RDKit can handle reaction. Enumeration of many molecules with template reaction and building blocks are useful for library generation.
Recently I have a question about how to handle intramolecular reactions with RDKit such as micro cyclization etc.
In the case of amidation reaction that is often used for drug synthesis SMARTS query is below.
The query is inter molecular reaction in RDKit. A + B => C. So this query can not apply to intramolecular reaction such like a “OC(=O)CCCCN => C(=O)1CCCCN1”
In the RDKit, intramolecular reaction query is represented by including reactants in parentheses.
You can found in the document.
By the way how to distinguish between intra and inter reaction in my code?🤔
I propose simple solution, multiple SMILES is handled as one mol object and perform reaction and then separate it.
OK my english is difficult to understand, let’s go to code.
In the blog post, I wrote an example for amidation.
from rdkit import Chem from rdkit.Chem import rdChemReactions from rdkit.Chem import AllChem from rdkit.Chem.Draw import IPythonConsole from rdkit.Chem import Draw IPythonConsole.ipython_useSVG=True # define intra and inter molecular reaction intra_rxn = AllChem.ReactionFromSmarts('([C:1][C:2](=[O:6])[O:3].[N:4][C:5])>>[C:1][C:2](=[O:6])[N:4][C:5]') inter_rxn = AllChem.ReactionFromSmarts('[C:1][C:2](=[O:6])[O:3].[N:4][C:5]>>[C:1][C:2](=[O:6])[N:4][C:5]') # basic acid / amine acid = Chem.MolFromSmiles('CC(=O)O') amine = Chem.MolFromSmiles('NC') # intramolecular aminoacid = Chem.MolFromSmiles('N(C)CCC(O)CC(=O)O') # two molecules in one mol object! combmol = Chem.MolFromSmiles("CC(=O)O.N1CCC(C)1")
In the case of A + B => C is below
# Intra reaction can not represent with inter molecular reactoin query inter_rxn.RunReactant(aminoacid,0)
But intra SMIRKS query works fine.
#inra moleclar query works fine intra_rxn.RunReactant(aminoacid,0)
Next run the reaction with one mol object in two molecules and intra molecular reaction object.
# paired molecular object also works but reactant two molecules is handled as one object intra_rxn.RunReactant(combmol,0)
Finally combined molecules are separated with Sep_mol function. The function convert molecule to SMILES and split by ‘.’ then transforms SMILES to molecules.
def sepMol(mol): smi_list = Chem.MolToSmiles(mol).split('.') mols = [ Chem.MolFromSmiles(smi) for smi in smi_list] return mols
ms = sepMol(combmol) print(len(ms)) ms.append(intra_rxn.RunReactant(combmol,0)) # out 2
I tried the function only amidation and do not know whether the method is efficient or not.
Any comment or advice is appreciated.
All my code can check from following URL.