-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
Using the --debug-chr argument in the contribs_bw command can lead to errors like:
Saving 'counts' scores
Traceback (most recent call last):
File "/work/aaa/miniforge3/envs/chrombpnet_0_1_7/bin/chrombpnet", line 8, in <module>
sys.exit(main())
File "/work/aaa/miniforge3/envs/chrombpnet_0_1_7/lib/python3.10/site-packages/chrombpnet/CHROMBPNET.py", line 69, in main
importance_hdf5_to_bigwig.main(args_copy)
File "/work/aaa/miniforge3/envs/chrombpnet_0_1_7/lib/python3.10/site-packages/chrombpnet/evaluation/make_bigwigs/importance_hdf5_to_bigwig.py", line 33, in main
bigwig_helper.write_bigwig(d.sum(1),
File "/work/aaa/miniforge3/envs/chrombpnet_0_1_7/lib/python3.10/site-packages/chrombpnet/evaluation/make_bigwigs/bigwig_helper.py", line 115, in write_bigwig
all_entries = np.hstack(all_entries)
File "<__array_function__ internals>", line 180, in hstack
File "/work/aaa/miniforge3/envs/chrombpnet_0_1_7/lib/python3.10/site-packages/numpy/core/shape_base.py", line 345, in hstack
return _nx.concatenate(arrs, 1)
File "<__array_function__ internals>", line 180, in concatenate
ValueError: need at least one array to concatenateThis can occur under a couple circumstances:
- Including multiple debug chromosomes.
- Using a chromosome with fewer regions than the number of chrom.sizes entries.
This appears due to the following code:
chrombpnet/chrombpnet/evaluation/make_bigwigs/bigwig_helper.py
Lines 72 to 78 in aae277e
| for itr in iterator: | |
| # subset to chromosome (debugging) | |
| if debug_chr and regions[i][0]!=debug_chr: | |
| continue | |
| i = order_of_regs[itr] | |
| i_chr, i_start, i_end, i_mid = regions[i] |
which under either (1) or (2) will always enter the continue branch and lead to all_entries being left empty. Case (1) fails because equality is checked instead of membership; case (2) fails because i is not initialized and is still holding its enumeration value from iterating the chrom.sizes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels