Unexpected behavior of do_enhanced_stereo_sss? #7190
-
Hi, My problem is this: I enumerate the 2 isomers of a smiles having a single "and" group, and then I search against the results using one of the isomers. My ability to find a match seems to require do_enahanced_stereo_sss = false, but I'm not sure why that would be, since the enumerations have no enhanced stereochemistry in them (also since I'm doing an exact match, not a substructure)? The below example recreates the behavior .. apologies that it involves both API and cartridge .. that's the context I'm developing under. Which I've also retained in its Flask context, just so I can be sure the example code is valid. I'm using 2023_09_4. The below code generates this response:
Thank you for any information. Best, Andrew
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
@someonetookmyname this is too much code for me to wade through in order to try and figure out what is going on. If you'd like help, please make it possible for us to do so by providing a simple reproducible which uses either Python or the cartridge. |
Beta Was this translation helpful? Give feedback.
I'd characterize this as a bug. Here's what's happening: the molecule equality code goes through a bunch of increasingly expensive checks to detect that the two molecules are different. The last of those steps is to generate a SMILES or CXSMILES (in the case of enhanced stereo) for each and compare them. Since CXSMILES includes coordinates by default, this is going to result in molecules with different atomic positions comparing unequal.
In general:
@=
is there because we had to provide a molecular equality operator, but I think it's generally better to do molecular comparison with SMILES (or CXSMILES if you want enhanced stereo) if you can.