@gmod/tabix 1.5.15 → 1.6.1
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 +10 -6
- package/README.md +175 -37
- package/dist/chunk.js.map +1 -1
- package/dist/csi.js +115 -121
- package/dist/csi.js.map +1 -1
- package/dist/indexFile.js +15 -41
- package/dist/indexFile.js.map +1 -1
- package/dist/tabix-bundle.js +1 -1
- package/dist/tabixIndexedFile.d.ts +6 -5
- package/dist/tabixIndexedFile.js +155 -161
- package/dist/tabixIndexedFile.js.map +1 -1
- package/dist/tbi.js +150 -165
- package/dist/tbi.js.map +1 -1
- package/dist/util.js +3 -14
- package/dist/util.js.map +1 -1
- package/esm/chunk.js.map +1 -1
- package/esm/tabixIndexedFile.d.ts +6 -5
- package/esm/tabixIndexedFile.js +70 -51
- package/esm/tabixIndexedFile.js.map +1 -1
- package/package.json +7 -5
- package/src/chunk.ts +0 -1
- package/src/tabixIndexedFile.ts +70 -58
package/dist/indexFile.js
CHANGED
|
@@ -1,35 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
-
var t = {};
|
|
13
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
-
t[p] = s[p];
|
|
15
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
-
t[p[i]] = s[p[i]];
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
};
|
|
22
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
3
|
class IndexFile {
|
|
24
4
|
constructor({ filehandle, renameRefSeqs = (n) => n, }) {
|
|
25
5
|
this.filehandle = filehandle;
|
|
26
6
|
this.renameRefSeq = renameRefSeqs;
|
|
27
7
|
}
|
|
28
|
-
getMetadata() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return rest;
|
|
32
|
-
});
|
|
8
|
+
async getMetadata(opts = {}) {
|
|
9
|
+
const { indices: _indices, ...rest } = await this.parse(opts);
|
|
10
|
+
return rest;
|
|
33
11
|
}
|
|
34
12
|
_findFirstData(currentFdl, virtualOffset) {
|
|
35
13
|
if (currentFdl) {
|
|
@@ -41,23 +19,19 @@ class IndexFile {
|
|
|
41
19
|
return virtualOffset;
|
|
42
20
|
}
|
|
43
21
|
}
|
|
44
|
-
parse() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
this.parseP =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return this.parseP;
|
|
53
|
-
});
|
|
22
|
+
async parse(opts = {}) {
|
|
23
|
+
if (!this.parseP) {
|
|
24
|
+
this.parseP = this._parse(opts).catch((e) => {
|
|
25
|
+
this.parseP = undefined;
|
|
26
|
+
throw e;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return this.parseP;
|
|
54
30
|
}
|
|
55
|
-
hasRefSeq(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return !!((_a = idx.indices[seqId]) === null || _a === void 0 ? void 0 : _a.binIndex);
|
|
60
|
-
});
|
|
31
|
+
async hasRefSeq(seqId, opts = {}) {
|
|
32
|
+
var _a;
|
|
33
|
+
const idx = await this.parse(opts);
|
|
34
|
+
return !!((_a = idx.indices[seqId]) === null || _a === void 0 ? void 0 : _a.binIndex);
|
|
61
35
|
}
|
|
62
36
|
}
|
|
63
37
|
exports.default = IndexFile;
|
package/dist/indexFile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexFile.js","sourceRoot":"","sources":["../src/indexFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"indexFile.js","sourceRoot":"","sources":["../src/indexFile.ts"],"names":[],"mappings":";;AAoBA,MAA8B,SAAS;IAKrC,YAAY,EACV,UAAU,EACV,aAAa,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,GAIjC;QACC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,YAAY,GAAG,aAAa,CAAA;IACnC,CAAC;IAMM,KAAK,CAAC,WAAW,CAAC,OAAgB,EAAE;QACzC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC7D,OAAO,IAAI,CAAA;IACb,CAAC;IASD,cAAc,CACZ,UAAqC,EACrC,aAA4B;QAE5B,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC;gBAC5C,CAAC,CAAC,aAAa;gBACf,CAAC,CAAC,UAAU,CAAA;QAChB,CAAC;aAAM,CAAC;YACN,OAAO,aAAa,CAAA;QACtB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAgB,EAAE;QAC5B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,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