from dreams.algorithms.murcko_hist.murcko_hist import break_rings
from rdkit import Chem
mol = Chem.MolFromInchi('InChI=1S/C28H22O6/c29-21-3-1-9-25-23(31)19-7-5-15(11-17(19)13-27(21,25)33-25)16-6-8-20-18(12-16)14-28-22(30)4-2-10-26(28,34-28)24(20)32/h5-8,11-12H,1-4,9-10,13-14H2')
break_rings(mol, rings_size=3)
Why? Well, we are modifying the mol in-the-loop, while using an outdated list of rings, from the original molecule, br = [set(r) for r in mol.GetRingInfo().BondRings()]. Instead, we need to iteratively (while has_rings) remove rings to avoid this.
A molecule:
causes the
break_rings
to break:Why? Well, we are modifying the mol in-the-loop, while using an outdated list of rings, from the original molecule,
br = [set(r) for r in mol.GetRingInfo().BondRings()]
. Instead, we need to iteratively (while has_rings
) remove rings to avoid this.