Dear Yannick, On Thu, Nov 20, 2014 at 5:21 PM, Yannick .Djoumbou <[email protected]> wrote: > IAtomContainer molecule = sp.parseSmiles("CSCCSCO"); > SMARTSQueryTool smarts_pattern = new SMARTSQueryTool("[#6]S[#6]");
OK, that seems to work: http://apps.ideaconsult.net:8080/ambit2/depict/cdk?search=CSCCSCO&smarts=%5B%236%5DS%5B%236%5D > boolean status = smarts_pattern.matches(molecule); > List<List<Integer>> indexes = smarts_pattern.getUniqueMatchingAtoms(); > > smarts_pattern.countMatches() returned 2. However, indexes = [[0, 1, 2]] > (Aren't I supposed to get 2 arrays here ?). I would expect so too. But it could be it counted the first match twice, as 0,1,2 and as 2,1,0, which actually is only 1 unique match. > Trying smarts_pattern.getMatchingAtoms() did not change anything. > > When I changed the structure to "CSCCSC(O)CCCSCC", > > smarts_pattern.countMatches() returned 4, which is wrong too. > > And indexes = [[0, 1, 2], [9, 10, 11]]. Following the above pattern, it could be here too that it missed the "last" match, and thus gives 4 hits because if found the first two substructures in forward and backwards mode (that is normal), resulting in two unique hits... > I am using CDK-1.4.11. Can you please try with a version from the CDK 1.5 series, preferably the latest? I will try to write a unit test against the master branch (1.5 series)... Egon -- E.L. Willighagen Department of Bioinformatics - BiGCaT Maastricht University (http://www.bigcat.unimaas.nl/) Homepage: http://egonw.github.com/ LinkedIn: http://se.linkedin.com/in/egonw Blog: http://chem-bla-ics.blogspot.com/ PubList: http://www.citeulike.org/user/egonw/tag/papers ORCID: 0000-0001-7542-0286 ImpactStory: https://impactstory.org/EgonWillighagen ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

