Skip to main content

enantiomer()

The mirror image: every chiral LS inverted, atom indices kept.

Usage

Source

enantiomer(gra: G) -> G
 
enantiomer(gra: ReactionGraph | StereoReactionGraph) -> ReactionGraph | StereoReactionGraph
 
enantiomer(gra: AnyGraph) -> AnyGraph

Tetrahedral, AtropBond, TrigonalBipyramidal and Octahedral LS with a parity flip it, and so do the slots of a reaction graph’s stereo changes; PlanarBond and SquarePlanar (their own mirror images) and undetermined LS are kept as they are. A graph without stereo fields is returned unchanged. Being index-aligned, the result needs no atom map: the geometry reflected through a plane is a geometry of it. A trivial site’s fixed LS (a CH3 carbon’s) is inverted too, as reading the reflected geometry would give it (P75); it describes the same configuration, so compare results by canonical JSON, not ==.

>>> from protomol import from_smiles
>>> gra = from_smiles("C[C@H](O)/C=C/C")
>>> canonical_json(enantiomer(gra)) == canonical_json(
...     from_smiles("C[C@@H](O)/C=C/C")
... )

True

>>> enantiomer(enantiomer(gra)) == gra

True