Hi Christos,
The Hs are, by default, left in the query graph when you construct the
molecule from SMARTS.
They will only match when the molecule you are matching against also has an
H in the graph.
Chem.MolToSmarts() takes an optional "mergeHs" argument that will get you
the behavior you want:
In [9]: m1 =
Chem.MolFromSmarts("[C:3][C:4](=[O:5])[O:6]([H:100])",mergeHs=True)
In [10]: Chem.MolFromSmiles("CCCCCCCCCCCCCC(=O)O").HasSubstructMatch(m1)
Out[10]: True
In [11]: Chem.MolFromSmiles("CCCCCCCCCCCCCC(=O)[O-]").HasSubstructMatch(m1)
Out[11]: False
In [12]: Chem.MolFromSmiles("CCCCCCCCCCCCCC(=O)OC").HasSubstructMatch(m1)
Out[12]: False
Hope this helps,
-greg
On Wed, Feb 19, 2014 at 11:25 AM, Christos Kannas <chriskan...@gmail.com>wrote:
> Hi all,
>
> At my current project I'm working on reaction based multiobjective de novo
> design.
> And I have a set of reactions that I have converted into SMIRKS and
> reaction SMARTS..
>
> The problem I have is that when I have a reactant pattern in SSMARTS, as
> required by SMIRKS, that has explicit mapped Hydrogens that play a role in
> reaction, and I request a substructure search matching to a compound that
> has the substructure in question it can not find a match. But when I change
> the pattern to not have explicit mapped hydrogens the substructure matching
> search is successful.
>
> To help you understand I've created this small IPython Notebook
> http://nbviewer.ipython.org/gist/CKannas/9089271
>
> Can you give me the reasons why this happens?
>
> Best,
> Christos
>
> --
>
> Christos Kannas
> Researcher
> Ph.D Student
>
> Mob (UK): +44 (0) 7447700937
> Mob (Cyprus): +357 99530608
>
> [image: View Christos Kannas's profile on
> LinkedIn]<http://cy.linkedin.com/in/christoskannas>
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss