Hi list, this is strictly speaking not an OB question: How can I match a SMARTS pattern with optional branch? Example: My compound is "C-C(-O)=C-C". The SMARTS expressions are s1="[#6]-[#6](-[#8])=[#6]" matches, as well as s2="[#6]-[#6]=[#6]". Since s2 is contained in s1 in terms of subgraphs, I was thinking about combining s1 and s2 into a single SMARTS by enforcing the common part and make the part that solely occurs in s1 (i.e. the branch to oxygen) optional.
Is there a way to combine s1 and s2 into a single SMARTS expression? I know about "([#6]-[#6](-[#8])=[#6],[#6]-[#6]=[#6])", but that is not what I want. I want an expression that states: carbon - single_edge - carbon - optional(begin) (single_edge oxygen) optional(end) - double_edge - carbon i.e. the optional part is "inside" the SMARTS pattern. Any ideas? Greetings Andreas -- http://www.maunz.de OpenPGP key: http://www.maunz.de/[email protected]_pub.asc I do know everything, just not all at once. It's a virtual memory problem. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ OpenBabel-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
