topology.topology

topology.topology

Classes

Name Description
MoleculeType One moleculetype in the topology
Topology Smart container for parsed topology data.

MoleculeType

topology.topology.MoleculeType(self, header, atomics)

One moleculetype in the topology

Attributes

Name Type Description
atoms dict[str, Atom]
bonds dict[tuple[str, str], Bond]
pairs dict[tuple[str, str], Pair]
angles dict[tuple[str, str, str], Angle]
proper_dihedrals dict[tuple[str, str, str, str], MultipleDihedrals]
improper_dihedrals dict[tuple[str, str, str, str], Dihedral]
position_restraints dict[str, PositionRestraint]
dihedral_restraints dict[tuple[str, str, str, str], DihedralRestraint]
radicals dict[str, Atom] dict mapping atom indices to atom objects for storing all radical atoms

Methods

Name Description
reindex_atomnrs Reindex atom numbers in topology.
test_for_radicals Updates radical status per atom and in topology.
reindex_atomnrs

topology.topology.MoleculeType.reindex_atomnrs(self)

Reindex atom numbers in topology.

Starts at index 1. This also updates the numbers for bonds, angles, dihedrals and pairs. Returns a dict, mapping of old atom number strings to new ones

test_for_radicals

topology.topology.MoleculeType.test_for_radicals(self)

Updates radical status per atom and in topology.

Iterate over all atoms and designate them as radicals if they have fewer bounds than their natural bond order.

Topology

topology.topology.Topology(self, top, parametrizer=BasicParameterizer())

Smart container for parsed topology data.

A topology keeps track of connections when bonds are broken or formed. Reparametrization is triggerd automatically if to_dict is called after bonds have changed.

Assumptions:

  • the topology of interest (the protein) is in section ‘moleculetype_0’.

Parameters

Name Type Description Default
top TopologyDict A dictionary containing the parsed topology data, produced by kimmdy.parsing.read_top required

Methods

Name Description
bind_bond Add a bond in topology.
break_bond Break bonds in topology homolytically.
del_atom Deletes atom
reindex_atomnrs Reindex atom numbers in topology.
validate_bond Validates bond consistency between both atoms and top
bind_bond

topology.topology.Topology.bind_bond(self, atompair_addresses)

Add a bond in topology.

Modifies the topology dictionary in place. It keeps track of affected terms in the topology via a graph representation of the topology and applies the necessary changes to bonds, angles and dihedrals (proper and improper). Furthermore, it modifies to function types in the topology to account for radicals.

Parameters
Name Type Description Default
atompair_addresses tuple[TopologyAtomAddress, TopologyAtomAddress] Atoms to bind together. required
break_bond

topology.topology.Topology.break_bond(self, atompair_addresses)

Break bonds in topology homolytically.

Removes bond, angles and dihedrals where atompair was involved. Modifies the topology dictionary in place. Atom pairs become radicals.

Parameters
Name Type Description Default
atompair_addresses tuple[TopologyAtomAddress, TopologyAtomAddress] Between which atoms to break the bond. required
del_atom

topology.topology.Topology.del_atom(self, atom_nr, parameterize=True)

Deletes atom

Deletes atom and all attached bonds. Reindexes the top and updates the parameters if requested.

Parameters
Name Type Description Default
atom_nr str 1-based atom number as string to delete required
parameterize bool If true and bonds are removed triggers reparameterization, by default True True
Returns
Type Description
update_map Dict, mapping of old atom number strings to new ones.
reindex_atomnrs

topology.topology.Topology.reindex_atomnrs(self)

Reindex atom numbers in topology.

Starts at index 1. This also updates the numbers for bonds, angles, dihedrals and pairs. Returns a dict of all moleculetypes to their update maps (old -> new).

validate_bond

topology.topology.Topology.validate_bond(self, atm1, atm2)

Validates bond consistency between both atoms and top Returns True if bond exists, False if not. Raises RuntimeError if bond is not consistent.

Back to top