print.msa: Printing MSA objects

Description Usage Arguments Details Author(s) Examples

View source: R/msa.R

Description

Prints an MSA (multiple sequence alignment) object.

Usage

1
2
3
## S3 method for class 'msa'
print(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 is.format.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.

Author(s)

Melissa J. Hubisz and Adam Siepel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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)

Example output

msa object with 3 sequences and 6 columns, stored in R
$names
[1] "human" "mouse" "rat"  

$alphabet
[1] "ACGT"

$is.ordered
[1] TRUE

$seq
[1] "ACGTAT" "AGGTAA" "AGGTAG"

msa object with 3 sequences and 6 columns, stored in R
$names
[1] "human" "mouse" "rat"  

$alphabet
[1] "ACGT"

$is.ordered
[1] TRUE

$seq
> human
ACGTAT
> mouse
AGGTAA
> rat
AGGTAG

msa object with 3 sequences and 6 columns, stored in R
$names
[1] "human" "mouse" "rat"  

$alphabet
[1] "ACGT"

$is.ordered
[1] TRUE

$seq
  3 6
human     
ACGTAT
mouse     
.G...A
rat       
.G...G

msa object with 3 sequences and 6 columns, stored as a pointer to a C structure
$names
[1] "human" "mouse" "rat"  

$alphabet
[1] "ACGT"

$is.ordered
[1] TRUE

$seq
> human
ACGTAT
> mouse
AGGTAA
> rat
AGGTAG

rphast documentation built on May 1, 2019, 9:26 p.m.