Skip to content

Commit

Permalink
Fix htsget missing chrAliasTable and decoding header after data fetch (
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgenomics authored Aug 9, 2024
1 parent a9dafc3 commit a10605a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/htsget/htsgetBamReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class HtsgetBamReader extends HtsgetReader {
const ba = BGZip.unbgzf(compressedData.buffer)
this.header = BamUtils.decodeBamHeader(ba, this.genome)
this.chrAliasTable = new Map()
for (let key of Object.keys(this.header.chrAliasTable)) {
this.chrAliasTable.set(key, this.header.chrAliasTable[key])
for (let name of this.header.chrNames) {
this.chrAliasTable.set(name, this.genome.getChromosomeName(name))
}
}

Expand All @@ -55,6 +55,7 @@ class HtsgetBamReader extends HtsgetReader {

// BAM decoding
const ba = BGZip.unbgzf(compressedData.buffer)
this.header = BamUtils.decodeBamHeader(ba, this.genome)

const chrIdx = this.header.chrToIndex[chr]
const alignmentContainer = new AlignmentContainer(chr, start, end, this.config)
Expand Down

0 comments on commit a10605a

Please sign in to comment.