Skip to content

Commit

Permalink
Passing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Dec 11, 2024
1 parent b15bbae commit c6450a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/bamFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export default class BamFile {
buffer = await this.bam.readFile(opts)
}

console.log({ buffer })
const uncba = await unzip(buffer)
const dataView = new DataView(uncba.buffer)

Expand Down
9 changes: 5 additions & 4 deletions src/csi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ export default class CSI extends IndexFile {

const dataView = new DataView(bytes.buffer)
let csiVersion
// check TBI magic numbers
if (dataView.getUint32(0, true) === CSI1_MAGIC) {
const magic = dataView.getUint32(0, true)

if (magic === CSI1_MAGIC) {
csiVersion = 1
} else if (dataView.getUint32(0, true) === CSI2_MAGIC) {
} else if (magic === CSI2_MAGIC) {
csiVersion = 2
} else {
throw new Error('Not a CSI file')
throw new Error(`Not a CSI file ${magic}`)
// TODO: do we need to support big-endian CSI files?
}

Expand Down

0 comments on commit c6450a1

Please sign in to comment.