pyDNase icon indicating copy to clipboard operation
pyDNase copied to clipboard

wellington_bootstrap.py finishes with empty files

Open KRSBar opened this issue 6 years ago • 3 comments

Hello,

I recently attempted differential footprinting for the first time with wellington_bootstrap.py. After running the output files were completely empty. There were no errors raised during the run.

Is this simply because there are no differential footprints that pass the default FDR threshold? This was run on approximately 156,000 peak regions so I was thinking it would find something.

Thanks in advance for any help.

KRSBar avatar Mar 30 '18 15:03 KRSBar

I have the same problem. The output files are empty even when I set -fdr 0.99 -fdrlimit 0.

brisk022 avatar May 29 '18 04:05 brisk022

Here is what's happening. The footprints method of the Diffwel class performs a division when creating coordinates for GenomicIntervalSet object (line 74 in wellington_bootstrap.py) .

return_set.append(((i[0] + i[1])/2, i[3]))

This works fine in python2 as it automagically casts the result as int. In python3, the operation returns a float, which subsequently causes a TypeError during an attempt to use the coordinate as array index best_footprintsizes[i[0]] (line 103). The exception is successfully swallowed by the exception monster called multiprocessing. So, the script finishes without any errors and the exit code 0 but empty output files.

The way to fix it is to add an explicit int cast, i.e.

return_set.append((int((i[0] + i[1])/2), i[3]))

PS I might be wrong here as the exception message mentions numpy.float64, so it might be a numpy version issue rather than python2/python3.

brisk022 avatar May 29 '18 09:05 brisk022

I'm hoping #39 will have fixed this. I am working on a new release...

jpiper avatar Jul 18 '19 21:07 jpiper