vibesketch.chem.embed

3D structures for drawn species: ETKDG, a force field, the stereochemistry kept.

Coordinates come from RDKit’s distance geometry with experimental torsion preferences, ETKDG version 3 (S. Riniker, G. A. Landrum, J. Chem. Inf. Model. 55, 2562-2574 (2015); S. Wang, J. Witek, G. A. Landrum, S. Riniker, J. Chem. Inf. Model. 60, 2044-2058 (2020)). Several embeddings are refined with MMFF94 (T. A. Halgren, J. Comput. Chem. 17, 490-519 (1996)), or with UFF (A. K. Rappé et al., J. Am. Chem. Soc. 114, 10024-10035 (1992)) where MMFF94 has no parameters, and ranked by the force field’s energy. A species neither covers, such as most metal complexes, keeps ETKDG’s geometry with a warning: distance geometry knows nothing of square-planar or octahedral centres.

The drawing’s stereochemistry is the contract. Every conformer is read back (AssignStereochemistryFrom3D) and must give the R/S and E/Z the drawing specifies; one that does not is dropped, and if none is left, embedding fails with that reason instead of returning the wrong isomer (roadmap, section 6). Stereocentres the drawing leaves open are counted, because the 3D structure has to pick one of them.

Embedding is deterministic: a fixed seed and one thread.

Module Attributes

SEED

The seed every embedding starts from, so the same drawing gives the same structure.

Functions

embed_3d(smiles, *[, count, attempts])

3D conformers of the species smiles describes, best first.

Classes

Embedded(conformers, energies[, ...])

3D structures for one species, lowest force-field energy first.

Exceptions

EmbedFailed

No 3D structure with the drawing's stereochemistry could be made.

exception vibesketch.chem.embed.EmbedFailed

Bases: ValueError

No 3D structure with the drawing’s stereochemistry could be made.

class vibesketch.chem.embed.Embedded(conformers, energies, open_stereo=0, warnings=<factory>)

Bases: object

3D structures for one species, lowest force-field energy first.

Parameters:
conformers: list[Conformer]
energies: list[float | None]

Force-field energies in kcal/mol, in the same order; None without a force field.

open_stereo: int = 0

Stereocentres and stereogenic double bonds the drawing leaves open.

warnings: list[str]
vibesketch.chem.embed.embed_3d(smiles, *, count=1, attempts=10)

3D conformers of the species smiles describes, best first.

attempts embeddings are made and refined; the count lowest in energy that keep the stereochemistry are returned. Raises EmbedFailed with the reason when there is none.

Parameters:
Return type:

Embedded