IndexFactory.writeIndex is incorrect for tabix indexes, missing BlockCompressedOutputStream #430

Closed
akiezun opened this Issue Jan 8, 2016 · 1 comment

Comments

Projects
None yet
3 participants
Contributor

akiezun commented Jan 8, 2016

IndexFactory.writeIndex is incorrect for tabix indexes (does not use BlockCompressedOutputStream) and thus loading the index will blow up (reading does use BlockCompressedInoutStream).

Courtesy of @droazen, we know that compressing the index is indeed the right thing:
"the tbi index itself is supposed to be block compressed. Cf., eg., the code for writing tbi indices in htslib (https://github.com/samtools/htslib/blob/1e2ed48935a58845cecb64880e8cf7553c7db852/hts.c):

} else if (fmt == HTS_FMT_TBI) {
    BGZF *fp = bgzf_open(fnidx, "w");
    if (fp == NULL) return -1;
    bgzf_write(fp, "TBI\1", 4);
    hts_idx_save_core(idx, fp, HTS_FMT_TBI);
    bgzf_close(fp);

"

gatk has a workaround: broadinstitute/gatk#1422

akiezun added the bug label Jan 8, 2016

droazen self-assigned this Jan 8, 2016

Contributor

magicDGS commented Jul 27, 2016

I think that this could be close, couldn't it?

@magicDGS magicDGS added a commit to magicDGS/htsjdk that referenced this issue Aug 12, 2016

@magicDGS magicDGS fix #430 275fa9d

@magicDGS magicDGS added a commit to magicDGS/htsjdk that referenced this issue Sep 1, 2016

@magicDGS magicDGS fix #430 e785e1e

@magicDGS magicDGS added a commit to magicDGS/htsjdk that referenced this issue Sep 1, 2016

@magicDGS magicDGS fix #430 e599f9b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment