Reputation: 11
I am trying to fragment my molecule using the BRICS and RECAP fragmenting algorithms implemented in RDKit. For BRICS, there is a a way to get a mapping of atom ids in fragments and which atoms do they correspond to in the original molecule
For example:
from rdkit import Chem
from rdkit.Chem import BRICS, Draw
mol = Chem.MolFromSmiles("CCOC1=C(C=CC=C1)O[CH]([CH]2OCCNC2)C3=CC=CC=C3")
fragmented = BRICS.BreakBRICSBonds(mol)
pieces=Chem.GetMolFrags(fragmented, asMols=True)
pieces_idx_mapping = [list(piece) for piece in Chem.GetMolFrags(fragmented)]
Draw.MolsToGridImage(pieces, molsPerRow=5)
In this case, pieces_idx_mapping
will return a list of lists, each list containing the atom IDs in the original molecule.
For RECAP however, there is no rdkit implementation to get this; there is only a RECAPDecompose
function. Moreover, if I want to use the BRICS.BRICSDecompose
function in RDKit as it allows setting a minFragmentSize
option, we get the same problem of not being able to get the atom mapping.
Does anyone have an idea for how to implement this?
Many thanks in advance for any help!
Upvotes: 1
Views: 94