deeptools / deepTools

Tools to process and analyze deep sequencing data.
Other
685 stars 213 forks source link

Fix error handling + cases where with bigwigAverage with more than 2 bigwigs #1257

Closed lldelisle closed 1 year ago

lldelisle commented 1 year ago

I got an error when using bigwigAverage:

Traceback (most recent call last):
  File "/data/galaxy/galaxy/var/dependencies/_conda/envs/mulled-v1-9dd4e5433cf4f47ee04cca722ff3869495cfcd627aecb78c70b6dcb65b45e293/bin/bigwigAverage", line 12, in <module>
    main(args)
  File "/data/galaxy/galaxy/var/dependencies/_conda/envs/mulled-v1-9dd4e5433cf4f47ee04cca722ff3869495cfcd627aecb78c70b6dcb65b45e293/lib/python3.8/site-packages/deeptools/bigwigAverage.py", line 140, in main
    writeBedGraph_bam_and_bw.writeBedGraph(
  File "/data/galaxy/galaxy/var/dependencies/_conda/envs/mulled-v1-9dd4e5433cf4f47ee04cca722ff3869495cfcd627aecb78c70b6dcb65b45e293/lib/python3.8/site-packages/deeptools/writeBedGraph_bam_and_bw.py", line 209, in writeBedGraph
    res = mapReduce.mapReduce((tileSize, fragmentLength, bamOrBwFileList,
  File "/data/galaxy/galaxy/var/dependencies/_conda/envs/mulled-v1-9dd4e5433cf4f47ee04cca722ff3869495cfcd627aecb78c70b6dcb65b45e293/lib/python3.8/site-packages/deeptools/mapReduce.py", line 146, in mapReduce
    res = list(map(func, TASKS))
  File "/data/galaxy/galaxy/var/dependencies/_conda/envs/mulled-v1-9dd4e5433cf4f47ee04cca722ff3869495cfcd627aecb78c70b6dcb65b45e293/lib/python3.8/site-packages/deeptools/writeBedGraph_bam_and_bw.py", line 42, in writeBedGraph_wrapper
    return writeBedGraph_worker(*args)
  File "/data/galaxy/galaxy/var/dependencies/_conda/envs/mulled-v1-9dd4e5433cf4f47ee04cca722ff3869495cfcd627aecb78c70b6dcb65b45e293/lib/python3.8/site-packages/deeptools/writeBedGraph_bam_and_bw.py", line 74, in writeBedGraph_worker
    getCoverageFromBigwig(
  File "/data/galaxy/galaxy/var/dependencies/_conda/envs/mulled-v1-9dd4e5433cf4f47ee04cca722ff3869495cfcd627aecb78c70b6dcb65b45e293/lib/python3.8/site-packages/deeptools/writeBedGraph_bam_and_bw.py", line 25, in getCoverageFromBigwig
    coverage = np.asarray(bigwigHandle.values(chrom, start, end))
RuntimeError: Invalid interval bounds!

I think it is because in the code there is a except ValueError instead of RuntimeError. The switch in pyBigwig occured in https://github.com/deeptools/pyBigWig/commit/17f8dab0d132975ade2cd3d9a755e8f3820940ca which has been merged in version 0.2.1...

lldelisle commented 1 year ago

The test that fails has been solved by #1258 . Do you want me to merge develop or (to save energy) you accept the PR like this? Do you think it would be possible to do a release quickly with this bug fix?

WardDeb commented 1 year ago

We'll merge like this, I'll add the PR for mpl version as well and then tag a new release today still. Thanks @lldelisle !

lldelisle commented 1 year ago

Thanks.