Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reindex

Reinitialize Object Indexing


Description

Reinitialize the indexing of an object.

Usage

reindex(...)

## S3 method for class 'atoms'
reindex(x, eleid = TRUE, resid = TRUE, ...)

## S3 method for class 'pdb'
reindex(x, eleid = TRUE, resid = TRUE, ...)

Arguments

x

an R object.

eleid

a single element logical vector indicating if elements IDs have to reindexed.

resid

a single element logical vector indicating if residues IDs have to reindexed.

...

further arguments passed to or from other methods.

Details

reindex is a generic function to reinitialize the indexing of an object or its components. The methods for objects of class ‘atoms’ reinitialize the residue and element IDs starting from 1 and avoiding gaps in the indexes. For objects of class ‘pdb’ their atoms and conect components are reindexed consistently.

Value

Return an object of the same class as x with updated indexes.

See Also

Examples

x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
x <- subset(x, x$atoms$eleid \%in\% sample(x$atoms$eleid, 10))
print(x)
x <- reindex(x)
print(x)

Rpdb

Read, Write, Visualize and Manipulate PDB Files

v2.3
GPL
Authors
Julien Idé
Initial release
2014-02-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.