A short study of hexose sugars​
​by J. M.​
7/2/2022
Hexoses are simple carbohydrates (monosaccharides) that contain six carbon atoms. Some of the more famous hexoses include the sugars glucose and fructose. These are chemical entities known to Mathematica:
MoleculePlot[#,PlotLabel->#]&/@
D-(+)-glucose
CHEMICAL
,
D-(-)-fructose
CHEMICAL


,

It is interesting to see if we can generate hexoses ab initio using the built-in functionality, and with minimal recourse to the Wolfram Knowledgebase. Let us consider only the D-series hexoses, since these are the ones that predominantly occur in nature. First, we will consider the aldohexoses, which are the hexoses with an aldehyde (–CH=O) functional group. Here is the generic aldohexose, represented through a SMILES string:
MoleculePlot[hexose=Molecule["O=CC(O)C(O)C(O)C(O)CO"]]
This has four possible stereocenters:
Length[MoleculeValue[hexose,"PossibleStereocenters"]]
4
Now, the D-series aldohexoses correspond to fixing the stereochemistry of one of the stereocenters to be R; specifically, the carbon atom highlighted below:
To pick out that particular carbon, we can use the function
FindMoleculeSubstructure
with
MoleculePattern
and an appropriately constructed recursive SMARTS:
dCenter=FindMoleculeSubstructure[hexose,MoleculePattern["[$([CX4H][CH2]O)]"]]//Values
{{9}}
Having identified the position of that special carbon, the generic D-aldohexose can be constructed using
MoleculeModify
:
dHexose=MoleculeModify[hexose,{"SetAtomChirality",dCenter[[1,1]]->"R"}]
Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23

This leaves three stereocenters still free:
centers=Complement[MoleculeValue[dHexose,"PossibleStereocenters"],First[dCenter]]
{3,5,7}
From that, it can be seen that there are
4-1
2
=8
possible D-aldohexoses. With the help of Tuples and MoleculeModify again, we can see them all:
dHexoseList=Table[MoleculeModify[dHexose,{"SetAtomChirality",Thread[centers->stereo]}],{stereo,Reverse[Tuples[{"R","S"},3],2]}]
Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
23

Molecule happens to also recognize the names of these D-aldohexoses, so use
MoleculeMatchQ
to check that they were generated correctly:
dHexoseNames={"D-allose","D-altrose","D-glucose","D-mannose","D-gulose","D-idose","D-galactose","D-talose"};
MapThread[MoleculeMatchQ,{dHexoseList,Molecule/@dHexoseNames}]
{True,True,True,True,True,True,True,True}
Show them all together:
MapThread[MoleculePlot[#1,PlotLabel->#2]&,{dHexoseList,dHexoseNames}]//OperatorApplied[Partition][4]//GraphicsGrid
You may now ask why these structures look nothing like the structures shown in the beginning of this post. This is because hexoses can exist in two forms, an open chain form like the ones depicted immediately above (this form is usually seen in solution), and a cyclic hemiacetal form where one of the hydroxyl groups in the hexose reacts with the carbonyl group, resulting in a ring structure. To see these ring structures, the functions
PatternReaction
and
ApplyReaction
, which are new in version 13.1, can be used together to transform the open chain forms into cyclic forms. Here is a PatternReaction for forming the hemiacetal, which uses a reaction SMARTS:
hemiac=PatternReaction["([$([OX2][CX4H][CX4H2]):1].[CX3:2](=[O:3]))>>([O:1][C:2][O:3])"]
Transform all 8 D-aldohexoses into their cyclic forms:
dHexoseCyclicList=First[ApplyReaction[hemiac,{#}]]&/@dHexoseList
Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24
,Molecule
Formula:
C
6
H
12
O
6
Atoms:
24
Bonds:
24

Molecule is again smart enough to know the names of the cyclic forms, so we can do another check with MoleculeMatchQ:
dHexoseCyclicNames=StringReplace[dHexoseNames,"se"->"pyranose"]
{D-allopyranose,D-altropyranose,D-glucopyranose,D-mannopyranose,D-gulopyranose,D-idopyranose,D-galactopyranose,D-talopyranose}
MapThread[MoleculeMatchQ,{dHexoseCyclicList,Molecule/@dHexoseCyclicNames}]
{True,True,True,True,True,True,True,True}
Show all the cyclic D-aldohexoses:
MapThread[MoleculePlot[#1,PlotLabel->#2]&,{dHexoseCyclicList,dHexoseCyclicNames}]//OperatorApplied[Partition][4]//GraphicsGrid
Now, let us take a closer look at D-glucopyranose:
MoleculePlot[glu=dHexoseCyclicList[[3]]]
It can be seen that there is still one stereocenter that is undetermined; this is the so-called anomeric carbon which was formed during the cyclization to the hemiacetal. Find the position of this anomeric carbon, again using a recursive SMARTS pattern:
The two forms of D-glucopyranose can then be generated like this:
These two forms are respectively called α-D-glucopyranose and β-D-glucopyranose. We can visualize their 3D structure like so:
α-D-glucopyranose is the building block of the complex carbohydrate (polysaccharide) known as starch (itself a mixture of the polysaccharides amylose and amylopectin), while β-D-glucopyranose is the building block of the polysaccharide cellulose. This difference in the stereochemistry of one carbon is enough to make the properties of starch and cellulose differ; for example, human beings are able to digest starch, but not cellulose, because the enzymes involved in digestion are specific for the linkages that involve the α form.
Let us now consider the other type of hexoses, called ketohexoses. These have a ketone group instead of an aldehyde group, and generically look like this:
Ketohexoses have three stereocenters:
Visualize the D-ketohexoses:
Again in analogy to the D-aldohexoses, the D-ketohexoses both have an open chain form (depicted immediately above) and a cyclic form. We again proceed in an analogous fashion:
Proceeding further with D-fructofuranose, let us also fix the stereochemistry of its anomeric carbon, thus leading to its α and β forms:
One can go even further with computationally investigating the properties of sugars (or other molecules in general), but we will stop here lest this post get too long. (For instance, why is the cyclic form shown above for fructose apparently different from the cyclic form depicted in the Wolfram Knowledgebase?) Hopefully, this exploration has amply demonstrated the breadth of available molecular computation functionality in Mathematica, as well as inspiring other users to carry out similar explorations.
Acknowledgements​
I would like to thank Jason Biggs for helping me streamline some of the code used in this post.