pdb2aln.Rd
Extract sequence from a PDB object and align it to an existing multiple sequence alignment that you wish keep intact.
pdb2aln(aln, pdb, id="seq.pdb", aln.id=NULL, file="pdb2aln.fa", ...)
aln | an alignment list object with |
---|---|
pdb | the PDB object to be added to |
id | name for the PDB sequence in the generated new alignment. |
aln.id | id of the sequence in |
file | output file name for writing the generated new alignment. |
... | additional arguments passed to |
The basic effect of this function is to add a PDB sequence to an existing
alignement. In this case, the function is simply a wrapper of
seq2aln
.
The more advanced (and also more useful) effect is giving complete mappings
from the column indices of the original alignment (aln$ali
) to
atomic indices of equivalent C-alpha atoms in the pdb
. These mappings
are stored in the output list (see below 'Value' section). This feature
is better illustrated in the function pdb2aln.ind
, which
calls pdb2aln
and directly returns atom selections given a set of
alignment positions. (See pdb2aln.ind
for details. )
When aln.id
is provided, the function will do pairwise alignment
between the sequence from pdb
and the sequence in aln
with id matching aln.id
. This is the best way to use the
function if the protein has an identical or very similar sequence
to one of the sequences in aln
.
Return a list object of the class 'fasta' containing three components:
sequence names as identifers.
an alignment character matrix with a row per sequence and a column per equivalent aminoacid/nucleotide.
an integer 2xN matrix, where N is the number of columns of
the new alignment ali
. The first row contains the column indices of
the original alignment aln$ali
. The second row contains atomic
indices of equivalent C-alpha atoms in pdb
. Gaps in the new
alignement are indicated by NAs.
Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.
Xin-Qiu Yao & Barry Grant
if (FALSE) { ##--- 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) # add pdb to the alignment naln <- pdb2aln(aln=pdbs, pdb=pdb, id=id) naln }