definitions

XML handling for biomolecular residue topology definitions.

Code author: Jens Erik Nielsen

Code author: Todd Dolinsky

Code author: Yong Huang

class pdb2pqr.definitions.Definition(aa_file, na_file, patch_file)[source]

Force field topology definitions.

The Definition class contains the structured definitions found in the files and several mappings for easy access to the information.

__init__(aa_file, na_file, patch_file)[source]

Initialize object.

Parameters:
  • aa_file (file) – file-like object with amino acid definitions

  • na_file (file) – file-like object with nucleic acid definitions

  • patch_file (file) – file-like object with patch definitions

add_patch(patch, refname, newname)[source]

Add a patch to a topology definition residue.

Parameters:
  • patch (Patch) – the patch object to add

  • refname (str) – the name of the object to add the patch to

  • newname (str) – the name of the new (patched) object

class pdb2pqr.definitions.DefinitionAtom(name=None, x=None, y=None, z=None)[source]

Store force field atom topology definitions.

__init__(name=None, x=None, y=None, z=None)[source]

Initialize class.

Parameters:
  • name (str) – atom name

  • x (float) – x-coordinate

  • y (float) – y-coordinate

  • z (float) – z-coordinate

property is_backbone

Identify whether atom is in backbone.

Returns:

true if atom name is in backbone, otherwise false

Return type:

bool

class pdb2pqr.definitions.DefinitionHandler[source]

Handle definition XML file content.

__init__()[source]
characters(text)[source]

Parse text data in XML.

Parameters:

text (str) – text data to parse

endElement(name)[source]

End XML element parsing.

Parameters:

name (str) – element name

Raises:
  • KeyError – for invalid atom or residue names

  • RuntimeError – for unexpected XML features or format

startElement(name, _)[source]

Start XML element parsing.

Parameters:

name (str) – element name

class pdb2pqr.definitions.DefinitionResidue[source]

Force field toplogy representation for a residue.

__init__()[source]

Initialize the class

Parameters:

atoms (list) – list of atom-like (HETATM or ATOM) objects to be stored

get_nearest_bonds(atomname)[source]

Get bonded atoms near a given atom.

Parameters:

atomname (str) – name of specific atom

Returns:

list of nearby bonded atom names

Return type:

[str]

class pdb2pqr.definitions.Patch[source]

Residue patches for structure topologies.

__init__()[source]