Conformer¶
3D conformer generation from a molecular graph. Conformer takes an
Atomistic (typically from a SMILES or CGsmiles parse, which carries no
coordinates) and returns a structure with embedded 3D positions, using the native ETKDGv3 →
torsion refinement → MMFF94 cleanup pipeline. Available via import molpy as mp (mp.Conformer).
Quick reference¶
| Symbol | Summary | Preferred for |
|---|---|---|
Conformer |
Generate 3D coordinates for a graph | Turning a parsed graph into a 3D structure |
ConformerReport |
Per-run summary of the generation pipeline | Inspecting which stages ran / succeeded |
ConformerStageReport |
Single-stage record within a report | Debugging a specific embedding stage |
Related¶
- Builder —
Assemblerconsumes 3D units; embed a CGsmiles fragment withConformer(this module) and its ports are kept. It is the only embedder MolPy ships.
Full API¶
Conformer ¶
Bases: Conformer
3D conformer generator for molpy molecules.
Subclasses the native Conformer; the constructor parameters
(speed, add_hydrogens, seed) are inherited unchanged. Only the
empty-molecule guard in :meth:generate is added.
Examples:
>>> import molpy as mp
>>> mol = mp.io.read_smiles("CCO")
>>> mol_3d, report = Conformer(seed=42).generate(mol)
>>> mol_3d.n_atoms # heavy atoms + added hydrogens
9
generate ¶
Generate 3D coordinates, returning a fresh Atomistic.
mol is the native graph, so the inherited Rust generator embeds it
directly and its result is returned as is. The core
reads the canonical integer "formal_charge" key for valence filling
([N+] / [N-] hydrogen counts); the parsers emit that key, so a
charged input must already carry it. The core clones the graph internally,
so the input is not mutated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mol
|
Atomistic
|
Input molecular graph. Element symbols and bond orders are required; coordinates may be missing. |
required |
Returns:
| Type | Description |
|---|---|
Atomistic
|
A tuple of the generated structure (an |
ConformerReport
|
per-stage :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
ConformerReport ¶
Aggregate report from a conformer generation run.
ConformerStageReport ¶
Per-stage report from the conformer generation pipeline.