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 écrit :
Dear Jean-Marc, adding '~' between C and ring number seems to work: 'm1 = Chem.MolFromSmiles('C1CCCC(=C12)CCCC2') m2 = Chem.MolFromSmiles('C1CCC=C(C12)CCCC2') 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)) return True and True Best regards, BriceLe ven. 17 janv. 2020 à 10:55, Jean-Marc Nuzillard <[email protected] <mailto:[email protected]>> a écrit :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 m1 = Chem.MolFromSmiles('C1CCCC(=C12)CCCC2') m2 = Chem.MolFromSmiles('C1CCC=C(C12)CCCC2') pattern = Chem.MolFromSmarts('C1~C~C2~C~C~C~C~C2~C~C1') print(m1.HasSubstructMatch(pattern)) print(m2.HasSubstructMatch(pattern)) prints False for m1 and True for m2 because the double bond in m1 is located at the place of one of the ring closure bonds in pattern. My question is how to write a SMARTS chain that fits in all cases for decalin or any other ring system and is more related to SMARTS-writing than to RDKit, I admit. Best, Jean-Marc--Dr. Jean-Marc Nuzillard Institute of Molecular Chemistry, CNRS UMR 7312 Faculté des Sciences Exactes et Naturelles, Bâtiment 18 BP 1039 51687 REIMS Cedex 2 France Tel : 33 3 26 91 82 10 Fax : 33 3 26 91 31 66 http://www.univ-reims.fr/icmr http://eos.univ-reims.fr/LSD/CSNteam.html ORCID: 0000-0002-5120-2556 http://www.univ-reims.fr/LSD/ http://www.univ-reims.fr/LSD/JmnSoft/ _______________________________________________ Rdkit-discuss mailing list [email protected] <mailto:[email protected]> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss -- Brice HOFFMANN Senior Scientist, Molecular Modeling & Computational Chemistry iktos.ai <http://iktos.ai/> 24 rue chaptal 75009 Paris
-- Jean-Marc Nuzillard Directeur de Recherches au CNRS Institut de Chimie Moléculaire de Reims CNRS UMR 7312 Moulin de la Housse CPCBAI, Bâtiment 18 BP 1039 51687 REIMS Cedex 2 France Tel : 03 26 91 82 10 Fax : 03 26 91 31 66 http://www.univ-reims.fr/icmr http://eos.univ-reims.fr/LSD/CSNteam.html http://www.univ-reims.fr/LSD/ http://www.univ-reims.fr/LSD/JmnSoft/
_______________________________________________ Rdkit-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

