pdb: Create an Object of Class 'pdb'

View source: R/pdb.R

pdbR Documentation

Create an Object of Class ‘pdb’

Description

Creates an object of class 'pdb'.

Usage

pdb(...)

## Default S3 method:
pdb(
  atoms,
  crystal = NULL,
  conect = NULL,
  remark = NULL,
  title = NULL,
  resolution = NULL,
  ...,
  cryst1 = NULL
)

is.pdb(x)

Arguments

...

further arguments passed to or from other methods.

atoms

a data.frame of class atoms containing ATOM and HETATM records use to create the pdb object.

crystal

a list of class crystal containing the periodical boundary conditions and space group used to create the pdb object.

conect

a data.frame of class conect containing CONECT records use to create the pdb object.

remark

a character vector containing some REMARK records to be added to the pdb object.

title

a character vector containing some TITLE records to be added to the pdb object.

resolution

numeric value specifying the resolution; the unit should be specified as an attribute.

cryst1

will be deprecated and replaced by argument crystal.

x

an R object to be tested.

Details

This function is the generic function to create objects of class ‘pdb’. The purpose of this class is to store the data of molecular systems contained in PDB files. The default method of the pdb function creates an object of class ‘pdb’ from its different components, i.e.: title, remark, crystal, atoms and conect. At least an object of class ‘atoms’ has to be specified.

is.pdb tests if x is an object of class ‘pdb’, i.e. if x has a “class” attribute equal to pdb.

Value

pdb returns a list of class ‘pdb’ with the following components:

title

a character vector containing the TITLE records found in a PDB file.

remark

a character vector containing the REMARK records found in a PDB file.

crystal

a list of class ‘crystal’ containing the first CRYST1 record found in a PDB file. All others are ignored.

atoms

a data.frame of class ‘atoms’ containing the ATOM and HETATM records found in a PDB file.

conect

a data.frame of class ‘conect’ containing the CONECT records found in a PDB file.


is.pdb returns TRUE if x is an object of class ‘pdb’ and FALSE otherwise.

See Also

atoms, coords, crystal, conect and read.pdb

Examples

title  <- "This is just an example"
remark <- NULL
cryst1 <- crystal(c(10,10,10))
atoms <- atoms(recname = c("ATOM","ATOM"), eleid = 1:2, elename = c("H","H"), alt = "",
               resname = c("H2","H2"), chainid = "", resid = c(1,1), insert = "",
               x1 = c(0,0), x2 = c(0,0), x3 = c(0,1), occ = c(0.0,0.0), temp = c(1.0,1.0),
               segid = c("H2","H2"))
conect <- conect(eleid.1 = c(1), eleid.2 = c(2))
x <- pdb(atoms = atoms, cryst1 = cryst1, conect = conect, remark = remark, title = title)
is.pdb(x)


Rpdb documentation built on March 16, 2026, 5:07 p.m.