| merge.coords | R Documentation |
Merge two objects containing atomic coordinates
## S3 method for class 'coords'
merge(x, y, ...)
## S3 method for class 'atoms'
merge(x, y, reindex = TRUE, ...)
## S3 method for class 'pdb'
merge(x, y, reindex = TRUE, ...)
## S3 method for class 'pdb.hetero'
merge(x, y, ...)
## S3 method for class 'pdb.structure'
merge(x, y, ...)
## S3 method for class 'pdb.resolution'
merge(x, y, ...)
x, y |
objects of class |
... |
further arguments passed to or from other methods. |
reindex |
a single element logical vector indicating if residue and element IDs have to be reindexed after merging. |
To merge x and y they must have the same basis
attributes (see basis).
For objects of class ‘coords’ and ‘atoms’
the atomic coordinates are directly merged by row.
For objects of class ‘pdb’,
the atoms and connect components of the two pdb objects
are merged by row and the crystal component of x is used
to build the returned object.
For objects of class ‘atoms’ and ‘pdb’
the residue and element IDs of y are shifted to avoid any confusion
with those of x. If reindex == TRUE the reindex function
is called to reinitialize the indexing of the returned object.
The functions of type ‘pdb.hetero’, ‘pdb.structure’ and
‘pdb.resolution’ merge the corresponding pdb fields.
Return an object of the same class as x and y
merging x and y.
Note: x and y must have the same basis attributes,
otherwise an error is returned.
coords, atoms, pdb,
basis, merge, merge.data.frame
c1 <- coords( 1:3 , 4:6 , 7:9 , basis = "xyz")
c2 <- coords(10:12, 13:15, 16:18, basis = "xyz")
merge(c1,c2)
## Merging objects with different basis sets returns an error.
c2 <- coords(9:11, 12:14, 15:17, basis = "abc")
try(merge(c1,c2))
## Prepare a Pentacene/C70 dimer
C70 <- read.pdb(system.file("examples/C70.pdb", package="Rpdb"))
Pen <- read.pdb(system.file("examples/Pentacene.pdb", package="Rpdb"))
x <- merge(Tz(C70, 3.5, thickness=0.5), Pen)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.