Skip to content

Commit a94f9f9

Browse files
authored
Merge pull request #1039 from haddocking/1037-update-installationdevelopment-instructions
Update installation instructions
2 parents c6b3f99 + f9dcc9b commit a94f9f9

File tree

4 files changed

+67
-132
lines changed

4 files changed

+67
-132
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,34 @@ HADDOCK, standing for **H**igh **A**mbiguity **D**riven protein-protein **DOCK**
2626

2727
## Installation
2828

29-
Please check the [INSTALL](docs/INSTALL.md) file for instructions.
29+
Clone the repository and run `pip install .`;
30+
31+
```bash
32+
git clone https://github.com/haddocking/haddock3
33+
cd haddock3
34+
pip install .
35+
```
36+
37+
Execute:
38+
39+
```bash
40+
$ haddock3 -h
41+
usage: haddock3 [-h] [--restart RESTART] [--extend-run EXTEND_RUN] [--setup] [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [-v] recipe
42+
43+
positional arguments:
44+
recipe The input recipe file path
45+
46+
optional arguments:
47+
-h, --help show this help message and exit
48+
--restart RESTART Restart the run from a given step. Previous folders from the selected step onwards will be deleted.
49+
--extend-run EXTEND_RUN
50+
Start a run from a run directory previously prepared with the `haddock3-copy` CLI. Provide the run directory created with `haddock3-copy` CLI.
51+
--setup Only setup the run, do not execute
52+
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
53+
-v, --version show version
54+
```
55+
56+
For the installation of third-party additional software, please check the [INSTALL](docs/INSTALL.md).
3057

3158
You might also want to check the following utilities:
3259

docs/INSTALL.md

Lines changed: 13 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,31 @@
11
# Installation
22

