An example of building 3D coordinates of congeneric series using RDKit
Published
January 29, 2021
Motivation
I often have to modify a given molecule to introduce a set of modification to make congeneric series. AllChem.ConstrainedEmbed in RDKit could provide such function. See below blog posts for an example:
However, AllChem.ConstrinedEmbed uses MCS algorithm, and the MCS sometimes did not yielded the core that I desired, which resulted in a completely wrong alignment between the parent and the newly modified molecule.
So, I wrote a small function that takes the SMARTS pattern, and explicitly takes the coordinates then embed the rest of the coordinates.
Code
from io import BytesIOimport pandas as pdimport numpy as npfrom rdkit.Chem import PandasToolsfrom rdkit import Chemfrom rdkit.Chem import AllChemfrom rdkit.Chem import DataStructsfrom rdkit.Chem import rdMolDescriptorsfrom rdkit.Chem import rdRGroupDecompositionfrom rdkit.Chem.Draw import IPythonConsole #Needed to show moleculesfrom rdkit.Chem import Drawfrom rdkit.Chem import rdDepictorfrom rdkit.Chem.Draw import rdMolDraw2Dfrom rdkit.Chem.Draw.MolDrawing import MolDrawing, DrawingOptions #Only needed if modifying defaultsDrawingOptions.bondLineWidth=1.8IPythonConsole.ipython_useSVG=Truefrom rdkit import RDLoggerRDLogger.DisableLog('rdApp.warning')import rdkitimport py3Dmolprint(rdkit.__version__)
2020.03.2
Example
Let’s use Imatinib for the parent molecule as an example.
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: jupyter labextension install jupyterlab_3dmol
Note you can perform a fragment grafting instead of embedding. See https://pschmidtke.github.io/blog/rdkit/3d-editor/2021/01/23/grafting-fragments.html