atom2ele(...)"atom2ele"(x, elety.custom=NULL, rescue=TRUE, ...)"atom2ele"(pdb, inds, elety.custom=NULL, rescue=TRUE, ...)
elety
will
be converted.pdb
object to be used (see atom.select
and
trim.pdb
).Convert atom names/types into atomic symbols
The default method searchs for the atom names/types in the
atom.index
data set and returns their corresponding atomic
symbols. If elety.custom
is specified it is combined with
atom.index
(using rbind
) before
searching. Therefore, elety.custom
must contains columns named
name
and symb
.
The S3 method for object of class pdb, pass
pdb$atom[,"elety"]
to the default method.
atom.names <- c("CA", "O", "N", "OXT") atom2ele(atom.names)[1] "C" "O" "N" "O"# PDB server connection required - testing excluded ## Get atomic symbols from a PDB object with a customized data set pdb <- read.pdb("3RE0",verbose=FALSE)Note: Accessing on-line PDB file PDB has ALT records, taking A only, rm.alt=TRUEinds <- atom.select(pdb, resno=201, verbose=FALSE) ## maps CL2 to C atom2ele(pdb, inds, elety.custom = NULL)Warning message: unknown element: mapped PT1 to P unknown element: mapped N1 to N unknown element: mapped N2 to N unknown element: mapped CL2 to C[1] "P" "N" "N" "C"## map CL2 to Cl manually myelety <- data.frame(name = "CL2", symb = "Cl") atom2ele(pdb, inds, elety.custom = myelety)Warning message: unknown element: mapped PT1 to P unknown element: mapped N1 to N unknown element: mapped N2 to N[1] "P" "N" "N" "Cl"