Skip to content

Commit

Permalink
System setup with espaloma (#11)
Browse files Browse the repository at this point in the history
* Separate solvation and parameter assignment

* Add espaloma model

* Parametrize solute with espaloma

* Linters
  • Loading branch information
chapincavender authored Oct 18, 2023
1 parent 1c9b6b1 commit db9e984
Show file tree
Hide file tree
Showing 6 changed files with 336 additions and 194 deletions.
35 changes: 35 additions & 0 deletions devtools/conda-envs/proteinbenchmark-espaloma.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: openff-proteinbenchmark-espaloma
channels:
- conda-forge
- openeye
- defaults
dependencies:
- black
- click
- isort
- pip
- python

# System setup
- pip:
- git+https://github.com/deGrootLab/pmx@develop
- git+https://github.com/Electrostatics/pdb2pqr@master#egg=pdb2pqr

# MM calculations
- ambertools
- cudatoolkit
- espaloma>=0.3.2
- openeye-toolkits
- openff-forcefields
- openff-toolkit>=0.13.0
- openff-units
- openmm>=8.0.0
- openmmforcefields>=0.12.0
- openmmtools

# Analysis
- loos
- pandas
- pymol-open-source
- seaborn

2 changes: 1 addition & 1 deletion devtools/conda-envs/proteinbenchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dependencies:
- pip:
- git+https://github.com/deGrootLab/pmx@develop
- git+https://github.com/Electrostatics/pdb2pqr@master#egg=pdb2pqr
- git+https://github.com/openmm/openmmforcefields@main

# MM calculations
- ambertools
Expand All @@ -24,6 +23,7 @@ dependencies:
- openff-toolkit>=0.13.0
- openff-units
- openmm>=8.0.0
- openmmforcefields>=0.12.0
- openmmtools

# Analysis
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions proteinbenchmark/force_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# List of force fields with force field XML file, water model, and water model
# XML file
force_fields = {
"espaloma-0.3.2-tip3p": {
"force_field_file": Path(ff_directory, "espaloma-0.3.2.pt"),
"water_model": "tip3p",
},
"ff14sb-opc": {
"force_field_file": Path(
ff_directory, "nerenberg_ff14sb_c0ala_c0gly_c0val.xml"
Expand Down
29 changes: 25 additions & 4 deletions proteinbenchmark/protein_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from proteinbenchmark.openmm_simulation import OpenMMSimulation
from proteinbenchmark.simulation_parameters import *
from proteinbenchmark.system_setup import (
assign_parameters,
build_initial_coordinates,
minimize_gmx,
minimize_openmm,
Expand Down Expand Up @@ -168,8 +169,8 @@ def setup(self):
'contain one of "aa_sequence" or "initial_pdb"'
)

# Solvate, add ions, and construct parametrized system
if not exists_and_not_empty(self.parametrized_system):
# Solvate and add ions using Amber ff14SB as a reference force field
if not exists_and_not_empty(solvated_pdb):
print(f"Solvating system {self.system_name}")

# Get parameters for solvation and constructing OpenMM system
Expand All @@ -191,8 +192,29 @@ def setup(self):
vdw_switch_width = VDW_SWITCH_WIDTH

solvate(
simulation_platform=self.simulation_platform,
ionic_strength=self.target_parameters["ionic_strength"],
protonated_pdb_file=self.protonated_pdb,
solvated_pdb_file=solvated_pdb,
water_model=self.water_model,
solvent_padding=solvent_padding,
)

# Construct parametrized system
if not exists_and_not_empty(self.parametrized_system):
print(f"Parametrizing system {self.system_name}")

if "nonbonded_cutoff" in self.target_parameters:
nonbonded_cutoff = self.target_parameters["nonbonded_cutoff"]
else:
nonbonded_cutoff = NONBONDED_CUTOFF

if "vdw_switch_width" in self.target_parameters:
vdw_switch_width = self.target_parameters["vdw_switch_width"]
else:
vdw_switch_width = VDW_SWITCH_WIDTH

assign_parameters(
simulation_platform=self.simulation_platform,
nonbonded_cutoff=nonbonded_cutoff,
vdw_switch_width=vdw_switch_width,
protonated_pdb_file=self.protonated_pdb,
Expand All @@ -201,7 +223,6 @@ def setup(self):
water_model=self.water_model,
force_field_file=self.force_field_file,
water_model_file=self.water_model_file,
solvent_padding=solvent_padding,
setup_prefix=self.setup_prefix,
)

Expand Down
Loading

0 comments on commit db9e984

Please sign in to comment.