oncoprintjs 5.0.3 → 6.0.1

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.
Files changed (100) hide show
  1. package/README.md +34 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.es.js +14746 -0
  4. package/dist/index.es.js.map +1 -0
  5. package/dist/index.js +14760 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/js/CachedProperty.d.ts +10 -10
  8. package/dist/js/binarysearch.d.ts +1 -1
  9. package/dist/js/bucketsort.d.ts +16 -16
  10. package/dist/js/clustering.d.ts +14 -14
  11. package/dist/js/extractrgba.d.ts +4 -4
  12. package/dist/js/haselementsininterval.d.ts +1 -1
  13. package/dist/js/heatmapcolors.d.ts +5 -4
  14. package/dist/js/makesvgelement.d.ts +1 -1
  15. package/dist/js/modelutils.d.ts +7 -7
  16. package/dist/js/oncoprint.d.ts +168 -170
  17. package/dist/js/oncoprintheaderview.d.ts +23 -22
  18. package/dist/js/oncoprintlabelview.d.ts +79 -78
  19. package/dist/js/oncoprintlegendrenderer.d.ts +32 -31
  20. package/dist/js/oncoprintminimapview.d.ts +69 -68
  21. package/dist/js/oncoprintmodel.d.ts +403 -398
  22. package/dist/js/oncoprintruleset.d.ts +176 -177
  23. package/dist/js/oncoprintshape.d.ts +67 -67
  24. package/dist/js/oncoprintshapetosvg.d.ts +2 -2
  25. package/dist/js/oncoprintshapetovertexes.d.ts +5 -5
  26. package/dist/js/oncoprinttooltip.d.ts +23 -22
  27. package/dist/js/oncoprinttrackinfoview.d.ts +40 -39
  28. package/dist/js/oncoprinttrackoptionsview.d.ts +58 -57
  29. package/dist/js/oncoprintwebglcellview.d.ts +168 -167
  30. package/dist/js/oncoprintzoomslider.d.ts +28 -27
  31. package/dist/js/polyfill.d.ts +4 -4
  32. package/dist/js/precomputedcomparator.d.ts +13 -13
  33. package/dist/js/shaders.d.ts +2 -2
  34. package/dist/js/svgfactory.d.ts +24 -23
  35. package/dist/js/utils.d.ts +16 -16
  36. package/dist/js/workers/clustering-worker.d.ts +19 -20
  37. package/dist/test/gradientCategoricalRuleset.spec.d.ts +1 -1
  38. package/dist/test/monolith.spec.d.ts +1 -1
  39. package/jest.config.ts +2 -0
  40. package/package.json +20 -26
  41. package/rollup.config.ts +14 -0
  42. package/rules/geneticrules.ts +344 -305
  43. package/server.js +11 -0
  44. package/src/img/menudots.svg +9 -9
  45. package/src/img/zoomtofit.svg +12 -12
  46. package/src/index.tsx +13 -0
  47. package/src/js/CachedProperty.ts +6 -7
  48. package/src/js/binarysearch.ts +8 -3
  49. package/src/js/bucketsort.ts +89 -47
  50. package/src/js/clustering.ts +22 -10
  51. package/src/js/extractrgba.ts +16 -12
  52. package/src/js/haselementsininterval.ts +8 -4
  53. package/src/js/heatmapcolors.ts +515 -515
  54. package/src/js/main.js +1 -1
  55. package/src/js/makesvgelement.ts +2 -2
  56. package/src/js/modelutils.ts +11 -8
  57. package/src/js/oncoprint.ts +706 -385
  58. package/src/js/oncoprintheaderview.ts +165 -125
  59. package/src/js/oncoprintlabelview.ts +388 -170
  60. package/src/js/oncoprintlegendrenderer.ts +203 -72
  61. package/src/js/oncoprintminimapview.ts +965 -423
  62. package/src/js/oncoprintmodel.ts +905 -532
  63. package/src/js/oncoprintruleset.ts +694 -379
  64. package/src/js/oncoprintshape.ts +240 -97
  65. package/src/js/oncoprintshapetosvg.ts +77 -26
  66. package/src/js/oncoprintshapetovertexes.ts +153 -48
  67. package/src/js/oncoprinttooltip.ts +58 -27
  68. package/src/js/oncoprinttrackinfoview.ts +115 -59
  69. package/src/js/oncoprinttrackoptionsview.ts +354 -187
  70. package/src/js/oncoprintwebglcellview.ts +951 -415
  71. package/src/js/oncoprintzoomslider.ts +172 -107
  72. package/src/js/polyfill.ts +7 -3
  73. package/src/js/precomputedcomparator.ts +133 -50
  74. package/src/js/shaders.ts +2 -4
  75. package/src/js/svgfactory.ts +128 -73
  76. package/src/js/utils.ts +51 -31
  77. package/src/js/workers/clustering-worker.ts +50 -42
  78. package/src/test/gradientCategoricalRuleset.spec.ts +55 -38
  79. package/src/test/monolith.spec.ts +718 -285
  80. package/test/generate_data.py +108 -0
  81. package/test/glyphmap-data.js +1041 -0
  82. package/test/heatmap-data.js +1027 -0
  83. package/test/index.html +21 -0
  84. package/test/oncoprint-glyphmap.js +79 -0
  85. package/test/oncoprint-heatmap.js +123 -0
  86. package/tsconfig.json +4 -10
  87. package/tsconfig.test.json +11 -0
  88. package/.idea/misc.xml +0 -6
  89. package/.idea/modules.xml +0 -8
  90. package/.idea/oncoprintjs.iml +0 -12
  91. package/.idea/vcs.xml +0 -6
  92. package/.idea/workspace.xml +0 -105
  93. package/dist/.gitkeep +0 -0
  94. package/dist/js/minimaputils.d.ts +0 -0
  95. package/dist/oncoprint.bundle.js +0 -44313
  96. package/jest.config.js +0 -12
  97. package/src/js/minimaputils.ts +0 -0
  98. package/typings/custom.d.ts +0 -7
  99. package/typings/missing.d.ts +0 -7
  100. package/webpack.config.js +0 -43
