@gmod/bbi 1.0.31 → 1.0.32
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 +6 -59
- package/dist/blockView.js +33 -35
- package/dist/unzip-pako.d.ts +2 -0
- package/dist/unzip-pako.js +8 -0
- package/dist/unzip.d.ts +2 -0
- package/dist/unzip.js +5 -0
- package/esm/blockView.js +36 -38
- package/esm/unzip-pako.d.ts +2 -0
- package/esm/unzip-pako.js +8 -0
- package/esm/unzip.d.ts +2 -0
- package/esm/unzip.js +5 -0
- package/package.json +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
## [1.0.
|
|
1
|
+
## [1.0.32](https://github.com/GMOD/bbi-js/compare/v1.0.31...v1.0.32) (2022-02-16)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Use pako to decode on command line instead of using zlib to avoid need to
|
|
6
|
+
manually polyfill zlib
|
|
6
7
|
|
|
7
|
-
## [1.0.
|
|
8
|
+
## [1.0.31](https://github.com/GMOD/bbi-js/compare/v1.0.30...v1.0.31) (2021-12-14)
|
|
8
9
|
|
|
10
|
+
- Add esm module builds with less babelification for smaller bundle sizes
|
|
9
11
|
|
|
12
|
+
## [1.0.30](https://github.com/GMOD/bbi-js/compare/v1.0.29...v1.0.30) (2020-06-25)
|
|
10
13
|
|
|
11
14
|
- Use abortable-promise-cache instead of abortable-memoize
|
|
12
15
|
- Allow opts parameter to getHeader instead of just abortsignal
|
|
13
16
|
|
|
14
17
|
## [1.0.29](https://github.com/GMOD/bbi-js/compare/v1.0.28...v1.0.29) (2020-01-28)
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
19
|
- Accidentally made the package include itself as dependency in 1.0.28, republish
|
|
19
20
|
|
|
20
|
-
|
|
21
21
|
## [1.0.28](https://github.com/GMOD/bbi-js/compare/v1.0.27...v1.0.28) (2020-01-28)
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
23
|
- Change typescript interface to use object keys instead of Map type for refsByName, refsById
|
|
26
24
|
- Typescript only release change
|
|
27
25
|
|
|
28
26
|
## [1.0.27](https://github.com/GMOD/bbi-js/compare/v1.0.26...v1.0.27) (2020-01-10)
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
28
|
- Reduce number of requests needed on initial header
|
|
33
29
|
- Add definedFieldCount to the returned Header
|
|
34
30
|
|
|
@@ -36,8 +32,6 @@ Thanks to @skinner for both of these contributions!
|
|
|
36
32
|
|
|
37
33
|
## [1.0.26](https://github.com/GMOD/bbi-js/compare/v1.0.25...v1.0.26) (2019-11-10)
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
35
|
- Fix important bug with fixed step bigwig files not using the proper start coordinate
|
|
42
36
|
|
|
43
37
|
## [1.0.25](https://github.com/GMOD/bbi-js/compare/v1.0.24...v1.0.25) (2019-11-03)
|
|
@@ -46,138 +40,97 @@ Thanks to @skinner for both of these contributions!
|
|
|
46
40
|
|
|
47
41
|
## [1.0.24](https://github.com/GMOD/bbi-js/compare/v1.0.23...v1.0.24) (2019-10-29)
|
|
48
42
|
|
|
49
|
-
|
|
50
|
-
|
|
51
43
|
- Fix the uniqueIds generated via the bigbed features
|
|
52
44
|
|
|
53
45
|
## [1.0.23](https://github.com/GMOD/bbi-js/compare/v1.0.22...v1.0.23) (2019-10-06)
|
|
54
46
|
|
|
55
|
-
|
|
56
47
|
- Small refactor of `filehandle.read()` to make it more robust
|
|
57
48
|
|
|
58
|
-
|
|
59
49
|
## [1.0.22](https://github.com/GMOD/bbi-js/compare/v1.0.21...v1.0.22) (2019-06-13)
|
|
60
50
|
|
|
61
|
-
|
|
62
|
-
|
|
63
51
|
- Bump generic-filehandle
|
|
64
52
|
- Add more checks for abort signal to allow early bailing
|
|
65
53
|
|
|
66
54
|
## [1.0.21](https://github.com/GMOD/bbi-js/compare/v1.0.20...v1.0.21) (2019-05-09)
|
|
67
55
|
|
|
68
|
-
|
|
69
|
-
|
|
70
56
|
- Add fix for reading files with greater than 256 contigs
|
|
71
57
|
|
|
72
58
|
## [1.0.20](https://github.com/GMOD/bbi-js/compare/v1.0.19...v1.0.20) (2019-05-06)
|
|
73
59
|
|
|
74
|
-
|
|
75
|
-
|
|
76
60
|
- Add fix that prevented accessing the lowest zoom/reduction level
|
|
77
61
|
|
|
78
62
|
## [1.0.19](https://github.com/GMOD/bbi-js/compare/v1.0.18...v1.0.19) (2019-05-02)
|
|
79
63
|
|
|
80
|
-
|
|
81
|
-
|
|
82
64
|
- Add regression fix since 1.0.16 for uncompressed files. Thanks to @lidaof for reporting!
|
|
83
65
|
|
|
84
66
|
## [1.0.18](https://github.com/GMOD/bbi-js/compare/v1.0.17...v1.0.18) (2019-05-02)
|
|
85
67
|
|
|
86
|
-
|
|
87
|
-
|
|
88
68
|
- Improve error handling of the observables (issue #20, pull #21)
|
|
89
69
|
- Bump generic-filehandle to 1.0.9 to fix compatibility with native browser fetch
|
|
90
70
|
|
|
91
71
|
## [1.0.17](https://github.com/GMOD/bbi-js/compare/v1.0.16...v1.0.17) (2019-04-30)
|
|
92
72
|
|
|
93
|
-
|
|
94
|
-
|
|
95
73
|
- Use some standard rxjs notions for combining operator results
|
|
96
74
|
- Add parsing of the extraIndex data in BigBed, allowing you to call bigbed.searchExtraIndex(name[,opts])
|
|
97
75
|
|
|
98
76
|
## [1.0.16](https://github.com/GMOD/bbi-js/compare/v1.0.15...v1.0.16) (2019-04-23)
|
|
99
77
|
|
|
100
|
-
|
|
101
|
-
|
|
102
78
|
- Pre-compile binary-parser instances for faster
|
|
103
79
|
- Important: fixed bug that caused bigwig summary blocks to not be returned in output
|
|
104
80
|
|
|
105
81
|
## [1.0.15](https://github.com/GMOD/bbi-js/compare/v1.0.14...v1.0.15) (2019-04-18)
|
|
106
82
|
|
|
107
|
-
|
|
108
|
-
|
|
109
83
|
- Make important performance improvement for BigWig data
|
|
110
84
|
|
|
111
85
|
## [1.0.14](https://github.com/GMOD/bbi-js/compare/v1.0.12...v1.0.14) (2019-04-17)
|
|
112
86
|
|
|
113
|
-
|
|
114
|
-
|
|
115
87
|
- Improve documentation for integration with @gmod/bed@2
|
|
116
88
|
- Fix some cases where abortSignal was passed incorrectly to filehandle
|
|
117
89
|
|
|
118
90
|
## [1.0.13](https://github.com/GMOD/bbi-js/compare/v1.0.12...v1.0.13) (2019-04-14)
|
|
119
91
|
|
|
120
|
-
|
|
121
|
-
|
|
122
92
|
- Added uniqueId to objects returned from BigBed to avoid issue with duplicates
|
|
123
93
|
|
|
124
94
|
## [1.0.12](https://github.com/GMOD/bbi-js/compare/v1.0.11...v1.0.12) (2019-04-12)
|
|
125
95
|
|
|
126
96
|
- Fix returning bigbed objects on empty regions
|
|
127
97
|
|
|
128
|
-
|
|
129
98
|
## [1.0.11](https://github.com/GMOD/bbi-js/compare/v1.0.10...v1.0.11) (2019-04-10)
|
|
130
99
|
|
|
131
|
-
|
|
132
|
-
|
|
133
100
|
- Removed polyfill of Array.prototype.flat which modifies global scope
|
|
134
101
|
|
|
135
102
|
## [1.0.10](https://github.com/GMOD/bbi-js/compare/v1.0.9...v1.0.10) (2019-04-09)
|
|
136
103
|
|
|
137
|
-
|
|
138
|
-
|
|
139
104
|
- Fix misinterpretation of variable step wig files in this module (the span is not variable in variable step files, only the step, use bedGraphToBigWig for variable span)
|
|
140
105
|
- Improved docs
|
|
141
106
|
|
|
142
107
|
## [1.0.9](https://github.com/GMOD/bbi-js/compare/v1.0.8...v1.0.9) (2019-04-05)
|
|
143
108
|
|
|
144
|
-
|
|
145
|
-
|
|
146
109
|
- Added caching of networking requests (thanks @rbuels for the abortable-promise-cache module!)
|
|
147
110
|
- Fix some type errors on the range class
|
|
148
111
|
- Correct using span on fixed size wiggle types
|
|
149
112
|
|
|
150
113
|
## [1.0.8](https://github.com/GMOD/bbi-js/compare/v1.0.7...v1.0.8) (2019-04-01)
|
|
151
114
|
|
|
152
|
-
|
|
153
|
-
|
|
154
115
|
- Fix @babel/runtime in deployed package
|
|
155
116
|
- Bugfix to the url argument to the BigWig/BigBed
|
|
156
117
|
|
|
157
118
|
## [1.0.7](https://github.com/GMOD/bbi-js/compare/v1.0.6...v1.0.7) (2019-04-01)
|
|
158
119
|
|
|
159
|
-
|
|
160
|
-
|
|
161
120
|
- Added getFeatureStream which returns an Observable from rxjs
|
|
162
121
|
- Added url option to BigWig and BigBed constructors to allow usage of RemoteFile filehandle
|
|
163
122
|
- Added typescript backend for better processing
|
|
164
123
|
|
|
165
124
|
## [1.0.6](https://github.com/GMOD/bbi-js/compare/v1.0.5...v1.0.6) (2019-03-15)
|
|
166
125
|
|
|
167
|
-
|
|
168
|
-
|
|
169
126
|
- Fix issue with fixed step and variable step bigwig files not working at all
|
|
170
127
|
|
|
171
128
|
## [1.0.5](https://github.com/GMOD/bbi-js/compare/v1.0.4...v1.0.5) (2019-03-07)
|
|
172
129
|
|
|
173
|
-
|
|
174
|
-
|
|
175
130
|
- Fix issue with jest being in deps instead of devDeps
|
|
176
131
|
|
|
177
132
|
## [1.0.4](https://github.com/GMOD/bbi-js/compare/v1.0.3...v1.0.4) (2019-01-28)
|
|
178
133
|
|
|
179
|
-
|
|
180
|
-
|
|
181
134
|
- Add renameRefSeqs functionality where you can apply a callback to the refseq names
|
|
182
135
|
- Consistently apply start/end coordinate filters at different zoom levels
|
|
183
136
|
|
|
@@ -187,19 +140,13 @@ Thanks to @skinner for both of these contributions!
|
|
|
187
140
|
|
|
188
141
|
## [1.0.2](https://github.com/GMOD/bbi-js/compare/v1.0.1...v1.0.2) (2019-01-24)
|
|
189
142
|
|
|
190
|
-
|
|
191
|
-
|
|
192
143
|
- Added regenerator-runtime to babel dist compilation
|
|
193
144
|
|
|
194
145
|
## [1.0.1](https://github.com/GMOD/bbi-js/compare/v1.0.0...v1.0.1) (2019-01-24)
|
|
195
146
|
|
|
196
|
-
|
|
197
|
-
|
|
198
147
|
- Added exports for BigWig and BigBed. const {BigWig, BigBed} = require('@gmod/bbi')
|
|
199
148
|
|
|
200
149
|
# 1.0.0 (2019-01-23)
|
|
201
150
|
|
|
202
|
-
|
|
203
|
-
|
|
204
151
|
- Initial version
|
|
205
152
|
- Has support for bigwig and bigbed files
|
package/dist/blockView.js
CHANGED
|
@@ -53,7 +53,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
53
53
|
exports.BlockView = void 0;
|
|
54
54
|
var binary_parser_1 = require("@gmod/binary-parser");
|
|
55
55
|
var abortable_promise_cache_1 = __importDefault(require("abortable-promise-cache"));
|
|
56
|
-
var
|
|
56
|
+
var unzip_1 = require("./unzip");
|
|
57
57
|
var quick_lru_1 = __importDefault(require("quick-lru"));
|
|
58
58
|
var range_1 = __importDefault(require("./range"));
|
|
59
59
|
var util_1 = require("./util");
|
|
@@ -213,10 +213,33 @@ var BlockView = /** @class */ (function () {
|
|
|
213
213
|
: buffer.readUInt32LE(4);
|
|
214
214
|
blocksToFetch_1 = [];
|
|
215
215
|
outstanding_1 = 0;
|
|
216
|
+
cirFobRecur2_1 = function (cirBlockData, offset, level) {
|
|
217
|
+
try {
|
|
218
|
+
var data = cirBlockData.slice(offset);
|
|
219
|
+
var p = _this.leafParser.parse(data).result;
|
|
220
|
+
if (p.blocksToFetch) {
|
|
221
|
+
blocksToFetch_1 = blocksToFetch_1.concat(p.blocksToFetch.filter(filterFeats_1).map(function (l) { return ({
|
|
222
|
+
offset: l.blockOffset,
|
|
223
|
+
length: l.blockSize,
|
|
224
|
+
}); }));
|
|
225
|
+
}
|
|
226
|
+
if (p.recurOffsets) {
|
|
227
|
+
var recurOffsets = p.recurOffsets
|
|
228
|
+
.filter(filterFeats_1)
|
|
229
|
+
.map(function (l) { return l.blockOffset; });
|
|
230
|
+
if (recurOffsets.length > 0) {
|
|
231
|
+
cirFobRecur_1(recurOffsets, level + 1);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch (e) {
|
|
236
|
+
observer.error(e);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
216
239
|
filterFeats_1 = function (b) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
(
|
|
240
|
+
var startChrom = b.startChrom, startBase = b.startBase, endChrom = b.endChrom, endBase = b.endBase;
|
|
241
|
+
return ((startChrom < chrId_1 || (startChrom === chrId_1 && startBase <= end)) &&
|
|
242
|
+
(endChrom > chrId_1 || (endChrom === chrId_1 && endBase >= start)));
|
|
220
243
|
};
|
|
221
244
|
cirFobStartFetch_1 = function (off, fr, level) { return __awaiter(_this, void 0, void 0, function () {
|
|
222
245
|
var length_1, offset, resultBuffer, i, e_2;
|
|
@@ -231,7 +254,7 @@ var BlockView = /** @class */ (function () {
|
|
|
231
254
|
resultBuffer = _a.sent();
|
|
232
255
|
for (i = 0; i < off.length; i += 1) {
|
|
233
256
|
if (fr.contains(off[i])) {
|
|
234
|
-
cirFobRecur2_1(resultBuffer, off[i] - offset, level
|
|
257
|
+
cirFobRecur2_1(resultBuffer, off[i] - offset, level);
|
|
235
258
|
outstanding_1 -= 1;
|
|
236
259
|
if (outstanding_1 === 0) {
|
|
237
260
|
this.readFeatures(observer, blocksToFetch_1, __assign(__assign({}, opts), { request: request_1 }));
|
|
@@ -256,32 +279,7 @@ var BlockView = /** @class */ (function () {
|
|
|
256
279
|
var blockSpan = new range_1.default(offset[i], offset[i] + maxCirBlockSpan);
|
|
257
280
|
spans = spans.union(blockSpan);
|
|
258
281
|
}
|
|
259
|
-
spans
|
|
260
|
-
.getRanges()
|
|
261
|
-
.map(function (fr) { return cirFobStartFetch_1(offset, fr, level); });
|
|
262
|
-
}
|
|
263
|
-
catch (e) {
|
|
264
|
-
observer.error(e);
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
cirFobRecur2_1 = function (cirBlockData, offset, level) {
|
|
268
|
-
try {
|
|
269
|
-
var data = cirBlockData.slice(offset);
|
|
270
|
-
var p = _this.leafParser.parse(data).result;
|
|
271
|
-
if (p.blocksToFetch) {
|
|
272
|
-
blocksToFetch_1 = blocksToFetch_1.concat(p.blocksToFetch.filter(filterFeats_1).map(function (l) { return ({
|
|
273
|
-
offset: l.blockOffset,
|
|
274
|
-
length: l.blockSize,
|
|
275
|
-
}); }));
|
|
276
|
-
}
|
|
277
|
-
if (p.recurOffsets) {
|
|
278
|
-
var recurOffsets = p.recurOffsets
|
|
279
|
-
.filter(filterFeats_1)
|
|
280
|
-
.map(function (l) { return l.blockOffset; });
|
|
281
|
-
if (recurOffsets.length > 0) {
|
|
282
|
-
cirFobRecur_1(recurOffsets, level + 1);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
282
|
+
spans.getRanges().map(function (fr) { return cirFobStartFetch_1(offset, fr, level); });
|
|
285
283
|
}
|
|
286
284
|
catch (e) {
|
|
287
285
|
observer.error(e);
|
|
@@ -309,7 +307,7 @@ var BlockView = /** @class */ (function () {
|
|
|
309
307
|
if (request) {
|
|
310
308
|
items = items.filter(function (elt) { return elt.chromId === request.chrId; });
|
|
311
309
|
}
|
|
312
|
-
|
|
310
|
+
var feats = items.map(function (elt) { return ({
|
|
313
311
|
start: elt.start,
|
|
314
312
|
end: elt.end,
|
|
315
313
|
maxScore: elt.maxScore,
|
|
@@ -318,8 +316,8 @@ var BlockView = /** @class */ (function () {
|
|
|
318
316
|
summary: true,
|
|
319
317
|
}); });
|
|
320
318
|
return request
|
|
321
|
-
?
|
|
322
|
-
:
|
|
319
|
+
? feats.filter(function (f) { return BlockView.coordFilter(f, request); })
|
|
320
|
+
: feats;
|
|
323
321
|
};
|
|
324
322
|
BlockView.prototype.parseBigBedBlock = function (data, startOffset, offset, request) {
|
|
325
323
|
var items = [];
|
|
@@ -385,7 +383,7 @@ var BlockView = /** @class */ (function () {
|
|
|
385
383
|
var blockOffset = block.offset - blockGroup.offset;
|
|
386
384
|
var resultData = data;
|
|
387
385
|
if (isCompressed_1) {
|
|
388
|
-
resultData =
|
|
386
|
+
resultData = (0, unzip_1.unzip)(data.slice(blockOffset));
|
|
389
387
|
blockOffset = 0;
|
|
390
388
|
}
|
|
391
389
|
(0, util_1.checkAbortSignal)(signal_2);
|
package/dist/unzip.d.ts
ADDED
package/dist/unzip.js
ADDED
package/esm/blockView.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.BlockView = void 0;
|
|
7
7
|
const binary_parser_1 = require("@gmod/binary-parser");
|
|
8
8
|
const abortable_promise_cache_1 = __importDefault(require("abortable-promise-cache"));
|
|
9
|
-
const
|
|
9
|
+
const unzip_1 = require("./unzip");
|
|
10
10
|
const quick_lru_1 = __importDefault(require("quick-lru"));
|
|
11
11
|
const range_1 = __importDefault(require("./range"));
|
|
12
12
|
const util_1 = require("./util");
|
|
@@ -148,11 +148,34 @@ class BlockView {
|
|
|
148
148
|
: buffer.readUInt32LE(4);
|
|
149
149
|
let blocksToFetch = [];
|
|
150
150
|
let outstanding = 0;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
const cirFobRecur2 = (cirBlockData, offset, level) => {
|
|
152
|
+
try {
|
|
153
|
+
const data = cirBlockData.slice(offset);
|
|
154
|
+
const p = this.leafParser.parse(data).result;
|
|
155
|
+
if (p.blocksToFetch) {
|
|
156
|
+
blocksToFetch = blocksToFetch.concat(p.blocksToFetch.filter(filterFeats).map((l) => ({
|
|
157
|
+
offset: l.blockOffset,
|
|
158
|
+
length: l.blockSize,
|
|
159
|
+
})));
|
|
160
|
+
}
|
|
161
|
+
if (p.recurOffsets) {
|
|
162
|
+
const recurOffsets = p.recurOffsets
|
|
163
|
+
.filter(filterFeats)
|
|
164
|
+
.map((l) => l.blockOffset);
|
|
165
|
+
if (recurOffsets.length > 0) {
|
|
166
|
+
cirFobRecur(recurOffsets, level + 1);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
observer.error(e);
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const filterFeats = (b) => {
|
|
175
|
+
const { startChrom, startBase, endChrom, endBase } = b;
|
|
176
|
+
return ((startChrom < chrId || (startChrom === chrId && startBase <= end)) &&
|
|
177
|
+
(endChrom > chrId || (endChrom === chrId && endBase >= start)));
|
|
178
|
+
};
|
|
156
179
|
const cirFobStartFetch = async (off, fr, level) => {
|
|
157
180
|
try {
|
|
158
181
|
const length = fr.max() - fr.min();
|
|
@@ -160,7 +183,7 @@ class BlockView {
|
|
|
160
183
|
const resultBuffer = await this.featureCache.get(`${length}_${offset}`, { length, offset }, signal);
|
|
161
184
|
for (let i = 0; i < off.length; i += 1) {
|
|
162
185
|
if (fr.contains(off[i])) {
|
|
163
|
-
cirFobRecur2(resultBuffer, off[i] - offset, level
|
|
186
|
+
cirFobRecur2(resultBuffer, off[i] - offset, level);
|
|
164
187
|
outstanding -= 1;
|
|
165
188
|
if (outstanding === 0) {
|
|
166
189
|
this.readFeatures(observer, blocksToFetch, { ...opts, request });
|
|
@@ -181,32 +204,7 @@ class BlockView {
|
|
|
181
204
|
const blockSpan = new range_1.default(offset[i], offset[i] + maxCirBlockSpan);
|
|
182
205
|
spans = spans.union(blockSpan);
|
|
183
206
|
}
|
|
184
|
-
spans
|
|
185
|
-
.getRanges()
|
|
186
|
-
.map((fr) => cirFobStartFetch(offset, fr, level));
|
|
187
|
-
}
|
|
188
|
-
catch (e) {
|
|
189
|
-
observer.error(e);
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
cirFobRecur2 = (cirBlockData, offset, level) => {
|
|
193
|
-
try {
|
|
194
|
-
const data = cirBlockData.slice(offset);
|
|
195
|
-
const p = this.leafParser.parse(data).result;
|
|
196
|
-
if (p.blocksToFetch) {
|
|
197
|
-
blocksToFetch = blocksToFetch.concat(p.blocksToFetch.filter(filterFeats).map((l) => ({
|
|
198
|
-
offset: l.blockOffset,
|
|
199
|
-
length: l.blockSize,
|
|
200
|
-
})));
|
|
201
|
-
}
|
|
202
|
-
if (p.recurOffsets) {
|
|
203
|
-
const recurOffsets = p.recurOffsets
|
|
204
|
-
.filter(filterFeats)
|
|
205
|
-
.map((l) => l.blockOffset);
|
|
206
|
-
if (recurOffsets.length > 0) {
|
|
207
|
-
cirFobRecur(recurOffsets, level + 1);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
207
|
+
spans.getRanges().map(fr => cirFobStartFetch(offset, fr, level));
|
|
210
208
|
}
|
|
211
209
|
catch (e) {
|
|
212
210
|
observer.error(e);
|
|
@@ -228,9 +226,9 @@ class BlockView {
|
|
|
228
226
|
}
|
|
229
227
|
let items = features;
|
|
230
228
|
if (request) {
|
|
231
|
-
items = items.filter(
|
|
229
|
+
items = items.filter(elt => elt.chromId === request.chrId);
|
|
232
230
|
}
|
|
233
|
-
|
|
231
|
+
const feats = items.map((elt) => ({
|
|
234
232
|
start: elt.start,
|
|
235
233
|
end: elt.end,
|
|
236
234
|
maxScore: elt.maxScore,
|
|
@@ -239,8 +237,8 @@ class BlockView {
|
|
|
239
237
|
summary: true,
|
|
240
238
|
}));
|
|
241
239
|
return request
|
|
242
|
-
?
|
|
243
|
-
:
|
|
240
|
+
? feats.filter(f => BlockView.coordFilter(f, request))
|
|
241
|
+
: feats;
|
|
244
242
|
}
|
|
245
243
|
parseBigBedBlock(data, startOffset, offset, request) {
|
|
246
244
|
const items = [];
|
|
@@ -292,7 +290,7 @@ class BlockView {
|
|
|
292
290
|
let blockOffset = block.offset - blockGroup.offset;
|
|
293
291
|
let resultData = data;
|
|
294
292
|
if (isCompressed) {
|
|
295
|
-
resultData =
|
|
293
|
+
resultData = (0, unzip_1.unzip)(data.slice(blockOffset));
|
|
296
294
|
blockOffset = 0;
|
|
297
295
|
}
|
|
298
296
|
(0, util_1.checkAbortSignal)(signal);
|
package/esm/unzip.d.ts
ADDED
package/esm/unzip.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmod/bbi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"description": "Parser for BigWig/BigBed files",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "GMOD/bbi-js",
|
|
@@ -24,10 +24,12 @@
|
|
|
24
24
|
"lint": "eslint --report-unused-disable-directives --max-warnings 0 --ext .js,.ts src",
|
|
25
25
|
"clean": "rimraf dist esm",
|
|
26
26
|
"prebuild": "npm run clean",
|
|
27
|
-
"build": "tsc --target es2018 --outDir esm
|
|
27
|
+
"build:esm": "tsc --target es2018 --outDir esm",
|
|
28
|
+
"build:es5": "tsc --target es5 --outDir dist",
|
|
29
|
+
"build": "npm run build:esm && npm run build:es5",
|
|
28
30
|
"preversion": "npm run lint && npm test && npm run build",
|
|
29
31
|
"version": "standard-changelog && git add CHANGELOG.md",
|
|
30
|
-
"
|
|
32
|
+
"postversion": "git push origin master --follow-tags"
|
|
31
33
|
},
|
|
32
34
|
"keywords": [
|
|
33
35
|
"bionode",
|
|
@@ -43,6 +45,7 @@
|
|
|
43
45
|
"buffer-crc32": "^0.2.13",
|
|
44
46
|
"es6-promisify": "^6.0.1",
|
|
45
47
|
"generic-filehandle": "^2.0.0",
|
|
48
|
+
"pako": "^1.0.0",
|
|
46
49
|
"quick-lru": "^4.0.0",
|
|
47
50
|
"rxjs": "^6.5.2"
|
|
48
51
|
},
|
|
@@ -51,21 +54,26 @@
|
|
|
51
54
|
"@types/jest": "^27.0.3",
|
|
52
55
|
"@types/long": "^4.0.0",
|
|
53
56
|
"@types/node": "^12.0.2",
|
|
54
|
-
"@
|
|
55
|
-
"@typescript-eslint/
|
|
57
|
+
"@types/pako": "^1.0.3",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
59
|
+
"@typescript-eslint/parser": "^5.10.0",
|
|
56
60
|
"cross-fetch": "^3.0.2",
|
|
57
|
-
"eslint": "^7.0
|
|
61
|
+
"eslint": "^8.7.0",
|
|
58
62
|
"eslint-config-prettier": "^8.3.0",
|
|
59
63
|
"eslint-plugin-import": "^2.25.3",
|
|
60
64
|
"eslint-plugin-prettier": "^4.0.0",
|
|
61
65
|
"jest": "^27.4.3",
|
|
62
66
|
"prettier": "^2.5.1",
|
|
63
|
-
"rimraf": "^
|
|
67
|
+
"rimraf": "^3.0.2",
|
|
64
68
|
"standard-changelog": "^2.0.11",
|
|
65
69
|
"ts-jest": "^27.0.7",
|
|
66
70
|
"typescript": "^4.5.2"
|
|
67
71
|
},
|
|
68
72
|
"publishConfig": {
|
|
69
73
|
"access": "public"
|
|
74
|
+
},
|
|
75
|
+
"browser": {
|
|
76
|
+
"./esm/unzip.js": "./esm/unzip-pako.js",
|
|
77
|
+
"./dist/unzip.js": "./dist/unzip-pako.js"
|
|
70
78
|
}
|
|
71
79
|
}
|