Hi Toby,

On Fri, Mar 7, 2014 at 11:57 AM, Toby Wright <toby.wri...@inhibox.com>wrote:

> Thanks Greg,
>
> The final strange behaviour I've noticed that could trip fellow users up
> is with matching kekule verses aromatic representations of the same
> molecule in SMARTS against SMILES. Most surprisingly C1=CC=CC=C1 is not a
> substructure of itself but has c1ccccc1 as a substructure (if the lefthand
> term is SMILES and the right is SMARTS in both cases).
> Code to demonstrate what I mean below:
>
> > aromatic_benzene_smiles = Chem.MolFromSmiles('c1ccccc1')
> > aromatic_benzene_smarts = Chem.MolFromSmarts('c1ccccc1')
> > kekule_benzene_smiles = Chem.MolFromSmiles('C1=CC=CC=C1')
> > kekule_benzene_smarts = Chem.MolFromSmarts('C1=CC=CC=C1')
> > aromatic_benzene_smiles.HasSubstructMatch(aromatic_benzene_smarts)
> True
> > aromatic_benzene_smiles.HasSubstructMatch(kekule_benzene_smiles)
> True
> > aromatic_benzene_smiles.HasSubstructMatch(kekule_benzene_smarts)
> False
> > kekule_benzene_smiles.HasSubstructMatch(kekule_benzene_smarts)
> False
> > kekule_benzene_smiles.HasSubstructMatch(aromatic_benzene_smiles)
> True
> > kekule_benzene_smiles.HasSubstructMatch(aromatic_benzene_smarts)
> True
>
> I think I can see why there is a difference in behaviour, a double bond is
> not the same thing as an aromatic bond. In the SMILES case a conversion can
> take place because the context is complete but in the SMARTS case it is not
> (or at least might not be). But I thought I'd point out the issue in any
> case. The workaround is to always explicitly make atoms aromatic in SMARTS
> if you wish them to match aromatic SMILES rather than relying on the kekule
> representation to sort it for you.
>

There have been a couple of discussion of related topics on the list
already. There is a nice discussion of this in the Daylight Theory Manual
page for SMARTS:
http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html look for
"SMARTS versus SMILES"

-greg
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to