Hi Markus,

I suspect the problem is that your SMARTS query is not as specific as you
might think.  For example, RDKit does not understand how many rings there
are in your SMARTS query.  Each [a] could be an atom arbitrarily connected
to many other rings that wouldn't be a part of the substructure match.
Thus, RDKit cannot generate a meaningful set of 2D coordinates for your
SMARTS patterns, and defaults somehow to the unhelpful representation you
reported.

Compare:

# define two molecules one from smiles, one from smarts
naphthalene = Chem.MolFromSmiles('c12ccccc1cccc2')
naphthalene_smarts = Chem.MolFromSmarts('c12ccccc1cccc2')

# define a query that hits atoms that are in two rings
in_two_rings = Chem.MolFromSmarts('[R2]')

# find atoms in our molecules that are in two rings
naphthalene.GetSubstructMatches(in_two_rings)
naphthalene_smarts.GetSubstructMatches(in_two_rings)  # fails because the
RingInfo object of this molecule could not be initiated

A path forward for you could be setting the RingInfo of your SMARTS query
manually, but I"m not exactly sure how to do that.  Maybe others could
weigh in?  Here's a SMARTS that might be useful: it should hit any molecule
that consists of an aromatic benzene fused to any (aromatic or aliphatic)
five-membered ring:
benzene_with_five_membered_fusion =
Chem.MolFromSmarts('[*r5R1]1[cR2]2[cR1][cR1][cR1][cR1][cR2]2[*r5R1][*r5R1]1')

Curt

On Wed, Sep 21, 2016 at 11:47 AM, Markus Metz <metm...@gmail.com> wrote:

> Hello all:
>
> I am trying to perform a 2D alignment of molecules by using a pattern for
> which I am using Compute2DCoords.
>
> If I use a smarts string matching napthalene the 2D depiction is as one
> would expect.
> However, if I am switching to a 5,6 aromatic smarts pattern the matched
> benzoxazol the 2D structure looks rather unusual.
>
> Is there a way to match the 5,6 with the 6,6 pattern behavior?
>
> Any hint is very much appreciated,
>
> Markus
>
> P.S. a work book is attached.
>
> ------------------------------------------------------------
> ------------------
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to