brentp / hts-nim

nim wrapper for htslib for parsing genomics data files

Home Page:https://brentp.github.io/hts-nim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Error: unhandled exception: invalid bgzf file [ValueError]" on an S3 bam file that samtools-1.9 can view.

splichte opened this issue · comments

Here is my command history:

ubuntu $ ./mosdepth pref http://s3.amazonaws.com/1000genomes/phase3/data/NA21103/alignment/NA21103.chrom11.ILLUMINA.bwa.GIH.low_coverage.20120522.bam
[E::knet_seek] SEEK_END is not supported for HTTP. Offset is unchanged
../../../../root/.nimble/pkgs/hts-0.2.8/hts/bam.nim(297) open
Error: unhandled exception: invalid bgzf file [ValueError]

ubuntu $ samtools view http://s3.amazonaws.com/1000genomes/phase3/data/NA21103/alignment/NA21103.chrom11.ILLUMINA.bwa.GIH.low_coverage.20120522.bam >/dev/null

samtools is built with htslib-1.9. mosdepth can read this file just OK if I copy it from S3 first. I put this issue on hts-nim since it seems like it is in bam.nim and has nothing to do with mosdepth itself.

I'm happy to attempt a fix if you have any idea what might be going on. Thanks!

thank you. i just pushed a fix for this.

thanks for reporting. not sure how I haven't seen this before, but good to get it resolved.

thanks!

yes. just tagged v0.2.21.