Learn R Programming

rphast (version 1.0)

write.msa: Writing MSA Objects to Files

Description

Writes a multiple sequence alignment (MSA) object to a file in one of several formats.

Usage

write.msa(msa, filename=NULL, format=c(guess.format.msa(filename),
    "FASTA")[1], pretty.print=FALSE)

Arguments

msa
an object of class msa
filename
File to write (will be overwritten). If NULL, output goes to terminal.
format
format to write MSA object. Valid values are "FASTA", "PHYLIP", "MPM", or "SS".
pretty.print
Whether to pretty-print alignment (turning bases which match the first base in the same column to ".").

Examples

Run this code
m <- msa(seqs=c("ACGTAT", "AGGTAA", "AGGTAG"),
         names=c("human", "mouse", "rat"))
write.msa(m, "foo.ss")
write.msa(m, "foo.fa", pretty.print=TRUE)
write.msa(m, NULL, format="PHYLIP", pretty.print=TRUE)

#clean up
unlink("foo.ss")
unlink("foo.fa")

Run the code above in your browser using DataLab