@gmod/cram 1.5.9 → 1.6.2
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 +90 -0
- package/README.md +182 -172
- package/dist/craiIndex.d.ts +37 -0
- package/dist/craiIndex.js +196 -301
- package/dist/craiIndex.js.map +1 -0
- package/dist/cram-bundle.js +6 -15
- 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 -766
- 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/dist/unzip-pako.d.ts +2 -0
- package/dist/unzip-pako.js +9 -0
- package/dist/unzip-pako.js.map +1 -0
- package/dist/unzip.d.ts +2 -0
- package/dist/unzip.js +6 -0
- package/dist/unzip.js.map +1 -0
- package/errors.js +66 -103
- package/esm/craiIndex.d.ts +37 -0
- package/esm/craiIndex.js +158 -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/esm/unzip-pako.d.ts +2 -0
- package/esm/unzip-pako.js +5 -0
- package/esm/unzip-pako.js.map +1 -0
- package/esm/unzip.d.ts +2 -0
- package/esm/unzip.js +3 -0
- package/esm/unzip.js.map +1 -0
- package/package.json +38 -35
- package/src/craiIndex.js +180 -0
- package/src/cramFile/codecs/_base.js +49 -0
- package/src/cramFile/codecs/beta.js +23 -0
- package/src/cramFile/codecs/byteArrayLength.js +55 -0
- package/src/cramFile/codecs/byteArrayStop.js +50 -0
- package/src/cramFile/codecs/external.js +54 -0
- package/src/cramFile/codecs/gamma.js +30 -0
- package/src/cramFile/codecs/huffman.js +137 -0
- package/src/cramFile/codecs/index.js +38 -0
- package/src/cramFile/codecs/subexp.js +32 -0
- package/src/cramFile/constants.js +55 -0
- package/src/cramFile/container/compressionScheme.js +144 -0
- package/src/cramFile/container/index.js +119 -0
- package/src/cramFile/file.js +347 -0
- package/src/cramFile/index.js +3 -0
- package/src/cramFile/record.js +337 -0
- package/src/cramFile/sectionParsers.js +379 -0
- package/src/cramFile/slice/decodeRecord.js +362 -0
- package/src/cramFile/slice/index.js +497 -0
- package/src/cramFile/util.js +169 -0
- package/src/errors.js +22 -0
- package/src/index.js +5 -0
- package/src/indexedCramFile.js +191 -0
- package/src/io/bufferCache.js +66 -0
- package/src/io/index.js +26 -0
- package/src/io/localFile.js +35 -0
- package/src/io/remoteFile.js +71 -0
- package/src/rans/README.md +1 -0
- package/src/rans/constants.js +5 -0
- package/src/rans/d04.js +83 -0
- package/src/rans/d14.js +59 -0
- package/src/rans/decoding.js +141 -0
- package/src/rans/frequencies.js +121 -0
- package/src/rans/index.js +249 -0
- package/src/sam.js +15 -0
- package/src/unzip-pako.ts +5 -0
- package/src/unzip.ts +2 -0
package/dist/cramFile/record.js
CHANGED
|
@@ -1,310 +1,260 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
8
|
-
|
|
9
|
-
var _flags = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/flags"));
|
|
10
|
-
|
|
11
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
12
|
-
|
|
13
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
14
|
-
|
|
15
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
16
|
-
|
|
17
|
-
var Constants = require('./constants');
|
|
18
|
-
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var constants_1 = __importDefault(require("./constants"));
|
|
19
7
|
function decodeReadSequence(cramRecord, refRegion) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
currentReadFeature
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
8
|
+
// if it has no length, it has no sequence
|
|
9
|
+
if (!cramRecord.lengthOnRef && !cramRecord.readLength) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
if (cramRecord.isUnknownBases()) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
// remember: all coordinates are 1-based closed
|
|
16
|
+
var regionSeqOffset = cramRecord.alignmentStart - refRegion.start;
|
|
17
|
+
if (!cramRecord.readFeatures) {
|
|
18
|
+
return refRegion.seq
|
|
19
|
+
.substr(regionSeqOffset, cramRecord.lengthOnRef)
|
|
20
|
+
.toUpperCase();
|
|
21
|
+
}
|
|
22
|
+
var bases = '';
|
|
23
|
+
var regionPos = regionSeqOffset;
|
|
24
|
+
var currentReadFeature = 0;
|
|
25
|
+
while (bases.length < cramRecord.readLength) {
|
|
26
|
+
if (currentReadFeature < cramRecord.readFeatures.length) {
|
|
27
|
+
var feature = cramRecord.readFeatures[currentReadFeature];
|
|
28
|
+
if (feature.code === 'Q' || feature.code === 'q') {
|
|
29
|
+
currentReadFeature += 1;
|
|
30
|
+
}
|
|
31
|
+
else if (feature.pos === bases.length + 1) {
|
|
32
|
+
// process the read feature
|
|
33
|
+
currentReadFeature += 1;
|
|
34
|
+
if (feature.code === 'b') {
|
|
35
|
+
// specify a base pair for some reason
|
|
36
|
+
var ret = feature.data.split(',');
|
|
37
|
+
var added = String.fromCharCode.apply(String, ret);
|
|
38
|
+
bases += added;
|
|
39
|
+
regionPos += added.length;
|
|
40
|
+
}
|
|
41
|
+
else if (feature.code === 'B') {
|
|
42
|
+
// base pair and associated quality
|
|
43
|
+
// TODO: do we need to set the quality in the qual scores?
|
|
44
|
+
bases += feature.data[0];
|
|
45
|
+
regionPos += 1;
|
|
46
|
+
}
|
|
47
|
+
else if (feature.code === 'X') {
|
|
48
|
+
// base substitution
|
|
49
|
+
bases += feature.sub;
|
|
50
|
+
regionPos += 1;
|
|
51
|
+
}
|
|
52
|
+
else if (feature.code === 'I') {
|
|
53
|
+
// insertion
|
|
54
|
+
bases += feature.data;
|
|
55
|
+
}
|
|
56
|
+
else if (feature.code === 'D') {
|
|
57
|
+
// deletion
|
|
58
|
+
regionPos += feature.data;
|
|
59
|
+
}
|
|
60
|
+
else if (feature.code === 'i') {
|
|
61
|
+
// insert single base
|
|
62
|
+
bases += feature.data;
|
|
63
|
+
}
|
|
64
|
+
else if (feature.code === 'N') {
|
|
65
|
+
// reference skip. delete some bases
|
|
66
|
+
// do nothing
|
|
67
|
+
// seqBases.splice(feature.pos - 1, feature.data)
|
|
68
|
+
regionPos += feature.data;
|
|
69
|
+
}
|
|
70
|
+
else if (feature.code === 'S') {
|
|
71
|
+
// soft clipped bases that should be present in the read seq
|
|
72
|
+
// seqBases.splice(feature.pos - 1, 0, ...feature.data.split(''))
|
|
73
|
+
bases += feature.data;
|
|
74
|
+
}
|
|
75
|
+
else if (feature.code === 'P') {
|
|
76
|
+
// padding, do nothing
|
|
77
|
+
}
|
|
78
|
+
else if (feature.code === 'H') {
|
|
79
|
+
// hard clip, do nothing
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (currentReadFeature < cramRecord.readFeatures.length) {
|
|
83
|
+
// put down a chunk of sequence up to the next read feature
|
|
84
|
+
var chunk = refRegion.seq.substr(regionPos, cramRecord.readFeatures[currentReadFeature].pos - bases.length - 1);
|
|
85
|
+
bases += chunk;
|
|
86
|
+
regionPos += chunk.length;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
// put down a chunk of reference up to the full read length
|
|
91
|
+
var chunk = refRegion.seq.substr(regionPos, cramRecord.readLength - bases.length);
|
|
92
|
+
bases += chunk;
|
|
93
|
+
regionPos += chunk.length;
|
|
75
94
|
}
|
|
76
|
-
} else if (currentReadFeature < cramRecord.readFeatures.length) {
|
|
77
|
-
// put down a chunk of sequence up to the next read feature
|
|
78
|
-
var chunk = refRegion.seq.substr(regionPos, cramRecord.readFeatures[currentReadFeature].pos - bases.length - 1);
|
|
79
|
-
bases += chunk;
|
|
80
|
-
regionPos += chunk.length;
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
// put down a chunk of reference up to the full read length
|
|
84
|
-
var _chunk = refRegion.seq.substr(regionPos, cramRecord.readLength - bases.length);
|
|
85
|
-
|
|
86
|
-
bases += _chunk;
|
|
87
|
-
regionPos += _chunk.length;
|
|
88
95
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return bases.toUpperCase();
|
|
96
|
+
return bases.toUpperCase();
|
|
92
97
|
}
|
|
93
|
-
|
|
94
98
|
var baseNumbers = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
a: 0,
|
|
100
|
+
A: 0,
|
|
101
|
+
c: 1,
|
|
102
|
+
C: 1,
|
|
103
|
+
g: 2,
|
|
104
|
+
G: 2,
|
|
105
|
+
t: 3,
|
|
106
|
+
T: 3,
|
|
107
|
+
n: 4,
|
|
108
|
+
N: 4,
|
|
105
109
|
};
|
|
106
|
-
|
|
107
110
|
function decodeBaseSubstitution(cramRecord, refRegion, compressionScheme, readFeature) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
if (!refRegion) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// decode base substitution code using the substitution matrix
|
|
115
|
+
var refCoord = readFeature.refPos - refRegion.start;
|
|
116
|
+
var refBase = refRegion.seq.charAt(refCoord);
|
|
117
|
+
if (refBase) {
|
|
118
|
+
readFeature.ref = refBase;
|
|
119
|
+
}
|
|
120
|
+
var baseNumber = baseNumbers[refBase];
|
|
121
|
+
if (baseNumber === undefined) {
|
|
122
|
+
baseNumber = 4;
|
|
123
|
+
}
|
|
124
|
+
var substitutionScheme = compressionScheme.substitutionMatrix[baseNumber];
|
|
125
|
+
var base = substitutionScheme[readFeature.data];
|
|
126
|
+
if (base) {
|
|
127
|
+
readFeature.sub = base;
|
|
128
|
+
}
|
|
118
129
|
}
|
|
119
130
|
/**
|
|
120
131
|
* Class of each CRAM record returned by this API.
|
|
121
132
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/*#__PURE__*/
|
|
126
|
-
function () {
|
|
127
|
-
function CramRecord() {
|
|
128
|
-
(0, _classCallCheck2.default)(this, CramRecord);
|
|
129
|
-
this.tags = {};
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* @returns {boolean} true if the read is paired, regardless of whether both segments are mapped
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
(0, _createClass2.default)(CramRecord, [{
|
|
137
|
-
key: "isPaired",
|
|
138
|
-
value: function isPaired() {
|
|
139
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FPAIRED);
|
|
133
|
+
var CramRecord = /** @class */ (function () {
|
|
134
|
+
function CramRecord() {
|
|
135
|
+
this.tags = {};
|
|
140
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* @returns {boolean} true if the read is paired, regardless of whether both segments are mapped
|
|
139
|
+
*/
|
|
140
|
+
CramRecord.prototype.isPaired = function () {
|
|
141
|
+
return !!(this.flags & constants_1.default.BAM_FPAIRED);
|
|
142
|
+
};
|
|
141
143
|
/** @returns {boolean} true if the read is paired, and both segments are mapped */
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
value: function isProperlyPaired() {
|
|
146
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FPROPER_PAIR);
|
|
147
|
-
}
|
|
144
|
+
CramRecord.prototype.isProperlyPaired = function () {
|
|
145
|
+
return !!(this.flags & constants_1.default.BAM_FPROPER_PAIR);
|
|
146
|
+
};
|
|
148
147
|
/** @returns {boolean} true if the read itself is unmapped; conflictive with isProperlyPaired */
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
value: function isSegmentUnmapped() {
|
|
153
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FUNMAP);
|
|
154
|
-
}
|
|
148
|
+
CramRecord.prototype.isSegmentUnmapped = function () {
|
|
149
|
+
return !!(this.flags & constants_1.default.BAM_FUNMAP);
|
|
150
|
+
};
|
|
155
151
|
/** @returns {boolean} true if the read itself is unmapped; conflictive with isProperlyPaired */
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
value: function isMateUnmapped() {
|
|
160
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FMUNMAP);
|
|
161
|
-
}
|
|
152
|
+
CramRecord.prototype.isMateUnmapped = function () {
|
|
153
|
+
return !!(this.flags & constants_1.default.BAM_FMUNMAP);
|
|
154
|
+
};
|
|
162
155
|
/** @returns {boolean} true if the read is mapped to the reverse strand */
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
value: function isReverseComplemented() {
|
|
167
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FREVERSE);
|
|
168
|
-
}
|
|
156
|
+
CramRecord.prototype.isReverseComplemented = function () {
|
|
157
|
+
return !!(this.flags & constants_1.default.BAM_FREVERSE);
|
|
158
|
+
};
|
|
169
159
|
/** @returns {boolean} true if the mate is mapped to the reverse strand */
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
value: function isMateReverseComplemented() {
|
|
174
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FMREVERSE);
|
|
175
|
-
}
|
|
160
|
+
CramRecord.prototype.isMateReverseComplemented = function () {
|
|
161
|
+
return !!(this.flags & constants_1.default.BAM_FMREVERSE);
|
|
162
|
+
};
|
|
176
163
|
/** @returns {boolean} true if this is read number 1 in a pair */
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
value: function isRead1() {
|
|
181
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FREAD1);
|
|
182
|
-
}
|
|
164
|
+
CramRecord.prototype.isRead1 = function () {
|
|
165
|
+
return !!(this.flags & constants_1.default.BAM_FREAD1);
|
|
166
|
+
};
|
|
183
167
|
/** @returns {boolean} true if this is read number 2 in a pair */
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
value: function isRead2() {
|
|
188
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FREAD2);
|
|
189
|
-
}
|
|
168
|
+
CramRecord.prototype.isRead2 = function () {
|
|
169
|
+
return !!(this.flags & constants_1.default.BAM_FREAD2);
|
|
170
|
+
};
|
|
190
171
|
/** @returns {boolean} true if this is a secondary alignment */
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
value: function isSecondary() {
|
|
195
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FSECONDARY);
|
|
196
|
-
}
|
|
172
|
+
CramRecord.prototype.isSecondary = function () {
|
|
173
|
+
return !!(this.flags & constants_1.default.BAM_FSECONDARY);
|
|
174
|
+
};
|
|
197
175
|
/** @returns {boolean} true if this read has failed QC checks */
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
value: function isFailedQc() {
|
|
202
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FQCFAIL);
|
|
203
|
-
}
|
|
176
|
+
CramRecord.prototype.isFailedQc = function () {
|
|
177
|
+
return !!(this.flags & constants_1.default.BAM_FQCFAIL);
|
|
178
|
+
};
|
|
204
179
|
/** @returns {boolean} true if the read is an optical or PCR duplicate */
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
value: function isDuplicate() {
|
|
209
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FDUP);
|
|
210
|
-
}
|
|
180
|
+
CramRecord.prototype.isDuplicate = function () {
|
|
181
|
+
return !!(this.flags & constants_1.default.BAM_FDUP);
|
|
182
|
+
};
|
|
211
183
|
/** @returns {boolean} true if this is a supplementary alignment */
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
value: function isSupplementary() {
|
|
216
|
-
return !!((0, _flags.default)(this) & Constants.BAM_FSUPPLEMENTARY);
|
|
217
|
-
}
|
|
184
|
+
CramRecord.prototype.isSupplementary = function () {
|
|
185
|
+
return !!(this.flags & constants_1.default.BAM_FSUPPLEMENTARY);
|
|
186
|
+
};
|
|
218
187
|
/**
|
|
219
188
|
* @returns {boolean} true if the read is detached
|
|
220
189
|
*/
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
value: function isDetached() {
|
|
225
|
-
return !!(this.cramFlags & Constants.CRAM_FLAG_DETACHED);
|
|
226
|
-
}
|
|
190
|
+
CramRecord.prototype.isDetached = function () {
|
|
191
|
+
return !!(this.cramFlags & constants_1.default.CRAM_FLAG_DETACHED);
|
|
192
|
+
};
|
|
227
193
|
/** @returns {boolean} true if the read has a mate in this same CRAM segment */
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
value: function hasMateDownStream() {
|
|
232
|
-
return !!(this.cramFlags & Constants.CRAM_FLAG_MATE_DOWNSTREAM);
|
|
233
|
-
}
|
|
194
|
+
CramRecord.prototype.hasMateDownStream = function () {
|
|
195
|
+
return !!(this.cramFlags & constants_1.default.CRAM_FLAG_MATE_DOWNSTREAM);
|
|
196
|
+
};
|
|
234
197
|
/** @returns {boolean} true if the read contains qual scores */
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
value: function isPreservingQualityScores() {
|
|
239
|
-
return !!(this.cramFlags & Constants.CRAM_FLAG_PRESERVE_QUAL_SCORES);
|
|
240
|
-
}
|
|
198
|
+
CramRecord.prototype.isPreservingQualityScores = function () {
|
|
199
|
+
return !!(this.cramFlags & constants_1.default.CRAM_FLAG_PRESERVE_QUAL_SCORES);
|
|
200
|
+
};
|
|
241
201
|
/** @returns {boolean} true if the read has no sequence bases */
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
value: function isUnknownBases() {
|
|
246
|
-
return !!(this.cramFlags & Constants.CRAM_FLAG_NO_SEQ);
|
|
247
|
-
}
|
|
202
|
+
CramRecord.prototype.isUnknownBases = function () {
|
|
203
|
+
return !!(this.cramFlags & constants_1.default.CRAM_FLAG_NO_SEQ);
|
|
204
|
+
};
|
|
248
205
|
/**
|
|
249
206
|
* Get the original sequence of this read.
|
|
250
207
|
* @returns {String} sequence basepairs
|
|
251
208
|
*/
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return this.readBases;
|
|
261
|
-
}
|
|
209
|
+
CramRecord.prototype.getReadBases = function () {
|
|
210
|
+
if (!this.readBases && this._refRegion) {
|
|
211
|
+
this.readBases = decodeReadSequence(this, this._refRegion);
|
|
212
|
+
}
|
|
213
|
+
return this.readBases;
|
|
214
|
+
};
|
|
262
215
|
/**
|
|
263
216
|
* Get the pair orientation of a paired read. Adapted from igv.js
|
|
264
217
|
* @returns {String} of paired orientatin
|
|
265
218
|
*/
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
219
|
+
CramRecord.prototype.getPairOrientation = function () {
|
|
220
|
+
if (!this.isSegmentUnmapped() &&
|
|
221
|
+
this.isPaired() &&
|
|
222
|
+
!this.isMateUnmapped() &&
|
|
223
|
+
this.mate &&
|
|
224
|
+
this.sequenceId === this.mate.sequenceId) {
|
|
225
|
+
var s1 = this.isReverseComplemented() ? 'R' : 'F';
|
|
226
|
+
var s2 = this.isMateReverseComplemented() ? 'R' : 'F';
|
|
227
|
+
var o1 = ' ';
|
|
228
|
+
var o2 = ' ';
|
|
229
|
+
if (this.isRead1()) {
|
|
230
|
+
o1 = '1';
|
|
231
|
+
o2 = '2';
|
|
232
|
+
}
|
|
233
|
+
else if (this.isRead2()) {
|
|
234
|
+
o1 = '2';
|
|
235
|
+
o2 = '1';
|
|
236
|
+
}
|
|
237
|
+
var tmp = [];
|
|
238
|
+
var isize = this.templateLength || this.templateSize;
|
|
239
|
+
if (this.alignmentStart > this.mate.alignmentStart && isize > 0) {
|
|
240
|
+
isize = -isize;
|
|
241
|
+
}
|
|
242
|
+
if (isize > 0) {
|
|
243
|
+
tmp[0] = s1;
|
|
244
|
+
tmp[1] = o1;
|
|
245
|
+
tmp[2] = s2;
|
|
246
|
+
tmp[3] = o2;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
tmp[2] = s1;
|
|
250
|
+
tmp[3] = o1;
|
|
251
|
+
tmp[0] = s2;
|
|
252
|
+
tmp[1] = o2;
|
|
253
|
+
}
|
|
254
|
+
return tmp.join('');
|
|
289
255
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
tmp[0] = s1;
|
|
293
|
-
tmp[1] = o1;
|
|
294
|
-
tmp[2] = s2;
|
|
295
|
-
tmp[3] = o2;
|
|
296
|
-
} else {
|
|
297
|
-
tmp[2] = s1;
|
|
298
|
-
tmp[3] = o1;
|
|
299
|
-
tmp[0] = s2;
|
|
300
|
-
tmp[1] = o2;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return tmp.join('');
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
return null;
|
|
307
|
-
}
|
|
256
|
+
return null;
|
|
257
|
+
};
|
|
308
258
|
/**
|
|
309
259
|
* Annotates this feature with the given reference sequence basepair
|
|
310
260
|
* information. This will add a `sub` and a `ref` item to base
|
|
@@ -318,44 +268,39 @@ function () {
|
|
|
318
268
|
* @param {CramContainerCompressionScheme} compressionScheme
|
|
319
269
|
* @returns {undefined} nothing
|
|
320
270
|
*/
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
271
|
+
CramRecord.prototype.addReferenceSequence = function (refRegion, compressionScheme) {
|
|
272
|
+
var _this = this;
|
|
273
|
+
if (this.readFeatures) {
|
|
274
|
+
// use the reference bases to decode the bases
|
|
275
|
+
// substituted in each base substitution
|
|
276
|
+
this.readFeatures.forEach(function (readFeature) {
|
|
277
|
+
if (readFeature.code === 'X') {
|
|
278
|
+
decodeBaseSubstitution(_this, refRegion, compressionScheme, readFeature);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
// if this region completely covers this read,
|
|
283
|
+
// keep a reference to it
|
|
284
|
+
if (!this.readBases &&
|
|
285
|
+
refRegion.start <= this.alignmentStart &&
|
|
286
|
+
refRegion.end >=
|
|
287
|
+
this.alignmentStart + (this.lengthOnRef || this.readLength) - 1) {
|
|
288
|
+
this._refRegion = refRegion;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
CramRecord.prototype.toJSON = function () {
|
|
292
|
+
var _this = this;
|
|
293
|
+
var data = {};
|
|
294
|
+
Object.keys(this).forEach(function (k) {
|
|
295
|
+
if (k.charAt(0) === '_') {
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
data[k] = _this[k];
|
|
334
299
|
});
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
}, {
|
|
344
|
-
key: "toJSON",
|
|
345
|
-
value: function toJSON() {
|
|
346
|
-
var _context2,
|
|
347
|
-
_this2 = this;
|
|
348
|
-
|
|
349
|
-
var data = {};
|
|
350
|
-
(0, _forEach.default)(_context2 = (0, _keys.default)(this)).call(_context2, function (k) {
|
|
351
|
-
if (k.charAt(0) === '_') return;
|
|
352
|
-
data[k] = _this2[k];
|
|
353
|
-
});
|
|
354
|
-
data.readBases = this.getReadBases();
|
|
355
|
-
return data;
|
|
356
|
-
}
|
|
357
|
-
}]);
|
|
358
|
-
return CramRecord;
|
|
359
|
-
}();
|
|
360
|
-
|
|
361
|
-
module.exports = CramRecord;
|
|
300
|
+
data.readBases = this.getReadBases();
|
|
301
|
+
return data;
|
|
302
|
+
};
|
|
303
|
+
return CramRecord;
|
|
304
|
+
}());
|
|
305
|
+
exports.default = CramRecord;
|
|
306
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/cramFile/record.js"],"names":[],"mappings":";;;;;AAAA,0DAAmC;AAEnC,SAAS,kBAAkB,CAAC,UAAU,EAAE,SAAS;IAC/C,0CAA0C;IAC1C,IAAI,CAAC,UAAU,CAAC,WAAW,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE;QACrD,OAAO,SAAS,CAAA;KACjB;IAED,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE;QAC/B,OAAO,SAAS,CAAA;KACjB;IAED,+CAA+C;IAC/C,IAAM,eAAe,GAAG,UAAU,CAAC,cAAc,GAAG,SAAS,CAAC,KAAK,CAAA;IAEnE,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE;QAC5B,OAAO,SAAS,CAAC,GAAG;aACjB,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,WAAW,CAAC;aAC/C,WAAW,EAAE,CAAA;KACjB;IAED,IAAI,KAAK,GAAG,EAAE,CAAA;IACd,IAAI,SAAS,GAAG,eAAe,CAAA;IAC/B,IAAI,kBAAkB,GAAG,CAAC,CAAA;IAC1B,OAAO,KAAK,CAAC,MAAM,GAAG,UAAU,CAAC,UAAU,EAAE;QAC3C,IAAI,kBAAkB,GAAG,UAAU,CAAC,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AAE;YACrB,8CAA8C;YAC9C,wCAAwC;YACxC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,UAAA,WAAW;gBACnC,IAAI,WAAW,CAAC,IAAI,KAAK,GAAG,EAAE;oBAC5B,sBAAsB,CACpB,KAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,WAAW,CACZ,CAAA;iBACF;YACH,CAAC,CAAC,CAAA;SACH;QAED,8CAA8C;QAC9C,yBAAyB;QACzB,IACE,CAAC,IAAI,CAAC,SAAS;YACf,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc;YACtC,SAAS,CAAC,GAAG;gBACX,IAAI,CAAC,cAAc,GAAG,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EACjE;YACA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;SAC5B;IACH,CAAC;IAED,2BAAM,GAAN;QAAA,iBAYC;QAXC,IAAM,IAAI,GAAG,EAAE,CAAA;QACf,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAA,CAAC;YACzB,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;gBACvB,OAAM;aACP;YACD,IAAI,CAAC,CAAC,CAAC,GAAG,KAAI,CAAC,CAAC,CAAC,CAAA;QACnB,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,CAAA;QAEpC,OAAO,IAAI,CAAA;IACb,CAAC;IACH,iBAAC;AAAD,CAAC,AAvMD,IAuMC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export namespace cramFileDefinition {
|
|
2
|
+
const parser: any;
|
|
3
|
+
const maxLength: number;
|
|
4
|
+
}
|
|
5
|
+
export function getSectionParsers(majorVersion: any): {
|
|
6
|
+
cramFileDefinition: {
|
|
7
|
+
parser: any;
|
|
8
|
+
maxLength: number;
|
|
9
|
+
};
|
|
10
|
+
cramBlockHeader: {
|
|
11
|
+
parser: any;
|
|
12
|
+
maxLength: number;
|
|
13
|
+
};
|
|
14
|
+
cramBlockCrc32: {
|
|
15
|
+
parser: any;
|
|
16
|
+
maxLength: number;
|
|
17
|
+
};
|
|
18
|
+
};
|