Rafal,

> this three Mols (m1, m2, m33) below should all represent nitrobenzene,
> right?
> >>> m33=Chem.MolFromSmarts('c1ccccc1[N+](=O)[O-]')
> >>> m1=Chem.MolFromSmiles('c1ccccc1[N+](=O)[O-]')
> >>> m2=Chem.MolFromSmiles('c1ccccc1N(=O)(=O)')
>

I guess m33 represents nitrobenzene in a sense, but unlike m1 and m2, it
also is a representation of nitrotoluene, nitronapthalene, and all 2-, 3-,
and 4-substituted (and multiply substituted) nitrobenzenes.

If wanted a SMARTS query that would match "only" nitrobenzene, I would
start with something like
'[cH1]1[cH1][cH1][cH1][cH1][cH0]1[NX3H0](~[OX1H0])~[OX1H0]', but even that
might also represent some nitrobenzyl radical cation or something.

*nitrobenz = Chem.MolFromSmiles('c1ccccc1[N+](=O)[O-]')*
*nitrotol = Chem.MolFromSmiles('Cc1ccccc1[N+](=O)[O-]')*
*nitrobenz_smarts =
Chem.MolFromSmarts('[cH1]1[cH1][cH1][cH1][cH1][cH0]1[NX3H0](~[OX1H0])~[OX1H0]')*
*m33=Chem.MolFromSmarts('c1ccccc1[N+](=O)[O-]')*

*print([m.HasSubstructMatch(nitrobenz_smarts) for m in [nitrotol,
nitrobenz]])*
*print([m.HasSubstructMatch(m33) for m in [nitrotol, nitrobenz]])*



> 2. results of HasSubstructMatch is really unexpected:
>
> >>> m2.HasSubstructMatch(m33)
> True
> >>> m1.HasSubstructMatch(m33)
> True
> >>> m33.HasSubstructMatch(m1)
> False
> >>> m33.HasSubstructMatch(m2)
> False
> >>>
>
> m1, m2 is substruct of m33 but m33 is not substuct of m1 or m2. I
> really dont understand this.
> It seems this is problem with smarts mol:
> >>> m33.HasSubstructMatch(m33)
> False
>

I think if you're going to find substructure matches on un-Santized
molecules, you probably want to use the useQueryQueryMatches option.  The
following results in *True*:

*m33.HasSubstructMatch(m33, useQueryQueryMatches=True)*

But it's not clear to me why you would need to query in this way.

I think there likely is some weird behavior of nitro groups that is
happening here, but it's hard to be sure unless we are all using our terms
the same way.


Curt
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to