Skip to content

Commit d0b943e

Browse files
committed
Fix tests
1 parent a80f356 commit d0b943e

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/bamFile.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ export default class BamFile {
105105
this.chunkSizeLimit = chunkSizeLimit || 300000000 // 300MB
106106
}
107107

108-
async getHeader(opts: AbortSignal | BaseOpts = {}) {
109-
const indexData = await this.index.parse(makeOpts(opts))
108+
async getHeader(origOpts: AbortSignal | BaseOpts = {}) {
109+
const opts = makeOpts(origOpts)
110+
const indexData = await this.index.parse(opts)
110111
const ret = indexData.firstDataLine ? indexData.firstDataLine.blockPosition + 65535 : undefined
111112
let buffer
112113
if (ret) {
@@ -433,6 +434,9 @@ export default class BamFile {
433434
start: blockStart,
434435
end: blockEnd,
435436
},
437+
// the below results in an automatically calculated file-offset based ID
438+
// if the info for that is available, otherwise crc32 of the features
439+
//
436440
// cpositions[pos] refers to actual file offset of a bgzip block boundaries
437441
//
438442
// we multiply by (1 <<8) in order to make sure each block has a "unique"

src/htsget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { BaseOpts } from './indexFile'
2-
import BamFile, { BamOpts, BAM_MAGIC } from './bamFile'
1+
import { BaseOpts, BamOpts } from './util'
2+
import BamFile, { BAM_MAGIC } from './bamFile'
33
import 'cross-fetch/polyfill'
44
import Chunk from './chunk'
55
import { unzip } from '@gmod/bgzf-filehandle'

src/indexFile.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import QuickLRU from 'quick-lru'
33
import { GenericFilehandle } from 'generic-filehandle'
44
import VirtualOffset from './virtualOffset'
55
import Chunk from './chunk'
6+
import { BaseOpts } from './util'
67

78
export default abstract class IndexFile {
89
public filehandle: GenericFilehandle

0 commit comments

Comments
 (0)