trim | R Documentation |
Produce a new smaller PDB object, containing a subset of atoms, from a given larger PDB object.
trim(...)
## S3 method for class 'pdb'
trim(pdb, ..., inds = NULL, sse = TRUE)
pdb |
a PDB structure object obtained from
|
... |
additional arguments passed to |
inds |
a list object of ATOM and XYZ indices as obtained from
|
sse |
logical, if ‘FALSE’ helix and sheet components are omitted from output. |
This is a basic utility function for creating a new PDB object based on a selection of atoms.
Returns a list of class "pdb"
with the following components:
atom |
a 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). |
het |
a character matrix containing atomic coordinate records
for atoms within “non-standard” HET groups (see |
helix |
‘start’, ‘end’ and ‘length’ of H type sse, where start and end are residue numbers “resno”. |
sheet |
‘start’, ‘end’ and ‘length’ of E type sse, where start and end are residue numbers “resno”. |
seqres |
sequence from SEQRES field. |
xyz |
a numeric vector of ATOM coordinate data. |
xyz.models |
a numeric matrix of ATOM coordinate data for multi-model PDB files. |
calpha |
logical vector with length equal to |
het
and seqres
list components are returned unmodified.
For both atom
and het
list components the column names can be
used as a convenient means of data access, namely:
Atom serial number “eleno”,
Atom type “elety”,
Alternate location indicator “alt”,
Residue name “resid”,
Chain identifier “chain”,
Residue sequence number “resno”,
Code for insertion of residues “insert”,
Orthogonal coordinates “x”,
Orthogonal coordinates “y”,
Orthogonal coordinates “z”,
Occupancy “o”, and
Temperature factor “b”.
See examples for further details.
Barry Grant, Lars Skjaerven
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.
.
trim.pdbs
, trim.xyz
,
read.pdb
, atom.select
## Not run:
## 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)
## Or, simply
#new.pdb <- trim.pdb(pdb, "calpha")
## Write to file
write.pdb(new.pdb, file="calpha.pdb")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.