Hi all,
I'm trying to remove the MCS between two molecules (attached, 02.pdb and 12.pdb) using rdFMCS.FindMCS and AllChem.DeleteSubstructs using the following code: ######################################### from rdkit import Chem from rdkit.Chem import AllChem, rdmolfiles, rdFMCS ######################################### # load molecules: lig02_pdb = open("02.pdb", 'r').read() lig12_pdb = open("12.pdb", 'r').read() lig02_mol = rdmolfiles.MolFromPDBBlock(lig02_pdb) lig12_mol = rdmolfiles.MolFromPDBBlock(lig12_pdb) # make list of molecules to map the MCS to: perturbation_pair = [] perturbation_pair.append(lig02_mol) perturbation_pair.append(lig12_mol) MCS_object = rdFMCS.FindMCS(perturbation_pair, completeRingsOnly=True) MCS_SMARTS = Chem.MolFromSmarts(MCS_object.smartsString) # remove MCS from each molecule: lig02_stripped = AllChem.DeleteSubstructs(lig02_mol, MCS_SMARTS) lig12_stripped = AllChem.DeleteSubstructs(lig12_mol, MCS_SMARTS) # print SMILES of each stripped molecule: print("lig02: " + str(Chem.MolToSmiles(lig02_stripped))) print("lig12: " + str(Chem.MolToSmiles(lig12_stripped))) #print(Chem.MolToMolBlock(MCS_SMARTS),file=open('./MCS.mol','w+')) ######################################### I attached the MCS.mol file as well. The lig12.pdb contains an extra Cl atom, and lig12_stripped should thus contain a single Cl atom after deletion of the MCS substructure (the MCS substructure is equal to lig02.pdb). When running the script it actually contains 0 atoms. I haven't been able to locate the source of the issue in the AllChem.DeleteSubstructs documentation, does anyone have a suggestion? I'm using a conda install of rdkit (2018.09.1.0). Best, Jenke -------------------------------------------------------------- University of Edinburgh David Brewster road Edinburgh, EH9 3FJ United Kingdom ------------------------------------------------------------- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
12.pdb
Description: 12.pdb
02.pdb
Description: 02.pdb
MCS.pdb
Description: MCS.pdb
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss