Learn R Programming

rphast (version 1.0)

print.msa: Printing MSA objects

Description

Prints an MSA (multiple sequence alignment) object.

Usage

print.msa(x, ..., print.seq=ifelse(ncol.msa(x) * nrow.msa(x) < 500,
    TRUE, FALSE), format=NULL, pretty.print=FALSE)

Arguments

x
an object of class msa
...
additional arguments sent to print
print.seq
whether to supress printing of the alignment
format
to print sequence in if printing alignment
pretty.print
whether to pretty.print pretty-print sequence if printing alignment

Details

Valid formats for printing are "FASTA", "PHYLIP", "MPM", and "SS". See validFormatStr.msa for details on these formats. If format is specified, the alignment is printed regardless of print.seq.

Pretty-printing will cause all characters in a column which match the value in the first row to be printed as ".". It only works for FASTA, PHYLIP, or MPM formats.

If print.seq==TRUE, then the default printing format depends on whether the sequence is stored by value (the default storage mode), or by reference. If the MSA is stored by value, the default format is as a R character vector. Otherwise, the default format is FASTA.

Examples

Run this code
# read in an MSA stored in R
m <- msa(seqs=c("ACGTAT", "AGGTAA", "AGGTAG"),
         names=c("human", "mouse", "rat"))
print(m)
print(m, format="FASTA")
print(m, format="PHYLIP", pretty.print=TRUE)

# read in an MSA stored by reference in C
m <- msa(seqs=c("ACGTAT", "AGGTAA", "AGGTAG"),
         names=c("human", "mouse", "rat"),
         pointer.only=TRUE)
print(m)

Run the code above in your browser using DataLab