Hello Changge,

By default, RDKit throws away hydrogens. If you add explicit hydrogens to
mol using AddHs(), it should work. Just add the line

mol = Chem.AddHs(mol)

Ling


On Thu, Jan 19, 2017 at 9:49 AM, Changge Ji <chicago...@gmail.com> wrote:

> Dear All,
>
>  I'm a new to rdkit.
>
> I fount that the molecule 'c1ccccc1' don't fit to the smarts
> 'c1cc([#1,F,Cl,I])ccc1'
>
> -------------------------------------------------------
> mol =  Chem.MolFromSmiles('c1ccccc1')
> fap = FragmentMatcher.FragmentMatcher()
> smarts = 'c1cc([#1,F,Cl,I])ccc1'
> fap.Init(smarts)
> tp = fap.HasMatch(mol)
>
> result : tp = 0
> -----------------------------------------------------
>
> It seems that it is due to the explict H atom in smarts.
>
> How can I make my smarts work?
>
> Thank you for your help.
>
>
>
>
> Best,
>
>
> ------------------------------
> Changge
>
> ------------------------------------------------------------
> ------------------
> 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
>
>
------------------------------------------------------------------------------
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