Skip to main content

Module validation

Module validation 

Source
Expand description

Validation checks matching RDKit’s embedding validation pipeline. Part of the retry-on-failure loop in embedPoints().

Structs§

TetrahedralCenter
Tetrahedral center — any sp3 atom with 4 neighbors (not necessarily chiral)

Constants§

MAX_MINIMIZED_E_PER_ATOM

Functions§

check_chiral_centers
Check chiral center volumes have correct sign. Matches RDKit’s checkChiralCenters — intentionally permissive (allows 20% undershoot if sign matches). Uses f64 coords matching RDKit’s Point3D.
check_double_bond_geometry
Double bond geometry check: reject if substituent-double_bond_atom-other is nearly linear. Matches RDKit’s doubleBondGeometryChecks with doubleBondEnds filtering. Uses f64 coords matching RDKit’s Point3D.
check_planarity
Planarity check: compute OOP (improper torsion) energy for SP2 centers. Reject if energy > n_impropers * tolerance. Matches RDKit’s planarity check in minimizeWithExpTorsions.
check_tetrahedral_centers
Check all tetrahedral centers for minimum volume and center-in-volume. Matches RDKit’s checkTetrahedralCenters. Uses f64 coords matching RDKit’s Point3D.
find_sssr_pub
Find the Smallest Set of Smallest Rings (SSSR) using Horton’s algorithm. Returns a list of rings, each ring being a vector of atom indices.
identify_tetrahedral_centers
Identify tetrahedral centers for volume checks. Matches RDKit’s findChiralSets logic for tetrahedralCarbons:
perturb_if_planar
Check if coordinates are quasi-planar (2D) and perturb the z-axis if so. Returns true if coordinates were perturbed (caller should re-minimise).