Learn R Programming

bio3d (version 2.1-2)

is.gap: Gap Characters

Description

Test for the presence of gap characters.

Usage

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

Arguments

x
an R object to be tested.
gap.char
a character vector containing the gap character types to test for.

Value

  • Returns a logical vector with the same length as the input x, with TRUE elements corresponding to gap.char matches.

References

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

See Also

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

Examples

Run this code
is.gap( c("G",".","X","-","G","K","S","T") )

aln <- read.fasta( system.file("examples/kif1a.fa",
                   package = "bio3d") )

##- Mask existing gaps with an "X"
xaln <- aln
xaln$ali[ is.gap(xaln$ali) ]="X"

##- Read a new PDB and align its sequence to the existing alignment
pdb <- read.pdb( "1mkj" )
seq2aln(pdbseq(pdb), xaln, id = "1mkj")

Run the code above in your browser using DataLab