Skip to content

Conformer

3D conformer generation from a molecular graph. Conformer takes an Atomistic (typically from a SMILES / BigSMILES parse, which carries no coordinates) and returns a structure with embedded 3D positions, using the backend. Available via import molpy as mp (mp.conformer.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
  • BuilderPolymerBuilder consumes 3D monomers; embed them with Conformer (this module). It is the only embedder MolPy ships.

Full API

conformer

3D conformer generation for molpy molecules (molrs-backed).

:class:Conformer subclasses :class:molrs.conformer.Conformer and overrides :meth:Conformer.generate to marshal :class:molpy.Atomistic across the molrs boundary: it folds formal charges into the form the molrs pipeline expects, runs the inherited Rust generator, and re-adopts the result as a molpy graph-backed Atomistic. The heavy lifting — fragment / distance-geometry build, energy minimisation, rotor search, stereo guard — runs inside molrs.

The report types are inherited verbatim from molrs (re-exported here, not re-declared). The optional RDKit backend (:mod:molpy.adapter.rdkit) remains available as a separate external adapter.

Conformer

Conformer(speed='medium', add_hydrogens=True, seed=None)

Bases: Conformer

3D conformer generator for molpy molecules.

Subclasses :class:molrs.conformer.Conformer; the constructor parameters (speed, add_hydrogens, seed) are inherited unchanged. Only the molpy-side marshalling 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(mol)

Generate 3D coordinates, returning a fresh molpy Atomistic.

mol is already a molrs graph (Atomistic is-a molrs.Graph), so the inherited Rust generator embeds it directly — no translation. molrs 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. molrs 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 (a molpy Atomistic) and the

ConformerReport

per-stage :class:molrs.conformer.ConformerReport.

Raises:

Type Description
ValueError

If mol has no atoms.

ConformerReport

Aggregate report from a conformer generation run.

ConformerStageReport

Per-stage report from the conformer generation pipeline.