@@ -1,36 +1,35 @@
1
- import * as $ from "jquery";
1
+ import * as $ from 'jquery';
2
2
  import {
3
3
  GeneticAlterationRuleParams,
4
4
  IGeneticAlterationRuleSetParams,
5
5
  RuleSetParams,
6
- RuleSetType
7
- } from "../src/js/oncoprintruleset";
8
- import {shallowExtend} from "../src/js/utils";
6
+ RuleSetType,
7
+ } from '../src/js/oncoprintruleset';
8
+ import { shallowExtend } from '../src/js/utils';
9
9
 
10
10
  export const MUT_COLOR_MISSENSE = '#008000';
11
11
  export const MUT_COLOR_MISSENSE_PASSENGER = '#53D400';
12
12
  export const MUT_COLOR_INFRAME = '#993404';
13
13
  export const MUT_COLOR_INFRAME_PASSENGER = '#a68028';
14
- export const MUT_COLOR_TRUNC = "#000000";
14
+ export const MUT_COLOR_TRUNC = '#000000';
15
15
  export const MUT_COLOR_TRUNC_PASSENGER = '#708090';
16
16
  export const MUT_COLOR_FUSION = '#8B00C9';
17
17
  export const MUT_COLOR_PROMOTER = '#00B7CE';
18
- export const MUT_COLOR_OTHER = '#cf58bc';//'#cfb537';
18
+ export const MUT_COLOR_OTHER = '#cf58bc'; //'#cfb537';
19
19
 
20
- export const MRNA_COLOR_HIGH = "#ff9999";
21
- export const MRNA_COLOR_LOW = "#6699cc";
20
+ export const MRNA_COLOR_HIGH = '#ff9999';
21
+ export const MRNA_COLOR_LOW = '#6699cc';
22
22
  export const MUT_COLOR_GERMLINE = '#FFFFFF';
23
23
 
24
- export const PROT_COLOR_HIGH = "#ff3df8";
25
- export const PROT_COLOR_LOW = "#00E1FF";
24
+ export const PROT_COLOR_HIGH = '#ff3df8';
25
+ export const PROT_COLOR_LOW = '#00E1FF';
26
26
 
27
- export const CNA_COLOR_AMP = "#ff0000";
28
- export const CNA_COLOR_GAIN = "#ffb6c1";
29
- export const CNA_COLOR_HETLOSS = "#8fd8d8";
30
- export const CNA_COLOR_HOMDEL = "#0000ff";
31
-
32
- export const DEFAULT_GREY = "#BEBEBE";
27
+ export const CNA_COLOR_AMP = '#ff0000';
28
+ export const CNA_COLOR_GAIN = '#ffb6c1';
29
+ export const CNA_COLOR_HETLOSS = '#8fd8d8';
30
+ export const CNA_COLOR_HOMDEL = '#0000ff';
33
31
 
32
+ export const DEFAULT_GREY = '#BEBEBE';
34
33
 
35
34
  const MUTATION_LEGEND_ORDER = 0;
36
35
  const FUSION_LEGEND_ORDER = 1;
@@ -45,431 +44,471 @@ const PROT_HIGH_LEGEND_ORDER = 31;
45
44
  const PROT_LOW_LEGEND_ORDER = 32;
46
45
 
