Axel,

You need to use a SMARTS query:

q = Chem.MolFromSmarts("[CR0][CR0][CR0]")

Have a look at http://www.daylight.com/dayhtml/doc/theory/theory.smarts.html

Steve

On 29 June 2018 at 08:04, Axel Pahl <[email protected]> wrote:

> Dear all,
>
> my google-fu is failing is me.
> Is it possible in substructure searches to have chain atoms NOT match ring
> atoms?
>
> In essence, I would like the following example query for n-propane in
> cyclo-hexane to return False (currently it is returning True):
>
> mol = Chem.MolFromSmiles("C1CCCCC1")
> q = Chem.MolFromSmiles("CCC")
> print(mol.HasSubstructMatch(q))  # ==> True
>
> Many thanks in advance for your help.
>
> Kind regards,
> Axel
>
> ------------------------------------------------------------
> ------------------
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to