shawnzhangyx / PePr

a peak-calling and differential analysis tool for replicated ChIP-Seq data
GNU General Public License v3.0
37 stars 9 forks source link

ValueError: negative dimensions are not allowed #18

Closed mictadlo closed 8 years ago

mictadlo commented 8 years ago

Hi, I run PePr with the following command:

 PePr -c  0002-queryname.bam,0018-queryname.bam,0035-queryname.bam -i 0007-queryname.bam,0022-queryname.bam,0039-queryname.bam --chip2 0010-queryname.bam,0025-queryname.bam,0042-queryname.bam --input2 0015-queryname.bam,0029-queryname.bam,0047-queryname.bam -f bampe --diff

and I received the following error:

 ...
JHQJ01007345.1:15727 | JHQJ01009046.1:9097 | JHQJ01008539.1:11097 | JHQJ01020837.1:201 |    JHQJ01009826.1:385 | JHQJ01012575.1:508 | JHQJ01017636.1:1472 | JHQJ01016551.1:1327 | JHQJ01006218.1:19351
INFO   root 06/24/2016 01:56:46 PM | Read length: 40|40|40|40|40|40|40|40|40|40|40|40
INFO   root 06/24/2016 01:56:46 PM | begin estimating window size
3953510
INFO   root 06/24/2016 05:19:04 PM | Estimated window size is 260
INFO   root 06/24/2016 05:19:04 PM | calculating normalization constants
3953510
8252390
6286016
10,000,000 lines processed in 0010-queryname.bam
11323490
10,000,000 lines processed in 0025-queryname.bam
10181318
5666186
1410602
6547948
4790668
10,000,000 lines processed in 0015-queryname.bam
20,000,000 lines processed in 0015-queryname.bam
23966748
5532420
4029448
INFO   root 06/24/2016 05:24:44 PM | printing running parameters:

#filetype       filename        shift_size      normalization_factor
chip1   0002-queryname.bam      0       1.27370117128
chip1   0018-queryname.bam      0       0.981914242417
chip1   0035-queryname.bam      0       1.44472012197
chip2   0010-queryname.bam      0       0.739728603872
chip2   0025-queryname.bam      0       0.81565284317
chip2   0042-queryname.bam      0       1.26934968745
input1  0007-queryname.bam      0       6.23122997967
input1  0022-queryname.bam      0       1.16748641832
input1  0039-queryname.bam      0       1.63285276762
input2  0015-queryname.bam      0       0.311505978138
input2  0029-queryname.bam      0       1.38645772116
input2  0047-queryname.bam      0       1.93256393057
file-format     bampe
peaktype        broad
windowsize      260
difftest        True
threshold       1e-05
normalization   inter-group
name    NA
num-processors  1

INFO   root 06/24/2016 05:24:44 PM | processing 0002-queryname.bam
Traceback (most recent call last):
  File "/usr/local/bin/PePr", line 9, in <module>
load_entry_point('PePr==1.1.11', 'console_scripts', 'PePr')()
  File "/usr/local/lib/python2.7/dist-packages/PePr/PePr.py", line 27, in argless_main
