vanheeringen-lab / seq2science

Automated and customizable preprocessing of Next-Generation Sequencing data, including full (sc)ATAC-seq, ChIP-seq, and (sc)RNA-seq workflows. Works equally easy with public as local data.
https://vanheeringen-lab.github.io/seq2science
MIT License
156 stars 27 forks source link

BUG: latest numpy version and IDR inconsistency #995

Closed apposada closed 1 year ago

apposada commented 1 year ago

Hi,

First time trying this pipeline and it works very well! I had one minor setback and I was not sure under which category I should post it (I think Bug report is the best-suited?)

I was running seq2science atac-seq with two samples of two biological replicates each, using IDR to merge them, and I got this error in the log of IDR:

/mnt/sda/alberto/programs/miniconda3/envs/seq2science_venv/lib/python3.10/site-packages/seq2science/.snakemake/c90ff8cbd1e27eafcd9b38725c49c49c_/bin/idr --samples /mnt/sda/alberto/projects/smed_cisreg/outputs/bulk_atac/gehrke_2019/results/macs2/Smed-sample1_peaks.narrowPeak /mnt/sda/alberto/projects/smed_cisreg/outputs/bulk_atac/gehrke_2019/results/macs2/Smed-sample2_peaks.narrowPeak --output-file /mnt/sda/alberto/projects/smed_cisreg/outputs/bulk_atac/gehrke_2019/results/macs2/Smed-tail_0h_peaks.tmp.narrowPeak
Traceback (most recent call last):
  File "/mnt/sda/alberto/programs/miniconda3/envs/seq2science_venv/lib/python3.10/site-packages/seq2science/.snakemake/c90ff8cbd1e27eafcd9b38725c49c49c_/bin/idr", line 10, in <module>
    idr.idr.main()
  File "/mnt/sda/alberto/programs/miniconda3/envs/seq2science_venv/lib/python3.10/site-packages/seq2science/.snakemake/c90ff8cbd1e27eafcd9b38725c49c49c_/lib/python3.10/site-packages/idr/idr.py", line 846, in main
    r1, r2 = build_rank_vectors(merged_peaks)
  File "/mnt/sda/alberto/programs/miniconda3/envs/seq2science_venv/lib/python3.10/site-packages/seq2science/.snakemake/c90ff8cbd1e27eafcd9b38725c49c49c_/lib/python3.10/site-packages/idr/idr.py", line 299, in build_rank_vectors
    return ( numpy.array(rank1, dtype=numpy.int),
  File "/mnt/sda/alberto/programs/miniconda3/envs/seq2science_venv/lib/python3.10/site-packages/seq2science/.snakemake/c90ff8cbd1e27eafcd9b38725c49c49c_/lib/python3.10/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'inf'?

I went to the idr.py script and found the offending line. I manually replaced any reference to np.int for int and it seems to be working well. I know this is related to IDR (they have an issue here https://github.com/nboley/idr/issues/64 ) where they suggest working with a previous version of numpy. I just wanted to notify this in case there is something that could be done on your end, like keeping numpy on a previous version until this is fixed (although I do not know how this would interfere with the rest of your code...) . Otherwise it works great! looking forward to give it an in-depth try with our samples in the future :)

Keep up the good work! Thanks!

Alberto

Maarten-vd-Sande commented 1 year ago

Hi Alberto,

Great you find seq2science useful! Thanks for the extensive bug report, yes it is a bug!

I updated the idr recipe on bioconda to require numpy<1.20, which should mean that this problem is fixed for everyone (not just seq2science). On top of that I've added a change to the seq2science-idr environment that it has to have a numpy version smaller than 1.20, which will be there in the next release.

I'll close this issue when that's released 😄