atom.select {bio3d} | R Documentation |
Return the atom and xyz coordinates indices of a ‘pdb’ structure object corresponding to the intersection of a hierarchical selection string.
atom.select(pdb, string=NULL, chain=NULL, resno=NULL, resid=NULL, eleno=NULL, elety=NULL, verbose=TRUE, rm.insert=FALSE) pdb.summary(pdb)
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/ . |
chain |
a character vector of chain identifers. |
resno |
a numeric or character vector of residue numbers. |
resid |
a character vector of chain identifers. |
eleno |
a numeric or character vector of element numbers. |
elety |
a character vector of atom names. |
verbose |
logical, if TRUE details of the selection are printed. |
rm.insert |
logical, if TRUE insert ATOM records from the
pdb object are ignored. |
This function allows for the selection of atom and coordinate data
corresponding to the intersection of a hierarchical ‘selection string’
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
.
Returns a list of class "selection"
with components:
atom |
atom indices of selected atoms. |
xyz |
xyz indices of selected atoms. |
Barry Grant
Grant, B.J. et al. (2006) Bioinformatics 22, 2695–2696.
# 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)