47
46
  enum ShapeId {
48
- defaultGrayRectangle="defaultGrayRectangle",
47
+ defaultGrayRectangle = 'defaultGrayRectangle',
49
48
 
50
- ampRectangle="ampRectangle",
51
- gainRectangle="gainRectangle",
52
- homdelRectangle="homdelRectangle",
53
- hetlossRectangle="hetlossRectangle",
49
+ ampRectangle = 'ampRectangle',
50
+ gainRectangle = 'gainRectangle',
51
+ homdelRectangle = 'homdelRectangle',
52
+ hetlossRectangle = 'hetlossRectangle',
54
53
 
55
- mrnaHighRectangle="mrnaHighRectangle",
56
- mrnaLowRectangle="mrnaLowRectangle",
54
+ mrnaHighRectangle = 'mrnaHighRectangle',
55
+ mrnaLowRectangle = 'mrnaLowRectangle',
57
56
 
58
- protHighRectangle="protHighRectangle",
59
- protLowRectangle="protLowRectangle",
57
+ protHighRectangle = 'protHighRectangle',
58
+ protLowRectangle = 'protLowRectangle',
60
59
 
61
- fusionRectangle="fusionRectangle",
60
+ fusionRectangle = 'fusionRectangle',
62
61
 
63
- germlineRectangle="germlineRectangle",
62
+ germlineRectangle = 'germlineRectangle',
64
63
 
65
- missenseMutationDriverRectangle="missenseMutationDriverRectangle",
66
- missenseMutationVUSRectangle="missenseMutationVUSRectangle",
67
- otherMutationRectangle="otherMutationRectangle",
68
- promoterMutationRectangle="promoterMutationRectangle",
69
- truncatingMutationDriverRectangle="truncatingMutationDriverRectangle",
70
- truncatingMutationVUSRectangle="truncatingMutationVUSRectangle",
71
- inframeMutationDriverRectangle="inframeMutationDriverRectangle",
72
- inframeMutationVUSRectangle="inframeMutationVUSRectangle",
64
+ missenseMutationDriverRectangle = 'missenseMutationDriverRectangle',
65
+ missenseMutationVUSRectangle = 'missenseMutationVUSRectangle',
66
+ otherMutationRectangle = 'otherMutationRectangle',
67
+ promoterMutationRectangle = 'promoterMutationRectangle',
68
+ truncatingMutationDriverRectangle = 'truncatingMutationDriverRectangle',
69
+ truncatingMutationVUSRectangle = 'truncatingMutationVUSRectangle',
70
+ inframeMutationDriverRectangle = 'inframeMutationDriverRectangle',
71
+ inframeMutationVUSRectangle = 'inframeMutationVUSRectangle',
73
72
  }
74
73
 
