partridgejiang / Kekule.js

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

Molecule Mismatch When Element at Different X,Y #178

Closed rfedor-macmillan closed 4 years ago

rfedor-macmillan commented 4 years ago

Hello, I'm new to working with Kekule.js and work with Aaron Llanos and Nate Hayden. I found an issue with the Kekule library where it is not be matching molecules when an element X, Y coordinate is changed by a few pixels as shown in the screenshot below, image

Here's the payloads that were used for the comparisons,

Molecule 1 - unshifted-response.json.txt

Molecule 2 - shifted-response.json.txt

Thank you for your time.

partridgejiang commented 4 years ago

Hi @rfedor-macmillan, in molecule 1, the bonds connected to the bottom chiral center are very near to decussation, so the structure around the chiral center are regarded as a Fischer projection with a certain configuration. While in molecule 2, the structure around the corresponding chiral center is regarded as a normal skeleton with configuration unknown. So the result comparison is false. If such a behavior is not wanted, you can turn off the Fischer projection detection globally:

Kekule.globalOptions.algorithm.stereoPerception.implicitFischerProjection = false;
rfedor-macmillan commented 4 years ago

Thank you very much. I'll be sure to pass that along.