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

Analysis stage of "mdpow-pow benzene" failing #129

Closed
Ntr9999 opened this issue Jan 26, 2021 · 6 comments · Fixed by #144
Closed

Analysis stage of "mdpow-pow benzene" failing #129

Ntr9999 opened this issue Jan 26, 2021 · 6 comments · Fixed by #144
Labels

Comments

@Ntr9999
Copy link

Ntr9999 commented Jan 26, 2021

Final stage of the benzene tutorial outputs errors (after output of values and files). Originally mentioned here: #126

To fully reproduce:
conda create -c conda-forge -n mdpow python=2.7 numpy scipy 'matplotlib<3.3' 'mdanalysis<2' 'mdanalysistests<2' pyyaml
conda activate mdpow
pip install gromacswrapper
git clone https://github.com/Becksteinlab/MDPOW.git
pip install ./MDPOW

I copied the benzene.itp,pdb&yml files into a desktop/benzene/benzene and then:

cd desktop/benzene
conda activate mdpow
source /usr/local/opt/gromacs/bin/GMXRC
mdpow-equilibrium --solvent water benzene/benzene.yml
mdpow-equilibrium --solvent octanol benzene/benzene.yml
mdpow-fep --solvent water benzene/benzene.yml
mdpow-fep --solvent octanol benzene/benzene.yml
mdpow-pow benzene

Note: I set maxthreads =1 for mdpow-fep --solvent octanol benzene/benzene.yml, I don't believe this is relevant though.

All steps are fine until the final step mdpow-pow benzene, where files are outputted correctly I believe (apart from only 1 graph on DeltaA.png maybe?) but there is some errors shown relating to matplotlib.

The output (from when it starts failing):

mdpow.fep   : INFO     [BNZ] Octanol solvation free energy (Gibbs) -20.0205 (2.40) kJ/mol
mdpow.fep   : INFO     [BNZ] Octanol solvation free energy (coulomb) 1.52674 (0.27) kJ/mol
mdpow.fep   : INFO     [BNZ] Octanol solvation free energy (vdw) 18.4938 (2.38) kJ/mol
mdpow.fep   : INFO     [BNZ] Values at T = 300 K
mdpow.fep   : INFO     [BNZ] Free energy of transfer water --> octanol: -12.260 (3.707) kJ/mol
mdpow.fep   : INFO     [BNZ] log P_ow: 2.135 (0.645)
mdpow       : INFO     Wrote results to '/Users/mark/Desktop/benzene/pow.txt'
mdpow       : INFO     Wrote solvation energy terms to '/Users/mark/Desktop/benzene/energies.txt'
/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow:131: UserWarning: 
This call to matplotlib.use() has no effect because the backend has already
been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

The backend was *originally* set to 'MacOSX' by the following code:
  File "/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow", line 39, in <module>
    import mdpow.fep
  File "/Users/mark/opt/anaconda3/envs/mdpow/lib/python2.7/site-packages/mdpow/fep.py", line 137, in <module>
    import gromacs, gromacs.utilities
  File "/Users/mark/opt/anaconda3/envs/mdpow/lib/python2.7/site-packages/gromacs/__init__.py", line 183, in <module>
    from . import fileformats
  File "/Users/mark/opt/anaconda3/envs/mdpow/lib/python2.7/site-packages/gromacs/fileformats/__init__.py", line 10, in <module>
    from .xvg import XVG
  File "/Users/mark/opt/anaconda3/envs/mdpow/lib/python2.7/site-packages/gromacs/fileformats/xvg.py", line 203, in <module>
    from matplotlib import pyplot as plt
  File "/Users/mark/opt/anaconda3/envs/mdpow/lib/python2.7/site-packages/matplotlib/pyplot.py", line 71, in <module>
    from matplotlib.backends import pylab_setup
  File "/Users/mark/opt/anaconda3/envs/mdpow/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 17, in <module>
    line for line in traceback.format_stack()


  matplotlib.use('agg')  # quick non-interactive plotting
mdpow       : CRITICAL Running analysis in directory 'benzene' failed
mdpow       : ERROR    Catastrophic problem occurred, see the stack trace for hints.
Traceback (most recent call last):
  File "/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow", line 233, in <module>
    force=opts.force, stride=opts.stride, permissive=opts.permissive)
  File "/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow", line 136, in run_pow
    activate_subplot(1)
  File "/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow", line 163, in activate_subplot
    return axes(gcf().get_axes()[numPlot])
IndexError: list index out of range
Traceback (most recent call last):
  File "/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow", line 233, in <module>
    force=opts.force, stride=opts.stride, permissive=opts.permissive)
  File "/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow", line 136, in run_pow
    activate_subplot(1)
  File "/Users/mark/opt/anaconda3/envs/mdpow/bin/mdpow-pow", line 163, in activate_subplot
    return axes(gcf().get_axes()[numPlot])
IndexError: list index out of range

mdpow.log

Many thanks.

@orbeckst
Copy link
Member

The matplotlib backend thing should not be a problem.

I am not sure what failed in the plots. It looks as if one plot is missing (maybe no data??). Sorry, I know, not very helpful.

@orbeckst
Copy link
Member

@VOD555 are you able to reproduce the error above?

@VOD555
Copy link
Contributor

VOD555 commented Apr 29, 2021

@orbeckst I met another error about the plot function. I'm running the tutorial to see whether we can reproduce thiserror.

@VOD555
Copy link
Contributor

VOD555 commented Apr 29, 2021

I'm doubting whether it's caused by pylab, I'm trying to rewrite the plot functions without pylab.

@VOD555
Copy link
Contributor

VOD555 commented May 1, 2021

This first error was caused by the use of matplotlib in gromacswrapper.
We should import matplotlib before importing gromacswrapper and fixed this.

@VOD555
Copy link
Contributor

VOD555 commented May 1, 2021

The second error is due to plt.close() at line 1189 in fep.py. As the plot window is closed, we can't activate it again with gcf().get_axes() which generates a empty list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants