On Jan 7, 2010, at 2:00 PM, Andreas Maunz wrote:
> Right now I found that calling kekulize() before match() does the trick,
> at least for the example
> f: [#7]-[#6]=[#6]-[#6]=[#6]-[#6]-[#6]-[#6]
> m: c1cc(CCNC)ncc1
That works in this case because of luck. There are two possible ways to
kekulize that aromatic structure, and what it chose happens to match your
pattern. But other ways of writing the SMILES, differing only on the order of
the atoms in the SMILES string, will not match the pattern.
Aromatic terms in SMILES and SMARTS are used to avoid being so specific on the
bonding pattern. But since you aren't using aromaticity, you need some other
solution.
Try this: instead of "-" to match a single bond, use "-,:" which matches
"single or aromatic", and instead of "=" to match a double bond used "=,:"
which matches "double or aromatic".
Cheers!
Andrew
[email protected]
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
OpenBabel-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel