Learn R Programming

rphast (version 1.6.9)

strip.gaps.msa: MSA Strip Gaps

Description

Strip gaps from an alignment.

Usage

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

Arguments

x

MSA object

strip.mode

Determines which gaps to strip. See Details

Value

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

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.

Examples

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

Run the code above in your browser using DataLab