Skip to main content

Module graph

Module graph 

Source
Expand description

Molecular graph representation backed by petgraph.

Defines Atom, Bond, and Molecule — the core data model consumed by conformer generation, force fields, electronic methods, and all property modules. Atoms carry hybridization, chirality, and aromaticity; bonds carry order and stereo.

Structs§

Atom
A single atom node in the molecular graph.
Bond
A bond edge in the molecular graph.
Molecule
Molecular graph: atoms as nodes, bonds as edges. Constructed from a SMILES string via Molecule::from_smiles.
NodeIndex
Node identifier.

Enums§

BondOrder
Bond order: single, double, triple, aromatic, or unknown.
BondStereo
E/Z (cis/trans) stereochemistry of a double bond.
ChiralType
Tetrahedral chirality type derived from the SMILES @/@@ specification.
Hybridization
Hybridization state of an atom, used to compute bond angles and geometry.

Functions§

atom_in_ring
Check if an atom is in any ring (has an alternative path of length ≤ 8 through any neighbor).
bond_in_ring_of_size
Check if a bond (edge between a and b) is in a ring of exactly the given size.
get_corrected_ideal_angle
Returns the ideal 1–2–3 bond angle (radians) between atoms n1centern2, accounting for ring strain in small rings (3-, 4-, 5-membered).
get_covalent_radius
Returns the covalent radius (in Å) for a given atomic number Data derived from RDKit’s atomic_data.cpp
get_ideal_angle
Returns the ideal bond angle (in radians) for a given hybridization
get_vdw_radius
Returns the Van der Waals radius (in Å)
min_path_excluding
BFS shortest path (in bonds) from start to target in the molecular graph, excluding the node exclude. Used to detect ring membership and ring sizes. Returns None if no path exists within limit bonds.
min_path_excluding2
BFS shortest path from start to target, excluding two intermediate nodes.