Learn R Programming

bio3d (version 2.1-2)

atom.select: Atom Selection From PDB Structure

Description

Return the atom and xyz coordinate indices of a pdb structure object corresponding to the intersection of a hierarchical selection.

Usage

atom.select(pdb, string=NULL, chain=NULL, resno=NULL, resid=NULL,
eleno=NULL, elety=NULL, type=NULL, verbose=TRUE, rm.insert=FALSE)
## S3 method for class 'select':
print(x, \dots)

Arguments

pdb
a structure object of class "pdb", obtained from read.pdb.
string
a character selection string with the following syntax: /segid/chain/resno/resid/eleno/elety/. Or a single selection keyword from calpha cbeta backbone protein notprotein <
chain
a character vector of chain identifiers.
resno
a numeric or character vector of residue numbers.
resid
a character vector of residue name identifiers.
eleno
a numeric or character vector of element numbers.
elety
a character vector of atom names.
type
a single element character vector for selecting ATOM or HETATM record types.
verbose
logical, if TRUE details of the selection are printed.
rm.insert
logical, if TRUE insert ATOM records from the pdb object are ignored.
x
a atom.select object as obtained from atom.select.
...
additional arguments to print. Currently ignored.

Value

  • Returns a list of class "select" with components:
  • atomatom indices of selected atoms.
  • xyzxyz indices of selected atoms.

Details

This function allows for the selection of atom and coordinate data corresponding to the intersection of various input criteria.

Input selection criteria include selection string keywords (such as "calpha", "backbone", "protein", "ligand", etc.) and individual named selection components (including chain, resno, resid, elety etc.). For example, atom.select(pdb, "calpha") or atom.select(pdb, elety="CA"), which in this case are equivalent.

Alternatively, a single element character vector containing a hierarchical selection string, string, with a strict format composed of six sections separated by a / character can be used. Each section of this selection string corresponds to a different level in the PDB structure hierarchy, namely: (1) segment identifier, (2) chain identifier, (3) residue number, (4) residue name, (5) element number, and (6) element name.

For example, the string //A/65:143///CA/ selects all C-alpha atoms from residue numbers 65 to 143, of chain A.

A simpler alternative would be atom.select(pdb, chain="A", resno=65:143, elety="CA").

More typical use is through keyword string shortcuts "calpha", "back", "backbone", "cbeta", "protein", "notprotein", "ligand", "water", "notwater", "h" and "noh".

Note that keyword string shortcuts can be combined with individual selection components, e.g. atom.select(pdb, "protein", chain="A"). See below for further examples.

In addition, the combine.sel function can further combine atom selections using and, or, or not logical operations.

When called without selection criteria, atom.select will print a summary of pdb makeup.

References

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

See Also

combine.sel, read.pdb, write.pdb, read.dcd

Examples

Run this code
# Read a PDB file
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )

# Print structure summary
atom.select(pdb)

# Select all C-alpha atoms with residues numbers between 43 and 54
ca.inds <- atom.select(pdb, "calpha", resno=43:54)
print( pdb$atom[ ca.inds$atom, "resid" ] )
print( pdb$xyz[ ca.inds$xyz ] )

# Select all C-alphas
ca.inds <- atom.select(pdb, "calpha")

# String examples (see above).
ca.inds <- atom.select(pdb, "///43:54///CA/")
inds <- atom.select(pdb, "///107:118///N,CA,C,O/")

Run the code above in your browser using DataLab