rdkit/rdkit-js

Losing bond stereo on molecules

mwojcikowski opened this issue · 1 comments

RDKit-js loses double bond stereo when generating molblock

var smiles = "F\C=C\F";
var mol = RDKitModule.get_mol(smiles);
var mol2 = RDKitModule.get_mol(mol.get_molblock());
console.log(mol2.get_smiles())

This will produce: FC=CF

Expected behavior
produce: F\C=C\F

Debugging
Produced molblock is wrong, it does not contain bond stereo information


     RDKit          2D

  4  3  0  0  0  0  0  0  0  0999 V2000
   -1.2990    0.7500    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.2990    0.7500    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.5981   -0.0000    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
  2  3  2  3  <----
  3  4  1  0
M  END

In python the molblock is good Chem.MolToMolBlock(Chem.MolFromSmiles('F\C=C\F'))


     RDKit          2D
  4  3  0  0  0  0  0  0  0  0999 V2000
   -0.7500   -1.2990    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    1.5000    0.0000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.2500    1.2990    0.0000 F   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  1  0
  2  3  2  0
  3  4  1  0
M  END

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome
  • Version 110

Additional context
RDKit version available on rdkitjs.com

Turns out that is the issue with escaping... Following works correctly!

var smiles = "F\\C=C\\F";
...