topology
#
Utilities for manipulating OpenFF topology objects.
Functions:
-
topology_to_components
–A helper method for condensing a topology down to a list of components
-
topology_to_atom_indices
–A helper method for extracting the sets of atom indices associated with each
topology_to_components
#
A helper method for condensing a topology down to a list of components and their counts.
Notes
If the topology is not contiguous then the returned list may contain multiple tuples with the same smiles but different counts.
Parameters:
-
topology
(Topology
) –The topology to condense.
Returns:
-
list[tuple[str, int]]
–A list of the form
components[i] = (smiles_i, count_i)
wheresmiles_i
is the SMILES representation of componenti
andcount_i
is the number of corresponding instances of that component to create.
Source code in absolv/utils/topology.py
topology_to_atom_indices
#
A helper method for extracting the sets of atom indices associated with each molecule in a topology.
Parameters:
-
topology
(Topology
) –The topology to extract the atom indices from.
Returns:
-
list[set[int]]
–The set of atoms indices associated with each molecule in the topology.