From dcb99ce82a0b31fa264f222c2e3edf8568939b4a Mon Sep 17 00:00:00 2001 From: mgiulini Date: Wed, 16 Oct 2024 16:29:47 +0200 Subject: [PATCH 01/29] changed docs generation --- devtools/build_defaults_rst.py | 42 +++++++++++----------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/devtools/build_defaults_rst.py b/devtools/build_defaults_rst.py index 0e6da48fe..4ef1e8eb1 100644 --- a/devtools/build_defaults_rst.py +++ b/devtools/build_defaults_rst.py @@ -13,10 +13,11 @@ from pathlib import Path import shutil -from haddock import haddock3_repository_path, haddock3_source_path from haddock.core.typing import ParamMap from haddock.libs.libio import read_from_yaml +HADDOCK_REL_SRC_PATH = Path("src", "haddock") + MODULE_TITLE_DICT = { "topoaa": "All-atom topology module", "rigidbody": "Rigid body docking sampling module", @@ -37,6 +38,7 @@ "alascan": "Alanine Scanning module", "ilrmsdmatrix": "Interface Ligand RMSD Matrix calculation module", "exit": "Exit module", + "openmm": "OpenMM module", } CATEGORY_TITLE_DICT = { @@ -185,12 +187,11 @@ def process_category_file(category: str) -> None: Category name. """ category_rst = Path( - haddock3_repository_path, 'docs', f"haddock.modules.{category}.rst" ) + target_path = Path( - haddock3_repository_path, 'docs', 'modules', category @@ -217,12 +218,10 @@ def process_module_file(category: str, module_name: str) -> None: Module name. """ module_rst = Path( - haddock3_repository_path, 'docs', f"haddock.modules.{category}.{module_name}.rst" ) target_rst = Path( - haddock3_repository_path, 'docs', 'modules', category, @@ -230,20 +229,13 @@ def process_module_file(category: str, module_name: str) -> None: ) shutil.move(module_rst, target_rst) # does the submodule exist? - submodule_gen = Path(haddock3_repository_path, 'docs').glob(f"haddock.modules.{category}.{module_name}.*.rst") + submodule_gen = Path('docs').glob(f"haddock.modules.{category}.{module_name}.*.rst") submodule_list = list(submodule_gen) if len(submodule_list) != 0: - submodule_name = submodule_list[0] - - submodule_rst = Path( - haddock3_repository_path, - 'docs', - submodule_name - ) + submodule_rst = submodule_list[0] submodule_target_rst = Path( - haddock3_repository_path, 'docs', 'modules', category, @@ -278,8 +270,7 @@ def main() -> None: # from haddock.modules import modules_category # to avoid importing dependencies of the haddock modules packages pattern = Path('modules', '*', '*', '*.yaml') - configs = haddock3_source_path.glob(str(pattern)) - + configs = Path(HADDOCK_REL_SRC_PATH).glob(str(pattern)) processed_categories = [] # create RST pages for all modules' configuration files. for config in configs: @@ -293,10 +284,8 @@ def main() -> None: # ignore empty modules - currently topocg for example if len(params) == 0: continue - # if the category has not been processed yet, copy the category file if category not in processed_categories: - process_category_file(category) processed_categories.append(category) @@ -306,14 +295,12 @@ def main() -> None: text = build_rst(params) params_folder = Path( - haddock3_repository_path, 'docs', 'modules', category, 'params', ) params_folder.mkdir(exist_ok=True) - with open(Path(params_folder, f'{module_name}.rst'), 'w') as fout: fout.write(text) @@ -323,11 +310,10 @@ def main() -> None: # Generate general default parameters RST page HEADING.reset() HEADING.increase() - general_defaults = Path(haddock3_source_path, 'modules', 'defaults.yaml') + general_defaults = Path(HADDOCK_REL_SRC_PATH, 'modules', 'defaults.yaml') general_params = read_from_yaml(general_defaults) text = build_rst(general_params) params_file = Path( - haddock3_repository_path, 'docs', 'modules', 'general_module_params.rst', @@ -339,10 +325,10 @@ def main() -> None: # now libs, gear and core for folder in ("libs", "gear", "core"): # make directory if it does not exist - target_path = Path(haddock3_repository_path, 'docs', 'reference', folder) + target_path = Path(HADDOCK_REL_SRC_PATH, 'docs', 'reference', folder) target_path.mkdir(exist_ok=True) # collect rst files - rst_files = Path(haddock3_repository_path, 'docs').glob(f"haddock.{folder}.*rst") + rst_files = Path(HADDOCK_REL_SRC_PATH, 'docs').glob(f"haddock.{folder}.*rst") for rst_file in rst_files: target_rst = Path(target_path, rst_file.name) shutil.move(rst_file, target_rst) @@ -353,7 +339,7 @@ def main() -> None: # Generate mandatory parameters RST page HEADING.reset() - mandatory_defaults = Path(haddock3_source_path, 'core', 'mandatory.yaml') + mandatory_defaults = Path(HADDOCK_REL_SRC_PATH, 'core', 'mandatory.yaml') mandatory_params = read_from_yaml(mandatory_defaults) for param in mandatory_params: @@ -362,7 +348,6 @@ def main() -> None: text = build_rst(mandatory_params) params_file = Path( - haddock3_repository_path, 'docs', 'reference', 'core', @@ -375,13 +360,12 @@ def main() -> None: fout.write(text) # now the command-line interfaces - clients_folder = Path(haddock3_repository_path, 'docs', 'clients') + clients_folder = Path(HADDOCK_REL_SRC_PATH, 'docs', 'clients') clients_folder.mkdir(exist_ok=True) - cli_rst_files = Path(haddock3_repository_path, 'docs').glob(f"haddock.clis.*rst") + cli_rst_files = Path(HADDOCK_REL_SRC_PATH, 'docs').glob(f"haddock.clis.*rst") for cli_rst_file in cli_rst_files: target_rst = Path( - haddock3_repository_path, 'docs', 'clients', cli_rst_file.name From 946edfafd27cb8dfde5eefa27e24d11fd46eb329 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Thu, 17 Oct 2024 16:08:35 +0200 Subject: [PATCH 02/29] readded missing elements in toctree --- devtools/build_defaults_rst.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devtools/build_defaults_rst.py b/devtools/build_defaults_rst.py index 3aea42ec5..5a42708ba 100644 --- a/devtools/build_defaults_rst.py +++ b/devtools/build_defaults_rst.py @@ -330,7 +330,7 @@ def main() -> None: target_path.mkdir(exist_ok=True) # collect rst files rst_files = Path('docs').glob( - f"haddock.{folder}.*rst" + f"haddock.{folder}.*.rst" ) for rst_file in rst_files: target_rst = Path(target_path, rst_file.name) @@ -368,7 +368,7 @@ def main() -> None: clients_folder.mkdir(exist_ok=True) cli_rst_files = Path('docs').glob( - f"haddock.clis.*rst" + f"haddock.clis.*.rst" ) for cli_rst_file in cli_rst_files: target_rst = Path( From 2cb5c4f7c53d62b5887c20d19fa0500fbeef9910 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Thu, 17 Oct 2024 16:25:14 +0200 Subject: [PATCH 03/29] reference title for known cns errors --- devtools/build_defaults_rst.py | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/build_defaults_rst.py b/devtools/build_defaults_rst.py index 5a42708ba..7cddabaad 100644 --- a/devtools/build_defaults_rst.py +++ b/devtools/build_defaults_rst.py @@ -62,6 +62,7 @@ "gear.extend_run": "Start from copy", "gear.greetings": "Greetings messages", "gear.haddockmodel": "HADDOCK models", + "gear.known_cns_errors": "Known CNS errors", "gear.parameters": "Parameters helper", "gear.prepare_run": "Prepare run", "gear.preprocessing": "PDB preprocessing", From feab5d1e3354e9ee0be01535f4e3cca7e9aef61f Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 21 Oct 2024 16:27:22 +0200 Subject: [PATCH 04/29] better openmm descr --- devtools/build_defaults_rst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/build_defaults_rst.py b/devtools/build_defaults_rst.py index 7cddabaad..b772f27f4 100644 --- a/devtools/build_defaults_rst.py +++ b/devtools/build_defaults_rst.py @@ -39,7 +39,7 @@ "alascan": "Alanine Scanning module", "ilrmsdmatrix": "Interface Ligand RMSD Matrix calculation module", "exit": "Exit module", - "openmm": "OpenMM module", + "openmm": "OpenMM Molecular Dynamics module", "sasascore": "Surface Accessibility Scoring module", } From 3579ff1f0283947e2b36710aca06518a9ed489f6 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Wed, 23 Oct 2024 15:40:51 +0200 Subject: [PATCH 05/29] corrected docstrings --- .../modules/refinement/flexref/__init__.py | 9 +++--- .../modules/refinement/openmm/__init__.py | 29 ++++++++++--------- .../modules/scoring/sasascore/sasascore.py | 3 ++ 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/haddock/modules/refinement/flexref/__init__.py b/src/haddock/modules/refinement/flexref/__init__.py index fca1801a6..bdbea226e 100644 --- a/src/haddock/modules/refinement/flexref/__init__.py +++ b/src/haddock/modules/refinement/flexref/__init__.py @@ -6,10 +6,11 @@ This semi-flexible SA consists of several stages: -- High temperature rigid body molecular dynamics -- Rigid body SA -- Semi-flexible SA with flexible side-chains at the interface -- Semi-flexible SA with fully flexible interface (both backbone and side-chains) + +* High temperature rigid body molecular dynamics +* Rigid body SA +* Semi-flexible SA with flexible side-chains at the interface +* Semi-flexible SA with fully flexible interface (both backbone and side-chains) By default, only the interface regions is treated as flexible. It is automatically defined based on the intermolecular contacts made. It is also possible to manually diff --git a/src/haddock/modules/refinement/openmm/__init__.py b/src/haddock/modules/refinement/openmm/__init__.py index 681d44747..1288367be 100644 --- a/src/haddock/modules/refinement/openmm/__init__.py +++ b/src/haddock/modules/refinement/openmm/__init__.py @@ -1,22 +1,25 @@ -"""OpenMM refinement module for HADDOCK3. +"""OpenMM Molecular Dynamics refinement module for HADDOCK3. The potential of OpenMM can be exploited to perform potentially different - tasks, such as: -- Run MD simulation for each model from previous step; -- Refine the models in the middle of a docking run. For example, it can be used - to refine the models coming from a `[rigidbody]` module before `[flexref]` is - executed, or to replace the `[mdref]` step. -- Generate conformers prior to their use in a thorough docking run. +tasks, such as: + +* Run MD simulation for each model from previous step; +* Refine the models in the middle of a docking run. For example, it can be used + to refine the models coming from a `[rigidbody]` module before `[flexref]` is + executed, or to replace the `[mdref]` step. +* Generate conformers prior to their use in a thorough docking run. To get a list of all possible parameters, run: - haddock3-cfg -m openmm + +>>> haddock3-cfg -m openmm Module workflow: -- Generate openmm topology and fix atoms -- Build solvation box -- Equilibration solvation box restraining the protein -- Run MD simulation: increase temperature, run MD, reduce temperature. -- Either generate an ensemble of multiple frames or return the last frame. + +* Generate openmm topology and fix atoms +* Build solvation box +* Equilibration solvation box restraining the protein +* Run MD simulation: increase temperature, run MD, reduce temperature. +* Either generate an ensemble of multiple frames or return the last frame. This module will refine all models coming from the previous workflow step and send them to the next step in the workflow. If you want to use other modules diff --git a/src/haddock/modules/scoring/sasascore/sasascore.py b/src/haddock/modules/scoring/sasascore/sasascore.py index 4b81f7517..7aa305507 100644 --- a/src/haddock/modules/scoring/sasascore/sasascore.py +++ b/src/haddock/modules/scoring/sasascore/sasascore.py @@ -87,6 +87,9 @@ def run(self) -> None: acc_sc, b_viols, a_viols = calc_acc_score(result_dic, self.buried_resdic, self.acc_resdic) + print(f"Accessibility score for {self.model}: {acc_sc}") + print(f"Buried violations: {b_viols}") + print(f"Accessible violations: {a_viols}") except AssertionError as e: log.warning(f"Error in get_accessibility for {self.model}: {e}.") acc_sc, b_viols, a_viols = None, None, None From fa65b41ec646d19e4d17ed0c55cd55e5bb94512a Mon Sep 17 00:00:00 2001 From: VGPReys Date: Wed, 23 Oct 2024 17:41:25 +0200 Subject: [PATCH 06/29] workaround import pdbtools in openmm --- src/haddock/modules/refinement/openmm/openmm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/haddock/modules/refinement/openmm/openmm.py b/src/haddock/modules/refinement/openmm/openmm.py index ce13004f9..f82d0316a 100644 --- a/src/haddock/modules/refinement/openmm/openmm.py +++ b/src/haddock/modules/refinement/openmm/openmm.py @@ -28,11 +28,15 @@ # Standard libarires importation import os +from contextlib import suppress from pathlib import Path # Import OpenMM and pdbfixer third-party libraries # >conda activate haddock3 # >conda install -c conda-forge libstdcxx-ng openmm pdbfixer + +# allow general testing when OpenMM is not installed +#with suppress(ImportError): from openmm import ( CustomCentroidBondForce, CustomExternalForce, @@ -69,8 +73,7 @@ from pdbfixer import PDBFixer # Haddock libraries -from pdbtools import pdb_delhetatm -from pdbtools.pdb_mkensemble import run as make_ensemble +from pdbtools import pdb_delhetatm, pdb_mkensemble from haddock import log from haddock.core.exceptions import ModuleError from haddock.core.typing import Optional, Union, ParamDict @@ -886,7 +889,7 @@ def generate_output_ensemble( f"Generating ensemble from {len(all_files)} samples: " f"{ensemble_filepath}" ) - ensemble = make_ensemble(all_files) + ensemble = pdb_mkensemble.run(all_files) with open(ensemble_filepath, "w") as wfile: for line in ensemble: wfile.write(line) From 0dba015e59c8097343259a418d98d2dfaa8167a0 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:20:13 +0100 Subject: [PATCH 07/29] fixed docstrings openmm --- .../modules/refinement/openmm/openmm.py | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/haddock/modules/refinement/openmm/openmm.py b/src/haddock/modules/refinement/openmm/openmm.py index f82d0316a..fbda9d810 100644 --- a/src/haddock/modules/refinement/openmm/openmm.py +++ b/src/haddock/modules/refinement/openmm/openmm.py @@ -1,28 +1,5 @@ -"""OpenMM refinement module for HADDOCK3. - -The potential of OpenMM can be exploited to perform potentially different - tasks, such as: -- Run MD simulation for each model from previous step; -- Refine the models in the middle of a docking run. For example, it can be used - to refine the models coming from a `[rigidbody]` module before `[flexref]` is - executed, or to replace the `[mdref]` step. -- Generate conformers prior to their use in a thorough docking run. - -To get a list of all possible parameters, run: - haddock3-cfg -m openmm - -Module workflow: -- Generate openmm topology and fix atoms -- Build solvation box -- Equilibration solvation box restraining the protein -- Run MD simulation: increase temperature, run MD, reduce temperature. -- Either generate an ensemble of multiple frames or return the last frame. - -This module will refine all models coming from the previous workflow step and -send them to the next step in the workflow. If you want to use other modules -such as `flexref` or `emref` after the OpenMM module, you need to recreate the -topologies by simply adding a `[topoaa]` step in the workflow. -See examples in `examples/thirdparty/openmm` folder. +""" +OpenMM Molecular Dynamics refinement module for HADDOCK3. """ # Standard libarires importation @@ -270,11 +247,11 @@ def equilibrate_solvation_box( """Machinery for the equilibration of water in presence of the protein. Here, the idea is to: - 0. Check if something has to be done - 1. Initiate the system - 2. Construct restrain forces on protein atom positions - 3. Run simulation under restrain - 4. Save new coordinates file + 0. Check if something has to be done + 1. Initiate the system + 2. Construct restrain forces on protein atom positions + 3. Run simulation under restrain + 4. Save new coordinates file Parameters ---------- @@ -576,6 +553,7 @@ def _get_simulation_temperature(simulation: Simulation, dof: int) -> float: NOTE: this function is similar to the lines of code found in the :py:class:`openmm.app.statedatareporter.StateDataReporter()` + NOTE2: Would be better if in the StateustomCentroidBondForce class... Parameters @@ -606,7 +584,9 @@ def remove_water_and_ions(input_filepath: str) -> str: """Remove water from the output of an explicit solvent run. Uses the pdb-tools.pdb_delhetatm() module to do this + NOTE: May produce an issue with TER atoms (Water + ions) + NOTE2: May lead to issue with modified AA e.g: phsophoserine, etc... Parameters From 5475695153246f89dd11e273585ae85d39a4e800 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:29:03 +0100 Subject: [PATCH 08/29] modified pages --- .github/workflows/pages.yml | 52 ++++++++++++++----------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 8369e90e6..81bdfc3a0 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -14,35 +14,23 @@ jobs: pages: runs-on: ubuntu-latest steps: - - run: echo "temporarily disabled" -# - uses: actions/checkout@v2 -# with: -# submodules: recursive -# -# - name: Set up Python -# uses: actions/setup-python@v4 -# with: -# python-version: "3.9" -# -# - name: Install dependencies -# run: | -# python -m pip install pip==23.1.2 setuptools==67.7.2 wheel==0.40.0 -# pip install virtualenv==20.23.0 tox==4.5.1.1 -# -# # needs to install hd3 so the command-line pages are -# # rendered properly -# - name: Install HADDOCK3 -# run: pip install -v . -# -# - name: Generate docs -# run: | -# tox -e docs -# touch haddock3-docs/.nojekyll -# -# - name: deploy -# uses: s0/git-publish-subdir-action@develop -# env: -# REPO: self -# BRANCH: gh-pages -# FOLDER: haddock3-docs -# GITHUB_TOKEN: ${{ secrets.PAGES }} +# - run: echo "temporarily disabled" + - name: install haddock3 with extra dependencies + run: pip install '.[dev,docs]' + +# install openmm to render openmm docs properly + - name: install openmm + conda install -c conda-forge openmm pdbfixer + + - name: Generate docs + run: | + sphinx-apidoc -f -e -o docs/ src/haddock -d 1 + sphinx-build -b html docs haddock3-docs + + - name: deploy + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: gh-pages + FOLDER: haddock3-docs + GITHUB_TOKEN: ${{ secrets.PAGES }} From 4ed4ed6bcc85fb180c356a0613c9da401d2876cd Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:35:21 +0100 Subject: [PATCH 09/29] removed comment --- .github/workflows/pages.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 81bdfc3a0..3869c0a6a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -14,14 +14,13 @@ jobs: pages: runs-on: ubuntu-latest steps: -# - run: echo "temporarily disabled" - name: install haddock3 with extra dependencies run: pip install '.[dev,docs]' # install openmm to render openmm docs properly - name: install openmm conda install -c conda-forge openmm pdbfixer - + - name: Generate docs run: | sphinx-apidoc -f -e -o docs/ src/haddock -d 1 From 6c73d01523d42038a65a2ac15810acb7993b63fa Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:38:37 +0100 Subject: [PATCH 10/29] more fixing --- .github/workflows/pages.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3869c0a6a..b9795cc73 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -14,15 +14,19 @@ jobs: pages: runs-on: ubuntu-latest steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + - name: install haddock3 with extra dependencies run: pip install '.[dev,docs]' -# install openmm to render openmm docs properly - name: install openmm - conda install -c conda-forge openmm pdbfixer + run: conda install -c conda-forge openmm pdbfixer - - name: Generate docs - run: | + - name: Generate docs + run: | sphinx-apidoc -f -e -o docs/ src/haddock -d 1 sphinx-build -b html docs haddock3-docs From baf65a8884a01c962869d7480cb2895efc41a6ac Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:47:56 +0100 Subject: [PATCH 11/29] more fixing --- .github/workflows/pages.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index b9795cc73..c76d8d6b3 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -9,6 +9,7 @@ on: push: branches: - main + - correct_auto_documentation jobs: pages: @@ -30,10 +31,10 @@ jobs: sphinx-apidoc -f -e -o docs/ src/haddock -d 1 sphinx-build -b html docs haddock3-docs - - name: deploy - uses: s0/git-publish-subdir-action@develop - env: - REPO: self - BRANCH: gh-pages - FOLDER: haddock3-docs - GITHUB_TOKEN: ${{ secrets.PAGES }} +# - name: deploy +# uses: s0/git-publish-subdir-action@develop +# env: +# REPO: self +# BRANCH: gh-pages +# FOLDER: haddock3-docs +# GITHUB_TOKEN: ${{ secrets.PAGES }} From f674b7676233d2cd63f456bc1487692f5933ad94 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:50:28 +0100 Subject: [PATCH 12/29] more fixing --- .github/workflows/pages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index c76d8d6b3..3bec5bb2a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -15,6 +15,8 @@ jobs: pages: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v4 with: From 0db0b82187f1ca544f94644c4fd511c6b4c79a95 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:52:19 +0100 Subject: [PATCH 13/29] more fixing --- .github/workflows/pages.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3bec5bb2a..0ea097350 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -18,10 +18,15 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.9" + - name: install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y openmpi-bin libopenmpi3 libopenmpi-dev + - name: install haddock3 with extra dependencies run: pip install '.[dev,docs]' From eb0b4fe4a49f563fe8a7674719d859fe91a24d77 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 13:58:54 +0100 Subject: [PATCH 14/29] re-added deployment --- .github/workflows/pages.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0ea097350..85132ca33 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,8 +1,4 @@ --- -# ======================= -# DISABLED UNTIL RELEASE # -# ======================= -# name: pages on: @@ -38,10 +34,10 @@ jobs: sphinx-apidoc -f -e -o docs/ src/haddock -d 1 sphinx-build -b html docs haddock3-docs -# - name: deploy -# uses: s0/git-publish-subdir-action@develop -# env: -# REPO: self -# BRANCH: gh-pages -# FOLDER: haddock3-docs -# GITHUB_TOKEN: ${{ secrets.PAGES }} + - name: deploy + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: gh-pages + FOLDER: haddock3-docs + GITHUB_TOKEN: ${{ secrets.PAGES }} From b81dbf043dcc43a440a7fe80e3d1c5b35799958d Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 14:11:38 +0100 Subject: [PATCH 15/29] updated docs dependencies --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4f9644e70..582b10606 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,12 +59,12 @@ dev = [ "kaleido==0.2.1", ] docs = [ - "sphinx>=2", - "sphinx-argparse>=0.4.0", - "sphinx_rtd_theme>=2.0.0", + "sphinx>=8", + "sphinx-argparse>=0.5.2", + "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", - "mock>=5.0.2", - "myst-parser>=1.0.0", + "mock>=5.1.0", + "myst-parser>=4.0.0", ] [project.urls] From 11c679bf125bf4eca1d9b795b47e8558d51c743d Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 14:14:26 +0100 Subject: [PATCH 16/29] updated python for docs --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 85132ca33..cbad69d5d 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: install system dependencies run: | From 0b6d09a6a18d7664f60aca15e2ce03ab7d1f3afc Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 17:12:37 +0100 Subject: [PATCH 17/29] reverting to 3.9 --- .github/workflows/pages.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index cbad69d5d..85132ca33 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.9" - name: install system dependencies run: | diff --git a/pyproject.toml b/pyproject.toml index 582b10606..181398b20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ dev = [ "kaleido==0.2.1", ] docs = [ - "sphinx>=8", + "sphinx>=7", "sphinx-argparse>=0.5.2", "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", From 95b415e88a853feac83735bf84e2add0f69e3b73 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 17:15:03 +0100 Subject: [PATCH 18/29] downgrading --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 181398b20..292ed2ea8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ dev = [ ] docs = [ "sphinx>=7", - "sphinx-argparse>=0.5.2", + "sphinx-argparse>=0.4.0", "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", "mock>=5.1.0", From 275175cbac801c07e41c7d342082de3f06f6d1eb Mon Sep 17 00:00:00 2001 From: mgiulini Date: Mon, 28 Oct 2024 17:15:52 +0100 Subject: [PATCH 19/29] downgrading --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 292ed2ea8..d082bb20b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ docs = [ "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", "mock>=5.1.0", - "myst-parser>=4.0.0", + "myst-parser>=3.0.1", ] [project.urls] From 1b2e133d69c990a50ca2dce22706e5a11d839d67 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 10:22:09 +0100 Subject: [PATCH 20/29] re added python 3.10 and touch --- .github/workflows/pages.yml | 4 ++-- pyproject.toml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 85132ca33..174370de3 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -5,7 +5,6 @@ on: push: branches: - main - - correct_auto_documentation jobs: pages: @@ -16,7 +15,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: install system dependencies run: | @@ -33,6 +32,7 @@ jobs: run: | sphinx-apidoc -f -e -o docs/ src/haddock -d 1 sphinx-build -b html docs haddock3-docs + touch haddock3-docs/.nojekyll - name: deploy uses: s0/git-publish-subdir-action@develop diff --git a/pyproject.toml b/pyproject.toml index d082bb20b..582b10606 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,12 +59,12 @@ dev = [ "kaleido==0.2.1", ] docs = [ - "sphinx>=7", - "sphinx-argparse>=0.4.0", + "sphinx>=8", + "sphinx-argparse>=0.5.2", "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", "mock>=5.1.0", - "myst-parser>=3.0.1", + "myst-parser>=4.0.0", ] [project.urls] From b435c292a06018f75c4eea53d986fbcdc6d13c6b Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 10:36:25 +0100 Subject: [PATCH 21/29] more fixing --- .github/workflows/pages.yml | 5 +++-- .readthedocs.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 174370de3..363f482e2 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -5,6 +5,7 @@ on: push: branches: - main + - correct_auto_documentation jobs: pages: @@ -25,8 +26,8 @@ jobs: - name: install haddock3 with extra dependencies run: pip install '.[dev,docs]' - - name: install openmm - run: conda install -c conda-forge openmm pdbfixer +# - name: install openmm +# run: conda install -c conda-forge openmm pdbfixer - name: Generate docs run: | diff --git a/.readthedocs.yml b/.readthedocs.yml index 00c7819d7..13a5e2ebd 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -17,7 +17,7 @@ formats: all # Optionally set the version of Python and requirements required to build your docs python: - version: 3.9 + version: 3.10 install: - requirements: - devtools/docs-requirements.txt From e6c1eecb74fad9be19e5fa75dac5ff754ee3f79d Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 11:02:35 +0100 Subject: [PATCH 22/29] changed order of installation --- .github/workflows/pages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 363f482e2..3abef7ff2 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -23,12 +23,12 @@ jobs: sudo apt-get update sudo apt-get install -y openmpi-bin libopenmpi3 libopenmpi-dev + - name: install openmm + run: conda install -c conda-forge openmm pdbfixer + - name: install haddock3 with extra dependencies run: pip install '.[dev,docs]' -# - name: install openmm -# run: conda install -c conda-forge openmm pdbfixer - - name: Generate docs run: | sphinx-apidoc -f -e -o docs/ src/haddock -d 1 From c24b0f00f42bfd94d52700be8f37bcadfb74886e Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 11:10:06 +0100 Subject: [PATCH 23/29] removed openmm --- .github/workflows/pages.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3abef7ff2..00fb81ed8 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -23,9 +23,6 @@ jobs: sudo apt-get update sudo apt-get install -y openmpi-bin libopenmpi3 libopenmpi-dev - - name: install openmm - run: conda install -c conda-forge openmm pdbfixer - - name: install haddock3 with extra dependencies run: pip install '.[dev,docs]' From 4008133c7faaa8b73c4962e427cca4a374d1ef31 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 11:49:23 +0100 Subject: [PATCH 24/29] corrected rst generation --- devtools/build_defaults_rst.py | 4 +- docs/tutorials/benchmark.md | 113 --------------------------------- 2 files changed, 2 insertions(+), 115 deletions(-) delete mode 100644 docs/tutorials/benchmark.md diff --git a/devtools/build_defaults_rst.py b/devtools/build_defaults_rst.py index b772f27f4..857e84edb 100644 --- a/devtools/build_defaults_rst.py +++ b/devtools/build_defaults_rst.py @@ -331,7 +331,7 @@ def main() -> None: target_path.mkdir(exist_ok=True) # collect rst files rst_files = Path('docs').glob( - f"haddock.{folder}.*.rst" + f"haddock.{folder}*.rst" ) for rst_file in rst_files: target_rst = Path(target_path, rst_file.name) @@ -369,7 +369,7 @@ def main() -> None: clients_folder.mkdir(exist_ok=True) cli_rst_files = Path('docs').glob( - f"haddock.clis.*.rst" + f"haddock.clis*.rst" ) for cli_rst_file in cli_rst_files: target_rst = Path( diff --git a/docs/tutorials/benchmark.md b/docs/tutorials/benchmark.md deleted file mode 100644 index 4af980c80..000000000 --- a/docs/tutorials/benchmark.md +++ /dev/null @@ -1,113 +0,0 @@ -# HADDOCK3 benchmark tutorial - -Developing HADDOCK3 requires handling thousands of parameters, either at -the CNS level or the Python level. Therefore, unit-testing is sometimes -not enough. To assess the correct functioning of HADDOCK3 we have -assembled a benchmarking workflow where we dock well known and studied -complexes and ensure the outcome matches expectations. - -To run HADDOCK3 as a user, you don't need to run this benchmark. But if -you are an advanced user who has configured HADDOCK3 in your systems, -you may wish to run the benchmark to make sure HADDOCK3 behaves as -expected. - -HADDOCK3 has two command-line clients that set up the benchmark workflow -automatically. Let's go through them step-by-step. - -## Obtaining the initial models - -The Bonvin lab has manually curated a list of systems ideal for this -benchmark. The repository is available here. Clone it to your machine -with: - -`git clone https://github.com/haddocking/BM5-clean` - -If you inspect the new `BM5-clean` folder, you will see the -`HADDOCK-ready` folder has more than 200 sub-folders with "ready-to-use" -systems for HADDOCK. - -## Setting up the runs - -Having HADDOCK3 installed, you can set up the runs with the following -command: - -``` -# first, make a new folder where you want the runs to be stored -mkdir -haddock3-bm BM5-clean/HADDOCK-ready [OPTIONS] -``` - -`[OPTIONS]` are optional :relaxed:. Look at the `haddock3-bm -h` help -menu and select which ones better adapt to your system. - -## Running with the daemon - -Running more than 200 HADDOCK jobs is time-consuming. Inspecting the -queue system manually over several days is a pain. Therefore, we created -a daemon that will handle the queue and submit the jobs for you. Use the -command: - -`haddock3-dmn [OPTIONS]` - -Use `haddock3-dmn -h` to read all possible options. - -From this point on, the daemon will manage the queue for you. You can -also run the daemon as a job; please read further. - -Initially, all jobs have a file named `AVAILABLE` pointing that the jobs -are ready to run. Jobs that are sent to the queue get the file flag -`RUNNING`. Completed jobs get the file flag `DONE`, and failed jobs get -the file flag `FAIL`.You can inspect which jobs are at which state with -the `find` command: - -`find -name DONE` - -You can count the number of folders with: - -`find -name DONE | wc -l` - -## Stopping the daemon - -If you want to stop the daemon, press `Ctrl+c` in the window where you -launch it. And manually cancel the remaining jobs. You can try the -following command: - -`qstat -a | awk '{print $4}' | grep BM5 | xargs scancel` - -`BM5` comes because all jobs prepared for the benchmark have the `BM5` -tag in their job name (unless you defined otherwise in the `[OPTIONS]`) - -## Further notes - -As with any command-line tool, the haddock3-daemon will run as long as -the terminal window is open. However, we don't recommend using the `&` -terminal detacher suffix command unless you know what you do. -Alternatively, you could use [`tmux`](https://github.com/tmux/tmux) to -maintain the session running even when you disconnect from your login -node. - -A better way can be to send the daemon job to some queue. You can easily -do that by using the daemon job created by the `haddock3-bm` command. - -## What happens if you halt the daemon? - -If you halt the daemon, you can restart the operations from where they -left. Two scenarios are possible: - -1. you also canceled running jobs -2. you let the running jobs finish properly - -In the first scenario, you want the previously running jobs to restart. -For that, run the command: - -`haddock3-dmn --restart [OPTIONS]` - -Or you can update the `hd3-daemon.job` file with the `--restart` option. - -In the second scenario, run the daemon as you would from scratch. Only -the jobs with the file flag `AVAILABLE` will be executed. - -Thanks for using HADDOCK3. [Any feedback is very -welcomed](https://github.com/haddocking/haddock3/issues). - -The HADDOCK team. From 31f74e126bfd7a6432488246caa1c168140c94cf Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 11:59:16 +0100 Subject: [PATCH 25/29] removed secondary branch --- .github/workflows/pages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 00fb81ed8..816ea48e9 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -5,7 +5,6 @@ on: push: branches: - main - - correct_auto_documentation jobs: pages: From e496a6a8728b2428d1de330dd3968fa086c43820 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 13:12:39 +0100 Subject: [PATCH 26/29] downgradin sphinx for python 3.9 compatibility --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 582b10606..181398b20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ dev = [ "kaleido==0.2.1", ] docs = [ - "sphinx>=8", + "sphinx>=7", "sphinx-argparse>=0.5.2", "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", From b6d56e9bedad08e681d9ea636bc66cef3fa8f809 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 13:15:09 +0100 Subject: [PATCH 27/29] downgradin sphinx-argparse for python 3.9 compatibility --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 181398b20..292ed2ea8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ dev = [ ] docs = [ "sphinx>=7", - "sphinx-argparse>=0.5.2", + "sphinx-argparse>=0.4.0", "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", "mock>=5.1.0", From 6ced39c166fd8a75bdc889e01f8fed8309858d1f Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 13:16:18 +0100 Subject: [PATCH 28/29] downgradin myst-parser for python 3.9 compatibility --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 292ed2ea8..d082bb20b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ docs = [ "sphinx_rtd_theme>=3.0.1", "CommonMark>=0.9.1", "mock>=5.1.0", - "myst-parser>=4.0.0", + "myst-parser>=3.0.1", ] [project.urls] From 4995aa6486d8ee266d42c1f1d130c6ae589794c6 Mon Sep 17 00:00:00 2001 From: mgiulini Date: Tue, 29 Oct 2024 13:36:56 +0100 Subject: [PATCH 29/29] removing prints --- src/haddock/modules/scoring/sasascore/sasascore.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/haddock/modules/scoring/sasascore/sasascore.py b/src/haddock/modules/scoring/sasascore/sasascore.py index 7aa305507..4b81f7517 100644 --- a/src/haddock/modules/scoring/sasascore/sasascore.py +++ b/src/haddock/modules/scoring/sasascore/sasascore.py @@ -87,9 +87,6 @@ def run(self) -> None: acc_sc, b_viols, a_viols = calc_acc_score(result_dic, self.buried_resdic, self.acc_resdic) - print(f"Accessibility score for {self.model}: {acc_sc}") - print(f"Buried violations: {b_viols}") - print(f"Accessible violations: {a_viols}") except AssertionError as e: log.warning(f"Error in get_accessibility for {self.model}: {e}.") acc_sc, b_viols, a_viols = None, None, None