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.
Files changed (64) hide show
  1. {pyVLMP-1.0.2/pyVLMP.egg-info → pyVLMP-1.0.4}/PKG-INFO +1 -1
  2. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/__init__.py +8 -2
  3. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/HELIX.py +16 -24
  4. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/utils/utils.py +15 -0
  5. {pyVLMP-1.0.2 → pyVLMP-1.0.4/pyVLMP.egg-info}/PKG-INFO +1 -1
  6. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyproject.toml +1 -1
  7. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/LICENSE +0 -0
  8. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/MANIFEST.in +0 -0
  9. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/README.md +0 -0
  10. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/VLMP.py +0 -0
  11. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/__main__.py +0 -0
  12. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/__init__.py +0 -0
  13. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/globals/NVT.py +0 -0
  14. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/globals/__init__.py +0 -0
  15. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/BBK.py +0 -0
  16. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/EulerMaruyama.py +0 -0
  17. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/EulerMaruyamaRigidBody.py +0 -0
  18. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/GJF.py +0 -0
  19. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/integrators/__init__.py +0 -0
  20. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/__init__.py +0 -0
  21. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForce.py +0 -0
  22. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForceBetweenCentersOfMass.py +0 -0
  23. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantForceOverCenterOfMass.py +0 -0
  24. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantTorqueBetweenCentersOfMass.py +0 -0
  25. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constantTorqueOverCenterOfMass.py +0 -0
  26. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/constraintCenterOfMassPosition.py +0 -0
  27. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelExtensions/harmonicBondBetweenCentersOfMass.py +0 -0
  28. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelOperations/__init__.py +0 -0
  29. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/modelOperations/setCenterOfMassPosition.py +0 -0
  30. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/CORONAVIRUS.py +0 -0
  31. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/KB.py +0 -0
  32. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/MADna.py +0 -0
  33. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/SBCG.py +0 -0
  34. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/SOP.py +0 -0
  35. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/WLC.py +0 -0
  36. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/__init__.py +0 -0
  37. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/data/CORONAVIRUS.json +0 -0
  38. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/models/data/MADna.json +0 -0
  39. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/__init__.py +0 -0
  40. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/centerOfMassMeasurement.py +0 -0
  41. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/heightMeasurement.py +0 -0
  42. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/info.py +0 -0
  43. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/patchPolymersMeasurement.py +0 -0
  44. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/savePatchyParticlesState.py +0 -0
  45. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/simulationSteps/saveState.py +0 -0
  46. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/system/__init__.py +0 -0
  47. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/system/backup.py +0 -0
  48. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/system/simulationName.py +0 -0
  49. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/types/__init__.py +0 -0
  50. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/types/basic.py +0 -0
  51. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/types/none.py +0 -0
  52. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/units/KcalMol_A.py +0 -0
  53. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/units/__init__.py +0 -0
  54. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/components/units/none.py +0 -0
  55. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/experiments/SurfaceUmbrellaSampling.py +0 -0
  56. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/experiments/__init__.py +0 -0
  57. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/utils/__init__.py +0 -0
  58. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/VLMP/utils/bounds.py +0 -0
  59. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/SOURCES.txt +0 -0
  60. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/dependency_links.txt +0 -0
  61. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/requires.txt +0 -0
  62. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/pyVLMP.egg-info/top_level.txt +0 -0
  63. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/setup.cfg +0 -0
  64. {pyVLMP-1.0.2 → pyVLMP-1.0.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyVLMP
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Virtual Laboratory for the simulation of Macromolecular Properties
5
5
  Home-page: https://github.com/PabloIbannez/pyGrained
6
6
  Author-email: Pablo Ibáñez-Freire <p.ibanez.fre@gmail.com>
@@ -49,6 +49,12 @@ logger.addHandler(clogger)
49
49
 
50
50
  #################################################
51
51
 
52
- from .VLMP import VLMP
53
- from .utils import *
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*self.__getEx(monomersOrientations[-1])
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*self.__getEx(orientation)
203
- connectionEnd = position+self.monomerRadius*self.__getEx(orientation)
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"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyVLMP
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Virtual Laboratory for the simulation of Macromolecular Properties
5
5
  Home-page: https://github.com/PabloIbannez/pyGrained
6
6
  Author-email: Pablo Ibáñez-Freire <p.ibanez.fre@gmail.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name="pyVLMP"
3
- version="1.0.2"
3
+ version="1.0.4"
4
4
  authors = [
5
5
  {name = "Pablo Ibáñez-Freire", email = "p.ibanez.fre@gmail.com"},
6
6
  ]
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