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

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.

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.

Author

Barry Grant

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.

See also

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

Examples

if (FALSE) { # Read a PDB file pdb <- read.pdb("4q21") pdb head( pdb$atom[pdb$calpha,"resno"] ) # Convert to CHARMM format new <- convert.pdb(pdb, type="amber", renumber=TRUE, first.resno=22 ) head( new$atom[new$calpha,"resno"] ) # Write a PDB file #write.pdb(new, file="tmp4amber.pdb") }