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

Duck tape broken networks #144

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c1340b5
building_a_network_taping_approach
RiesBen Sep 3, 2024
ac3fc61
building_a_network_taping_approach
RiesBen Sep 3, 2024
1d8dd70
Merge branch 'main' into duckTapeNetwork
RiesBen Sep 3, 2024
6f9604e
taping update
RiesBen Sep 4, 2024
590d69c
tape nets
RiesBen Sep 4, 2024
60f4f41
cli fix
RiesBen Sep 4, 2024
9f442cf
cli fix
RiesBen Sep 4, 2024
0a2988c
formatting fix
RiesBen Sep 4, 2024
b2c81b1
Update tape_networks.py
RiesBen Sep 5, 2024
a3c15ff
Merge branch 'main' into duckTapeNetwork
RiesBen Sep 5, 2024
eb9c9e1
improve cli
RiesBen Sep 5, 2024
8c242d7
Saving transformations to json
hannahbaumann Sep 5, 2024
850fcee
Merge branch 'duckTapeNetwork' into write_AlchemicalNetwork
hannahbaumann Sep 5, 2024
5ce225e
small fix
hannahbaumann Sep 5, 2024
0714c24
filtering for only new tapes
RiesBen Sep 5, 2024
0ed4d30
trying to clean up and improve reading quality
RiesBen Sep 5, 2024
c346af0
Merge branch 'duckTapeNetwork' into write_AlchemicalNetwork
RiesBen Sep 5, 2024
5070695
Merge pull request #1 from RiesBen/write_AlchemicalNetwork
RiesBen Sep 5, 2024
ee419ab
a bit nicer output
RiesBen Sep 5, 2024
824e10b
fixing var names
RiesBen Sep 5, 2024
b11daee
Update industry_benchmarks/utils/tape_networks.py
RiesBen Sep 6, 2024
60d1426
Update industry_benchmarks/utils/tape_networks.py
RiesBen Sep 6, 2024
777273b
Update industry_benchmarks/utils/tape_networks.py
RiesBen Sep 6, 2024
d75b1d1
adding connectivity check
RiesBen Sep 6, 2024
ccb2cf3
adding connectivity check
RiesBen Sep 6, 2024
bd7b112
adding connectivity check
RiesBen Sep 6, 2024
4c654a1
ensuring taping, adding error
RiesBen Sep 6, 2024
4106921
Merge branch 'main' into duckTapeNetwork
RiesBen Sep 7, 2024
71768c0
Merge branch 'main' into duckTapeNetwork
IAlibay Sep 12, 2024
6c511b9
Start of changing this script to not depend on Konnektor
hannahbaumann Sep 17, 2024
388f487
Some fixes for the network fixing
hannahbaumann Sep 17, 2024
96a8d0d
Adding two tests
hannahbaumann Sep 18, 2024
09258f5
Add alchemical network for tests
hannahbaumann Sep 18, 2024
0c4b477
Merge branch 'main' into duckTapeNetwork
hannahbaumann Sep 30, 2024
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
581 changes: 581 additions & 0 deletions industry_benchmarks/utils/tape_networks.py

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions industry_benchmarks/utils/tests/test_tape_networks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import pathlib

import pytest
from importlib import resources
import os
import json
import glob
from gufe.tokenization import JSON_HANDLER
import click.testing
from openfe.setup import LigandNetwork
from openfe.protocols import openmm_rfe
from ..tape_networks import cli_do_taping as main


@pytest.fixture
def results():
with resources.files("utils.tests.data.bace_inputs") as d:
yield pathlib.Path(d / "results_broken_network/*json")


@pytest.fixture
def input_alchemical_network():
with resources.files("utils.tests.data.bace_inputs") as d:
yield str(d / "alchemical_network.json")


@pytest.fixture
def output_dir():
return pathlib.Path("utils.tests.data.bace_inputs.tapesForAlchemicalNetwork")


class TestScript:
def test_invoke(self):
runner = click.testing.CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(main, ["--help"])
assert result.exit_code == 0
assert "Usage: cli-do-taping" in result.output

def test_do_taping(self, results, input_alchemical_network, output_dir):
runner = click.testing.CliRunner()
with runner.isolated_filesystem():
# Test warning for charge changing transformations
result = runner.invoke(
main,
["-rp", results, "-ia", input_alchemical_network, "-oa", output_dir],
)
assert result.exit_code == 0
assert os.path.exists(str(output_dir))
# Create a list of all .json files
output_files = list(output_dir.glob("transformations/*.json"))
# Check if the output files are created
assert len(output_files) == 12
for f in output_files:
assert f.is_file()