Question: How to get msa output in fasta format
0
15 months ago by
cav3gh0
cav3gh0 wrote:

My current code is :

myFirstAlignment <- msaClustalOmega(mySequences)

msaPrettyPrint(myFirstAlignment, output=c("pdf", "tex", "dvi", "asis"))

msaPrettyPrint says that its first writes to a fasta file but does not include that as an output option, is there anyway to get that fasta file?  I am trying to use phangorn to create phylogenetic trees in downstream analysis.

msa msaprettyprint() • 340 views
modified 15 months ago by UBodenhofer250 • written 15 months ago by cav3gh0
Answer: How to get msa output in fasta format
2
15 months ago by
Mike Smith3.8k
EMBL Heidelberg / de.NBI
Mike Smith3.8k wrote:

You can use the argument alFile = /path/to/a/file.fasta to specify the location of the generated alignment file e.g.

msaPrettyPrint(myFirstAlignment, output=c("pdf", "tex", "dvi", "asis"), alFile = "/tmp/alignment.fasta")


Note that it has to have the file extension .fasta otherwise it throws an error.

Answer: How to get msa output in fasta format
0
15 months ago by
UBodenhofer250
Johannes Kepler University, Linz, Austria
UBodenhofer250 wrote:

If you do not want to make the extra way via the msaPrettyPrint() function, you can also directly write to a FASTA file in the following way (which is actually what msaPrettyPrint() does internally; suppose 'aln' is an object containing a multiple alignment):

writeXStringSet(as(unmasked(aln), "XStringSet"), file="aln.fasta")