sub.msa: MSA Subset

Description Usage Arguments Value Note Author(s) Examples

View source: R/msa.R

Description

Get a subset of an alignment

Usage

1
2
sub.msa(x, seqs = NULL, keep = TRUE, start.col = NULL, end.col = NULL,
  refseq = NULL, pointer.only = FALSE)

Arguments

x

An object of type msa

seqs

The sequence names to keep (or to remove if keep is FALSE)

keep

Whether to keep the named sequences or remove them

start.col

the first column to keep (columns indices start at 1)

end.col

the last column to keep (inclusive)

refseq

A character string naming the sequence in the alignment which determines the coordinates for start.col and end.col. If NULL, start.col and end.col are column indices in the multiple alignment.

pointer.only

If TRUE, return an msa object which is only a pointer to a C structure (advanced use only).

Value

A new MSA object containing a subset of the original MSA.

Note

If x is stored as a pointer and represents an unordered alignment, it may be ordered after this call. Otherwise it will not be changed.

Author(s)

Melissa J. Hubisz and Adam Siepel

Examples

1
2
3
4
5
6
7
m <- msa(seqs=c("ACGT---AT", "AGGTAGTAA", "AGGAAGTAG"),
         names=c("human", "mouse", "rat"))
print(sub.msa(m, c("human", "rat"), start.col=3, end.col=6),
      print.seq=TRUE)
print(sub.msa(m, c("mouse"), keep=FALSE, refseq="human",
              start.col=3, end.col=4),
      print.seq=TRUE)

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