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,
  connect = NULL,
  title = NULL,
  remark = NULL,
  hetero = NULL,
  structure = NULL,
  resolution = 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 used 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.

connect

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

title

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

remark

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

hetero

a data.frame with details about the Hetero-Molecules in the pdb object.

structure

a structure object with secondary structure elements.

resolution

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

x

an R object to be tested.

Details

This function is a generic function used 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 connect. 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 CRYSTAL 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.

connect

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

Hetero

a data.frame with names and abbreviations of hetero-molecules in the PDB file.

Structure

an abject of type structure containing the elements of secondary structure.

Resolution

Resolution of the X-Ray diffraction.


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

See Also

atoms, coords, crystal, connect and read.pdb

Examples

title  <- "This is just an example"
remark <- NULL
crystal <- 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"))
connect <- connect(eleid.1 = c(1), eleid.2 = c(2))
x <- pdb(atoms = atoms, crystal = crystal, connect = connect, title = title, remark = remark)
is.pdb(x)


Rpdb documentation built on May 12, 2026, 5:06 p.m.