main(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/PePr/PePr.py", line 41, in main
prepareData.read_files_to_arrays(parameter)
  File "/usr/local/lib/python2.7/dist-packages/PePr/prepareData.py", line 147, in read_files_to_arrays
parameter.array_dict[filename] = read_file_to_array(filename, parameter)
  File "/usr/local/lib/python2.7/dist-packages/PePr/prepareData.py", line 111, in read_file_to_array
data_dict[chr] = numpy.zeros(row_num, dtype=numpy.float64)
ValueError: negative dimensions are not allowed

Did I do anything wrong?

Thank you in advance.

Best wishes,

Mic

shawnzhangyx commented 8 years ago

Hi Mic,

The issue is caused by a chromosome/contig that shorter than the window size estimated (260). I will fix the code so it will not result in an error.

Best, Yanxiao

On Fri, Jun 24, 2016 at 5:18 AM, Michał T. Lorenc notifications@github.com wrote:

Hi, I run PePr with the following command:

PePr -c 0002-queryname.bam,0018-queryname.bam,0035-queryname.bam -i 0007-queryname.bam,0022-queryname.bam,0039-queryname.bam --chip2 0010-queryname.bam,0025-queryname.bam,0042-queryname.bam --input2 0015-queryname.bam,0029-queryname.bam,0047-queryname.bam -f bampe --diff

and I received the following error:

... JHQJ01007345.1:15727 | JHQJ01009046.1:9097 | JHQJ01008539.1:11097 | JHQJ01020837.1:201 | JHQJ01009826.1:385 | JHQJ01012575.1:508 | JHQJ01017636.1:1472 | JHQJ01016551.1:1327 | JHQJ01006218.1:19351 INFO root 06/24/2016 01:56:46 PM | Read length: 40|40|40|40|40|40|40|40|40|40|40|40 INFO root 06/24/2016 01:56:46 PM | begin estimating window size 3953510 INFO root 06/24/2016 05:19:04 PM | Estimated window size is 260 INFO root 06/24/2016 05:19:04 PM | calculating normalization constants 3953510 8252390 6286016 10,000,000 lines processed in 0010-queryname.bam 11323490 10,000,000 lines processed in 0025-queryname.bam 10181318 5666186 1410602 6547948 4790668 10,000,000 lines processed in 0015-queryname.bam 20,000,000 lines processed in 0015-queryname.bam 23966748 5532420 4029448 INFO root 06/24/2016 05:24:44 PM | printing running parameters:

filetype filename shift_size normalization_factor

chip1 0002-queryname.bam 0 1.27370117128 chip1 0018-queryname.bam 0 0.981914242417 chip1 0035-queryname.bam 0 1.44472012197 chip2 0010-queryname.bam 0 0.739728603872 chip2 0025-queryname.bam 0 0.81565284317 chip2 0042-queryname.bam 0 1.26934968745 input1 0007-queryname.bam 0 6.23122997967 input1 0022-queryname.bam 0 1.16748641832 input1 0039-queryname.bam 0 1.63285276762 input2 0015-queryname.bam 0 0.311505978138 input2 0029-queryname.bam 0 1.38645772116 input2 0047-queryname.bam 0 1.93256393057 file-format bampe peaktype broad windowsize 260 difftest True threshold 1e-05 normalization inter-group name NA num-processors 1

INFO root 06/24/2016 05:24:44 PM | processing 0002-queryname.bam Traceback (most recent call last): File "/usr/local/bin/PePr", line 9, in load_entry_point('PePr==1.1.11', 'console_scripts', 'PePr')() File "/usr/local/lib/python2.7/dist-packages/PePr/PePr.py", line 27, in argless_main main(sys.argv) File "/usr/local/lib/python2.7/dist-packages/PePr/PePr.py", line 41, in main prepareData.read_files_to_arrays(parameter) File "/usr/local/lib/python2.7/dist-packages/PePr/prepareData.py", line 147, in read_files_to_arrays parameter.array_dict[filename] = read_file_to_array(filename, parameter) File "/usr/local/lib/python2.7/dist-packages/PePr/prepareData.py", line 111, in read_file_to_array data_dict[chr] = numpy.zeros(row_num, dtype=numpy.float64) ValueError: negative dimensions are not allowed

Did I do anything wrong?

Thank you in advance.

Best wishes,

Mic

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shawnzhangyx/PePr/issues/18, or mute the thread https://github.com/notifications/unsubscribe/AFOG6LMnoY_asmQBxOU9JFa-enCJYAYkks5qO6DUgaJpZM4I9mXm .

shawnzhangyx commented 8 years ago

Hi Mic,

Try upgrading PePr to the latest version (v1.1.12) and see if it fixes your problem. @mictadlo

Best, Yanxiao

mictadlo commented 8 years ago

Thank you it works.