jackh726 / bigtools

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

Support specifying bed(Graph) input files as .gz #39

Open jackh726 opened 5 months ago

mrvollger commented 3 months ago

Hi @jackh726

This seems like a great potential tool, but my bed files tend to be very large, so it would be awesome if you allowed for compressed input (maybe through https://github.com/luizirber/niffler).

Mostly commenting so I'll get an update if there is progress.

Cheers, Mitchell

jackh726 commented 3 months ago

Cool crate! I had expected to just use the flate2 decompress, but may try niffler instead (for the extra support).

I'll work on getting this in this weekend - it's ultimately a fairly small addition, I just need to get to it.

mrvollger commented 3 months ago

Awesome, great news!

Overall I agree it should be pretty easy as it has been easy in some other "bed" crates I have worked in e.g.: https://github.com/noamteyssier/gia/pull/58/files

Cheers!

mrvollger commented 3 months ago

Hi @jackh726,

I have been playing with the tool, and it seems that streaming input to bedtobigbed works, which is awesome, but I just wanted to double-check that this is intended to work generally?

bgzip -cd large.bed.gz -@ 16 | bigtools bedtobigbed -s start -a my.as - hg38.analysisSet.chrom.sizes out.bb 

If it is supported, then this is an excellent workaround for compressed files for now.

Cheers, Mitchell