Function Repository Resource:

InvertAtom (1.0.0) current version: 1.0.1 »

Source Notebook

Invert the geometry of an atom in a molecule

Contributed by: Robert B. Nachbar

ResourceFunction["InvertAtom"][mol, atom]

inverts the geometry of atom in molecule mol.

Details

The coordinates of the moving atoms are transformed with a 2-fold rotation, thus preserving all other stereocenters in the molecule.
Inverting the entire molecule involves a reflection or an improper rotation (rotary reflection or rotary inversion). For molecules with only a single stereocenter, reflecting all the coordinates through a plane would accomplish the same effect as ResourceFunction["InvertAtom"]. However, all the atoms move and in molecular modeling one usually expects some part of the molecule to remain fixed in space. For molecules with more than one stereocenter, ResourceFunction["InvertAtom"] allows one to generate a diastereomer, an epimer more specifically. In this case, the chirality at only one atom is changed, and the rest remain geometrically unaffected.

Examples

Basic Examples (2) 

Show 2-butanol:

In[1]:=
(mol = Molecule["C[C@H](O)CC"]) // MoleculePlot3D
Out[1]=

Invert it:

In[2]:=
(invMol = ResourceFunction["InvertAtom"][mol, 2]) // MoleculePlot3D
Out[2]=

Check the chirality:

In[3]:=
MoleculeValue[{mol, invMol}, {"AtomChirality", 2}]
Out[3]=

Invert one of the carbinol atoms of cis-cyclohexan-1,3-diol:

In[4]:=
(mol = Molecule["[C@H]1(O)C[C@@H](O)CCC1"]) // MoleculePlot3D[#, {1}] &
Out[4]=
In[5]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[5]=

Check the chirality:

In[6]:=
MoleculeValue[{mol, invMol}, {"AtomChirality", 1}]
Out[6]=

Scope (5) 

Amines can be inverted:

In[7]:=
(mol = Molecule["CN(CC)CCC"]) // MoleculePlot3D
Out[7]=
In[8]:=
(invMol = ResourceFunction["InvertAtom"][mol, 2]) // MoleculePlot3D
Out[8]=

Check the out-of-plane angle:

In[9]:=
MoleculeValue[{mol, invMol}, {"OutOfPlaneAngle", {1, 2, 3, 5}}]
Out[9]=

Show a molecule:

In[10]:=
(mol = Molecule["C1N(C)COCC1"]) // MoleculePlot3D
Out[10]=

Invert it:

In[11]:=
(invMol = ResourceFunction["InvertAtom"][mol, 2]) // MoleculePlot3D
Out[11]=

Check the out-of-plane angle:

In[12]:=
MoleculeValue[{mol, invMol}, {"OutOfPlaneAngle", {1, 2, 4, 3}}]
Out[12]=

Spiro centers can be inverted:

In[13]:=
(mol = Molecule["[C@@]12([C@H](O)CCC1)C[C@H](Cl)CC2"]) // MoleculePlot3D[#, {1}] &
Out[13]=
In[14]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[14]=

Check the chirality:

In[15]:=
MoleculeValue[{mol, invMol}, {"AtomChirality", 1}]
Out[15]=

Ring fusion atoms with sufficiently large rings can be inverted:

In[16]:=
(mol = Molecule["[C@]12(C)CCCC[C@H]1CCCC2"]) // MoleculePlot3D[#, {1}] &
Out[16]=
In[17]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[17]=

Check the chirality:

In[18]:=
MoleculeValue[{mol, invMol}, {"AtomChirality", 1}]
Out[18]=

Bridgehead atoms with sufficiently large rings can be inverted:

In[19]:=
(mol = Molecule["C12CCCC(CCC1)CCC2"]) // MoleculePlot3D[#, {1}] &
Out[19]=
In[20]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[20]=

Applications (2) 

Invert the anomeric carbon of α-D-glucose:

In[21]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/89433db5-7691-441c-9465-f332ef2fd7ca"]
Out[21]=
In[22]:=
(betaDglucose = ResourceFunction["InvertAtom"][alphaDglucose, 2]) // MoleculePlot3D
Out[22]=

Check that the stereochemistry at only atom 2 has changed:

In[23]:=
(AssociationThread[Range[#["AtomCount"]], MoleculeValue[#, "AtomChirality"]] // DeleteCases[None]) & /@ {alphaDglucose, betaDglucose}
Out[23]=

Possible Issues (4) 

Ring fusion atoms with small rings are not inverted:

In[24]:=
(mol = Molecule["[C@]12(C)CCC[C@H]1CCC2"]) // MoleculePlot3D[#, {1}] &
Out[24]=
In[25]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[25]=
In[26]:=
(mol = Molecule["[C@]12(C)CC[C@H]1CC2"]) // MoleculePlot3D[#, {1}] &
Out[26]=
In[27]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[27]=

Bridgehead atoms with small rings are not inverted:

In[28]:=
(mol = Molecule["C12COC(C1)CC2"]) // MoleculePlot3D[#, {1}] &
Out[28]=
In[29]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[29]=

Bridgehead atoms in tricyclic and larger ring systems are not inverted:

In[30]:=
(mol = Molecule["C123CCCC1(CCC2)CCC3"]) // MoleculePlot3D[#, {5}] &
Out[30]=
In[31]:=
(invMol = ResourceFunction["InvertAtom"][mol, 5]) // MoleculePlot3D[#, {5}] &
Out[31]=
In[32]:=
(mol = Molecule["C12(C(CCC3)CCCC1CCC4)C3CCCC24"]) // MoleculePlot3D[#, {1}] &
Out[32]=
In[33]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D[#, {1}] &
Out[33]=

Pentacoordinate atoms cannot be inverted:

In[34]:=
(mol = Molecule[
    "P1(C(C)(C)C)(OC(C(F)(F)F)CC1)(N(CC)CC)Cl"]) // MoleculePlot3D
Out[34]=
In[35]:=
(invMol = ResourceFunction["InvertAtom"][mol, 1]) // MoleculePlot3D
Out[35]=

Publisher

Robert Nachbar

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.1 – 08 March 2024
  • 1.0.0 – 06 March 2024

Related Resources

License Information