Re: [Rdkit-discuss] SMARTS and ring closure

2020-01-21 Thread Jean-Marc Nuzillard
Dear Brice and Richard, for some reason, I missed your answers. Many thanks ! I also checked your solution (inserting a ~ between C and n) with SMARTSviewer, https://smartsview.zbh.uni-hamburg.de/ , for which I am pleased to advertise. Best, Jean-Marc Le 17/01/2020 à 11:21, Brice Hoffmann a

Re: [Rdkit-discuss] SMARTS and ring closure

2020-01-17 Thread Brice Hoffmann
Dear Jean-Marc, adding '~' between C and ring number seems to work: 'm1 = Chem.MolFromSmiles('C1(=C12)2') m2 = Chem.MolFromSmiles('C1CCC=C(C12)2') pattern = Chem.MolFromSmarts('C~1~C~C~2~C~C~C~C~C~2~C~C~1') print(m1.HasSubstructMatch(pattern)) print(m2.HasSubstructMatch(pattern))

[Rdkit-discuss] SMARTS and ring closure

2020-01-17 Thread Jean-Marc Nuzillard
Dear all, I would like to write a SMARTS chain that matches any compound with a decalin ring system, whatever bond multiplicity. I wrote it as 'C1~C~C2~C~C~C~C~C2~C~C1' with ~ standing for "any bond". The C1-C1 and C2-C2 bonds have the "default type", which is single or aromatic. The code