From f7d8816f80f57fc6b3c58b0c173fad3f74204d9b Mon Sep 17 00:00:00 2001 From: JamesW <60615431+JWallaceEvotec@users.noreply.github.com> Date: Tue, 30 Apr 2024 11:54:58 +0100 Subject: [PATCH] Update fragment_types.py to add SanitizeMol calls This fixes an issue seen where unitialized ring systems confuse the fragmentor --- mmpdblib/fragment_types.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mmpdblib/fragment_types.py b/mmpdblib/fragment_types.py index c136a11..2232d5c 100644 --- a/mmpdblib/fragment_types.py +++ b/mmpdblib/fragment_types.py @@ -258,6 +258,8 @@ def __init__( self.max_up_enumerations = max_up_enumerations def normalize(self, mol): + from rdkit import Chem + Chem.SanitizeMol(mol) # XXX Remove existing isotope labels? if self.salt_remover is not None: desalted_mol = self.salt_remover.StripMol(mol) @@ -269,6 +271,8 @@ def normalize(self, mol): return None, desalted_mol def apply_filters(self, mol): + from rdkit import Chem + Chem.SanitizeMol(mol) num_heavies = 0 for atom in mol.GetAtoms(): atomic_num = atom.GetAtomicNum()