@gmod/tabix 1.5.0 → 1.5.3
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 +20 -0
- package/README.md +3 -2
- package/dist/chunk.js +34 -62
- package/dist/chunk.js.map +1 -0
- package/dist/csi.d.ts +0 -1
- package/dist/csi.js +329 -533
- package/dist/csi.js.map +1 -0
- package/dist/index.js +12 -36
- package/dist/index.js.map +1 -0
- package/dist/indexFile.d.ts +1 -1
- package/dist/indexFile.js +113 -174
- package/dist/indexFile.js.map +1 -0
- package/dist/tabixIndexedFile.d.ts +8 -4
- package/dist/tabixIndexedFile.js +477 -774
- package/dist/tabixIndexedFile.js.map +1 -0
- package/dist/tbi.js +313 -485
- package/dist/tbi.js.map +1 -0
- package/dist/util.js +133 -148
- package/dist/util.js.map +1 -0
- package/dist/virtualOffset.js +45 -68
- package/dist/virtualOffset.js.map +1 -0
- package/esm/chunk.d.ts +18 -0
- package/esm/chunk.js +33 -0
- package/esm/chunk.js.map +1 -0
- package/esm/csi.d.ts +71 -0
- package/esm/csi.js +230 -0
- package/esm/csi.js.map +1 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +5 -0
- package/esm/index.js.map +1 -0
- package/esm/indexFile.d.ts +32 -0
- package/esm/indexFile.js +40 -0
- package/esm/indexFile.js.map +1 -0
- package/esm/tabixIndexedFile.d.ts +118 -0
- package/esm/tabixIndexedFile.js +398 -0
- package/esm/tabixIndexedFile.js.map +1 -0
- package/esm/tbi.d.ts +45 -0
- package/esm/tbi.js +216 -0
- package/esm/tbi.js.map +1 -0
- package/esm/util.d.ts +25 -0
- package/esm/util.js +91 -0
- package/esm/util.js.map +1 -0
- package/esm/virtualOffset.d.ts +10 -0
- package/esm/virtualOffset.js +37 -0
- package/esm/virtualOffset.js.map +1 -0
- package/package.json +27 -44
- package/src/chunk.ts +52 -0
- package/src/csi.ts +277 -0
- package/src/declare.d.ts +2 -0
- package/src/index.ts +5 -0
- package/src/indexFile.ts +79 -0
- package/src/tabixIndexedFile.ts +519 -0
- package/src/tbi.ts +250 -0
- package/src/util.ts +103 -0
- package/src/virtualOffset.ts +47 -0
- package/dist/declare.d.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [1.5.3](https://github.com/GMOD/tabix-js/compare/v1.5.2...v1.5.3) (2022-04-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
- Fix esm module build to use ESM instead of CJS
|
|
6
|
+
|
|
7
|
+
<a name="1.5.2"></a>
|
|
8
|
+
## [1.5.2](https://github.com/GMOD/tabix-js/compare/v1.5.1...v1.5.2) (2021-12-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
- Change typescript signature of lineCallback from Promise<void> to void
|
|
13
|
+
|
|
14
|
+
<a name="1.5.1"></a>
|
|
15
|
+
## [1.5.1](https://github.com/GMOD/tabix-js/compare/v1.5.0...v1.5.1) (2021-12-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
- Add esm module with less babelification for smaller bundle size
|
|
20
|
+
|
|
1
21
|
<a name="1.5.0"></a>
|
|
2
22
|
# [1.5.0](https://github.com/GMOD/tabix-js/compare/v1.4.6...v1.5.0) (2020-12-11)
|
|
3
23
|
|
package/README.md
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# @gmod/tabix
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.org/package/@gmod/tabix)
|
|
4
|
-
[](https://codecov.io/gh/GMOD/tabix-js/branch/master)
|
|
5
|
+
[](https://github.com/GMOD/tabix-js/actions?query=branch%3Amaster+workflow%3APush+)
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
Read Tabix-indexed files using either .tbi or .csi indexes.
|
package/dist/chunk.js
CHANGED
|
@@ -1,66 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports.default = void 0;
|
|
12
|
-
|
|
13
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
14
|
-
|
|
15
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
16
|
-
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
18
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
3
|
// little class representing a chunk in the index
|
|
20
|
-
var Chunk =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(0, _defineProperty2.default)(this, "_fetchedSize", void 0);
|
|
34
|
-
this.minv = minv;
|
|
35
|
-
this.maxv = maxv;
|
|
36
|
-
this.bin = bin;
|
|
37
|
-
this._fetchedSize = fetchedSize;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
(0, _createClass2.default)(Chunk, [{
|
|
41
|
-
key: "toUniqueString",
|
|
42
|
-
value: function toUniqueString() {
|
|
43
|
-
return "".concat(this.minv, "..").concat(this.maxv, " (bin ").concat(this.bin, ", fetchedSize ").concat(this.fetchedSize(), ")");
|
|
4
|
+
var Chunk = /** @class */ (function () {
|
|
5
|
+
/**
|
|
6
|
+
* @param {VirtualOffset} minv
|
|
7
|
+
* @param {VirtualOffset} maxv
|
|
8
|
+
* @param {number} bin
|
|
9
|
+
* @param {number} [fetchedSize]
|
|
10
|
+
*/
|
|
11
|
+
function Chunk(minv, maxv, bin, fetchedSize) {
|
|
12
|
+
if (fetchedSize === void 0) { fetchedSize = undefined; }
|
|
13
|
+
this.minv = minv;
|
|
14
|
+
this.maxv = maxv;
|
|
15
|
+
this.bin = bin;
|
|
16
|
+
this._fetchedSize = fetchedSize;
|
|
44
17
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}();
|
|
64
|
-
|
|
18
|
+
Chunk.prototype.toUniqueString = function () {
|
|
19
|
+
return "".concat(this.minv, "..").concat(this.maxv, " (bin ").concat(this.bin, ", fetchedSize ").concat(this.fetchedSize(), ")");
|
|
20
|
+
};
|
|
21
|
+
Chunk.prototype.toString = function () {
|
|
22
|
+
return this.toUniqueString();
|
|
23
|
+
};
|
|
24
|
+
Chunk.prototype.compareTo = function (b) {
|
|
25
|
+
return (this.minv.compareTo(b.minv) ||
|
|
26
|
+
this.maxv.compareTo(b.maxv) ||
|
|
27
|
+
this.bin - b.bin);
|
|
28
|
+
};
|
|
29
|
+
Chunk.prototype.fetchedSize = function () {
|
|
30
|
+
if (this._fetchedSize !== undefined) {
|
|
31
|
+
return this._fetchedSize;
|
|
32
|
+
}
|
|
33
|
+
return this.maxv.blockPosition + (1 << 16) - this.minv.blockPosition;
|
|
34
|
+
};
|
|
35
|
+
return Chunk;
|
|
36
|
+
}());
|
|
65
37
|
exports.default = Chunk;
|
|
66
|
-
//# sourceMappingURL=
|
|
38
|
+
//# sourceMappingURL=chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk.js","sourceRoot":"","sources":["../src/chunk.ts"],"names":[],"mappings":";;AAEA,iDAAiD;AACjD;IAME;;;;;OAKG;IACH,eACE,IAAmB,EACnB,IAAmB,EACnB,GAAW,EACX,WAAuB;QAAvB,4BAAA,EAAA,uBAAuB;QAEvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;IACjC,CAAC;IAED,8BAAc,GAAd;QACE,OAAO,UAAG,IAAI,CAAC,IAAI,eAAK,IAAI,CAAC,IAAI,mBAC/B,IAAI,CAAC,GAAG,2BACO,IAAI,CAAC,WAAW,EAAE,MAAG,CAAA;IACxC,CAAC;IAED,wBAAQ,GAAR;QACE,OAAO,IAAI,CAAC,cAAc,EAAE,CAAA;IAC9B,CAAC;IAED,yBAAS,GAAT,UAAU,CAAQ;QAChB,OAAO,CACL,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3B,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CACjB,CAAA;IACH,CAAC;IAED,2BAAW,GAAX;QACE,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;YACnC,OAAO,IAAI,CAAC,YAAY,CAAA;SACzB;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAA;IACtE,CAAC;IACH,YAAC;AAAD,CAAC,AAhDD,IAgDC"}
|
package/dist/csi.d.ts
CHANGED
|
@@ -66,7 +66,6 @@ export default class CSI extends IndexFile {
|
|
|
66
66
|
blocksForRange(refName: string, min: number, max: number, opts?: Options): Promise<Chunk[]>;
|
|
67
67
|
/**
|
|
68
68
|
* calculate the list of bins that may overlap with region [beg,end) (zero-based half-open)
|
|
69
|
-
* @returns {Array[number]}
|
|
70
69
|
*/
|
|
71
70
|
reg2bins(beg: number, end: number): number[][];
|
|
72
71
|
}
|