strip.gaps.msa: MSA Strip Gaps

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/msa.R

Description

Strip gaps from an alignment.

Usage

1
strip.gaps.msa(x, strip.mode = 1)

Arguments

x

MSA object

strip.mode

Determines which gaps to strip. See Details

Details

If strip.mode can be a vector of integers or a vector of character strings. If it is a vector of integers, these are the indices of the sequences from which to strip gaps. If strip.mode is vector of character strings, each string names a sequence from which to strip gaps.

strip.mode can also be the string "all.gaps" or "any.gaps". The former will strip columns containing only gaps, whereas the latter strips columns containing even a single gap.

Value

an MSA object, with gaps stripped according to strip.mode.

Note

If x is passed as a pointer to a C structure (ie, it was created with pointer.only=TRUE), then this function will directly modify x. Use strip.gaps.msa(copy.msa(x)) to avoid this behavior. Also, the return value will be stored as a pointer if x is stored as a pointer; otherwise the return value will be stored in R.

Author(s)

Melissa J. Hubisz and Adam Siepel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
m <- msa(seqs=c("A--ACGTAT-", "AG-AGGTAA-", "AGGAGGTA--"),
         names=c("human", "mouse", "rat"))
print(strip.gaps.msa(m, c("human", "mouse")), print.seq=TRUE)
print(strip.gaps.msa(m, strip.mode="any.gaps"), print.seq=TRUE)
print(strip.gaps.msa(m, strip.mode="all.gaps"), print.seq=TRUE)
print(m, print.seq=TRUE)
#' NOTE if msa stored as pointer, original object is changed
m <- as.pointer.msa(m)
temp <- strip.gaps.msa(m, "any.gaps")
print(m, print.seq=TRUE)

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