RedesignScience / cvpack

Useful Collective Variables for OpenMM
https://redesignscience.github.io/cvpack/latest
MIT License
11 stars 1 forks source link

A Bug in HelixRMSDContent #73

Closed JinyinZha closed 5 months ago

JinyinZha commented 6 months ago

Hi, I found a bug in HelixRMSDContent. If I turn on the normalization (normalize=True), it would throw the following error:

Traceback (most recent call last): File "/home/jyzha/project/enhanced_sampling/test/test_alpha_cv_on_kras4b/run.py", line 32, in simulation = Simulation(prmtop.topology, system, integrator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jyzha/software/anaconda3/envs/openmm/lib/python3.12/site-packages/openmm/app/simulation.py", line 102, in init self.context = mm.Context(self.system, self.integrator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jyzha/software/anaconda3/envs/openmm/lib/python3.12/site-packages/openmm/openmm.py", line 12171, in init _openmm.Context_swiginit(self, _openmm.new_Context(*args)) ^^^^^^^^^^^^^^^^^^^^^^^^^^ openmm.OpenMMException: Parse error in expression "((1+x0^4)/(1+x0^4+x0^8)+(1+x1^4)/(1+x1^4+x1^8)+(1+x2^4)/(1+x2^4+x2^8)+(1+x3^4)/(1+x3^4+x3^8)+(1+x4^4)/(1+x4^4+x4^8)+(1+x5^4)/(1+x5^4+x5^8)+(1+x6^4)/(1+x6^4+x6^8)+(1+x7^4)/(1+x7^4+x7^8)+(1+x8^4)/(1+x8^4+x8^8)+(1+x9^4)/(1+x9^4+x9^8)+(1+x10^4)/(1+x10^4+x10^8)+(1+x11^4)/(1+x11^4+x11^8)+(1+x12^4)/(1+x12^4+x12^8)+(1+x13^4)/(1+x13^4+x13^8)+(1+x14^4)/(1+x14^4+x14^8);x0=rmsd0/0.08;x1=rmsd1/0.08;x2=rmsd2/0.08;x3=rmsd3/0.08;x4=rmsd4/0.08;x5=rmsd5/0.08;x6=rmsd6/0.08;x7=rmsd7/0.08;x8=rmsd8/0.08;x9=rmsd9/0.08;x10=rmsd10/0.08;x11=rmsd11/0.08;x12=rmsd12/0.08;x13=rmsd13/0.08;x14=rmsd14/0.08)/15": unexpected text at end of subexpression: )

However, the error would not be thrown when normalize=False

craabreu commented 5 months ago

Thanks for catching this. The bug has been fixed (see #75), and a new version is expected to be released shortly.