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

Refactor workflow initialization to remove hard dependency on topoaa #921

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5a5a439
adding checks for duplicated parameters in defaults.yaml
VGPReys Jun 26, 2024
5b109b5
trial1
VGPReys Jul 3, 2024
727c23f
fix types
VGPReys Jul 3, 2024
c19b2cd
remove E203 and E501 lint checks from examples/run_tests.py
VGPReys Jul 10, 2024
08c7fcb
add docstring in HaddockModel method
VGPReys Jul 10, 2024
4285a18
workaround topoaa
VGPReys Jul 10, 2024
a823b62
Merge branch 'main' into workaround-topoaa
VGPReys Jul 10, 2024
55e20d5
fix tests
VGPReys Jul 10, 2024
65242dd
fix types and tests for clustfcc
VGPReys Jul 10, 2024
537869b
Convert FilePath to Path in libontology load()
VGPReys Jul 10, 2024
83793c3
adding tests
VGPReys Jul 10, 2024
2784331
fix tests
VGPReys Jul 10, 2024
620e6e1
tweak intergration tests
VGPReys Jul 10, 2024
2c6e722
intergaration of alascan fix
VGPReys Jul 10, 2024
d988167
fixing integration tests
VGPReys Jul 10, 2024
af2aceb
creating directories in topoaa integration tests
VGPReys Jul 11, 2024
69a93ce
tweak path
VGPReys Jul 11, 2024
9e38b36
tweak path
VGPReys Jul 11, 2024
b16d202
tweak path
VGPReys Jul 11, 2024
a651b67
Merge branch 'main' into workaround-topoaa
VGPReys Jul 11, 2024
5a6be5c
improved regex for ensemble origin parsing
VGPReys Jul 11, 2024
2bc5595
Update libontology.py regex
VGPReys Jul 15, 2024
cdfefd4
Update cli_score.py
VGPReys Jul 15, 2024
38bb99b
Update __init__.py
VGPReys Jul 15, 2024
102c8f4
revision v1.1
VGPReys Jul 17, 2024
85e6181
Merge branch 'main' into workaround-topoaa
VGPReys Jul 17, 2024
a03cdb5
modify step index of caprieval and rigidbody integration tests
VGPReys Jul 17, 2024
cb81025
removing List type import
VGPReys Jul 17, 2024
9add2c1
adding tests
VGPReys Jul 17, 2024
f8d9dd4
adding tests
VGPReys Jul 17, 2024
451f942
adding new exception DependencyError
VGPReys Jul 29, 2024
3d2a345
adding dependency checks at workflow prepare_run
VGPReys Jul 29, 2024
6e121fa
test to the DependencyError during prepare_run
VGPReys Jul 29, 2024
364a5e4
fixing types
VGPReys Jul 29, 2024
9f9a2d0
remove useless import
VGPReys Jul 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
64 changes: 32 additions & 32 deletions examples/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,34 @@
# keys are the examples folder, and values are the configuration files
# the whitespaces below are anti-pythonic but facilitate reading :-)
examples = (
("docking-antibody-antigen" , "docking-antibody-antigen-ranairCDR-test.cfg"), # noqa: E203, E501
("docking-antibody-antigen" , "docking-antibody-antigen-ranairCDR-clt-test.cfg"), # noqa: E203, E501
("docking-antibody-antigen" , "docking-antibody-antigen-CDR-accessible-test.cfg"), # noqa: E203, E501
("docking-antibody-antigen" , "docking-antibody-antigen-CDR-accessible-clt-test.cfg"), # noqa: E203, E501
("docking-antibody-antigen" , "docking-antibody-antigen-CDR-NMR-CSP-test.cfg"), # noqa: E203, E501
("docking-protein-DNA" , "docking-protein-DNA-test.cfg"), # noqa: E203, E501
("docking-protein-DNA" , "docking-protein-DNA-mdref-test.cfg"), # noqa: E203, E501
("docking-protein-homotrimer" , "docking-protein-homotrimer-test.cfg"), # noqa: E203, E501
("docking-protein-glycan" , "docking-protein-glycan-test.cfg"), # noqa: E203, E501
("docking-protein-glycan" , "docking-protein-glycan-ilrmsd-test.cfg"), # noqa: E203, E501
("docking-protein-glycan" , "docking-flexref-protein-glycan-test.cfg"), # noqa: E203, E501
("docking-protein-ligand-shape", "docking-protein-ligand-shape-test.cfg"), # noqa: E203, E501
("docking-protein-ligand" , "docking-protein-ligand-test.cfg"), # noqa: E203, E501
("docking-protein-peptide" , "docking-protein-peptide-test.cfg"), # noqa: E203, E501
("docking-protein-peptide" , "docking-protein-peptide-mdref-test.cfg"), # noqa: E203, E501
("docking-protein-protein" , "docking-protein-protein-test.cfg"), # noqa: E203, E501
("docking-protein-protein" , "docking-protein-protein-cltsel-test.cfg"), # noqa: E203, E501
("docking-protein-protein" , "docking-protein-protein-mdref-test.cfg"), # noqa: E203, E501
("docking-multiple-ambig" , "docking-multiple-tbls-test.cfg"), # noqa: E203, E501
("docking-protein-protein" , "docking-exit-test.cfg"), # noqa: E203, E501
("refine-complex" , "refine-complex-test.cfg"), # noqa: E203, E501
("scoring" , "emscoring-test.cfg"), # noqa: E203, E501
("scoring" , "mdscoring-test.cfg"), # noqa: E203, E501
("scoring" , "emscoring-mdscoring-test.cfg"), # noqa: E203, E501
("analysis" , "topoaa-caprieval-test.cfg"), # noqa: E203, E501
("analysis" , "topoaa-ilrmsdmatrix-clustrmsd-test.cfg"), # noqa: E203, E501
("analysis" , "alascan-test.cfg"), # noqa: E203, E501
("analysis" , "contmap-test.cfg"), # noqa: E203, E501
("docking-antibody-antigen" , "docking-antibody-antigen-ranairCDR-test.cfg"),
("docking-antibody-antigen" , "docking-antibody-antigen-ranairCDR-clt-test.cfg"),
("docking-antibody-antigen" , "docking-antibody-antigen-CDR-accessible-test.cfg"),
("docking-antibody-antigen" , "docking-antibody-antigen-CDR-accessible-clt-test.cfg"),
("docking-antibody-antigen" , "docking-antibody-antigen-CDR-NMR-CSP-test.cfg"),
("docking-protein-DNA" , "docking-protein-DNA-test.cfg"),
("docking-protein-DNA" , "docking-protein-DNA-mdref-test.cfg"),
("docking-protein-homotrimer" , "docking-protein-homotrimer-test.cfg"),
("docking-protein-glycan" , "docking-protein-glycan-test.cfg"),
("docking-protein-glycan" , "docking-protein-glycan-ilrmsd-test.cfg"),
("docking-protein-glycan" , "docking-flexref-protein-glycan-test.cfg"),
("docking-protein-ligand-shape", "docking-protein-ligand-shape-test.cfg"),
("docking-protein-ligand" , "docking-protein-ligand-test.cfg"),
("docking-protein-peptide" , "docking-protein-peptide-test.cfg"),
("docking-protein-peptide" , "docking-protein-peptide-mdref-test.cfg"),
("docking-protein-protein" , "docking-protein-protein-test.cfg"),
("docking-protein-protein" , "docking-protein-protein-cltsel-test.cfg"),
("docking-protein-protein" , "docking-protein-protein-mdref-test.cfg"),
("docking-multiple-ambig" , "docking-multiple-tbls-test.cfg"),
("docking-protein-protein" , "docking-exit-test.cfg"),
("refine-complex" , "refine-complex-test.cfg"),
("scoring" , "emscoring-test.cfg"),
("scoring" , "mdscoring-test.cfg"),
("scoring" , "emscoring-mdscoring-test.cfg"),
("analysis" , "topoaa-caprieval-test.cfg"),
("analysis" , "topoaa-ilrmsdmatrix-clustrmsd-test.cfg"),
("analysis" , "alascan-test.cfg"),
("analysis" , "contmap-test.cfg"),
)


