Learn R Programming

bio3d (version 2.1-2)

pdb2aln.ind: Mapping between PDB atomic indices and alignment positions

Description

Find the best alignment between a PDB structure and an existing alignment. Then, given a set of residue indices defined for the original alignment, return the equivalent CA atom indices in the PDB coordinates.

Usage

pdb2aln.ind(aln, pdb, inds, ...)

Arguments

aln
an alignment list object with id and ali components, similar to that generated by read.fasta, read.fasta.pdb, and
pdb
the PDB object.
inds
a numeric vector with a subset of the alignment position indices.
...
additional arguments for the function pdb2aln.

Value

  • Returns a numeric vector with the equivalent CA atomic indices.

Details

Call the function pdb2aln to align the PDB sequence to the existing alignment. Then find the equivalent CA atomic indices in PDB to inds.

References

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

See Also

seq2aln, seqaln.pair, pdb2aln

Examples

Run this code
##--- Read aligned PDB coordinates (CA only)
aln  <- read.fasta(system.file("examples/kif1a.fa",package="bio3d"))
pdbs <- read.fasta.pdb(aln)

##--- Read PDB coordinate for a new structure (all atoms)
id <- get.pdb("2kin", URLonly=TRUE)
pdb <- read.pdb(id)

# map the non-gap positions
gap.inds <- gap.inspect(pdbs$resno)
npc.inds <- pdb2aln.ind(aln=pdbs, pdb=pdb, id=id, inds=gap.inds$f.inds)

# If gaps are found in PDB sequence with the predefined indices,
# redefine the non-gap positions
ngap.f.inds <- gap.inds$f.inds[!is.na(npc.inds)]
npc.inds <- npc.inds[!is.na(npc.inds)]

##--- fit the atomic coordinates to the aligned X-ray structure
xyz <- fit.xyz(pdbs$xyz[1,], pdb$xyz, atom2xyz(ngap.f.inds), atom2xyz(npc.inds))

## seq2aln(pdbseq(pdb), aln, id = id)
## do we get the same result

Run the code above in your browser using DataLab