pren / poltype

POLTYPE: AMOEBA parametrization tool
https://pren.github.io/poltype
Other
4 stars 11 forks source link

RuntimeWarning #57

Closed ahmedo047 closed 3 years ago

ahmedo047 commented 3 years ago

Hi,

I get the following "RuntimeWarning" while running the POLTYPE to get the benzene parameters. Do you know how I can fix this warning/error?

python3 /home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py poltype.ini

Calling: analyze.x /home/user/anaconda3/envs/poltype/poltype-poltype2/water.xyz -k /home/user/anaconda3/envs/poltype/poltype-poltype2/water.key e> version.out /home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/electrostaticpotential.py:423: RuntimeWarning: invalid value encountered in double_scalars ratio=np.abs(diff/qmdipole)

benzene.sdf:

t.pdb
 OpenBabel09282009253D

 12 12  0  0  0  0  0  0  0  0999 V2000
   16.7700   17.2300   15.9700 C   0  0  0  0  0  0  0  0  0  0  0  0
   17.8500   16.3200   16.2000 C   0  0  0  0  0  0  0  0  0  0  0  0
   18.4900   16.2100   17.4200 C   0  0  0  0  0  0  0  0  0  0  0  0
   17.9700   16.9700   18.4200 C   0  0  0  0  0  0  0  0  0  0  0  0
   16.8600   17.7800   18.3300 C   0  0  0  0  0  0  0  0  0  0  0  0
   16.2300   17.9200   17.0800 C   0  0  0  0  0  0  0  0  0  0  0  0
   16.3400   17.3000   14.9800 H   0  0  0  0  0  0  0  0  0  0  0  0
   18.2200   15.8500   15.2900 H   0  0  0  0  0  0  0  0  0  0  0  0
   19.3700   15.5900   17.3600 H   0  0  0  0  0  0  0  0  0  0  0  0
   18.5000   16.8900   19.3700 H   0  0  0  0  0  0  0  0  0  0  0  0
   16.4700   18.2800   19.2100 H   0  0  0  0  0  0  0  0  0  0  0  0
   15.3300   18.5100   16.9800 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0  0  0  0
  1  6  1  0  0  0  0
  2  3  1  0  0  0  0
  3  4  2  0  0  0  0
  4 10  1  0  0  0  0
  5  4  1  0  0  0  0
  5 11  1  0  0  0  0
  6  5  2  0  0  0  0
  7  1  1  0  0  0  0
  8  2  1  0  0  0  0
  9  3  1  0  0  0  0
 12  6  1  0  0  0  0
M  END
>  <TITLE>
    Gromacs Runs One Microsecond At Cannonball Speeds

>  <MODEL>
       1

$$$$

poltype.ini:

structure=benzene.sdf
numproc=6
maxmem=6GB
maxdisk=20GB
misterbrandonwalker commented 3 years ago

hi please attach a folder with all files I will take a look.

On Tue, Oct 27, 2020 at 4:13 PM ahmedo047 notifications@github.com wrote:

Hi,

I get the following "RuntimeWarning" while running the POLTYPE to get the benzene parameters. Do you know how I can fix this warning/error?

python3 /home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py poltype.ini

Calling: analyze.x /home/user/anaconda3/envs/poltype/poltype-poltype2/ water.xyz -k /home/user/anaconda3/envs/poltype/poltype-poltype2/water.key e> version.out /home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/electrostaticpotential.py:423: RuntimeWarning: invalid value encountered in double_scalars ratio=np.abs(diff/qmdipole)

benzene.sdf:

t.pdb OpenBabel09282009253D

12 12 0 0 0 0 0 0 0 0999 V2000 16.7700 17.2300 15.9700 C 0 0 0 0 0 0 0 0 0 0 0 0 17.8500 16.3200 16.2000 C 0 0 0 0 0 0 0 0 0 0 0 0 18.4900 16.2100 17.4200 C 0 0 0 0 0 0 0 0 0 0 0 0 17.9700 16.9700 18.4200 C 0 0 0 0 0 0 0 0 0 0 0 0 16.8600 17.7800 18.3300 C 0 0 0 0 0 0 0 0 0 0 0 0 16.2300 17.9200 17.0800 C 0 0 0 0 0 0 0 0 0 0 0 0 16.3400 17.3000 14.9800 H 0 0 0 0 0 0 0 0 0 0 0 0 18.2200 15.8500 15.2900 H 0 0 0 0 0 0 0 0 0 0 0 0 19.3700 15.5900 17.3600 H 0 0 0 0 0 0 0 0 0 0 0 0 18.5000 16.8900 19.3700 H 0 0 0 0 0 0 0 0 0 0 0 0 16.4700 18.2800 19.2100 H 0 0 0 0 0 0 0 0 0 0 0 0 15.3300 18.5100 16.9800 H 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 0 0 0 0 1 6 1 0 0 0 0 2 3 1 0 0 0 0 3 4 2 0 0 0 0 4 10 1 0 0 0 0 5 4 1 0 0 0 0 5 11 1 0 0 0 0 6 5 2 0 0 0 0 7 1 1 0 0 0 0 8 2 1 0 0 0 0 9 3 1 0 0 0 0 12 6 1 0 0 0 0 M END

