rust-bio / rust-htslib

This library provides HTSlib bindings and a high level Rust API for reading and writing BAM files.
MIT License
297 stars 76 forks source link

tbx::Reader InvalidIndex error when reading bgzip pileup #225

Open kentwait opened 4 years ago

kentwait commented 4 years ago

The following text file was bgzip compressed using bgzip 1.10.2

bgzip test.pileup.txt

Then tabix-indexed using tabix 1.10.2

tabix -s 1 -b 2 -e 2 -c \# test.pileup.txt.gz

When I try to read test.pileup.txt I get an InvalidIndex error for the following code let reader = tbx::Reader::from_path(path).expect("Failed to create TabixPileup from path");

Failed to create TabixPileup from path: InvalidIndex

Let me know if I'm missing something here. I'm stumped. I've tried both with a header and without.

test.pileup.txt test.noheader.pileup.txt

brainstorm commented 4 years ago

Hello @kentwait, thanks for filing this! Can you craft a small test and pullrequest for this? Could be useful to increase test coverage and work towards a fix?

felix-clark commented 4 years ago

Is this a dup of #194 ? The difference is that you report failure even without the header line. PR #226 has just been merged to address it; perhaps you could see if your issue is resolved in the master branch?