syndirella.slipper.intra_geometry

slipper/intra_geometry.py

This module was directly sourced from the PoseBusters repository, which is open source code under the BSD-3-Clause license. The original code is found at: https://github.com/maabuu/posebusters/blob/3c467ab82bdbae5b71f80a286bb49ecc011be529/posebusters/modules/distance_geometry.py

It is used to check bond lengths, bond angles, and the internal clash of ligand conformations.

Attributes

logger

col_lb

col_ub

col_pe

col_bpe

col_bape

bound_matrix_params

col_n_bonds

col_shortest_bond

col_longest_bond

col_n_short_bonds

col_n_long_bonds

col_n_good_bonds

col_bonds_result

col_n_angles

col_extremest_angle

col_n_bad_angles

col_n_good_angles

col_angles_result

col_n_noncov

col_closest_noncov

col_n_clashes

col_n_good_noncov

col_clash_result

_empty_results

Functions

check_geometry(→ dict[str, Any])

Use RDKit distance geometry bounds to check the geometry of a molecule.

_bond_check(→ pandas.DataFrame)

_angle_check(→ pandas.DataFrame)

_clash_check(→ pandas.DataFrame)

_get_bond_atom_indices(→ list[tuple[int, int]])

_get_angle_atom_indices(→ list[tuple[int, int, int]])

Check all combinations of bonds to generate list of molecule angles.

_two_bonds_to_angle(→ None | tuple[int, int, int])

_sort_bond(→ tuple[int, int])

_pairwise_distance(x)

_has_hydrogen(→ bool)

_is_hydrogen(→ bool)

Module Contents

syndirella.slipper.intra_geometry.logger[source]
syndirella.slipper.intra_geometry.col_lb = 'lower_bound'[source]
syndirella.slipper.intra_geometry.col_ub = 'upper_bound'[source]
syndirella.slipper.intra_geometry.col_pe = 'percent_error'[source]
syndirella.slipper.intra_geometry.col_bpe = 'bound_percent_error'[source]
syndirella.slipper.intra_geometry.col_bape = 'bound_absolute_percent_error'[source]
syndirella.slipper.intra_geometry.bound_matrix_params[source]
syndirella.slipper.intra_geometry.col_n_bonds = 'number_bonds'[source]
syndirella.slipper.intra_geometry.col_shortest_bond = 'shortest_bond_relative_length'[source]
syndirella.slipper.intra_geometry.col_longest_bond = 'longest_bond_relative_length'[source]
syndirella.slipper.intra_geometry.col_n_short_bonds = 'number_short_outlier_bonds'[source]
syndirella.slipper.intra_geometry.col_n_long_bonds = 'number_long_outlier_bonds'[source]
syndirella.slipper.intra_geometry.col_n_good_bonds = 'number_valid_bonds'[source]
syndirella.slipper.intra_geometry.col_bonds_result = 'bond_lengths_within_bounds'[source]
syndirella.slipper.intra_geometry.col_n_angles = 'number_angles'[source]
syndirella.slipper.intra_geometry.col_extremest_angle = 'most_extreme_relative_angle'[source]
syndirella.slipper.intra_geometry.col_n_bad_angles = 'number_outlier_angles'[source]
syndirella.slipper.intra_geometry.col_n_good_angles = 'number_valid_angles'[source]
syndirella.slipper.intra_geometry.col_angles_result = 'bond_angles_within_bounds'[source]
syndirella.slipper.intra_geometry.col_n_noncov = 'number_noncov_pairs'[source]
syndirella.slipper.intra_geometry.col_closest_noncov = 'shortest_noncovalent_relative_distance'[source]
syndirella.slipper.intra_geometry.col_n_clashes = 'number_clashes'[source]
syndirella.slipper.intra_geometry.col_n_good_noncov = 'number_valid_noncov_pairs'[source]
syndirella.slipper.intra_geometry.col_clash_result = 'no_internal_clash'[source]
syndirella.slipper.intra_geometry._empty_results[source]
syndirella.slipper.intra_geometry.check_geometry(mol_pred: rdkit.Chem.rdchem.Mol, threshold_bad_bond_length: float = 0.2, threshold_clash: float = 0.2, threshold_bad_angle: float = 0.2, bound_matrix_params: dict[str, Any] = bound_matrix_params, ignore_hydrogens: bool = True, sanitize: bool = True) dict[str, Any][source]

Use RDKit distance geometry bounds to check the geometry of a molecule.

Parameters:
  • mol_pred – Predicted molecule (docked ligand). Only the first conformer will be checked.

  • threshold_bad_bond_length – Bond length threshold in relative percentage. 0.2 means that bonds may be up to 20% longer than DG bounds. Defaults to 0.2.

  • threshold_clash – Threshold for how much overlap constitutes a clash. 0.2 means that the two atoms may be up to 80% of the lower bound apart. Defaults to 0.2.

  • threshold_bad_angle – Bond angle threshold in relative percentage. 0.2 means that bonds may be up to 20% longer than DG bounds. Defaults to 0.2.

  • bound_matrix_params – Parameters passe to RDKit’s GetMoleculeBoundsMatrix function.

  • ignore_hydrogens – Whether to ignore hydrogens. Defaults to True.

  • sanitize – Sanitize molecule before running DG module (recommended). Defaults to True.

Returns:

PoseBusters results dictionary.

syndirella.slipper.intra_geometry._bond_check(df: pandas.DataFrame) pandas.DataFrame[source]
syndirella.slipper.intra_geometry._angle_check(df: pandas.DataFrame) pandas.DataFrame[source]
syndirella.slipper.intra_geometry._clash_check(df: pandas.DataFrame) pandas.DataFrame[source]
syndirella.slipper.intra_geometry._get_bond_atom_indices(mol: rdkit.Chem.rdchem.Mol) list[tuple[int, int]][source]
syndirella.slipper.intra_geometry._get_angle_atom_indices(bonds: list[tuple[int, int]]) list[tuple[int, int, int]][source]

Check all combinations of bonds to generate list of molecule angles.

syndirella.slipper.intra_geometry._two_bonds_to_angle(bond1: tuple[int, int], bond2: tuple[int, int]) None | tuple[int, int, int][source]
syndirella.slipper.intra_geometry._sort_bond(bond: tuple[int, int]) tuple[int, int][source]
syndirella.slipper.intra_geometry._pairwise_distance(x)[source]
syndirella.slipper.intra_geometry._has_hydrogen(mol: rdkit.Chem.rdchem.Mol, idcs: Iterable[int]) bool[source]
syndirella.slipper.intra_geometry._is_hydrogen(mol: rdkit.Chem.rdchem.Mol, idx: int) bool[source]