Learn R Programming

bio3d (version 2.3-0)

trim: 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(...)
"trim"(pdb, ..., inds = NULL, sse = TRUE)

Arguments

pdb
a PDB structure object obtained from read.pdb.
...
additional arguments passed to atom.select. If inds is also provided, these arguments will be ignored.
inds
a list object of ATOM and XYZ indices as obtained from atom.select. If NULL, atom selection will be obtained from calling atom.select(pdb, ...).
sse
logical, if ‘FALSE’ helix and sheet components are omitted from output.

Value

Returns a list of class "pdb" with the following components:

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

trim.pdbs, trim.xyz, read.pdb, atom.select

Examples

Run this code
## 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)

Run the code above in your browser using DataLab