Learn R Programming

bio3d (version 2.1-3)

read.fasta.pdb: Read Aligned Structure Data

Description

Read aligned PDB structures and store their C-alpha atom data, including xyz coordinates, residue numbers, residue type and B-factors.

Usage

read.fasta.pdb(aln, prefix = "", pdbext = "", fix.ali = FALSE,
             ncore = 1, nseg.scale = 1, ...)

Arguments

aln
an alignment data structure obtained with read.fasta.
prefix
prefix to aln$id to locate PDB files.
pdbext
the file name extention of the PDB files.
fix.ali
logical, if TRUE check consistence between $ali and $resno, and correct $ali if they don't match.
ncore
number of CPU cores used to do the calculation. ncore>1 requires package parallel installed.
nseg.scale
split input data into specified number of segments prior to running multiple core calculation. See fit.xyz.
...
other parameters for read.pdb.

Value

  • Returns a list of class "pdbs" with the following five components:
  • xyznumeric matrix of aligned C-alpha coordinates.
  • resnocharacter matrix of aligned residue numbers.
  • bnumeric matrix of aligned B-factor values.
  • chaincharacter matrix of aligned chain identifiers.
  • idcharacter vector of PDB sequence/structure names.
  • alicharacter matrix of aligned sequences.
  • residcharacter matrix of aligned 3-letter residue names.
  • callthe matched call.

Details

The input aln, produced with read.fasta, must have identifers (i.e. sequence names) that match the PDB file names. For example the sequence corresponding to the structure 1bg2.pdb should have the identifer 1bg2. See examples below. Sequence miss-matches will generate errors. Thus, care should be taken to ensure that the sequences in the alignment match the sequences in their associated PDB files.

References

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

See Also

read.fasta, read.pdb, core.find, fit.xyz, read.all

Examples

Run this code
# Read sequence alignment
file <- system.file("examples/kif1a.fa",package="bio3d")
aln  <- read.fasta(file)

# Read aligned PDBs
pdbs <- read.fasta.pdb(aln)

# Structure/sequence names/ids
basename( pdbs$id )

# Alignment positions 335 to 339
pdbs$ali[,335:339]
pdbs$resid[,335:339]
pdbs$resno[,335:339]
pdbs$b[,335:339]

# Alignment C-alpha coordinates for these positions
pdbs$xyz[, atom2xyz(335:339)]

# See 'fit.xyz()' function for actual coordinate superposition
#  e.g. fit to first structure
# xyz <- fit.xyz(pdbs$xyz[1,], pdbs)
# xyz[, atom2xyz(335:339)]

Run the code above in your browser using DataLab