MolecularDiffusion.runmodes.analyze.compare_to_optimized

Compute unified comparison metrics (RMSD, xTB Energy, Bond Geometry) between initial XYZ files and their optimized counterparts in the optimized_xyz subdirectory.

Features: - Validates connectivity (skip disjoint graphs) - Computes RMSD and Energy difference (via xTB) - Computes Bond Length, Angle, and Torsion differences (via OpenBabel/cell2mol)

Attributes

Functions

compute_all_metrics(→ dict)

Compute all available metrics for a single pair.

compute_coord_rmsd(→ float)

Compute RMSD between two coordinate sets.

get_xtb_energy(→ Optional[float])

Compute xTB single-point energy for an XYZ file (returns Hartree).

run_compare_analysis(args)

xyz2mol_cell2mol(→ Optional[rdkit.Chem.Mol])

Convert XYZ to RDKit Mol using cell2mol logic.

xyz2mol_openbabel(→ Optional[rdkit.Chem.Mol])

Convert XYZ to RDKit Mol using OpenBabel (via pybel).

Module Contents

MolecularDiffusion.runmodes.analyze.compare_to_optimized.compute_all_metrics(init_file: pathlib.Path, opt_file: pathlib.Path, args: argparse.Namespace) dict

Compute all available metrics for a single pair.

MolecularDiffusion.runmodes.analyze.compare_to_optimized.compute_coord_rmsd(coords1: numpy.ndarray, coords2: numpy.ndarray) float

Compute RMSD between two coordinate sets.

MolecularDiffusion.runmodes.analyze.compare_to_optimized.get_xtb_energy(xyz_path: str, charge: int = 0, level: str = 'gfn2', timeout: int = 120) float | None

Compute xTB single-point energy for an XYZ file (returns Hartree).

MolecularDiffusion.runmodes.analyze.compare_to_optimized.run_compare_analysis(args: argparse.Namespace)
MolecularDiffusion.runmodes.analyze.compare_to_optimized.xyz2mol_cell2mol(xyz_file: str, timeout: int = 10) rdkit.Chem.Mol | None

Convert XYZ to RDKit Mol using cell2mol logic.

MolecularDiffusion.runmodes.analyze.compare_to_optimized.xyz2mol_openbabel(xyz_file: str) rdkit.Chem.Mol | None

Convert XYZ to RDKit Mol using OpenBabel (via pybel).

MolecularDiffusion.runmodes.analyze.compare_to_optimized.parser