Renumber and Convert Between Various PDB formats

Usage

convert.pdb(pdb, type=c("original", "pdb", "charmm", "amber", "gromacs"), renumber = FALSE, first.resno = 1, first.eleno = 1, consecutive=TRUE, rm.h = TRUE, rm.wat = FALSE, verbose=TRUE)

Arguments

pdb
a structure object of class "pdb", obtained from read.pdb.
type
output format, one of ‘original’, ‘pdb’, ‘charmm’, ‘amber’, or ‘gromacs’. The default option of ‘original’ results in no conversion.
renumber
logical, if TRUE atom and residue records are renumbered using ‘first.resno’ and ‘first.eleno’.
first.resno
first residue number to be used if ‘renumber’ is TRUE.
first.eleno
first element number to be used if ‘renumber’ is TRUE.
consecutive
logical, if TRUE renumbering will result in consecutive residue numbers spanning all chains. Otherwise new residue numbers will begin at ‘first.resno’ for each chain.
rm.h
logical, if TRUE hydrogen atoms are removed.
rm.wat
logical, if TRUE water atoms are removed.
verbose
logical, if TRUE details of the conversion process are printed.

Description

Renumber and convert between CHARMM, Amber, Gromacs and Brookhaven PDB formats.

Details

Convert atom names and residue names, renumber atom and residue records, strip water and hydrogen atoms from pdb objects.

Format type can be one of “ori”, “pdb”, “charmm”, “amber” or “gromacs”.

Value

Returns a list of class "pdb", with the following components:
atom
a character matrix containing all atomic coordinate ATOM data, with a row per ATOM and a column per record type. See below for details of the record type naming convention (useful for accessing columns).

het
a character matrix containing atomic coordinate records for atoms within “non-standard” HET groups (see atom).

helix
‘start’, ‘end’ and ‘length’ of H type sse, where start and end are residue numbers “resno”.

sheet
‘start’, ‘end’ and ‘length’ of E type sse, where start and end are residue numbers “resno”.

seqres
sequence from SEQRES field.

xyz
a numeric vector of ATOM coordinate data.

calpha
logical vector with length equal to nrow(atom) with TRUE values indicating a C-alpha “elety”.

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

For a description of PDB format (version3.3) see: http://www.wwpdb.org/documentation/format33/v3.3.html.

Note

For both atom and het list components the column names can be used as a convenient means of data access, namely: Atom serial number “eleno” , Atom type “elety”, Alternate location indicator “alt”, Residue name “resid”, Chain identifier “chain”, Residue sequence number “resno”, Code for insertion of residues “insert”, Orthogonal coordinates “x”, Orthogonal coordinates “y”, Orthogonal coordinates “z”, Occupancy “o”, and Temperature factor “b”. See examples for further details.

Examples

# Read a PDB file pdb <- read.pdb("4q21")
Note: Accessing on-line PDB file
pdb
Call: read.pdb(file = "4q21") Total Models#: 1 Total Atoms#: 1447, XYZs#: 4341 Chains#: 1 (values: A) Protein Atoms#: 1340 (residues/Calpha atoms#: 168) Nucleic acid Atoms#: 0 (residues/phosphate atoms#: 0) Non-protein/nucleic Atoms#: 107 (residues: 80) Non-protein/nucleic resid values: [ GDP (1), HOH (78), MG (1) ] Protein sequence: MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGETCLLDILDTAG QEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQIKRVKDSDDVPMVLVGNKCDL AARTVESRQAQDLARSYGIPYIETSAKTRQGVEDAFYTLVREIRQHKL + attr: atom, xyz, seqres, helix, sheet, calpha, remark, call
head( pdb$atom[pdb$calpha,"resno"] )
[1] 1 2 3 4 5 6
# Convert to CHARMM format new <- convert.pdb(pdb, type="amber", renumber=TRUE, first.resno=22 )
Retaining 1447 non-hydrogen atoms Renumbering residues ( from 22 ) and atoms ( from 1 ) Converting to 'amber' format Non-standard residue names present ( MG GDP HOH )
head( new$atom[new$calpha,"resno"] )
[1] 22 23 24 25 26 27
# Write a PDB file #write.pdb(new, file="tmp4amber.pdb")

See also

atom.select, write.pdb, read.dcd, read.fasta.pdb, read.fasta

Author

Barry Grant