Reaction binary format throws away stereo chemistry #1257

Open
bp-kelley opened this Issue Jan 9, 2017 · 0 comments

Projects

None yet

1 participant

@bp-kelley
Contributor

Rxn block below - product is a glucose

sugar.rxn
  ChemDraw01091716252D

  0  1
$MOL



 12 12  0  0  0  0  0  0  0  0999 V2000
   -1.6271    1.1845    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7537    0.4787    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7537   -0.4785    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.1555    0.9572    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.1555   -0.9631    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -1.3460   -0.9631    0.0000 H   0  0  0  0  0  0  0  0  0  0  0  0
   -0.1555    1.9263    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.4367    0.4787    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
   -0.1555   -1.9263    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
    0.4367   -0.4785    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.0349   -0.9631    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.6271   -0.4785    0.0000 O   0  0  0  0  0  0  0  0  0  0  0  0
  2  1  1  1        0
  2  3  1  0        0
  2  4  1  0        0
  3  5  1  0        0
  3  6  1  6        0
  4  7  1  1        0
  4  8  1  0        0
  5  9  1  6        0
  5 10  1  0        0
 10  8  1  0        0
 10 11  1  6        0
 11 12  1  0        0
M  END

Test

rxn = AllChem.ReactionFromRxnBlock(open("sugar.rxn").read())
for prod in rxn.GetProducts():
    s = Chem.MolToSmiles(prod, isomericSmiles=True)

rxn = AllChem.ChemicalReaction(rxn.ToBinary())

for prod in rxn.GetProducts():
    s2 = Chem.MolToSmiles(prod, isomericSmiles=True)
    assert s == s2, "%s %s"%(s, s2)

output

AssertionError: [H]C1[C@@H](O)[C@@H](O)O[C@H](CO)[C@@H]1O [H]C1C(O)C(O)OC(CO)C1O
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment