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.
_________________________________________________________________
25GB of FREE Online Storage – Find out more
http://clk.atdmt.com/UKM/go/134665320/direct/01/