is.gap {bio3d} | R Documentation |
Test for the presence of gap characters.
is.gap(x, gap.char = c("-", "."))
x |
an R object to be tested. |
gap.char |
a character vector containing the gap character types to test for. |
Returns a logical vector with the same length as the input ‘x’, with TRUE elements corresponding to ‘gap.char’ matches.
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.
Barry Grant
Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.
gap.inspect
, read.fasta
,
read.fasta.pdb
, seqaln
is.gap( c("G",".","X","-","G","K","S","T") ) ## Not run: aln <- read.fasta( system.file("examples/kinesin_xray.fa", package = "bio3d") ) ##- Mask gaps with an "X" xaln <- aln xaln$ali[ is.gap(xaln$ali) ]="X" ##- Read a PDB and align its sequence to the existing alignment pdb <- read.pdb( system.file("examples/1bg2.pdb", package="bio3d") ) pdbseq <- aa321(pdb$atom[pdb$calpha,"resid"]) seqaln.pair(seqbind(xaln$ali[1,], pdbseq)) ## End(Not run)