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

quick fix openm install and 8.2 version #1145

Merged
merged 23 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c44d4db
quick fix openm install and 8.2 version
VGPReys Nov 14, 2024
7b40fd3
Update docs/INSTALL.md
VGPReys Nov 18, 2024
5ead6ab
Update src/haddock/modules/refinement/openmm/__init__.py
VGPReys Nov 18, 2024
f8a23b0
instructions to install openmm under venv
VGPReys Nov 18, 2024
95be79a
Merge branch 'main' into openmm-8-2-updates
VGPReys Nov 18, 2024
e4dd85e
update install instructions
VGPReys Nov 19, 2024
ff99681
Merge branch 'main' into openmm-8-2-updates
VGPReys Nov 19, 2024
11a4456
Update docs/INSTALL.md
VGPReys Nov 19, 2024
d9b8493
Update docs/INSTALL.md
VGPReys Nov 19, 2024
296fa18
reducing openmm tests cfg file computational cost
VGPReys Nov 20, 2024
a25cf3a
reduce solvant equilibration timesteps in -test.cfg
VGPReys Nov 21, 2024
20dc03d
Upgrade on the openmm module
VGPReys Nov 21, 2024
a94a5c4
manage automatic detection of chain breaks as preprocessing step in o…
VGPReys Nov 22, 2024
97fa61a
adding test comparison files
VGPReys Nov 26, 2024
21603ee
test for chain break functionality
VGPReys Nov 26, 2024
a2ab9dd
modify openmm pre-processing steps to use chain break detection
VGPReys Nov 26, 2024
631d4b4
adding chain break detection function in libpdb
VGPReys Nov 26, 2024
9d52aac
removing unused pdbtidy from openmm
VGPReys Nov 27, 2024
7ca3a76
fix last residue writing
VGPReys Nov 27, 2024
4489fce
Merge branch 'main' into openmm-8-2-updates
VGPReys Nov 27, 2024
a653ff6
Merge branch 'main' into openmm-8-2-updates
VGPReys Dec 5, 2024
0bf6d8e
Merge branch 'main' into openmm-8-2-updates
VGPReys Dec 16, 2024
774da56
Merge branch 'main' into openmm-8-2-updates
VGPReys Dec 16, 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
32 changes: 28 additions & 4 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,41 @@ information.

## `openmm`

1. Install the latest version of openmm and pdbfixer
The use of the openmm module requires the installation of both OpenMM and pdbfixer.

### In venv

The venv installation instruction uses `pip` and requires a python version >=3.10 (not functional with python3.9).

```bash
# Create a new virtual env
python3.12 -m venv hd3-openmm
source hd3-openmm/bin/activate
# Install haddock3
pip install .
# Install OpenMM
pip install openmm
VGPReys marked this conversation as resolved.
Show resolved Hide resolved
# Install openmm - pdbfixer
pip install https://github.com/openmm/pdbfixer/archive/refs/tags/v1.10.tar.gz
```

### In conda

The Conda installation instructions are using conda-forge to retrieve packages and requires a python3 version between 3.9 and 3.12.

```bash
conda create -n hd3-p39-openmm python=3.9
VGPReys marked this conversation as resolved.
Show resolved Hide resolved
# Activate the haddock3 env
conda activate haddock3
conda activate hd3-p39-openmm
# Install haddock3
pip install haddock3
# libstdxx must be installed, maybe already present in your system
conda install -c conda-forge libstdcxx-ng
# Install OpenMM and related tools/binaries
conda install -c conda-forge openmm pdbfixer
conda install -c conda-forge openmm==8.2.0 pdbfixer
VGPReys marked this conversation as resolved.
Show resolved Hide resolved
```

Openmm should automatically detect the fastest platform among those available
OpenMM should automatically detect the fastest platform among those available
on your machine.

Please refer to the [official page](http://docs.openmm.org/latest/userguide/)
Expand Down
25 changes: 8 additions & 17 deletions src/haddock/modules/refinement/openmm/__init__.py
VGPReys marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -98,26 +98,17 @@ def confirm_installation(cls) -> None:
ThirdPartyIntallationError
When OpenMM pdbfixer is not installed
"""
def run_subprocess(command_to_run: str) -> str:
"""Run subprocess."""
subprocess_output = subprocrun(
[command_to_run],
shell=True,
capture_output=True,
encoding='utf-8',
)
return subprocess_output.stdout.strip()

checkOpenMM = run_subprocess("conda list openmm --json")
checkPdbfixer = run_subprocess("conda list pdbfixer --json")

if (checkOpenMM == "[]"):
try:
import openmm
except ModuleNotFoundError:
raise ThirdPartyIntallationError(
"OpenMM is not installed in conda."
"OpenMM is not installed."
)
if (checkPdbfixer == "[]"):
try:
import pdbfixer
except ModuleNotFoundError:
raise ThirdPartyIntallationError(
"OpenMM pdbfixer is not installed in conda."
"OpenMM pdbfixer is not installed."
)
return None

Expand Down
10 changes: 8 additions & 2 deletions src/haddock/modules/refinement/openmm/openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,11 +716,17 @@ def run_openmm(
qtemp = n * delta_temp
integrator.setTemperature(qtemp * kelvin)
simulation.step(int(eq_steps / nvt_sims))
# Try to obtain the degree of freedom
try:
dof = statereporter._dof
except AttributeError:
# may not exists if in implicit solvent..
dof = system.getNumParticles() * 3
# Makes sure temperature of the system is reached
self._stabilize_temperature(
simulation,
qtemp,
statereporter._dof,
self.params["temperature_kelvin"],
mgiulini marked this conversation as resolved.
Show resolved Hide resolved
dof,
tolerance=5.0,
steps=50
)
Expand Down