**Configuration:** - RDKit Version: 2019.09.1
**Description:** I am attempting to perform an r-group decomposition on a set of molecules which vary slightly within the rings of the MCS (N/O positions within the ring structure). I first calculated the MCS using FindMCS function and then filtered based on a threshold, followed by an attempt to RGD. I did try several different options for MCS (see the commented out **mcs_varied** line below. I am wondering if this is the expected behavior and perhaps I am asking too much of the RGD function to handle SMARTS where multiple atoms are possible? Or perhaps I am in error in the params I am using? Thank you for any help you can provide. --------------------------------------------------------------------------- smiles_list = ['CN(C)CC1CC2c3cc(F)ccc3Cc3ccc(F)cc3N2O1', 'CN(C)CCC1CC2c3ccccc3Cc3ccccc3N2O1', 'CN(C)CC1CC2c3cccnc3Cc3ccccc3N2O1', 'CN(C)CC1CC2c3ccccc3Cc3ccncc3N2O1', 'Cc1ccc2c(c1)N1OC(CN(C)C)CC1c1ccccc1C2', 'CN(C)CC1CC2c3ccccc3Cc3ccc(F)cc3N2O1', 'CN(C)CC1CC2c3ccccc3Cc3ccccc3N2O1', 'CN(C)CC1CC2c3ccccc3Cc3ccc(Cl)cc3N2O1', 'CN(C)CC1CC2c3ccccc3Cc3ccccc3C2O1'] ms = [Chem.MolFromSmiles(m) for m in smiles_list] #MCS mcs_varied = rdFMCS.FindMCS(ms,atomCompare=rdFMCS.AtomCompare.CompareAny, threshold=0.8) #mcs_varied = rdFMCS.FindMCS(ms, atomCompare=rdFMCS.AtomCompare.CompareAny, bondCompare=rdFMCS.BondCompare.CompareOrder, ringMatchesRingOnly=True, completeRingsOnly=True, threshold=0.8) #filter off those which do not match the thresholded smarts from mcs... patt = Chem.MolFromSmarts(mcs_varied.smartsString) matches = [] for mol in ms: if mol.HasSubstructMatch(patt): matches.append(mol) #perform RGD print (mcs_varied.smartsString) --------------------------------------------------------------------------- output >>[#6]-[#7](-[#6])-[#6]-[#6]1-[#6,#8]-[#6,#7]2-[#7,#6](-[#8,#6]-1)-[#6]1:[#6]:[#6,#7]:[#6]:[#6]:[#6]:1-[#6]-[#6]1:[#6]-2:[#6]:[#6]:[#6]:[#7,#6]:1 --------------------------------------------------------------------------- core = Chem.MolFromSmarts(mcs_varied.smartsString) res, unmatched = rdRGD.RGroupDecompose([core], matches, asSmiles=True) --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-271-bb8c2d599741> in <module> 28 core = Chem.MolFromSmarts(mcs_varied.smartsString) 29 ---> 30 res, unmatched = rdRGD.RGroupDecompose([core],matches,asSmiles=True) RuntimeError: Invariant Violation Duplicate labels in rgroup core! Violation occurred on line 101 in file Code/GraphMol/RGroupDecomposition/RGroupDecomp.cpp Failed Expression: atoms.find(rlabel) == atoms.end() RDKIT: 2019.09.1 BOOST: 1_67 --------------------------------------------------------------------------- In case you want to quickly view the structures on your end... --------------------------------------------------------------------------- AllChem.Compute2DCoords(core) for m in matches: AllChem.GenerateDepictionMatching2DStructure(m,core) Draw.MolsToGridImage(matches,molsPerRow=4,subImgSize=(200,200)) -- Dennis Moccia
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss