is.distances(x)distances(...) "distances"(dx1 = numeric(0), dx2 = numeric(0), dx3 = numeric(0), basis = "xyz", ...) "distances"(x, sel1, sel2, ...) "distances"(x, sel1, sel2, ...) "distances"(x, sel1, sel2, ...)norm(...) "norm"(x, type = "xyz", ...)
distancefunction return an object of class distances containing inter-atomic distance vectors. The
normfunction return an array, with the same dimensions as the
dx3components of the distances object for which the norms have to be computed, containing the norm of the distance vectors.
is.distancesreturns TRUE if x is an object of class distances and FALSE otherwise
distancesfunction is actually a builder allowing to create a distances object from its different components, i.e.:
basis. All the arguments have to be specified except 'basis' which by default is set to "xyz" (Cartesian reference).
For objects of class coords, atoms, pdb, two sets of atomic coordinates, defined by
sel2, are extracted and inter-atomic distance vectors are computed between these two sets.
The method of the
norm function for objects of class distances computes the norm of the distances vectors.
type specify how to project the distance vectors before computing the norms. By default no projection is perform. The three dx, dy, and dz components of the distance vectors are used to compute the norm.
type can take the following values:
is.distances tests if x is an object of class distances, i.e. if x has a class attribute equal to
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb")) is.DCB7 <- x$atoms$resname == "DCB" & x$atoms$resid == 7 is.DCB8 <- x$atoms$resname == "DCB" & x$atoms$resid == 8 d <- distances(x, is.DCB7, is.DCB8) norm(d, type = "xyz") norm(d, type = "xy") norm(d, type = "x")