SignatureAnalyzer icon indicating copy to clipboard operation
SignatureAnalyzer copied to clipboard

ValueError: zero-size array to reduction operation minimum which has no identity

Open itsvenu opened this issue 3 years ago • 3 comments

Hi,

Thanks a lot for the amazing tool. I was running the version 0.0.8 on the example spectra from the repo. However, I get the following error. I presume the error is coming from one of the matplotlib function (?). It would be great if you can suggest a fix

command

signatureanalyzer example_luad_spectra_1.tsv --type spectra --nruns 2 --max_iter 100 --outdir ./test_luad/

Error:

---------------------------------------------------------
---------- S I G N A T U R E  A N A L Y Z E R  ----------
---------------------------------------------------------
   * Creating output dir at ./test_luad/
   * Using cosmic3 signatures
   * Saving ARD-NMF outputs to ./test_luad/nmf_output.h5
   * Running ARD-NMF...
Traceback (most recent call last):
  File "/b06x/cluster/42.2/x86_64/easybuild/software/SignatureAnalyzer/0.0.8-foss-2020a-Python-3.8.2/bin/signatureanalyzer", line 8, in <module>
    sys.exit(main())
  File "/b06x/cluster/42.2/x86_64/easybuild/software/SignatureAnalyzer/0.0.8-foss-2020a-Python-3.8.2/lib/python3.8/site-packages/signatureanalyzer/__main__.py", line 200, in main
    run_spectra(
  File "/b06x/cluster/42.2/x86_64/easybuild/software/SignatureAnalyzer/0.0.8-foss-2020a-Python-3.8.2/lib/python3.8/site-packages/signatureanalyzer/signatureanalyzer.py", line 231, in run_spectra
    res = ardnmf(
  File "/b06x/cluster/42.2/x86_64/easybuild/software/SignatureAnalyzer/0.0.8-foss-2020a-Python-3.8.2/lib/python3.8/site-packages/signatureanalyzer/bnmf.py", line 86, in ardnmf
    data = ARD_NMF(X, objective, verbose=verbose)
  File "/b06x/cluster/42.2/x86_64/easybuild/software/SignatureAnalyzer/0.0.8-foss-2020a-Python-3.8.2/lib/python3.8/site-packages/signatureanalyzer/signatureanalyzer_gpu/ARD_NMF.py", line 26, in __init__
    self.V = self.V0 - np.min(self.V0) + 1.e-30
  File "<__array_function__ internals>", line 5, in amin
  File "/b06x/cluster/42.2/x86_64/easybuild/software/SciPy-bundle/2020.03-foss-2020a-Python-3.8.2/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 2792, in amin
    return _wrapreduction(a, np.minimum, 'min', axis, None, out,
  File "/b06x/cluster/42.2/x86_64/easybuild/software/SciPy-bundle/2020.03-foss-2020a-Python-3.8.2/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity
Closing remaining open files:./test_luad/nmf_output.h5...done

Thank you & stay safe!

itsvenu avatar Apr 30 '22 09:04 itsvenu

Thanks for bringing this to our attention. This isn't an error that I've ever seen with signatureanalyzer. How was the spectra generated? Are all values non-negative?

yoakiyama avatar May 02 '22 17:05 yoakiyama

Hi @yoakiyama thanks for the response. The spectra is actually from this repo example_luad_spectra_1.tsv

I was unable to figure out where exactly this error is coming from. Would really appreciate any help fixing it.

Thank you!

itsvenu avatar May 02 '22 18:05 itsvenu

@itsvenu I ran your exact shell script on my end with the latest version of signatureanalyzer and did not run into any issues. How did you install SignatureAnalyzer to your machine? Sorry for the slow response

Best regards, Yo

yoakiyama avatar May 22 '22 21:05 yoakiyama