Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lomap network generator #1082

Merged
merged 8 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/add_lomap_network_generator_to_cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Added CLI support for ``generate_lomap_network``. This option can be specified as a `YAML-defined setting <https://docs.openfree.energy/en/stable/guide/cli/cli_yaml.html>`_

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
3 changes: 3 additions & 0 deletions openfecli/parameters/plan_network_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def load_yaml_planner_options(path: Optional[str], context) -> PlanNetworkOption
generate_minimal_spanning_network,
generate_maximal_network,
generate_minimal_redundant_network,
generate_lomap_network,
)
from openfe.setup import (
LomapAtomMapper,
Expand Down Expand Up @@ -179,6 +180,7 @@ def load_yaml_planner_options(path: Optional[str], context) -> PlanNetworkOption
'mst': generate_minimal_spanning_network,
'generate_minimal_redundant_network': generate_minimal_redundant_network,
'generate_maximal_network': generate_maximal_network,
'generate_lomap_network': generate_lomap_network,
}

try:
Expand Down Expand Up @@ -225,6 +227,7 @@ def load_yaml_planner_options(path: Optional[str], context) -> PlanNetworkOption
- `generate_minimal_spanning_tree`
- `generate_minimal_redundant_network`
- `generate_radial_network`
- `generate_lomap_network`

Supported partial charge method choices are:
- ``am1bcc``
Expand Down
18 changes: 8 additions & 10 deletions openfecli/tests/commands/test_plan_rbfe_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,39 +338,37 @@ def test_plan_rbfe_network_charge_changes(cdk8_files):


@pytest.fixture
def custom_yaml_settings():
def lomap_yaml_settings():
return """\
network:
method: generate_minimal_redundant_network
method: generate_lomap_network
atravitz marked this conversation as resolved.
Show resolved Hide resolved
settings:
mst_num: 2
max_path_length: 6

mapper:
method: LomapAtomMapper
settings:
time: 45
element_change: True

partial_charge:
method: nagl
settings:
nagl_model: openff-gnn-am1bcc-0.1.0-rc.3.pt
"""

@pytest.mark.xfail(HAS_OPENEYE, reason="openff-nagl#177")
def test_custom_yaml_plan_rbfe_smoke_test(custom_yaml_settings, eg5_files, tmpdir):
protein, ligand, cofactor = eg5_files
def test_lomap_yaml_plan_rbfe_smoke_test(lomap_yaml_settings, cdk8_files, tmpdir):
protein, ligand = cdk8_files
settings_path = tmpdir / "settings.yaml"
with open(settings_path, "w") as f:
f.write(custom_yaml_settings)
f.write(lomap_yaml_settings)

assert settings_path.exists()

args = [
'-p', protein,
'-M', ligand,
'-C', cofactor,
'-s', settings_path,
'-s', settings_path
]

runner = CliRunner()
Expand Down