【问题标题】:How to convert DNAbin to DNAStringSet?如何将 DNAbin 转换为 DNAStringSet?
【发布时间】:2017-07-07 07:35:34
【问题描述】:

我正在尝试使用此代码从 R 中获得猿的对齐方式:

library(muscle)
#https://bioconductor.org/packages/release/bioc/html/muscle.html 

muscle(x, exec = "muscle", MoreArgs = "", quiet = TRUE)

但是控制台说:

 Error in muscle(x, exec = "muscle", MoreArgs = "",  : 
input must be an object of class XStringSet: DNAStringSet, RNAStringSet, or AAStringSet

【问题讨论】:

  • 请将您希望强制转换的数据添加到 DNAStringSet 以及到目前为止您尝试过的方法都不起作用。
  • 你的意思是DNAbin 来自ape 包吗?在那种情况下,我相信你需要走DNAbin → as.character → DNAStringSet 的路线。

标签: r bioinformatics bioconductor


【解决方案1】:

您可以通过

将任何 DNAbin 转换为 DNAStringSet
library(magrittr)

yourDNAbin %>% as.character %>% lapply(.,paste0,collapse="") %>% unlist %>% DNAStringSet

如果您的 DNAbin 是: xxx DNA 序列以二进制格式存储在列表中。 如果它存储在一个矩阵中,首先列出它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-17
    • 1970-01-01
    • 2010-09-08
    • 2013-09-21
    • 2011-05-14
    相关资源
    最近更新 更多