Outputting a multiple alignment to file error: could not find function write.XStringSet
1
0
Entering edit mode
cmdcolin ▴ 10
@cmdcolin-12337
Last seen 4.9 years ago



library(msa)
library(Biostrings)

x="ATGC"
y="ATGA"
z=msa(c(x,y), type="dna")
write.XStringSet(z)



Error: could not find function "write.XStringSet"

msa • 839 views
2
Entering edit mode
UBodenhofer ▴ 290
@ubodenhofer-5425
Last seen 12 weeks ago
University of Applied Sciences Upper Au…

The correct name of the function is 'writeXStringSet' (without period). I don't recall precisely when the function name was changed, but I think it was several Bioconductor releases ago. The correct usage is the following:

writeXStringSet(unmasked(z), file="test.fasta")

The function 'unmasked' makes the conversion to an 'XStringSet' object; moreover, the file argument was missing in your example.