taoliu/MACS — Issue #6: Error in bedGraphTrackII.call_peaks when use bdgpeakcall
Author: hanfeisun
Created: 2012-01-10 03:46:19+00:00
State: open

I met an error when I use bdgpeakcall, and the traceback shows that it was on the Line 882 of cBedGraph:

[liuj@BioServer1 ~/ENCODE/GEOdata]$ bdgpeakcall -i GSM831025_H1_CHD1_1.bdg
INFO @ Mon, 09 Jan 2012 23:51:58: Read and build bedGraph...
INFO @ Mon, 09 Jan 2012 23:57:45: Call peaks from bedGraph...
Traceback (most recent call last):
File "/opt/bin/bdgpeakcall", line 86, in
main()
File "/opt/bin/bdgpeakcall", line 77, in main
peaks = btrack.call_peaks(cutoff=options.cutoff,min_length=options.minlen,max_gap=options.maxgap)
File "cBedGraph.pyx", line 882, in MACS2.IO.cBedGraph.bedGraphTrackII.call_peaks (MACS2/IO/cBedGraph.c:11840)
ValueError: operands could not be broadcast together with shapes (297031) (297030)

Then I change the Line882 from:
above_cutoff_endpos = self.data[chrom]['pos'][above_cutoff] # end positions of regions where score is above cutoff
above_cutoff_startpos = self.data[chrom]['pos'][above_cutoff_flag[1:]] # start position

to:
above_cutoff_endpos = self.data[chrom]['pos'][above_cutoff] # end positions of regions where score is above cutoff
above_cutoff_startpos = self.data[chrom]['pos'][above_cutoff_flag[0:]] # start position

and it seems passed, but I'm not sure whether it's ok to do that?