very serious JChem alpha matching problem

User 870ab5b546

22-08-2006 12:38:41

Am I missing something obvious here?





Target structure:





Code:
 


  Marvin  08220608342D         





 11 12  0  0  0  0            999 V2000


   -1.3438    1.3250    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -2.0582    0.9125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -2.0582    0.0875    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -1.3438   -0.3250    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -0.6293    0.0875    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -0.6293    0.9125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


    0.0852    1.3250    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


    0.0852   -0.3250    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


    0.7996    0.0875    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


    0.7996    0.9125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -1.3438    2.1500    0.0000 Cl  0  0  0  0  0  0  0  0  0  0  0  0


  1  2  2  0  0  0  0


  1  6  1  0  0  0  0


  2  3  1  0  0  0  0


  3  4  2  0  0  0  0


  4  5  1  0  0  0  0


  7  6  1  0  0  0  0


  5  6  2  0  0  0  0


  5  8  1  0  0  0  0


  7 10  2  0  0  0  0


  8  9  2  0  0  0  0


  9 10  1  0  0  0  0


  1 11  1  0  0  0  0


M  END








Query structure:





Code:
 


  Marvin  08220608342D         





 11 12  0  0  0  0            999 V2000


   -2.6207    1.1000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -2.6207    0.2750    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -1.9063   -0.1375    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -1.9063    1.5125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -1.9063    2.3375    0.0000 Cl  0  0  0  0  0  0  0  0  0  0  0  0


   -1.1918    1.1000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -0.4773    1.5125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -1.1918    0.2750    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


   -0.4773   -0.1375    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


    0.2372    0.2750    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


    0.2372    1.1000    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0


  4  1  2  0  0  0  0


  4  6  1  0  0  0  0


  1  2  1  0  0  0  0


  2  3  2  0  0  0  0


  3  8  1  0  0  0  0


  4  5  1  0  0  0  0


  6  7  1  0  0  0  0


  8  6  2  0  0  0  0


  8  9  1  0  0  0  0


  9 10  2  0  0  0  0


 11  7  2  0  0  0  0


 10 11  1  0  0  0  0


M  END








Use these parameters:





ourSearch.setExactChargeMatching(true);


ourSearch.setExactIsotopeMatching(true);


ourSearch.setExactRadicalMatching(true);


if (ourSearch.isMatchCountInRelation(">=", 1))





Result: The query is not found in the target. (The target is not a more specific case of the query.)





or use these parameters:





s1.setOption(SearchConstants.OPTION_CHARGE_MATCHING,


SearchConstants.CHARGE_MATCHING_EXACT);


s1.setOption(SearchConstants.OPTION_ISOTOPE_MATCHING,


SearchConstants.ISOTOPE_MATCHING_EXACT);


s1.setOption(SearchConstants.OPTION_RADICAL_MATCHING,


SearchConstants.RADICAL_MATCHING_EXACT);


boolean res1 = s1.isMatching();





and get this result: matchExact_JChem: JChem search result is false

ChemAxon a3d59b832c

22-08-2006 13:35:02

Hi Bob,





I think I found the problem. Comparing aromatic rings is only safe if you aromatize both the query and target molecules prior to search. Alternatively, from JChem 3.2 you can use StandardizedMolSearch class instead of MolSearch, this will do it for you. (This class is already included in the alpha.)





Please let us know if it helps.





Szabolcs

User 870ab5b546

22-08-2006 13:58:52

Unfortunately, it does not help. I need to know whether the positions of the double bonds in the aromatic rings of the two structures are the same or different.





In the previous version of JChem, if we skipped aromaticization, the structures would match if the double bonds were in the same place, and would not if they were not.





Now, if we skip aromaticization, the structures don't match *even if* the double bonds are in the same place.





We need the old behavior back, or some workaround to mimic it.

ChemAxon a3d59b832c

22-08-2006 15:23:23

bobgr wrote:
Unfortunately, it does not help. I need to know whether the positions of the double bonds in the aromatic rings of the two structures are the same or different.





In the previous version of JChem, if we skipped aromaticization, the structures would match if the double bonds were in the same place, and would not if they were not.





Now, if we skip aromaticization, the structures don't match *even if* the double bonds are in the same place.





We need the old behavior back, or some workaround to mimic it.
OK, I see. We will fix it. Use this call for the time being as a workaround:





Code:
s1.setOption(SearchConstants.OPTION_VAGUE_BOND,


    SearchConstants.VAGUE_BOND_OFF);








Best regards,


Szabolcs

User 870ab5b546

22-08-2006 16:21:27

Will this option have any undesired side effects? What does it do, exactly?

ChemAxon a3d59b832c

22-08-2006 16:34:01

bobgr wrote:
Will this option have any undesired side effects?
No, it restores the previous default.
bobgr wrote:
What does it do, exactly?
The new default, VAGUE_BOND_LEVEL1 ensures matching of some ambiguous 5-membered aromatic rings. For more details, see the this UGM presentation: http://www.chemaxon.com/forum/viewpost6491.html#6491


(slides 11-16)





Szabolcs

User 870ab5b546

22-08-2006 16:46:05

Ah, I see.





Beware of changing defaults, because people's code depends on them being a certain value, especially if those values could not be changed previously. You may want to make the vagueness default OFF. If people need the new feature, they will look for it and go to the trouble of turning it on.

User 870ab5b546

22-08-2006 18:35:46

Our bug is fixed now. Thanks!

ChemAxon a3d59b832c

22-08-2006 21:08:00

bobgr wrote:
Beware of changing defaults, because people's code depends on them being a certain value, especially if those values could not be changed previously. You may want to make the vagueness default OFF. If people need the new feature, they will look for it and go to the trouble of turning it on.
Good point. We will think about it.





Thanks.


Szabolcs