Didn't mean that as a critisism by the way, I just meant to say - I really ought to do a sanity check before sending it to SubstructMatch, but I don't know how! :)
From: [email protected] To: [email protected] Date: Sat, 14 Mar 2009 20:40:09 +0000 Subject: [Rdkit-discuss] Sanity check of a SMARTS expression Hi All, Unsurprisingly, the following C++ code craches: ROMol *mol=SmilesToMol("O1c2cc(c(COCCOCCOCCCC)cc2OC1)CCC"); ROMol *pattern=SmartsToMol("O1c2cc"); std::vector<MatchVectType> matches; unsigned int nMatches = SubstructMatch(*mol,*pattern,matches) I guess because the SMARTS "O1c2cc" is not a valid SMARTS (unclosed branches). The problem is that at runtime SubstructMatch fires an unhandled exception (access violation). Rather than letting the exception crash the thread, it would be better to validate the SMARTS string before sending it to SubstructMatch. Are there any existing ways in the RDKit to do a sanity check on a SMARTS string in C++? Thanks, George. Share your photos with Windows Live Photos – Free. Try it Now! _________________________________________________________________ View your Twitter and Flickr updates from one place – Learn more! http://clk.atdmt.com/UKM/go/137984870/direct/01/

