I am trying to map atoms in one molecule to those of another using GetSubstructMatch, but have a problem with molecule pairs like the two below
The problem is that GetSubstructMatch ignored the H on the n, so that the protonated ān" in mol1 is mapped to the deprotonated ānā in mol2, and vice versa Is there a way to fix this? Best regards, Jan smiles1 = "ClCc1[nH]c(c2n1)cccc2" smiles2 = "c1(I)cc(I)c2c(c1)nc(CCl)[nH]2" mol1 = Chem.MolFromSmiles(smiles1) mol2 = Chem.MolFromSmiles(smiles2) order_mol1 = list(mol1.GetSubstructMatch(mol1)) order_mol2 = list(mol2.GetSubstructMatch(mol1)) print order_mol2 atom_map = dict(zip(order_mol1,order_mol2)) print atom_map Draw.DrawingOptions.includeAtomNumbers=True img = Draw.MolsToGridImage([mol1,mol2],molsPerRow=4,subImgSize=(200,200),useSVG=False) img ------------------------------------------------------------------------------ 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 Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss