Skip to content

Commit bddd10c

Browse files
committed
fix: Avoid potential side effects by breaking references to original molecule objects in select_primary_ligands_in_df
1 parent b3a15ef commit bddd10c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

posebench/analysis/inference_analysis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def select_primary_ligands_in_df(
170170

171171
if select_most_similar_pred_frag:
172172
mol_pred_frags = [
173-
find_most_similar_frag(mol_true_frag, mol_pred_frags)[0]
173+
# Break reference to original molecule objects to avoid potential side effects
174+
find_most_similar_frag(Chem.Mol(mol_true_frag), [Chem.Mol(mol_pred_frag) for mol_pred_frag in mol_pred_frags])[0]
174175
for mol_true_frag in mol_true_frags
175176
]
176177
if not any(mol_pred_frags):

0 commit comments

Comments
 (0)