partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

Smiles convert to the other isomer of that molecule #223

Open sowiso opened 3 years ago

sowiso commented 3 years ago

Hi there,

I might have found a small bug. When I use these smiles as input to load, let Kekule draw them and then output/save as a SMILE again, the SMILE-code changes: CC\C=C/CC changes to CC/C=C/CC C\C=C(C)/CC changes to C/C=C(C)/CC

I did notice that this only happens when using Indigo, not with OpenBabel, so this might be an Indigo issue.

partridgejiang commented 3 years ago

Thanks a lot for the feedback. It should be an issue of Indigo toolkit. In our test, the Indigo layout engine ignores the stereo of bonds or chiral centers in a molecule. Both CC\C=C/CC and CC/C=C/CC lead to the same structure as below: 图片 and for SMILES with chiral center (e.g. CCC[C@@H](C)CC), the result also loses the stereo information: 图片 At present, the 2D layout engine of OpenBabel seems ignoring the chiral centers as well, but is able to handling stereo bond correctly.