coords(...)
coords(x) <- value
is.coords(x)## S3 method for class 'default':
coords(x1, x2, x3, basis = "xyz", \dots)
## S3 method for class 'atoms':
coords(x, \dots)
## S3 method for class 'atoms':
coords(x) <- value
## S3 method for class 'pdb':
coords(x, \dots)
## S3 method for class 'pdb':
coords(x) <- value
## S3 method for class 'data.frame':
coords(x, basis = NULL, \dots)
## S3 method for class 'matrix':
coords(x, basis = NULL, \dots)
basis attribute equal to "xyz")
or fractional coordinates (basis attribute equal to "abc").The replacement function returns an object of the same class as x with updated coordinates.
is.coords returns TRUE if x is an object of class
coords and coords<- are generic accessor and replacement functions.
The default method of the coords function is actually a builder allowing to create a x1, x2, x3, and basis.
All the arguments have to be specified except 'basis' which by default is set to "xyz" (Cartesian coordinates).For an object of class x1, x2 and x3 components as well as its basis attribute to create a x1, x2 and x3 components as well as its basis attribute.
For an object of class x1, x2 and x3 components as well as the basis attribute of its atoms component to create a x1, x2 and x3 components as well as the basis attribute of its atoms component.
For basis==NULL this function search x, y, z or a, b, c columns in x.
If x, y, z columns are found they are used to a set the first, second and third coordinates of the returned x is set to "xyz".
If a, b, c columns are found they are used to a set the first, second and third coordinates of the returned x is set to "abc".
If the function doesn't found neither the x, y, z nor the a, b, c columns an error is returned.
When basis!=NULL it has to be equal to "xyz" or "abc" and x must have exactly 3 columns.
is.coords tests if x is an object of class coords.
basisx <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
is.coords(x)
is.coords(x$atoms)
## Replace the coordinates of x by translated coordinates
coords(x) <- coords(Tz(x, 10))
coords(x)Run the code above in your browser using DataLab