topology.utils
topology.utils
Functions
Name | Description |
---|---|
get_is_reactive_predicate_f | Returns whether a moleculetype name is configured to be recognized as reactive. |
get_is_reactive_predicate_from_config_f | Returns whether a moleculetype name is configured to be recognized as reactive. |
get_moleculetype_atomics | Get content of subsections (atoms/bonds/angles etc.) of a moleculetype from a topology dict. |
get_moleculetype_header | Get content of the header of a moleculetype from a topology dict. |
get_protein_section | Get content of a section in the first moleculetype (protein) from a topology dict. |
get_reactive_section | Get content of a section in the Reactive moleculetype from a topology dict. |
get_residue_by_bonding | Get the residue of an atom by its bonding. |
get_residue_fragments | Splits a residue into fragments after a bond has been broken. |
get_top_section | Get content of a section from a topology dict. |
is_not_solvent_or_ion | Returns whether a moleculetype name is not solvent or ion. |
set_reactive_section | Set content of a section in the first moleculetype (protein) from a topology dict. |
set_top_section | Set content of a section from a topology dict. |
get_is_reactive_predicate_f
topology.utils.get_is_reactive_predicate_f(include, exclude)
Returns whether a moleculetype name is configured to be recognized as reactive.
get_is_reactive_predicate_from_config_f
topology.utils.get_is_reactive_predicate_from_config_f(cfg)
Returns whether a moleculetype name is configured to be recognized as reactive.
get_moleculetype_atomics
topology.utils.get_moleculetype_atomics(top, moleculetype)
Get content of subsections (atoms/bonds/angles etc.) of a moleculetype from a topology dict.
Resolves any #ifdef
statements by check in the top[‘define’] dict and chooses the ‘content’ or ‘else_content’ depending on the result.
get_moleculetype_header
topology.utils.get_moleculetype_header(top, moleculetype)
Get content of the header of a moleculetype from a topology dict.
Resolves any #ifdef
statements by check in the top[‘define’] dict and chooses the ‘content’ or ‘else_content’ depending on the result.
get_protein_section
topology.utils.get_protein_section(top, name)
Get content of a section in the first moleculetype (protein) from a topology dict.
get_reactive_section
topology.utils.get_reactive_section(top, name)
Get content of a section in the Reactive moleculetype from a topology dict.
get_residue_by_bonding
topology.utils.get_residue_by_bonding(atom, atoms)
Get the residue of an atom by its bonding.
Avoids traversing the whole topology.
Parameters
Name | Type | Description | Default |
---|---|---|---|
atom | Atom | Atom of the residue | required |
atoms | dict[str, Atom] | All atoms of a topology | required |
Returns
Name | Type | Description |
---|---|---|
Atoms of the residue |
get_residue_fragments
topology.utils.get_residue_fragments(
top
residue
start1
start2=20
iterations )
Splits a residue into fragments after a bond has been broken.
Parameters
Name | Type | Description | Default |
---|---|---|---|
top | Topology | Topology | required |
residue | list[Atom] | All atoms of current residue. Ok, when it contains more atoms as long as those are not connected to broken bond. | required |
start1 | Atom | First atom with broken bond | required |
start2 | Atom | Second atom with broken bond | required |
iterations | int | Max number of bonds from start atoms to be included when building fragmets, by default 20 | 20 |
Returns
Name | Type | Description |
---|---|---|
Two fragments, or one fragment and empty set in case the | residue did not change its size. |
get_top_section
=None) topology.utils.get_top_section(top, name, moleculetype
Get content of a section from a topology dict.
Resolves any #ifdef
statements by check in the top[‘define’] dict and chooses the ‘content’ or ‘else_content’ depending on the result.
is_not_solvent_or_ion
topology.utils.is_not_solvent_or_ion(name)
Returns whether a moleculetype name is not solvent or ion.
set_reactive_section
topology.utils.set_reactive_section(top, name, value)
Set content of a section in the first moleculetype (protein) from a topology dict.
set_top_section
=None) topology.utils.set_top_section(top, name, value, moleculetype
Set content of a section from a topology dict.
Resolves any #ifdef
statements by check in the top[‘define’] dict and chooses the ‘content’ or ‘else_content’ depending on the result.