Substructure highlighting not working in some cases

User 7a9cb0374c

30-01-2014 19:54:50

Hi Chemaxon,


As part of a substructure search, we highlight the substructure in each of the matching molecules. In some cases, the highlighting does not complete because no hits are found even when the molecule and substructure are the same.


For a test case, I have been using caffeine (see attached Molfile). The specific part of the highlighting code that is generating unexpected results is:


public static int[][] findHits(Molecule targetMol, Molecule queryMol) {
    MolSearch search = new MolSearch();
    MolSearchOptions options = new MolSearchOptions(MolSearchOptions.SUBSTRUCTURE);
    options.setHitIncludesRNodes(true);
    search.setSearchOptions(options);
    search.setQuery(query);
    search.setTarget(target);

    int[][] hits = null;
    try {
        hits = search.findAll();
    } catch (SearchException e) {
        throw new CannotHighlightException(e);
    }
  }

More specifically, search.findAll() is returning null even when query and target are the same structure.


I am using JChem version 6.1.7.


Xiao

ChemAxon abe887c64e

03-02-2014 09:12:17

Hi Xiao,


The second caffeine.mol is an empty file; it was the query or the target or the result of the substructure search?


My second comment: You have to use StandardizedMolSearch instead of MolSearch if you want to take aromatization into account during the search.


Krisztina

ChemAxon a9ded07333

03-02-2014 10:46:51

Hi Xiao,


Just a quick reflection on your post: I would like to ask you to doublecheck whether you have used copy-paste for inserting your code snippet.


If yes, then this method surely won't give you the expected results, since it gets queryMol and targetMol as parameters but uses query and target as structures for search.


Regards,
Tamás

User 7a9cb0374c

04-02-2014 22:21:03

Hi Krisztina,


The second caffeine.mol was empty and was attached by accident. I did not see a way to remove the attachment, but I should have clarified after attaching the non-empty file.



Re: StandardizedMolSearch - That seems to be doing the trick. Thanks!


 


Hi Tamas,


My apologies, that was a bad copy-paste. I wrote up my original post hastily. Thanks for your help though!


Xiao