@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
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import {
|
|
3
3
|
ConfigurationReference,
|
|
4
4
|
AnyConfigurationModel,
|
|
5
|
+
AnyConfigurationSchemaType,
|
|
5
6
|
getConf,
|
|
6
7
|
} from '@jbrowse/core/configuration'
|
|
7
8
|
import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models'
|
|
@@ -11,30 +12,63 @@ import { autorun, when } from 'mobx'
|
|
|
11
12
|
import { addDisposer, getSnapshot, Instance, types } from 'mobx-state-tree'
|
|
12
13
|
import { getContainingTrack } from '@jbrowse/core/util'
|
|
13
14
|
import deepEqual from 'fast-deep-equal'
|
|
14
|
-
import { AlignmentsConfigModel } from './configSchema'
|
|
15
15
|
|
|
16
16
|
const minDisplayHeight = 20
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* #stateModel LinearAlignmentsDisplay
|
|
20
|
+
* extends `BaseDisplay`
|
|
21
|
+
*/
|
|
22
|
+
function stateModelFactory(
|
|
18
23
|
pluginManager: PluginManager,
|
|
19
|
-
configSchema:
|
|
20
|
-
)
|
|
24
|
+
configSchema: AnyConfigurationSchemaType,
|
|
25
|
+
) {
|
|
21
26
|
return types
|
|
22
27
|
.compose(
|
|
23
28
|
'LinearAlignmentsDisplay',
|
|
24
29
|
BaseDisplay,
|
|
25
30
|
types.model({
|
|
31
|
+
/**
|
|
32
|
+
* #property
|
|
33
|
+
* refers to LinearPileupDisplay sub-display model
|
|
34
|
+
*/
|
|
26
35
|
PileupDisplay: types.maybe(
|
|
27
36
|
pluginManager.getDisplayType('LinearPileupDisplay').stateModel,
|
|
28
37
|
),
|
|
38
|
+
/**
|
|
39
|
+
* #property
|
|
40
|
+
* refers to LinearSNPCoverageDisplay sub-display model
|
|
41
|
+
*/
|
|
29
42
|
SNPCoverageDisplay: types.maybe(
|
|
30
43
|
pluginManager.getDisplayType('LinearSNPCoverageDisplay').stateModel,
|
|
31
44
|
),
|
|
45
|
+
/**
|
|
46
|
+
* #property
|
|
47
|
+
*/
|
|
32
48
|
snpCovHeight: 45,
|
|
49
|
+
/**
|
|
50
|
+
* #property
|
|
51
|
+
*/
|
|
33
52
|
type: types.literal('LinearAlignmentsDisplay'),
|
|
53
|
+
/**
|
|
54
|
+
* #property
|
|
55
|
+
*/
|
|
34
56
|
configuration: ConfigurationReference(configSchema),
|
|
57
|
+
/**
|
|
58
|
+
* #property
|
|
59
|
+
*/
|
|
35
60
|
height: 250,
|
|
61
|
+
/**
|
|
62
|
+
* #property
|
|
63
|
+
*/
|
|
36
64
|
showCoverage: true,
|
|
65
|
+
/**
|
|
66
|
+
* #property
|
|
67
|
+
*/
|
|
37
68
|
showPileup: true,
|
|
69
|
+
/**
|
|
70
|
+
* #property
|
|
71
|
+
*/
|
|
38
72
|
userFeatureScreenDensity: types.maybe(types.number),
|
|
39
73
|
}),
|
|
40
74
|
)
|
|
@@ -42,15 +76,28 @@ const stateModelFactory = (
|
|
|
42
76
|
scrollTop: 0,
|
|
43
77
|
}))
|
|
44
78
|
.actions(self => ({
|
|
79
|
+
/**
|
|
80
|
+
* #action
|
|
81
|
+
*/
|
|
45
82
|
toggleCoverage() {
|
|
46
83
|
self.showCoverage = !self.showCoverage
|
|
47
84
|
},
|
|
85
|
+
/**
|
|
86
|
+
* #action
|
|
87
|
+
*/
|
|
48
88
|
togglePileup() {
|
|
49
89
|
self.showPileup = !self.showPileup
|
|
50
90
|
},
|
|
91
|
+
/**
|
|
92
|
+
* #action
|
|
93
|
+
*/
|
|
51
94
|
setScrollTop(scrollTop: number) {
|
|
52
95
|
self.scrollTop = scrollTop
|
|
53
96
|
},
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* #action
|
|
100
|
+
*/
|
|
54
101
|
setSNPCoverageHeight(n: number) {
|
|
55
102
|
self.snpCovHeight = n
|
|
56
103
|
},
|
|
@@ -58,6 +105,9 @@ const stateModelFactory = (
|
|
|
58
105
|
.views(self => {
|
|
59
106
|
const { trackMenuItems: superTrackMenuItems } = self
|
|
60
107
|
return {
|
|
108
|
+
/**
|
|
109
|
+
* #getter
|
|
110
|
+
*/
|
|
61
111
|
get pileupDisplayConfig() {
|
|
62
112
|
const conf = getConf(self, 'pileupDisplay')
|
|
63
113
|
const track = getContainingTrack(self)
|
|
@@ -69,31 +119,55 @@ const stateModelFactory = (
|
|
|
69
119
|
}
|
|
70
120
|
},
|
|
71
121
|
|
|
122
|
+
/**
|
|
123
|
+
* #method
|
|
124
|
+
*/
|
|
72
125
|
getFeatureByID(blockKey: string, id: string) {
|
|
73
126
|
return self.PileupDisplay.getFeatureByID(blockKey, id)
|
|
74
127
|
},
|
|
128
|
+
/**
|
|
129
|
+
* #method
|
|
130
|
+
*/
|
|
75
131
|
searchFeatureByID(id: string) {
|
|
76
132
|
return self.PileupDisplay.searchFeatureByID(id)
|
|
77
133
|
},
|
|
78
134
|
|
|
135
|
+
/**
|
|
136
|
+
* #getter
|
|
137
|
+
*/
|
|
79
138
|
get features() {
|
|
80
139
|
return self.PileupDisplay.features
|
|
81
140
|
},
|
|
82
141
|
|
|
142
|
+
/**
|
|
143
|
+
* #getter
|
|
144
|
+
*/
|
|
83
145
|
get DisplayBlurb() {
|
|
84
146
|
return self.PileupDisplay?.DisplayBlurb
|
|
85
147
|
},
|
|
86
148
|
|
|
149
|
+
/**
|
|
150
|
+
* #getter
|
|
151
|
+
*/
|
|
87
152
|
get sortedBy() {
|
|
88
153
|
return self.PileupDisplay.sortedBy
|
|
89
154
|
},
|
|
155
|
+
/**
|
|
156
|
+
* #getter
|
|
157
|
+
*/
|
|
90
158
|
get sortedByPosition() {
|
|
91
159
|
return self.PileupDisplay.sortedByPosition
|
|
92
160
|
},
|
|
161
|
+
/**
|
|
162
|
+
* #getter
|
|
163
|
+
*/
|
|
93
164
|
get sortedByRefName() {
|
|
94
165
|
return self.PileupDisplay.sortedByRefName
|
|
95
166
|
},
|
|
96
167
|
|
|
168
|
+
/**
|
|
169
|
+
* #getter
|
|
170
|
+
*/
|
|
97
171
|
get snpCoverageDisplayConfig() {
|
|
98
172
|
const conf = getConf(self, 'snpCoverageDisplay')
|
|
99
173
|
const track = getContainingTrack(self)
|
|
@@ -105,6 +179,9 @@ const stateModelFactory = (
|
|
|
105
179
|
}
|
|
106
180
|
},
|
|
107
181
|
|
|
182
|
+
/**
|
|
183
|
+
* #method
|
|
184
|
+
*/
|
|
108
185
|
trackMenuItems(): MenuItem[] {
|
|
109
186
|
return [
|
|
110
187
|
...superTrackMenuItems(),
|
|
@@ -123,6 +200,9 @@ const stateModelFactory = (
|
|
|
123
200
|
}
|
|
124
201
|
})
|
|
125
202
|
.actions(self => ({
|
|
203
|
+
/**
|
|
204
|
+
* #action
|
|
205
|
+
*/
|
|
126
206
|
setSNPCoverageDisplay(displayConfig: AnyConfigurationModel) {
|
|
127
207
|
self.SNPCoverageDisplay = {
|
|
128
208
|
type: 'LinearSNPCoverageDisplay',
|
|
@@ -130,16 +210,25 @@ const stateModelFactory = (
|
|
|
130
210
|
height: self.snpCovHeight,
|
|
131
211
|
}
|
|
132
212
|
},
|
|
213
|
+
/**
|
|
214
|
+
* #action
|
|
215
|
+
*/
|
|
133
216
|
setUserFeatureScreenDensity(limit: number) {
|
|
134
217
|
self.PileupDisplay.setUserFeatureScreenDensity(limit)
|
|
135
218
|
self.SNPCoverageDisplay.setUserFeatureScreenDensity(limit)
|
|
136
219
|
},
|
|
220
|
+
/**
|
|
221
|
+
* #action
|
|
222
|
+
*/
|
|
137
223
|
setPileupDisplay(displayConfig: AnyConfigurationModel) {
|
|
138
224
|
self.PileupDisplay = {
|
|
139
225
|
type: 'LinearPileupDisplay',
|
|
140
226
|
configuration: displayConfig,
|
|
141
227
|
}
|
|
142
228
|
},
|
|
229
|
+
/**
|
|
230
|
+
* #action
|
|
231
|
+
*/
|
|
143
232
|
setHeight(displayHeight: number) {
|
|
144
233
|
if (displayHeight > minDisplayHeight) {
|
|
145
234
|
self.height = displayHeight
|
|
@@ -148,6 +237,9 @@ const stateModelFactory = (
|
|
|
148
237
|
}
|
|
149
238
|
return self.height
|
|
150
239
|
},
|
|
240
|
+
/**
|
|
241
|
+
* #action
|
|
242
|
+
*/
|
|
151
243
|
resizeHeight(distance: number) {
|
|
152
244
|
const oldHeight = self.height
|
|
153
245
|
const newHeight = this.setHeight(self.height + distance)
|
|
@@ -218,6 +310,9 @@ const stateModelFactory = (
|
|
|
218
310
|
}),
|
|
219
311
|
)
|
|
220
312
|
},
|
|
313
|
+
/**
|
|
314
|
+
* #action
|
|
315
|
+
*/
|
|
221
316
|
async renderSvg(opts: { rasterizeLayers?: boolean }) {
|
|
222
317
|
const pileupHeight = self.height - self.SNPCoverageDisplay.height
|
|
223
318
|
await when(() => self.PileupDisplay.ready)
|
|
@@ -3,28 +3,43 @@ import { linearBasicDisplayConfigSchemaFactory } from '@jbrowse/plugin-linear-ge
|
|
|
3
3
|
import { types, Instance } from 'mobx-state-tree'
|
|
4
4
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* #config LinearPileupDisplay
|
|
8
|
+
*/
|
|
9
|
+
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
10
|
|
|
11
|
+
function PileupConfigFactory(pluginManager: PluginManager) {
|
|
10
12
|
// modify config schema to take in a sub coverage display
|
|
11
13
|
return ConfigurationSchema(
|
|
12
14
|
'LinearPileupDisplay',
|
|
13
15
|
{
|
|
16
|
+
/**
|
|
17
|
+
* #slot
|
|
18
|
+
*/
|
|
14
19
|
defaultRendering: {
|
|
15
20
|
type: 'stringEnum',
|
|
16
21
|
model: types.enumeration('Rendering', ['pileup']),
|
|
17
22
|
defaultValue: 'pileup',
|
|
18
23
|
},
|
|
24
|
+
/**
|
|
25
|
+
* #slot
|
|
26
|
+
*/
|
|
19
27
|
renderers: ConfigurationSchema('RenderersConfiguration', {
|
|
20
|
-
PileupRenderer:
|
|
28
|
+
PileupRenderer:
|
|
29
|
+
pluginManager.getRendererType('PileupRenderer').configSchema,
|
|
21
30
|
}),
|
|
22
|
-
|
|
31
|
+
/**
|
|
32
|
+
* #slot
|
|
33
|
+
*/
|
|
23
34
|
maxFeatureScreenDensity: {
|
|
24
35
|
type: 'number',
|
|
25
36
|
description: 'maximum features per pixel that is displayed in the view',
|
|
26
37
|
defaultValue: 5,
|
|
27
38
|
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* #slot
|
|
42
|
+
*/
|
|
28
43
|
colorScheme: {
|
|
29
44
|
type: 'stringEnum',
|
|
30
45
|
model: types.enumeration('colorScheme', [
|
|
@@ -40,6 +55,9 @@ function PileupConfigFactory(pluginManager: PluginManager) {
|
|
|
40
55
|
},
|
|
41
56
|
},
|
|
42
57
|
{
|
|
58
|
+
/**
|
|
59
|
+
* #baseConfiguration
|
|
60
|
+
*/
|
|
43
61
|
baseConfiguration: linearBasicDisplayConfigSchemaFactory(pluginManager),
|
|
44
62
|
explicitlyTyped: true,
|
|
45
63
|
},
|
|
@@ -53,20 +53,50 @@ const rendererTypes = new Map([
|
|
|
53
53
|
|
|
54
54
|
type LGV = LinearGenomeViewModel
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
/**
|
|
57
|
+
* #stateModel LinearPileupDisplay
|
|
58
|
+
*/
|
|
59
|
+
function stateModelFactory(configSchema: LinearPileupDisplayConfigModel) {
|
|
60
|
+
return types
|
|
58
61
|
.compose(
|
|
59
62
|
'LinearPileupDisplay',
|
|
60
63
|
BaseLinearDisplay,
|
|
61
64
|
types.model({
|
|
65
|
+
/**
|
|
66
|
+
* #property
|
|
67
|
+
*/
|
|
62
68
|
type: types.literal('LinearPileupDisplay'),
|
|
69
|
+
/**
|
|
70
|
+
* #property
|
|
71
|
+
*/
|
|
63
72
|
configuration: ConfigurationReference(configSchema),
|
|
73
|
+
/**
|
|
74
|
+
* #property
|
|
75
|
+
*/
|
|
64
76
|
showSoftClipping: false,
|
|
77
|
+
/**
|
|
78
|
+
* #property
|
|
79
|
+
*/
|
|
65
80
|
featureHeight: types.maybe(types.number),
|
|
81
|
+
/**
|
|
82
|
+
* #property
|
|
83
|
+
*/
|
|
66
84
|
noSpacing: types.maybe(types.boolean),
|
|
85
|
+
/**
|
|
86
|
+
* #property
|
|
87
|
+
*/
|
|
67
88
|
fadeLikelihood: types.maybe(types.boolean),
|
|
89
|
+
/**
|
|
90
|
+
* #property
|
|
91
|
+
*/
|
|
68
92
|
trackMaxHeight: types.maybe(types.number),
|
|
93
|
+
/**
|
|
94
|
+
* #property
|
|
95
|
+
*/
|
|
69
96
|
mismatchAlpha: types.maybe(types.boolean),
|
|
97
|
+
/**
|
|
98
|
+
* #property
|
|
99
|
+
*/
|
|
70
100
|
sortedBy: types.maybe(
|
|
71
101
|
types.model({
|
|
72
102
|
type: types.string,
|
|
@@ -76,6 +106,10 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
76
106
|
assemblyName: types.string,
|
|
77
107
|
}),
|
|
78
108
|
),
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* #property
|
|
112
|
+
*/
|
|
79
113
|
colorBy: types.maybe(
|
|
80
114
|
types.model({
|
|
81
115
|
type: types.string,
|
|
@@ -103,25 +137,43 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
103
137
|
ready: false,
|
|
104
138
|
}))
|
|
105
139
|
.actions(self => ({
|
|
140
|
+
/**
|
|
141
|
+
* #action
|
|
142
|
+
*/
|
|
106
143
|
setReady(flag: boolean) {
|
|
107
144
|
self.ready = flag
|
|
108
145
|
},
|
|
146
|
+
/**
|
|
147
|
+
* #action
|
|
148
|
+
*/
|
|
109
149
|
setMaxHeight(n: number) {
|
|
110
150
|
self.trackMaxHeight = n
|
|
111
151
|
},
|
|
152
|
+
/**
|
|
153
|
+
* #action
|
|
154
|
+
*/
|
|
112
155
|
setFeatureHeight(n: number) {
|
|
113
156
|
self.featureHeight = n
|
|
114
157
|
},
|
|
158
|
+
/**
|
|
159
|
+
* #action
|
|
160
|
+
*/
|
|
115
161
|
setNoSpacing(flag: boolean) {
|
|
116
162
|
self.noSpacing = flag
|
|
117
163
|
},
|
|
118
164
|
|
|
165
|
+
/**
|
|
166
|
+
* #action
|
|
167
|
+
*/
|
|
119
168
|
setColorScheme(colorScheme: { type: string; tag?: string }) {
|
|
120
169
|
self.colorTagMap = observable.map({}) // clear existing mapping
|
|
121
170
|
self.colorBy = cast(colorScheme)
|
|
122
171
|
self.ready = false
|
|
123
172
|
},
|
|
124
173
|
|
|
174
|
+
/**
|
|
175
|
+
* #action
|
|
176
|
+
*/
|
|
125
177
|
updateModificationColorMap(uniqueModifications: string[]) {
|
|
126
178
|
const colorPalette = ['red', 'blue', 'green', 'orange', 'purple']
|
|
127
179
|
uniqueModifications.forEach(value => {
|
|
@@ -133,6 +185,9 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
133
185
|
})
|
|
134
186
|
},
|
|
135
187
|
|
|
188
|
+
/**
|
|
189
|
+
* #action
|
|
190
|
+
*/
|
|
136
191
|
updateColorTagMap(uniqueTag: string[]) {
|
|
137
192
|
// pale color scheme
|
|
138
193
|
// https://cran.r-project.org/web/packages/khroma/vignettes/tol.html
|
|
@@ -158,6 +213,9 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
158
213
|
}
|
|
159
214
|
})
|
|
160
215
|
},
|
|
216
|
+
/**
|
|
217
|
+
* #action
|
|
218
|
+
*/
|
|
161
219
|
setFeatureUnderMouse(feat?: Feature) {
|
|
162
220
|
self.featureUnderMouseVolatile = feat
|
|
163
221
|
},
|
|
@@ -285,6 +343,10 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
285
343
|
}),
|
|
286
344
|
)
|
|
287
345
|
},
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* #action
|
|
349
|
+
*/
|
|
288
350
|
selectFeature(feature: Feature) {
|
|
289
351
|
const session = getSession(self)
|
|
290
352
|
if (isSessionModelWithWidgets(session)) {
|
|
@@ -298,11 +360,17 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
298
360
|
session.setSelection(feature)
|
|
299
361
|
},
|
|
300
362
|
|
|
363
|
+
/**
|
|
364
|
+
* #action
|
|
365
|
+
*/
|
|
301
366
|
clearSelected() {
|
|
302
367
|
self.sortedBy = undefined
|
|
303
368
|
},
|
|
304
369
|
|
|
305
|
-
|
|
370
|
+
/**
|
|
371
|
+
* #action
|
|
372
|
+
* uses copy-to-clipboard and generates notification
|
|
373
|
+
*/
|
|
306
374
|
copyFeatureToClipboard(feature: Feature) {
|
|
307
375
|
const { uniqueId, ...rest } = feature.toJSON()
|
|
308
376
|
const session = getSession(self)
|
|
@@ -310,17 +378,30 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
310
378
|
session.notify('Copied to clipboard', 'success')
|
|
311
379
|
},
|
|
312
380
|
|
|
381
|
+
/**
|
|
382
|
+
* #action
|
|
383
|
+
*/
|
|
313
384
|
toggleSoftClipping() {
|
|
314
385
|
self.showSoftClipping = !self.showSoftClipping
|
|
315
386
|
},
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* #action
|
|
390
|
+
*/
|
|
316
391
|
toggleMismatchAlpha() {
|
|
317
392
|
self.mismatchAlpha = !self.mismatchAlpha
|
|
318
393
|
},
|
|
319
394
|
|
|
395
|
+
/**
|
|
396
|
+
* #action
|
|
397
|
+
*/
|
|
320
398
|
setConfig(configuration: AnyConfigurationModel) {
|
|
321
399
|
self.configuration = configuration
|
|
322
400
|
},
|
|
323
401
|
|
|
402
|
+
/**
|
|
403
|
+
* #action
|
|
404
|
+
*/
|
|
324
405
|
setSortedBy(type: string, tag?: string) {
|
|
325
406
|
const { centerLineInfo } = getContainingView(self) as LGV
|
|
326
407
|
if (!centerLineInfo) {
|
|
@@ -356,6 +437,9 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
356
437
|
const superReload = self.reload
|
|
357
438
|
|
|
358
439
|
return {
|
|
440
|
+
/**
|
|
441
|
+
* #action
|
|
442
|
+
*/
|
|
359
443
|
reload() {
|
|
360
444
|
self.clearSelected()
|
|
361
445
|
superReload()
|
|
@@ -364,12 +448,19 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
364
448
|
})
|
|
365
449
|
|
|
366
450
|
.views(self => ({
|
|
451
|
+
/**
|
|
452
|
+
* #getter
|
|
453
|
+
*/
|
|
367
454
|
get maxHeight() {
|
|
368
455
|
const conf = getConf(self, ['renderers', self.rendererTypeName]) || {}
|
|
369
456
|
return self.trackMaxHeight !== undefined
|
|
370
457
|
? self.trackMaxHeight
|
|
371
458
|
: conf.maxHeight
|
|
372
459
|
},
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* #getter
|
|
463
|
+
*/
|
|
373
464
|
get rendererConfig() {
|
|
374
465
|
const configBlob =
|
|
375
466
|
getConf(self, ['renderers', self.rendererTypeName]) || {}
|
|
@@ -384,16 +475,26 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
384
475
|
getEnv(self),
|
|
385
476
|
)
|
|
386
477
|
},
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* #getter
|
|
481
|
+
*/
|
|
387
482
|
get featureHeightSetting() {
|
|
388
483
|
return (
|
|
389
484
|
self.featureHeight || readConfObject(this.rendererConfig, 'height')
|
|
390
485
|
)
|
|
391
486
|
},
|
|
487
|
+
/**
|
|
488
|
+
* #getter
|
|
489
|
+
*/
|
|
392
490
|
get mismatchAlphaSetting() {
|
|
393
491
|
return self.mismatchAlpha !== undefined
|
|
394
492
|
? self.mismatchAlpha
|
|
395
493
|
: readConfObject(this.rendererConfig, 'mismatchAlpha')
|
|
396
494
|
},
|
|
495
|
+
/**
|
|
496
|
+
* #getter
|
|
497
|
+
*/
|
|
397
498
|
get featureUnderMouse() {
|
|
398
499
|
return self.featureUnderMouseVolatile
|
|
399
500
|
},
|
|
@@ -405,6 +506,9 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
405
506
|
} = self
|
|
406
507
|
|
|
407
508
|
return {
|
|
509
|
+
/**
|
|
510
|
+
* #getter
|
|
511
|
+
*/
|
|
408
512
|
get rendererTypeName() {
|
|
409
513
|
const viewName = getConf(self, 'defaultRendering')
|
|
410
514
|
const rendererType = rendererTypes.get(viewName)
|
|
@@ -414,6 +518,9 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
414
518
|
return rendererType
|
|
415
519
|
},
|
|
416
520
|
|
|
521
|
+
/**
|
|
522
|
+
* #method
|
|
523
|
+
*/
|
|
417
524
|
contextMenuItems() {
|
|
418
525
|
const feat = self.contextMenuFeature
|
|
419
526
|
const contextMenuItems = feat
|
|
@@ -442,10 +549,15 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
442
549
|
return contextMenuItems
|
|
443
550
|
},
|
|
444
551
|
|
|
552
|
+
/**
|
|
553
|
+
* #getter
|
|
554
|
+
*/
|
|
445
555
|
get DisplayBlurb() {
|
|
446
556
|
return LinearPileupDisplayBlurb
|
|
447
557
|
},
|
|
448
|
-
|
|
558
|
+
/**
|
|
559
|
+
* #method
|
|
560
|
+
*/
|
|
449
561
|
renderProps() {
|
|
450
562
|
const view = getContainingView(self) as LGV
|
|
451
563
|
const {
|
|
@@ -543,6 +655,9 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
543
655
|
}
|
|
544
656
|
},
|
|
545
657
|
|
|
658
|
+
/**
|
|
659
|
+
* #method
|
|
660
|
+
*/
|
|
546
661
|
trackMenuItems() {
|
|
547
662
|
return [
|
|
548
663
|
...superTrackMenuItems(),
|
|
@@ -698,6 +813,7 @@ const stateModelFactory = (configSchema: LinearPileupDisplayConfigModel) =>
|
|
|
698
813
|
},
|
|
699
814
|
}
|
|
700
815
|
})
|
|
816
|
+
}
|
|
701
817
|
|
|
702
818
|
export type LinearPileupDisplayStateModel = ReturnType<typeof stateModelFactory>
|
|
703
819
|
export type LinearPileupDisplayModel = Instance<LinearPileupDisplayStateModel>
|
|
@@ -3,14 +3,18 @@ import { baseLinearDisplayConfigSchema } from '@jbrowse/plugin-linear-genome-vie
|
|
|
3
3
|
import { types } from 'mobx-state-tree'
|
|
4
4
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* #config LinearSNPCoverageDisplay
|
|
8
|
+
*/
|
|
9
|
+
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
10
10
|
|
|
11
|
+
export default function SNPCoverageConfigFactory(pluginManager: PluginManager) {
|
|
11
12
|
return ConfigurationSchema(
|
|
12
13
|
'LinearSNPCoverageDisplay',
|
|
13
14
|
{
|
|
15
|
+
/**
|
|
16
|
+
* #slot
|
|
17
|
+
*/
|
|
14
18
|
autoscale: {
|
|
15
19
|
type: 'stringEnum',
|
|
16
20
|
defaultValue: 'local',
|
|
@@ -18,38 +22,61 @@ export default function SNPCoverageConfigFactory(pluginManager: PluginManager) {
|
|
|
18
22
|
description:
|
|
19
23
|
'performs local autoscaling (no other options for SNP Coverage available)',
|
|
20
24
|
},
|
|
25
|
+
/**
|
|
26
|
+
* #slot
|
|
27
|
+
*/
|
|
21
28
|
minScore: {
|
|
22
29
|
type: 'number',
|
|
23
30
|
defaultValue: Number.MIN_VALUE,
|
|
24
31
|
description: 'minimum value for the y-scale',
|
|
25
32
|
},
|
|
33
|
+
/**
|
|
34
|
+
* #slot
|
|
35
|
+
*/
|
|
26
36
|
maxScore: {
|
|
27
37
|
type: 'number',
|
|
28
38
|
description: 'maximum value for the y-scale',
|
|
29
39
|
defaultValue: Number.MAX_VALUE,
|
|
30
40
|
},
|
|
41
|
+
/**
|
|
42
|
+
* #slot
|
|
43
|
+
*/
|
|
31
44
|
scaleType: {
|
|
32
45
|
type: 'stringEnum',
|
|
33
46
|
model: types.enumeration('Scale type', ['linear', 'log']), // todo zscale
|
|
34
47
|
description: 'The type of scale to use',
|
|
35
48
|
defaultValue: 'linear',
|
|
36
49
|
},
|
|
37
|
-
|
|
50
|
+
/**
|
|
51
|
+
* #slot
|
|
52
|
+
*/ inverted: {
|
|
38
53
|
type: 'boolean',
|
|
39
54
|
description: 'draw upside down',
|
|
40
55
|
defaultValue: false,
|
|
41
56
|
},
|
|
42
|
-
|
|
57
|
+
/**
|
|
58
|
+
* #slot
|
|
59
|
+
*/
|
|
43
60
|
multiTicks: {
|
|
44
61
|
type: 'boolean',
|
|
45
62
|
description: 'Display multiple values for the ticks',
|
|
46
63
|
defaultValue: false,
|
|
47
64
|
},
|
|
48
|
-
|
|
65
|
+
/**
|
|
66
|
+
* #slot
|
|
67
|
+
*/
|
|
49
68
|
renderers: ConfigurationSchema('RenderersConfiguration', {
|
|
50
|
-
SNPCoverageRenderer:
|
|
69
|
+
SNPCoverageRenderer: pluginManager.getRendererType(
|
|
70
|
+
'SNPCoverageRenderer',
|
|
71
|
+
).configSchema,
|
|
51
72
|
}),
|
|
52
73
|
},
|
|
53
|
-
{
|
|
74
|
+
{
|
|
75
|
+
/**
|
|
76
|
+
* #baseConfiguration
|
|
77
|
+
*/
|
|
78
|
+
baseConfiguration: baseLinearDisplayConfigSchema,
|
|
79
|
+
explicitlyTyped: true,
|
|
80
|
+
},
|
|
54
81
|
)
|
|
55
82
|
}
|