natom: Number of Atoms in an Object Containing Atomic Coordinates
Description
Evaluates the number of atoms in an object containing atomic coordinates.
Usage
natom(x, ...)
# S3 method for coords
natom(x, factor = NULL, ...)
# S3 method for atoms
natom(x, factor = NULL, ATOM = TRUE, HETATM = TRUE, ...)
# S3 method for pdb
natom(x, factor = NULL, ATOM = TRUE, HETATM = TRUE, ...)
Value
Return an integer or a vector of integer of lenght equal to
nlevels(factor) (if factor is specify) indication the number
of atoms in the object or in the groups defined by factor.
Arguments
x
an R object containing atomic coordinates.
...
further arguments passed to or from other methods.
factor
a factor used to split the object and evaluate the number of atoms
in each group.
ATOM
a single element logical vector indicating if ATOM records have
to be considered or not.
HETATM
a single element logical vector indicating if HETATM records
have to be considered or not.
Details
natom is a generic function to evalute the number of atom in an object
containing atomic coordinates. The atomic coordinates of the object are first
filtered to keep ATOM and/or HETATM records as indicated by the 'ATOM' and
'HETATM' arguments. Then, if factor is specify, the object is splitted
to evalute the number of atoms in each group defined by factor. If
factor is not specify then the total number of atoms in the object is
return.