kartograf.filters#

kartograf.filters.element_change#

kartograf.filters.element_change.filter_atoms_h_only_h_mapped(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Forces a mapping to only allow hydrogens to map to other hydrogens

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]

kartograf.filters.element_change.filter_element_changes(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Forces a mapping to exclude any alchemical element changes in the core

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]

kartograf.filters.element_change.filter_hybridization_changes(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Forces a mapping to exclude any alchemical atom hybridization changes. Such a change could be for example -C-C >> -C=C .

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]

kartograf.filters.ring_changes#

kartograf.filters.ring_changes.filter_fused_ring_changes(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Remove cases where a fused ring is partially mapped and could be considered broken, the entire fused ring system is then to be considered unique resulting in larger alchemical regions following the recomended best practices <https://livecomsjournal.org/index.php/livecoms/article/view/v2i1e18378>.

See <OpenFreeEnergy/kartograf#56> for more details.

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]

kartograf.filters.ring_changes.filter_hybridization_rings(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Ensure that any mapped rings are either both aromatic or aliphatic

e.g. this filter would unmap hexane to benzene type transformations

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]

kartograf.filters.ring_changes.filter_ringbreak_changes(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Prevent any ring cleaving transformations in the mapping

This filter prevents any non-ring atom turning into a ring atom (or vice versa)

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]

kartograf.filters.ring_changes.filter_ringsize_changes(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Prevents mutating the size of rings in the mapping

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]

kartograf.filters.ring_changes.filter_whole_rings_only(molA: Mol, molB: Mol, mapping: dict[int, int]) dict[int, int]#

Ensure that any mapped rings are wholly mapped

Parameters:
  • molA (Mol)

  • molB (Mol)

  • mapping (dict[int, int])

Return type:

dict[int, int]