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

Fix issues #215 and #216 #217

Merged
merged 2 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 2 additions & 4 deletions python/BioSimSpace/Metadynamics/_aux/metadynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

from ..._Utils import _try_import

mm = _try_import("openmm")
unit = _try_import("openmm.unit", "conda install -c conda-forge openmm")
import openmm as mm
from openmm import unit

from collections import namedtuple
from functools import reduce
Expand Down
12 changes: 6 additions & 6 deletions python/BioSimSpace/Process/_openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,13 +877,13 @@ def _generate_config(self):

self.addToConfig("\n# Upper wall.")
self.addToConfig(
"upper_wall_rest = CustomCentroidBondForce(3, '(k/2)*max(distance(g1,g2)*cos(angle(g1,g2,g3)) - upper_wall, 0)^2')"
"upper_wall_rest = CustomCentroidBondForce(3, '(k1/2)*max(distance(g1,g2)*cos(angle(g1,g2,g3)) - upper_wall, 0)^2')"
)
self.addToConfig("upper_wall_rest.addGroup(lig)")
self.addToConfig("upper_wall_rest.addGroup(p1)")
self.addToConfig("upper_wall_rest.addGroup(p2)")
self.addToConfig("upper_wall_rest.addBond([0,1,2])")
self.addToConfig("upper_wall_rest.addGlobalParameter('k', k1)")
self.addToConfig("upper_wall_rest.addGlobalParameter('k1', k1)")
self.addToConfig(
"upper_wall_rest.addGlobalParameter('upper_wall', upper_wall)"
)
Expand All @@ -903,13 +903,13 @@ def _generate_config(self):
)

self.addToConfig(
"dist_restraint = CustomCentroidBondForce(3, '(k/2)*max(distance(g1,g2)*sin(angle(g1,g2,g3)) - (a/(1+exp(b*(distance(g1,g2)*cos(angle(g1,g2,g3))-c)))+d), 0)^2')"
"dist_restraint = CustomCentroidBondForce(3, '(k2/2)*max(distance(g1,g2)*sin(angle(g1,g2,g3)) - (a/(1+exp(b*(distance(g1,g2)*cos(angle(g1,g2,g3))-c)))+d), 0)^2')"
)
self.addToConfig("dist_restraint.addGroup(lig)")
self.addToConfig("dist_restraint.addGroup(p1)")
self.addToConfig("dist_restraint.addGroup(p2)")
self.addToConfig("dist_restraint.addBond([0,1,2])")
self.addToConfig("dist_restraint.addGlobalParameter('k', k2)")
self.addToConfig("dist_restraint.addGlobalParameter('k2', k2)")
self.addToConfig("dist_restraint.addGlobalParameter('a', wall_width)")
self.addToConfig("dist_restraint.addGlobalParameter('b', beta_cent)")
self.addToConfig("dist_restraint.addGlobalParameter('c', s_cent)")
Expand All @@ -919,13 +919,13 @@ def _generate_config(self):

