Test for the presence of gap characters.

is.gap(x, gap.char = c("-", "."))

## Arguments

x an R object to be tested. Typically a sequence vector or sequence/structure alignment object as returned from seqaln, pdbaln etc. a character vector containing the gap character types to test for.

## Value

Returns a logical vector with the same length as the input vector, or the same length as the number of columns present in an alignment input object ‘x’. In the later case TRUE elements corresponding to ‘gap.char’ matches in any alignment column (i.e. gap containing columns).

## References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

Barry Grant

## Note

During alignment, gaps are introduced into sequences that are believed to have undergone deletions or insertions with respect to other sequences in the alignment. These gaps, often referred to as indels, can be represented with ‘NA’, ‘-’ or ‘.’ characters.

This function provides a simple test for the presence of such characters, or indeed any set of user defined characters set by the ‘gap.char’ argument.

gap.inspect, read.fasta, read.fasta.pdb, seqaln, pdbaln

## Examples


is.gap( c("G",".","X","-","G","K","S","T") )
#> [1] FALSE  TRUE FALSE  TRUE FALSE FALSE FALSE FALSE
if (FALSE) {
aln$ali[, !is.gap(aln) ] ##- Mask any existing gaps with an "X" xaln <- aln xaln$ali[ is.gap(xaln\$ali) ]="X"