BRICS Decomposition in 3D

Inspired by this blog post by the lovely Kate, I’ve been doing some BRICS decomposing of molecules myself. Like the structure-based goblin that I am, though, I’ve been applying it to 3D structures of molecules, rather than using the smiles approach she detailed. I thought it may be helpful to share the code snippets I’ve been using for this: unsurprisingly, it can also be done with RDKit!

I’ll use the same example as in the original blog post, propranolol.

1DY4: CBH1 IN COMPLEX WITH S-PROPRANOLOL

First, I import RDKit and load the ligand in question:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import BRICS
ligand = Chem.MolFromMolFile('propranolol.sdf')
from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import BRICS ligand = Chem.MolFromMolFile('propranolol.sdf')
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import BRICS
ligand = Chem.MolFromMolFile('propranolol.sdf')

Then I use BRICS.BreakBRICSBonds to generate an RDKit molecule with the BRICS bonds removed, and then Chem.GetMolFrags to separate the substructures into individual RDKit molecules:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ligand_broken = BRICS.BreakBRICSBonds(ligand)
brics_bits = Chem.GetMolFrags(ligand_broken, asMols=True)
ligand_broken = BRICS.BreakBRICSBonds(ligand) brics_bits = Chem.GetMolFrags(ligand_broken, asMols=True)
ligand_broken = BRICS.BreakBRICSBonds(ligand)
brics_bits = Chem.GetMolFrags(ligand_broken, asMols=True)

You can either write these directly to SDF files using Chem.SDWriter, or remove the dummy atoms first. I followed this post to do this as follows:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
w = Chem.SDWriter('propranolol_brics.sdf')
dummy = Chem.MolFromSmiles('*')
hydrogen = Chem.MolFromSmiles('[H]')
for mol in brics_bits:
for atom in mol.GetAtoms():
atom.SetIsotope(0)
rmv_dummy = AllChem.ReplaceSubstructs(mol,dummy,hydrogen,True)[0]
final_mol = Chem.RemoveHs(rmv_dummy)
w.write(final_mol)
w = Chem.SDWriter('propranolol_brics.sdf') dummy = Chem.MolFromSmiles('*') hydrogen = Chem.MolFromSmiles('[H]') for mol in brics_bits: for atom in mol.GetAtoms(): atom.SetIsotope(0) rmv_dummy = AllChem.ReplaceSubstructs(mol,dummy,hydrogen,True)[0] final_mol = Chem.RemoveHs(rmv_dummy) w.write(final_mol)
w = Chem.SDWriter('propranolol_brics.sdf')
dummy = Chem.MolFromSmiles('*')
hydrogen = Chem.MolFromSmiles('[H]')
for mol in brics_bits:
    for atom in mol.GetAtoms():
        atom.SetIsotope(0)
    
    rmv_dummy = AllChem.ReplaceSubstructs(mol,dummy,hydrogen,True)[0]
    final_mol = Chem.RemoveHs(rmv_dummy)


    w.write(final_mol)

The final molecules loaded into PyMOL look like this:

BRICS decomposition applied to propranolol in 3D

Happy decomposing!

Author