10.4. Local Geometry and Stereochemistry

10.4.1. Stereospecific Aconitase

Modelling of the reaction performed by the aconitase enzyme in the citric acid cycle: citrate to D-isocitrate. The rule implements the stereo-specificity of the reaction.

Explore in the playground.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
water = smiles("O", "H_2O")
cit = smiles("C(C(=O)O)C(CC(=O)O)(C(=O)O)O", name="Cit")
d_icit = smiles("C([C@@H]([C@H](C(=O)O)O)C(=O)O)C(=O)O", name="D-ICit")

aconitase = ruleGMLString("""rule [
   ruleID "Aconitase"
   left [
      # the dehydrated water
      edge [ source 1 target 100 label "-" ]
      edge [ source 2 target 102 label "-" ]
      # the hydrated water
      edge [ source 200 target 202 label "-" ]
   ]
   context [
      node [ id 1 label "C" ]
      edge [ source 1 target 2 label "-" ] # goes from - to = to -
      node [ id 2 label "C" ]
      # the dehydrated water
      node [ id 100 label "O" ]
      edge [ source 100 target 101 label "-" ]
      node [ id 101 label "H" ]
      node [ id 102 label "H" ]
      # the hydrated water
      node [ id 200 label "O" ]
      edge [ source 200 target 201 label "-" ]
      node [ id 201 label "H" ]
      node [ id 202 label "H" ]
      # dehydrated C neighbours
      node [ id 1000 label "C" ]
      edge [ source 1 target 1000 label "-" ]
      node [ id 1010 label "O" ]
      edge [ source 1000 target 1010 label "-" ]
      node [ id 1001 label "C" ]
      edge [ source 1 target 1001 label "-" ]
      # hydrated C neighbours
      node [ id 2000 label "C" ]
      edge [ source 2 target 2000 label "-" ]
      node [ id 2001 label "H" ]
      edge [ source 2 target 2001 label "-" ]
   ]
   right [
      # The '!' in the end changes it from TetrahedralSym to
      # TetrahedralFixed
      node [ id 1 stereo "tetrahedral[1000, 1001, 202, 2]!" ]
      node [ id 2 stereo "tetrahedral[200, 1, 2000, 2001]!" ]
      # the dehydrated water
      edge [ source 100 target 102 label "-" ]
      # the hydrated water
      edge [ source 1 target 202 label "-" ]
      edge [ source 2 target 200 label "-" ]
   ]
]""")

dg = DG(graphDatabase=inputGraphs,
      labelSettings=LabelSettings(
         LabelType.Term,
         LabelRelation.Specialisation,
         LabelRelation.Specialisation))
dg.build().execute(addSubset(cit, water) >> aconitase)
for e in dg.edges:
   p = GraphPrinter()
   p.withColour = True
   e.print(p, matchColour="Maroon")

10.4.2. Stereoisomers of Tartaric Acid

Generation of stereoisomers of tartaric acid, starting from a model without stereo-information and fixating each tetrahedral embedding.

Explore in the playground.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
smiles("C(C(C(=O)O)O)(C(=O)O)O", name="Tartaric acid")
smiles("[C@@H]([C@H](C(=O)O)O)(C(=O)O)O", name="L-tartaric acid")
smiles("[C@H]([C@@H](C(=O)O)O)(C(=O)O)O", name="D-tartaric acid")
smiles("[C@@H]([C@@H](C(=O)O)O)(C(=O)O)O", name="Meso-tartaric acid")
change = ruleGMLString("""rule [
   ruleID "Change"
   left [
      node [ id 0 stereo "tetrahedral" ]
   ]
   context [
      node [ id 0 label "*" ]
      node [ id 1 label "*" ]
      node [ id 2 label "*" ]
      node [ id 3 label "*" ]
      node [ id 4 label "*" ]
      edge [ source 0 target 1 label "-" ]
      edge [ source 0 target 2 label "-" ]
      edge [ source 0 target 3 label "-" ]
      edge [ source 0 target 4 label "-" ]
   ]
   right [
      node [ id 0 stereo "tetrahedral[1, 2, 3, 4]!" ]
   ]
]""")

dg = DG(graphDatabase=inputGraphs,
      labelSettings=LabelSettings(
         LabelType.Term,
         LabelRelation.Specialisation,
         LabelRelation.Specialisation))
dg.build().execute(addSubset(inputGraphs) >> repeat(change))

p = GraphPrinter()
p.setMolDefault()
p.withPrettyStereo = True
change.print(p)
p = DGPrinter()
p.withRuleName = True
p.withRuleId = False
dg.print(p)

10.4.3. Non-trivial Stereoisomers

Generation of stereoisomers in a non-trivial molecule.

Explore in the playground.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
g = smiles("N[C@](O)([C@](S)(P)(O))([C@](S)(P)(O))")
change = ruleGMLString("""rule [
   ruleID "Change"
   left [
      node [ id 0 stereo "tetrahedral" ]
   ]
   context [
      node [ id 0 label "*" ]
      node [ id 1 label "*" ]
      node [ id 2 label "*" ]
      node [ id 3 label "*" ]
      node [ id 4 label "*" ]
      edge [ source 0 target 1 label "-" ]
      edge [ source 0 target 2 label "-" ]
      edge [ source 0 target 3 label "-" ]
      edge [ source 0 target 4 label "-" ]
   ]
   right [
      node [ id 0 stereo "tetrahedral[1, 2, 3, 4]!" ]
   ]
]""")

dg = DG(graphDatabase=inputGraphs,
      labelSettings=LabelSettings(
         LabelType.Term,
         LabelRelation.Specialisation,
         LabelRelation.Specialisation))
dg.build().execute(addSubset(inputGraphs) >> repeat(change))

p = GraphPrinter()
p.setMolDefault()
p.withPrettyStereo = True
change.print(p)
p = DGPrinter()
p.withRuleName = True
p.withRuleId = False
dg.print(p)