Thanks for creating this awesome tool.
I have encountered a potential bug in the WPS score calculation tool. It fails to process specific genomic intervals from the input BED file. There appears to be an issue with the WPS score calculation to handle multiple genomic intervals within a BED file. However, the tool functions correctly when processing BED files with a single genomic interval that were split from the original multi-region BED file.
I am using the latest available version of the tool: FinaleToolkit 0.7.5
Calculating aggregate WPS
input_file: GSM1833238_chr22.bam
site_bed: type_a_12.bed
output_file: output_wps.bw
window_size: 100
interval_size: 4000
quality_threshold: 30
workers: 10
verbose: 1
Reading intervals from bed
Zipping inputs
Calculating wps...
Output file output_wps.bw specified. Opening...
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/frag/multi_wps.py", line 17, in _wps_star
return wps(*args)
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/frag/wps.py", line 122, in wps
window_starts = np.zeros(stop-start)
ValueError: negative dimensions are not allowed
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/finaletoolkit", line 8, in <module>
sys.exit(main_cli())
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/cli/main_cli.py", line 793, in main_cli
function(**funcargs)
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/frag/multi_wps.py", line 199, in multi_wps
for interval_score in interval_scores:
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 423, in <genexpr>
return (item for chunk in result for item in chunk)
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 873, in next
raise value
ValueError: negative dimensions are not allowed
Calculating aggregate WPS
input_file: GSM1833238_chr22.bam
site_bed: type_b_12.bed
output_file: output_wps.bw
window_size: 100
interval_size: 4000
quality_threshold: 30
workers: 10
verbose: 1
Reading intervals from bed
Zipping inputs
Calculating wps...
Output file output_wps.bw specified. Opening...
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 125, in worker
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/frag/multi_wps.py", line 17, in _wps_star
return wps(*args)
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/frag/wps.py", line 95, in wps
frag_ends = frag_array(input_file,
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/utils/utils.py", line 414, in frag_array
frag_list = [
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/utils/utils.py", line 414, in <listcomp>
frag_list = [
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/utils/utils.py", line 296, in frag_generator
for read in sam_file.fetch(contig, start, stop):
File "pysam/libcalignmentfile.pyx", line 1091, in pysam.libcalignmentfile.AlignmentFile.fetch
File "pysam/libchtslib.pyx", line 688, in pysam.libchtslib.HTSFile.parse_region
ValueError: invalid coordinates: start (46572011) > stop (39397740)
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/finaletoolkit", line 8, in <module>
sys.exit(main_cli())
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/cli/main_cli.py", line 793, in main_cli
function(**funcargs)
File "/usr/local/lib/python3.10/site-packages/finaletoolkit/frag/multi_wps.py", line 199, in multi_wps
for interval_score in interval_scores:
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 423, in <genexpr>
return (item for chunk in result for item in chunk)
File "/usr/local/lib/python3.10/multiprocessing/pool.py", line 873, in next
raise value
ValueError: invalid coordinates: start (46572011) > stop (39397740)
Could you please have a look at this issue. Thank you.
Thank you for bringing this to our attention. The error trace and included files are incredibly helpful and greatly appreciated. I will work with the other authors to find a solution.
Thanks for creating this awesome tool. I have encountered a potential bug in the WPS score calculation tool. It fails to process specific genomic intervals from the input BED file. There appears to be an issue with the WPS score calculation to handle multiple genomic intervals within a BED file. However, the tool functions correctly when processing BED files with a single genomic interval that were split from the original multi-region BED file. I am using the latest available version of the tool: FinaleToolkit 0.7.5
Here are the input files Input file download url: BAM: https://figshare.com/ndownloader/files/50203797 BED: https://figshare.com/ndownloader/files/50203812
This is the content of the input BED file
The command I used
The error message I received:
Additionally, I encountered another error message of similar nature using the following genomic regions BED: https://figshare.com/ndownloader/files/50203821
The error message I received:
Could you please have a look at this issue. Thank you.