75
74
  const shapeBank = {
76
75
  [ShapeId.defaultGrayRectangle]: {
77
- 'type': 'rectangle',
78
- 'fill': DEFAULT_GREY,
79
- 'z': 1
76
+ type: 'rectangle',
77
+ fill: DEFAULT_GREY,
78
+ z: 1,
80
79
  },
81
80
  [ShapeId.ampRectangle]: {
82
- 'type': 'rectangle',
83
- 'fill': CNA_COLOR_AMP,
84
- 'x': 0,
85
- 'y': 0,
86
- 'width': 100,
87
- 'height': 100,
88
- 'z': 2,
81
+ type: 'rectangle',
82
+ fill: CNA_COLOR_AMP,
83
+ x: 0,
84
+ y: 0,
85
+ width: 100,
86
+ height: 100,
87
+ z: 2,
89
88
  },
90
89
  [ShapeId.gainRectangle]: {
91
- 'type': 'rectangle',
92
- 'fill': CNA_COLOR_GAIN,
93
- 'x': 0,
94
- 'y': 0,
95
- 'width': 100,
96
- 'height': 100,
97
- 'z': 2,
90
+ type: 'rectangle',
91
+ fill: CNA_COLOR_GAIN,
92
+ x: 0,
93
+ y: 0,
94
+ width: 100,
95
+ height: 100,
96
+ z: 2,
98
97
  },
99
- [ShapeId.homdelRectangle]:{
100
- 'type': 'rectangle',
101
- 'fill': CNA_COLOR_HOMDEL,
102
- 'x': 0,
103
- 'y': 0,
104
- 'width': 100,
105
- 'height': 100,
106
- 'z': 2,
98
+ [ShapeId.homdelRectangle]: {
99
+ type: 'rectangle',
100
+ fill: CNA_COLOR_HOMDEL,
101
+ x: 0,
102
+ y: 0,
103
+ width: 100,
104
+ height: 100,
105
+ z: 2,
107
106
  },
108
- [ShapeId.hetlossRectangle]:{
109
- 'type': 'rectangle',
110
- 'fill': CNA_COLOR_HETLOSS,
111
- 'x': 0,
112
- 'y': 0,
113
- 'width': 100,
114
- 'height': 100,
115
- 'z': 2,
107
+ [ShapeId.hetlossRectangle]: {
108
+ type: 'rectangle',
109
+ fill: CNA_COLOR_HETLOSS,
110
+ x: 0,
111
+ y: 0,
112
+ width: 100,
113
+ height: 100,
114
+ z: 2,
116
115
  },
117
- [ShapeId.mrnaHighRectangle]:{
118
- 'type': 'rectangle',
119
- 'fill': 'rgba(0, 0, 0, 0)',
120
- 'stroke': MRNA_COLOR_HIGH,
116
+ [ShapeId.mrnaHighRectangle]: {
117
+ type: 'rectangle',
118
+ fill: 'rgba(0, 0, 0, 0)',
119
+ stroke: MRNA_COLOR_HIGH,
121
120
  'stroke-width': 2,
122
- 'x': 0,
123
- 'y': 0,
124
- 'width': 100,
125
- 'height': 100,
126
- 'z': 3,
121
+ x: 0,
122
+ y: 0,
123
+ width: 100,
124
+ height: 100,
125
+ z: 3,
127
126
  },
128
- [ShapeId.mrnaLowRectangle]:{
129
- 'type': 'rectangle',
130
- 'fill': 'rgba(0, 0, 0, 0)',
131
- 'stroke': MRNA_COLOR_LOW,
127
+ [ShapeId.mrnaLowRectangle]: {
128
+ type: 'rectangle',
129
+ fill: 'rgba(0, 0, 0, 0)',
130
+ stroke: MRNA_COLOR_LOW,
132
131
  'stroke-width': 2,
133
- 'x': 0,
134
- 'y': 0,
135
- 'width': 100,
136
- 'height': 100,
137
- 'z': 3,
132
+ x: 0,
133
+ y: 0,
134
+ width: 100,
135
+ height: 100,
136
+ z: 3,
138
137
  },
139
- [ShapeId.protHighRectangle]:{
140
- 'type': 'rectangle',
141
- 'fill': PROT_COLOR_HIGH,
142
- 'x':0,
143
- 'y':0,
144
- 'width':100,
145
- 'height':20,
146
- 'z': 4,
138
+ [ShapeId.protHighRectangle]: {
139
+ type: 'rectangle',
140
+ fill: PROT_COLOR_HIGH,
141
+ x: 0,
142
+ y: 0,
143
+ width: 100,
144
+ height: 20,
145
+ z: 4,
147
146
  },
148
- [ShapeId.protLowRectangle]:{
149
- 'type': 'rectangle',
150
- 'fill': PROT_COLOR_LOW,
151
- 'x':0,
152
- 'y':80,
153
- 'width':100,
154
- 'height':20,
155
- 'z': 4,
147
+ [ShapeId.protLowRectangle]: {
148
+ type: 'rectangle',
149
+ fill: PROT_COLOR_LOW,
150
+ x: 0,
151
+ y: 80,
152
+ width: 100,
153
+ height: 20,
154
+ z: 4,
156
155
  },
157
- [ShapeId.fusionRectangle]:{
158
- 'type': 'rectangle',
159
- 'fill': MUT_COLOR_FUSION,
160
- 'x': 0,
161
- 'y': 20,
162
- 'width': 100,
163
- 'height': 60,
164
- 'z': 5
156
+ [ShapeId.fusionRectangle]: {
157
+ type: 'rectangle',
158
+ fill: MUT_COLOR_FUSION,
159
+ x: 0,
160
+ y: 20,
161
+ width: 100,
162
+ height: 60,
163
+ z: 5,
165
164
  },
166
- [ShapeId.germlineRectangle]:{
167
- 'type': 'rectangle',
168
- 'fill': MUT_COLOR_GERMLINE,
169
- 'x': 0,
170
- 'y': 46,
171
- 'width': 100,
172
- 'height': 8,
173
- 'z': 7
165
+ [ShapeId.germlineRectangle]: {
166
+ type: 'rectangle',
167
+ fill: MUT_COLOR_GERMLINE,
168
+ x: 0,
169
+ y: 46,
170
+ width: 100,
171
+ height: 8,
172
+ z: 7,
174
173
  },
175
- [ShapeId.missenseMutationDriverRectangle]:{
176
- 'type': 'rectangle',
177
- 'fill': MUT_COLOR_MISSENSE,
178
- 'x': 0,
179
- 'y': 33.33,
180
- 'width': 100,
181
- 'height': 33.33,
182
- 'z': 6
174
+ [ShapeId.missenseMutationDriverRectangle]: {
175
+ type: 'rectangle',
176
+ fill: MUT_COLOR_MISSENSE,
177
+ x: 0,
178
+ y: 33.33,
179
+ width: 100,
180
+ height: 33.33,
181
+ z: 6,
183
182
  },
184
- [ShapeId.missenseMutationVUSRectangle]:{
185
- 'type': 'rectangle',
186
- 'fill': MUT_COLOR_MISSENSE_PASSENGER,
187
- 'x': 0,
188
- 'y': 33.33,
189
- 'width': 100,
190
- 'height': 33.33,
191
- 'z': 6
183
+ [ShapeId.missenseMutationVUSRectangle]: {
184
+ type: 'rectangle',
185
+ fill: MUT_COLOR_MISSENSE_PASSENGER,
186
+ x: 0,
187
+ y: 33.33,
188
+ width: 100,
189
+ height: 33.33,
190
+ z: 6,
192
191
  },
193
- [ShapeId.otherMutationRectangle]:{
194
- 'type': 'rectangle',
195
- 'fill': MUT_COLOR_OTHER,
196
- 'x': 0,
197
- 'y': 33.33,
198
- 'width': 100,
199
- 'height': 33.33,
200
- 'z': 6,
192
+ [ShapeId.otherMutationRectangle]: {
193
+ type: 'rectangle',
194
+ fill: MUT_COLOR_OTHER,
195
+ x: 0,
196
+ y: 33.33,
197
+ width: 100,
198
+ height: 33.33,
199
+ z: 6,
201
200
  },
202
- [ShapeId.promoterMutationRectangle]:{
203
- 'type': 'rectangle',
204
- 'fill': MUT_COLOR_PROMOTER,
205
- 'x': 0,
206
- 'y': 33.33,
207
- 'width': 100,
208
- 'height': 33.33,
209
- 'z': 6,
201
+ [ShapeId.promoterMutationRectangle]: {
202
+ type: 'rectangle',
203
+ fill: MUT_COLOR_PROMOTER,
204
+ x: 0,
205
+ y: 33.33,
206
+ width: 100,
207
+ height: 33.33,
208
+ z: 6,
210
209
  },
211
- [ShapeId.truncatingMutationDriverRectangle]:{
212
- 'type': 'rectangle',
213
- 'fill': MUT_COLOR_TRUNC,
214
- 'x': 0,
215
- 'y': 33.33,
216
- 'width': 100,
217
- 'height': 33.33,
218
- 'z': 6,
210
+ [ShapeId.truncatingMutationDriverRectangle]: {
211
+ type: 'rectangle',
212
+ fill: MUT_COLOR_TRUNC,
213
+ x: 0,
214
+ y: 33.33,
215
+ width: 100,
216
+ height: 33.33,
217
+ z: 6,
219
218
  },
220
- [ShapeId.truncatingMutationVUSRectangle]:{
221
- 'type': 'rectangle',
222
- 'fill': MUT_COLOR_TRUNC_PASSENGER,
223
- 'x': 0,
224
- 'y': 33.33,
225
- 'width': 100,
226
- 'height': 33.33,
227
- 'z': 6,
219
+ [ShapeId.truncatingMutationVUSRectangle]: {
220
+ type: 'rectangle',
221
+ fill: MUT_COLOR_TRUNC_PASSENGER,
222
+ x: 0,
223
+ y: 33.33,
224
+ width: 100,
225
+ height: 33.33,
226
+ z: 6,
228
227
  },
229
- [ShapeId.inframeMutationDriverRectangle]:{
230
- 'type': 'rectangle',
231
- 'fill': MUT_COLOR_INFRAME,
232
- 'x': 0,
233
- 'y': 33.33,
234
- 'width': 100,
235
- 'height': 33.33,
236
- 'z': 6,
228
+ [ShapeId.inframeMutationDriverRectangle]: {
229
+ type: 'rectangle',
230
+ fill: MUT_COLOR_INFRAME,
231
+ x: 0,
232
+ y: 33.33,
233
+ width: 100,
234
+ height: 33.33,
235
+ z: 6,
236
+ },
237
+ [ShapeId.inframeMutationVUSRectangle]: {
238
+ type: 'rectangle',
239
+ fill: MUT_COLOR_INFRAME_PASSENGER,
240
+ x: 0,
241
+ y: 33.33,
242
+ width: 100,
243
+ height: 33.33,
244
+ z: 6,
237
245
  },
238
- [ShapeId.inframeMutationVUSRectangle]:{
239
- 'type': 'rectangle',
240
- 'fill': MUT_COLOR_INFRAME_PASSENGER,
241
- 'x': 0,
242
- 'y': 33.33,
243
- 'width': 100,
244
- 'height': 33.33,
245
- 'z': 6,
246
- }
247
246
  };
248
247
 
249
- const non_mutation_rule_params:GeneticAlterationRuleParams = {
248
+ const non_mutation_rule_params: GeneticAlterationRuleParams = {
250
249
  // Default: gray rectangle
251
250
  always: {
252
251
  shapes: [shapeBank[ShapeId.defaultGrayRectangle]],
253
- legend_label: "No alterations",
254
- legend_order: Number.POSITIVE_INFINITY // put at the end always
252
+ legend_label: 'No alterations',
253
+ legend_order: Number.POSITIVE_INFINITY, // put at the end always
255
254
  },
256
- conditional:{
255
+ conditional: {
257
256
  // Copy number alteration
258
- 'disp_cna': {
257
+ disp_cna: {
259
258
  // Red rectangle for amplification
260
- 'amp': {
259
+ amp: {
261
260
  shapes: [shapeBank[ShapeId.ampRectangle]],
262
261
  legend_label: 'Amplification',
263
- legend_order: AMP_LEGEND_ORDER
262
+ legend_order: AMP_LEGEND_ORDER,
264
263
  },
265
264
  // Light red rectangle for gain
266
- 'gain': {
265
+ gain: {
267
266
  shapes: [shapeBank[ShapeId.gainRectangle]],
268
267
  legend_label: 'Gain',
269
- legend_order: GAIN_LEGEND_ORDER
268
+ legend_order: GAIN_LEGEND_ORDER,
270
269
  },
271
270
  // Blue rectangle for deep deletion
272
- 'homdel': {
271
+ homdel: {
273
272
  shapes: [shapeBank[ShapeId.homdelRectangle]],
274
273
  legend_label: 'Deep Deletion',
275
- legend_order: HOMDEL_LEGEND_ORDER
274
+ legend_order: HOMDEL_LEGEND_ORDER,
276
275
  },
277
276
  // Light blue rectangle for shallow deletion
278
- 'hetloss': {
277
+ hetloss: {
279
278
  shapes: [shapeBank[ShapeId.hetlossRectangle]],
280
279
  legend_label: 'Shallow Deletion',
281
- legend_order: HETLOSS_LEGEND_ORDER
282
- }
280
+ legend_order: HETLOSS_LEGEND_ORDER,
281
+ },
283
282
  },
284
283
  // mRNA regulation
285
- 'disp_mrna': {
284
+ disp_mrna: {
286
285
  // Light red outline for High
287
- 'high': {
286
+ high: {
288
287
  shapes: [shapeBank[ShapeId.mrnaHighRectangle]],
289
288
  legend_label: 'mRNA High',
290
- legend_order: MRNA_HIGH_LEGEND_ORDER
289
+ legend_order: MRNA_HIGH_LEGEND_ORDER,
291
290
  },
292
291
  // Light blue outline for downregulation
293
- 'low': {
292
+ low: {
294
293
  shapes: [shapeBank[ShapeId.mrnaLowRectangle]],
295
294
  legend_label: 'mRNA Low',
296
- legend_order: MRNA_LOW_LEGEND_ORDER
295
+ legend_order: MRNA_LOW_LEGEND_ORDER,
297
296
  },
298
297
  },
299
298
  // protein expression regulation
300
- 'disp_prot': {
299
+ disp_prot: {
301
300
  // small up arrow for upregulated
302
- 'high': {
301
+ high: {
303
302
  shapes: [shapeBank[ShapeId.protHighRectangle]],
304
303
  legend_label: 'Protein High',
305
- legend_order: PROT_HIGH_LEGEND_ORDER
304
+ legend_order: PROT_HIGH_LEGEND_ORDER,
306
305
  },
307
306
  // small down arrow for upregulated
308
- 'low': {
307
+ low: {
309
308
  shapes: [shapeBank[ShapeId.protLowRectangle]],
310
309
  legend_label: 'Protein Low',
311
- legend_order: PROT_LOW_LEGEND_ORDER
312
- }
310
+ legend_order: PROT_LOW_LEGEND_ORDER,
311
+ },
313
312
  },
314
313
  // fusion
315
- 'disp_fusion': {
314
+ disp_fusion: {
316
315
  // tall inset purple rectangle for fusion
317
- 'true': {
316
+ true: {
318
317
  shapes: [shapeBank[ShapeId.fusionRectangle]],
319
318
  legend_label: 'Fusion',
320
- legend_order: FUSION_LEGEND_ORDER
321
- }
322
- }
323
- }
319
+ legend_order: FUSION_LEGEND_ORDER,
320
+ },
321
+ },
322
+ },
324
323
  };
325
324
 
326
325
  export const germline_rule_params = {
327
326
  // germline
328
- 'disp_germ': {
327
+ disp_germ: {
329
328
  // white stripe in the middle
330
- 'true': {
331
- shapes: [{
332
- 'type': 'rectangle',
333
- 'fill': MUT_COLOR_GERMLINE,
334
- 'x': 0,
335
- 'y': 46,
336
- 'width': 100,
337
- 'height': 8,
338
- 'z': 7
339
- }],
329
+ true: {
330
+ shapes: [
331
+ {
332
+ type: 'rectangle',
333
+ fill: MUT_COLOR_GERMLINE,
334
+ x: 0,
335
+ y: 46,
336
+ width: 100,
337
+ height: 8,
338
+ z: 7,
339
+ },
340
+ ],
340
341
  legend_label: 'Germline Mutation',
341
- legend_order: GERMLINE_LEGEND_ORDER
342
- }
343
- }
342
+ legend_order: GERMLINE_LEGEND_ORDER,
343
+ },
344
+ },
344
345
  };
345
346
 
346
- const base_genetic_rule_set_params:Partial<IGeneticAlterationRuleSetParams> = {
347
+ const base_genetic_rule_set_params: Partial<IGeneticAlterationRuleSetParams> = {
347
348
  type: RuleSetType.GENE,
348
349
  legend_label: 'Genetic Alteration',
349
350
  na_legend_label: 'Not profiled',
350
- legend_base_color: DEFAULT_GREY
351
+ legend_base_color: DEFAULT_GREY,
351
352
  };
352
353
 
353
- export const genetic_rule_set_same_color_for_all_no_recurrence:IGeneticAlterationRuleSetParams =
354
- shallowExtend(base_genetic_rule_set_params, {
355
- 'rule_params': {
356
- always:non_mutation_rule_params.always,
354
+ export const genetic_rule_set_same_color_for_all_no_recurrence: IGeneticAlterationRuleSetParams = shallowExtend(
355
+ base_genetic_rule_set_params,
356
+ {
357
+ rule_params: {
358
+ always: non_mutation_rule_params.always,
357
359
  conditional: shallowExtend(non_mutation_rule_params.conditional, {
358
- 'disp_mut': {
360
+ disp_mut: {
359
361
  'trunc,inframe,missense,promoter,other,trunc_rec,inframe_rec,missense_rec,promoter_rec,other_rec': {
360
- shapes: [shapeBank[ShapeId.missenseMutationDriverRectangle]],
362
+ shapes: [
363
+ shapeBank[ShapeId.missenseMutationDriverRectangle],
364
+ ],
361
365
  legend_label: 'Mutation',
362
- legend_order: MUTATION_LEGEND_ORDER
363
- }
364
- }
365
- } as GeneticAlterationRuleParams["conditional"])
366
- }
367
- }) as IGeneticAlterationRuleSetParams;
366
+ legend_order: MUTATION_LEGEND_ORDER,
367
+ },
368
+ },
369
+ } as GeneticAlterationRuleParams['conditional']),
370
+ },
371
+ }
372
+ ) as IGeneticAlterationRuleSetParams;
368
373
 
369
- export const genetic_rule_set_same_color_for_all_recurrence:IGeneticAlterationRuleSetParams =
370
- shallowExtend(base_genetic_rule_set_params, {
371
- 'rule_params': {
372
- always:non_mutation_rule_params.always,
374
+ export const genetic_rule_set_same_color_for_all_recurrence: IGeneticAlterationRuleSetParams = shallowExtend(
375
+ base_genetic_rule_set_params,
376
+ {
377
+ rule_params: {
378
+ always: non_mutation_rule_params.always,
373
379
  conditional: shallowExtend(non_mutation_rule_params.conditional, {
374
- 'disp_mut': {
380
+ disp_mut: {
375
381
  'missense_rec,inframe_rec,trunc_rec,promoter_rec,other_rec': {
376
- shapes: [shapeBank[ShapeId.missenseMutationDriverRectangle]],
382
+ shapes: [
383
+ shapeBank[ShapeId.missenseMutationDriverRectangle],
384
+ ],
377
385
  legend_label: 'Mutation (putative driver)',
378
- legend_order: MUTATION_LEGEND_ORDER
386
+ legend_order: MUTATION_LEGEND_ORDER,
379
387
  },
380
388
  'missense,inframe,trunc,promoter,other': {
381
- shapes: [shapeBank[ShapeId.missenseMutationVUSRectangle]],
389
+ shapes: [
390
+ shapeBank[ShapeId.missenseMutationVUSRectangle],
391
+ ],
382
392
  legend_label: 'Mutation (unknown significance)',
383
- legend_order: MUTATION_LEGEND_ORDER
393
+ legend_order: MUTATION_LEGEND_ORDER,
384
394
  },
385
395
  },
386
- } as GeneticAlterationRuleParams["conditional"])
387
- }
388
- }) as IGeneticAlterationRuleSetParams;
396
+ } as GeneticAlterationRuleParams['conditional']),
397
+ },
398
+ }
399
+ ) as IGeneticAlterationRuleSetParams;
389
400
 
390
- export const genetic_rule_set_different_colors_no_recurrence:IGeneticAlterationRuleSetParams =
391
- shallowExtend(base_genetic_rule_set_params, {
392
- 'rule_params': {
393
- always:non_mutation_rule_params.always,
394
- conditional:shallowExtend(non_mutation_rule_params.conditional, {
395
- 'disp_mut': {
396
- 'other,other_rec':{
401
+ export const genetic_rule_set_different_colors_no_recurrence: IGeneticAlterationRuleSetParams = shallowExtend(
402
+ base_genetic_rule_set_params,
403
+ {
404
+ rule_params: {
405
+ always: non_mutation_rule_params.always,
406
+ conditional: shallowExtend(non_mutation_rule_params.conditional, {
407
+ disp_mut: {
408
+ 'other,other_rec': {
397
409
  shapes: [shapeBank[ShapeId.otherMutationRectangle]],
398
410
  legend_label: 'Other Mutation',
399
- legend_order: MUTATION_LEGEND_ORDER
411
+ legend_order: MUTATION_LEGEND_ORDER,
400
412
  },
401
413
  'promoter,promoter_rec': {
402
414
  shapes: [shapeBank[ShapeId.promoterMutationRectangle]],
403
415
  legend_label: 'Promoter Mutation',
404
- legend_order: MUTATION_LEGEND_ORDER
416
+ legend_order: MUTATION_LEGEND_ORDER,
405
417
  },
406
418
  'trunc,trunc_rec': {
407
- shapes: [shapeBank[ShapeId.truncatingMutationDriverRectangle]],
419
+ shapes: [
420
+ shapeBank[
421
+ ShapeId.truncatingMutationDriverRectangle
422
+ ],
423
+ ],
408
424
  legend_label: 'Truncating Mutation',
409
- legend_order: MUTATION_LEGEND_ORDER
425
+ legend_order: MUTATION_LEGEND_ORDER,
410
426
  },
411
427
  'inframe,inframe_rec': {
412
- shapes: [shapeBank[ShapeId.inframeMutationDriverRectangle]],
428
+ shapes: [
429
+ shapeBank[ShapeId.inframeMutationDriverRectangle],
430
+ ],
413
431
  legend_label: 'Inframe Mutation',
414
- legend_order: MUTATION_LEGEND_ORDER
432
+ legend_order: MUTATION_LEGEND_ORDER,
415
433
  },
416
434
  'missense,missense_rec': {
417
- shapes: [shapeBank[ShapeId.missenseMutationDriverRectangle]],
435
+ shapes: [
436
+ shapeBank[ShapeId.missenseMutationDriverRectangle],
437
+ ],
418
438
  legend_label: 'Missense Mutation',
419
- legend_order: MUTATION_LEGEND_ORDER
439
+ legend_order: MUTATION_LEGEND_ORDER,
420
440
  },
421
- }
422
- } as GeneticAlterationRuleParams["conditional"])
423
- }
424
- }) as IGeneticAlterationRuleSetParams;
441
+ },
442
+ } as GeneticAlterationRuleParams['conditional']),
443
+ },
444
+ }
445
+ ) as IGeneticAlterationRuleSetParams;
425
446
 
426
- export const genetic_rule_set_different_colors_recurrence:IGeneticAlterationRuleSetParams =
427
- shallowExtend(base_genetic_rule_set_params, {
428
- 'rule_params': {
429
- always:non_mutation_rule_params.always,
447
+ export const genetic_rule_set_different_colors_recurrence: IGeneticAlterationRuleSetParams = shallowExtend(
448
+ base_genetic_rule_set_params,
449
+ {
450
+ rule_params: {
451
+ always: non_mutation_rule_params.always,
430
452
  conditional: shallowExtend(non_mutation_rule_params.conditional, {
431
- 'disp_mut': {
432
- 'other,other_rec':{
453
+ disp_mut: {
454
+ 'other,other_rec': {
433
455
  shapes: [shapeBank[ShapeId.otherMutationRectangle]],
434
456
  legend_label: 'Other Mutation',
435
- legend_order: MUTATION_LEGEND_ORDER
457
+ legend_order: MUTATION_LEGEND_ORDER,
436
458
  },
437
459
  'promoter,promoter_rec': {
438
460
  shapes: [shapeBank[ShapeId.promoterMutationRectangle]],
439
461
  legend_label: 'Promoter Mutation',
440
- legend_order: MUTATION_LEGEND_ORDER
462
+ legend_order: MUTATION_LEGEND_ORDER,
441
463
  },
442
- 'trunc_rec': {
443
- shapes: [shapeBank[ShapeId.truncatingMutationDriverRectangle]],
464
+ trunc_rec: {
465
+ shapes: [
466
+ shapeBank[
467
+ ShapeId.truncatingMutationDriverRectangle
468
+ ],
469
+ ],
444
470
  legend_label: 'Truncating Mutation (putative driver)',
445
- legend_order: MUTATION_LEGEND_ORDER
471
+ legend_order: MUTATION_LEGEND_ORDER,
446
472
  },
447
- 'trunc': {
448
- shapes: [shapeBank[ShapeId.truncatingMutationVUSRectangle]],
449
- legend_label: 'Truncating Mutation (unknown significance)',
450
- legend_order: MUTATION_LEGEND_ORDER
473
+ trunc: {
474
+ shapes: [
475
+ shapeBank[ShapeId.truncatingMutationVUSRectangle],
476
+ ],
477
+ legend_label:
478
+ 'Truncating Mutation (unknown significance)',
479
+ legend_order: MUTATION_LEGEND_ORDER,
451
480
  },
452
- 'inframe_rec': {
453
- shapes: [shapeBank[ShapeId.inframeMutationDriverRectangle]],
481
+ inframe_rec: {
482
+ shapes: [
483
+ shapeBank[ShapeId.inframeMutationDriverRectangle],
484
+ ],
454
485
  legend_label: 'Inframe Mutation (putative driver)',
455
- legend_order: MUTATION_LEGEND_ORDER
486
+ legend_order: MUTATION_LEGEND_ORDER,
456
487
  },
457
- 'inframe': {
458
- shapes: [shapeBank[ShapeId.inframeMutationVUSRectangle]],
488
+ inframe: {
489
+ shapes: [
490
+ shapeBank[ShapeId.inframeMutationVUSRectangle],
491
+ ],
459
492
  legend_label: 'Inframe Mutation (unknown significance)',
460
- legend_order: MUTATION_LEGEND_ORDER
493
+ legend_order: MUTATION_LEGEND_ORDER,
461
494
  },
462
- 'missense_rec': {
463
- shapes: [shapeBank[ShapeId.missenseMutationDriverRectangle]],
495
+ missense_rec: {
496
+ shapes: [
497
+ shapeBank[ShapeId.missenseMutationDriverRectangle],
498
+ ],
464
499
  legend_label: 'Missense Mutation (putative driver)',
465
- legend_order: MUTATION_LEGEND_ORDER
500
+ legend_order: MUTATION_LEGEND_ORDER,
466
501
  },
467
- 'missense': {
468
- shapes: [shapeBank[ShapeId.missenseMutationVUSRectangle]],
469
- legend_label: 'Missense Mutation (unknown significance)',
470
- legend_order: MUTATION_LEGEND_ORDER
502
+ missense: {
503
+ shapes: [
504
+ shapeBank[ShapeId.missenseMutationVUSRectangle],
505
+ ],
506
+ legend_label:
507
+ 'Missense Mutation (unknown significance)',
508
+ legend_order: MUTATION_LEGEND_ORDER,
471
509
  },
472
- }
473
- } as GeneticAlterationRuleParams["conditional"])
474
- }
475
- }) as IGeneticAlterationRuleSetParams;
510
+ },
511
+ } as GeneticAlterationRuleParams['conditional']),
512
+ },
513
+ }
514
+ ) as IGeneticAlterationRuleSetParams;