@jbrowse/plugin-alignments 1.7.9 → 2.0.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/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +192 -207
- package/dist/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -0
- package/dist/AlignmentsFeatureDetail/index.d.ts +28 -3
- package/dist/AlignmentsFeatureDetail/index.js +48 -55
- package/dist/AlignmentsFeatureDetail/index.js.map +1 -0
- package/dist/AlignmentsTrack/index.js +24 -32
- package/dist/AlignmentsTrack/index.js.map +1 -0
- package/dist/BamAdapter/BamAdapter.js +345 -585
- package/dist/BamAdapter/BamAdapter.js.map +1 -0
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +143 -174
- package/dist/BamAdapter/BamSlightlyLazyFeature.js.map +1 -0
- package/dist/BamAdapter/MismatchParser.js +340 -416
- package/dist/BamAdapter/MismatchParser.js.map +1 -0
- package/dist/BamAdapter/configSchema.js +33 -46
- package/dist/BamAdapter/configSchema.js.map +1 -0
- package/dist/BamAdapter/index.js +36 -32
- package/dist/BamAdapter/index.js.map +1 -0
- package/dist/CramAdapter/CramAdapter.js +376 -644
- package/dist/CramAdapter/CramAdapter.js.map +1 -0
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +374 -439
- package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -0
- package/dist/CramAdapter/CramTestAdapters.js +169 -227
- package/dist/CramAdapter/CramTestAdapters.js.map +1 -0
- package/dist/CramAdapter/configSchema.js +28 -38
- package/dist/CramAdapter/configSchema.js.map +1 -0
- package/dist/CramAdapter/index.js +37 -32
- package/dist/CramAdapter/index.js.map +1 -0
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.js +91 -93
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.js.map +1 -0
- package/dist/HtsgetBamAdapter/configSchema.js +19 -29
- package/dist/HtsgetBamAdapter/configSchema.js.map +1 -0
- package/dist/HtsgetBamAdapter/index.js +44 -38
- package/dist/HtsgetBamAdapter/index.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +36 -65
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/index.js +22 -28
- package/dist/LinearAlignmentsDisplay/index.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/models/configSchema.js +12 -23
- package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -0
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +10 -10
- package/dist/LinearAlignmentsDisplay/models/model.js +257 -245
- package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -0
- package/dist/LinearPileupDisplay/components/ColorByModifications.js +98 -116
- package/dist/LinearPileupDisplay/components/ColorByModifications.js.map +1 -0
- package/dist/LinearPileupDisplay/components/ColorByTag.js +82 -91
- package/dist/LinearPileupDisplay/components/ColorByTag.js.map +1 -0
- package/dist/LinearPileupDisplay/components/FilterByTag.js +156 -192
- package/dist/LinearPileupDisplay/components/FilterByTag.js.map +1 -0
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +15 -29
- package/dist/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js.map +1 -0
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js +79 -93
- package/dist/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -0
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js +78 -81
- package/dist/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -0
- package/dist/LinearPileupDisplay/components/SortByTag.js +80 -88
- package/dist/LinearPileupDisplay/components/SortByTag.js.map +1 -0
- package/dist/LinearPileupDisplay/configSchema.js +40 -42
- package/dist/LinearPileupDisplay/configSchema.js.map +1 -0
- package/dist/LinearPileupDisplay/index.js +21 -27
- package/dist/LinearPileupDisplay/index.js.map +1 -0
- package/dist/LinearPileupDisplay/model.d.ts +33 -20
- package/dist/LinearPileupDisplay/model.js +702 -716
- package/dist/LinearPileupDisplay/model.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.d.ts +1 -1
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +105 -57
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/index.js +21 -27
- package/dist/LinearSNPCoverageDisplay/index.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/models/configSchema.js +45 -55
- package/dist/LinearSNPCoverageDisplay/models/configSchema.js.map +1 -0
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +14 -12
- package/dist/LinearSNPCoverageDisplay/models/model.js +257 -230
- package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -0
- package/dist/NestedFrequencyTable.js +104 -139
- package/dist/NestedFrequencyTable.js.map +1 -0
- package/dist/PileupRPC/rpcMethods.js +199 -278
- package/dist/PileupRPC/rpcMethods.js.map +1 -0
- package/dist/PileupRenderer/PileupLayoutSession.js +56 -76
- package/dist/PileupRenderer/PileupLayoutSession.js.map +1 -0
- package/dist/PileupRenderer/PileupRenderer.d.ts +56 -11
- package/dist/PileupRenderer/PileupRenderer.js +942 -1134
- package/dist/PileupRenderer/PileupRenderer.js.map +1 -0
- package/dist/PileupRenderer/components/PileupRendering.d.ts +1 -1
- package/dist/PileupRenderer/components/PileupRendering.js +173 -253
- package/dist/PileupRenderer/components/PileupRendering.js.map +1 -0
- package/dist/PileupRenderer/configSchema.js +65 -71
- package/dist/PileupRenderer/configSchema.js.map +1 -0
- package/dist/PileupRenderer/index.js +17 -22
- package/dist/PileupRenderer/index.js.map +1 -0
- package/dist/PileupRenderer/sortUtil.js +83 -107
- package/dist/PileupRenderer/sortUtil.js.map +1 -0
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +2 -0
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +436 -586
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -0
- package/dist/SNPCoverageAdapter/configSchema.js +10 -20
- package/dist/SNPCoverageAdapter/configSchema.js.map +1 -0
- package/dist/SNPCoverageAdapter/index.js +46 -41
- package/dist/SNPCoverageAdapter/index.js.map +1 -0
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +1 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +265 -290
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -0
- package/dist/SNPCoverageRenderer/configSchema.js +30 -39
- package/dist/SNPCoverageRenderer/configSchema.js.map +1 -0
- package/dist/SNPCoverageRenderer/index.js +19 -30
- package/dist/SNPCoverageRenderer/index.js.map +1 -0
- package/dist/index.js +135 -152
- package/dist/index.js.map +1 -0
- package/dist/shared.js +84 -92
- package/dist/shared.js.map +1 -0
- package/dist/util.js +130 -121
- package/dist/util.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.d.ts +6 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +145 -0
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js.map +1 -0
- package/esm/AlignmentsFeatureDetail/index.d.ts +38 -0
- package/esm/AlignmentsFeatureDetail/index.js +23 -0
- package/esm/AlignmentsFeatureDetail/index.js.map +1 -0
- package/esm/AlignmentsTrack/index.d.ts +2 -0
- package/esm/AlignmentsTrack/index.js +23 -0
- package/esm/AlignmentsTrack/index.js.map +1 -0
- package/esm/BamAdapter/BamAdapter.d.ts +40 -0
- package/esm/BamAdapter/BamAdapter.js +173 -0
- package/esm/BamAdapter/BamAdapter.js.map +1 -0
- package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +33 -0
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +107 -0
- package/esm/BamAdapter/BamSlightlyLazyFeature.js.map +1 -0
- package/esm/BamAdapter/MismatchParser.d.ts +25 -0
- package/esm/BamAdapter/MismatchParser.js +294 -0
- package/esm/BamAdapter/MismatchParser.js.map +1 -0
- package/esm/BamAdapter/configSchema.d.ts +2 -0
- package/esm/BamAdapter/configSchema.js +31 -0
- package/esm/BamAdapter/configSchema.js.map +1 -0
- package/esm/BamAdapter/index.d.ts +3 -0
- package/esm/BamAdapter/index.js +10 -0
- package/esm/BamAdapter/index.js.map +1 -0
- package/esm/CramAdapter/CramAdapter.d.ts +53 -0
- package/esm/CramAdapter/CramAdapter.js +228 -0
- package/esm/CramAdapter/CramAdapter.js.map +1 -0
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +49 -0
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +349 -0
- package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -0
- package/esm/CramAdapter/CramTestAdapters.d.ts +29 -0
- package/esm/CramAdapter/CramTestAdapters.js +70 -0
- package/esm/CramAdapter/CramTestAdapters.js.map +1 -0
- package/esm/CramAdapter/configSchema.d.ts +3 -0
- package/esm/CramAdapter/configSchema.js +26 -0
- package/esm/CramAdapter/configSchema.js.map +1 -0
- package/esm/CramAdapter/index.d.ts +3 -0
- package/esm/CramAdapter/index.js +11 -0
- package/esm/CramAdapter/index.js.map +1 -0
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +9 -0
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.js +27 -0
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.js.map +1 -0
- package/esm/HtsgetBamAdapter/configSchema.d.ts +2 -0
- package/esm/HtsgetBamAdapter/configSchema.js +17 -0
- package/esm/HtsgetBamAdapter/configSchema.js.map +1 -0
- package/esm/HtsgetBamAdapter/index.d.ts +3 -0
- package/esm/HtsgetBamAdapter/index.js +16 -0
- package/esm/HtsgetBamAdapter/index.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +7 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js +34 -0
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/index.d.ts +2 -0
- package/esm/LinearAlignmentsDisplay/index.js +19 -0
- package/esm/LinearAlignmentsDisplay/index.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +4 -0
- package/esm/LinearAlignmentsDisplay/models/configSchema.js +12 -0
- package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -0
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +105 -0
- package/esm/LinearAlignmentsDisplay/models/model.js +181 -0
- package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -0
- package/esm/LinearPileupDisplay/components/ColorByModifications.d.ts +14 -0
- package/esm/LinearPileupDisplay/components/ColorByModifications.js +71 -0
- package/esm/LinearPileupDisplay/components/ColorByModifications.js.map +1 -0
- package/esm/LinearPileupDisplay/components/ColorByTag.d.ts +9 -0
- package/esm/LinearPileupDisplay/components/ColorByTag.js +45 -0
- package/esm/LinearPileupDisplay/components/ColorByTag.js.map +1 -0
- package/esm/LinearPileupDisplay/components/FilterByTag.d.ts +18 -0
- package/esm/LinearPileupDisplay/components/FilterByTag.js +123 -0
- package/esm/LinearPileupDisplay/components/FilterByTag.js.map +1 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.d.ts +13 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js +13 -0
- package/esm/LinearPileupDisplay/components/LinearPileupDisplayBlurb.js.map +1 -0
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.d.ts +16 -0
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js +41 -0
- package/esm/LinearPileupDisplay/components/SetFeatureHeight.js.map +1 -0
- package/esm/LinearPileupDisplay/components/SetMaxHeight.d.ts +10 -0
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js +43 -0
- package/esm/LinearPileupDisplay/components/SetMaxHeight.js.map +1 -0
- package/esm/LinearPileupDisplay/components/SortByTag.d.ts +9 -0
- package/esm/LinearPileupDisplay/components/SortByTag.js +43 -0
- package/esm/LinearPileupDisplay/components/SortByTag.js.map +1 -0
- package/esm/LinearPileupDisplay/configSchema.d.ts +6 -0
- package/esm/LinearPileupDisplay/configSchema.js +41 -0
- package/esm/LinearPileupDisplay/configSchema.js.map +1 -0
- package/esm/LinearPileupDisplay/index.d.ts +2 -0
- package/esm/LinearPileupDisplay/index.js +18 -0
- package/esm/LinearPileupDisplay/index.js.map +1 -0
- package/esm/LinearPileupDisplay/model.d.ts +332 -0
- package/esm/LinearPileupDisplay/model.js +576 -0
- package/esm/LinearPileupDisplay/model.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.d.ts +10 -0
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +57 -0
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/index.d.ts +2 -0
- package/esm/LinearSNPCoverageDisplay/index.js +18 -0
- package/esm/LinearSNPCoverageDisplay/index.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/models/configSchema.d.ts +2 -0
- package/esm/LinearSNPCoverageDisplay/models/configSchema.js +44 -0
- package/esm/LinearSNPCoverageDisplay/models/configSchema.js.map +1 -0
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +348 -0
- package/esm/LinearSNPCoverageDisplay/models/model.js +185 -0
- package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -0
- package/esm/NestedFrequencyTable.d.ts +14 -0
- package/esm/NestedFrequencyTable.js +101 -0
- package/esm/NestedFrequencyTable.js.map +1 -0
- package/esm/PileupRPC/rpcMethods.d.ts +34 -0
- package/esm/PileupRPC/rpcMethods.js +70 -0
- package/esm/PileupRPC/rpcMethods.js.map +1 -0
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +32 -0
- package/esm/PileupRenderer/PileupLayoutSession.js +32 -0
- package/esm/PileupRenderer/PileupLayoutSession.js.map +1 -0
- package/esm/PileupRenderer/PileupRenderer.d.ts +182 -0
- package/esm/PileupRenderer/PileupRenderer.js +830 -0
- package/esm/PileupRenderer/PileupRenderer.js.map +1 -0
- package/esm/PileupRenderer/components/PileupRendering.d.ts +23 -0
- package/esm/PileupRenderer/components/PileupRendering.js +138 -0
- package/esm/PileupRenderer/components/PileupRendering.js.map +1 -0
- package/esm/PileupRenderer/configSchema.d.ts +2 -0
- package/esm/PileupRenderer/configSchema.js +64 -0
- package/esm/PileupRenderer/configSchema.js.map +1 -0
- package/esm/PileupRenderer/index.d.ts +2 -0
- package/esm/PileupRenderer/index.js +12 -0
- package/esm/PileupRenderer/index.js.map +1 -0
- package/esm/PileupRenderer/sortUtil.d.ts +8 -0
- package/esm/PileupRenderer/sortUtil.js +80 -0
- package/esm/PileupRenderer/sortUtil.js.map +1 -0
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.d.ts +67 -0
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +259 -0
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js.map +1 -0
- package/esm/SNPCoverageAdapter/configSchema.d.ts +3 -0
- package/esm/SNPCoverageAdapter/configSchema.js +6 -0
- package/esm/SNPCoverageAdapter/configSchema.js.map +1 -0
- package/esm/SNPCoverageAdapter/index.d.ts +3 -0
- package/esm/SNPCoverageAdapter/index.js +18 -0
- package/esm/SNPCoverageAdapter/index.js.map +1 -0
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +20 -0
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +185 -0
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js.map +1 -0
- package/esm/SNPCoverageRenderer/configSchema.d.ts +2 -0
- package/esm/SNPCoverageRenderer/configSchema.js +29 -0
- package/esm/SNPCoverageRenderer/configSchema.js.map +1 -0
- package/esm/SNPCoverageRenderer/index.d.ts +3 -0
- package/esm/SNPCoverageRenderer/index.js +14 -0
- package/esm/SNPCoverageRenderer/index.js.map +1 -0
- package/esm/index.d.ts +10 -0
- package/esm/index.js +91 -0
- package/esm/index.js.map +1 -0
- package/esm/shared.d.ts +25 -0
- package/esm/shared.js +28 -0
- package/esm/shared.js.map +1 -0
- package/esm/util.d.ts +19 -0
- package/esm/util.js +83 -0
- package/esm/util.js.map +1 -0
- package/package.json +19 -11
- package/src/AlignmentsFeatureDetail/AlignmentsFeatureDetail.tsx +16 -6
- package/src/AlignmentsFeatureDetail/__snapshots__/index.test.js.snap +321 -397
- package/src/AlignmentsFeatureDetail/index.ts +7 -17
- package/src/BamAdapter/MismatchParser.ts +1 -0
- package/src/LinearAlignmentsDisplay/components/AlignmentsDisplay.tsx +3 -3
- package/src/LinearPileupDisplay/components/ColorByModifications.tsx +7 -7
- package/src/LinearPileupDisplay/components/ColorByTag.tsx +5 -5
- package/src/LinearPileupDisplay/components/FilterByTag.tsx +5 -5
- package/src/LinearPileupDisplay/components/LinearPileupDisplayBlurb.tsx +1 -1
- package/src/LinearPileupDisplay/components/SetFeatureHeight.tsx +9 -9
- package/src/LinearPileupDisplay/components/SetMaxHeight.tsx +5 -5
- package/src/LinearPileupDisplay/components/SortByTag.tsx +5 -5
- package/src/LinearPileupDisplay/model.ts +90 -32
- package/src/LinearSNPCoverageDisplay/components/Tooltip.tsx +44 -30
- package/src/LinearSNPCoverageDisplay/models/model.ts +25 -25
- package/src/PileupRenderer/PileupRenderer.tsx +399 -198
- package/src/PileupRenderer/components/PileupRendering.tsx +11 -11
- package/src/SNPCoverageAdapter/SNPCoverageAdapter.ts +5 -0
- package/src/SNPCoverageRenderer/SNPCoverageRenderer.ts +7 -5
- package/dist/AlignmentsFeatureDetail/index.test.js +0 -60
- package/dist/BamAdapter/BamAdapter.test.js +0 -177
- package/dist/BamAdapter/MismatchParser.test.js +0 -251
- package/dist/CramAdapter/CramAdapter.test.js +0 -138
- package/dist/LinearAlignmentsDisplay/models/configSchema.test.js +0 -83
- package/dist/LinearPileupDisplay/configSchema.test.js +0 -92
- package/dist/LinearSNPCoverageDisplay/models/configSchema.test.js +0 -62
- package/dist/PileupRenderer/components/PileupRendering.test.js +0 -36
- package/dist/declare.d.js +0 -1
- package/dist/index.test.js +0 -26
|
@@ -1,452 +1,387 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
|
|
22
|
-
/* eslint-disable no-underscore-dangle */
|
|
23
|
-
var CramSlightlyLazyFeature = /*#__PURE__*/function () {
|
|
24
|
-
// uses parameter properties to automatically create fields on the class
|
|
25
|
-
// https://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
function CramSlightlyLazyFeature(record, _store) {
|
|
28
|
-
(0, _classCallCheck2.default)(this, CramSlightlyLazyFeature);
|
|
29
|
-
this.record = record;
|
|
30
|
-
this._store = _store;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
(0, _createClass2.default)(CramSlightlyLazyFeature, [{
|
|
34
|
-
key: "_get_name",
|
|
35
|
-
value: function _get_name() {
|
|
36
|
-
return this.record.readName;
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
key: "_get_start",
|
|
40
|
-
value: function _get_start() {
|
|
41
|
-
return this.record.alignmentStart - 1;
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
key: "_get_end",
|
|
45
|
-
value: function _get_end() {
|
|
46
|
-
return this.record.alignmentStart + this.record.lengthOnRef - 1;
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "_get_cram_read_features",
|
|
50
|
-
value: function _get_cram_read_features() {
|
|
51
|
-
return this.record.readFeatures;
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
key: "_get_type",
|
|
55
|
-
value: function _get_type() {
|
|
56
|
-
return 'match';
|
|
57
|
-
}
|
|
58
|
-
}, {
|
|
59
|
-
key: "_get_score",
|
|
60
|
-
value: function _get_score() {
|
|
61
|
-
return this.record.mappingQuality;
|
|
62
|
-
}
|
|
63
|
-
}, {
|
|
64
|
-
key: "_get_flags",
|
|
65
|
-
value: function _get_flags() {
|
|
66
|
-
return this.record.flags;
|
|
67
|
-
}
|
|
68
|
-
}, {
|
|
69
|
-
key: "_get_strand",
|
|
70
|
-
value: function _get_strand() {
|
|
71
|
-
return this.record.isReverseComplemented() ? -1 : 1;
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
key: "_read_group_id",
|
|
75
|
-
value: function _read_group_id() {
|
|
76
|
-
var rg = this._store.samHeader.readGroups;
|
|
77
|
-
return rg ? rg[this.record.readGroupId] : undefined;
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "_get_qual",
|
|
81
|
-
value: function _get_qual() {
|
|
82
|
-
return (this.record.qualityScores || []).join(' ');
|
|
83
|
-
}
|
|
84
|
-
}, {
|
|
85
|
-
key: "qualRaw",
|
|
86
|
-
value: function qualRaw() {
|
|
87
|
-
return this.record.qualityScores;
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
key: "_get_seq_id",
|
|
91
|
-
value: function _get_seq_id() {
|
|
92
|
-
return this._store.refIdToName(this.record.sequenceId);
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
key: "_get_refName",
|
|
96
|
-
value: function _get_refName() {
|
|
97
|
-
return this._get_seq_id();
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: "_get_is_paired",
|
|
101
|
-
value: function _get_is_paired() {
|
|
102
|
-
return !!this.record.mate;
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: "_get_pair_orientation",
|
|
106
|
-
value: function _get_pair_orientation() {
|
|
107
|
-
return this.record.isPaired() ? this.record.getPairOrientation() : undefined;
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "_get_template_length",
|
|
111
|
-
value: function _get_template_length() {
|
|
112
|
-
return this.record.templateLength || this.record.templateSize;
|
|
113
|
-
}
|
|
114
|
-
}, {
|
|
115
|
-
key: "_get_next_seq_id",
|
|
116
|
-
value: function _get_next_seq_id() {
|
|
117
|
-
return this.record.mate ? this._store.refIdToName(this.record.mate.sequenceId) : undefined;
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
+
if (!m) return o;
|
|
16
|
+
var i = m.call(o), r, ar = [], e;
|
|
17
|
+
try {
|
|
18
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
118
19
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
20
|
+
catch (error) { e = { error: error }; }
|
|
21
|
+
finally {
|
|
22
|
+
try {
|
|
23
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
+
}
|
|
25
|
+
finally { if (e) throw e.error; }
|
|
123
26
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
30
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
31
|
+
if (ar || !(i in from)) {
|
|
32
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
33
|
+
ar[i] = from[i];
|
|
34
|
+
}
|
|
128
35
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
36
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var CramSlightlyLazyFeature = /** @class */ (function () {
|
|
40
|
+
// uses parameter properties to automatically create fields on the class
|
|
41
|
+
// https://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
function CramSlightlyLazyFeature(record, _store) {
|
|
44
|
+
this.record = record;
|
|
45
|
+
this._store = _store;
|
|
139
46
|
}
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
47
|
+
CramSlightlyLazyFeature.prototype._get_name = function () {
|
|
48
|
+
return this.record.readName;
|
|
49
|
+
};
|
|
50
|
+
CramSlightlyLazyFeature.prototype._get_start = function () {
|
|
51
|
+
return this.record.alignmentStart - 1;
|
|
52
|
+
};
|
|
53
|
+
CramSlightlyLazyFeature.prototype._get_end = function () {
|
|
54
|
+
return this.record.alignmentStart + this.record.lengthOnRef - 1;
|
|
55
|
+
};
|
|
56
|
+
CramSlightlyLazyFeature.prototype._get_cram_read_features = function () {
|
|
57
|
+
return this.record.readFeatures;
|
|
58
|
+
};
|
|
59
|
+
CramSlightlyLazyFeature.prototype._get_type = function () {
|
|
60
|
+
return 'match';
|
|
61
|
+
};
|
|
62
|
+
CramSlightlyLazyFeature.prototype._get_score = function () {
|
|
63
|
+
return this.record.mappingQuality;
|
|
64
|
+
};
|
|
65
|
+
CramSlightlyLazyFeature.prototype._get_flags = function () {
|
|
66
|
+
return this.record.flags;
|
|
67
|
+
};
|
|
68
|
+
CramSlightlyLazyFeature.prototype._get_strand = function () {
|
|
69
|
+
return this.record.isReverseComplemented() ? -1 : 1;
|
|
70
|
+
};
|
|
71
|
+
CramSlightlyLazyFeature.prototype._read_group_id = function () {
|
|
72
|
+
var rg = this._store.samHeader.readGroups;
|
|
73
|
+
return rg ? rg[this.record.readGroupId] : undefined;
|
|
74
|
+
};
|
|
75
|
+
CramSlightlyLazyFeature.prototype._get_qual = function () {
|
|
76
|
+
return (this.record.qualityScores || []).join(' ');
|
|
77
|
+
};
|
|
78
|
+
CramSlightlyLazyFeature.prototype.qualRaw = function () {
|
|
79
|
+
return this.record.qualityScores;
|
|
80
|
+
};
|
|
81
|
+
CramSlightlyLazyFeature.prototype._get_seq_id = function () {
|
|
82
|
+
return this._store.refIdToName(this.record.sequenceId);
|
|
83
|
+
};
|
|
84
|
+
CramSlightlyLazyFeature.prototype._get_refName = function () {
|
|
85
|
+
return this._get_seq_id();
|
|
86
|
+
};
|
|
87
|
+
CramSlightlyLazyFeature.prototype._get_is_paired = function () {
|
|
88
|
+
return !!this.record.mate;
|
|
89
|
+
};
|
|
90
|
+
CramSlightlyLazyFeature.prototype._get_pair_orientation = function () {
|
|
91
|
+
return this.record.isPaired() ? this.record.getPairOrientation() : undefined;
|
|
92
|
+
};
|
|
93
|
+
CramSlightlyLazyFeature.prototype._get_template_length = function () {
|
|
94
|
+
return this.record.templateLength || this.record.templateSize;
|
|
95
|
+
};
|
|
96
|
+
CramSlightlyLazyFeature.prototype._get_next_seq_id = function () {
|
|
97
|
+
return this.record.mate
|
|
98
|
+
? this._store.refIdToName(this.record.mate.sequenceId)
|
|
99
|
+
: undefined;
|
|
100
|
+
};
|
|
101
|
+
CramSlightlyLazyFeature.prototype._get_next_pos = function () {
|
|
102
|
+
return this.record.mate ? this.record.mate.alignmentStart : undefined;
|
|
103
|
+
};
|
|
104
|
+
CramSlightlyLazyFeature.prototype._get_next_segment_position = function () {
|
|
105
|
+
return this.record.mate
|
|
106
|
+
? "".concat(this._store.refIdToName(this.record.mate.sequenceId), ":").concat(this.record.mate.alignmentStart)
|
|
107
|
+
: undefined;
|
|
108
|
+
};
|
|
109
|
+
CramSlightlyLazyFeature.prototype._get_tags = function () {
|
|
110
|
+
var RG = this._read_group_id();
|
|
111
|
+
var tags = this.record.tags;
|
|
112
|
+
// avoids a tag copy if no RG, but just copy if there is one
|
|
113
|
+
return RG !== undefined ? __assign(__assign({}, tags), { RG: RG }) : tags;
|
|
114
|
+
};
|
|
115
|
+
CramSlightlyLazyFeature.prototype._get_seq = function () {
|
|
116
|
+
return this.record.getReadBases();
|
|
117
|
+
};
|
|
118
|
+
// generate a CIGAR, based on code from jkbonfield
|
|
119
|
+
CramSlightlyLazyFeature.prototype._get_CIGAR = function () {
|
|
120
|
+
var seq = '';
|
|
121
|
+
var cigar = '';
|
|
122
|
+
var op = 'M';
|
|
123
|
+
var oplen = 0;
|
|
124
|
+
// not sure I should access these, but...
|
|
125
|
+
var ref = this.record._refRegion.seq;
|
|
126
|
+
var refStart = this.record._refRegion.start;
|
|
127
|
+
var last_pos = this.record.alignmentStart;
|
|
128
|
+
var sublen = 0;
|
|
129
|
+
if (typeof this.record.readFeatures !== 'undefined') {
|
|
130
|
+
// @ts-ignore
|
|
131
|
+
for (var i = 0; i < this.record.readFeatures.length; i++) {
|
|
132
|
+
var _a = this.record.readFeatures[i], code = _a.code, refPos = _a.refPos, sub = _a.sub, data = _a.data;
|
|
133
|
+
sublen = refPos - last_pos;
|
|
134
|
+
seq += ref.substring(last_pos - refStart, refPos - refStart);
|
|
135
|
+
last_pos = refPos;
|
|
136
|
+
if (oplen && op !== 'M') {
|
|
137
|
+
cigar += oplen + op;
|
|
138
|
+
oplen = 0;
|
|
139
|
+
}
|
|
140
|
+
if (sublen) {
|
|
141
|
+
op = 'M';
|
|
142
|
+
oplen += sublen;
|
|
143
|
+
}
|
|
144
|
+
if (code === 'b') {
|
|
145
|
+
// An array of bases stored verbatim
|
|
146
|
+
var ret = data.split(',');
|
|
147
|
+
var added = String.fromCharCode.apply(String, __spreadArray([], __read(ret), false));
|
|
148
|
+
seq += added;
|
|
149
|
+
last_pos += added.length;
|
|
150
|
+
oplen += added.length;
|
|
151
|
+
}
|
|
152
|
+
else if (code === 'B') {
|
|
153
|
+
// Single base (+ qual score)
|
|
154
|
+
seq += sub;
|
|
155
|
+
last_pos++;
|
|
156
|
+
oplen++;
|
|
157
|
+
}
|
|
158
|
+
else if (code === 'X') {
|
|
159
|
+
// Substitution
|
|
160
|
+
seq += sub;
|
|
161
|
+
last_pos++;
|
|
162
|
+
oplen++;
|
|
163
|
+
}
|
|
164
|
+
else if (code === 'D' || code === 'N') {
|
|
165
|
+
// Deletion or Ref Skip
|
|
166
|
+
last_pos += data;
|
|
167
|
+
if (oplen) {
|
|
168
|
+
cigar += oplen + op;
|
|
169
|
+
}
|
|
170
|
+
cigar += data + code;
|
|
171
|
+
oplen = 0;
|
|
172
|
+
}
|
|
173
|
+
else if (code === 'I' || code === 'S') {
|
|
174
|
+
// Insertion or soft-clip
|
|
175
|
+
seq += data;
|
|
176
|
+
if (oplen) {
|
|
177
|
+
cigar += oplen + op;
|
|
178
|
+
}
|
|
179
|
+
cigar += data.length + code;
|
|
180
|
+
oplen = 0;
|
|
181
|
+
}
|
|
182
|
+
else if (code === 'i') {
|
|
183
|
+
// Single base insertion
|
|
184
|
+
seq += data;
|
|
185
|
+
if (oplen) {
|
|
186
|
+
cigar += oplen + op;
|
|
187
|
+
}
|
|
188
|
+
cigar += "".concat(1, "I");
|
|
189
|
+
oplen = 0;
|
|
190
|
+
}
|
|
191
|
+
else if (code === 'P') {
|
|
192
|
+
// Padding
|
|
193
|
+
if (oplen) {
|
|
194
|
+
cigar += oplen + op;
|
|
195
|
+
}
|
|
196
|
+
cigar += "".concat(data, "P");
|
|
197
|
+
}
|
|
198
|
+
else if (code === 'H') {
|
|
199
|
+
// Hard clip
|
|
200
|
+
if (oplen) {
|
|
201
|
+
cigar += oplen + op;
|
|
202
|
+
}
|
|
203
|
+
cigar += "".concat(data, "H");
|
|
204
|
+
oplen = 0;
|
|
205
|
+
} // else q or Q
|
|
224
206
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
} else if (code === 'H') {
|
|
236
|
-
// Hard clip
|
|
237
|
-
if (oplen) {
|
|
238
|
-
cigar += oplen + op;
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
sublen = this.record.readLength - seq.length;
|
|
210
|
+
}
|
|
211
|
+
if (seq.length !== this.record.readLength) {
|
|
212
|
+
sublen = this.record.readLength - seq.length;
|
|
213
|
+
seq += ref.substring(last_pos - refStart, last_pos - refStart + sublen);
|
|
214
|
+
if (oplen && op !== 'M') {
|
|
215
|
+
cigar += oplen + op;
|
|
216
|
+
oplen = 0;
|
|
239
217
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
oplen = 0;
|
|
243
|
-
} // else q or Q
|
|
244
|
-
|
|
218
|
+
op = 'M';
|
|
219
|
+
oplen += sublen;
|
|
245
220
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (seq.length !== this.record.readLength) {
|
|
251
|
-
sublen = this.record.readLength - seq.length;
|
|
252
|
-
seq += ref.substring(last_pos - refStart, last_pos - refStart + sublen);
|
|
253
|
-
|
|
254
|
-
if (oplen && op !== 'M') {
|
|
255
|
-
cigar += oplen + op;
|
|
256
|
-
oplen = 0;
|
|
221
|
+
if (oplen) {
|
|
222
|
+
cigar += oplen + op;
|
|
257
223
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}).map(function (methodName) {
|
|
276
|
-
return methodName.replace('_get_', '');
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
}, {
|
|
280
|
-
key: "id",
|
|
281
|
-
value: function id() {
|
|
282
|
-
return "".concat(this._store.id, "-").concat(this.record.uniqueId);
|
|
283
|
-
}
|
|
284
|
-
}, {
|
|
285
|
-
key: "get",
|
|
286
|
-
value: function get(field) {
|
|
287
|
-
var methodName = "_get_".concat(field); // @ts-ignore
|
|
288
|
-
|
|
289
|
-
if (this[methodName]) {
|
|
224
|
+
return cigar;
|
|
225
|
+
};
|
|
226
|
+
CramSlightlyLazyFeature.prototype.tags = function () {
|
|
227
|
+
var properties = Object.getOwnPropertyNames(CramSlightlyLazyFeature.prototype);
|
|
228
|
+
return properties
|
|
229
|
+
.filter(function (prop) {
|
|
230
|
+
return prop.startsWith('_get_') &&
|
|
231
|
+
prop !== '_get_mismatches' &&
|
|
232
|
+
prop !== '_get_cram_read_features';
|
|
233
|
+
})
|
|
234
|
+
.map(function (methodName) { return methodName.replace('_get_', ''); });
|
|
235
|
+
};
|
|
236
|
+
CramSlightlyLazyFeature.prototype.id = function () {
|
|
237
|
+
return "".concat(this._store.id, "-").concat(this.record.uniqueId);
|
|
238
|
+
};
|
|
239
|
+
CramSlightlyLazyFeature.prototype.get = function (field) {
|
|
240
|
+
var methodName = "_get_".concat(field);
|
|
290
241
|
// @ts-ignore
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return undefined;
|
|
295
|
-
}
|
|
296
|
-
}, {
|
|
297
|
-
key: "parent",
|
|
298
|
-
value: function parent() {
|
|
299
|
-
return undefined;
|
|
300
|
-
}
|
|
301
|
-
}, {
|
|
302
|
-
key: "children",
|
|
303
|
-
value: function children() {
|
|
304
|
-
return undefined;
|
|
305
|
-
}
|
|
306
|
-
}, {
|
|
307
|
-
key: "set",
|
|
308
|
-
value: function set() {}
|
|
309
|
-
}, {
|
|
310
|
-
key: "pairedFeature",
|
|
311
|
-
value: function pairedFeature() {
|
|
312
|
-
return false;
|
|
313
|
-
}
|
|
314
|
-
}, {
|
|
315
|
-
key: "_get_clipPos",
|
|
316
|
-
value: function _get_clipPos() {
|
|
317
|
-
var mismatches = this.get('mismatches');
|
|
318
|
-
|
|
319
|
-
if (mismatches.length) {
|
|
320
|
-
var _record = this.get('strand') === -1 ? mismatches[mismatches.length - 1] : mismatches[0];
|
|
321
|
-
|
|
322
|
-
var type = _record.type,
|
|
323
|
-
cliplen = _record.cliplen;
|
|
324
|
-
|
|
325
|
-
if (type === 'softclip' || type === 'hardclip') {
|
|
326
|
-
return cliplen;
|
|
242
|
+
if (this[methodName]) {
|
|
243
|
+
// @ts-ignore
|
|
244
|
+
return this[methodName]();
|
|
327
245
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
if (
|
|
343
|
-
|
|
246
|
+
return undefined;
|
|
247
|
+
};
|
|
248
|
+
CramSlightlyLazyFeature.prototype.parent = function () {
|
|
249
|
+
return undefined;
|
|
250
|
+
};
|
|
251
|
+
CramSlightlyLazyFeature.prototype.children = function () {
|
|
252
|
+
return undefined;
|
|
253
|
+
};
|
|
254
|
+
CramSlightlyLazyFeature.prototype.set = function () { };
|
|
255
|
+
CramSlightlyLazyFeature.prototype.pairedFeature = function () {
|
|
256
|
+
return false;
|
|
257
|
+
};
|
|
258
|
+
CramSlightlyLazyFeature.prototype._get_clipPos = function () {
|
|
259
|
+
var mismatches = this.get('mismatches');
|
|
260
|
+
if (mismatches.length) {
|
|
261
|
+
var record = this.get('strand') === -1
|
|
262
|
+
? mismatches[mismatches.length - 1]
|
|
263
|
+
: mismatches[0];
|
|
264
|
+
var type = record.type, cliplen = record.cliplen;
|
|
265
|
+
if (type === 'softclip' || type === 'hardclip') {
|
|
266
|
+
return cliplen;
|
|
267
|
+
}
|
|
344
268
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
var j = 0;
|
|
365
|
-
|
|
366
|
-
for (var i = 0; i < readFeatures.length; i++) {
|
|
367
|
-
var f = readFeatures[i];
|
|
368
|
-
var code = f.code,
|
|
369
|
-
pos = f.pos,
|
|
370
|
-
data = f.data,
|
|
371
|
-
sub = f.sub,
|
|
372
|
-
ref = f.ref;
|
|
373
|
-
var refPos = f.refPos - 1 - start;
|
|
374
|
-
|
|
375
|
-
if (code === 'X') {
|
|
376
|
-
// substitution
|
|
377
|
-
mismatches[j++] = {
|
|
378
|
-
start: refPos,
|
|
379
|
-
length: 1,
|
|
380
|
-
base: sub,
|
|
381
|
-
qual: qual === null || qual === void 0 ? void 0 : qual[pos],
|
|
382
|
-
altbase: ref,
|
|
383
|
-
type: 'mismatch'
|
|
384
|
-
};
|
|
385
|
-
} else if (code === 'I') {
|
|
386
|
-
// insertion
|
|
387
|
-
mismatches[j++] = {
|
|
388
|
-
start: refPos,
|
|
389
|
-
type: 'insertion',
|
|
390
|
-
base: "".concat(data.length),
|
|
391
|
-
length: 0
|
|
392
|
-
};
|
|
393
|
-
} else if (code === 'N') {
|
|
394
|
-
// reference skip
|
|
395
|
-
mismatches[j++] = {
|
|
396
|
-
type: 'skip',
|
|
397
|
-
length: data,
|
|
398
|
-
start: refPos,
|
|
399
|
-
base: 'N'
|
|
400
|
-
};
|
|
401
|
-
} else if (code === 'S') {
|
|
402
|
-
// soft clip
|
|
403
|
-
var len = data.length;
|
|
404
|
-
mismatches[j++] = {
|
|
405
|
-
start: refPos,
|
|
406
|
-
type: 'softclip',
|
|
407
|
-
base: "S".concat(len),
|
|
408
|
-
cliplen: len,
|
|
409
|
-
length: 1
|
|
410
|
-
};
|
|
411
|
-
} else if (code === 'P') {// padding
|
|
412
|
-
} else if (code === 'H') {
|
|
413
|
-
// hard clip
|
|
414
|
-
var _len = data;
|
|
415
|
-
mismatches[j++] = {
|
|
416
|
-
start: refPos,
|
|
417
|
-
type: 'hardclip',
|
|
418
|
-
base: "H".concat(_len),
|
|
419
|
-
cliplen: _len,
|
|
420
|
-
length: 1
|
|
421
|
-
};
|
|
422
|
-
} else if (code === 'D') {
|
|
423
|
-
// deletion
|
|
424
|
-
mismatches[j++] = {
|
|
425
|
-
type: 'deletion',
|
|
426
|
-
length: data,
|
|
427
|
-
start: refPos,
|
|
428
|
-
base: '*'
|
|
429
|
-
};
|
|
430
|
-
} else if (code === 'b') {// stretch of bases
|
|
431
|
-
} else if (code === 'q') {// stretch of qual scores
|
|
432
|
-
} else if (code === 'B') {// a pair of [base, qual]
|
|
433
|
-
} else if (code === 'i') {
|
|
434
|
-
// single-base insertion
|
|
435
|
-
// insertion
|
|
436
|
-
mismatches[j++] = {
|
|
437
|
-
start: refPos,
|
|
438
|
-
type: 'insertion',
|
|
439
|
-
base: data,
|
|
440
|
-
length: 1
|
|
441
|
-
};
|
|
442
|
-
} else if (code === 'Q') {// single quality value
|
|
269
|
+
return 0;
|
|
270
|
+
};
|
|
271
|
+
CramSlightlyLazyFeature.prototype.toJSON = function () {
|
|
272
|
+
var _this = this;
|
|
273
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
274
|
+
var tags = {};
|
|
275
|
+
this.tags().forEach(function (t) {
|
|
276
|
+
var val = _this.get(t);
|
|
277
|
+
if (val !== undefined) {
|
|
278
|
+
tags[t] = val;
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
return __assign(__assign({}, tags), { name: this.get('name'), type: this.get('type'), uniqueId: this.id() });
|
|
282
|
+
};
|
|
283
|
+
CramSlightlyLazyFeature.prototype._get_mismatches = function () {
|
|
284
|
+
var readFeatures = this.get('cram_read_features');
|
|
285
|
+
var qual = this.qualRaw();
|
|
286
|
+
if (!readFeatures) {
|
|
287
|
+
return [];
|
|
443
288
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
289
|
+
var start = this.get('start');
|
|
290
|
+
var mismatches = new Array(readFeatures.length);
|
|
291
|
+
var j = 0;
|
|
292
|
+
for (var i = 0; i < readFeatures.length; i++) {
|
|
293
|
+
var f = readFeatures[i];
|
|
294
|
+
var code = f.code, pos = f.pos, data = f.data, sub = f.sub, ref = f.ref;
|
|
295
|
+
var refPos = f.refPos - 1 - start;
|
|
296
|
+
if (code === 'X') {
|
|
297
|
+
// substitution
|
|
298
|
+
mismatches[j++] = {
|
|
299
|
+
start: refPos,
|
|
300
|
+
length: 1,
|
|
301
|
+
base: sub,
|
|
302
|
+
qual: qual === null || qual === void 0 ? void 0 : qual[pos],
|
|
303
|
+
altbase: ref,
|
|
304
|
+
type: 'mismatch',
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
else if (code === 'I') {
|
|
308
|
+
// insertion
|
|
309
|
+
mismatches[j++] = {
|
|
310
|
+
start: refPos,
|
|
311
|
+
type: 'insertion',
|
|
312
|
+
base: "".concat(data.length),
|
|
313
|
+
length: 0,
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
else if (code === 'N') {
|
|
317
|
+
// reference skip
|
|
318
|
+
mismatches[j++] = {
|
|
319
|
+
type: 'skip',
|
|
320
|
+
length: data,
|
|
321
|
+
start: refPos,
|
|
322
|
+
base: 'N',
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
else if (code === 'S') {
|
|
326
|
+
// soft clip
|
|
327
|
+
var len = data.length;
|
|
328
|
+
mismatches[j++] = {
|
|
329
|
+
start: refPos,
|
|
330
|
+
type: 'softclip',
|
|
331
|
+
base: "S".concat(len),
|
|
332
|
+
cliplen: len,
|
|
333
|
+
length: 1,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
else if (code === 'P') {
|
|
337
|
+
// padding
|
|
338
|
+
}
|
|
339
|
+
else if (code === 'H') {
|
|
340
|
+
// hard clip
|
|
341
|
+
var len = data;
|
|
342
|
+
mismatches[j++] = {
|
|
343
|
+
start: refPos,
|
|
344
|
+
type: 'hardclip',
|
|
345
|
+
base: "H".concat(len),
|
|
346
|
+
cliplen: len,
|
|
347
|
+
length: 1,
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
else if (code === 'D') {
|
|
351
|
+
// deletion
|
|
352
|
+
mismatches[j++] = {
|
|
353
|
+
type: 'deletion',
|
|
354
|
+
length: data,
|
|
355
|
+
start: refPos,
|
|
356
|
+
base: '*',
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
else if (code === 'b') {
|
|
360
|
+
// stretch of bases
|
|
361
|
+
}
|
|
362
|
+
else if (code === 'q') {
|
|
363
|
+
// stretch of qual scores
|
|
364
|
+
}
|
|
365
|
+
else if (code === 'B') {
|
|
366
|
+
// a pair of [base, qual]
|
|
367
|
+
}
|
|
368
|
+
else if (code === 'i') {
|
|
369
|
+
// single-base insertion
|
|
370
|
+
// insertion
|
|
371
|
+
mismatches[j++] = {
|
|
372
|
+
start: refPos,
|
|
373
|
+
type: 'insertion',
|
|
374
|
+
base: data,
|
|
375
|
+
length: 1,
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
else if (code === 'Q') {
|
|
379
|
+
// single quality value
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return mismatches.slice(0, j);
|
|
383
|
+
};
|
|
384
|
+
return CramSlightlyLazyFeature;
|
|
385
|
+
}());
|
|
386
|
+
exports.default = CramSlightlyLazyFeature;
|
|
387
|
+
//# sourceMappingURL=CramSlightlyLazyFeature.js.map
|