react-msaview 1.3.1 → 2.0.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.
Files changed (200) hide show
  1. package/bundle/index.js +283 -97265
  2. package/dist/StructureModel.d.ts +9 -0
  3. package/dist/StructureModel.js +11 -0
  4. package/dist/StructureModel.js.map +1 -0
  5. package/dist/UniprotTrack.d.ts +27 -0
  6. package/dist/UniprotTrack.js +52 -0
  7. package/dist/UniprotTrack.js.map +1 -0
  8. package/dist/colorSchemes.d.ts +2 -2
  9. package/dist/colorSchemes.js +24 -29
  10. package/dist/colorSchemes.js.map +1 -0
  11. package/dist/components/AboutDlg.d.ts +0 -1
  12. package/dist/components/AboutDlg.js +38 -48
  13. package/dist/components/AboutDlg.js.map +1 -0
  14. package/dist/components/AddTrackDlg.d.ts +0 -1
  15. package/dist/components/AddTrackDlg.js +13 -13
  16. package/dist/components/AddTrackDlg.js.map +1 -0
  17. package/dist/components/AnnotationDlg.d.ts +0 -1
  18. package/dist/components/AnnotationDlg.js +36 -48
  19. package/dist/components/AnnotationDlg.js.map +1 -0
  20. package/dist/components/BoxTrack.d.ts +3 -4
  21. package/dist/components/BoxTrack.js +51 -48
  22. package/dist/components/BoxTrack.js.map +1 -0
  23. package/dist/components/DetailsDlg.d.ts +0 -1
  24. package/dist/components/DetailsDlg.js +7 -7
  25. package/dist/components/DetailsDlg.js.map +1 -0
  26. package/dist/components/Header.d.ts +0 -1
  27. package/dist/components/Header.js +39 -34
  28. package/dist/components/Header.js.map +1 -0
  29. package/dist/components/ImportForm.d.ts +0 -1
  30. package/dist/components/ImportForm.js +59 -71
  31. package/dist/components/ImportForm.js.map +1 -0
  32. package/dist/components/MSACanvas.d.ts +0 -1
  33. package/dist/components/MSACanvas.js +71 -74
  34. package/dist/components/MSACanvas.js.map +1 -0
  35. package/dist/components/MSAView.d.ts +0 -1
  36. package/dist/components/MSAView.js +19 -38
  37. package/dist/components/MSAView.js.map +1 -0
  38. package/dist/components/MoreInfoDlg.d.ts +2 -3
  39. package/dist/components/MoreInfoDlg.js +5 -5
  40. package/dist/components/MoreInfoDlg.js.map +1 -0
  41. package/dist/components/ResizeHandles.d.ts +2 -3
  42. package/dist/components/ResizeHandles.js +31 -32
  43. package/dist/components/ResizeHandles.js.map +1 -0
  44. package/dist/components/Rubberband.d.ts +2 -1
  45. package/dist/components/Rubberband.js +42 -64
  46. package/dist/components/Rubberband.js.map +1 -0
  47. package/dist/components/Ruler.d.ts +0 -15
  48. package/dist/components/Ruler.js +18 -87
  49. package/dist/components/Ruler.js.map +1 -0
  50. package/dist/components/SettingsDlg.d.ts +0 -1
  51. package/dist/components/SettingsDlg.js +29 -22
  52. package/dist/components/SettingsDlg.js.map +1 -0
  53. package/dist/components/TextTrack.d.ts +3 -4
  54. package/dist/components/TextTrack.js +23 -24
  55. package/dist/components/TextTrack.js.map +1 -0
  56. package/dist/components/Track.d.ts +2 -3
  57. package/dist/components/Track.js +38 -38
  58. package/dist/components/Track.js.map +1 -0
  59. package/dist/components/TrackInfoDlg.d.ts +5 -3
  60. package/dist/components/TrackInfoDlg.js +12 -13
  61. package/dist/components/TrackInfoDlg.js.map +1 -0
  62. package/dist/components/TracklistDlg.d.ts +0 -1
  63. package/dist/components/TracklistDlg.js +9 -9
  64. package/dist/components/TracklistDlg.js.map +1 -0
  65. package/dist/components/TreeCanvas.d.ts +0 -1
  66. package/dist/components/TreeCanvas.js +135 -148
  67. package/dist/components/TreeCanvas.js.map +1 -0
  68. package/dist/components/TreeRuler.d.ts +0 -1
  69. package/dist/components/TreeRuler.js +3 -3
  70. package/dist/components/TreeRuler.js.map +1 -0
  71. package/dist/components/VerticalGuide.d.ts +6 -0
  72. package/dist/components/VerticalGuide.js +30 -0
  73. package/dist/components/VerticalGuide.js.map +1 -0
  74. package/dist/components/data/seq2.d.ts +3 -3
  75. package/dist/components/data/seq2.js +33 -3
  76. package/dist/components/data/seq2.js.map +1 -0
  77. package/{bundle/components/Ruler.d.ts → dist/components/util.d.ts} +1 -6
  78. package/dist/components/util.js +69 -0
  79. package/dist/components/util.js.map +1 -0
  80. package/dist/index.d.ts +2 -4
  81. package/dist/index.js +3 -3
  82. package/dist/index.js.map +1 -0
  83. package/dist/layout.js +14 -20
  84. package/dist/layout.js.map +1 -0
  85. package/dist/model.d.ts +94 -74
  86. package/dist/model.js +232 -473
  87. package/dist/model.js.map +1 -0
  88. package/dist/parseNewick.d.ts +1 -5
  89. package/dist/parseNewick.js +10 -7
  90. package/dist/parseNewick.js.map +1 -0
  91. package/dist/parsers/ClustalMSA.d.ts +6 -18
  92. package/dist/parsers/ClustalMSA.js +55 -64
  93. package/dist/parsers/ClustalMSA.js.map +1 -0
  94. package/dist/parsers/FastaMSA.d.ts +4 -9
  95. package/dist/parsers/FastaMSA.js +55 -64
  96. package/dist/parsers/FastaMSA.js.map +1 -0
  97. package/dist/parsers/StockholmMSA.d.ts +8 -13
  98. package/dist/parsers/StockholmMSA.js +78 -107
  99. package/dist/parsers/StockholmMSA.js.map +1 -0
  100. package/dist/util.d.ts +33 -4
  101. package/dist/util.js +76 -24
  102. package/dist/util.js.map +1 -0
  103. package/dist/version.d.ts +1 -0
  104. package/dist/version.js +2 -0
  105. package/dist/version.js.map +1 -0
  106. package/package.json +30 -30
  107. package/src/StructureModel.ts +11 -0
  108. package/src/UniprotTrack.ts +60 -0
  109. package/src/colorSchemes.ts +520 -0
  110. package/src/components/AboutDlg.tsx +64 -0
  111. package/src/components/AddTrackDlg.tsx +74 -0
  112. package/src/components/AnnotationDlg.tsx +144 -0
  113. package/src/components/BoxTrack.tsx +225 -0
  114. package/src/components/DetailsDlg.tsx +28 -0
  115. package/src/components/Header.tsx +117 -0
  116. package/src/components/ImportForm.tsx +192 -0
  117. package/src/components/MSACanvas.tsx +297 -0
  118. package/src/components/MSAView.tsx +132 -0
  119. package/src/components/MoreInfoDlg.tsx +21 -0
  120. package/src/components/ResizeHandles.tsx +137 -0
  121. package/src/components/Rubberband.tsx +271 -0
  122. package/src/components/Ruler.tsx +122 -0
  123. package/src/components/SettingsDlg.tsx +154 -0
  124. package/src/components/TextTrack.tsx +120 -0
  125. package/src/components/Track.tsx +150 -0
  126. package/src/components/TrackInfoDlg.tsx +59 -0
  127. package/src/components/TracklistDlg.tsx +61 -0
  128. package/src/components/TreeCanvas.tsx +633 -0
  129. package/src/components/TreeRuler.tsx +12 -0
  130. package/src/components/VerticalGuide.tsx +50 -0
  131. package/src/components/data/seq2.ts +35 -0
  132. package/src/components/util.ts +94 -0
  133. package/src/declare.d.ts +2 -0
  134. package/src/index.ts +2 -0
  135. package/src/layout.ts +83 -0
  136. package/src/model.ts +790 -0
  137. package/{bundle/parseNewick.d.ts → src/parseNewick.ts} +36 -5
  138. package/src/parsers/ClustalMSA.ts +79 -0
  139. package/src/parsers/FastaMSA.ts +82 -0
  140. package/src/parsers/StockholmMSA.ts +137 -0
  141. package/src/util.ts +142 -0
  142. package/src/version.ts +1 -0
  143. package/bundle/colorSchemes.d.ts +0 -16
  144. package/bundle/colorSchemes.js +0 -455
  145. package/bundle/components/AboutDlg.d.ts +0 -5
  146. package/bundle/components/AboutDlg.js +0 -47
  147. package/bundle/components/AddTrackDlg.d.ts +0 -8
  148. package/bundle/components/AddTrackDlg.js +0 -26
  149. package/bundle/components/AnnotationDlg.d.ts +0 -11
  150. package/bundle/components/AnnotationDlg.js +0 -77
  151. package/bundle/components/BoxTrack.d.ts +0 -7
  152. package/bundle/components/BoxTrack.js +0 -143
  153. package/bundle/components/DetailsDlg.d.ts +0 -8
  154. package/bundle/components/DetailsDlg.js +0 -12
  155. package/bundle/components/Header.d.ts +0 -6
  156. package/bundle/components/Header.js +0 -63
  157. package/bundle/components/ImportForm.d.ts +0 -6
  158. package/bundle/components/ImportForm.js +0 -89
  159. package/bundle/components/MSACanvas.d.ts +0 -6
  160. package/bundle/components/MSACanvas.js +0 -210
  161. package/bundle/components/MSAView.d.ts +0 -6
  162. package/bundle/components/MSAView.js +0 -88
  163. package/bundle/components/MoreInfoDlg.d.ts +0 -6
  164. package/bundle/components/MoreInfoDlg.js +0 -11
  165. package/bundle/components/ResizeHandles.d.ts +0 -8
  166. package/bundle/components/ResizeHandles.js +0 -110
  167. package/bundle/components/Rubberband.d.ts +0 -7
  168. package/bundle/components/Rubberband.js +0 -196
  169. package/bundle/components/Ruler.js +0 -121
  170. package/bundle/components/SettingsDlg.d.ts +0 -8
  171. package/bundle/components/SettingsDlg.js +0 -40
  172. package/bundle/components/TextTrack.d.ts +0 -7
  173. package/bundle/components/TextTrack.js +0 -72
  174. package/bundle/components/Track.d.ts +0 -11
  175. package/bundle/components/Track.js +0 -81
  176. package/bundle/components/TrackInfoDlg.d.ts +0 -6
  177. package/bundle/components/TrackInfoDlg.js +0 -33
  178. package/bundle/components/TracklistDlg.d.ts +0 -8
  179. package/bundle/components/TracklistDlg.js +0 -18
  180. package/bundle/components/TreeCanvas.d.ts +0 -6
  181. package/bundle/components/TreeCanvas.js +0 -431
  182. package/bundle/components/TreeRuler.d.ts +0 -6
  183. package/bundle/components/TreeRuler.js +0 -8
  184. package/bundle/components/data/seq2.d.ts +0 -3
  185. package/bundle/components/data/seq2.js +0 -3
  186. package/bundle/index.d.ts +0 -4
  187. package/bundle/layout.d.ts +0 -23
  188. package/bundle/layout.js +0 -53
  189. package/bundle/model.d.ts +0 -364
  190. package/bundle/model.js +0 -894
  191. package/bundle/parseNewick.js +0 -94
  192. package/bundle/parsers/ClustalMSA.d.ts +0 -39
  193. package/bundle/parsers/ClustalMSA.js +0 -77
  194. package/bundle/parsers/FastaMSA.d.ts +0 -26
  195. package/bundle/parsers/FastaMSA.js +0 -78
  196. package/bundle/parsers/StockholmMSA.d.ts +0 -75
  197. package/bundle/parsers/StockholmMSA.js +0 -142
  198. package/bundle/util.d.ts +0 -17
  199. package/bundle/util.js +0 -33
  200. package/dist/components/package.json +0 -62
@@ -1,455 +0,0 @@
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
- }
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- export default function AboutDialog({ onClose, open, }: {
3
- onClose: () => void;
4
- open: boolean;
5
- }): JSX.Element;
@@ -1,47 +0,0 @@
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
- }
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { MsaViewModel } from '../model';
3
- declare const _default: ({ model, onClose, open, }: {
4
- model: MsaViewModel;
5
- onClose: () => void;
6
- open: boolean;
7
- }) => JSX.Element;
8
- export default _default;
@@ -1,26 +0,0 @@
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
- });
@@ -1,11 +0,0 @@
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;
@@ -1,77 +0,0 @@
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
- });
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import { MsaViewModel } from '../model';
3
- declare const AnnotationTrack: ({ model, track }: {
4
- model: MsaViewModel;
5
- track: any;
6
- }) => JSX.Element;
7
- export default AnnotationTrack;