Re: [Rdkit-discuss] Why this doesn't work? HasStructMatch function
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Li, X. [xiaoboli] <Xia...@li...> - 2019-02-20 16:56:33
|
Hi Greg,
Thanks. Now I understand it.
Best regards,
Dr. Xiaobo Li
Postdoctoral Research Associate
Andrew I. Cooper Group
University of Liverpool / Materials Innovation Factory
Department of Chemistry
Crown Street
Liverpool, L69 7ZD
United Kingdom
From: Greg Landrum [mailto:gre...@gm...]
Sent: 20 February 2019 07:37
To: Li, Xiaobo [xiaoboli] <Xia...@li...>
Cc: Rdk...@li...
Subject: Re: [Rdkit-discuss] Why this doesn't work? HasStructMatch function
The middle ring in your system is considered to be aromatic. You can see this by looking at the output SMILES:
In [3]: m=Chem.MolFromSmiles('CN(C(C=CC=C1)=C1C2=O)C3=C2C=CC=C3')
In [4]: Chem.MolToSmiles(m)
Out[4]: 'Cn1c2ccccc2c(=O)c2ccccc21'
Given this, you need either the ~ bond (which matches anything) instead of -, or you could avoid specifying the bond order in your query. In SMARTS a bond that's not specified is either single or aromatic:
In [5]: s=Chem.MolFromSmarts('c1ccccc1[#6](c2ccccc2)=[#8]')
In [6]: m.HasSubstructMatch(s)
Out[6]: True
Best,
-greg
On Tue, Feb 19, 2019 at 11:56 PM Jason Biggs <jas...@gm...<mailto:jas...@gm...>> wrote:
Change your pattern to use ~ as an unspecified bond instead of - for a single bond:
>m=Chem.MolFromSmiles('CN(C(C=CC=C1)=C1C2=O)C3=C2C=CC=C3')
>s=Chem.MolFromSmarts('c1ccccc1~[#6](~c2ccccc2)=[#8]')
>m.HasSubstructMatch(s)
True
Jason
On Tue, Feb 19, 2019 at 4:42 PM Li, Xiaobo [xiaoboli] <Xia...@li...<mailto:Xia...@li...>> wrote:
Dear all,
Why the output is False?
m=Chem.MolFromSmiles('CN(C(C=CC=C1)=C1C2=O)C3=C2C=CC=C3')
s=Chem.MolFromSmarts('c1ccccc1-[#6](-c2ccccc2)=[#8]')
m.HasSubstructMatch(s)
Output: False
m
[cid:image001.png@01D4C93D.34643F00]
s
[cid:image002.png@01D4C93D.34643F00]
Best regards,
Xiaobo Li
_______________________________________________
Rdkit-discuss mailing list
Rdk...@li...<mailto:Rdk...@li...>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________
Rdkit-discuss mailing list
Rdk...@li...<mailto:Rdk...@li...>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
|