Menu

#1011 UniversalIsomorphismTester and/or SMARTS parsing issue

open
nobody
5
2012-10-08
2009-11-10
No

SMARTSQueryTool says that C1CC1 matches C1C(C)CC1 and C1C(C)CN1. I see this with 1.2.2, 1.2.3 and 1.3.0.
SMARTSQueryTool correctly says that C1CC1 does NOT match C1CCC1.

I have only seen the problem with cyclopropane. For example, SMARTSQueryTool correctly says that cyclobutane is not a match to cyclopentane, and it also correctly says that cyclobutane does not match C1C(C)CCC1.

It looks to me like there might be a problem in the SMARTS parser. After parsing, two of the bonds for the SMARTS C1CC1 are AromaticOrSingleBond, the third bond is a RingBond. It shouldn't be a RingBond because there is no "@" in the SMARTS. Cyclobutane has the same problem, three of the bonds are AromaticOrSingleBond and the fourth is a RingBond.

To narrow down what is going on I tried constructing the QueryAtomContainer for C1CC1 "by hand", making sure that all three bonds were AromaticOrSingleBond. The "by hand" QueryAtomContainer showed the same behavior, incorrectly matching C1C(C)CC1 but correctly not matching C1CCC1. Assuming I did the "by hand" construction correctly that seems to indicate the matching problem occurs in UniversalIsomorphismTester.isSubgraph(...), not the SMARTS parser.

I've attached some example code.

Discussion

  • Wayne Volkmuth

    Wayne Volkmuth - 2009-11-10

    example code

     
  • Rajarshi Guha

    Rajarshi Guha - 2009-11-10

    This issue derives from the fact the UIT considers cyclopropane and isobutane isomorphic (this is noted in theUIT Javadocs). As a result, C1C(C)CC1, contains an isobutane substructure, which thus matches the query - explaining why you see the match

     
  • Wayne Volkmuth

    Wayne Volkmuth - 2009-11-11

    Thanks, got it. Any thoughts on incorporating a fix in trunk? The warning in the UIT docs suggests it's better to leave the bug in but is that really desirable?

    Also, any thoughts on why the SMARTS parser assigns one of the bonds to be a RingBond for C1CC1 and C1CCC1 (and presumably larger rings, but I didn't check)? It seems that all the bonds should be AromaticOrSingleBond?

     
  • Rajarshi Guha

    Rajarshi Guha - 2009-11-16

    Regarding the query bond assignment - I'm surprised that just one of the bonds is a RingBond. I'm not sure where that came from