Learn R Programming

rphast (version 1.6.9)

sub.msa: MSA Subset

Description

Get a subset of an alignment

Usage

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.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab