atom.select | R Documentation |
Return the ‘atom’ and ‘xyz’ coordinate indices of ‘pdb’ or ‘prmtop’ structure objects corresponding to the intersection of a hierarchical selection.
atom.select(...)
## S3 method for class 'pdb'
atom.select(pdb, string = NULL,
type = NULL, eleno = NULL, elety = NULL,
resid = NULL, chain = NULL, resno = NULL,
insert = NULL, segid = NULL,
operator = "AND", inverse = FALSE,
value = FALSE, verbose=FALSE, ...)
## S3 method for class 'pdbs'
atom.select(pdbs, string = NULL,
resno = NULL, chain = NULL, resid = NULL,
operator="AND", inverse = FALSE,
value = FALSE, verbose=FALSE, ...)
## S3 method for class 'mol2'
atom.select(mol, string=NULL,
eleno = NULL, elena = NULL, elety = NULL,
resid = NULL, chain = NULL, resno = NULL,
statbit = NULL,
operator = "AND", inverse = FALSE,
value = FALSE, verbose=FALSE, ...)
## S3 method for class 'prmtop'
atom.select(prmtop, ...)
## S3 method for class 'select'
print(x, ...)
... |
arguments passed to |
pdb |
a structure object of class |
pdbs |
a numeric matrix of aligned C-alpha xyz Cartesian
coordinates as obtained with |
string |
a single selection keyword from |
type |
a single element character vector for selecting ‘ATOM’ or ‘HETATM’ record types. |
eleno |
a numeric vector of element numbers. |
elena |
a character vector of atom names. |
elety |
a character vector of atom names. |
resid |
a character vector of residue name identifiers. |
chain |
a character vector of chain identifiers. |
resno |
a numeric vector of residue numbers. |
insert |
a character vector of insert identifiers. Non-insert
residues can be selected with |
segid |
a character vector of segment identifiers. Empty segid
values can be selected with |
operator |
a single element character specifying either the AND or OR operator by which individual selection components should be combined. Allowed values are ‘"AND"’ and ‘"OR"’. |
verbose |
logical, if TRUE details of the selection are printed. |
inverse |
logical, if TRUE the inversed selection is retured (i.e. all atoms NOT in the selection). |
value |
logical, if FALSE, vectors containing the (integer) indices of
the matches determined by |
mol |
a structure object of class |
statbit |
a character vector of statbit identifiers. |
prmtop |
a structure object of class |
x |
a atom.select object as obtained from
|
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"
, "sidechain"
, "protein"
,
"nucleic"
, "ligand"
, etc.) and individual named
selection components (including ‘chain’, ‘resno’,
‘resid’, ‘elety’ etc.).
For example, atom.select(pdb, "calpha")
will return indices for
all C-alpha (CA) atoms found in protein residues in the pdb
object, atom.select(pdb, "backbone")
will return indices
for all protein N,CA,C,O atoms, and atom.select(pdb, "cbeta")
for all protein N,CA,C,O,CB atoms.
Note that keyword string
shortcuts can be combined with individual
selection components, e.g. atom.select(pdb, "protein", chain="A")
will select all protein atoms found in chain A.
Selection criteria are combined according to the provided
operator
argument. The default operator AND
(or &
) will
combine by intersection while OR
(or |
) will take the union.
For example, atom.select(pdb, "protein", elety=c("N", "CA", "C"),
resno=65:103)
will select the N, CA, C atoms in the protein residues
65 through 103, while atom.select(pdb, "protein", resid="ATP",
operator="OR")
will select all protein atoms as well as any ATP
residue(s).
Other string
shortcuts include:
"calpha"
, "back"
, "backbone"
, "cbeta"
,
"protein"
, "notprotein"
, "ligand"
,
"water"
, "notwater"
, "h"
, "noh"
,
"nucleic"
, and "notnucleic"
.
In addition, the combine.select
function can further combine atom
selections using ‘AND’, ‘OR’, or ‘NOT’ logical
operations.
Returns a list of class "select"
with the following components:
atom |
a numeric matrix of atomic indices. |
xyz |
a numeric matrix of xyz indices. |
call |
the matched call. |
Protein atoms are defined as any atom in a residue matching the
residue name in the attached aa.table
data frame. See
aa.table$aa3
for a complete list of residue names.
Nucleic atoms are defined as all atoms found in residues with names A, U, G, C, T, I, DA, DU, DG, DC, DT, or DI.
Water atoms/residues are defined as those with residue names H2O, OH2, HOH, HHO, OHH, SOL, WAT, TIP, TIP, TIP3, or TIP4.
Barry Grant, Lars Skjaerven
Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.
read.pdb
, as.select
,
combine.select
, trim.pdb
,
write.pdb
, read.prmtop
,
read.crd
, read.dcd
,
read.ncdf
.
##- PDB example
# Read a PDB file
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )
# Select protein atoms of chain A
atom.select(pdb, "protein", chain="A")
# Select all atoms except from the protein
atom.select(pdb, "protein", inverse=TRUE, verbose=TRUE)
# Select all C-alpha atoms with residues numbers between 43 and 54
sele <- atom.select(pdb, "calpha", resno=43:54, verbose=TRUE)
# Access the PDB data with the selection indices
print( pdb$atom[ sele$atom, "resid" ] )
print( pdb$xyz[ sele$xyz ] )
# Trim PDB to selection
ca.pdb <- trim.pdb(pdb, sele)
## Not run:
##- PRMTOP example
prmtop <- read.prmtop(system.file("examples/crambin.prmtop", package="bio3d"))
## Atom selection
ca.inds <- atom.select(prmtop, "calpha")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.