@jbrowse/plugin-alignments 2.1.6 → 2.2.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/AlignmentsTrack/index.d.ts +1 -1
- package/dist/AlignmentsTrack/index.js +16 -6
- package/dist/AlignmentsTrack/index.js.map +1 -1
- package/dist/BamAdapter/BamAdapter.d.ts +6 -2
- package/dist/BamAdapter/BamAdapter.js +35 -31
- package/dist/BamAdapter/BamAdapter.js.map +1 -1
- package/dist/BamAdapter/configSchema.d.ts +2 -2
- package/dist/BamAdapter/configSchema.js +27 -2
- package/dist/BamAdapter/configSchema.js.map +1 -1
- package/dist/CramAdapter/CramAdapter.d.ts +13 -7
- package/dist/CramAdapter/CramAdapter.js +56 -61
- package/dist/CramAdapter/CramAdapter.js.map +1 -1
- package/dist/CramAdapter/CramSlightlyLazyFeature.d.ts +14 -13
- package/dist/CramAdapter/CramSlightlyLazyFeature.js +28 -22
- package/dist/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/dist/CramAdapter/configSchema.d.ts +2 -3
- package/dist/CramAdapter/configSchema.js +44 -22
- package/dist/CramAdapter/configSchema.js.map +1 -1
- package/dist/CramAdapter/index.js +1 -1
- package/dist/CramAdapter/index.js.map +1 -1
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +5 -2
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.js +15 -20
- package/dist/HtsgetBamAdapter/HtsgetBamAdapter.js.map +1 -1
- package/dist/HtsgetBamAdapter/configSchema.d.ts +2 -2
- package/dist/HtsgetBamAdapter/configSchema.js +20 -3
- package/dist/HtsgetBamAdapter/configSchema.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/configSchema.d.ts +1 -1
- package/dist/LinearAlignmentsDisplay/models/configSchema.js +23 -6
- package/dist/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/dist/LinearAlignmentsDisplay/models/model.d.ts +72 -5
- package/dist/LinearAlignmentsDisplay/models/model.js +95 -2
- package/dist/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/dist/LinearPileupDisplay/configSchema.js +20 -3
- package/dist/LinearPileupDisplay/configSchema.js.map +1 -1
- package/dist/LinearPileupDisplay/model.d.ts +88 -4
- package/dist/LinearPileupDisplay/model.js +616 -503
- package/dist/LinearPileupDisplay/model.js.map +1 -1
- package/dist/LinearSNPCoverageDisplay/models/configSchema.js +33 -4
- package/dist/LinearSNPCoverageDisplay/models/configSchema.js.map +1 -1
- package/dist/LinearSNPCoverageDisplay/models/model.d.ts +86 -3
- package/dist/LinearSNPCoverageDisplay/models/model.js +240 -159
- package/dist/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/dist/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/dist/PileupRenderer/PileupRenderer.js +5 -6
- package/dist/PileupRenderer/PileupRenderer.js.map +1 -1
- package/dist/PileupRenderer/configSchema.d.ts +2 -2
- package/dist/PileupRenderer/configSchema.js +37 -2
- package/dist/PileupRenderer/configSchema.js.map +1 -1
- package/dist/SNPCoverageAdapter/configSchema.d.ts +2 -2
- package/dist/SNPCoverageAdapter/configSchema.js +11 -3
- package/dist/SNPCoverageAdapter/configSchema.js.map +1 -1
- package/dist/SNPCoverageRenderer/configSchema.d.ts +2 -2
- package/dist/SNPCoverageRenderer/configSchema.js +21 -1
- package/dist/SNPCoverageRenderer/configSchema.js.map +1 -1
- package/dist/SNPCoverageRenderer/index.d.ts +0 -1
- package/dist/SNPCoverageRenderer/index.js +1 -4
- package/dist/SNPCoverageRenderer/index.js.map +1 -1
- package/esm/AlignmentsTrack/index.d.ts +1 -1
- package/esm/AlignmentsTrack/index.js +16 -6
- package/esm/AlignmentsTrack/index.js.map +1 -1
- package/esm/BamAdapter/BamAdapter.d.ts +6 -2
- package/esm/BamAdapter/BamAdapter.js +35 -31
- package/esm/BamAdapter/BamAdapter.js.map +1 -1
- package/esm/BamAdapter/configSchema.d.ts +2 -2
- package/esm/BamAdapter/configSchema.js +27 -2
- package/esm/BamAdapter/configSchema.js.map +1 -1
- package/esm/CramAdapter/CramAdapter.d.ts +13 -7
- package/esm/CramAdapter/CramAdapter.js +56 -61
- package/esm/CramAdapter/CramAdapter.js.map +1 -1
- package/esm/CramAdapter/CramSlightlyLazyFeature.d.ts +14 -13
- package/esm/CramAdapter/CramSlightlyLazyFeature.js +28 -22
- package/esm/CramAdapter/CramSlightlyLazyFeature.js.map +1 -1
- package/esm/CramAdapter/configSchema.d.ts +2 -3
- package/esm/CramAdapter/configSchema.js +44 -22
- package/esm/CramAdapter/configSchema.js.map +1 -1
- package/esm/CramAdapter/index.js +2 -2
- package/esm/CramAdapter/index.js.map +1 -1
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.d.ts +5 -2
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.js +15 -20
- package/esm/HtsgetBamAdapter/HtsgetBamAdapter.js.map +1 -1
- package/esm/HtsgetBamAdapter/configSchema.d.ts +2 -2
- package/esm/HtsgetBamAdapter/configSchema.js +20 -3
- package/esm/HtsgetBamAdapter/configSchema.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/configSchema.d.ts +1 -1
- package/esm/LinearAlignmentsDisplay/models/configSchema.js +23 -6
- package/esm/LinearAlignmentsDisplay/models/configSchema.js.map +1 -1
- package/esm/LinearAlignmentsDisplay/models/model.d.ts +72 -5
- package/esm/LinearAlignmentsDisplay/models/model.js +95 -2
- package/esm/LinearAlignmentsDisplay/models/model.js.map +1 -1
- package/esm/LinearPileupDisplay/configSchema.js +20 -3
- package/esm/LinearPileupDisplay/configSchema.js.map +1 -1
- package/esm/LinearPileupDisplay/model.d.ts +88 -4
- package/esm/LinearPileupDisplay/model.js +616 -503
- package/esm/LinearPileupDisplay/model.js.map +1 -1
- package/esm/LinearSNPCoverageDisplay/models/configSchema.js +33 -4
- package/esm/LinearSNPCoverageDisplay/models/configSchema.js.map +1 -1
- package/esm/LinearSNPCoverageDisplay/models/model.d.ts +86 -3
- package/esm/LinearSNPCoverageDisplay/models/model.js +240 -159
- package/esm/LinearSNPCoverageDisplay/models/model.js.map +1 -1
- package/esm/PileupRenderer/PileupRenderer.d.ts +1 -1
- package/esm/PileupRenderer/PileupRenderer.js +5 -6
- package/esm/PileupRenderer/PileupRenderer.js.map +1 -1
- package/esm/PileupRenderer/configSchema.d.ts +2 -2
- package/esm/PileupRenderer/configSchema.js +37 -2
- package/esm/PileupRenderer/configSchema.js.map +1 -1
- package/esm/SNPCoverageAdapter/configSchema.d.ts +2 -2
- package/esm/SNPCoverageAdapter/configSchema.js +11 -3
- package/esm/SNPCoverageAdapter/configSchema.js.map +1 -1
- package/esm/SNPCoverageRenderer/configSchema.d.ts +2 -2
- package/esm/SNPCoverageRenderer/configSchema.js +21 -1
- package/esm/SNPCoverageRenderer/configSchema.js.map +1 -1
- package/esm/SNPCoverageRenderer/index.d.ts +0 -1
- package/esm/SNPCoverageRenderer/index.js +1 -3
- package/esm/SNPCoverageRenderer/index.js.map +1 -1
- package/package.json +3 -3
- package/src/AlignmentsFeatureDetail/__snapshots__/index.test.js.snap +54 -54
- package/src/AlignmentsTrack/index.ts +18 -12
- package/src/BamAdapter/BamAdapter.ts +39 -39
- package/src/BamAdapter/configSchema.ts +57 -29
- package/src/CramAdapter/CramAdapter.test.ts +1 -2
- package/src/CramAdapter/CramAdapter.ts +83 -84
- package/src/CramAdapter/CramSlightlyLazyFeature.ts +34 -25
- package/src/CramAdapter/configSchema.ts +55 -30
- package/src/CramAdapter/index.ts +2 -2
- package/src/HtsgetBamAdapter/HtsgetBamAdapter.ts +14 -21
- package/src/HtsgetBamAdapter/configSchema.ts +36 -19
- package/src/LinearAlignmentsDisplay/models/configSchema.ts +23 -10
- package/src/LinearAlignmentsDisplay/models/model.tsx +99 -4
- package/src/LinearPileupDisplay/configSchema.ts +23 -5
- package/src/LinearPileupDisplay/model.ts +120 -4
- package/src/LinearSNPCoverageDisplay/models/configSchema.ts +36 -9
- package/src/LinearSNPCoverageDisplay/models/model.ts +83 -4
- package/src/PileupRenderer/PileupRenderer.tsx +5 -9
- package/src/PileupRenderer/configSchema.ts +39 -2
- package/src/SNPCoverageAdapter/configSchema.ts +18 -10
- package/src/SNPCoverageRenderer/configSchema.ts +23 -1
- package/src/SNPCoverageRenderer/index.ts +1 -8
- package/src/declare.d.ts +0 -1
|
@@ -27,548 +27,661 @@ const rendererTypes = new Map([
|
|
|
27
27
|
['pileup', 'PileupRenderer'],
|
|
28
28
|
['svg', 'SvgFeatureRenderer'],
|
|
29
29
|
]);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
self.
|
|
142
|
-
}
|
|
143
|
-
if (sortedBy) {
|
|
144
|
-
const { pos, refName, assemblyName } = sortedBy;
|
|
145
|
-
// render just the sorted region first
|
|
146
|
-
// @ts-ignore
|
|
147
|
-
await self.rendererType.renderInClient(rpcManager, {
|
|
148
|
-
assemblyName,
|
|
149
|
-
regions: [
|
|
150
|
-
{
|
|
151
|
-
start: pos,
|
|
152
|
-
end: pos + 1,
|
|
153
|
-
refName,
|
|
154
|
-
assemblyName,
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
adapterConfig: adapterConfig,
|
|
158
|
-
rendererType: rendererType.name,
|
|
159
|
-
sessionId: getRpcSessionId(self),
|
|
160
|
-
layoutId: view.id,
|
|
161
|
-
timeout: 1000000,
|
|
162
|
-
...self.renderProps(),
|
|
163
|
-
});
|
|
164
|
-
self.setReady(true);
|
|
165
|
-
self.setCurrBpPerPx(bpPerPx);
|
|
30
|
+
/**
|
|
31
|
+
* #stateModel LinearPileupDisplay
|
|
32
|
+
*/
|
|
33
|
+
function stateModelFactory(configSchema) {
|
|
34
|
+
return types
|
|
35
|
+
.compose('LinearPileupDisplay', BaseLinearDisplay, types.model({
|
|
36
|
+
/**
|
|
37
|
+
* #property
|
|
38
|
+
*/
|
|
39
|
+
type: types.literal('LinearPileupDisplay'),
|
|
40
|
+
/**
|
|
41
|
+
* #property
|
|
42
|
+
*/
|
|
43
|
+
configuration: ConfigurationReference(configSchema),
|
|
44
|
+
/**
|
|
45
|
+
* #property
|
|
46
|
+
*/
|
|
47
|
+
showSoftClipping: false,
|
|
48
|
+
/**
|
|
49
|
+
* #property
|
|
50
|
+
*/
|
|
51
|
+
featureHeight: types.maybe(types.number),
|
|
52
|
+
/**
|
|
53
|
+
* #property
|
|
54
|
+
*/
|
|
55
|
+
noSpacing: types.maybe(types.boolean),
|
|
56
|
+
/**
|
|
57
|
+
* #property
|
|
58
|
+
*/
|
|
59
|
+
fadeLikelihood: types.maybe(types.boolean),
|
|
60
|
+
/**
|
|
61
|
+
* #property
|
|
62
|
+
*/
|
|
63
|
+
trackMaxHeight: types.maybe(types.number),
|
|
64
|
+
/**
|
|
65
|
+
* #property
|
|
66
|
+
*/
|
|
67
|
+
mismatchAlpha: types.maybe(types.boolean),
|
|
68
|
+
/**
|
|
69
|
+
* #property
|
|
70
|
+
*/
|
|
71
|
+
sortedBy: types.maybe(types.model({
|
|
72
|
+
type: types.string,
|
|
73
|
+
pos: types.number,
|
|
74
|
+
tag: types.maybe(types.string),
|
|
75
|
+
refName: types.string,
|
|
76
|
+
assemblyName: types.string,
|
|
77
|
+
})),
|
|
78
|
+
/**
|
|
79
|
+
* #property
|
|
80
|
+
*/
|
|
81
|
+
colorBy: types.maybe(types.model({
|
|
82
|
+
type: types.string,
|
|
83
|
+
tag: types.maybe(types.string),
|
|
84
|
+
extra: types.frozen(),
|
|
85
|
+
})),
|
|
86
|
+
filterBy: types.optional(types.model({
|
|
87
|
+
flagInclude: types.optional(types.number, 0),
|
|
88
|
+
flagExclude: types.optional(types.number, 1540),
|
|
89
|
+
readName: types.maybe(types.string),
|
|
90
|
+
tagFilter: types.maybe(types.model({ tag: types.string, value: types.string })),
|
|
91
|
+
}), {}),
|
|
92
|
+
}))
|
|
93
|
+
.volatile(() => ({
|
|
94
|
+
colorTagMap: observable.map({}),
|
|
95
|
+
modificationTagMap: observable.map({}),
|
|
96
|
+
featureUnderMouseVolatile: undefined,
|
|
97
|
+
ready: false,
|
|
98
|
+
}))
|
|
99
|
+
.actions(self => ({
|
|
100
|
+
/**
|
|
101
|
+
* #action
|
|
102
|
+
*/
|
|
103
|
+
setReady(flag) {
|
|
104
|
+
self.ready = flag;
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* #action
|
|
108
|
+
*/
|
|
109
|
+
setMaxHeight(n) {
|
|
110
|
+
self.trackMaxHeight = n;
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* #action
|
|
114
|
+
*/
|
|
115
|
+
setFeatureHeight(n) {
|
|
116
|
+
self.featureHeight = n;
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* #action
|
|
120
|
+
*/
|
|
121
|
+
setNoSpacing(flag) {
|
|
122
|
+
self.noSpacing = flag;
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* #action
|
|
126
|
+
*/
|
|
127
|
+
setColorScheme(colorScheme) {
|
|
128
|
+
self.colorTagMap = observable.map({}); // clear existing mapping
|
|
129
|
+
self.colorBy = cast(colorScheme);
|
|
130
|
+
self.ready = false;
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* #action
|
|
134
|
+
*/
|
|
135
|
+
updateModificationColorMap(uniqueModifications) {
|
|
136
|
+
const colorPalette = ['red', 'blue', 'green', 'orange', 'purple'];
|
|
137
|
+
uniqueModifications.forEach(value => {
|
|
138
|
+
if (!self.modificationTagMap.has(value)) {
|
|
139
|
+
const totalKeys = [...self.modificationTagMap.keys()].length;
|
|
140
|
+
const newColor = colorPalette[totalKeys];
|
|
141
|
+
self.modificationTagMap.set(value, newColor);
|
|
166
142
|
}
|
|
167
|
-
|
|
168
|
-
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* #action
|
|
147
|
+
*/
|
|
148
|
+
updateColorTagMap(uniqueTag) {
|
|
149
|
+
// pale color scheme
|
|
150
|
+
// https://cran.r-project.org/web/packages/khroma/vignettes/tol.html
|
|
151
|
+
// e.g. "tol_light"
|
|
152
|
+
const colorPalette = [
|
|
153
|
+
'#BBCCEE',
|
|
154
|
+
'pink',
|
|
155
|
+
'#CCDDAA',
|
|
156
|
+
'#EEEEBB',
|
|
157
|
+
'#FFCCCC',
|
|
158
|
+
'lightblue',
|
|
159
|
+
'lightgreen',
|
|
160
|
+
'tan',
|
|
161
|
+
'#CCEEFF',
|
|
162
|
+
'lightsalmon',
|
|
163
|
+
];
|
|
164
|
+
uniqueTag.forEach(value => {
|
|
165
|
+
if (!self.colorTagMap.has(value)) {
|
|
166
|
+
const totalKeys = [...self.colorTagMap.keys()].length;
|
|
167
|
+
const newColor = colorPalette[totalKeys];
|
|
168
|
+
self.colorTagMap.set(value, newColor);
|
|
169
169
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* #action
|
|
174
|
+
*/
|
|
175
|
+
setFeatureUnderMouse(feat) {
|
|
176
|
+
self.featureUnderMouseVolatile = feat;
|
|
177
|
+
},
|
|
178
|
+
}))
|
|
179
|
+
.actions(self => ({
|
|
180
|
+
afterAttach() {
|
|
181
|
+
addDisposer(self, autorun(async () => {
|
|
182
|
+
try {
|
|
183
|
+
const { rpcManager } = getSession(self);
|
|
184
|
+
const view = getContainingView(self);
|
|
185
|
+
const { sortedBy, colorBy, parentTrack, adapterConfig, rendererType, } = self;
|
|
186
|
+
if (!view.initialized ||
|
|
187
|
+
!self.estimatedStatsReady ||
|
|
188
|
+
self.regionTooLarge) {
|
|
189
|
+
return;
|
|
185
190
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
//
|
|
191
|
+
const { staticBlocks, bpPerPx } = view;
|
|
192
|
+
// continually generate the vc pairing, set and rerender if any
|
|
193
|
+
// new values seen
|
|
194
|
+
if (colorBy === null || colorBy === void 0 ? void 0 : colorBy.tag) {
|
|
195
|
+
self.updateColorTagMap(await getUniqueTagValues(self, colorBy, staticBlocks));
|
|
196
|
+
}
|
|
197
|
+
if ((colorBy === null || colorBy === void 0 ? void 0 : colorBy.type) === 'modifications') {
|
|
198
|
+
const adapter = getConf(parentTrack, ['adapter']);
|
|
199
|
+
self.updateModificationColorMap(await getUniqueModificationValues(self, adapter, colorBy, staticBlocks));
|
|
200
|
+
}
|
|
201
|
+
if (sortedBy) {
|
|
202
|
+
const { pos, refName, assemblyName } = sortedBy;
|
|
203
|
+
// render just the sorted region first
|
|
199
204
|
// @ts-ignore
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
await self.rendererType.renderInClient(rpcManager, {
|
|
206
|
+
assemblyName,
|
|
207
|
+
regions: [
|
|
208
|
+
{
|
|
209
|
+
start: pos,
|
|
210
|
+
end: pos + 1,
|
|
211
|
+
refName,
|
|
212
|
+
assemblyName,
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
adapterConfig: adapterConfig,
|
|
216
|
+
rendererType: rendererType.name,
|
|
217
|
+
sessionId: getRpcSessionId(self),
|
|
218
|
+
layoutId: view.id,
|
|
219
|
+
timeout: 1000000,
|
|
220
|
+
...self.renderProps(),
|
|
221
|
+
});
|
|
222
|
+
self.setReady(true);
|
|
223
|
+
self.setCurrBpPerPx(bpPerPx);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
self.setReady(true);
|
|
204
227
|
}
|
|
205
228
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
clearSelected() {
|
|
222
|
-
self.sortedBy = undefined;
|
|
223
|
-
},
|
|
224
|
-
// uses copy-to-clipboard and generates notification
|
|
225
|
-
copyFeatureToClipboard(feature) {
|
|
226
|
-
const { uniqueId, ...rest } = feature.toJSON();
|
|
227
|
-
const session = getSession(self);
|
|
228
|
-
copy(JSON.stringify(rest, null, 4));
|
|
229
|
-
session.notify('Copied to clipboard', 'success');
|
|
230
|
-
},
|
|
231
|
-
toggleSoftClipping() {
|
|
232
|
-
self.showSoftClipping = !self.showSoftClipping;
|
|
233
|
-
},
|
|
234
|
-
toggleMismatchAlpha() {
|
|
235
|
-
self.mismatchAlpha = !self.mismatchAlpha;
|
|
236
|
-
},
|
|
237
|
-
setConfig(configuration) {
|
|
238
|
-
self.configuration = configuration;
|
|
239
|
-
},
|
|
240
|
-
setSortedBy(type, tag) {
|
|
241
|
-
const { centerLineInfo } = getContainingView(self);
|
|
242
|
-
if (!centerLineInfo) {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const { refName, assemblyName, offset } = centerLineInfo;
|
|
246
|
-
const centerBp = Math.round(offset) + 1;
|
|
247
|
-
if (centerBp < 0 || !refName) {
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
self.sortedBy = {
|
|
251
|
-
type,
|
|
252
|
-
pos: centerBp,
|
|
253
|
-
refName,
|
|
254
|
-
assemblyName,
|
|
255
|
-
tag,
|
|
256
|
-
};
|
|
257
|
-
self.ready = false;
|
|
258
|
-
},
|
|
259
|
-
setFilterBy(filter) {
|
|
260
|
-
self.filterBy = cast(filter);
|
|
261
|
-
},
|
|
262
|
-
}))
|
|
263
|
-
.actions(self => {
|
|
264
|
-
// resets the sort object and refresh whole display on reload
|
|
265
|
-
const superReload = self.reload;
|
|
266
|
-
return {
|
|
267
|
-
reload() {
|
|
268
|
-
self.clearSelected();
|
|
269
|
-
superReload();
|
|
270
|
-
},
|
|
271
|
-
};
|
|
272
|
-
})
|
|
273
|
-
.views(self => ({
|
|
274
|
-
get maxHeight() {
|
|
275
|
-
const conf = getConf(self, ['renderers', self.rendererTypeName]) || {};
|
|
276
|
-
return self.trackMaxHeight !== undefined
|
|
277
|
-
? self.trackMaxHeight
|
|
278
|
-
: conf.maxHeight;
|
|
279
|
-
},
|
|
280
|
-
get rendererConfig() {
|
|
281
|
-
const configBlob = getConf(self, ['renderers', self.rendererTypeName]) || {};
|
|
282
|
-
return self.rendererType.configSchema.create({
|
|
283
|
-
...configBlob,
|
|
284
|
-
height: self.featureHeight,
|
|
285
|
-
noSpacing: self.noSpacing,
|
|
286
|
-
maxHeight: this.maxHeight,
|
|
287
|
-
mismatchAlpha: self.mismatchAlpha,
|
|
288
|
-
}, getEnv(self));
|
|
289
|
-
},
|
|
290
|
-
get featureHeightSetting() {
|
|
291
|
-
return (self.featureHeight || readConfObject(this.rendererConfig, 'height'));
|
|
292
|
-
},
|
|
293
|
-
get mismatchAlphaSetting() {
|
|
294
|
-
return self.mismatchAlpha !== undefined
|
|
295
|
-
? self.mismatchAlpha
|
|
296
|
-
: readConfObject(this.rendererConfig, 'mismatchAlpha');
|
|
297
|
-
},
|
|
298
|
-
get featureUnderMouse() {
|
|
299
|
-
return self.featureUnderMouseVolatile;
|
|
300
|
-
},
|
|
301
|
-
}))
|
|
302
|
-
.views(self => {
|
|
303
|
-
const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, } = self;
|
|
304
|
-
return {
|
|
305
|
-
get rendererTypeName() {
|
|
306
|
-
const viewName = getConf(self, 'defaultRendering');
|
|
307
|
-
const rendererType = rendererTypes.get(viewName);
|
|
308
|
-
if (!rendererType) {
|
|
309
|
-
throw new Error(`unknown alignments view name ${viewName}`);
|
|
310
|
-
}
|
|
311
|
-
return rendererType;
|
|
312
|
-
},
|
|
313
|
-
contextMenuItems() {
|
|
314
|
-
const feat = self.contextMenuFeature;
|
|
315
|
-
const contextMenuItems = feat
|
|
316
|
-
? [
|
|
317
|
-
{
|
|
318
|
-
label: 'Open feature details',
|
|
319
|
-
icon: MenuOpenIcon,
|
|
320
|
-
onClick: () => {
|
|
321
|
-
self.clearFeatureSelection();
|
|
322
|
-
if (feat) {
|
|
323
|
-
self.selectFeature(feat);
|
|
324
|
-
}
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
label: 'Copy info to clipboard',
|
|
329
|
-
icon: ContentCopyIcon,
|
|
330
|
-
onClick: () => {
|
|
331
|
-
if (feat) {
|
|
332
|
-
self.copyFeatureToClipboard(feat);
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
]
|
|
337
|
-
: [];
|
|
338
|
-
return contextMenuItems;
|
|
339
|
-
},
|
|
340
|
-
get DisplayBlurb() {
|
|
341
|
-
return LinearPileupDisplayBlurb;
|
|
342
|
-
},
|
|
343
|
-
renderProps() {
|
|
344
|
-
const view = getContainingView(self);
|
|
345
|
-
const { colorTagMap, modificationTagMap, sortedBy, colorBy, filterBy, rpcDriverName, currBpPerPx, ready, } = self;
|
|
346
|
-
const superProps = superRenderProps();
|
|
347
|
-
return {
|
|
348
|
-
...superProps,
|
|
349
|
-
notReady: superProps.notReady ||
|
|
350
|
-
!ready ||
|
|
351
|
-
(sortedBy && currBpPerPx !== view.bpPerPx),
|
|
352
|
-
rpcDriverName,
|
|
353
|
-
displayModel: self,
|
|
354
|
-
sortedBy,
|
|
355
|
-
colorBy,
|
|
356
|
-
filterBy: JSON.parse(JSON.stringify(filterBy)),
|
|
357
|
-
colorTagMap: Object.fromEntries(colorTagMap.toJSON()),
|
|
358
|
-
modificationTagMap: Object.fromEntries(modificationTagMap.toJSON()),
|
|
359
|
-
showSoftClip: self.showSoftClipping,
|
|
360
|
-
config: self.rendererConfig,
|
|
361
|
-
async onFeatureClick(_, featureId) {
|
|
362
|
-
const session = getSession(self);
|
|
363
|
-
const { rpcManager } = session;
|
|
364
|
-
try {
|
|
365
|
-
const f = featureId || self.featureIdUnderMouse;
|
|
366
|
-
if (!f) {
|
|
367
|
-
self.clearFeatureSelection();
|
|
229
|
+
catch (e) {
|
|
230
|
+
console.error(e);
|
|
231
|
+
self.setError(e);
|
|
232
|
+
}
|
|
233
|
+
}, { delay: 1000 }));
|
|
234
|
+
// autorun synchronizes featureUnderMouse with featureIdUnderMouse
|
|
235
|
+
addDisposer(self, autorun(async () => {
|
|
236
|
+
var _a;
|
|
237
|
+
const session = getSession(self);
|
|
238
|
+
try {
|
|
239
|
+
const featureId = self.featureIdUnderMouse;
|
|
240
|
+
if (((_a = self.featureUnderMouse) === null || _a === void 0 ? void 0 : _a.id()) !== featureId) {
|
|
241
|
+
if (!featureId) {
|
|
242
|
+
self.setFeatureUnderMouse(undefined);
|
|
368
243
|
}
|
|
369
244
|
else {
|
|
370
245
|
const sessionId = getRpcSessionId(self);
|
|
371
|
-
const
|
|
372
|
-
|
|
246
|
+
const view = getContainingView(self);
|
|
247
|
+
const { feature } = (await session.rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
|
|
248
|
+
featureId,
|
|
373
249
|
sessionId,
|
|
374
|
-
layoutId:
|
|
250
|
+
layoutId: view.id,
|
|
375
251
|
rendererType: 'PileupRenderer',
|
|
376
252
|
}));
|
|
377
|
-
|
|
253
|
+
// check featureIdUnderMouse is still the same as the
|
|
254
|
+
// feature.id that was returned e.g. that the user hasn't
|
|
255
|
+
// moused over to a new position during the async operation
|
|
256
|
+
// above
|
|
257
|
+
// @ts-ignore
|
|
258
|
+
if (self.featureIdUnderMouse === feature.uniqueId) {
|
|
378
259
|
// @ts-ignore
|
|
379
|
-
self.
|
|
260
|
+
self.setFeatureUnderMouse(new SimpleFeature(feature));
|
|
380
261
|
}
|
|
381
262
|
}
|
|
382
263
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
264
|
+
}
|
|
265
|
+
catch (e) {
|
|
266
|
+
console.error(e);
|
|
267
|
+
session.notify(`${e}`, 'error');
|
|
268
|
+
}
|
|
269
|
+
}));
|
|
270
|
+
},
|
|
271
|
+
/**
|
|
272
|
+
* #action
|
|
273
|
+
*/
|
|
274
|
+
selectFeature(feature) {
|
|
275
|
+
const session = getSession(self);
|
|
276
|
+
if (isSessionModelWithWidgets(session)) {
|
|
277
|
+
const featureWidget = session.addWidget('AlignmentsFeatureWidget', 'alignmentFeature', { featureData: feature.toJSON(), view: getContainingView(self) });
|
|
278
|
+
session.showWidget(featureWidget);
|
|
279
|
+
}
|
|
280
|
+
session.setSelection(feature);
|
|
281
|
+
},
|
|
282
|
+
/**
|
|
283
|
+
* #action
|
|
284
|
+
*/
|
|
285
|
+
clearSelected() {
|
|
286
|
+
self.sortedBy = undefined;
|
|
287
|
+
},
|
|
288
|
+
/**
|
|
289
|
+
* #action
|
|
290
|
+
* uses copy-to-clipboard and generates notification
|
|
291
|
+
*/
|
|
292
|
+
copyFeatureToClipboard(feature) {
|
|
293
|
+
const { uniqueId, ...rest } = feature.toJSON();
|
|
294
|
+
const session = getSession(self);
|
|
295
|
+
copy(JSON.stringify(rest, null, 4));
|
|
296
|
+
session.notify('Copied to clipboard', 'success');
|
|
297
|
+
},
|
|
298
|
+
/**
|
|
299
|
+
* #action
|
|
300
|
+
*/
|
|
301
|
+
toggleSoftClipping() {
|
|
302
|
+
self.showSoftClipping = !self.showSoftClipping;
|
|
303
|
+
},
|
|
304
|
+
/**
|
|
305
|
+
* #action
|
|
306
|
+
*/
|
|
307
|
+
toggleMismatchAlpha() {
|
|
308
|
+
self.mismatchAlpha = !self.mismatchAlpha;
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
* #action
|
|
312
|
+
*/
|
|
313
|
+
setConfig(configuration) {
|
|
314
|
+
self.configuration = configuration;
|
|
315
|
+
},
|
|
316
|
+
/**
|
|
317
|
+
* #action
|
|
318
|
+
*/
|
|
319
|
+
setSortedBy(type, tag) {
|
|
320
|
+
const { centerLineInfo } = getContainingView(self);
|
|
321
|
+
if (!centerLineInfo) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const { refName, assemblyName, offset } = centerLineInfo;
|
|
325
|
+
const centerBp = Math.round(offset) + 1;
|
|
326
|
+
if (centerBp < 0 || !refName) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
self.sortedBy = {
|
|
330
|
+
type,
|
|
331
|
+
pos: centerBp,
|
|
332
|
+
refName,
|
|
333
|
+
assemblyName,
|
|
334
|
+
tag,
|
|
418
335
|
};
|
|
336
|
+
self.ready = false;
|
|
419
337
|
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
338
|
+
setFilterBy(filter) {
|
|
339
|
+
self.filterBy = cast(filter);
|
|
340
|
+
},
|
|
341
|
+
}))
|
|
342
|
+
.actions(self => {
|
|
343
|
+
// resets the sort object and refresh whole display on reload
|
|
344
|
+
const superReload = self.reload;
|
|
345
|
+
return {
|
|
346
|
+
/**
|
|
347
|
+
* #action
|
|
348
|
+
*/
|
|
349
|
+
reload() {
|
|
350
|
+
self.clearSelected();
|
|
351
|
+
superReload();
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
})
|
|
355
|
+
.views(self => ({
|
|
356
|
+
/**
|
|
357
|
+
* #getter
|
|
358
|
+
*/
|
|
359
|
+
get maxHeight() {
|
|
360
|
+
const conf = getConf(self, ['renderers', self.rendererTypeName]) || {};
|
|
361
|
+
return self.trackMaxHeight !== undefined
|
|
362
|
+
? self.trackMaxHeight
|
|
363
|
+
: conf.maxHeight;
|
|
364
|
+
},
|
|
365
|
+
/**
|
|
366
|
+
* #getter
|
|
367
|
+
*/
|
|
368
|
+
get rendererConfig() {
|
|
369
|
+
const configBlob = getConf(self, ['renderers', self.rendererTypeName]) || {};
|
|
370
|
+
return self.rendererType.configSchema.create({
|
|
371
|
+
...configBlob,
|
|
372
|
+
height: self.featureHeight,
|
|
373
|
+
noSpacing: self.noSpacing,
|
|
374
|
+
maxHeight: this.maxHeight,
|
|
375
|
+
mismatchAlpha: self.mismatchAlpha,
|
|
376
|
+
}, getEnv(self));
|
|
377
|
+
},
|
|
378
|
+
/**
|
|
379
|
+
* #getter
|
|
380
|
+
*/
|
|
381
|
+
get featureHeightSetting() {
|
|
382
|
+
return (self.featureHeight || readConfObject(this.rendererConfig, 'height'));
|
|
383
|
+
},
|
|
384
|
+
/**
|
|
385
|
+
* #getter
|
|
386
|
+
*/
|
|
387
|
+
get mismatchAlphaSetting() {
|
|
388
|
+
return self.mismatchAlpha !== undefined
|
|
389
|
+
? self.mismatchAlpha
|
|
390
|
+
: readConfObject(this.rendererConfig, 'mismatchAlpha');
|
|
391
|
+
},
|
|
392
|
+
/**
|
|
393
|
+
* #getter
|
|
394
|
+
*/
|
|
395
|
+
get featureUnderMouse() {
|
|
396
|
+
return self.featureUnderMouseVolatile;
|
|
397
|
+
},
|
|
398
|
+
}))
|
|
399
|
+
.views(self => {
|
|
400
|
+
const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, } = self;
|
|
401
|
+
return {
|
|
402
|
+
/**
|
|
403
|
+
* #getter
|
|
404
|
+
*/
|
|
405
|
+
get rendererTypeName() {
|
|
406
|
+
const viewName = getConf(self, 'defaultRendering');
|
|
407
|
+
const rendererType = rendererTypes.get(viewName);
|
|
408
|
+
if (!rendererType) {
|
|
409
|
+
throw new Error(`unknown alignments view name ${viewName}`);
|
|
410
|
+
}
|
|
411
|
+
return rendererType;
|
|
412
|
+
},
|
|
413
|
+
/**
|
|
414
|
+
* #method
|
|
415
|
+
*/
|
|
416
|
+
contextMenuItems() {
|
|
417
|
+
const feat = self.contextMenuFeature;
|
|
418
|
+
const contextMenuItems = feat
|
|
419
|
+
? [
|
|
446
420
|
{
|
|
447
|
-
label: '
|
|
421
|
+
label: 'Open feature details',
|
|
422
|
+
icon: MenuOpenIcon,
|
|
448
423
|
onClick: () => {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
424
|
+
self.clearFeatureSelection();
|
|
425
|
+
if (feat) {
|
|
426
|
+
self.selectFeature(feat);
|
|
427
|
+
}
|
|
453
428
|
},
|
|
454
429
|
},
|
|
455
430
|
{
|
|
456
|
-
label: '
|
|
457
|
-
|
|
458
|
-
},
|
|
459
|
-
],
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
label: 'Color scheme',
|
|
463
|
-
icon: PaletteIcon,
|
|
464
|
-
subMenu: [
|
|
465
|
-
{
|
|
466
|
-
label: 'Normal',
|
|
431
|
+
label: 'Copy info to clipboard',
|
|
432
|
+
icon: ContentCopyIcon,
|
|
467
433
|
onClick: () => {
|
|
468
|
-
|
|
434
|
+
if (feat) {
|
|
435
|
+
self.copyFeatureToClipboard(feat);
|
|
436
|
+
}
|
|
469
437
|
},
|
|
470
438
|
},
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
439
|
+
]
|
|
440
|
+
: [];
|
|
441
|
+
return contextMenuItems;
|
|
442
|
+
},
|
|
443
|
+
/**
|
|
444
|
+
* #getter
|
|
445
|
+
*/
|
|
446
|
+
get DisplayBlurb() {
|
|
447
|
+
return LinearPileupDisplayBlurb;
|
|
448
|
+
},
|
|
449
|
+
/**
|
|
450
|
+
* #method
|
|
451
|
+
*/
|
|
452
|
+
renderProps() {
|
|
453
|
+
const view = getContainingView(self);
|
|
454
|
+
const { colorTagMap, modificationTagMap, sortedBy, colorBy, filterBy, rpcDriverName, currBpPerPx, ready, } = self;
|
|
455
|
+
const superProps = superRenderProps();
|
|
456
|
+
return {
|
|
457
|
+
...superProps,
|
|
458
|
+
notReady: superProps.notReady ||
|
|
459
|
+
!ready ||
|
|
460
|
+
(sortedBy && currBpPerPx !== view.bpPerPx),
|
|
461
|
+
rpcDriverName,
|
|
462
|
+
displayModel: self,
|
|
463
|
+
sortedBy,
|
|
464
|
+
colorBy,
|
|
465
|
+
filterBy: JSON.parse(JSON.stringify(filterBy)),
|
|
466
|
+
colorTagMap: Object.fromEntries(colorTagMap.toJSON()),
|
|
467
|
+
modificationTagMap: Object.fromEntries(modificationTagMap.toJSON()),
|
|
468
|
+
showSoftClip: self.showSoftClipping,
|
|
469
|
+
config: self.rendererConfig,
|
|
470
|
+
async onFeatureClick(_, featureId) {
|
|
471
|
+
const session = getSession(self);
|
|
472
|
+
const { rpcManager } = session;
|
|
473
|
+
try {
|
|
474
|
+
const f = featureId || self.featureIdUnderMouse;
|
|
475
|
+
if (!f) {
|
|
476
|
+
self.clearFeatureSelection();
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
const sessionId = getRpcSessionId(self);
|
|
480
|
+
const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
|
|
481
|
+
featureId: f,
|
|
482
|
+
sessionId,
|
|
483
|
+
layoutId: getContainingView(self).id,
|
|
484
|
+
rendererType: 'PileupRenderer',
|
|
485
|
+
}));
|
|
486
|
+
if (feature) {
|
|
487
|
+
// @ts-ignore
|
|
488
|
+
self.selectFeature(new SimpleFeature(feature));
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
catch (e) {
|
|
493
|
+
console.error(e);
|
|
494
|
+
session.notify(`${e}`);
|
|
495
|
+
}
|
|
496
|
+
},
|
|
497
|
+
onClick() {
|
|
498
|
+
self.clearFeatureSelection();
|
|
499
|
+
},
|
|
500
|
+
// similar to click but opens a menu with further options
|
|
501
|
+
async onFeatureContextMenu(_, featureId) {
|
|
502
|
+
const session = getSession(self);
|
|
503
|
+
const { rpcManager } = session;
|
|
504
|
+
try {
|
|
505
|
+
const f = featureId || self.featureIdUnderMouse;
|
|
506
|
+
if (!f) {
|
|
507
|
+
self.clearFeatureSelection();
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
const sessionId = getRpcSessionId(self);
|
|
511
|
+
const { feature } = (await rpcManager.call(sessionId, 'CoreGetFeatureDetails', {
|
|
512
|
+
featureId: f,
|
|
513
|
+
sessionId,
|
|
514
|
+
layoutId: getContainingView(self).id,
|
|
515
|
+
rendererType: 'PileupRenderer',
|
|
516
|
+
}));
|
|
517
|
+
if (feature) {
|
|
518
|
+
self.setContextMenuFeature(new SimpleFeature(feature));
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
catch (e) {
|
|
523
|
+
console.error(e);
|
|
524
|
+
session.notify(`${e}`);
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
};
|
|
528
|
+
},
|
|
529
|
+
/**
|
|
530
|
+
* #method
|
|
531
|
+
*/
|
|
532
|
+
trackMenuItems() {
|
|
533
|
+
return [
|
|
534
|
+
...superTrackMenuItems(),
|
|
535
|
+
{
|
|
536
|
+
label: 'Show soft clipping',
|
|
537
|
+
icon: VisibilityIcon,
|
|
538
|
+
type: 'checkbox',
|
|
539
|
+
checked: self.showSoftClipping,
|
|
540
|
+
onClick: () => {
|
|
541
|
+
self.toggleSoftClipping();
|
|
542
|
+
// if toggling from off to on, will break sort for this track
|
|
543
|
+
// so clear it
|
|
544
|
+
if (self.showSoftClipping) {
|
|
545
|
+
self.clearSelected();
|
|
546
|
+
}
|
|
476
547
|
},
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
label: 'Sort by',
|
|
551
|
+
icon: SortIcon,
|
|
552
|
+
disabled: self.showSoftClipping,
|
|
553
|
+
subMenu: [
|
|
554
|
+
...['Start location', 'Read strand', 'Base pair'].map(option => ({
|
|
555
|
+
label: option,
|
|
556
|
+
onClick: () => self.setSortedBy(option),
|
|
557
|
+
})),
|
|
558
|
+
{
|
|
559
|
+
label: 'Sort by tag...',
|
|
560
|
+
onClick: () => {
|
|
561
|
+
getSession(self).queueDialog(handleClose => [
|
|
562
|
+
SortByTagDlg,
|
|
563
|
+
{ model: self, handleClose },
|
|
564
|
+
]);
|
|
565
|
+
},
|
|
481
566
|
},
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
onClick: () => {
|
|
486
|
-
self.setColorScheme({ type: 'pairOrientation' });
|
|
567
|
+
{
|
|
568
|
+
label: 'Clear sort',
|
|
569
|
+
onClick: () => self.clearSelected(),
|
|
487
570
|
},
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
571
|
+
],
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
label: 'Color scheme',
|
|
575
|
+
icon: PaletteIcon,
|
|
576
|
+
subMenu: [
|
|
577
|
+
{
|
|
578
|
+
label: 'Normal',
|
|
579
|
+
onClick: () => {
|
|
580
|
+
self.setColorScheme({ type: 'normal' });
|
|
581
|
+
},
|
|
493
582
|
},
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
583
|
+
{
|
|
584
|
+
label: 'Mapping quality',
|
|
585
|
+
onClick: () => {
|
|
586
|
+
self.setColorScheme({ type: 'mappingQuality' });
|
|
587
|
+
},
|
|
499
588
|
},
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
ModificationsDlg,
|
|
506
|
-
{ model: self, handleClose: doneCallback },
|
|
507
|
-
]);
|
|
589
|
+
{
|
|
590
|
+
label: 'Strand',
|
|
591
|
+
onClick: () => {
|
|
592
|
+
self.setColorScheme({ type: 'strand' });
|
|
593
|
+
},
|
|
508
594
|
},
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
595
|
+
{
|
|
596
|
+
label: 'Pair orientation',
|
|
597
|
+
onClick: () => {
|
|
598
|
+
self.setColorScheme({ type: 'pairOrientation' });
|
|
599
|
+
},
|
|
514
600
|
},
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
601
|
+
{
|
|
602
|
+
label: 'Per-base quality',
|
|
603
|
+
onClick: () => {
|
|
604
|
+
self.setColorScheme({ type: 'perBaseQuality' });
|
|
605
|
+
},
|
|
520
606
|
},
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
607
|
+
{
|
|
608
|
+
label: 'Per-base lettering',
|
|
609
|
+
onClick: () => {
|
|
610
|
+
self.setColorScheme({ type: 'perBaseLettering' });
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
label: 'Modifications or methylation',
|
|
615
|
+
onClick: () => {
|
|
616
|
+
getSession(self).queueDialog(doneCallback => [
|
|
617
|
+
ModificationsDlg,
|
|
618
|
+
{ model: self, handleClose: doneCallback },
|
|
619
|
+
]);
|
|
620
|
+
},
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
label: 'Insert size',
|
|
624
|
+
onClick: () => {
|
|
625
|
+
self.setColorScheme({ type: 'insertSize' });
|
|
626
|
+
},
|
|
529
627
|
},
|
|
628
|
+
{
|
|
629
|
+
label: 'Stranded paired-end',
|
|
630
|
+
onClick: () => {
|
|
631
|
+
self.setColorScheme({ type: 'reverseTemplate' });
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
label: 'Color by tag...',
|
|
636
|
+
onClick: () => {
|
|
637
|
+
getSession(self).queueDialog(doneCallback => [
|
|
638
|
+
ColorByTagDlg,
|
|
639
|
+
{ model: self, handleClose: doneCallback },
|
|
640
|
+
]);
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
],
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
label: 'Filter by',
|
|
647
|
+
icon: FilterListIcon,
|
|
648
|
+
onClick: () => {
|
|
649
|
+
getSession(self).queueDialog(doneCallback => [
|
|
650
|
+
FilterByTagDlg,
|
|
651
|
+
{ model: self, handleClose: doneCallback },
|
|
652
|
+
]);
|
|
530
653
|
},
|
|
531
|
-
],
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
label: 'Filter by',
|
|
535
|
-
icon: FilterListIcon,
|
|
536
|
-
onClick: () => {
|
|
537
|
-
getSession(self).queueDialog(doneCallback => [
|
|
538
|
-
FilterByTagDlg,
|
|
539
|
-
{ model: self, handleClose: doneCallback },
|
|
540
|
-
]);
|
|
541
654
|
},
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
655
|
+
{
|
|
656
|
+
label: 'Set feature height',
|
|
657
|
+
onClick: () => {
|
|
658
|
+
getSession(self).queueDialog(doneCallback => [
|
|
659
|
+
SetFeatureHeightDlg,
|
|
660
|
+
{ model: self, handleClose: doneCallback },
|
|
661
|
+
]);
|
|
662
|
+
},
|
|
550
663
|
},
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
664
|
+
{
|
|
665
|
+
label: 'Set max height',
|
|
666
|
+
onClick: () => {
|
|
667
|
+
getSession(self).queueDialog(doneCallback => [
|
|
668
|
+
SetMaxHeightDlg,
|
|
669
|
+
{ model: self, handleClose: doneCallback },
|
|
670
|
+
]);
|
|
671
|
+
},
|
|
559
672
|
},
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
673
|
+
{
|
|
674
|
+
label: 'Fade mismatches by quality',
|
|
675
|
+
type: 'checkbox',
|
|
676
|
+
checked: self.mismatchAlphaSetting,
|
|
677
|
+
onClick: () => {
|
|
678
|
+
self.toggleMismatchAlpha();
|
|
679
|
+
},
|
|
567
680
|
},
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
}
|
|
681
|
+
];
|
|
682
|
+
},
|
|
683
|
+
};
|
|
684
|
+
});
|
|
685
|
+
}
|
|
573
686
|
export default stateModelFactory;
|
|
574
687
|
//# sourceMappingURL=model.js.map
|