Skip to content

Commit

Permalink
A template can evolve. When the structure is big enough, it is best t…
Browse files Browse the repository at this point in the history
…o 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.
  • Loading branch information
bieniekmateusz committed Jul 21, 2023
1 parent d3e50d0 commit b54c5d9
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions fegrow/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b54c5d9

Please sign in to comment.