atom.select {bio3d}R Documentation

Atom Selection From PDB Structure

Description

Return the atom and xyz coordinates indices of a ‘pdb’ structure object corresponding to the intersection of a hierarchical selection string.

Usage

atom.select(pdb, string=NULL, verbose=TRUE, rm.insert=FALSE)
pdb.summary(pdb)

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/.
verbose logical, if TRUE details of the selection are printed.
rm.insert logical, if TRUE insert ATOM records from the pdb object are ignored.

Details

This function allows for the selection of atom and coordinate data corresponding to the intersection of a hierarchical ‘selection string’ with a strict format.

The selection string should be a single element character vector containing a string composed of six sections separated by a ‘/’ character.

Each section of this ‘selection string’ corresponds to a different level in the PDB structure hierarchy, namely: (1) segment identifer, (2) chain identifer, (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.

The character string shortcuts "calpha", "back", "backbone", "cbeta", "h" and "noh" may also be used.

When called without a selection string, atom.select will print a summary of pdb makeup. pdb.summary is a simple alias to atom.select with string=NULL and verbose=T.

Value

Returns a list of class "selection" with components:

atom atom indices of selected atoms.
xyz xyz indices of selected atoms.

Author(s)

Barry Grant

References

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

See Also

read.pdb, write.pdb, read.dcd

Examples


# Read a PDB file
kin <- system.file("examples/1bg2.pdb", package = "bio3d")
pdb <- read.pdb(kin)

# Print structure summary
atom.select(pdb)

# Select all C-alpha atoms with residues numbers between 65 and 143
ca.inds <- atom.select(pdb, "///65:143///CA/")
print( pdb$atom[ ca.inds$atom, "resid" ] )
print( pdb$xyz[ ca.inds$xyz ] )
## Not run: 
# Select all C-alphas
ca.inds <- atom.select(pdb, "calpha")

# Another example
inds <- atom.select(pdb, "///130:142///N,CA,C,O/")
## End(Not run)

[Package bio3d version 1.0-5 Index]