jackh726 / bigtools

A high-performance BigWig and BigBed library in Rust
MIT License
70 stars 5 forks source link

bigtools bigwigtobedgraph hangs for certain bigwig file created with pyBigWig #18

Closed ghuls closed 9 months ago

ghuls commented 9 months ago

bigtools bigwigtobedgraph hangs for certain bigwig file created with pyBigWig

wget https://temp.aertslab.org/.bigtools/atac_fragments.pybigwig.bw

# bigtools hangs after writing 65530584 of the 130726419 output lines.
bigtools bigwigtobedgraph atac_fragments.pybigwig.bw atac_fragments.pybigwig.with_bigtools.bedgraph

# bigWigToBedGraph works fine on the same file
bigWigToBedGraph atac_fragments.pybigwig.bw atac_fragments.pybigwig.with_kenttools.bedgraph

# When the original bigWig was created with pybigtools instead of pyBigWig, the conversion works.
bigtools bigwigtobedgraph atac_fragments.bigtools.bw atac_fragments.bigtools.with_bigtools.bedgraph
jackh726 commented 9 months ago

Interesting. I'll take a look. Thanks for the repro steps!

jackh726 commented 9 months ago

Found the problem here. Wasn't properly handling the case where a chromosome appears in the bigwig, but has no data. This will be fixed in the 0.4.1 release (should be in the next couple days).

jackh726 commented 9 months ago

0.4.1 is pushed