# `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)

  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)

    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)

    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)

  Store force field atom topology definitions.

  __init__(name=None, x=None, y=None, z=None)

    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

  Handle definition XML file content.

  __init__()
  characters(text)

    Parse text data in XML.

    Parameters:

      text (str) – text data to parse

  endElement(name)

    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, _)

    Start XML element parsing.

    Parameters:

      name (str) – element name

class pdb2pqr.definitions.DefinitionResidue

  Force field toplogy representation for a residue.

  __init__()

    Initialize the class

    Parameters:

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

  get_nearest_bonds(atomname)

    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

  Residue patches for structure topologies.

  __init__()