Hi all, I'm trying to draw two similar molecules with slightly different scaffolds in the same orientation. I can't define a pattern to use for GenerateDepictionMatching2DStructure, so I was instead trying to get the MCS of the two molecules, get the coordinates of the MCS from the first molecule, and use those to depict the second with coordMap, similarly as in http://ctr.wikia.com/wiki/Align_the_depiction_using_a_fixed_substructure. This gives the required result most of the time, but in some cases the MCS has a symmetry element and then the image ends up with distorted rings. Is there a way to force rings to be drawn as they should be even when a coordMap is used? Please find the code below. Thanks, Márton
from rdkit import Chem from rdkit import Geometry from rdkit.Chem import AllChem from rdkit.Chem import rdFMCS from rdkit.Chem import Draw mol1=Chem.MolFromSmiles("CC1=C2C=C(N)C=CC2=CC(Cl)=N1") mol2=Chem.MolFromSmiles("CC1=C2C=C(N)C=CC2=NC(Cl)=C1") mcs=Chem.MolFromSmarts(rdFMCS.FindMCS([mol1,mol2]).smartsString) AllChem.Compute2DCoords(mol1) match1=mol1.GetSubstructMatch(mcs) match2=mol2.GetSubstructMatch(mcs) coords=[mol1.GetConformer().GetAtomPosition(x) for x in match1] coords2D = [Geometry.Point2D(pt.x,pt.y) for pt in coords] coordDict={} for i,coord in enumerate(coords2D): coordDict[match2[i]] = coord AllChem.Compute2DCoords(mol2,coordMap=coordDict) Draw.MolsToGridImage([mol1,mol2],subImgSize=(250,250),molsPerRow=2)
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss