Closed yxxue closed 8 years ago
This is most likely caused by an unsupported version of matplotlib, metAMOS has only been tested with matplotlib up to version 1.3 (http://metamos.readthedocs.org/en/v1.5rc3/content/installation.html). If you either remove matplotlib from your path or update the path to point to a compatible version of matplotlib, the issue should be fixed.
I think it may not the problem of matplotlib.The error info is like this: File "/Home/ii/yaxinx/bin/metAMOS-1.5rc3/Utilities/python/create_plots.py", line 240, in create_plots ff2s += "\"%.2f\t%f\n\" + \n"%(bins[i],n[i]) IndexError: index out of bounds
So I configured the source code and found that this error is caused by len(bins)>len(n) in create_plots.py:
if c > 0: n, bins, patches = plt.hist(h, 20) ff2 = open("mapreads.js","w") ff2s = "var contiglens = \"cov\tfrequency\n\" + \n" i = 0 while i < len(n): try: ff2s += "\"%.2f\t%f\n\" + \n"%(bins[i],n[i]) except TypeError:
ff2s += "\"%.2f\t%f\n\" + \n"%(0.0,0.0)
#continue
i+=1
So I made some changes like this, this time no error occurs:
if c > 0:
n, bins, patches = plt.hist(h, 20)
ff2 = open("mapreads.js","w")
ff2s = "var contiglens = \"cov\tfrequency\n\" + \n"
i = 0
cycle_num=0
if len(bins)>=len(n):
cycle_num=len(n)
else:
cycle_num=len(bins)
while i < cycle_num:
try:
ff2s += "\"%.2f\t%f\n\" + \n"%(bins[i],n[i])
except TypeError:
ff2s += "\"%.2f\t%f\n\" + \n"%(0.0,0.0)
#continue
i+=1
I think different matplot lib versions have different behavior for teh hist function which is why the error doesn't occur on our system. Are you able to submit your code change as a pull request? We can the incorporate it into the codebase.
Closed, only one version of matplot is supported/tested. However, your suggested code changes will be incorporated.
Hi, I installed metAMOS-1.5rc3 in our cluster. Although some warnings exist, I can run the run_pipeline_test.sh successfully: /usr/lib64/python2.6/site-packages/matplotlib/axes.py:7066: UserWarning: 2D hist should be nsamples x nvariables; this looks transposed warnings.warn('2D hist should be nsamples x nvariables; ' Job = [proba.asm.contig -> proba.scf.fa] completed Completed Task = postprocess.Postprocess done! pipeline took 0.78 minutes Please see results in /Home/ii/yaxinx/bin/metAMOS-1.5rc3/Test/test1/Postprocess/out metAMOS summary report is file:///Home/ii/yaxinx/bin/metAMOS-1.5rc3/Test/test1/Postprocess/out/html/summary.htm
However, I tried to run my own data, it failed at the final postprocess step: /usr/lib64/python2.6/site-packages/matplotlib/axes.py:7066: UserWarning: 2D hist should be nsamples x nvariables; this looks transposed warnings.warn('2D hist should be nsamples x nvariables; ' Oops, MetAMOS finished with errors! see text in red above for details. Traceback (most recent call last): File "/Home/ii/yaxinx/bin/metAMOS-1.5rc3/runPipeline", line 985, in
verbose = 1)
File "/Home/ii/yaxinx/bin/metAMOS-1.5rc3/Utilities/ruffus/task.py", line 2965, in pipeline_run
raise job_errors
RethrownJobError:
Can anyone tell me how to fix this problem? Thanks a lot.