Last chance! 50% off unlimited learning
Sale ends in
Report the number of gaps per sequence and per position for a given alignment.
gap.inspect(x)
a matrix or an alignment data structure obtained from
read.fasta
or read.fasta.pdb
.
Returns a list object with the following components:
a numeric vector detailing the number of gaps per row (i.e. sequence).
a numeric vector detailing the number of gaps per column (i.e. position).
indices for gap containing coloums
indices for non-gap containing coloums
a binary numeric matrix with the same dimensions as the
alignment
, with 0 at non-gap positions and 1 at gap
positions.
Reports the number of gap characters per row (i.e. sequence) and
per column (i.e. position) for a given alignment
. In addition,
the indices for gap and non-gap containing coloums are returned along
with a binary matrix indicating the location of gap positions.
Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.
# NOT RUN {
aln <- read.fasta( system.file("examples/hivp_xray.fa",
package = "bio3d") )
gap.stats <- gap.inspect(aln$ali)
gap.stats$row # Gaps per sequence
gap.stats$col # Gaps per position
##gap.stats$bin # Binary matrix (1 for gap, 0 for aminoacid)
##aln[,gap.stats$f.inds] # Alignment without gap positions
plot(gap.stats$col, typ="h", ylab="No. of Gaps")
# }
Run the code above in your browser using DataLab