From b54c5d9641cec40a8d6769312ce223d70c1b98bb Mon Sep 17 00:00:00 2001 From: bieniekmat Date: Fri, 21 Jul 2023 14:32:50 +0100 Subject: [PATCH] A template can evolve. When the structure is big enough, it is best to use the previously minimised structure as a starting point, instead of always regenerating the entire set of stacked R-groups. This leads to many more "wrong conformers". By setting a template to be the previously minimised structure, we are decreasing the size of the search space for the next R-group. --- fegrow/package.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fegrow/package.py b/fegrow/package.py index 38534675..5fa0161a 100644 --- a/fegrow/package.py +++ b/fegrow/package.py @@ -160,15 +160,9 @@ def merge_R_group(scaffold, RGroup, replace_index): merged.RemoveConformer(c.GetId()) # bookkeeping about scaffolding - # if the molecule was previously merged - if hasattr(scaffold, "template") and scaffold.template is not None: - # mol already had a connected e.g. a linker, therefore we use the area without the linker - template = scaffold.template - else: - # prepare the template - etemp = Chem.EditableMol(scaffold) - etemp.RemoveAtom(atom_to_replace.GetIdx()) - template = etemp.GetMol() + etemp = Chem.EditableMol(scaffold) + etemp.RemoveAtom(atom_to_replace.GetIdx()) + template = etemp.GetMol() with_template = RMol(merged) with_template._save_template(template)