deepTools icon indicating copy to clipboard operation
deepTools copied to clipboard

computeMatrix scale-regions. error("'i' format requires -2147483648 <= number <= 2147483647",)

Open alfonsosaera opened this issue 3 years ago • 3 comments

Hi

I am having issues with computeMatrix scale-regions.

  • I did not find this issue (or a similar issue) using the search tab above. Please point me to the right issue if this has been asked before.

  • My deepTools version (deeptools --version) is deeptools 3.4.3 and my python version (python --version) is Python 2.7.17 and (python3 --version) is Python 3.6.9.

  • my command is:

computeMatrix scale-regions
-p 10 -R file.bed
-S sample1.bpm.bw
sample2.bpm.bw
sample3.bpm.bw
-b 20000
-a 20000
--regionBodyLength 20
--skipZeros
-o matrix.gz

My bed file looks like: chr1 11504 11675 -248944747 - L1MC5a LINE L1 -2382 395 199 3 chr1 18906 19048 -248937374 + L2a LINE L2 2942 3104 -322 8 chr1 19971 20405 -248936017 + L3 LINE CR1 2680 3129 -970 9 chr1 20530 20679 -248935743 + Plat_L3 LINE CR1 2802 2947 -639 1 chr1 23803 24038 -248932384 + L2b LINE L2 2940 3212 -175 1 chr1 24294 24448 -248931974 + L2b LINE L2 3268 3425 -1 1 chr1 26582 26790 -248929632 - L2c LINE L2 -14 3373 3116 1 chr1 27053 27137 -248929285 - L2c LINE L2 -272 3115 3026 1 chr1 29901 30198 -248926224 + L1MB3 LINE L1 5883 6181 -2 2 chr1 33047 33456 -248922966 + L1MB5 LINE L1 5746 6174 0 2

and the bpm.bw files were generated using the following command:

bamCompare -p 20
--operation mean
--effectiveGenomeSize 2913022398
--normalizeUsing BPM
--binSize 50
--scaleFactorsMethod None
-b1 file1.bam
-b2 file2.bam
-o sample1.bpm.bw

  • The error is:

Traceback (most recent call last): File "/usr/local/bin/computeMatrix", line 14, in main(args) File "/usr/local/lib/python3.6/dist-packages/deeptools/computeMatrix.py", line 421, in main hm.computeMatrix(scores_file_list, args.regionsFileName, parameters, blackListFileName=args.blackListFileName, verbose=args.verbose, allArgs=args) File "/usr/local/lib/python3.6/dist-packages/deeptools/heatmapper.py", line 264, in computeMatrix verbose=verbose) File "/usr/local/lib/python3.6/dist-packages/deeptools/mapReduce.py", line 142, in mapReduce res = pool.map_async(func, TASKS).get(9999999) File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value multiprocessing.pool.MaybeEncodingError: Error sending result: '[(array([[0.029576 , 0.029576 , 0.029576 , ..., 0.0644981 , 0.0644981 , 0.05482337], [0.118304 , 0.118304 , 0.118304 , ..., 0.0967471 , 0.0967471 , 0.0967471 ], ... ... ... 0. ]]), [['chr19', [(48801384, 48801471)], '-9816145', 0, '.', 0.0], ['chr19', [(48801472, 48801638)], '-9815978', 0, '.', 0.0], ['chr19', [(48802057, 48802437)], '-9815179', 0, '.', 0.0], ['chr19', [(48802745, 48802914)], '-9814702', 0, '.', 0.0], ['chr19', [(48803699, 48803877)], '-9813739', 0, '.', 0.0], ['chr19', [(48804185, 48804255)], '-9813361', 0, '.', 0.0], ['chr19', [(48816363, 48816481)], '-9801135', 0, '.', 0.0], ['chr19', [(48816586, 48816668)], '-9800948', 0, '.', 0.0], ['chr19', [(48817478, 48817740)], '-9799876', 0, '.', 0.0], ['chr19', [(48818520, 48818639)], '-9798977', 0, '.', 0.0], ['chr19', [(48818837, 48818951)], '-9798665', 0, '.', 0.0], ['chr19', [(48819292, 48819553)], '-9798063', 0, '.', 0.0], ['chr19', [(48819788, 48819863)], '-9797753', 0, '.', 0.0], ['chr19', [(48823002, 48823036)], '-9794580', 0, '.', 0.0], ['chr19', [(48823036, 48823212)], '-9794404', 0, '.', 0.0], ['chr19', [(48823430, 48823624)], '-9793992', 0, '.', 0.0], ['chr19', [(48823940, 48823964)], '-9793652', 0, '.', 0.0], ['chr19', [(48824824, 48824891)], '-9792725', 0, '.', 0.0], ['chr19', [(48826949, 48827009)], '-9790607', 0, '.', 0.0], ['chr19', [(48827341, 48827437)], '-9790179', 0, '.', 0.0], ['chr19', [(48838144, 48838481)], '-9779135', 0, '.', 0.0], ['chr19', [(48851163, 48851309)], '-9766307', 0, '.', 0.0], ['chr19', [(48863033, 48863188)], '-9754428', 0, '.', 0.0], ['chr19', [(48864468, 48864559)], '-9753057', 0, '.', 0.0], ['chr19', [(48864847, 48865056)], '-9752560', 0, '.', 0.0], ['chr19', [(48869456, 48869533)], '-9748083', 0, '.', 0.0], ['chr19', [(48890934, 48891026)], '-9726590', 0, '.', 0.0], ['chr19', [(48893396, 48893545)], '-9724071', 0, '.', 0.0], ['chr19', [(48893853, 48893932)], '-9723684', 0, '.', 0.0], ['chr19', [(48894847, 48894922)], '-9722694', 0, '.', 0.0]], 0)]'. Reason: 'error("'i' format requires -2147483648 <= number <= 2147483647",)'

The 3 ... were added by me, the error is gigantic. I found this question in stackoverflow that I think is related to this issue but I am unsure how to apply the suggested solution. I must add I have used deeptools before in my system with no issues.

Thank you very much for your help!

alfonsosaera avatar Jan 03 '22 12:01 alfonsosaera

Is there any reason your scores span such an extreme range? It's column 4 of you BED file that's causing an issue.

dpryan79 avatar Jan 03 '22 20:01 dpryan79

Thanks for the quick answer. I guess I can keep only the first 3 columns to make a 'minimal' bed file and avoid this issue. I know is a weird range but a collaborator asked for it and decided to give it a try. Is there any reason against a range as extreme as this one? Thanks again!

alfonsosaera avatar Jan 03 '22 23:01 alfonsosaera

Well you will end up running into weird corner cases like this due to treating it as a 32-bit integer.

dpryan79 avatar Jan 04 '22 15:01 dpryan79