Kekule.js icon indicating copy to clipboard operation
Kekule.js copied to clipboard

Stereoisomers comparison giving false negative

Open franciscohanna92 opened this issue 4 years ago • 4 comments

Hi there!

I'm trying to do some stereoisomers comparison, but I think Kekule is giving me a false negative. The two stereoisomers that I'm comparing are:

image image

The options for compare are:

{
  "method": 10,
  "doStandardize": false,
  "extraComparisonProperties": [
    "canonicalizationIndex"
  ],
  "lonePair": true,
  "hydrogen_display_type": "IMPLICIT",
  "stereo": true,
  "skeletalMode": true,
  "strictStereoBondGeometry": true,
  "atom": true,
  "compareAtom": true,
  "mass": true,
  "compareMass": true,
  "linkedConnectorCount": true,
  "compareLinkedConnectorCount": true,
  "charge": true,
  "compareCharge": true,
  "radical": true,
  "compareRadical": true,
  "compareStereo": true,
  "hydrogenCount": true,
  "compareHydrogenCount": true,
  "connectedObjCount": true,
  "compareConnectedObjCount": true,
  "bondType": true,
  "compareBondType": true,
  "bondOrder": true,
  "compareBondOrder": true
}

What am I doing wrong here? Is this something that Kekule supports out of the box?

franciscohanna92 avatar Oct 14 '20 17:10 franciscohanna92

I see that the comparison for the following works fine: image image

franciscohanna92 avatar Oct 14 '20 19:10 franciscohanna92

Hi @franciscohanna92, the test with the latest dist of Kekule.js gives a positive result: 图片 Please try again with the latest files on GitHub, since in some old releases, there did exist a bug that causes wrong comparison result on molecules with explicit hydrogen atoms. By the way, when doing molecule comparison, it is recommended to set doStandardize option to true. Otherwise the molecules may not be canonicalized before comparison, thus a wrong result may be invoked too.

partridgejiang avatar Oct 15 '20 07:10 partridgejiang

Hi @partridgejiang , thanks for your answer. Indeed, the latest version of Kekule works fine. Sadly, we have a heavily modified version of it, for which its maintainers no longer work on the project.

I see that the point of failure (for the example above) in our Kekule version is this line https://github.com/partridgejiang/Kekule.js/blob/fa64625d6486c0aa752dadd10fedaa15310ce275/src/core/kekule.structures.js#L1208

Any clues on why this may be failing? I'm setting doStandardize: true

franciscohanna92 avatar Oct 16 '20 20:10 franciscohanna92

Hi @franciscohanna92, please check if /algorithm/kekule.structures.stereos.js has been modified in your version. If not, perhaps you could overwrite it with the file in this repository directly?

partridgejiang avatar Oct 17 '20 04:10 partridgejiang