self.addToConfig("\n# Lower wall.")
self.addToConfig(
"lower_wall_rest = CustomCentroidBondForce(3, '(k/2)*min(distance(g1,g2)*cos(angle(g1,g2,g3)) - lower_wall, 0)^2')"
"lower_wall_rest = CustomCentroidBondForce(3, '(k1/2)*min(distance(g1,g2)*cos(angle(g1,g2,g3)) - lower_wall, 0)^2')"
)
self.addToConfig("lower_wall_rest.addGroup(lig)")
self.addToConfig("lower_wall_rest.addGroup(p1)")
self.addToConfig("lower_wall_rest.addGroup(p2)")
self.addToConfig("lower_wall_rest.addBond([0,1,2])")
self.addToConfig("lower_wall_rest.addGlobalParameter('k', k1)")
self.addToConfig("lower_wall_rest.addGlobalParameter('k1', k1)")
self.addToConfig(
"lower_wall_rest.addGlobalParameter('lower_wall', lower_wall)"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

from ..._Utils import _try_import

mm = _try_import("openmm")
unit = _try_import("openmm.unit", "conda install -c conda-forge openmm")
import openmm as mm
from openmm import unit

from collections import namedtuple
from functools import reduce
Expand Down
12 changes: 6 additions & 6 deletions python/BioSimSpace/Sandpit/Exscientia/Process/_openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,13 +878,13 @@ def _generate_config(self):

self.addToConfig("\n# Upper wall.")
self.addToConfig(
"upper_wall_rest = CustomCentroidBondForce(3, '(k/2)*max(distance(g1,g2)*cos(angle(g1,g2,g3)) - upper_wall, 0)^2')"
"upper_wall_rest = CustomCentroidBondForce(3, '(k1/2)*max(distance(g1,g2)*cos(angle(g1,g2,g3)) - upper_wall, 0)^2')"
)
self.addToConfig("upper_wall_rest.addGroup(lig)")
self.addToConfig("upper_wall_rest.addGroup(p1)")
self.addToConfig("upper_wall_rest.addGroup(p2)")
self.addToConfig("upper_wall_rest.addBond([0,1,2])")
self.addToConfig("upper_wall_rest.addGlobalParameter('k', k1)")
self.addToConfig("upper_wall_rest.addGlobalParameter('k1', k1)")
self.addToConfig(
"upper_wall_rest.addGlobalParameter('upper_wall', upper_wall)"
)
Expand All @@ -904,13 +904,13 @@ def _generate_config(self):
)

self.addToConfig(
"dist_restraint = CustomCentroidBondForce(3, '(k/2)*max(distance(g1,g2)*sin(angle(g1,g2,g3)) - (a/(1+exp(b*(distance(g1,g2)*cos(angle(g1,g2,g3))-c)))+d), 0)^2')"
"dist_restraint = CustomCentroidBondForce(3, '(k2/2)*max(distance(g1,g2)*sin(angle(g1,g2,g3)) - (a/(1+exp(b*(distance(g1,g2)*cos(angle(g1,g2,g3))-c)))+d), 0)^2')"
)
self.addToConfig("dist_restraint.addGroup(lig)")
self.addToConfig("dist_restraint.addGroup(p1)")
self.addToConfig("dist_restraint.addGroup(p2)")
self.addToConfig("dist_restraint.addBond([0,1,2])")
self.addToConfig("dist_restraint.addGlobalParameter('k', k2)")
self.addToConfig("dist_restraint.addGlobalParameter('k2', k2)")
self.addToConfig("dist_restraint.addGlobalParameter('a', wall_width)")
self.addToConfig("dist_restraint.addGlobalParameter('b', beta_cent)")
self.addToConfig("dist_restraint.addGlobalParameter('c', s_cent)")
Expand All @@ -920,13 +920,13 @@ def _generate_config(self):

self.addToConfig("\n# Lower wall.")
self.addToConfig(
"lower_wall_rest = CustomCentroidBondForce(3, '(k/2)*min(distance(g1,g2)*cos(angle(g1,g2,g3)) - lower_wall, 0)^2')"
"lower_wall_rest = CustomCentroidBondForce(3, '(k1/2)*min(distance(g1,g2)*cos(angle(g1,g2,g3)) - lower_wall, 0)^2')"
)
self.addToConfig("lower_wall_rest.addGroup(lig)")
self.addToConfig("lower_wall_rest.addGroup(p1)")
self.addToConfig("lower_wall_rest.addGroup(p2)")
self.addToConfig("lower_wall_rest.addBond([0,1,2])")
self.addToConfig("lower_wall_rest.addGlobalParameter('k', k1)")
self.addToConfig("lower_wall_rest.addGlobalParameter('k1', k1)")
self.addToConfig(
"lower_wall_rest.addGlobalParameter('lower_wall', lower_wall)"
)
Expand Down
Loading