Hi Xiaobo,

as this molecule does not contain the middle aromatic ring, the bonds connecting the two /m/-toluyl substituentsto the carbonyl group are actually single, so the SMARTS pattern specifying explicit single bonds matches.


Cheers,

p.


On 02/19/19 23:42, Li, Xiaobo [xiaoboli] wrote:

Hi Paolo,


Thanks.


But why this returns True?


m=Chem.MolFromSmiles('C1=CC=C(C=C1C(C2=CC(=CC=C2)C)=O)C')
s=Chem.MolFromSmarts('c1ccccc1-[#6](-c2ccccc2)=[#8]')
m.HasSubstructMatch(s)


Output: True


m




Best regards,


Xiaobo Li



------------------------------------------------------------------------
*From:* Paolo Tosco <paolo.tosco.m...@gmail.com>
*Sent:* 19 February 2019 23:15
*To:* Li, Xiaobo [xiaoboli]
*Subject:* Re: [Rdkit-discuss] Why this doesn't work? HasStructMatch function

Hi Xiaobo,


it will work if you use as SMARTS query one of the following expressions, not if you specify an explicit single bond, as those two bonds are aromatic in molecule m:


s=Chem.MolFromSmarts('c1ccccc1[#6](c2ccccc2)=[#8]')
s=Chem.MolFromSmarts('c1ccccc1~[#6](~c2ccccc2)=[#8]')
s=Chem.MolFromSmarts('c1ccccc1:[#6](:c2ccccc2)=[#8]')

Cheers,
p.

On 02/19/19 22:41, Li, Xiaobo [xiaoboli] 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

s

Best regards,
Xiaobo Li




_______________________________________________
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