Expand Down Expand Up @@ -160,7 +160,7 @@ def main(examples, break_on_errors=True):
rmtree("run2", ignore_errors=True)
run_subprocess_cmd("haddock3-copy -r run1-test -m 0 4 -o run2")
run_subprocess_cmd(
"haddock3 docking-extend-run-exit-test.cfg --extend-run run2", # noqa: E501
"haddock3 docking-extend-run-exit-test.cfg --extend-run run2",
)

# test exit with --restart
Expand All @@ -178,20 +178,20 @@ def main(examples, break_on_errors=True):

# perform a haddock3 re-scoring command
run_subprocess_cmd(
"haddock3-re score -e 1.1 -w 1 -d 0.3 -b 1 -a 1 run1-re/2_caprieval", # noqa : E501
"haddock3-re score -e 1.1 -w 1 -d 0.3 -b 1 -a 1 run1-re/2_caprieval",
)

# perform a haddock3 re-clustfcc command
run_subprocess_cmd(
"haddock3-re clustfcc -f 0.5 -s 0.7 -t 2 run1-re/1_clustfcc", # noqa : E501
"haddock3-re clustfcc -f 0.5 -s 0.7 -t 2 run1-re/1_clustfcc",
)

# FIXME: Make this runs properly function
# perform a haddock3 re-clustrmsd command

# perform haddock3 --extend-run on re-run
# run_subprocess_cmd(
# "haddock3 docking-re-extend-run-test.cfg --extend-run run1-re", # noqa : E501
# "haddock3 docking-re-extend-run-test.cfg --extend-run run1-re",
# )

