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", ...)

Arguments

aln

an alignment list object with id and ali components, similar to that generated by read.fasta, read.fasta.pdb, and seqaln.

pdb

the PDB object to be added to aln.

id

name for the PDB sequence in the generated new alignment.

aln.id

id of the sequence in aln that is close to the sequence from pdb.

file

output file name for writing the generated new alignment.

...

additional arguments passed to seqaln.

Details

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.

Value

Return a list object of the class 'fasta' containing three components:

id

sequence names as identifers.

ali

an alignment character matrix with a row per sequence and a column per equivalent aminoacid/nucleotide.

ref

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.

References

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

Author

Xin-Qiu Yao & Barry Grant

See also

seqaln, seq2aln, seqaln.pair, pdb2aln.ind

Examples

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 }