@gmod/bbi 2.0.3 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/README.md +1 -1
- package/dist/bbi.js +160 -268
- package/dist/bbi.js.map +1 -1
- package/dist/bigbed.js +146 -259
- package/dist/bigbed.js.map +1 -1
- package/dist/bigint-polyfill/polyfill.js +1 -1
- package/dist/bigint-polyfill/polyfill.js.map +1 -1
- package/dist/bigint-polyfill/pure.js +11 -11
- package/dist/bigint-polyfill/pure.js.map +1 -1
- package/dist/bigwig.js +21 -75
- package/dist/bigwig.js.map +1 -1
- package/dist/blockView.js +207 -303
- package/dist/blockView.js.map +1 -1
- package/dist/range.js +49 -50
- package/dist/range.js.map +1 -1
- package/dist/unzip-pako.js +1 -1
- package/dist/unzip-pako.js.map +1 -1
- package/dist/unzip.js +1 -1
- package/dist/unzip.js.map +1 -1
- package/dist/util.js +14 -66
- package/dist/util.js.map +1 -1
- package/esm/bbi.js +4 -3
- package/esm/bbi.js.map +1 -1
- package/esm/blockView.js +2 -3
- package/esm/blockView.js.map +1 -1
- package/package.json +13 -13
- package/src/bbi.ts +5 -3
- package/src/blockView.ts +14 -4
package/src/blockView.ts
CHANGED
|
@@ -16,6 +16,8 @@ interface CoordRequest {
|
|
|
16
16
|
end: number
|
|
17
17
|
}
|
|
18
18
|
interface DataBlock {
|
|
19
|
+
blockOffset: bigint
|
|
20
|
+
blockSize: bigint
|
|
19
21
|
startChrom: number
|
|
20
22
|
endChrom: number
|
|
21
23
|
startBase: number
|
|
@@ -200,8 +202,13 @@ export class BlockView {
|
|
|
200
202
|
}
|
|
201
203
|
const request = { chrId, start, end }
|
|
202
204
|
if (!this.cirTreePromise) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
+
this.cirTreePromise = bbi.read(
|
|
206
|
+
Buffer.alloc(48),
|
|
207
|
+
0,
|
|
208
|
+
48,
|
|
209
|
+
Number(cirTreeOffset),
|
|
210
|
+
opts,
|
|
211
|
+
)
|
|
205
212
|
}
|
|
206
213
|
const { buffer } = await this.cirTreePromise
|
|
207
214
|
const cirBlockSize = isBigEndian
|
|
@@ -218,7 +225,10 @@ export class BlockView {
|
|
|
218
225
|
try {
|
|
219
226
|
const data = cirBlockData.subarray(offset)
|
|
220
227
|
|
|
221
|
-
const p = this.leafParser.parse(data)
|
|
228
|
+
const p = this.leafParser.parse(data) as {
|
|
229
|
+
blocksToFetch: DataBlock[]
|
|
230
|
+
recurOffsets: DataBlock[]
|
|
231
|
+
}
|
|
222
232
|
if (p.blocksToFetch) {
|
|
223
233
|
blocksToFetch = blocksToFetch.concat(
|
|
224
234
|
p.blocksToFetch
|
|
@@ -232,7 +242,7 @@ export class BlockView {
|
|
|
232
242
|
if (p.recurOffsets) {
|
|
233
243
|
const recurOffsets = p.recurOffsets
|
|
234
244
|
.filter(filterFeats)
|
|
235
|
-
.map(
|
|
245
|
+
.map(l => Number(l.blockOffset))
|
|
236
246
|
if (recurOffsets.length > 0) {
|
|
237
247
|
cirFobRecur(recurOffsets, level + 1)
|
|
238
248
|
}
|