Learn R Programming

bio3d (version 2.1-2)

trim.pdb: Trim a PDB Object To A Subset of Atoms.

Description

Produce a new smaller PDB object, containing a subset of atoms, from a given larger PDB object.

Usage

trim.pdb(pdb, inds = NULL, sse = TRUE)

Arguments

pdb
a PDB structure object obtained from read.pdb.
inds
a list object of ATOM and XYZ indices as obtained from atom.select.
sse
logical, if FALSE helix and sheet components are omitted from output.

Value

  • Returns a list of class "pdb" with the following components:
  • atoma character matrix containing all atomic coordinate ATOM data, with a row per ATOM and a column per record type. See below for details of the record type naming convention (useful for accessing columns).
  • heta character matrix containing atomic coordinate records for atoms within non-standard HET groups (see atom).
  • helixstart, end and length of H type sse, where start and end are residue numbers resno.
  • sheetstart, end and length of E type sse, where start and end are residue numbers resno.
  • seqressequence from SEQRES field.
  • xyza numeric vector of ATOM coordinate data.
  • xyz.modelsa numeric matrix of ATOM coordinate data for multi-model PDB files.
  • calphalogical vector with length equal to nrow(atom) with TRUE values indicating a C-alpha elety.

Details

This is a basic utility function for creating a new PDB object based on a selection of atoms.

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696. For a description of PDB format (version3.3) see: http://www.wwpdb.org/documentation/format33/v3.3.html. .

See Also

read.pdb, atom.select, write.pdb

Examples

Run this code
## Read a PDB file from the RCSB online database
pdb <- read.pdb("1bg2")

## Select calpha atoms
sele <- atom.select(pdb, "calpha")

## Trim PDB
new.pdb <- trim.pdb(pdb, inds=sele)

## Write to file
write.pdb(new.pdb, file="calpha.pdb")

Run the code above in your browser using DataLab