3-
Open a `terminal` window and navigate to the folder where you want to
4-
install HADDOCK3; for example: `software`. The current installation
5-
instructions are local and will affect only your user.
6-
7-
Before starting with the installation of HADDOCK3, make sure to properly [install CNS](CNS.md).
8-
If you have installed a previous version of HADDOCK, you may already have a suitable version of CNS.
9-
Please do [check your CNS installation](CNS.md#5-Check-installation) before proceeding.
10-
11-
12-
## 1. Clone this repository:
13-
14-
Mind the `--recursive` flag when cloning!
15-
16-
```bash
17-
git clone --recursive https://github.com/haddocking/haddock3.git
18-
```
19-
20-
Go to the **haddock3** directory
21-
22-
```bash
23-
cd haddock3
24-
```
25-
26-
and type the following commands to first install the [FCC](https://github.com/haddocking/fcc) source code provided
27-
28-
```bash
29-
cd src/fcc/src
30-
chmod u+x Makefile
31-
make
32-
cd -
33-
```
34-
35-
Then, follow the same logic to install the [fast-rmsdmatrix](https://github.com/mgiulini/fast-rmsdmatrix) source code
36-
37-
```bash
38-
cd src/fast-rmsdmatrix/src
39-
chmod u+x Makefile
40-
make fast-rmsdmatrix
41-
cd -
42-
```
43-
44-
By the end of the above commands, you should be back to the **haddock3**
45-
main folder.
46-
47-
## 2 Create a virtual environment with Python 3.9+ and install dependencies:
3+
Create a virtual environment with Python 3.9:
484

495
You can use Python's `venv` or `conda` depending on your choice.
506
Commands are provided below:
517

528
### with `venv`
539

5410
```bash
55-
virtualenv venv --python=3.9
56-
source venv/bin/activate
57-
pip install -r requirements.txt
11+
python -m venv .venv
12+
source .venv/bin/activate
5813
```
5914

6015
### with `conda`
6116

6217
```bash
6318
conda create -n haddock3 python=3.9
6419
conda activate haddock3
65-
pip install -r requirements.txt
66-
```
67-
68-
## 3. Install the HADDOCK3 package and command line clients
69-
70-
```bash
71-
python setup.py develop --no-deps
72-
```
73-
74-
Of note, here we are still using the depreacted `setup.py` command due to HPC, GRID and LOCAL compabilities with CNS.
75-
76-
## 4. Make a CNS binary shortcut to the expected path:
77-
78-
```bash
79-
mkdir -p bin/
80-
81-
# on mac
82-
ln -s /PATH/TO/cns_solve_1.3/mac-intel-darwin/source/cns_solve-2206031450.exe bin/cns
83-
84-
# on linux
85-
ln -s /PATH/TO/cns_solve_1.3/intel-x86_64bit-linux/source/cns_solve-2002171359.exe bin/cns
86-
```
87-
88-
As long as you have the `(haddock3)` python environment activated, you can
89-
navigate away from the **haddock3** installation folder. You can run
90-
HADDOCK3 from anywhere. To run HADDOCK3, follow the [usage
91-
guidelines](USAGE.md).
92-
93-
94-
## 5. Keep your installation up to date
95-
96-
Navigate to the **haddock3** installation folder (the one you cloned from
97-
GitHub). Ensure you have the `(haddock3)` python environment activated.
98-
Please keep in mind that HADDOCK3, as well as its
99-
dependencies, are under active development.
100-
If the updating processing fails, it is safest to reinstall
101-
from scratch. Always refer to the latest installation guidelines.
102-
103-
```bash
104-
# if you used `venv`
105-
source venv/bin/activate
106-
107-
# if you used `conda`
108-
conda activate haddock3
10920
```
11021

111-
Afterwards:
112-
11322
```bash
114-
# pull the latest source code from our repository to your computer
115-
git pull
116-
117-
# update the dependencies by running:
118-
pip install -r requirements.txt --upgrade
119-
120-
# ensure all command-lines clients are installed
121-
python setup.py develop --no-deps
23+
git clone https://github.com/haddocking/haddock3.git
24+
cd haddock3
25+
pip install .
12226
```
12327

124-
Of note, here we are still using the depreacted `setup.py` command due to HPC, GRID and LOCAL compabilities with CNS.
125-
126-
127-
## 6. (Optional) Install MPI libraries if you intend to run HADDOCK3 with MPI
28+
## (Optional) Install MPI libraries if you intend to run HADDOCK3 with MPI
12829

12930
To use the mpi implementation of haddock3 you must have mpi4py installed in the `(haddock3)` python environment, and OpenMPI in the host system.
13031

@@ -136,7 +37,7 @@ $ conda install -c conda-forge mpi4py
13637

13738
Later, you can find [here](https://www.bonvinlab.org/haddock3/tutorials/mpi.html) instructions on how to run HADDOCK3 with MPI.
13839

139-
## 7. (Optional) Install web service dependencies if you intend to run HADDOCK3 restraints web service
40+
## (Optional) Install web service dependencies if you intend to run HADDOCK3 restraints web service
14041

14142
To run the restraints web service you must have the following dependencies installed in the `(haddock3)` python environment:
14243

@@ -146,21 +47,21 @@ pip install uvicorn fastapi
14647

14748
Information on the restraints web service can be found [here](https://github.com/haddocking/haddock3/blob/main/src/haddock/clis/restraints/webservice.py).
14849

149-
# Installing third-party packages
50+
## Installing third-party packages
15051

15152
HADDOCK3 can integrate third-party software in its workflows.
15253
We are not responsible for the proper installation of such packages, but
15354
we help you install them. Below, you will find a list of all third-party
15455
packages HADDOCK3 can use and guidelines for their proper installation.
15556

156-
## `lightdock`
57+
### `lightdock` (outdated)
15758

15859
To install [lightdock](https://github.com/lightdock/lightdock) follow
15960
the instructions on the project's website. Remember to install it under
16061
the same Python environment you created for HADDOCK3. If you have any
16162
doubts, please let us know.
16263

163-
## `gdock`
64+
### `gdock` (outdated)
16465

16566
1. Clone the latest version:
16667

@@ -170,11 +71,13 @@ git clone https://github.com/rvhonorato/gdock.git
17071
```
17172

17273
2. Install Python3+ dependencies
74+
17375
```
17476
pip install deap scipy mgzip biopython
17577
```
17678

17779
3. Set `GDOCK_PATH`
80+
17881
```
17982
export GDOCK_PATH=some-folder
18083
```

src/haddock/clis/cli.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@
3636
ap = argparse.ArgumentParser()
3737

3838
ap.add_argument(
39-
"recipe",
39+
"workflow",
4040
type=arg_file_exist,
41-
help="The input recipe file path",
42-
)
41+
help=(
42+
"The input configuration file path describing "
43+
"the workflow to be performed"
44+
),
45+
)
4346

4447
add_restart_arg(ap)
4548
add_extend_run(ap)
@@ -76,7 +79,7 @@ def maincli() -> None:
7679

7780

7881
def main(
79-
recipe: FilePath,
82+
workflow: FilePath,
8083
restart: Optional[int] = None,
8184
extend_run: Optional[FilePath] = EXTEND_RUN_DEFAULT,
8285
setup_only: bool = False,
@@ -87,8 +90,8 @@ def main(
8790
8891
Parameters
8992
----------
90-
recipe : str or pathlib.Path
91-
The path to the recipe (config file).
93+
workflow : str or pathlib.Path
94+
The path to the workflow (config file).
9295
9396
restart : int
9497
The step to restart the run from (inclusive).
@@ -145,7 +148,7 @@ def main(
145148

146149
with log_error_and_exit():
147150
params, other_params = setup_run(
148-
recipe,
151+
workflow,
149152
restart_from=restart,
150153
extend_run=extend_run,
151154
)

tests/test_cli.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
from . import configs_data
99

1010

11-
recipe = Path(configs_data, 'recipe.cfg')
11+
@pytest.fixture(name="workflow")
12+
def fixture_workflow():
13+
yield Path(configs_data, "recipe.cfg")
1214

1315

1416
def test_cli_has_maincli():
@@ -21,29 +23,29 @@ def test_cli_has_maincli():
2123

2224

2325
def test_ap_recipe_does_not_exist():
24-
"""Test raise error if recipe does not exist."""
26+
"""Test raise error if workflow does not exist."""
2527
with pytest.raises(SystemExit) as exit:
2628
cli.ap.parse_args('does_not_exit.cfg'.split())
2729
assert exit.type == SystemExit
2830
assert exit.value.code == 2
2931

3032

31-
def test_ap_recipe_exists():
32-
"""Test reading recipes."""
33-
cmd = cli.ap.parse_args(str(recipe).split())
34-
with open(cmd.recipe) as fin:
33+
def test_ap_workflow_exists(workflow):
34+
"""Test reading workflows."""
35+
cmd = cli.ap.parse_args(str(workflow).split())
36+
with open(cmd.workflow) as fin:
3537
fin.readlines()
3638

3739

38-
def test_ap_setup_true():
40+
def test_ap_setup_true(workflow):
3941
"""Test --setup flag."""
40-
cmd = cli.ap.parse_args(f'{recipe} --setup'.split())
42+
cmd = cli.ap.parse_args(f'{workflow} --setup'.split())
4143
assert cmd.setup_only is True
4244

4345

44-
def test_ap_setup_false():
46+
def test_ap_setup_false(workflow):
4547
"""Test setup only default."""
46-
cmd = cli.ap.parse_args(str(recipe).split())
48+
cmd = cli.ap.parse_args(str(workflow).split())
4749
assert cmd.setup_only is False
4850

4951

@@ -59,15 +61,15 @@ def test_ap_version():
5961
'level',
6062
("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"),
6163
)
62-
def test_ap_log_level(level):
64+
def test_ap_log_level(workflow, level):
6365
"""Test --log-level correct."""
64-
cmd = cli.ap.parse_args(f'{recipe} --log-level {level}'.split())
66+
cmd = cli.ap.parse_args(f'{workflow} --log-level {level}'.split())
6567
assert cmd.log_level == level
6668

6769

68-
def test_ap_log_level_error():
70+
def test_ap_log_level_error(workflow):
6971
"""Test --log-level error with bad input."""
7072
with pytest.raises(SystemExit) as exit:
71-
cli.ap.parse_args(f'{recipe} --log-level BAD'.split())
73+
cli.ap.parse_args(f'{workflow} --log-level BAD'.split())
7274
assert exit.type == SystemExit
7375
assert exit.value.code == 2

0 commit comments

Comments
 (0)