Learn R Programming

bio3d (version 2.1-3)

read.all: Read Aligned Structure Data

Description

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

Usage

read.all(aln, prefix = "", pdbext = "", sel = NULL, ...)

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.
sel
a selection string detailing the atom type data to store (see function store.atom)
...
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.
  • allnumeric matrix of aligned equalvelent atom coordinates.
  • all.eletynumeric matrix of aligned atom element types.
  • all.residnumeric matrix of aligned three-letter residue codes.
  • all.resnonumeric matrix of aligned residue numbers.

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 file mypdbdir/1bg2.pdb should have the identifer mypdbdir/1bg2.pdb or 1bg2 if input prefix and pdbext equal mypdbdir/ and pdb. See the 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

Examples

Run this code
# still working on speeding this guy up
cat("")
## Read sequence alignment
file <- system.file("examples/kif1a.fa",package="bio3d")
aln  <- read.fasta(file)

## Read aligned PDBs storing all data for 'sel'
sel <- c("N", "CA", "C", "O", "CB", "*G", "*D",  "*E", "*Z")
pdbs <- read.all(aln, sel=sel)

atm <- colnames(pdbs$all)
ca.ind  <- which(atm == "CA")
core <- core.find(pdbs)
core.ind <- c( matrix(ca.ind, nrow=3)[,core$c0.5A.atom] )

## Fit structures
nxyz <- fit.xyz(pdbs$all[1,], pdbs$all,
               fixed.inds  = core.ind,
               mobile.inds = core.ind)

ngap.col <- gap.inspect(nxyz)

#npc.xray <- pca.xyz(nxyz[ ,ngap.col$f.inds])

#a <- mktrj.pca(npc.xray, pc=1, file="pc1-all.pdb",
#               elety=pdbs$all.elety[1,unique( ceiling(ngap.col$f.inds/3) )],
#               resid=pdbs$all.resid[1,unique( ceiling(ngap.col$f.inds/3) )],
#               resno=pdbs$all.resno[1,unique( ceiling(ngap.col$f.inds/3) )] )

Run the code above in your browser using DataLab