@jbrowse/plugin-alignments 2.16.0 → 2.17.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 +2 -3
- package/dist/AlignmentsFeatureDetail/Flags.js +2 -2
- package/dist/AlignmentsFeatureDetail/LinkedPairedAlignments.js +2 -2
- package/dist/AlignmentsFeatureDetail/SupplementaryAlignments.js +2 -2
- package/dist/AlignmentsFeatureDetail/getSAFeatures.js +2 -2
- package/dist/AlignmentsFeatureDetail/stateModelFactory.d.ts +1 -1
- package/dist/BamAdapter/BamAdapter.d.ts +3 -2
- package/dist/BamAdapter/BamAdapter.js +34 -11
- package/dist/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -17
- package/dist/BamAdapter/BamSlightlyLazyFeature.js +42 -72
- package/dist/CramAdapter/CramAdapter.d.ts +4 -3
- package/dist/CramAdapter/CramAdapter.js +24 -7
- package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +21 -27
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +74 -73
- package/dist/CramAdapter/util.d.ts +1 -10
- package/dist/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
- package/dist/LinearAlignmentsDisplay/index.js +2 -2
- package/dist/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +6 -3
- package/dist/LinearAlignmentsDisplay/{models/model.js → model.js} +11 -7
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +6 -27
- package/dist/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +43 -21
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
- package/dist/LinearPileupDisplay/components/ColorByTagDialog.js +3 -1
- package/dist/LinearPileupDisplay/components/GroupByDialog.js +8 -6
- package/dist/LinearPileupDisplay/components/SortByTagDialog.js +6 -4
- package/dist/LinearPileupDisplay/model.d.ts +41 -45
- package/dist/LinearPileupDisplay/model.js +118 -41
- package/dist/LinearReadArcsDisplay/components/ReactComponent.js +1 -1
- package/dist/LinearReadArcsDisplay/model.d.ts +22 -21
- package/dist/LinearReadArcsDisplay/model.js +13 -14
- package/dist/LinearReadCloudDisplay/components/ReactComponent.js +1 -1
- package/dist/LinearReadCloudDisplay/model.d.ts +14 -22
- package/dist/LinearReadCloudDisplay/model.js +12 -13
- package/dist/LinearSNPCoverageDisplay/components/Tooltip.js +49 -19
- package/dist/LinearSNPCoverageDisplay/index.js +3 -2
- package/dist/LinearSNPCoverageDisplay/{models/model.d.ts → model.d.ts} +3 -13
- package/dist/LinearSNPCoverageDisplay/{models/model.js → model.js} +71 -45
- package/dist/MismatchParser/cigarToMismatches.d.ts +3 -0
- package/dist/MismatchParser/cigarToMismatches.js +94 -0
- package/dist/MismatchParser/getNextRefPos.d.ts +4 -0
- package/dist/MismatchParser/getNextRefPos.js +40 -0
- package/dist/MismatchParser/index.d.ts +4 -29
- package/dist/MismatchParser/index.js +10 -321
- package/dist/MismatchParser/mdToMismatches.d.ts +3 -0
- package/dist/MismatchParser/mdToMismatches.js +80 -0
- package/dist/ModificationParser/index.d.ts +19 -0
- package/dist/ModificationParser/index.js +144 -0
- package/dist/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
- package/dist/PileupRPC/methods/GetReducedFeatures.d.ts +1 -1
- package/dist/PileupRPC/methods/GetReducedFeatures.js +19 -16
- package/dist/PileupRPC/methods/GetVisibleModifications.d.ts +2 -1
- package/dist/PileupRPC/methods/GetVisibleModifications.js +9 -6
- package/dist/PileupRenderer/PileupLayoutSession.d.ts +8 -7
- package/dist/PileupRenderer/PileupRenderer.d.ts +6 -14
- package/dist/PileupRenderer/PileupRenderer.js +7 -5
- package/dist/PileupRenderer/renderAlignment.js +17 -4
- package/dist/PileupRenderer/renderAlignmentShape.js +102 -21
- package/dist/PileupRenderer/renderMethylation.d.ts +2 -1
- package/dist/PileupRenderer/renderMethylation.js +17 -9
- package/dist/PileupRenderer/renderMismatches.js +19 -19
- package/dist/PileupRenderer/renderModifications.d.ts +3 -2
- package/dist/PileupRenderer/renderModifications.js +31 -34
- package/dist/PileupRenderer/renderPerBaseLettering.d.ts +2 -1
- package/dist/PileupRenderer/renderPerBaseLettering.js +1 -3
- package/dist/PileupRenderer/renderPerBaseQuality.d.ts +2 -1
- package/dist/PileupRenderer/renderPerBaseQuality.js +1 -3
- package/dist/PileupRenderer/renderSoftClipping.js +6 -6
- package/dist/PileupRenderer/sortUtil.d.ts +2 -7
- package/dist/PileupRenderer/sortUtil.js +13 -13
- package/dist/SNPCoverageAdapter/SNPCoverageAdapter.js +10 -5
- package/dist/SNPCoverageAdapter/generateCoverageBins.d.ts +13 -9
- package/dist/SNPCoverageAdapter/generateCoverageBins.js +269 -166
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -1
- package/dist/SNPCoverageRenderer/SNPCoverageRenderer.js +171 -54
- package/dist/shared/color.d.ts +0 -10
- package/dist/shared/color.js +1 -7
- package/{esm/shared → dist/shared/components}/BaseDisplayComponent.d.ts +2 -2
- package/{esm/shared → dist/shared/components}/FilterByTagDialog.d.ts +3 -3
- package/dist/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +5 -1
- package/dist/shared/fetchChains.js +1 -2
- package/dist/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
- package/dist/shared/getMaximumModificationAtEachPosition.js +42 -0
- package/dist/shared/getUniqueModifications.d.ts +14 -0
- package/dist/shared/getUniqueModifications.js +16 -0
- package/dist/shared/getUniqueTags.d.ts +15 -0
- package/dist/shared/getUniqueTags.js +18 -0
- package/dist/shared/types.d.ts +94 -0
- package/dist/shared/util.d.ts +8 -0
- package/dist/shared/util.js +26 -0
- package/dist/util.d.ts +7 -4
- package/dist/util.js +30 -30
- package/esm/AlignmentsFeatureDetail/AlignmentsFeatureDetail.js +2 -3
- package/esm/AlignmentsFeatureDetail/Flags.js +1 -1
- package/esm/AlignmentsFeatureDetail/LinkedPairedAlignments.js +1 -1
- package/esm/AlignmentsFeatureDetail/SupplementaryAlignments.js +1 -1
- package/esm/AlignmentsFeatureDetail/getSAFeatures.js +2 -2
- package/esm/AlignmentsFeatureDetail/stateModelFactory.d.ts +1 -1
- package/esm/BamAdapter/BamAdapter.d.ts +3 -2
- package/esm/BamAdapter/BamAdapter.js +31 -8
- package/esm/BamAdapter/BamSlightlyLazyFeature.d.ts +3 -17
- package/esm/BamAdapter/BamSlightlyLazyFeature.js +43 -73
- package/esm/CramAdapter/CramAdapter.d.ts +4 -3
- package/esm/CramAdapter/CramAdapter.js +22 -5
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +21 -27
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +74 -73
- package/esm/CramAdapter/util.d.ts +1 -10
- package/esm/LinearAlignmentsDisplay/components/AlignmentsDisplay.d.ts +1 -1
- package/esm/LinearAlignmentsDisplay/index.js +2 -2
- package/esm/LinearAlignmentsDisplay/{models/model.d.ts → model.d.ts} +6 -3
- package/esm/LinearAlignmentsDisplay/{models/model.js → model.js} +11 -7
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.d.ts +6 -27
- package/esm/LinearPileupDisplay/SharedLinearPileupDisplayMixin.js +45 -23
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.d.ts +5 -4
- package/esm/LinearPileupDisplay/components/ColorByTagDialog.js +3 -1
- package/esm/LinearPileupDisplay/components/GroupByDialog.js +8 -6
- package/esm/LinearPileupDisplay/components/SortByTagDialog.js +6 -4
- package/esm/LinearPileupDisplay/model.d.ts +41 -45
- package/esm/LinearPileupDisplay/model.js +119 -42
- package/esm/LinearReadArcsDisplay/components/ReactComponent.js +1 -1
- package/esm/LinearReadArcsDisplay/model.d.ts +22 -21
- package/esm/LinearReadArcsDisplay/model.js +14 -15
- package/esm/LinearReadCloudDisplay/components/ReactComponent.js +1 -1
- package/esm/LinearReadCloudDisplay/model.d.ts +14 -22
- package/esm/LinearReadCloudDisplay/model.js +13 -14
- package/esm/LinearSNPCoverageDisplay/components/Tooltip.js +49 -19
- package/esm/LinearSNPCoverageDisplay/index.js +3 -2
- package/esm/LinearSNPCoverageDisplay/{models/model.d.ts → model.d.ts} +3 -13
- package/esm/LinearSNPCoverageDisplay/{models/model.js → model.js} +72 -46
- package/esm/MismatchParser/cigarToMismatches.d.ts +3 -0
- package/esm/MismatchParser/cigarToMismatches.js +91 -0
- package/esm/MismatchParser/getNextRefPos.d.ts +4 -0
- package/esm/MismatchParser/getNextRefPos.js +37 -0
- package/esm/MismatchParser/index.d.ts +4 -29
- package/esm/MismatchParser/index.js +5 -311
- package/esm/MismatchParser/mdToMismatches.d.ts +3 -0
- package/esm/MismatchParser/mdToMismatches.js +77 -0
- package/esm/ModificationParser/index.d.ts +19 -0
- package/esm/ModificationParser/index.js +138 -0
- package/esm/PileupRPC/methods/GetGlobalValueForTag.js +1 -2
- package/esm/PileupRPC/methods/GetReducedFeatures.d.ts +1 -1
- package/esm/PileupRPC/methods/GetReducedFeatures.js +19 -16
- package/esm/PileupRPC/methods/GetVisibleModifications.d.ts +2 -1
- package/esm/PileupRPC/methods/GetVisibleModifications.js +9 -6
- package/esm/PileupRenderer/PileupLayoutSession.d.ts +8 -7
- package/esm/PileupRenderer/PileupRenderer.d.ts +6 -14
- package/esm/PileupRenderer/PileupRenderer.js +8 -6
- package/esm/PileupRenderer/renderAlignment.js +17 -4
- package/esm/PileupRenderer/renderAlignmentShape.js +102 -21
- package/esm/PileupRenderer/renderMethylation.d.ts +2 -1
- package/esm/PileupRenderer/renderMethylation.js +17 -9
- package/esm/PileupRenderer/renderMismatches.js +19 -19
- package/esm/PileupRenderer/renderModifications.d.ts +3 -2
- package/esm/PileupRenderer/renderModifications.js +30 -33
- package/esm/PileupRenderer/renderPerBaseLettering.d.ts +2 -1
- package/esm/PileupRenderer/renderPerBaseLettering.js +1 -3
- package/esm/PileupRenderer/renderPerBaseQuality.d.ts +2 -1
- package/esm/PileupRenderer/renderPerBaseQuality.js +1 -3
- package/esm/PileupRenderer/renderSoftClipping.js +6 -6
- package/esm/PileupRenderer/sortUtil.d.ts +2 -7
- package/esm/PileupRenderer/sortUtil.js +13 -13
- package/esm/SNPCoverageAdapter/SNPCoverageAdapter.js +10 -5
- package/esm/SNPCoverageAdapter/generateCoverageBins.d.ts +13 -9
- package/esm/SNPCoverageAdapter/generateCoverageBins.js +269 -166
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.d.ts +2 -1
- package/esm/SNPCoverageRenderer/SNPCoverageRenderer.js +171 -54
- package/esm/shared/color.d.ts +0 -10
- package/esm/shared/color.js +0 -6
- package/{dist/shared → esm/shared/components}/BaseDisplayComponent.d.ts +2 -2
- package/{dist/shared → esm/shared/components}/FilterByTagDialog.d.ts +3 -3
- package/esm/shared/{FilterByTagDialog.js → components/FilterByTagDialog.js} +5 -1
- package/esm/shared/fetchChains.js +1 -2
- package/esm/shared/getMaximumModificationAtEachPosition.d.ts +8 -0
- package/esm/shared/getMaximumModificationAtEachPosition.js +39 -0
- package/esm/shared/getUniqueModifications.d.ts +14 -0
- package/esm/shared/getUniqueModifications.js +13 -0
- package/esm/shared/getUniqueTags.d.ts +15 -0
- package/esm/shared/getUniqueTags.js +15 -0
- package/esm/shared/types.d.ts +94 -0
- package/esm/shared/util.d.ts +8 -0
- package/esm/shared/util.js +23 -0
- package/esm/util.d.ts +7 -4
- package/esm/util.js +28 -27
- package/package.json +4 -4
- package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
- package/dist/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -41
- package/dist/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
- package/dist/LinearPileupDisplay/components/ModificationsTable.js +0 -28
- package/dist/SNPCoverageAdapter/util.d.ts +0 -25
- package/dist/shared/index.d.ts +0 -49
- package/dist/shared/index.js +0 -41
- package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.d.ts +0 -15
- package/esm/LinearPileupDisplay/components/ColorByModificationsDialog.js +0 -36
- package/esm/LinearPileupDisplay/components/ModificationsTable.d.ts +0 -4
- package/esm/LinearPileupDisplay/components/ModificationsTable.js +0 -22
- package/esm/SNPCoverageAdapter/util.d.ts +0 -25
- package/esm/shared/index.d.ts +0 -49
- package/esm/shared/index.js +0 -36
- /package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +0 -0
- /package/dist/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
- /package/dist/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/dist/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/dist/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +0 -0
- /package/dist/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
- /package/dist/shared/{renderSvg.js → renderSvgUtil.js} +0 -0
- /package/dist/{SNPCoverageAdapter/util.js → shared/types.js} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.d.ts → alignmentsModel.d.ts} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/alignmentsModel.js → alignmentsModel.js} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/util.d.ts → util.d.ts} +0 -0
- /package/esm/LinearAlignmentsDisplay/{models/util.js → util.js} +0 -0
- /package/esm/LinearSNPCoverageDisplay/{models/configSchema.d.ts → configSchema.d.ts} +0 -0
- /package/esm/LinearSNPCoverageDisplay/{models/configSchema.js → configSchema.js} +0 -0
- /package/esm/shared/{BaseDisplayComponent.js → components/BaseDisplayComponent.js} +0 -0
- /package/esm/shared/{renderSvg.d.ts → renderSvgUtil.d.ts} +0 -0
- /package/esm/shared/{renderSvg.js → renderSvgUtil.js} +0 -0
- /package/esm/{SNPCoverageAdapter/util.js → shared/types.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const util_1 = require("./util");
|
|
4
|
+
const util_2 = require("../shared/util");
|
|
4
5
|
class CramSlightlyLazyFeature {
|
|
5
6
|
// uses parameter properties to automatically create fields on the class
|
|
6
7
|
// https://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties
|
|
@@ -8,98 +9,80 @@ class CramSlightlyLazyFeature {
|
|
|
8
9
|
this.record = record;
|
|
9
10
|
this._store = _store;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
get name() {
|
|
12
13
|
return this.record.readName;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
get start() {
|
|
15
16
|
return this.record.alignmentStart - 1;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
+
get end() {
|
|
18
19
|
var _a;
|
|
19
|
-
return this.
|
|
20
|
+
return this.start + ((_a = this.record.lengthOnRef) !== null && _a !== void 0 ? _a : 1);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
return this.record.readFeatures;
|
|
23
|
-
}
|
|
24
|
-
_get_type() {
|
|
25
|
-
return 'match';
|
|
26
|
-
}
|
|
27
|
-
_get_score() {
|
|
22
|
+
get score() {
|
|
28
23
|
return this.record.mappingQuality;
|
|
29
24
|
}
|
|
30
|
-
|
|
25
|
+
get flags() {
|
|
31
26
|
return this.record.flags;
|
|
32
27
|
}
|
|
33
|
-
|
|
28
|
+
get strand() {
|
|
34
29
|
return this.record.isReverseComplemented() ? -1 : 1;
|
|
35
30
|
}
|
|
36
|
-
|
|
37
|
-
var _a;
|
|
38
|
-
return (_a = this._store.samHeader.readGroups) === null || _a === void 0 ? void 0 : _a[this.record.readGroupId];
|
|
39
|
-
}
|
|
40
|
-
_get_qual() {
|
|
31
|
+
get qual() {
|
|
41
32
|
return (this.record.qualityScores || []).join(' ');
|
|
42
33
|
}
|
|
43
|
-
qualRaw() {
|
|
34
|
+
get qualRaw() {
|
|
44
35
|
return this.record.qualityScores;
|
|
45
36
|
}
|
|
46
|
-
|
|
37
|
+
get refName() {
|
|
47
38
|
return this._store.refIdToName(this.record.sequenceId);
|
|
48
39
|
}
|
|
49
|
-
|
|
50
|
-
return !!this.record.mate;
|
|
51
|
-
}
|
|
52
|
-
_get_pair_orientation() {
|
|
40
|
+
get pair_orientation() {
|
|
53
41
|
return this.record.isPaired() ? this.record.getPairOrientation() : undefined;
|
|
54
42
|
}
|
|
55
|
-
|
|
43
|
+
get template_length() {
|
|
56
44
|
return this.record.templateLength || this.record.templateSize;
|
|
57
45
|
}
|
|
58
|
-
|
|
46
|
+
get next_ref() {
|
|
59
47
|
return this.record.mate
|
|
60
48
|
? this._store.refIdToName(this.record.mate.sequenceId)
|
|
61
49
|
: undefined;
|
|
62
50
|
}
|
|
63
|
-
|
|
51
|
+
get next_segment_position() {
|
|
64
52
|
return this.record.mate
|
|
65
53
|
? `${this._store.refIdToName(this.record.mate.sequenceId)}:${this.record.mate.alignmentStart}`
|
|
66
54
|
: undefined;
|
|
67
55
|
}
|
|
68
|
-
|
|
56
|
+
get is_paired() {
|
|
57
|
+
return !!this.record.mate;
|
|
58
|
+
}
|
|
59
|
+
get next_pos() {
|
|
69
60
|
var _a;
|
|
70
61
|
return (_a = this.record.mate) === null || _a === void 0 ? void 0 : _a.alignmentStart;
|
|
71
62
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
return RG !== undefined ? { ...tags, RG } : tags;
|
|
63
|
+
get tags() {
|
|
64
|
+
var _a;
|
|
65
|
+
const RG = (_a = this._store.samHeader.readGroups) === null || _a === void 0 ? void 0 : _a[this.record.readGroupId];
|
|
66
|
+
return RG !== undefined ? { ...this.record.tags, RG } : this.record.tags;
|
|
77
67
|
}
|
|
78
|
-
|
|
68
|
+
get seq() {
|
|
79
69
|
return this.record.getReadBases();
|
|
80
70
|
}
|
|
81
71
|
// generate a CIGAR, based on code from jkbonfield
|
|
82
|
-
|
|
72
|
+
get CIGAR() {
|
|
83
73
|
return (0, util_1.readFeaturesToCIGAR)(this.record.readFeatures, this.record.alignmentStart, this.record.readLength, this.record._refRegion);
|
|
84
74
|
}
|
|
85
|
-
tags() {
|
|
86
|
-
return Object.getOwnPropertyNames(CramSlightlyLazyFeature.prototype)
|
|
87
|
-
.filter(prop => prop.startsWith('_get_') &&
|
|
88
|
-
prop !== '_get_mismatches' &&
|
|
89
|
-
prop !== '_get_cram_read_features')
|
|
90
|
-
.map(methodName => methodName.replace('_get_', ''));
|
|
91
|
-
}
|
|
92
75
|
id() {
|
|
93
76
|
return `${this._store.id}-${this.record.uniqueId}`;
|
|
94
77
|
}
|
|
95
78
|
get(field) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
79
|
+
return field === 'mismatches'
|
|
80
|
+
? this.mismatches
|
|
81
|
+
: field === 'qual'
|
|
82
|
+
? this.qual
|
|
83
|
+
: field === 'CIGAR'
|
|
84
|
+
? this.CIGAR
|
|
85
|
+
: this.fields[field];
|
|
103
86
|
}
|
|
104
87
|
parent() {
|
|
105
88
|
return undefined;
|
|
@@ -107,34 +90,52 @@ class CramSlightlyLazyFeature {
|
|
|
107
90
|
children() {
|
|
108
91
|
return undefined;
|
|
109
92
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
93
|
+
get mismatches() {
|
|
94
|
+
return (0, util_1.readFeaturesToMismatches)(this.record.readFeatures, this.start, this.qualRaw);
|
|
95
|
+
// this commented code can try to resolve MD tags, xref https://github.com/galaxyproject/tools-iuc/issues/6523#issuecomment-2462927211 but put on hold
|
|
96
|
+
// return this.tags.MD && this.seq
|
|
97
|
+
// ? mismatches.concat(
|
|
98
|
+
// mdToMismatches(
|
|
99
|
+
// this.tags.MD,
|
|
100
|
+
// parseCigar(this.CIGAR),
|
|
101
|
+
// mismatches,
|
|
102
|
+
// this.seq,
|
|
103
|
+
// this.qualRaw,
|
|
104
|
+
// ),
|
|
105
|
+
// )
|
|
106
|
+
// : mismatches
|
|
107
|
+
}
|
|
108
|
+
get fields() {
|
|
126
109
|
return {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
110
|
+
start: this.start,
|
|
111
|
+
name: this.name,
|
|
112
|
+
end: this.end,
|
|
113
|
+
score: this.score,
|
|
114
|
+
strand: this.strand,
|
|
115
|
+
template_length: this.template_length,
|
|
116
|
+
flags: this.flags,
|
|
117
|
+
tags: this.tags,
|
|
118
|
+
refName: this.refName,
|
|
119
|
+
seq: this.seq,
|
|
120
|
+
type: 'match',
|
|
121
|
+
pair_orientation: this.pair_orientation,
|
|
122
|
+
next_ref: this.next_ref,
|
|
123
|
+
next_pos: this.next_pos,
|
|
124
|
+
next_segment_position: this.next_segment_position,
|
|
130
125
|
uniqueId: this.id(),
|
|
131
126
|
};
|
|
132
127
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
toJSON() {
|
|
129
|
+
return {
|
|
130
|
+
...this.fields,
|
|
131
|
+
// lazy
|
|
132
|
+
CIGAR: this.CIGAR,
|
|
133
|
+
// lazy
|
|
134
|
+
qual: this.qual,
|
|
135
|
+
};
|
|
138
136
|
}
|
|
139
137
|
}
|
|
140
138
|
exports.default = CramSlightlyLazyFeature;
|
|
139
|
+
(0, util_2.cacheGetter)(CramSlightlyLazyFeature, 'fields');
|
|
140
|
+
(0, util_2.cacheGetter)(CramSlightlyLazyFeature, 'CIGAR');
|
|
141
|
+
(0, util_2.cacheGetter)(CramSlightlyLazyFeature, 'mismatches');
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { CramRecord } from '@gmod/cram';
|
|
2
|
+
import { Mismatch } from '../shared/types';
|
|
2
3
|
type ReadFeatures = CramRecord['readFeatures'];
|
|
3
|
-
export interface Mismatch {
|
|
4
|
-
qual?: number;
|
|
5
|
-
start: number;
|
|
6
|
-
length: number;
|
|
7
|
-
type: string;
|
|
8
|
-
base: string | undefined;
|
|
9
|
-
altbase?: string;
|
|
10
|
-
seq?: string;
|
|
11
|
-
cliplen?: number;
|
|
12
|
-
}
|
|
13
4
|
export declare function readFeaturesToMismatches(readFeatures: ReadFeatures, start: number, qual?: number[] | null): Mismatch[];
|
|
14
5
|
export declare function readFeaturesToCIGAR(readFeatures: ReadFeatures, alignmentStart: number, readLen: number, refRegion?: {
|
|
15
6
|
seq: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { LinearAlignmentsDisplayModel } from '../
|
|
2
|
+
import { LinearAlignmentsDisplayModel } from '../model';
|
|
3
3
|
declare const AlignmentsDisplay: ({ model, }: {
|
|
4
4
|
model: LinearAlignmentsDisplayModel;
|
|
5
5
|
}) => React.JSX.Element | null;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.default = LinearAlignmentsDisplayF;
|
|
7
7
|
const DisplayType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/DisplayType"));
|
|
8
8
|
// locals
|
|
9
|
-
const configSchema_1 = __importDefault(require("./
|
|
10
|
-
const model_1 = __importDefault(require("./
|
|
9
|
+
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
10
|
+
const model_1 = __importDefault(require("./model"));
|
|
11
11
|
const AlignmentsDisplay_1 = __importDefault(require("./components/AlignmentsDisplay"));
|
|
12
12
|
function LinearAlignmentsDisplayF(pluginManager) {
|
|
13
13
|
pluginManager.addDisplayType(() => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Instance
|
|
2
|
+
import { Instance } from 'mobx-state-tree';
|
|
3
3
|
import { AnyConfigurationModel, AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
4
4
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
5
5
|
import { MenuItem } from '@jbrowse/core/ui';
|
|
6
6
|
import { FeatureDensityStats } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
7
|
-
import {
|
|
7
|
+
import { FilterBy } from '../shared/types';
|
|
8
8
|
/**
|
|
9
9
|
* #stateModel LinearAlignmentsDisplay
|
|
10
10
|
* extends
|
|
@@ -83,6 +83,9 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
83
83
|
setRpcDriverName(rpcDriverName: string): void;
|
|
84
84
|
reload(): void;
|
|
85
85
|
} & {
|
|
86
|
+
/**
|
|
87
|
+
* #volatile
|
|
88
|
+
*/
|
|
86
89
|
scrollTop: number;
|
|
87
90
|
} & {
|
|
88
91
|
/**
|
|
@@ -151,7 +154,7 @@ declare function stateModelFactory(pluginManager: PluginManager, configSchema: A
|
|
|
151
154
|
/**
|
|
152
155
|
* #action
|
|
153
156
|
*/
|
|
154
|
-
setFilterBy(filter:
|
|
157
|
+
setFilterBy(filter: FilterBy): void;
|
|
155
158
|
/**
|
|
156
159
|
* #action
|
|
157
160
|
*/
|
|
@@ -14,9 +14,6 @@ const models_1 = require("@jbrowse/core/pluggableElementTypes/models");
|
|
|
14
14
|
const alignmentsModel_1 = require("./alignmentsModel");
|
|
15
15
|
const util_1 = require("./util");
|
|
16
16
|
const minDisplayHeight = 20;
|
|
17
|
-
function deepSnap(x1, x2) {
|
|
18
|
-
return (0, fast_deep_equal_1.default)(x1 ? (0, mobx_state_tree_1.getSnapshot)(x1) : undefined, x2 ? (0, mobx_state_tree_1.getSnapshot)(x2) : undefined);
|
|
19
|
-
}
|
|
20
17
|
function preCheck(self) {
|
|
21
18
|
const { PileupDisplay, SNPCoverageDisplay } = self;
|
|
22
19
|
return (PileupDisplay ||
|
|
@@ -29,8 +26,10 @@ function propagateColorBy(self) {
|
|
|
29
26
|
if (!preCheck(self) || !PileupDisplay.colorBy) {
|
|
30
27
|
return;
|
|
31
28
|
}
|
|
32
|
-
if (!
|
|
33
|
-
SNPCoverageDisplay.
|
|
29
|
+
if (!(0, fast_deep_equal_1.default)(PileupDisplay.colorBy, SNPCoverageDisplay.colorBy)) {
|
|
30
|
+
SNPCoverageDisplay.setColorScheme({
|
|
31
|
+
...PileupDisplay.colorBy,
|
|
32
|
+
});
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
function propagateFilterBy(self) {
|
|
@@ -38,8 +37,10 @@ function propagateFilterBy(self) {
|
|
|
38
37
|
if (!preCheck(self) || !PileupDisplay.filterBy) {
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
|
-
if (!
|
|
42
|
-
SNPCoverageDisplay.setFilterBy(
|
|
40
|
+
if (!(0, fast_deep_equal_1.default)(PileupDisplay.filterBy, SNPCoverageDisplay.filterBy)) {
|
|
41
|
+
SNPCoverageDisplay.setFilterBy({
|
|
42
|
+
...PileupDisplay.filterBy,
|
|
43
|
+
});
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
@@ -52,6 +53,9 @@ function stateModelFactory(pluginManager, configSchema) {
|
|
|
52
53
|
return mobx_state_tree_1.types
|
|
53
54
|
.compose('LinearAlignmentsDisplay', models_1.BaseDisplay, (0, alignmentsModel_1.LinearAlignmentsDisplayMixin)(pluginManager, configSchema))
|
|
54
55
|
.volatile(() => ({
|
|
56
|
+
/**
|
|
57
|
+
* #volatile
|
|
58
|
+
*/
|
|
55
59
|
scrollTop: 0,
|
|
56
60
|
}))
|
|
57
61
|
.actions(self => ({
|
|
@@ -2,8 +2,7 @@ import { AnyConfigurationModel, AnyConfigurationSchemaType } from '@jbrowse/core
|
|
|
2
2
|
import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
|
|
3
3
|
import { Feature } from '@jbrowse/core/util';
|
|
4
4
|
import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons';
|
|
5
|
-
import {
|
|
6
|
-
import { ExtraColorBy } from '../shared/color';
|
|
5
|
+
import { ColorBy, FilterBy } from '../shared/types';
|
|
7
6
|
/**
|
|
8
7
|
* #stateModel SharedLinearPileupDisplayMixin
|
|
9
8
|
* #category display
|
|
@@ -124,23 +123,11 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
124
123
|
/**
|
|
125
124
|
* #property
|
|
126
125
|
*/
|
|
127
|
-
colorBy: import("mobx-state-tree").
|
|
128
|
-
type: import("mobx-state-tree").ISimpleType<string>;
|
|
129
|
-
tag: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
130
|
-
extra: import("mobx-state-tree").IType<any, any, any>;
|
|
131
|
-
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
126
|
+
colorBy: import("mobx-state-tree").IType<ColorBy | undefined, ColorBy | undefined, ColorBy | undefined>;
|
|
132
127
|
/**
|
|
133
128
|
* #property
|
|
134
129
|
*/
|
|
135
|
-
filterBy: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").
|
|
136
|
-
flagInclude: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
137
|
-
flagExclude: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
138
|
-
readName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
139
|
-
tagFilter: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IModelType<{
|
|
140
|
-
tag: import("mobx-state-tree").ISimpleType<string>;
|
|
141
|
-
value: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
142
|
-
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
143
|
-
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
130
|
+
filterBy: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<FilterBy, FilterBy, FilterBy>, [undefined]>;
|
|
144
131
|
/**
|
|
145
132
|
* #property
|
|
146
133
|
*/
|
|
@@ -296,11 +283,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
296
283
|
/**
|
|
297
284
|
* #action
|
|
298
285
|
*/
|
|
299
|
-
setColorScheme(colorScheme:
|
|
300
|
-
type: string;
|
|
301
|
-
tag?: string;
|
|
302
|
-
extra?: ExtraColorBy;
|
|
303
|
-
}): void;
|
|
286
|
+
setColorScheme(colorScheme: ColorBy): void;
|
|
304
287
|
/**
|
|
305
288
|
* #action
|
|
306
289
|
*/
|
|
@@ -325,7 +308,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
325
308
|
/**
|
|
326
309
|
* #action
|
|
327
310
|
*/
|
|
328
|
-
setFilterBy(filter:
|
|
311
|
+
setFilterBy(filter: FilterBy): void;
|
|
329
312
|
/**
|
|
330
313
|
* #action
|
|
331
314
|
*/
|
|
@@ -343,11 +326,7 @@ export declare function SharedLinearPileupDisplayMixin(configSchema: AnyConfigur
|
|
|
343
326
|
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
344
327
|
[x: string]: any;
|
|
345
328
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>);
|
|
346
|
-
} & import("mobx-state-tree"
|
|
347
|
-
* #stateModel SharedLinearPileupDisplayMixin
|
|
348
|
-
* #category display
|
|
349
|
-
* extends `BaseLinearDisplay`
|
|
350
|
-
*/).IStateTreeNode<AnyConfigurationSchemaType>);
|
|
329
|
+
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>);
|
|
351
330
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
352
331
|
} & {
|
|
353
332
|
/**
|
|
@@ -42,11 +42,11 @@ const MenuOpen_1 = __importDefault(require("@mui/icons-material/MenuOpen"));
|
|
|
42
42
|
const ClearAll_1 = __importDefault(require("@mui/icons-material/ClearAll"));
|
|
43
43
|
// locals
|
|
44
44
|
const LinearPileupDisplayBlurb_1 = __importDefault(require("./components/LinearPileupDisplayBlurb"));
|
|
45
|
-
const shared_1 = require("../shared");
|
|
46
45
|
const util_2 = require("../util");
|
|
47
|
-
const
|
|
46
|
+
const getUniqueTags_1 = require("../shared/getUniqueTags");
|
|
47
|
+
const util_3 = require("../shared/util");
|
|
48
48
|
// lazies
|
|
49
|
-
const FilterByTagDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('../shared/FilterByTagDialog'))));
|
|
49
|
+
const FilterByTagDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('../shared/components/FilterByTagDialog'))));
|
|
50
50
|
const ColorByTagDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/ColorByTagDialog'))));
|
|
51
51
|
const SetFeatureHeightDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SetFeatureHeightDialog'))));
|
|
52
52
|
const SetMaxHeightDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SetMaxHeightDialog'))));
|
|
@@ -86,11 +86,11 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
86
86
|
/**
|
|
87
87
|
* #property
|
|
88
88
|
*/
|
|
89
|
-
colorBy:
|
|
89
|
+
colorBy: mobx_state_tree_1.types.frozen(),
|
|
90
90
|
/**
|
|
91
91
|
* #property
|
|
92
92
|
*/
|
|
93
|
-
filterBy: mobx_state_tree_1.types.optional(
|
|
93
|
+
filterBy: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.frozen(), util_3.defaultFilterFlags),
|
|
94
94
|
/**
|
|
95
95
|
* #property
|
|
96
96
|
*/
|
|
@@ -138,8 +138,10 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
138
138
|
* #action
|
|
139
139
|
*/
|
|
140
140
|
setColorScheme(colorScheme) {
|
|
141
|
-
self.colorTagMap = mobx_1.observable.map({});
|
|
142
|
-
self.colorBy =
|
|
141
|
+
self.colorTagMap = mobx_1.observable.map({});
|
|
142
|
+
self.colorBy = {
|
|
143
|
+
...colorScheme,
|
|
144
|
+
};
|
|
143
145
|
if (colorScheme.tag) {
|
|
144
146
|
self.tagsReady = false;
|
|
145
147
|
}
|
|
@@ -211,7 +213,9 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
211
213
|
* #action
|
|
212
214
|
*/
|
|
213
215
|
setFilterBy(filter) {
|
|
214
|
-
self.filterBy =
|
|
216
|
+
self.filterBy = {
|
|
217
|
+
...filter,
|
|
218
|
+
};
|
|
215
219
|
},
|
|
216
220
|
/**
|
|
217
221
|
* #action
|
|
@@ -325,8 +329,8 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
325
329
|
notReady: superProps.notReady || !self.renderReady(),
|
|
326
330
|
rpcDriverName,
|
|
327
331
|
displayModel: self,
|
|
328
|
-
colorBy
|
|
329
|
-
filterBy
|
|
332
|
+
colorBy,
|
|
333
|
+
filterBy,
|
|
330
334
|
filters: self.filters,
|
|
331
335
|
colorTagMap: Object.fromEntries(colorTagMap.toJSON()),
|
|
332
336
|
config: self.rendererConfig,
|
|
@@ -346,7 +350,7 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
346
350
|
layoutId: (0, util_1.getContainingView)(self).id,
|
|
347
351
|
rendererType: 'PileupRenderer',
|
|
348
352
|
}));
|
|
349
|
-
if (feature) {
|
|
353
|
+
if ((0, mobx_state_tree_1.isAlive)(self) && feature) {
|
|
350
354
|
self.selectFeature(new util_1.SimpleFeature(feature));
|
|
351
355
|
}
|
|
352
356
|
}
|
|
@@ -396,37 +400,49 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
396
400
|
{
|
|
397
401
|
label: 'Normal',
|
|
398
402
|
onClick: () => {
|
|
399
|
-
self.setColorScheme({
|
|
403
|
+
self.setColorScheme({
|
|
404
|
+
type: 'normal',
|
|
405
|
+
});
|
|
400
406
|
},
|
|
401
407
|
},
|
|
402
408
|
{
|
|
403
409
|
label: 'Mapping quality',
|
|
404
410
|
onClick: () => {
|
|
405
|
-
self.setColorScheme({
|
|
411
|
+
self.setColorScheme({
|
|
412
|
+
type: 'mappingQuality',
|
|
413
|
+
});
|
|
406
414
|
},
|
|
407
415
|
},
|
|
408
416
|
{
|
|
409
417
|
label: 'Strand',
|
|
410
418
|
onClick: () => {
|
|
411
|
-
self.setColorScheme({
|
|
419
|
+
self.setColorScheme({
|
|
420
|
+
type: 'strand',
|
|
421
|
+
});
|
|
412
422
|
},
|
|
413
423
|
},
|
|
414
424
|
{
|
|
415
425
|
label: 'Per-base quality',
|
|
416
426
|
onClick: () => {
|
|
417
|
-
self.setColorScheme({
|
|
427
|
+
self.setColorScheme({
|
|
428
|
+
type: 'perBaseQuality',
|
|
429
|
+
});
|
|
418
430
|
},
|
|
419
431
|
},
|
|
420
432
|
{
|
|
421
433
|
label: 'Per-base lettering',
|
|
422
434
|
onClick: () => {
|
|
423
|
-
self.setColorScheme({
|
|
435
|
+
self.setColorScheme({
|
|
436
|
+
type: 'perBaseLettering',
|
|
437
|
+
});
|
|
424
438
|
},
|
|
425
439
|
},
|
|
426
440
|
{
|
|
427
441
|
label: 'First-of-pair strand',
|
|
428
442
|
onClick: () => {
|
|
429
|
-
self.setColorScheme({
|
|
443
|
+
self.setColorScheme({
|
|
444
|
+
type: 'stranded',
|
|
445
|
+
});
|
|
430
446
|
},
|
|
431
447
|
},
|
|
432
448
|
{
|
|
@@ -526,14 +542,19 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
526
542
|
const { colorBy, tagsReady } = self;
|
|
527
543
|
const { staticBlocks } = view;
|
|
528
544
|
if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.tag) && !tagsReady) {
|
|
529
|
-
const vals = await (0,
|
|
545
|
+
const vals = await (0, getUniqueTags_1.getUniqueTags)({
|
|
530
546
|
self,
|
|
531
547
|
tag: colorBy.tag,
|
|
532
548
|
blocks: staticBlocks,
|
|
533
549
|
});
|
|
534
|
-
|
|
550
|
+
if ((0, mobx_state_tree_1.isAlive)(self)) {
|
|
551
|
+
self.updateColorTagMap(vals);
|
|
552
|
+
self.setTagsReady(true);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
self.setTagsReady(true);
|
|
535
557
|
}
|
|
536
|
-
self.setTagsReady(true);
|
|
537
558
|
}, { delay: 1000 });
|
|
538
559
|
// autorun synchronizes featureUnderMouse with featureIdUnderMouse
|
|
539
560
|
// asynchronously. this is needed due to how we do not serialize all
|
|
@@ -560,7 +581,8 @@ function SharedLinearPileupDisplayMixin(configSchema) {
|
|
|
560
581
|
// feature.id that was returned e.g. that the user hasn't
|
|
561
582
|
// moused over to a new position during the async operation
|
|
562
583
|
// above
|
|
563
|
-
if (
|
|
584
|
+
if ((0, mobx_state_tree_1.isAlive)(self) &&
|
|
585
|
+
feature &&
|
|
564
586
|
self.featureIdUnderMouse === feature.uniqueId) {
|
|
565
587
|
self.setFeatureUnderMouse(new util_1.SimpleFeature(feature));
|
|
566
588
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
interface Tag {
|
|
3
|
+
type: string;
|
|
4
|
+
tag: string;
|
|
5
|
+
}
|
|
2
6
|
declare const ColorByTagDialog: ({ model, handleClose, }: {
|
|
3
7
|
model: {
|
|
4
|
-
setColorScheme: (arg:
|
|
5
|
-
type: string;
|
|
6
|
-
tag: string;
|
|
7
|
-
}) => void;
|
|
8
|
+
setColorScheme: (arg: Tag) => void;
|
|
8
9
|
};
|
|
9
10
|
handleClose: () => void;
|
|
10
11
|
}) => React.JSX.Element;
|
|
@@ -36,7 +36,9 @@ const ColorByTagDialog = (0, mobx_react_1.observer)(function ({ model, handleClo
|
|
|
36
36
|
react_1.default.createElement(material_1.Typography, { color: "textSecondary" }, "Examples: XS or TS for RNA-seq inferred read strand, ts (lower-case) for minimap2 read strand, HP for haplotype, RG for read group, etc."),
|
|
37
37
|
react_1.default.createElement(material_1.TextField, { value: tag, onChange: event => {
|
|
38
38
|
setTag(event.target.value);
|
|
39
|
-
}, placeholder: "Enter tag name",
|
|
39
|
+
}, placeholder: "Enter tag name", error: tag.length === 2 && !validTag, helperText: tag.length === 2 && !validTag ? 'Not a valid tag' : '', autoComplete: "off", slotProps: {
|
|
40
|
+
htmlInput: { maxLength: 2 },
|
|
41
|
+
} }),
|
|
40
42
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
41
43
|
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", onClick: () => {
|
|
42
44
|
model.setColorScheme({ type: 'tag', tag });
|
|
@@ -30,7 +30,7 @@ const ui_1 = require("@jbrowse/core/ui");
|
|
|
30
30
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
31
31
|
const util_1 = require("@jbrowse/core/util");
|
|
32
32
|
// locals
|
|
33
|
-
const
|
|
33
|
+
const getUniqueTags_1 = require("../../shared/getUniqueTags");
|
|
34
34
|
function clone(c) {
|
|
35
35
|
return JSON.parse(JSON.stringify(c));
|
|
36
36
|
}
|
|
@@ -52,7 +52,7 @@ const GroupByTagDialog = (0, mobx_react_1.observer)(function (props) {
|
|
|
52
52
|
if (!isInvalid) {
|
|
53
53
|
setError(undefined);
|
|
54
54
|
setLoading(true);
|
|
55
|
-
const vals = await (0,
|
|
55
|
+
const vals = await (0, getUniqueTags_1.getUniqueTags)({
|
|
56
56
|
self: model,
|
|
57
57
|
tag: debouncedTag,
|
|
58
58
|
blocks: (0, util_1.getContainingView)(model)
|
|
@@ -79,10 +79,12 @@ const GroupByTagDialog = (0, mobx_react_1.observer)(function (props) {
|
|
|
79
79
|
} }), label: "Make a new subtrack for undefined values of tag as well?" }),
|
|
80
80
|
react_1.default.createElement(material_1.TextField, { value: tag, onChange: event => {
|
|
81
81
|
setTag(event.target.value);
|
|
82
|
-
}, placeholder: "Enter tag name",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
}, placeholder: "Enter tag name", error: isInvalid, helperText: isInvalid ? 'Not a valid tag' : '', autoComplete: "off", "data-testid": "group-tag-name", slotProps: {
|
|
83
|
+
htmlInput: {
|
|
84
|
+
maxLength: 2,
|
|
85
|
+
'data-testid': 'group-tag-name-input',
|
|
86
|
+
},
|
|
87
|
+
} }),
|
|
86
88
|
error ? (react_1.default.createElement(ui_1.ErrorMessage, { error: error })) : loading ? (react_1.default.createElement(ui_1.LoadingEllipses, { title: "Loading unique tags" })) : tagSet ? (react_1.default.createElement("div", null,
|
|
87
89
|
react_1.default.createElement("div", null,
|
|
88
90
|
"Found unique ",
|
|
@@ -37,10 +37,12 @@ const SortByTagDialog = (0, mobx_react_1.observer)(function (props) {
|
|
|
37
37
|
react_1.default.createElement(material_1.Typography, { color: "textSecondary" }, "Examples: HP for haplotype, RG for read group, etc."),
|
|
38
38
|
react_1.default.createElement(material_1.TextField, { value: tag, onChange: event => {
|
|
39
39
|
setTag(event.target.value);
|
|
40
|
-
}, placeholder: "Enter tag name",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
}, placeholder: "Enter tag name", error: tag.length === 2 && !validTag, helperText: tag.length === 2 && !validTag ? 'Not a valid tag' : '', autoComplete: "off", "data-testid": "sort-tag-name", slotProps: {
|
|
41
|
+
htmlInput: {
|
|
42
|
+
maxLength: 2,
|
|
43
|
+
'data-testid': 'sort-tag-name-input',
|
|
44
|
+
},
|
|
45
|
+
} }),
|
|
44
46
|
react_1.default.createElement(material_1.DialogActions, null,
|
|
45
47
|
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, onClick: () => {
|
|
46
48
|
model.setSortedBy('tag', tag);
|