Subsetting ‘atoms’ and ‘pdb’ Objects
Return subsets of ‘atoms’ or ‘pdb’ objects which meet conditions.
## S3 method for class 'atoms' subset(x, subset, drop = FALSE, reindex.all = TRUE, ...) ## S3 method for class 'pdb' subset(x, subset, drop = FALSE, reindex.all = TRUE, ...)
x |
object to be subsetted. |
subset |
logical expression indicating elements or rows to keep: missing values are taken as false. |
drop |
passed on to [ indexing operator. |
reindex.all |
a single element logical vector indicating if residues and elements IDs have to be reindexed after subsetting. |
... |
further arguments to be passed to or from other methods. |
For a ‘atoms’ object the method is similar to the data.frame method
(see subset
) but allow to directly reindex the elements and
residues IDs. For a ‘pdb’ object subsetting is apply on the
atoms
and conect
components of the object in a consistent way.
First the atoms
component is subsetted and then the conect
component is filtered to keep only the conectivity for the subset.
Return a subsetted object of the same class as x
.
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb")) y <- subset(x, x$atoms$eleid \%in\% sample(x$atoms$eleid, 10)) is(y) y <- subset(x$atoms, x$atoms$eleid \%in\% sample(x$atoms$eleid, 10)) is(y) x <- coords(x) y <- subset(x, x < 0) is(y)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.