Learn R Programming

Rpdb (version 2.0)

pdb: Create an Object of Class pdb

Description

Creates an object of class 'pdb'.

Usage

pdb(...)

## S3 method for class 'default': pdb(atoms, cryst1 = NULL, conect = NULL, remark = NULL, title = NULL, \dots)

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.
cryst1
a list of class cryst1 containing the periodical bondary conditions and space group use 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.

Value

  • Returns a list of class pdb with the following components:
  • titlea character vector containing the TITLE records found in a PDB file.
  • remarka character vector containing the REMARK records found in a PDB file.
  • cryst1a list of class cryst1 containing the first CRYST1 record found in a PDB file. All others are ignored.
  • atomsa data.frame of class atoms containing the ATOM and HETATM records found in a PDB file.
  • conecta data.frame of class conect containing the CONECT records found in a PDB file.

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, cryst1, atoms and conect. At least an object of class atoms has to be specified.

See Also

atoms, coords, cryst1, conect and read.pdb

Examples

Run this code
title  <- "This is just an example"
remark <- NULL
cryst1 <- cryst1(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)
class(x)

Run the code above in your browser using DataLab