#1004 Atommaps incorrect for singleatom molecules

cdk-1.2.x
closed
None
5
2012-11-03
2009-10-29
No

Comparing "[H]" to itself with the UniversalIsomorphismTester.getIsomorphMaps(mol, mol), followed by conversion to atommaps (makeAtomsMapsOfBondsMaps) gives an empty list.

I understand where it's coming from (there are no bonds), but this is either a documentation bug or a corner-case requiring a bug fix, because this molecule is isomorphic to itself and the Tester should yield this result.

Discussion

  • Noel O'Boyle

    Noel O'Boyle - 2009-10-29

    I also have problems with comparing "diatomic" molecules to themselves, e.g. "CN".

     
  • Egon Willighagen

    Noel, next time I'll try to remember to not just read the title and the first line... :)

     
  • Rajarshi Guha

    Rajarshi Guha - 2009-11-10

    For single atom molecules, the main isomoprhism mehtods of the UIT should not be invoked. Rather simply loop over the target molecule atoms seeing if we can match any atom to the query atom. (This is what the SMARTS query tool does)

     
  • Rajarshi Guha

    Rajarshi Guha - 2009-11-12

    I've got a fix that updates getIsomorphMaps to directly match single atom queries. The return value is the same as usual but in this case, RMap refers to atom indices rather than bond indices - thus there is no need to call makeAtomsMapsOfBondsMaps. However, in the interests of generality, makeAtomsMapsOfBondsMaps is also modified to account for single atom queries. Thus the return value is the appropriate atom-atom mapping (basically, just return the input mapping). This way code for multi-atom queries is the same as for single-atom queries. Unit tests and Javadocs are updated in the patch. Needs review

     
  • Rajarshi Guha

    Rajarshi Guha - 2009-11-12

    Patch is meant for cdk-1.2.x

     
  • Rajarshi Guha

    Rajarshi Guha - 2009-11-18

    Closing since patch with the fix has been applied and pushed

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks