> and there's a comment from ghutchis last year saying he should have some code > that does this fairly soon, so I guess this question is directed at Geoff: Is > this something that's stayed out because it's low priority or because it > turns out to be more difficult than anticipated? > > If someone can point me in the right direction (and it doesn't involve major > re-writing of the smarts parser) I'd be happy to try and get this working...
It's a lot more work than anticipated. (I also opened my big mouth recently about fixing cis/trans matching for SMARTS.) For one, the code for *parsing* the SMARTS is tricky to modify. I have also seen these projects have also been lower priority than fixing stereo errors, crashes, etc. For parsing, there's currently a block on '.' but once you remove that, you'd want to handle it something like an AND operator. (Sorry, it's late, so I can't remember operator precedence on '.' versus the ANDs in SMARTS.) Once you add '.' as another type of operator, my approach was something like this: 1) Ensure that each component matched the OBMol as a SMARTS itself (i.e., throw away easy rejects) 2) Ensure that there are at least as many contiguous fragments in the OBMol as there are components in the SMARTS (more rejects). 3) For each component SMARTS, go through the matches and determine which contiguous fragment it's in. 4) Now the hard work -- iterating through the components and their matches: * OK, now you have a list of component SMARTS, each with a list of matching contiguous fragments: * for component one, take a matching fragment. * check component two, see if there's a match that's *not* the same as component one * If no, reject early * If yes, continue down the line to make sure we can find unique fragments for each SMARTS component I'm sure that's the naive, brute-force method, but it should work. I'd be more than happy to give further pointers and/or hand-holding. Best regards, -Geoff ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel