pyVLMP 1.0.2__tar.gz → 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyVLMP-1.0.2/pyVLMP.egg-info → pyVLMP-1.0.4}/PKG-INFO +1 -1
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/__init__.py +8 -2
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/HELIX.py +16 -24
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/utils/utils.py +15 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4/pyVLMP.egg-info}/PKG-INFO +1 -1
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyproject.toml +1 -1
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/LICENSE +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/MANIFEST.in +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/README.md +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/VLMP.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/__main__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/globals/NVT.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/globals/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/BBK.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/EulerMaruyama.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/EulerMaruyamaRigidBody.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/GJF.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForce.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForceBetweenCentersOfMass.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForceOverCenterOfMass.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantTorqueBetweenCentersOfMass.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantTorqueOverCenterOfMass.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constraintCenterOfMassPosition.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/harmonicBondBetweenCentersOfMass.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelOperations/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelOperations/setCenterOfMassPosition.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/CORONAVIRUS.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/KB.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/MADna.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/SBCG.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/SOP.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/WLC.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/data/CORONAVIRUS.json +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/data/MADna.json +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/centerOfMassMeasurement.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/heightMeasurement.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/info.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/patchPolymersMeasurement.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/savePatchyParticlesState.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/saveState.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/system/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/system/backup.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/system/simulationName.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/types/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/types/basic.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/types/none.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/units/KcalMol_A.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/units/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/units/none.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/experiments/SurfaceUmbrellaSampling.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/experiments/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/utils/__init__.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/utils/bounds.py +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/SOURCES.txt +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/dependency_links.txt +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/requires.txt +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/top_level.txt +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/setup.cfg +0 -0
- {pyVLMP-1.0.2 → pyVLMP-1.0.4}/setup.py +0 -0
|
@@ -49,6 +49,12 @@ logger.addHandler(clogger)
|
|
|
49
49
|
|
|
50
50
|
#################################################
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if "-m" not in sys.argv:
|
|
53
|
+
#This done to avoid the error when running the program with -m option.
|
|
54
|
+
#When running with -m option a large number of libraries imported by VLMP
|
|
55
|
+
#are not needed.
|
|
54
56
|
|
|
57
|
+
logger.info("Starting VLMP...")
|
|
58
|
+
|
|
59
|
+
from .VLMP import VLMP
|
|
60
|
+
from .utils import *
|
|
@@ -4,6 +4,7 @@ import itertools
|
|
|
4
4
|
import logging
|
|
5
5
|
|
|
6
6
|
from . import modelBase
|
|
7
|
+
from ...utils.utils import getEx
|
|
7
8
|
|
|
8
9
|
import random
|
|
9
10
|
|
|
@@ -33,35 +34,22 @@ class HELIX(modelBase):
|
|
|
33
34
|
def __computeKdst(self,var,Eb,rc):
|
|
34
35
|
init = 1.0
|
|
35
36
|
Kdst = root(lambda K: var - (self.kT/Eb)*((rc*rc)/(np.pi*np.pi))*((1.0-np.exp(-2.0*K))/K),init)
|
|
37
|
+
varTheo = (self.kT/Eb)*((rc*rc)/(np.pi*np.pi))*((1.0-np.exp(-2.0*Kdst["x"][0]))/Kdst["x"][0])
|
|
38
|
+
if np.abs(varTheo-var) > 1e-6:
|
|
39
|
+
self.logger.error(f"[HELIX] Error computing Kdst")
|
|
40
|
+
raise Exception("Error computing Kdst")
|
|
36
41
|
return Kdst["x"][0]
|
|
37
42
|
|
|
38
43
|
def __computeKangle(self,var,Eb):
|
|
39
44
|
init = (1.0-0.5*var*(Eb/self.kT))/2.0
|
|
40
45
|
Kangle = root(lambda K: var - (self.kT/Eb)*((1.0-np.exp(-2.0*K))/K),init)
|
|
46
|
+
varTheo = (self.kT/Eb)*((1.0-np.exp(-2.0*Kangle["x"][0]))/Kangle["x"][0])
|
|
47
|
+
if np.abs(varTheo-var) > 1e-6:
|
|
48
|
+
self.logger.error(f"[HELIX] Error computing Kangle")
|
|
49
|
+
raise Exception("Error computing Kangle")
|
|
41
50
|
return Kangle["x"][0]
|
|
42
51
|
|
|
43
52
|
|
|
44
|
-
def __getEx(self,q):
|
|
45
|
-
""" Given a quaternion, q, the function returns the z vector of the local basis"""
|
|
46
|
-
|
|
47
|
-
q0,q1,q2,q3 = q
|
|
48
|
-
|
|
49
|
-
return 2.0*np.asarray([q0*q0+q1*q1-0.5,q1*q2+q0*q3,q1*q3-q0*q2])
|
|
50
|
-
|
|
51
|
-
def __getEy(self,q):
|
|
52
|
-
""" Given a quaternion, q, the function returns the z vector of the local basis"""
|
|
53
|
-
|
|
54
|
-
q0,q1,q2,q3 = q
|
|
55
|
-
|
|
56
|
-
return 2.0*np.asarray([q1*q2-q0*q3,q0*q0+q2*q2-0.5,q2*q3+q0*q1])
|
|
57
|
-
|
|
58
|
-
def __getEz(self,q):
|
|
59
|
-
""" Given a quaternion, q, the function returns the z vector of the local basis"""
|
|
60
|
-
|
|
61
|
-
q0,q1,q2,q3 = q
|
|
62
|
-
|
|
63
|
-
return 2.0*np.asarray([q1*q3+q0*q2,q2*q3-q0*q1,q0*q0+q3*q3-0.5])
|
|
64
|
-
|
|
65
53
|
def __generateRandomPositions(self):
|
|
66
54
|
monomersPositions = []
|
|
67
55
|
monomersOrientations = []
|
|
@@ -171,7 +159,7 @@ class HELIX(modelBase):
|
|
|
171
159
|
q1,q2,q3,q0 = r_init.as_quat()
|
|
172
160
|
|
|
173
161
|
else:
|
|
174
|
-
x,y,z = monomersPositions[-1]+sigma*
|
|
162
|
+
x,y,z = monomersPositions[-1]+sigma*getEx(monomersOrientations[-1])
|
|
175
163
|
|
|
176
164
|
q0,q1,q2,q3 = monomersOrientations[-1]
|
|
177
165
|
r_prev = R.from_quat([q1,q2,q3,q0])
|
|
@@ -199,8 +187,8 @@ class HELIX(modelBase):
|
|
|
199
187
|
return np.asarray(monomersPositions),np.asarray(monomersOrientations)
|
|
200
188
|
|
|
201
189
|
def __getMonomerConnections(self,position,orientation):
|
|
202
|
-
connectionStart = position-self.monomerRadius*
|
|
203
|
-
connectionEnd = position+self.monomerRadius*
|
|
190
|
+
connectionStart = position-self.monomerRadius*getEx(orientation)
|
|
191
|
+
connectionEnd = position+self.monomerRadius*getEx(orientation)
|
|
204
192
|
|
|
205
193
|
return connectionStart,connectionEnd
|
|
206
194
|
|
|
@@ -302,6 +290,10 @@ class HELIX(modelBase):
|
|
|
302
290
|
self.logger.info(f"[HELIX] K theta computed {self.Ka} for variance {varTheta}")
|
|
303
291
|
self.logger.info(f"[HELIX] K phi computed {self.Kd} for variance {varPhi}")
|
|
304
292
|
|
|
293
|
+
if self.Kb < 0 or self.Ka < 0 or self.Kd < 0:
|
|
294
|
+
self.logger.error(f"[HELIX] Negative spring constant: Kb {self.Kb} Ka {self.Ka} Kd {self.Kd}")
|
|
295
|
+
raise Exception("Negative spring constant")
|
|
296
|
+
|
|
305
297
|
##############################################
|
|
306
298
|
|
|
307
299
|
self.logger.info(f"[HELIX] Generating HELIX model with {self.nMonomers} monomers")
|
|
@@ -13,6 +13,20 @@ def picosecond2KcalMol_A_time():
|
|
|
13
13
|
|
|
14
14
|
#Geometry utils
|
|
15
15
|
|
|
16
|
+
def getEx(q):
|
|
17
|
+
""" Given a quaternion, q, the function returns the z vector of the local basis"""
|
|
18
|
+
|
|
19
|
+
q0,q1,q2,q3 = q
|
|
20
|
+
|
|
21
|
+
return 2.0*np.asarray([q0*q0+q1*q1-0.5,q1*q2+q0*q3,q1*q3-q0*q2])
|
|
22
|
+
|
|
23
|
+
def getEy(q):
|
|
24
|
+
""" Given a quaternion, q, the function returns the z vector of the local basis"""
|
|
25
|
+
|
|
26
|
+
q0,q1,q2,q3 = q
|
|
27
|
+
|
|
28
|
+
return 2.0*np.asarray([q1*q2-q0*q3,q0*q0+q2*q2-0.5,q2*q3+q0*q1])
|
|
29
|
+
|
|
16
30
|
def getEz(q):
|
|
17
31
|
""" Given a quaternion, q, the function returns the z vector of the local basis"""
|
|
18
32
|
|
|
@@ -20,6 +34,7 @@ def getEz(q):
|
|
|
20
34
|
|
|
21
35
|
return 2.0*np.asarray([q1*q3+q0*q2,q2*q3-q0*q1,q0*q0+q3*q3-0.5])
|
|
22
36
|
|
|
37
|
+
|
|
23
38
|
def quaternionFromVectors(vec1, vec2):
|
|
24
39
|
""" Given two vector the function returns the rotation that transform one into another.
|
|
25
40
|
The rotation is codified as a quaternion"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForceBetweenCentersOfMass.py
RENAMED
|
File without changes
|
{pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForceOverCenterOfMass.py
RENAMED
|
File without changes
|
{pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantTorqueBetweenCentersOfMass.py
RENAMED
|
File without changes
|
{pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantTorqueOverCenterOfMass.py
RENAMED
|
File without changes
|
{pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constraintCenterOfMassPosition.py
RENAMED
|
File without changes
|
{pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/harmonicBondBetweenCentersOfMass.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|