@gmod/bbi 2.0.4 → 3.0.0
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 +9 -1
- package/CHANGELOG.md.orig +200 -0
- package/README.md +91 -76
- package/dist/bbi.js +164 -275
- 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 -302
- 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 +18 -20
- package/esm/bbi.js.map +1 -1
- package/esm/bigbed.js +2 -2
- package/esm/bigbed.js.map +1 -1
- package/package.json +12 -12
- package/src/bbi.ts +5 -7
- package/src/bigbed.ts +3 -6
package/src/bbi.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Parser } from 'binary-parser'
|
|
2
2
|
import { LocalFile, RemoteFile, GenericFilehandle } from 'generic-filehandle'
|
|
3
|
-
import { Observable, Observer } from 'rxjs'
|
|
4
|
-
import {
|
|
3
|
+
import { firstValueFrom, Observable, Observer } from 'rxjs'
|
|
4
|
+
import { toArray } from 'rxjs/operators'
|
|
5
5
|
import { BlockView } from './blockView'
|
|
6
6
|
|
|
7
7
|
const BIG_WIG_MAGIC = -2003829722
|
|
@@ -367,12 +367,10 @@ export abstract class BBI {
|
|
|
367
367
|
opts: RequestOptions & { scale?: number; basesPerSpan?: number } = {
|
|
368
368
|
scale: 1,
|
|
369
369
|
},
|
|
370
|
-
)
|
|
370
|
+
) {
|
|
371
371
|
const ob = await this.getFeatureStream(refName, start, end, opts)
|
|
372
372
|
|
|
373
|
-
const ret = await ob
|
|
374
|
-
|
|
375
|
-
.toPromise()
|
|
376
|
-
return ret || []
|
|
373
|
+
const ret = await firstValueFrom(ob.pipe(toArray()))
|
|
374
|
+
return ret.flat()
|
|
377
375
|
}
|
|
378
376
|
}
|
package/src/bigbed.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Parser } from 'binary-parser'
|
|
2
|
-
import { Observable, merge } from 'rxjs'
|
|
2
|
+
import { Observable, merge, firstValueFrom } from 'rxjs'
|
|
3
3
|
import { map, reduce } from 'rxjs/operators'
|
|
4
4
|
import AbortablePromiseCache from 'abortable-promise-cache'
|
|
5
5
|
import QuickLRU from 'quick-lru'
|
|
@@ -216,10 +216,7 @@ export class BigBed extends BBI {
|
|
|
216
216
|
* @param opts - a SearchOptions argument with optional signal
|
|
217
217
|
* @return a Promise for an array of Feature
|
|
218
218
|
*/
|
|
219
|
-
public async searchExtraIndex(
|
|
220
|
-
name: string,
|
|
221
|
-
opts: RequestOptions = {},
|
|
222
|
-
): Promise<Feature[]> {
|
|
219
|
+
public async searchExtraIndex(name: string, opts: RequestOptions = {}) {
|
|
223
220
|
const blocks = await this.searchExtraIndexBlocks(name, opts)
|
|
224
221
|
if (!blocks.length) {
|
|
225
222
|
return []
|
|
@@ -238,7 +235,7 @@ export class BigBed extends BBI {
|
|
|
238
235
|
}),
|
|
239
236
|
)
|
|
240
237
|
})
|
|
241
|
-
const ret = await merge(...res)
|
|
238
|
+
const ret = await firstValueFrom(merge(...res))
|
|
242
239
|
return ret.filter(f => f.rest?.split('\t')[(f.field || 0) - 3] === name)
|
|
243
240
|
}
|
|
244
241
|
}
|