Gromacs Runs One Microsecond At Cannonball Speeds <MODEL> 1 </blockquote> <p>$$$$</p> <p><em>poltype.ini:</em></p> <p>structure=benzene.sdf numproc=6 maxmem=6GB maxdisk=20GB</p> <p>— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <a href="https://github.com/pren/poltype/issues/57">https://github.com/pren/poltype/issues/57</a>, or unsubscribe <a href="https://github.com/notifications/unsubscribe-auth/AKNB26KONXQ4Y5IVWWP425LSM4ZYFANCNFSM4TBM6APA">https://github.com/notifications/unsubscribe-auth/AKNB26KONXQ4Y5IVWWP425LSM4ZYFANCNFSM4TBM6APA</a> .</p> </blockquote> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ahmedo047"><img src="https://avatars.githubusercontent.com/u/12836114?v=4" />ahmedo047</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>Here it is: <a href="https://github.com/pren/poltype/files/5448260/benzene.zip">benzene.zip</a></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/misterbrandonwalker"><img src="https://avatars.githubusercontent.com/u/43654521?v=4" />misterbrandonwalker</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>Awesome thanks, the issue is that the qm dipole is 0, and we typically use relative error in QM, MM dipole as a measure of how bad parameters are. So this means the program was dividing by 0! The bug has been fixed. </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ahmedo047"><img src="https://avatars.githubusercontent.com/u/12836114?v=4" />ahmedo047</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>Hi,</p> <p>Now it gives another error. I think there is still a bug?</p> <pre><code>python3 /home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py poltype.ini Poltype -- Polarizable atom typer of small molecules for the AMOEBA polarizable force field Please cite: Wu, J.C.; Chattree, G.; Ren, P.Y.; Automation of AMOEBA polarizable force field parameterization for small molecules. Theor Chem Acc. Version 2.3.0 February 2020 Copyright (c) Johnny Wu, Gaurav Chattree, Brandon Walker, Matthew Harger and Pengyu Ren 2019 All Rights Reserved ############################################################################################################## Calling: analyze.x /home/user/anaconda3/envs/poltype/poltype-poltype2/water.xyz -k /home/user/anaconda3/envs/poltype/poltype-poltype2/water.key e> version.out no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log Traceback (most recent call last): File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py", line 1219, in <module> params=poltype.main() File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py", line 930, in main params= self.GenerateParameters() File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py", line 1191, in GenerateParameters esp.CheckDipoleMoments(self,optmol) File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/electrostaticpotential.py", line 501, in CheckDipoleMoments raise ValueError('Relative error of '+str(ratio)+' for QMDipole '+str(qmdipole)+' and '+str(mmdipole)+' for MMDipole '+'is bigger than '+str(poltype.dipoletol)+' '+os.getcwd()) ValueError: Relative error of 0.25 for QMDipole 0.004 and 0.003 for MMDipole is bigger than 0.1 /home/user/Desktop/test/poltype/benzene</code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/misterbrandonwalker"><img src="https://avatars.githubusercontent.com/u/43654521?v=4" />misterbrandonwalker</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>Okay thanks for the report.</p> <p>The MM and QM dipoles are very close (good thing). I am unable to reproduce your particular case with benzene, however I have added an absolute tolerance for comparing QM to MM dipoles as well as the relative error tolerance.</p> <ul> <li>Brandon</li> </ul> <p>On Wed, Oct 28, 2020 at 2:19 PM ahmedo047 <a href="mailto:notifications@github.com">notifications@github.com</a> wrote:</p> <blockquote> <p>Hi,</p> <p>Now it gives another error. I think there is still a bug?</p> <p>python3 /home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py poltype.ini Poltype -- Polarizable atom typer of small molecules for the AMOEBA polarizable force field</p> <p>Please cite: Wu, J.C.; Chattree, G.; Ren, P.Y.; Automation of AMOEBA polarizable force field parameterization for small molecules. Theor Chem Acc.</p> <p>Version 2.3.0 February 2020</p> <p>Copyright (c) Johnny Wu, Gaurav Chattree, Brandon Walker, Matthew Harger and Pengyu Ren 2019</p> <p>All Rights Reserved ##############################################################################################################</p> <p>Calling: analyze.x /home/user/anaconda3/envs/poltype/poltype-poltype2/water.xyz -k /home/user/anaconda3/envs/poltype/poltype-poltype2/water.key e> version.out no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error /home/user/Desktop/test/poltype/benzene/benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log no longer error benzene-opt.log Traceback (most recent call last): File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py", line 1219, in <module> params=poltype.main() File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py", line 930, in main params= self.GenerateParameters() File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/poltype.py", line 1191, in GenerateParameters esp.CheckDipoleMoments(self,optmol) File "/home/user/anaconda3/envs/poltype/poltype-poltype2/PoltypeModules/electrostaticpotential.py", line 501, in CheckDipoleMoments raise ValueError('Relative error of '+str(ratio)+' for QMDipole '+str(qmdipole)+' and '+str(mmdipole)+' for MMDipole '+'is bigger than '+str(poltype.dipoletol)+' '+os.getcwd()) ValueError: Relative error of 0.25 for QMDipole 0.004 and 0.003 for MMDipole is bigger than 0.1 /home/user/Desktop/test/poltype/benzene</p> <p>— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <a href="https://github.com/pren/poltype/issues/57#issuecomment-718153593">https://github.com/pren/poltype/issues/57#issuecomment-718153593</a>, or unsubscribe <a href="https://github.com/notifications/unsubscribe-auth/AKNB26IHROHWOBI3KAG2443SNBVBXANCNFSM4TBM6APA">https://github.com/notifications/unsubscribe-auth/AKNB26IHROHWOBI3KAG2443SNBVBXANCNFSM4TBM6APA</a> .</p> </blockquote> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ahmedo047"><img src="https://avatars.githubusercontent.com/u/12836114?v=4" />ahmedo047</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>Thanks. Now POLTYPE doesn't give any error but there are still a few problems: -It doesn't generate the <code>valence.prms</code> file. -It doesn't print the torsion parameters at the end of <code>polytype.log</code> file. -<code>Fragments</code> folder is empty. I think the fragmentation protocol doesn't work. -POLTYPE doesn't terminate.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/misterbrandonwalker"><img src="https://avatars.githubusercontent.com/u/43654521?v=4" />misterbrandonwalker</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>There is nothing to fragment in Benzene. All torsion is transferred. Valence.prms not needed, that was for if someone want to add new torsion to existing database. This has been added to comments of key file.</p> <hr /> <p>From: ahmedo047 <a href="mailto:notifications@github.com">notifications@github.com</a> Sent: Wednesday, October 28, 2020 5:35:09 PM To: pren/poltype <a href="mailto:poltype@noreply.github.com">poltype@noreply.github.com</a> Cc: Brandon Walker <a href="mailto:bdw2292@utexas.edu">bdw2292@utexas.edu</a>; State change <a href="mailto:state_change@noreply.github.com">state_change@noreply.github.com</a> Subject: Re: [pren/poltype] RuntimeWarning (#57)</p> <p>Thanks. Now POLTYPE doesn't give any error but there are still a few problems: -It doesn't generate the valence.prms file. -It doesn't print the torsion parameters at the end of polytype.log file.</p> <ul> <li>Fragments folder is empty. I think the fragmentation protocol doesn't work. -POLTYPE doesn't terminate.</li> </ul> <p>— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub<a href="https://github.com/pren/poltype/issues/57#issuecomment-718247311">https://github.com/pren/poltype/issues/57#issuecomment-718247311</a>, or unsubscribe<a href="https://github.com/notifications/unsubscribe-auth/AKNB26MJLF6AU7BQ3USLDNLSNCMB3ANCNFSM4TBM6APA">https://github.com/notifications/unsubscribe-auth/AKNB26MJLF6AU7BQ3USLDNLSNCMB3ANCNFSM4TBM6APA</a>.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>