react-msaview 1.2.10 → 1.3.2
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/bundle/colorSchemes.d.ts +16 -0
- package/bundle/colorSchemes.js +455 -0
- package/bundle/components/AboutDlg.d.ts +5 -0
- package/bundle/components/AboutDlg.js +47 -0
- package/bundle/components/AddTrackDlg.d.ts +8 -0
- package/bundle/components/AddTrackDlg.js +26 -0
- package/bundle/components/AnnotationDlg.d.ts +11 -0
- package/bundle/components/AnnotationDlg.js +77 -0
- package/bundle/components/BoxTrack.d.ts +7 -0
- package/bundle/components/BoxTrack.js +143 -0
- package/bundle/components/DetailsDlg.d.ts +8 -0
- package/bundle/components/DetailsDlg.js +12 -0
- package/bundle/components/Header.d.ts +6 -0
- package/bundle/components/Header.js +63 -0
- package/bundle/components/ImportForm.d.ts +6 -0
- package/bundle/components/ImportForm.js +89 -0
- package/bundle/components/MSACanvas.d.ts +6 -0
- package/bundle/components/MSACanvas.js +210 -0
- package/bundle/components/MSAView.d.ts +6 -0
- package/bundle/components/MSAView.js +88 -0
- package/bundle/components/MoreInfoDlg.d.ts +6 -0
- package/bundle/components/MoreInfoDlg.js +11 -0
- package/bundle/components/ResizeHandles.d.ts +8 -0
- package/bundle/components/ResizeHandles.js +110 -0
- package/bundle/components/Rubberband.d.ts +7 -0
- package/bundle/components/Rubberband.js +196 -0
- package/bundle/components/Ruler.d.ts +20 -0
- package/bundle/components/Ruler.js +121 -0
- package/bundle/components/SettingsDlg.d.ts +8 -0
- package/bundle/components/SettingsDlg.js +40 -0
- package/bundle/components/TextTrack.d.ts +7 -0
- package/bundle/components/TextTrack.js +72 -0
- package/bundle/components/Track.d.ts +11 -0
- package/bundle/components/Track.js +81 -0
- package/bundle/components/TrackInfoDlg.d.ts +6 -0
- package/bundle/components/TrackInfoDlg.js +33 -0
- package/bundle/components/TracklistDlg.d.ts +8 -0
- package/bundle/components/TracklistDlg.js +18 -0
- package/bundle/components/TreeCanvas.d.ts +6 -0
- package/bundle/components/TreeCanvas.js +431 -0
- package/bundle/components/TreeRuler.d.ts +6 -0
- package/bundle/components/TreeRuler.js +8 -0
- package/bundle/components/data/seq2.d.ts +3 -0
- package/bundle/components/data/seq2.js +3 -0
- package/bundle/index.d.ts +4 -0
- package/bundle/index.js +97100 -0
- package/bundle/layout.d.ts +23 -0
- package/bundle/layout.js +53 -0
- package/bundle/model.d.ts +364 -0
- package/bundle/model.js +894 -0
- package/bundle/parseNewick.d.ts +64 -0
- package/bundle/parseNewick.js +94 -0
- package/bundle/parsers/ClustalMSA.d.ts +39 -0
- package/bundle/parsers/ClustalMSA.js +77 -0
- package/bundle/parsers/FastaMSA.d.ts +26 -0
- package/bundle/parsers/FastaMSA.js +78 -0
- package/bundle/parsers/StockholmMSA.d.ts +75 -0
- package/bundle/parsers/StockholmMSA.js +142 -0
- package/bundle/util.d.ts +17 -0
- package/bundle/util.js +33 -0
- package/dist/colorSchemes.js +1 -1
- package/dist/components/AboutDlg.js +1 -1
- package/dist/components/AddTrackDlg.js +1 -1
- package/dist/components/AnnotationDlg.js +1 -1
- package/dist/components/BoxTrack.js +4 -4
- package/dist/components/Header.js +1 -1
- package/dist/components/ImportForm.js +10 -2
- package/dist/components/MSACanvas.js +2 -2
- package/dist/components/Rubberband.js +1 -1
- package/dist/components/Ruler.js +2 -2
- package/dist/components/SettingsDlg.js +3 -3
- package/dist/components/TextTrack.js +1 -1
- package/dist/components/TreeCanvas.js +2 -1
- package/dist/components/package.json +13 -6
- package/dist/model.d.ts +68 -4
- package/dist/model.js +8 -6
- package/dist/parsers/StockholmMSA.js +1 -1
- package/dist/util.js +2 -2
- package/package.json +13 -6
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
[k: string]: {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare function getClustalXColor(stats: {
|
|
8
|
+
[key: string]: number;
|
|
9
|
+
}, model: {
|
|
10
|
+
columns: Record<string, string>;
|
|
11
|
+
}, row: number, col: number): "rgb(128,179,230)" | "#d88" | "rgb(192, 72, 192)" | "rgb(204, 77, 204)" | "#8f8" | "rgb(26,204,26)" | "rgb(240, 128, 128)" | "rgb(240, 144, 72)" | "rgb(204, 204, 0)" | "rgb(26, 179, 179)" | undefined;
|
|
12
|
+
export declare function getPercentIdentityColor(stats: {
|
|
13
|
+
[key: string]: number;
|
|
14
|
+
}, model: {
|
|
15
|
+
columns: Record<string, string>;
|
|
16
|
+
}, row: number, col: number): string | undefined;
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import Color from 'color';
|
|
2
|
+
import { transform } from './util';
|
|
3
|
+
var colorSchemes = {
|
|
4
|
+
clustal: {
|
|
5
|
+
G: 'orange',
|
|
6
|
+
P: 'orange',
|
|
7
|
+
S: 'orange',
|
|
8
|
+
T: 'orange',
|
|
9
|
+
H: 'red',
|
|
10
|
+
K: 'red',
|
|
11
|
+
R: 'red',
|
|
12
|
+
F: 'blue',
|
|
13
|
+
W: 'blue',
|
|
14
|
+
Y: 'blue',
|
|
15
|
+
I: 'green',
|
|
16
|
+
L: 'green',
|
|
17
|
+
M: 'green',
|
|
18
|
+
V: 'green',
|
|
19
|
+
},
|
|
20
|
+
lesk: {
|
|
21
|
+
G: 'orange',
|
|
22
|
+
A: 'orange',
|
|
23
|
+
S: 'orange',
|
|
24
|
+
T: 'orange',
|
|
25
|
+
C: 'green',
|
|
26
|
+
V: 'green',
|
|
27
|
+
I: 'green',
|
|
28
|
+
L: 'green',
|
|
29
|
+
P: 'green',
|
|
30
|
+
F: 'green',
|
|
31
|
+
Y: 'green',
|
|
32
|
+
M: 'green',
|
|
33
|
+
W: 'green',
|
|
34
|
+
N: 'magenta',
|
|
35
|
+
Q: 'magenta',
|
|
36
|
+
H: 'magenta',
|
|
37
|
+
D: 'red',
|
|
38
|
+
E: 'red',
|
|
39
|
+
K: 'blue',
|
|
40
|
+
R: 'blue',
|
|
41
|
+
},
|
|
42
|
+
maeditor: {
|
|
43
|
+
A: 'lightgreen',
|
|
44
|
+
G: 'lightgreen',
|
|
45
|
+
C: 'green',
|
|
46
|
+
D: 'darkgreen',
|
|
47
|
+
E: 'darkgreen',
|
|
48
|
+
N: 'darkgreen',
|
|
49
|
+
Q: 'darkgreen',
|
|
50
|
+
I: 'blue',
|
|
51
|
+
L: 'blue',
|
|
52
|
+
M: 'blue',
|
|
53
|
+
V: 'blue',
|
|
54
|
+
F: '#c8a2c8',
|
|
55
|
+
W: '#c8a2c8',
|
|
56
|
+
Y: '#c8a2c8',
|
|
57
|
+
H: 'darkblue',
|
|
58
|
+
K: 'orange',
|
|
59
|
+
R: 'orange',
|
|
60
|
+
P: 'pink',
|
|
61
|
+
S: 'red',
|
|
62
|
+
T: 'red',
|
|
63
|
+
},
|
|
64
|
+
percent_identity_dynamic: {},
|
|
65
|
+
//https://github.com/biotite-dev/biotite/blob/8c460972f8ab904312f130dfb80f3efc8c9bd7c5/src/biotite/sequence/graphics/color_schemes/flower.json
|
|
66
|
+
flower: {
|
|
67
|
+
A: '#b18a51',
|
|
68
|
+
C: '#ff5701',
|
|
69
|
+
D: '#01a578',
|
|
70
|
+
E: '#2da0a1',
|
|
71
|
+
F: '#fa559d',
|
|
72
|
+
G: '#b1c23c',
|
|
73
|
+
H: '#0194f9',
|
|
74
|
+
I: '#f27663',
|
|
75
|
+
K: '#7fc3d7',
|
|
76
|
+
L: '#df6e75',
|
|
77
|
+
M: '#fe9daf',
|
|
78
|
+
N: '#0bcec6',
|
|
79
|
+
P: '#4fa32a',
|
|
80
|
+
Q: '#7295ae',
|
|
81
|
+
R: '#83bff1',
|
|
82
|
+
S: '#b4bd9b',
|
|
83
|
+
T: '#d2b576',
|
|
84
|
+
V: '#fd997b',
|
|
85
|
+
W: '#ff2ded',
|
|
86
|
+
Y: '#c96ecf',
|
|
87
|
+
},
|
|
88
|
+
rainbow_dna: {
|
|
89
|
+
A: '#3737f5',
|
|
90
|
+
C: '#37f537',
|
|
91
|
+
G: '#f5f537',
|
|
92
|
+
T: '#f53737',
|
|
93
|
+
U: '#f53737',
|
|
94
|
+
},
|
|
95
|
+
//https://github.com/biotite-dev/biotite/blob/8c460972f8ab904312f130dfb80f3efc8c9bd7c5/src/biotite/sequence/graphics/color_schemes/clustalx_protein.json
|
|
96
|
+
clustalx_protein: {
|
|
97
|
+
A: '#197fe5',
|
|
98
|
+
C: '#e57f7f',
|
|
99
|
+
D: '#cc4ccc',
|
|
100
|
+
E: '#cc4ccc',
|
|
101
|
+
F: '#197fe5',
|
|
102
|
+
G: '#e5994c',
|
|
103
|
+
H: '#19b2b2',
|
|
104
|
+
I: '#197fe5',
|
|
105
|
+
K: '#e53319',
|
|
106
|
+
L: '#197fe5',
|
|
107
|
+
M: '#197fe5',
|
|
108
|
+
N: '#19cc19',
|
|
109
|
+
P: '#cccc00',
|
|
110
|
+
Q: '#19cc19',
|
|
111
|
+
R: '#e53319',
|
|
112
|
+
S: '#19cc19',
|
|
113
|
+
T: '#19cc19',
|
|
114
|
+
V: '#197fe5',
|
|
115
|
+
W: '#197fe5',
|
|
116
|
+
Y: '#19b2b2',
|
|
117
|
+
},
|
|
118
|
+
// this has special handling
|
|
119
|
+
clustalx_protein_dynamic: {},
|
|
120
|
+
clustalx_dna: {
|
|
121
|
+
A: '#e53319',
|
|
122
|
+
C: '#197fe5',
|
|
123
|
+
G: '#e5994c',
|
|
124
|
+
T: '#19cc19',
|
|
125
|
+
U: '#19cc19',
|
|
126
|
+
},
|
|
127
|
+
jalview_buried: {
|
|
128
|
+
A: '#00a35c',
|
|
129
|
+
R: '#00fc03',
|
|
130
|
+
N: '#00eb14',
|
|
131
|
+
D: '#00eb14',
|
|
132
|
+
C: '#0000ff',
|
|
133
|
+
Q: '#00f10e',
|
|
134
|
+
E: '#00f10e',
|
|
135
|
+
G: '#009d62',
|
|
136
|
+
H: '#00d52a',
|
|
137
|
+
I: '#0054ab',
|
|
138
|
+
L: '#007b84',
|
|
139
|
+
K: '#00ff00',
|
|
140
|
+
M: '#009768',
|
|
141
|
+
F: '#008778',
|
|
142
|
+
P: '#00e01f',
|
|
143
|
+
S: '#00d52a',
|
|
144
|
+
T: '#00db24',
|
|
145
|
+
W: '#00a857',
|
|
146
|
+
Y: '#00e619',
|
|
147
|
+
V: '#005fa0',
|
|
148
|
+
B: '#00eb14',
|
|
149
|
+
X: '#00b649',
|
|
150
|
+
Z: '#00f10e',
|
|
151
|
+
},
|
|
152
|
+
jalview_hydrophobicity: {
|
|
153
|
+
A: '#ad0052',
|
|
154
|
+
R: '#0000ff',
|
|
155
|
+
N: '#0c00f3',
|
|
156
|
+
D: '#0c00f3',
|
|
157
|
+
C: '#c2003d',
|
|
158
|
+
Q: '#0c00f3',
|
|
159
|
+
E: '#0c00f3',
|
|
160
|
+
G: '#6a0095',
|
|
161
|
+
H: '#1500ea',
|
|
162
|
+
I: '#ff0000',
|
|
163
|
+
L: '#ea0015',
|
|
164
|
+
K: '#0000ff',
|
|
165
|
+
M: '#b0004f',
|
|
166
|
+
F: '#cb0034',
|
|
167
|
+
P: '#4600b9',
|
|
168
|
+
S: '#5e00a1',
|
|
169
|
+
T: '#61009e',
|
|
170
|
+
W: '#5b00a4',
|
|
171
|
+
Y: '#4f00b0',
|
|
172
|
+
V: '#f60009',
|
|
173
|
+
B: '#0c00f3',
|
|
174
|
+
X: '#680097',
|
|
175
|
+
Z: '#0c00f3',
|
|
176
|
+
},
|
|
177
|
+
jalview_prophelix: {
|
|
178
|
+
A: '#e718e7',
|
|
179
|
+
R: '#6f906f',
|
|
180
|
+
N: '#1be41b',
|
|
181
|
+
D: '#778877',
|
|
182
|
+
C: '#23dc23',
|
|
183
|
+
Q: '#926d92',
|
|
184
|
+
E: '#ff00ff',
|
|
185
|
+
G: '#00ff00',
|
|
186
|
+
H: '#758a75',
|
|
187
|
+
I: '#8a758a',
|
|
188
|
+
L: '#ae51ae',
|
|
189
|
+
K: '#a05fa0',
|
|
190
|
+
M: '#ef10ef',
|
|
191
|
+
F: '#986798',
|
|
192
|
+
P: '#00ff00',
|
|
193
|
+
S: '#36c936',
|
|
194
|
+
T: '#47b847',
|
|
195
|
+
W: '#8a758a',
|
|
196
|
+
Y: '#21de21',
|
|
197
|
+
V: '#857a85',
|
|
198
|
+
B: '#49b649',
|
|
199
|
+
X: '#758a75',
|
|
200
|
+
Z: '#c936c9',
|
|
201
|
+
},
|
|
202
|
+
jalview_propstrand: {
|
|
203
|
+
A: '#5858a7',
|
|
204
|
+
R: '#6b6b94',
|
|
205
|
+
N: '#64649b',
|
|
206
|
+
D: '#2121de',
|
|
207
|
+
C: '#9d9d62',
|
|
208
|
+
Q: '#8c8c73',
|
|
209
|
+
E: '#0000ff',
|
|
210
|
+
G: '#4949b6',
|
|
211
|
+
H: '#60609f',
|
|
212
|
+
I: '#ecec13',
|
|
213
|
+
L: '#b2b24d',
|
|
214
|
+
K: '#4747b8',
|
|
215
|
+
M: '#82827d',
|
|
216
|
+
F: '#c2c23d',
|
|
217
|
+
P: '#2323dc',
|
|
218
|
+
S: '#4949b6',
|
|
219
|
+
T: '#9d9d62',
|
|
220
|
+
W: '#c0c03f',
|
|
221
|
+
Y: '#d3d32c',
|
|
222
|
+
V: '#ffff00',
|
|
223
|
+
B: '#4343bc',
|
|
224
|
+
X: '#797986',
|
|
225
|
+
Z: '#4747b8',
|
|
226
|
+
},
|
|
227
|
+
jalview_propturn: {
|
|
228
|
+
A: '#2cd3d3',
|
|
229
|
+
R: '#708f8f',
|
|
230
|
+
N: '#ff0000',
|
|
231
|
+
D: '#e81717',
|
|
232
|
+
C: '#a85757',
|
|
233
|
+
Q: '#3fc0c0',
|
|
234
|
+
E: '#778888',
|
|
235
|
+
G: '#ff0000',
|
|
236
|
+
H: '#708f8f',
|
|
237
|
+
I: '#00ffff',
|
|
238
|
+
L: '#1ce3e3',
|
|
239
|
+
K: '#7e8181',
|
|
240
|
+
M: '#1ee1e1',
|
|
241
|
+
F: '#1ee1e1',
|
|
242
|
+
P: '#f60909',
|
|
243
|
+
S: '#e11e1e',
|
|
244
|
+
T: '#738c8c',
|
|
245
|
+
W: '#738c8c',
|
|
246
|
+
Y: '#9d6262',
|
|
247
|
+
V: '#07f8f8',
|
|
248
|
+
B: '#f30c0c',
|
|
249
|
+
X: '#7c8383',
|
|
250
|
+
Z: '#5ba4a4',
|
|
251
|
+
},
|
|
252
|
+
jalview_taylor: {
|
|
253
|
+
A: '#ccff00',
|
|
254
|
+
R: '#0000ff',
|
|
255
|
+
N: '#cc00ff',
|
|
256
|
+
D: '#ff0000',
|
|
257
|
+
C: '#ffff00',
|
|
258
|
+
Q: '#ff00cc',
|
|
259
|
+
E: '#ff0066',
|
|
260
|
+
G: '#ff9900',
|
|
261
|
+
H: '#0066ff',
|
|
262
|
+
I: '#66ff00',
|
|
263
|
+
L: '#33ff00',
|
|
264
|
+
K: '#6600ff',
|
|
265
|
+
M: '#00ff00',
|
|
266
|
+
F: '#00ff66',
|
|
267
|
+
P: '#ffcc00',
|
|
268
|
+
S: '#ff3300',
|
|
269
|
+
T: '#ff6600',
|
|
270
|
+
W: '#00ccff',
|
|
271
|
+
Y: '#00ffcc',
|
|
272
|
+
V: '#99ff00',
|
|
273
|
+
},
|
|
274
|
+
jalview_zappo: {
|
|
275
|
+
A: '#ffafaf',
|
|
276
|
+
R: '#6464ff',
|
|
277
|
+
N: '#00ff00',
|
|
278
|
+
D: '#ff0000',
|
|
279
|
+
C: '#ffff00',
|
|
280
|
+
Q: '#00ff00',
|
|
281
|
+
E: '#ff0000',
|
|
282
|
+
G: '#ff00ff',
|
|
283
|
+
H: '#6464ff',
|
|
284
|
+
I: '#ffafaf',
|
|
285
|
+
L: '#ffafaf',
|
|
286
|
+
K: '#6464ff',
|
|
287
|
+
M: '#ffafaf',
|
|
288
|
+
F: '#ffc800',
|
|
289
|
+
P: '#ff00ff',
|
|
290
|
+
S: '#00ff00',
|
|
291
|
+
T: '#00ff00',
|
|
292
|
+
W: '#ffc800',
|
|
293
|
+
Y: '#ffc800',
|
|
294
|
+
V: '#ffafaf',
|
|
295
|
+
},
|
|
296
|
+
cinema: {
|
|
297
|
+
H: 'blue',
|
|
298
|
+
K: 'blue',
|
|
299
|
+
R: 'blue',
|
|
300
|
+
D: 'red',
|
|
301
|
+
E: 'red',
|
|
302
|
+
S: 'green',
|
|
303
|
+
T: 'green',
|
|
304
|
+
N: 'green',
|
|
305
|
+
Q: 'green',
|
|
306
|
+
A: 'white',
|
|
307
|
+
V: 'white',
|
|
308
|
+
L: 'white',
|
|
309
|
+
I: 'white',
|
|
310
|
+
M: 'white',
|
|
311
|
+
F: 'magenta',
|
|
312
|
+
W: 'magenta',
|
|
313
|
+
Y: 'magenta',
|
|
314
|
+
P: 'brown',
|
|
315
|
+
G: 'brown',
|
|
316
|
+
C: 'yellow',
|
|
317
|
+
B: 'gray',
|
|
318
|
+
Z: 'gray',
|
|
319
|
+
X: 'gray',
|
|
320
|
+
'-': 'gray',
|
|
321
|
+
'.': 'gray',
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
// turn all supplied colors to hex colors which getContrastText from mui
|
|
325
|
+
// requires
|
|
326
|
+
export default transform(colorSchemes, function (_a) {
|
|
327
|
+
var key = _a[0], val = _a[1];
|
|
328
|
+
return [
|
|
329
|
+
key,
|
|
330
|
+
transform(val, function (_a) {
|
|
331
|
+
var letter = _a[0], color = _a[1];
|
|
332
|
+
return [letter, Color(color).hex()];
|
|
333
|
+
}),
|
|
334
|
+
];
|
|
335
|
+
});
|
|
336
|
+
// info http://www.jalview.org/help/html/colourSchemes/clustal.html
|
|
337
|
+
// modifications:
|
|
338
|
+
// reference to clustalX source code scheme modifies what the jalview.org
|
|
339
|
+
// scheme says there the jalview.org colorscheme says WLVIMAFCHP but it
|
|
340
|
+
// should be WLVIMAFCHPY, colprot.xml says e.g. %#ACFHILMVWYPp" which has Y
|
|
341
|
+
export function getClustalXColor(stats, model, row, col) {
|
|
342
|
+
var total = Object.values(stats).reduce(function (a, b) { return a + b; }, 0);
|
|
343
|
+
var l = model.columns[row][col];
|
|
344
|
+
var _a = stats.W, W = _a === void 0 ? 0 : _a, _b = stats.L, L = _b === void 0 ? 0 : _b, _c = stats.V, V = _c === void 0 ? 0 : _c, _d = stats.I, I = _d === void 0 ? 0 : _d, _e = stats.M, M = _e === void 0 ? 0 : _e, _f = stats.A, A = _f === void 0 ? 0 : _f, _g = stats.F, F = _g === void 0 ? 0 : _g, _h = stats.C, C = _h === void 0 ? 0 : _h, _j = stats.H, H = _j === void 0 ? 0 : _j, _k = stats.P, P = _k === void 0 ? 0 : _k, _l = stats.R, R = _l === void 0 ? 0 : _l, _m = stats.K, K = _m === void 0 ? 0 : _m, _o = stats.Q, Q = _o === void 0 ? 0 : _o, _p = stats.E, E = _p === void 0 ? 0 : _p, _q = stats.D, D = _q === void 0 ? 0 : _q, _r = stats.T, T = _r === void 0 ? 0 : _r, _s = stats.S, S = _s === void 0 ? 0 : _s, _t = stats.G, G = _t === void 0 ? 0 : _t, _u = stats.Y, Y = _u === void 0 ? 0 : _u, _v = stats.N, N = _v === void 0 ? 0 : _v;
|
|
345
|
+
var WLVIMAFCHP = W + L + V + I + M + A + F + C + H + P + Y;
|
|
346
|
+
var KR = K + R;
|
|
347
|
+
var QE = Q + E;
|
|
348
|
+
var ED = E + D;
|
|
349
|
+
var TS = T + S;
|
|
350
|
+
if (WLVIMAFCHP / total > 0.6) {
|
|
351
|
+
if (l === 'W' ||
|
|
352
|
+
l === 'L' ||
|
|
353
|
+
l === 'V' ||
|
|
354
|
+
l === 'A' ||
|
|
355
|
+
l === 'I' ||
|
|
356
|
+
l === 'M' ||
|
|
357
|
+
l === 'F' ||
|
|
358
|
+
l === 'C') {
|
|
359
|
+
// blue from jalview.org docs
|
|
360
|
+
return 'rgb(128,179,230)';
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if ((l === 'K' || l === 'R') &&
|
|
364
|
+
(KR / total > 0.6 || K / total > 0.8 || R / total > 0.8 || Q / total > 0.8)) {
|
|
365
|
+
return '#d88';
|
|
366
|
+
}
|
|
367
|
+
if (l === 'E' &&
|
|
368
|
+
(KR / total > 0.6 ||
|
|
369
|
+
QE / total > 0.5 ||
|
|
370
|
+
E / total > 0.8 ||
|
|
371
|
+
Q / total > 0.8 ||
|
|
372
|
+
D / total > 0.8)) {
|
|
373
|
+
return 'rgb(192, 72, 192)';
|
|
374
|
+
}
|
|
375
|
+
if (l === 'D' &&
|
|
376
|
+
(KR / total > 0.6 ||
|
|
377
|
+
ED / total > 0.5 ||
|
|
378
|
+
K / total > 0.8 ||
|
|
379
|
+
R / total > 0.8 ||
|
|
380
|
+
Q / total > 0.8)) {
|
|
381
|
+
return 'rgb(204, 77, 204)';
|
|
382
|
+
}
|
|
383
|
+
if (l === 'N' && (N / total > 0.5 || Y / total > 0.85)) {
|
|
384
|
+
return '#8f8';
|
|
385
|
+
}
|
|
386
|
+
if (l === 'Q' &&
|
|
387
|
+
(KR / total > 0.6 ||
|
|
388
|
+
QE / total > 0.6 ||
|
|
389
|
+
Q / total > 0.85 ||
|
|
390
|
+
E / total > 0.85 ||
|
|
391
|
+
K / total > 0.85 ||
|
|
392
|
+
R / total > 0.85)) {
|
|
393
|
+
return '#8f8';
|
|
394
|
+
}
|
|
395
|
+
if ((l === 'S' || l === 'T') &&
|
|
396
|
+
// WLVIMAFCHP modified from 0.6 to 0.55 on page to match what i see in jalview
|
|
397
|
+
(WLVIMAFCHP / total > 0.6 ||
|
|
398
|
+
TS / total > 0.5 ||
|
|
399
|
+
S / total > 0.85 ||
|
|
400
|
+
T / total > 0.85)) {
|
|
401
|
+
return 'rgb(26,204,26)';
|
|
402
|
+
}
|
|
403
|
+
if (l === 'C' && C / total > 0.85) {
|
|
404
|
+
return 'rgb(240, 128, 128)';
|
|
405
|
+
}
|
|
406
|
+
if (l === 'G' && G / total > 0) {
|
|
407
|
+
return 'rgb(240, 144, 72)';
|
|
408
|
+
}
|
|
409
|
+
if (l === 'P' && P / total > 0) {
|
|
410
|
+
return 'rgb(204, 204, 0)';
|
|
411
|
+
}
|
|
412
|
+
if ((l === 'H' || l === 'Y') &&
|
|
413
|
+
(WLVIMAFCHP / total > 0.6 ||
|
|
414
|
+
W > 0.85 ||
|
|
415
|
+
Y > 0.85 ||
|
|
416
|
+
A > 0.85 ||
|
|
417
|
+
C > 0.85 ||
|
|
418
|
+
P > 0.85 ||
|
|
419
|
+
Q > 0.85 ||
|
|
420
|
+
F > 0.85 ||
|
|
421
|
+
H > 0.85 ||
|
|
422
|
+
I > 0.85 ||
|
|
423
|
+
L > 0.85 ||
|
|
424
|
+
M > 0.85 ||
|
|
425
|
+
V > 0.85)) {
|
|
426
|
+
// cyan from jalview.org docs
|
|
427
|
+
return 'rgb(26, 179, 179)';
|
|
428
|
+
}
|
|
429
|
+
return undefined;
|
|
430
|
+
}
|
|
431
|
+
// info http://www.jalview.org/help/html/colourSchemes/clustal.html
|
|
432
|
+
// modifications:
|
|
433
|
+
// reference to clustalX source code scheme modifies what the jalview.org
|
|
434
|
+
// scheme says there the jalview.org colorscheme says WLVIMAFCHP but it
|
|
435
|
+
// should be WLVIMAFCHPY, colprot.xml says e.g. %#ACFHILMVWYPp" which has Y
|
|
436
|
+
export function getPercentIdentityColor(stats, model, row, col) {
|
|
437
|
+
var total = Object.values(stats).reduce(function (a, b) { return a + b; }, 0);
|
|
438
|
+
var l = model.columns[row][col];
|
|
439
|
+
var entries = Object.entries(stats);
|
|
440
|
+
var ent = 0;
|
|
441
|
+
var letter = '';
|
|
442
|
+
for (var i = 0; i < entries.length; i++) {
|
|
443
|
+
if (entries[i][1] > ent && entries[i][0] !== '-') {
|
|
444
|
+
letter = entries[i][0];
|
|
445
|
+
ent = entries[i][1];
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
var proportion = ent / total;
|
|
449
|
+
var thresh = "hsl(240, 30%, " + 100 * Math.max(1 - ent / total / 3, 0.3) + "%)";
|
|
450
|
+
if (proportion > 0.4) {
|
|
451
|
+
if (l === letter) {
|
|
452
|
+
return thresh;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Dialog, DialogTitle, DialogContent, Typography, Link, } from '@material-ui/core';
|
|
3
|
+
function LicenseDialog(_a) {
|
|
4
|
+
var onClose = _a.onClose, open = _a.open;
|
|
5
|
+
return (React.createElement(Dialog, { onClose: function () { return onClose(); }, open: open },
|
|
6
|
+
React.createElement(DialogTitle, null, "Biotite License"),
|
|
7
|
+
React.createElement(DialogContent, null,
|
|
8
|
+
React.createElement("pre", { style: { height: 100, overflow: 'auto' } }, "\nCopyright 2017 - 2020, The Biotite contributors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\nlist of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\nthis list of conditions and the following disclaimer in the documentation and/or\nother materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors\nmay be used to endorse or promote products derived from this software without\nspecific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n "))));
|
|
9
|
+
}
|
|
10
|
+
export default function AboutDialog(_a) {
|
|
11
|
+
var onClose = _a.onClose, open = _a.open;
|
|
12
|
+
var _b = useState(false), dlgOpen = _b[0], setDlgOpen = _b[1];
|
|
13
|
+
return (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement(LicenseDialog, { onClose: function () { return setDlgOpen(false); }, open: dlgOpen }),
|
|
15
|
+
React.createElement(Dialog, { onClose: function () { return onClose(); }, open: open },
|
|
16
|
+
React.createElement(DialogTitle, null, "About this plugin"),
|
|
17
|
+
React.createElement(DialogContent, null,
|
|
18
|
+
React.createElement(Typography, null,
|
|
19
|
+
"MSAView 1.2.12 (",
|
|
20
|
+
React.createElement(Link, { href: "https://github.com/gmod/jbrowse-plugin-msaview" }, "Github"),
|
|
21
|
+
")"),
|
|
22
|
+
React.createElement("ul", null,
|
|
23
|
+
React.createElement("li", null,
|
|
24
|
+
React.createElement(Typography, null,
|
|
25
|
+
"We use some color schemes from the",
|
|
26
|
+
' ',
|
|
27
|
+
React.createElement(Link, { href: "https://github.com/biotite-dev/biotite" }, "biotite"),
|
|
28
|
+
' ',
|
|
29
|
+
"project, and their license is reproduced",
|
|
30
|
+
' ',
|
|
31
|
+
React.createElement(Link, { onClick: function () { return setDlgOpen(true); } }, "here"))),
|
|
32
|
+
React.createElement("li", null,
|
|
33
|
+
React.createElement(Typography, null,
|
|
34
|
+
"See this page for some information on jalview colorings",
|
|
35
|
+
' ',
|
|
36
|
+
React.createElement(Link, { href: "https://www.jalview.org/help/html/colourSchemes/" }, "here"))),
|
|
37
|
+
React.createElement("li", null,
|
|
38
|
+
React.createElement(Typography, null,
|
|
39
|
+
"See this page for some info on the clustal, cinema, maeditor, and lesk color schemes",
|
|
40
|
+
' ',
|
|
41
|
+
React.createElement(Link, { href: "http://www.bioinformatics.nl/~berndb/aacolour.html" }, "here"))),
|
|
42
|
+
React.createElement("li", null,
|
|
43
|
+
React.createElement(Typography, null,
|
|
44
|
+
"See this paper about the flower color scheme",
|
|
45
|
+
' ',
|
|
46
|
+
React.createElement(Link, { href: "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/" }, "here"))))))));
|
|
47
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Dialog, DialogTitle, DialogContent, DialogActions, Button, TextField, MenuItem, Typography, } from '@material-ui/core';
|
|
3
|
+
import { FileSelector } from '@jbrowse/core/ui';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
export default observer(function (_a) {
|
|
6
|
+
var model = _a.model, onClose = _a.onClose, open = _a.open;
|
|
7
|
+
var options = model.rows.map(function (r) { return r[0]; });
|
|
8
|
+
var _b = useState(), trackFile = _b[0], setTrackFile = _b[1];
|
|
9
|
+
var _c = useState(''), currentOption = _c[0], setCurrentOption = _c[1];
|
|
10
|
+
return (React.createElement(Dialog, { onClose: function () { return onClose(); }, open: open },
|
|
11
|
+
React.createElement(DialogTitle, null, "Add track"),
|
|
12
|
+
React.createElement(DialogContent, null,
|
|
13
|
+
React.createElement(Typography, null, "Open relevant per-alignment tracks e.g. protein domains"),
|
|
14
|
+
React.createElement(TextField, { select: true, helperText: "Which row does this track apply to?", value: currentOption, onChange: function (event) {
|
|
15
|
+
setCurrentOption(event.target.value);
|
|
16
|
+
} }, options.map(function (option, index) { return (React.createElement(MenuItem, { key: option + "-" + index, value: option }, option)); })),
|
|
17
|
+
React.createElement(FileSelector, { location: trackFile, setLocation: setTrackFile }),
|
|
18
|
+
React.createElement(DialogActions, null,
|
|
19
|
+
React.createElement(Button, { onClick: function () {
|
|
20
|
+
model.setError(undefined);
|
|
21
|
+
if (trackFile) {
|
|
22
|
+
model.setMSAFilehandle(trackFile);
|
|
23
|
+
}
|
|
24
|
+
}, variant: "contained", color: "primary" }, "Open"),
|
|
25
|
+
React.createElement(Button, { color: "secondary", variant: "contained", onClick: function () { return onClose(); } }, "Cancel")))));
|
|
26
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MsaViewModel } from '../model';
|
|
3
|
+
declare const _default: ({ onClose, data, model, }: {
|
|
4
|
+
model: MsaViewModel;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
data: {
|
|
7
|
+
left: number;
|
|
8
|
+
right: number;
|
|
9
|
+
};
|
|
10
|
+
}) => JSX.Element;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
|
+
import { observer } from 'mobx-react';
|
|
12
|
+
import { Button, Dialog, DialogActions, DialogTitle, DialogContent, IconButton, TextField, Typography, } from '@material-ui/core';
|
|
13
|
+
import DeleteIcon from '@material-ui/icons/Delete';
|
|
14
|
+
var specialFromEntries = function (val) {
|
|
15
|
+
var ret = {};
|
|
16
|
+
val.forEach(function (_a) {
|
|
17
|
+
var key = _a[0], val = _a[1];
|
|
18
|
+
if (!ret[key])
|
|
19
|
+
ret[key] = [];
|
|
20
|
+
ret[key].push(val);
|
|
21
|
+
});
|
|
22
|
+
return ret;
|
|
23
|
+
};
|
|
24
|
+
var Row = observer(function (_a) {
|
|
25
|
+
var name = _a.name, value = _a.value, setValue = _a.setValue, setName = _a.setName, onDelete = _a.onDelete;
|
|
26
|
+
return (React.createElement("div", null,
|
|
27
|
+
React.createElement(IconButton, { onClick: onDelete, style: { margin: 10 } },
|
|
28
|
+
React.createElement(DeleteIcon, null)),
|
|
29
|
+
React.createElement(TextField, { value: name, onChange: function (event) { return setName(event.target.value); }, label: "Key" }),
|
|
30
|
+
React.createElement(TextField, { value: value, onChange: function (event) { return setValue(event.target.value); }, label: "Value" })));
|
|
31
|
+
});
|
|
32
|
+
export default observer(function (_a) {
|
|
33
|
+
var onClose = _a.onClose, data = _a.data, model = _a.model;
|
|
34
|
+
var blanks = model.blanks;
|
|
35
|
+
var l = data.left, r = data.right;
|
|
36
|
+
var _b = useState([
|
|
37
|
+
['Name', ''],
|
|
38
|
+
['ID', ''],
|
|
39
|
+
['Note', ''],
|
|
40
|
+
]), rows = _b[0], setRows = _b[1];
|
|
41
|
+
return (React.createElement(Dialog, { onClose: function () { return onClose(); }, open: true },
|
|
42
|
+
React.createElement(DialogTitle, null, "Create new region annotation"),
|
|
43
|
+
React.createElement(DialogContent, null,
|
|
44
|
+
React.createElement(Typography, null,
|
|
45
|
+
"Do you want to add an annotation to the MSA at ",
|
|
46
|
+
l,
|
|
47
|
+
"..",
|
|
48
|
+
r,
|
|
49
|
+
' ',
|
|
50
|
+
blanks.length
|
|
51
|
+
? " (gapped " + model.getPos(l) + ".." + model.getPos(r)
|
|
52
|
+
: ''),
|
|
53
|
+
rows.map(function (_a, index) {
|
|
54
|
+
var key = _a[0], val = _a[1];
|
|
55
|
+
return (React.createElement(Row, { key: index, name: key, value: val, setValue: function (newValue) {
|
|
56
|
+
var newRows = __spreadArray([], rows, true);
|
|
57
|
+
newRows[index][1] = newValue;
|
|
58
|
+
setRows(newRows);
|
|
59
|
+
}, setName: function (newName) {
|
|
60
|
+
var newRows = __spreadArray([], rows, true);
|
|
61
|
+
newRows[index][0] = newName;
|
|
62
|
+
setRows(newRows);
|
|
63
|
+
}, onDelete: function () {
|
|
64
|
+
rows.splice(index, 1);
|
|
65
|
+
setRows(__spreadArray([], rows, true));
|
|
66
|
+
} }));
|
|
67
|
+
}),
|
|
68
|
+
React.createElement(Button, { onClick: function () {
|
|
69
|
+
setRows(__spreadArray(__spreadArray([], rows, true), [['', '']], false));
|
|
70
|
+
} }, "Add row"),
|
|
71
|
+
React.createElement(DialogActions, null,
|
|
72
|
+
React.createElement(Button, { onClick: function () {
|
|
73
|
+
model.addAnnotation(l, r, specialFromEntries(rows));
|
|
74
|
+
onClose();
|
|
75
|
+
}, variant: "contained", color: "primary" }, "Submit"),
|
|
76
|
+
React.createElement(Button, { variant: "contained", color: "secondary", onClick: function () { return onClose(); } }, "Cancel")))));
|
|
77
|
+
});
|