如何将DNAbin转换为DNAStringSet?

时间:2017-05-28 07:55:00

标签: r bioinformatics bioconductor

我正试图通过以下代码在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

1 个答案:

答案 0 :(得分:1)

您可以通过

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

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

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