@gmod/cram 1.5.6 → 1.6.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 +82 -0
- package/README.md +126 -154
- package/dist/craiIndex.d.ts +37 -0
- package/dist/craiIndex.js +198 -365
- package/dist/craiIndex.js.map +1 -0
- package/dist/cram-bundle.js +8 -6
- package/dist/cramFile/codecs/_base.d.ts +6 -0
- package/dist/cramFile/codecs/_base.js +44 -53
- package/dist/cramFile/codecs/_base.js.map +1 -0
- package/dist/cramFile/codecs/beta.d.ts +4 -0
- package/dist/cramFile/codecs/beta.js +38 -48
- package/dist/cramFile/codecs/beta.js.map +1 -0
- package/dist/cramFile/codecs/byteArrayLength.d.ts +8 -0
- package/dist/cramFile/codecs/byteArrayLength.js +58 -78
- package/dist/cramFile/codecs/byteArrayLength.js.map +1 -0
- package/dist/cramFile/codecs/byteArrayStop.d.ts +6 -0
- package/dist/cramFile/codecs/byteArrayStop.js +62 -76
- package/dist/cramFile/codecs/byteArrayStop.js.map +1 -0
- package/dist/cramFile/codecs/external.d.ts +7 -0
- package/dist/cramFile/codecs/external.js +63 -81
- package/dist/cramFile/codecs/external.js.map +1 -0
- package/dist/cramFile/codecs/gamma.d.ts +4 -0
- package/dist/cramFile/codecs/gamma.js +43 -56
- package/dist/cramFile/codecs/gamma.js.map +1 -0
- package/dist/cramFile/codecs/huffman.d.ts +17 -0
- package/dist/cramFile/codecs/huffman.js +126 -199
- package/dist/cramFile/codecs/huffman.js.map +1 -0
- package/dist/cramFile/codecs/index.d.ts +2 -0
- package/dist/cramFile/codecs/index.js +31 -38
- package/dist/cramFile/codecs/index.js.map +1 -0
- package/dist/cramFile/codecs/subexp.d.ts +4 -0
- package/dist/cramFile/codecs/subexp.js +51 -64
- package/dist/cramFile/codecs/subexp.js.map +1 -0
- package/dist/cramFile/constants.d.ts +36 -0
- package/dist/cramFile/constants.js +52 -50
- package/dist/cramFile/constants.js.map +1 -0
- package/dist/cramFile/container/compressionScheme.d.ts +23 -0
- package/dist/cramFile/container/compressionScheme.js +115 -153
- package/dist/cramFile/container/compressionScheme.js.map +1 -0
- package/dist/cramFile/container/index.d.ts +13 -0
- package/dist/cramFile/container/index.js +169 -283
- package/dist/cramFile/container/index.js.map +1 -0
- package/dist/cramFile/file.d.ts +63 -0
- package/dist/cramFile/file.js +440 -735
- package/dist/cramFile/file.js.map +1 -0
- package/dist/cramFile/index.d.ts +2 -0
- package/dist/cramFile/index.js +7 -4
- package/dist/cramFile/index.js.map +1 -0
- package/dist/cramFile/record.d.ts +79 -0
- package/dist/cramFile/record.js +253 -308
- package/dist/cramFile/record.js.map +1 -0
- package/dist/cramFile/sectionParsers.d.ts +18 -0
- package/dist/cramFile/sectionParsers.js +324 -362
- package/dist/cramFile/sectionParsers.js.map +1 -0
- package/dist/cramFile/slice/decodeRecord.d.ts +2 -0
- package/dist/cramFile/slice/decodeRecord.js +278 -298
- package/dist/cramFile/slice/decodeRecord.js.map +1 -0
- package/dist/cramFile/slice/index.d.ts +20 -0
- package/dist/cramFile/slice/index.js +488 -789
- package/dist/cramFile/slice/index.js.map +1 -0
- package/dist/cramFile/util.d.ts +5 -0
- package/dist/cramFile/util.js +158 -144
- package/dist/cramFile/util.js.map +1 -0
- package/dist/errors.d.ts +23 -0
- package/dist/errors.js +66 -103
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -0
- package/dist/indexedCramFile.d.ts +39 -0
- package/dist/indexedCramFile.js +213 -315
- package/dist/indexedCramFile.js.map +1 -0
- package/dist/io/bufferCache.d.ts +12 -0
- package/dist/io/bufferCache.js +108 -128
- package/dist/io/bufferCache.js.map +1 -0
- package/dist/io/index.d.ts +5 -0
- package/dist/io/index.js +29 -27
- package/dist/io/index.js.map +1 -0
- package/dist/io/localFile.d.ts +10 -0
- package/dist/io/localFile.js +105 -162
- package/dist/io/localFile.js.map +1 -0
- package/dist/io/remoteFile.d.ts +16 -0
- package/dist/io/remoteFile.js +137 -206
- package/dist/io/remoteFile.js.map +1 -0
- package/dist/rans/constants.d.ts +3 -0
- package/dist/rans/constants.js +6 -6
- package/dist/rans/constants.js.map +1 -0
- package/dist/rans/d04.d.ts +1 -0
- package/dist/rans/d04.js +70 -99
- package/dist/rans/d04.js.map +1 -0
- package/dist/rans/d14.d.ts +1 -0
- package/dist/rans/d14.js +55 -93
- package/dist/rans/d14.js.map +1 -0
- package/dist/rans/decoding.d.ts +30 -0
- package/dist/rans/decoding.js +112 -159
- package/dist/rans/decoding.js.map +1 -0
- package/dist/rans/frequencies.d.ts +2 -0
- package/dist/rans/frequencies.js +110 -119
- package/dist/rans/frequencies.js.map +1 -0
- package/dist/rans/index.d.ts +1 -0
- package/dist/rans/index.js +111 -174
- package/dist/rans/index.js.map +1 -0
- package/dist/sam.d.ts +1 -0
- package/dist/sam.js +16 -41
- package/dist/sam.js.map +1 -0
- package/errors.js +66 -103
- package/esm/craiIndex.d.ts +37 -0
- package/esm/craiIndex.js +160 -0
- package/esm/craiIndex.js.map +1 -0
- package/esm/cramFile/codecs/_base.d.ts +6 -0
- package/esm/cramFile/codecs/_base.js +42 -0
- package/esm/cramFile/codecs/_base.js.map +1 -0
- package/esm/cramFile/codecs/beta.d.ts +4 -0
- package/esm/cramFile/codecs/beta.js +15 -0
- package/esm/cramFile/codecs/beta.js.map +1 -0
- package/esm/cramFile/codecs/byteArrayLength.d.ts +8 -0
- package/esm/cramFile/codecs/byteArrayLength.js +35 -0
- package/esm/cramFile/codecs/byteArrayLength.js.map +1 -0
- package/esm/cramFile/codecs/byteArrayStop.d.ts +6 -0
- package/esm/cramFile/codecs/byteArrayStop.js +40 -0
- package/esm/cramFile/codecs/byteArrayStop.js.map +1 -0
- package/esm/cramFile/codecs/external.d.ts +7 -0
- package/esm/cramFile/codecs/external.js +40 -0
- package/esm/cramFile/codecs/external.js.map +1 -0
- package/esm/cramFile/codecs/gamma.d.ts +4 -0
- package/esm/cramFile/codecs/gamma.js +20 -0
- package/esm/cramFile/codecs/gamma.js.map +1 -0
- package/esm/cramFile/codecs/huffman.d.ts +17 -0
- package/esm/cramFile/codecs/huffman.js +107 -0
- package/esm/cramFile/codecs/huffman.js.map +1 -0
- package/esm/cramFile/codecs/index.d.ts +2 -0
- package/esm/cramFile/codecs/index.js +30 -0
- package/esm/cramFile/codecs/index.js.map +1 -0
- package/esm/cramFile/codecs/subexp.d.ts +4 -0
- package/esm/cramFile/codecs/subexp.js +28 -0
- package/esm/cramFile/codecs/subexp.js.map +1 -0
- package/esm/cramFile/constants.d.ts +36 -0
- package/esm/cramFile/constants.js +51 -0
- package/esm/cramFile/constants.js.map +1 -0
- package/esm/cramFile/container/compressionScheme.d.ts +23 -0
- package/esm/cramFile/container/compressionScheme.js +123 -0
- package/esm/cramFile/container/compressionScheme.js.map +1 -0
- package/esm/cramFile/container/index.d.ts +13 -0
- package/esm/cramFile/container/index.js +84 -0
- package/esm/cramFile/container/index.js.map +1 -0
- package/esm/cramFile/file.d.ts +63 -0
- package/esm/cramFile/file.js +281 -0
- package/esm/cramFile/file.js.map +1 -0
- package/esm/cramFile/index.d.ts +2 -0
- package/esm/cramFile/index.js +3 -0
- package/esm/cramFile/index.js.map +1 -0
- package/esm/cramFile/record.d.ts +79 -0
- package/esm/cramFile/record.js +297 -0
- package/esm/cramFile/record.js.map +1 -0
- package/esm/cramFile/sectionParsers.d.ts +18 -0
- package/esm/cramFile/sectionParsers.js +347 -0
- package/esm/cramFile/sectionParsers.js.map +1 -0
- package/esm/cramFile/slice/decodeRecord.d.ts +2 -0
- package/esm/cramFile/slice/decodeRecord.js +299 -0
- package/esm/cramFile/slice/decodeRecord.js.map +1 -0
- package/esm/cramFile/slice/index.d.ts +20 -0
- package/esm/cramFile/slice/index.js +364 -0
- package/esm/cramFile/slice/index.js.map +1 -0
- package/esm/cramFile/util.d.ts +5 -0
- package/esm/cramFile/util.js +161 -0
- package/esm/cramFile/util.js.map +1 -0
- package/esm/errors.d.ts +23 -0
- package/esm/errors.js +24 -0
- package/esm/errors.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/indexedCramFile.d.ts +39 -0
- package/esm/indexedCramFile.js +155 -0
- package/esm/indexedCramFile.js.map +1 -0
- package/esm/io/bufferCache.d.ts +12 -0
- package/esm/io/bufferCache.js +54 -0
- package/esm/io/bufferCache.js.map +1 -0
- package/esm/io/index.d.ts +5 -0
- package/esm/io/index.js +24 -0
- package/esm/io/index.js.map +1 -0
- package/esm/io/localFile.d.ts +10 -0
- package/esm/io/localFile.js +31 -0
- package/esm/io/localFile.js.map +1 -0
- package/esm/io/remoteFile.d.ts +16 -0
- package/esm/io/remoteFile.js +64 -0
- package/esm/io/remoteFile.js.map +1 -0
- package/esm/rans/constants.d.ts +3 -0
- package/esm/rans/constants.js +5 -0
- package/esm/rans/constants.js.map +1 -0
- package/esm/rans/d04.d.ts +1 -0
- package/esm/rans/d04.js +67 -0
- package/esm/rans/d04.js.map +1 -0
- package/esm/rans/d14.d.ts +1 -0
- package/esm/rans/d14.js +52 -0
- package/esm/rans/d14.js.map +1 -0
- package/esm/rans/decoding.d.ts +30 -0
- package/esm/rans/decoding.js +118 -0
- package/esm/rans/decoding.js.map +1 -0
- package/esm/rans/frequencies.d.ts +2 -0
- package/esm/rans/frequencies.js +110 -0
- package/esm/rans/frequencies.js.map +1 -0
- package/esm/rans/index.d.ts +1 -0
- package/esm/rans/index.js +195 -0
- package/esm/rans/index.js.map +1 -0
- package/esm/sam.d.ts +1 -0
- package/esm/sam.js +16 -0
- package/esm/sam.js.map +1 -0
- package/package.json +34 -35
package/dist/craiIndex.js
CHANGED
|
@@ -1,254 +1,178 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
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 __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var abortable_promise_cache_1 = __importDefault(require("abortable-promise-cache"));
|
|
43
|
+
var quick_lru_1 = __importDefault(require("quick-lru"));
|
|
44
|
+
var es6_promisify_1 = require("es6-promisify");
|
|
45
|
+
var zlib_1 = __importDefault(require("zlib"));
|
|
46
|
+
var io_1 = require("./io");
|
|
47
|
+
var errors_1 = require("./errors");
|
|
48
|
+
var gunzip = (0, es6_promisify_1.promisify)(zlib_1.default.gunzip);
|
|
50
49
|
var BAI_MAGIC = 21578050; // BAI\1
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function () {
|
|
55
|
-
function Slice(args) {
|
|
56
|
-
(0, _classCallCheck2.default)(this, Slice);
|
|
57
|
-
(0, _assign.default)(this, args);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
(0, _createClass2.default)(Slice, [{
|
|
61
|
-
key: "toString",
|
|
62
|
-
value: function toString() {
|
|
63
|
-
var _context, _context2, _context3, _context4;
|
|
64
|
-
|
|
65
|
-
return (0, _concat.default)(_context = (0, _concat.default)(_context2 = (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.start, ":")).call(_context4, this.span, ":")).call(_context3, this.containerStart, ":")).call(_context2, this.sliceStart, ":")).call(_context, this.sliceBytes);
|
|
50
|
+
var Slice = /** @class */ (function () {
|
|
51
|
+
function Slice(args) {
|
|
52
|
+
Object.assign(this, args);
|
|
66
53
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
54
|
+
Slice.prototype.toString = function () {
|
|
55
|
+
return "".concat(this.start, ":").concat(this.span, ":").concat(this.containerStart, ":").concat(this.sliceStart, ":").concat(this.sliceBytes);
|
|
56
|
+
};
|
|
57
|
+
return Slice;
|
|
58
|
+
}());
|
|
71
59
|
function addRecordToIndex(index, record) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (!index[seqId]) index[seqId] = [];
|
|
87
|
-
index[seqId].push(new Slice({
|
|
88
|
-
start: start,
|
|
89
|
-
span: span,
|
|
90
|
-
containerStart: containerStart,
|
|
91
|
-
sliceStart: sliceStart,
|
|
92
|
-
sliceBytes: sliceBytes
|
|
93
|
-
}));
|
|
60
|
+
if (record.some(function (el) { return el === undefined; })) {
|
|
61
|
+
throw new errors_1.CramMalformedError('invalid .crai index file');
|
|
62
|
+
}
|
|
63
|
+
var seqId = record[0], start = record[1], span = record[2], containerStart = record[3], sliceStart = record[4], sliceBytes = record[5];
|
|
64
|
+
if (!index[seqId]) {
|
|
65
|
+
index[seqId] = [];
|
|
66
|
+
}
|
|
67
|
+
index[seqId].push(new Slice({
|
|
68
|
+
start: start,
|
|
69
|
+
span: span,
|
|
70
|
+
containerStart: containerStart,
|
|
71
|
+
sliceStart: sliceStart,
|
|
72
|
+
sliceBytes: sliceBytes,
|
|
73
|
+
}));
|
|
94
74
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
_context5;
|
|
118
|
-
|
|
119
|
-
(0, _classCallCheck2.default)(this, CraiIndex);
|
|
120
|
-
var filehandle = open(args.url, args.path, args.filehandle);
|
|
121
|
-
this._parseCache = new AbortablePromiseCache({
|
|
122
|
-
cache: new QuickLRU({
|
|
123
|
-
maxSize: 1
|
|
124
|
-
}),
|
|
125
|
-
fill: function fill(data, signal) {
|
|
126
|
-
return _this.parseIndex({
|
|
127
|
-
signal: signal
|
|
75
|
+
var CraiIndex = /** @class */ (function () {
|
|
76
|
+
// A CRAM index (.crai) is a gzipped tab delimited file containing the following columns:
|
|
77
|
+
// 1. Sequence id
|
|
78
|
+
// 2. Alignment start
|
|
79
|
+
// 3. Alignment span
|
|
80
|
+
// 4. Container start byte position in the file
|
|
81
|
+
// 5. Slice start byte position in the container data (‘blocks’)
|
|
82
|
+
// 6. Slice size in bytes
|
|
83
|
+
// Each line represents a slice in the CRAM file. Please note that all slices must be listed in index file.
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @param {object} args
|
|
87
|
+
* @param {string} [args.path]
|
|
88
|
+
* @param {string} [args.url]
|
|
89
|
+
* @param {FileHandle} [args.filehandle]
|
|
90
|
+
*/
|
|
91
|
+
function CraiIndex(args) {
|
|
92
|
+
var _this = this;
|
|
93
|
+
var filehandle = (0, io_1.open)(args.url, args.path, args.filehandle);
|
|
94
|
+
this._parseCache = new abortable_promise_cache_1.default({
|
|
95
|
+
cache: new quick_lru_1.default({ maxSize: 1 }),
|
|
96
|
+
fill: function (data, signal) { return _this.parseIndex({ signal: signal }); },
|
|
128
97
|
});
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
} else if (charCode !== 13
|
|
177
|
-
/* \r */
|
|
178
|
-
&& charCode !== 32
|
|
179
|
-
/* space */
|
|
180
|
-
) {
|
|
181
|
-
// if there are other characters in the file besides
|
|
182
|
-
// space and \r, something is wrong.
|
|
183
|
-
throw new CramMalformedError('invalid .crai index file');
|
|
98
|
+
this.readFile = filehandle.readFile.bind(filehandle);
|
|
99
|
+
}
|
|
100
|
+
CraiIndex.prototype.parseIndex = function () {
|
|
101
|
+
var index = {};
|
|
102
|
+
return this.readFile()
|
|
103
|
+
.then(function (data) {
|
|
104
|
+
if (data[0] === 31 && data[1] === 139) {
|
|
105
|
+
return gunzip(data);
|
|
106
|
+
}
|
|
107
|
+
return data;
|
|
108
|
+
})
|
|
109
|
+
.then(function (uncompressedBuffer) {
|
|
110
|
+
if (uncompressedBuffer.length > 4 &&
|
|
111
|
+
uncompressedBuffer.readUInt32LE(0) === BAI_MAGIC) {
|
|
112
|
+
throw new errors_1.CramMalformedError('invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support');
|
|
113
|
+
}
|
|
114
|
+
// interpret the text as regular ascii, since it is
|
|
115
|
+
// supposed to be only digits and whitespace characters
|
|
116
|
+
// this is written in a deliberately low-level fashion for performance,
|
|
117
|
+
// because some .crai files can be pretty large.
|
|
118
|
+
var currentRecord = [];
|
|
119
|
+
var currentString = '';
|
|
120
|
+
for (var i = 0; i < uncompressedBuffer.length; i += 1) {
|
|
121
|
+
var charCode = uncompressedBuffer[i];
|
|
122
|
+
if ((charCode >= 48 && charCode <= 57) /* 0-9 */ ||
|
|
123
|
+
(!currentString && charCode === 45) /* leading - */) {
|
|
124
|
+
currentString += String.fromCharCode(charCode);
|
|
125
|
+
}
|
|
126
|
+
else if (charCode === 9 /* \t */) {
|
|
127
|
+
currentRecord.push(Number.parseInt(currentString, 10));
|
|
128
|
+
currentString = '';
|
|
129
|
+
}
|
|
130
|
+
else if (charCode === 10 /* \n */) {
|
|
131
|
+
currentRecord.push(Number.parseInt(currentString, 10));
|
|
132
|
+
currentString = '';
|
|
133
|
+
addRecordToIndex(index, currentRecord);
|
|
134
|
+
currentRecord = [];
|
|
135
|
+
}
|
|
136
|
+
else if (charCode !== 13 /* \r */ && charCode !== 32 /* space */) {
|
|
137
|
+
// if there are other characters in the file besides
|
|
138
|
+
// space and \r, something is wrong.
|
|
139
|
+
throw new errors_1.CramMalformedError('invalid .crai index file');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// if the file ends without a \n, we need to flush our buffers
|
|
143
|
+
if (currentString) {
|
|
144
|
+
currentRecord.push(Number.parseInt(currentString, 10));
|
|
184
145
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
} // sort each of them by start
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
(0, _forEach.default)(_context6 = (0, _entries.default)(index)).call(_context6, function (_ref) {
|
|
198
|
-
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
199
|
-
seqId = _ref2[0],
|
|
200
|
-
ent = _ref2[1];
|
|
201
|
-
|
|
202
|
-
index[seqId] = (0, _sort.default)(ent).call(ent, function (a, b) {
|
|
203
|
-
return a.start - b.start || a.span - b.span;
|
|
204
|
-
});
|
|
146
|
+
if (currentRecord.length === 6) {
|
|
147
|
+
addRecordToIndex(index, currentRecord);
|
|
148
|
+
}
|
|
149
|
+
// sort each of them by start
|
|
150
|
+
Object.entries(index).forEach(function (_a) {
|
|
151
|
+
var seqId = _a[0], ent = _a[1];
|
|
152
|
+
index[seqId] = ent.sort(function (a, b) { return a.start - b.start || a.span - b.span; });
|
|
153
|
+
});
|
|
154
|
+
return index;
|
|
205
155
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
value: function getIndex() {
|
|
212
|
-
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
213
|
-
return this._parseCache.get('index', null, opts.signal);
|
|
214
|
-
}
|
|
156
|
+
};
|
|
157
|
+
CraiIndex.prototype.getIndex = function (opts) {
|
|
158
|
+
if (opts === void 0) { opts = {}; }
|
|
159
|
+
return this._parseCache.get('index', null, opts.signal);
|
|
160
|
+
};
|
|
215
161
|
/**
|
|
216
162
|
* @param {number} seqId
|
|
217
163
|
* @returns {Promise} true if the index contains entries for
|
|
218
164
|
* the given reference sequence ID, false otherwise
|
|
219
165
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
case 0:
|
|
231
|
-
_context7.next = 2;
|
|
232
|
-
return this.getIndex();
|
|
233
|
-
|
|
234
|
-
case 2:
|
|
235
|
-
_context7.t0 = seqId;
|
|
236
|
-
return _context7.abrupt("return", !!_context7.sent[_context7.t0]);
|
|
237
|
-
|
|
238
|
-
case 4:
|
|
239
|
-
case "end":
|
|
240
|
-
return _context7.stop();
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}, _callee, this);
|
|
244
|
-
}));
|
|
245
|
-
|
|
246
|
-
function hasDataForReferenceSequence(_x) {
|
|
247
|
-
return _hasDataForReferenceSequence.apply(this, arguments);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return hasDataForReferenceSequence;
|
|
251
|
-
}()
|
|
166
|
+
CraiIndex.prototype.hasDataForReferenceSequence = function (seqId) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
168
|
+
return __generator(this, function (_a) {
|
|
169
|
+
switch (_a.label) {
|
|
170
|
+
case 0: return [4 /*yield*/, this.getIndex()];
|
|
171
|
+
case 1: return [2 /*return*/, !!(_a.sent())[seqId]];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
};
|
|
252
176
|
/**
|
|
253
177
|
* fetch index entries for the given range
|
|
254
178
|
*
|
|
@@ -260,131 +184,40 @@ function () {
|
|
|
260
184
|
* an array of objects of the form
|
|
261
185
|
* `{start, span, containerStart, sliceStart, sliceBytes }`
|
|
262
186
|
*/
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
187
|
+
CraiIndex.prototype.getEntriesForRange = function (seqId, queryStart, queryEnd) {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
189
|
+
var seqEntries, compare, bins, i;
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0: return [4 /*yield*/, this.getIndex()];
|
|
193
|
+
case 1:
|
|
194
|
+
seqEntries = (_a.sent())[seqId];
|
|
195
|
+
if (!seqEntries) {
|
|
196
|
+
return [2 /*return*/, []];
|
|
197
|
+
}
|
|
198
|
+
compare = function (entry) {
|
|
199
|
+
var entryStart = entry.start;
|
|
200
|
+
var entryEnd = entry.start + entry.span;
|
|
201
|
+
if (entryStart >= queryEnd) {
|
|
202
|
+
return -1;
|
|
203
|
+
} // entry is ahead of query
|
|
204
|
+
if (entryEnd <= queryStart) {
|
|
205
|
+
return 1;
|
|
206
|
+
} // entry is behind query
|
|
207
|
+
return 0; // entry overlaps query
|
|
208
|
+
};
|
|
209
|
+
bins = [];
|
|
210
|
+
for (i = 0; i < seqEntries.length; i += 1) {
|
|
211
|
+
if (compare(seqEntries[i]) === 0) {
|
|
212
|
+
bins.push(seqEntries[i]);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return [2 /*return*/, bins];
|
|
285
216
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
compare = function compare(entry) {
|
|
295
|
-
var entryStart = entry.start;
|
|
296
|
-
var entryEnd = entry.start + entry.span;
|
|
297
|
-
if (entryStart >= queryEnd) return -1; // entry is ahead of query
|
|
298
|
-
|
|
299
|
-
if (entryEnd <= queryStart) return 1; // entry is behind query
|
|
300
|
-
|
|
301
|
-
return 0; // entry overlaps query
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
lowerBound = 0;
|
|
305
|
-
upperBound = len - 1;
|
|
306
|
-
|
|
307
|
-
case 10:
|
|
308
|
-
if (!(lowerBound <= upperBound)) {
|
|
309
|
-
_context8.next = 24;
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
searchPosition = Math.round((upperBound + lowerBound) / 2);
|
|
314
|
-
nextSearchDirection = compare(seqEntries[searchPosition]);
|
|
315
|
-
|
|
316
|
-
if (!(nextSearchDirection > 0)) {
|
|
317
|
-
_context8.next = 17;
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
lowerBound = searchPosition + 1;
|
|
322
|
-
_context8.next = 22;
|
|
323
|
-
break;
|
|
324
|
-
|
|
325
|
-
case 17:
|
|
326
|
-
if (!(nextSearchDirection < 0)) {
|
|
327
|
-
_context8.next = 21;
|
|
328
|
-
break;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
upperBound = searchPosition - 1;
|
|
332
|
-
_context8.next = 22;
|
|
333
|
-
break;
|
|
334
|
-
|
|
335
|
-
case 21:
|
|
336
|
-
return _context8.abrupt("break", 24);
|
|
337
|
-
|
|
338
|
-
case 22:
|
|
339
|
-
_context8.next = 10;
|
|
340
|
-
break;
|
|
341
|
-
|
|
342
|
-
case 24:
|
|
343
|
-
// now extend backward
|
|
344
|
-
overlapStart = searchPosition;
|
|
345
|
-
|
|
346
|
-
while (overlapStart && !compare(seqEntries[overlapStart - 1])) {
|
|
347
|
-
overlapStart -= 1;
|
|
348
|
-
} // and then extend forward
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
overlapEnd = searchPosition;
|
|
352
|
-
|
|
353
|
-
while (overlapEnd < len - 1 && !compare(seqEntries[overlapEnd + 1])) {
|
|
354
|
-
overlapEnd += 1;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
x1 = seqEntries[overlapStart].start;
|
|
358
|
-
x2 = seqEntries[overlapEnd].start + seqEntries[overlapEnd].span;
|
|
359
|
-
y1 = queryStart;
|
|
360
|
-
y2 = queryEnd;
|
|
361
|
-
|
|
362
|
-
if (!(x2 >= y1 && y2 >= x1)) {
|
|
363
|
-
_context8.next = 34;
|
|
364
|
-
break;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
return _context8.abrupt("return", (0, _slice.default)(seqEntries).call(seqEntries, overlapStart, overlapEnd + 1));
|
|
368
|
-
|
|
369
|
-
case 34:
|
|
370
|
-
return _context8.abrupt("return", []);
|
|
371
|
-
|
|
372
|
-
case 35:
|
|
373
|
-
case "end":
|
|
374
|
-
return _context8.stop();
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}, _callee2, this);
|
|
378
|
-
}));
|
|
379
|
-
|
|
380
|
-
function getEntriesForRange(_x2, _x3, _x4) {
|
|
381
|
-
return _getEntriesForRange.apply(this, arguments);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
return getEntriesForRange;
|
|
385
|
-
}()
|
|
386
|
-
}]);
|
|
387
|
-
return CraiIndex;
|
|
388
|
-
}();
|
|
389
|
-
|
|
390
|
-
module.exports = CraiIndex;
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
return CraiIndex;
|
|
221
|
+
}());
|
|
222
|
+
exports.default = CraiIndex;
|
|
223
|
+
//# sourceMappingURL=craiIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"craiIndex.js","sourceRoot":"","sources":["../src/craiIndex.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA2D;AAC3D,wDAAgC;AAChC,+CAAyC;AACzC,8CAAuB;AACvB,2BAA2B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