# perform haddock3 --restart on re-run
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_alascan.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def alascan_module():
"""Return a default alascan module."""
with tempfile.TemporaryDirectory(dir=".") as tmpdir:
alascan = AlascanModule(
order=0, path=".", initial_params=DEFAULT_ALASCAN_CONFIG
order=1, path=Path("."), initial_params=DEFAULT_ALASCAN_CONFIG
VGPReys marked this conversation as resolved.
Show resolved Hide resolved
)
alascan.params["int_cutoff"] = 3.5
yield alascan
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_caprieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def caprieval_module():
with tempfile.TemporaryDirectory() as tmpdir:
yield CaprievalModule(
order=0,
order=1,
path=Path(tmpdir),
init_params=DEFAULT_CAPRIEVAL_CONFIG,
)
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_contactmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def contactmap():
"""Return contmap module."""
with tempfile.TemporaryDirectory() as tmpdir:
preset_contactmap = CMapModule(
order=0,
order=1,
path=Path(tmpdir),
initial_params=CONTMAP_CONF,
)
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_ilrmsdmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def ilrmsdmatrix_module():
"""Provide a parametrized IL-RMSD matrix module."""
with tempfile.TemporaryDirectory() as tmpdir:
ilrmsdmatrix = IlrmsdmatrixModule(
order=0, path=tmpdir, initial_params=DEFAULT_ILRMSD_CONFIG
order=1, path=Path(tmpdir), initial_params=DEFAULT_ILRMSD_CONFIG
)
yield ilrmsdmatrix

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/test_rigidbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def rigidbody_module():
with tempfile.TemporaryDirectory() as tmpdir:
rigidbody = RigidbodyModule(
order=0, path=Path(tmpdir), initial_params=DEFAULT_RIGIDBODY_CONFIG
order=1, path=Path(tmpdir), initial_params=DEFAULT_RIGIDBODY_CONFIG
)
yield rigidbody

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/test_rmsdmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

@pytest.fixture
def rmsdmatrix_module():
with tempfile.TemporaryDirectory() as tmpdir:
with tempfile.TemporaryDirectory(".") as tmpdir:
ilrmsdmatrix = rmsdmatrixModule(
order=0, path=tmpdir, initial_params=DEFAULT_RMSD_CONFIG
order=1, path=Path(tmpdir), initial_params=DEFAULT_RMSD_CONFIG
)
yield ilrmsdmatrix

Expand Down
58 changes: 42 additions & 16 deletions integration_tests/test_topoaa.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
import tempfile
from pathlib import Path

import pytest
from pathlib import Path
from shutil import copyfile

from haddock.modules.topology.topoaa import DEFAULT_CONFIG as DEFAULT_TOPOAA_CONFIG
from haddock.modules.topology.topoaa import HaddockModule as TopoaaModule
from haddock.core.defaults import DATA_DIRNAME
from haddock.libs.libio import working_directory
from haddock.modules.topology.topoaa import (
DEFAULT_CONFIG as DEFAULT_TOPOAA_CONFIG,
HaddockModule as TopoaaModule,
)

from . import CNS_EXEC, DATA_DIR, has_cns


@pytest.fixture
def topoaa_module():
def molecules():
return [
Path(DATA_DIR, "docking-protein-protein/data/e2aP_1F3G.pdb"),
Path(DATA_DIR, "docking-protein-protein/data/hpr_ensemble.pdb"),
]


@pytest.fixture
def prepare_topoaa_run(molecules):
with tempfile.TemporaryDirectory() as tmpdir:
topoaa = TopoaaModule(
order=0, path=tmpdir, initial_params=DEFAULT_TOPOAA_CONFIG
with working_directory(tmpdir):
modulename_path = Path("0_topoaa")
modulename_path.mkdir(parents=True)
input_dir_path = Path(DATA_DIRNAME, modulename_path)
input_dir_path.mkdir(parents=True)
mol_copies = [
copyfile(mol, Path(input_dir_path, mol.name))
for mol in molecules
]
yield modulename_path, mol_copies


@pytest.fixture
def topoaa_module(prepare_topoaa_run):
modulename_path = prepare_topoaa_run[0]
mol_copies = prepare_topoaa_run[1]
topoaa = TopoaaModule(
order=0,
path=modulename_path,
initial_params=DEFAULT_TOPOAA_CONFIG,
)
topoaa.__init__(path=tmpdir, order=0)
topoaa.params["molecules"] = [
Path(DATA_DIR, "docking-protein-protein/data/e2aP_1F3G.pdb"),
Path(DATA_DIR, "docking-protein-protein/data/hpr_ensemble.pdb"),
]
topoaa.params["mol1"] = {"prot_segid": "A"}
topoaa.params["mol2"] = {"prot_segid": "B"}
topoaa.params["molecules"] = mol_copies
topoaa.params["mol1"] = {"prot_segid": "A"}
topoaa.params["mol2"] = {"prot_segid": "B"}

topoaa.params["cns_exec"] = CNS_EXEC
topoaa.params["cns_exec"] = CNS_EXEC

yield topoaa
yield topoaa


@has_cns
Expand Down
6 changes: 3 additions & 3 deletions src/haddock/clis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
Command-line interfaces.

HADDOCK3 has a series of command-line interfaces (CLIs), from which the most important
one is ``haddock3``. You can ask help to the CLIs with the ``-h`` flag::

HADDOCK3 has a series of command-line interfaces (CLIs), from which the most
important one is ``haddock3``.
You can ask help to the CLIs with the ``-h`` flag:
haddock3 -h
"""
Loading
Loading