Hello Craig,

Craig A. James wrote on 11/16/2009 06:12 PM:
> You may be able to do this using recursive SMARTS.  In a recursive
> SMARTS, an atom expression can itself be a whole SMARTS, ad infinitum. 
> And since an atom can be an OR list of alternatives, you can have an
> atom that is "This OR that", where "this" and "that" are entire SMARTS
> expressions.  I'm not sure if this is what you want, but it might be
> something like this:
> 
>  [#6]-[$([#6]),$([#6]-[#8])]=[#6]

This reads:

1. (carbon) attached to
2. ((a) a carbon OR (b) a carbon attached to an oxygen) attached to
3. (an oxygen),

whereas it is implicitly meant that in case of 2.(b) a branch occurs:

1.2.3.
C-C=C
  |
  O

this is due to the semantics of a recursive expression as "a single atom
with special properties".
In case of 2.(b) the C has the special property of being
(branch-)connected to an O, compared to case 2.(a)
with no special properties for the C.
Am I right here? If yes, this would be the solution I was looking for.

Another aspect of this specific example:
Case 2.(b) is a special case of 2.(a), so that every time 2.(b) matches,
2.(a) also matches.
Therefore, in this case, 2.(b) is not needed at all and the expression
[#6]-[#6]=[#6] would have done the job as well.
In general, a recursive smarts is only necessary if the alternatives are
mutually exclusive.
Is this also correct?

Best regards
Andreas

-- 
http://www.maunz.de
OpenPGP key: http://www.maunz.de/[email protected]_pub.asc

Real programmers don't document. If it was hard to write, it should be
hard to understand.

------------------------------------------------------------------------------
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

Reply via email to