From b99b6cb9c1042b9cf1decf4d9e5e8580add00e34 Mon Sep 17 00:00:00 2001 From: Joao Morado Date: Fri, 10 Jul 2026 16:07:54 +0100 Subject: [PATCH] Add optional emle_plus support to OpenFFCreationStrategy --- src/fes_ml/alchemical/strategies/openff_strategy.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fes_ml/alchemical/strategies/openff_strategy.py b/src/fes_ml/alchemical/strategies/openff_strategy.py index fe88840..9aacfee 100644 --- a/src/fes_ml/alchemical/strategies/openff_strategy.py +++ b/src/fes_ml/alchemical/strategies/openff_strategy.py @@ -446,6 +446,7 @@ def create_alchemical_state( partial_charges_method: str = "am1bcc", keep_tmp_files: bool = True, modifications_kwargs: Optional[Dict[str, Dict[str, Any]]] = None, + emle_plus: bool = False, *args, **kwargs, ) -> AlchemicalState: @@ -507,6 +508,8 @@ def create_alchemical_state( The geometry of the ligand. keep_tmp_files : bool, optional, default=True Whether to keep the temporary files created by the strategy. + emle_plus : bool, optional, default=False + Whether to use EMLE+ instead of EMLE. If True, the EMLE+ modifications will be applied to the system. modifications_kwargs : dict A dictionary of keyword arguments for the modifications. @@ -679,9 +682,9 @@ def create_alchemical_state( for modification_name in emle_instances: modifications_kwargs[modification_name]["mols"] = sr_mols modifications_kwargs[modification_name]["parm7"] = alchemical_prm7[0] - # TODO: uncomment for EMLE+ - modifications_kwargs[modification_name]["top_file"] = files_prefix + ".top" - modifications_kwargs[modification_name]["crd_file"] = files_prefix + ".gro" + if emle_plus: + modifications_kwargs[modification_name]["top_file"] = files_prefix + ".top" + modifications_kwargs[modification_name]["crd_file"] = files_prefix + ".gro" modifications_kwargs[modification_name]["mm_charges"] = _np.asarray( [atom.charge().value() for atom in sr_mols.atoms(alchemical_atoms)] )