react-msaview 3.1.12 → 3.2.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 (233) hide show
  1. package/bundle/index.js +32 -31
  2. package/dist/colorSchemes.d.ts +2 -2
  3. package/dist/colorSchemes.js +5 -6
  4. package/dist/colorSchemes.js.map +1 -1
  5. package/dist/components/Loading.d.ts +1 -1
  6. package/dist/components/Loading.js +7 -5
  7. package/dist/components/Loading.js.map +1 -1
  8. package/dist/components/MSAView.d.ts +1 -1
  9. package/dist/components/MSAView.js +13 -9
  10. package/dist/components/MSAView.js.map +1 -1
  11. package/dist/components/ResizeHandles.d.ts +1 -1
  12. package/dist/components/ResizeHandles.js +8 -4
  13. package/dist/components/ResizeHandles.js.map +1 -1
  14. package/dist/components/SequenceTextArea.js +9 -3
  15. package/dist/components/SequenceTextArea.js.map +1 -1
  16. package/dist/components/TextTrack.d.ts +1 -1
  17. package/dist/components/TextTrack.js +1 -1
  18. package/dist/components/TextTrack.js.map +1 -1
  19. package/dist/components/Track.d.ts +1 -1
  20. package/dist/components/Track.js +6 -2
  21. package/dist/components/Track.js.map +1 -1
  22. package/dist/components/VerticalScrollbar.d.ts +6 -0
  23. package/dist/components/VerticalScrollbar.js +69 -0
  24. package/dist/components/VerticalScrollbar.js.map +1 -0
  25. package/dist/components/dialogs/AboutDialog.js +3 -1
  26. package/dist/components/dialogs/AboutDialog.js.map +1 -1
  27. package/dist/components/dialogs/AddTrackDialog.d.ts +3 -3
  28. package/dist/components/dialogs/AddTrackDialog.js +8 -3
  29. package/dist/components/dialogs/AddTrackDialog.js.map +1 -1
  30. package/dist/components/dialogs/DomainDialog.d.ts +1 -1
  31. package/dist/components/dialogs/DomainDialog.js +8 -4
  32. package/dist/components/dialogs/DomainDialog.js.map +1 -1
  33. package/dist/components/dialogs/ExportSVGDialog.d.ts +1 -1
  34. package/dist/components/dialogs/ExportSVGDialog.js +29 -17
  35. package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
  36. package/dist/components/dialogs/FeatureDialog.d.ts +1 -1
  37. package/dist/components/dialogs/FeatureDialog.js +8 -4
  38. package/dist/components/dialogs/FeatureDialog.js.map +1 -1
  39. package/dist/components/dialogs/{InterProScanPanel.d.ts → InterProScanDialog.d.ts} +1 -1
  40. package/dist/components/dialogs/{InterProScanPanel.js → InterProScanDialog.js} +26 -11
  41. package/dist/components/dialogs/InterProScanDialog.js.map +1 -0
  42. package/dist/components/dialogs/MetadataDialog.d.ts +1 -1
  43. package/dist/components/dialogs/MetadataDialog.js +3 -1
  44. package/dist/components/dialogs/MetadataDialog.js.map +1 -1
  45. package/dist/components/dialogs/SettingsDialog.d.ts +1 -1
  46. package/dist/components/dialogs/SettingsDialog.js +62 -15
  47. package/dist/components/dialogs/SettingsDialog.js.map +1 -1
  48. package/dist/components/dialogs/TracklistDialog.d.ts +3 -3
  49. package/dist/components/dialogs/TracklistDialog.js +8 -3
  50. package/dist/components/dialogs/TracklistDialog.js.map +1 -1
  51. package/dist/components/dialogs/UserProvidedDomainsDialog.d.ts +7 -0
  52. package/dist/components/dialogs/UserProvidedDomainsDialog.js +64 -0
  53. package/dist/components/dialogs/UserProvidedDomainsDialog.js.map +1 -0
  54. package/dist/components/header/Header.d.ts +1 -1
  55. package/dist/components/header/Header.js +11 -4
  56. package/dist/components/header/Header.js.map +1 -1
  57. package/dist/components/header/HeaderInfoArea.d.ts +1 -1
  58. package/dist/components/header/HeaderInfoArea.js +5 -2
  59. package/dist/components/header/HeaderInfoArea.js.map +1 -1
  60. package/dist/components/header/HeaderMenu.d.ts +1 -1
  61. package/dist/components/header/HeaderMenu.js +12 -4
  62. package/dist/components/header/HeaderMenu.js.map +1 -1
  63. package/dist/components/header/HeaderMenuExtra.d.ts +1 -1
  64. package/dist/components/header/HeaderMenuExtra.js +55 -35
  65. package/dist/components/header/HeaderMenuExtra.js.map +1 -1
  66. package/dist/components/header/HeaderStatusArea.d.ts +2 -2
  67. package/dist/components/header/HeaderStatusArea.js +1 -1
  68. package/dist/components/header/HeaderStatusArea.js.map +1 -1
  69. package/dist/components/header/MultiAlignmentSelector.d.ts +1 -1
  70. package/dist/components/header/ZoomControls.js +45 -3
  71. package/dist/components/header/ZoomControls.js.map +1 -1
  72. package/dist/components/import/ImportForm.d.ts +3 -3
  73. package/dist/components/import/ImportForm.js +15 -2
  74. package/dist/components/import/ImportForm.js.map +1 -1
  75. package/dist/components/import/ImportFormExamples.d.ts +1 -1
  76. package/dist/components/import/ImportFormExamples.js +53 -38
  77. package/dist/components/import/ImportFormExamples.js.map +1 -1
  78. package/dist/components/import/util.d.ts +2 -2
  79. package/dist/components/minimap/Minimap.d.ts +1 -1
  80. package/dist/components/minimap/Minimap.js +24 -17
  81. package/dist/components/minimap/Minimap.js.map +1 -1
  82. package/dist/components/minimap/MinimapSVG.d.ts +1 -1
  83. package/dist/components/minimap/MinimapSVG.js +1 -1
  84. package/dist/components/minimap/MinimapSVG.js.map +1 -1
  85. package/dist/components/msa/MSACanvas.d.ts +1 -1
  86. package/dist/components/msa/MSACanvas.js +3 -3
  87. package/dist/components/msa/MSACanvas.js.map +1 -1
  88. package/dist/components/msa/MSACanvasBlock.d.ts +3 -3
  89. package/dist/components/msa/MSACanvasBlock.js +9 -6
  90. package/dist/components/msa/MSACanvasBlock.js.map +1 -1
  91. package/dist/components/msa/MSAMouseoverCanvas.d.ts +1 -1
  92. package/dist/components/msa/MSAPanel.d.ts +1 -1
  93. package/dist/components/msa/renderBoxFeatureCanvasBlock.d.ts +1 -1
  94. package/dist/components/msa/renderBoxFeatureCanvasBlock.js +3 -4
  95. package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
  96. package/dist/components/msa/renderMSABlock.d.ts +2 -2
  97. package/dist/components/msa/renderMSABlock.js +16 -16
  98. package/dist/components/msa/renderMSABlock.js.map +1 -1
  99. package/dist/components/msa/renderMSAMouseover.d.ts +1 -1
  100. package/dist/components/msa/renderMSAMouseover.js +3 -3
  101. package/dist/components/msa/renderMSAMouseover.js.map +1 -1
  102. package/dist/components/tree/TreeBranchMenu.d.ts +1 -1
  103. package/dist/components/tree/TreeBranchMenu.js +6 -3
  104. package/dist/components/tree/TreeBranchMenu.js.map +1 -1
  105. package/dist/components/tree/TreeCanvas.d.ts +1 -1
  106. package/dist/components/tree/TreeCanvas.js +13 -12
  107. package/dist/components/tree/TreeCanvas.js.map +1 -1
  108. package/dist/components/tree/TreeCanvasBlock.d.ts +1 -1
  109. package/dist/components/tree/TreeCanvasBlock.js +13 -5
  110. package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
  111. package/dist/components/tree/TreeNodeMenu.d.ts +1 -1
  112. package/dist/components/tree/TreeNodeMenu.js +3 -3
  113. package/dist/components/tree/TreeNodeMenu.js.map +1 -1
  114. package/dist/components/tree/TreePanel.d.ts +1 -1
  115. package/dist/components/tree/TreeRuler.d.ts +1 -1
  116. package/dist/components/tree/dialogs/TreeNodeInfoDialog.d.ts +3 -3
  117. package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +5 -2
  118. package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
  119. package/dist/components/tree/renderTreeCanvas.d.ts +3 -3
  120. package/dist/components/tree/renderTreeCanvas.js +25 -9
  121. package/dist/components/tree/renderTreeCanvas.js.map +1 -1
  122. package/dist/components/util.js +1 -4
  123. package/dist/components/util.js.map +1 -1
  124. package/dist/ggplotPalettes.js.map +1 -1
  125. package/dist/launchInterProScan.d.ts +1 -1
  126. package/dist/launchInterProScan.js +11 -13
  127. package/dist/launchInterProScan.js.map +1 -1
  128. package/dist/model/DataModel.d.ts +5 -1
  129. package/dist/model/DataModel.js +10 -1
  130. package/dist/model/DataModel.js.map +1 -1
  131. package/dist/model/DialogQueue.d.ts +1 -1
  132. package/dist/model/DialogQueue.js +0 -1
  133. package/dist/model/DialogQueue.js.map +1 -1
  134. package/dist/model.d.ts +187 -35
  135. package/dist/model.js +317 -94
  136. package/dist/model.js.map +1 -1
  137. package/dist/parseGFF.js +8 -6
  138. package/dist/parseGFF.js.map +1 -1
  139. package/dist/parseNewick.js +1 -2
  140. package/dist/parseNewick.js.map +1 -1
  141. package/dist/parsers/ClustalMSA.d.ts +2 -2
  142. package/dist/parsers/ClustalMSA.js.map +1 -1
  143. package/dist/parsers/FastaMSA.d.ts +1 -1
  144. package/dist/parsers/FastaMSA.js +3 -3
  145. package/dist/parsers/FastaMSA.js.map +1 -1
  146. package/dist/parsers/StockholmMSA.d.ts +7 -7
  147. package/dist/parsers/StockholmMSA.js +4 -4
  148. package/dist/parsers/StockholmMSA.js.map +1 -1
  149. package/dist/renderToSvg.d.ts +2 -2
  150. package/dist/renderToSvg.js +6 -11
  151. package/dist/renderToSvg.js.map +1 -1
  152. package/dist/reparseTree.d.ts +1 -1
  153. package/dist/rowCoordinateCalculations.d.ts +2 -0
  154. package/dist/rowCoordinateCalculations.js +26 -0
  155. package/dist/rowCoordinateCalculations.js.map +1 -0
  156. package/dist/rowCoordinateCalculations.test.d.ts +1 -0
  157. package/dist/rowCoordinateCalculations.test.js +18 -0
  158. package/dist/rowCoordinateCalculations.test.js.map +1 -0
  159. package/dist/util.d.ts +2 -2
  160. package/dist/util.js +0 -2
  161. package/dist/util.js.map +1 -1
  162. package/dist/version.d.ts +1 -1
  163. package/dist/version.js +1 -1
  164. package/dist/version.js.map +1 -1
  165. package/package.json +10 -3
  166. package/src/colorSchemes.ts +7 -6
  167. package/src/components/Checkbox2.tsx +1 -1
  168. package/src/components/Loading.tsx +18 -6
  169. package/src/components/MSAView.tsx +27 -18
  170. package/src/components/ResizeHandles.tsx +9 -5
  171. package/src/components/SequenceTextArea.tsx +10 -4
  172. package/src/components/TextTrack.tsx +3 -3
  173. package/src/components/Track.tsx +9 -5
  174. package/src/components/VerticalScrollbar.tsx +89 -0
  175. package/src/components/dialogs/AboutDialog.tsx +7 -1
  176. package/src/components/dialogs/AddTrackDialog.tsx +15 -5
  177. package/src/components/dialogs/DomainDialog.tsx +12 -5
  178. package/src/components/dialogs/ExportSVGDialog.tsx +37 -18
  179. package/src/components/dialogs/FeatureDialog.tsx +10 -8
  180. package/src/components/dialogs/{InterProScanPanel.tsx → InterProScanDialog.tsx} +30 -13
  181. package/src/components/dialogs/MetadataDialog.tsx +9 -2
  182. package/src/components/dialogs/SettingsDialog.tsx +98 -19
  183. package/src/components/dialogs/TracklistDialog.tsx +18 -4
  184. package/src/components/dialogs/UserProvidedDomainsDialog.tsx +139 -0
  185. package/src/components/header/Header.tsx +12 -5
  186. package/src/components/header/HeaderInfoArea.tsx +4 -3
  187. package/src/components/header/HeaderMenu.tsx +13 -8
  188. package/src/components/header/HeaderMenuExtra.tsx +59 -43
  189. package/src/components/header/HeaderStatusArea.tsx +2 -6
  190. package/src/components/header/MultiAlignmentSelector.tsx +1 -1
  191. package/src/components/header/ZoomControls.tsx +52 -2
  192. package/src/components/import/ImportForm.tsx +16 -4
  193. package/src/components/import/ImportFormExamples.tsx +77 -64
  194. package/src/components/import/util.ts +2 -2
  195. package/src/components/minimap/Minimap.tsx +34 -29
  196. package/src/components/minimap/MinimapSVG.tsx +2 -2
  197. package/src/components/msa/MSACanvas.tsx +11 -4
  198. package/src/components/msa/MSACanvasBlock.tsx +10 -7
  199. package/src/components/msa/MSAMouseoverCanvas.tsx +1 -1
  200. package/src/components/msa/MSAPanel.tsx +1 -1
  201. package/src/components/msa/renderBoxFeatureCanvasBlock.ts +8 -9
  202. package/src/components/msa/renderMSABlock.ts +44 -24
  203. package/src/components/msa/renderMSAMouseover.ts +4 -4
  204. package/src/components/tree/TreeBranchMenu.tsx +6 -4
  205. package/src/components/tree/TreeCanvas.tsx +15 -16
  206. package/src/components/tree/TreeCanvasBlock.tsx +14 -6
  207. package/src/components/tree/TreeNodeMenu.tsx +4 -4
  208. package/src/components/tree/TreePanel.tsx +1 -1
  209. package/src/components/tree/TreeRuler.tsx +1 -1
  210. package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +12 -3
  211. package/src/components/tree/renderTreeCanvas.ts +32 -12
  212. package/src/components/util.ts +2 -5
  213. package/src/ggplotPalettes.ts +1 -1
  214. package/src/launchInterProScan.ts +13 -15
  215. package/src/model/DataModel.ts +10 -0
  216. package/src/model/DialogQueue.ts +1 -2
  217. package/src/model.ts +355 -112
  218. package/src/parseGFF.ts +13 -11
  219. package/src/parseNewick.ts +4 -4
  220. package/src/parsers/ClustalMSA.ts +3 -3
  221. package/src/parsers/FastaMSA.ts +5 -5
  222. package/src/parsers/StockholmMSA.ts +11 -11
  223. package/src/renderToSvg.tsx +7 -8
  224. package/src/reparseTree.ts +1 -1
  225. package/src/rowCoordinateCalculations.test.ts +19 -0
  226. package/src/rowCoordinateCalculations.ts +26 -0
  227. package/src/util.ts +2 -4
  228. package/src/version.ts +1 -1
  229. package/dist/components/dialogs/InterProScanPanel.js.map +0 -1
  230. package/dist/components/dialogs/UserProvidedResultPanel.d.ts +0 -7
  231. package/dist/components/dialogs/UserProvidedResultPanel.js +0 -56
  232. package/dist/components/dialogs/UserProvidedResultPanel.js.map +0 -1
  233. package/src/components/dialogs/UserProvidedResultPanel.tsx +0 -119
@@ -3,9 +3,10 @@ import { observer } from 'mobx-react'
3
3
  import { Button, DialogActions, DialogContent, Typography } from '@mui/material'
4
4
 
5
5
  // locals
6
- import { MsaViewModel } from '../../model'
6
+ import type { MsaViewModel } from '../../model'
7
7
  import { getSession } from '@jbrowse/core/util'
8
8
  import { launchInterProScan } from '../../launchInterProScan'
9
+ import { Dialog } from '@jbrowse/core/ui'
9
10
 
10
11
  const InterProScanDialog = observer(function ({
11
12
  handleClose,
@@ -147,12 +148,24 @@ const InterProScanDialog = observer(function ({
147
148
  const [show, setShow] = useState(false)
148
149
 
149
150
  return (
150
- <>
151
+ <Dialog
152
+ maxWidth="xl"
153
+ title="Query InterProScan API for domains"
154
+ onClose={() => {
155
+ handleClose()
156
+ }}
157
+ open
158
+ >
151
159
  <DialogContent>
152
160
  <Typography>
153
- This will run InterProScan on all rows of the current MSA
161
+ This will run InterProScan via the InterProScan API on all rows of the
162
+ current MSA
154
163
  </Typography>
155
- <Button onClick={() => setShow(!show)}>
164
+ <Button
165
+ onClick={() => {
166
+ setShow(!show)
167
+ }}
168
+ >
156
169
  {show ? 'Hide' : 'Show'} advanced options
157
170
  </Button>
158
171
  {show ? (
@@ -162,18 +175,18 @@ const InterProScanDialog = observer(function ({
162
175
  <Button
163
176
  variant="contained"
164
177
  color="secondary"
165
- onClick={() =>
178
+ onClick={() => {
166
179
  setVals(vals.map(v => ({ ...v, checked: false })))
167
- }
180
+ }}
168
181
  >
169
182
  Select none
170
183
  </Button>
171
184
  <Button
172
185
  variant="contained"
173
186
  color="primary"
174
- onClick={() =>
187
+ onClick={() => {
175
188
  setVals(vals.map(v => ({ ...v, checked: true })))
176
- }
189
+ }}
177
190
  >
178
191
  Select all
179
192
  </Button>
@@ -189,7 +202,7 @@ const InterProScanDialog = observer(function ({
189
202
  type="checkbox"
190
203
  key={name}
191
204
  checked={checked}
192
- onChange={() =>
205
+ onChange={() => {
193
206
  setVals(
194
207
  vals.map(e =>
195
208
  e.name === name
@@ -197,7 +210,7 @@ const InterProScanDialog = observer(function ({
197
210
  : e,
198
211
  ),
199
212
  )
200
- }
213
+ }}
201
214
  />
202
215
  </td>
203
216
  <td>{name}</td>
@@ -213,7 +226,9 @@ const InterProScanDialog = observer(function ({
213
226
  <Button
214
227
  variant="contained"
215
228
  color="secondary"
216
- onClick={() => handleClose()}
229
+ onClick={() => {
230
+ handleClose()
231
+ }}
217
232
  >
218
233
  Cancel
219
234
  </Button>
@@ -238,7 +253,9 @@ const InterProScanDialog = observer(function ({
238
253
  .filter(f => !!f[1])
239
254
  .map(row => `>${row[0]}\n${row[1]}`)
240
255
  .join('\n'),
241
- onProgress: arg => model.setStatus(arg),
256
+ onProgress: arg => {
257
+ model.setStatus(arg)
258
+ },
242
259
  model,
243
260
  })
244
261
  } catch (e) {
@@ -254,7 +271,7 @@ const InterProScanDialog = observer(function ({
254
271
  Send sequences to InterProScan
255
272
  </Button>
256
273
  </DialogActions>
257
- </>
274
+ </Dialog>
258
275
  )
259
276
  })
260
277
 
@@ -8,7 +8,7 @@ import {
8
8
  } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
9
9
 
10
10
  // locals
11
- import { MsaViewModel } from '../../model'
11
+ import type { MsaViewModel } from '../../model'
12
12
  import SequenceTextArea from '../SequenceTextArea'
13
13
 
14
14
  const MetadataDialog = observer(function ({
@@ -21,7 +21,14 @@ const MetadataDialog = observer(function ({
21
21
  const { header } = model
22
22
 
23
23
  return (
24
- <Dialog onClose={() => onClose()} open title="Metadata" maxWidth="xl">
24
+ <Dialog
25
+ onClose={() => {
26
+ onClose()
27
+ }}
28
+ open
29
+ title="Metadata"
30
+ maxWidth="xl"
31
+ >
25
32
  <DialogContent>
26
33
  <Attributes attributes={header} />
27
34
  <BaseCard title="sequence">
@@ -12,7 +12,7 @@ import {
12
12
  Typography,
13
13
  } from '@mui/material'
14
14
 
15
- import { MsaViewModel } from '../../model'
15
+ import type { MsaViewModel } from '../../model'
16
16
  import colorSchemes from '../../colorSchemes'
17
17
  import Checkbox2 from '../Checkbox2'
18
18
 
@@ -23,6 +23,9 @@ const useStyles = makeStyles()(theme => ({
23
23
  flex: {
24
24
  display: 'flex',
25
25
  },
26
+ minw: {
27
+ width: '80em',
28
+ },
26
29
  }))
27
30
 
28
31
  const SettingsContent = observer(function ({ model }: { model: MsaViewModel }) {
@@ -56,39 +59,49 @@ const TreeSettings = observer(function TreeSettings({
56
59
  <h1>Tree options</h1>
57
60
  <Checkbox2
58
61
  checked={showBranchLen}
59
- onChange={() => model.setShowBranchLen(!showBranchLen)}
62
+ onChange={() => {
63
+ model.setShowBranchLen(!showBranchLen)
64
+ }}
60
65
  label="Show branch length?"
61
66
  />
62
67
 
63
68
  <Checkbox2
64
69
  checked={drawNodeBubbles}
65
- onChange={() => model.setDrawNodeBubbles(!drawNodeBubbles)}
70
+ onChange={() => {
71
+ model.setDrawNodeBubbles(!drawNodeBubbles)
72
+ }}
66
73
  label="Draw clickable bubbles on tree branches?"
67
74
  />
68
75
  <Checkbox2
69
76
  checked={drawTree}
70
- onChange={() => model.setDrawTree(!drawTree)}
77
+ onChange={() => {
78
+ model.setDrawTree(!drawTree)
79
+ }}
71
80
  label="Show tree?"
72
81
  />
73
82
 
74
83
  <Checkbox2
75
84
  checked={labelsAlignRight}
76
- onChange={() => model.setLabelsAlignRight(!labelsAlignRight)}
85
+ onChange={() => {
86
+ model.setLabelsAlignRight(!labelsAlignRight)
87
+ }}
77
88
  label="Tree labels align right?"
78
89
  />
79
90
 
80
91
  <Checkbox2
81
92
  checked={drawLabels}
82
- onChange={() => model.setDrawLabels(!drawLabels)}
93
+ onChange={() => {
94
+ model.setDrawLabels(!drawLabels)
95
+ }}
83
96
  label="Draw labels"
84
97
  />
85
98
  {noTree ? null : (
86
99
  <div>
87
100
  <Checkbox2
88
101
  checked={treeWidthMatchesArea}
89
- onChange={() =>
102
+ onChange={() => {
90
103
  model.setTreeWidthMatchesArea(!treeWidthMatchesArea)
91
- }
104
+ }}
92
105
  label="Make tree width fit to tree area?"
93
106
  />
94
107
  {treeWidthMatchesArea ? null : (
@@ -99,7 +112,9 @@ const TreeSettings = observer(function TreeSettings({
99
112
  min={50}
100
113
  max={600}
101
114
  value={treeWidth}
102
- onChange={(_, val) => model.setTreeWidth(val as number)}
115
+ onChange={(_, val) => {
116
+ model.setTreeWidth(val as number)
117
+ }}
103
118
  />
104
119
  </div>
105
120
  )}
@@ -115,18 +130,62 @@ const MSASettings = observer(function MSASettings({
115
130
  model: MsaViewModel
116
131
  }) {
117
132
  const { classes } = useStyles()
118
- const { bgColor, colWidth, colorSchemeName, rowHeight } = model
133
+ const {
134
+ bgColor,
135
+ contrastLettering,
136
+ colWidth,
137
+ allowedGappyness,
138
+ drawMsaLetters,
139
+ colorSchemeName,
140
+ hideGaps,
141
+ rowHeight,
142
+ } = model
119
143
 
120
144
  return (
121
145
  <div>
122
146
  <h1>MSA options</h1>
123
-
147
+ <Checkbox2
148
+ checked={drawMsaLetters}
149
+ onChange={() => {
150
+ model.setDrawMsaLetters(!drawMsaLetters)
151
+ }}
152
+ label="Draw letters"
153
+ />
124
154
  <Checkbox2
125
155
  checked={bgColor}
126
- onChange={() => model.setBgColor(!bgColor)}
156
+ onChange={() => {
157
+ model.setBgColor(!bgColor)
158
+ }}
127
159
  label="Color background tiles of MSA?"
128
160
  />
129
-
161
+ <Checkbox2
162
+ checked={contrastLettering}
163
+ onChange={() => {
164
+ model.setContrastLettering(!contrastLettering)
165
+ }}
166
+ label="Use contrast lettering"
167
+ />
168
+ <Checkbox2
169
+ checked={hideGaps}
170
+ onChange={() => {
171
+ model.setHideGaps(!hideGaps)
172
+ }}
173
+ label={`Hide columns that are ${allowedGappyness}% gaps`}
174
+ />
175
+ {hideGaps ? (
176
+ <div className={classes.flex}>
177
+ <Typography>Allowed gappyness ({100 - allowedGappyness}%)</Typography>
178
+ <Slider
179
+ className={classes.field}
180
+ min={1}
181
+ max={100}
182
+ value={allowedGappyness}
183
+ onChange={(_, val) => {
184
+ model.setAllowedGappyness(val as number)
185
+ }}
186
+ />
187
+ </div>
188
+ ) : null}
130
189
  <div className={classes.flex}>
131
190
  <Typography>Column width ({colWidth}px)</Typography>
132
191
  <Slider
@@ -134,7 +193,9 @@ const MSASettings = observer(function MSASettings({
134
193
  min={1}
135
194
  max={50}
136
195
  value={colWidth}
137
- onChange={(_, val) => model.setColWidth(val as number)}
196
+ onChange={(_, val) => {
197
+ model.setColWidth(val as number)
198
+ }}
138
199
  />
139
200
  </div>
140
201
  <div className={classes.flex}>
@@ -144,7 +205,9 @@ const MSASettings = observer(function MSASettings({
144
205
  min={1}
145
206
  max={50}
146
207
  value={rowHeight}
147
- onChange={(_, val) => model.setRowHeight(val as number)}
208
+ onChange={(_, val) => {
209
+ model.setRowHeight(val as number)
210
+ }}
148
211
  />
149
212
  </div>
150
213
 
@@ -152,7 +215,9 @@ const MSASettings = observer(function MSASettings({
152
215
  select
153
216
  label="Color scheme"
154
217
  value={colorSchemeName}
155
- onChange={event => model.setColorSchemeName(event.target.value)}
218
+ onChange={event => {
219
+ model.setColorSchemeName(event.target.value)
220
+ }}
156
221
  >
157
222
  {Object.keys(colorSchemes).map(option => (
158
223
  <MenuItem key={option} value={option}>
@@ -171,12 +236,26 @@ const SettingsDialog = observer(function ({
171
236
  model: MsaViewModel
172
237
  onClose: () => void
173
238
  }) {
239
+ const { classes } = useStyles()
174
240
  return (
175
- <Dialog open onClose={() => onClose()} title="Settings" maxWidth="xl">
176
- <DialogContent style={{ width: '80em' }}>
241
+ <Dialog
242
+ open
243
+ onClose={() => {
244
+ onClose()
245
+ }}
246
+ title="Settings"
247
+ maxWidth="xl"
248
+ >
249
+ <DialogContent className={classes.minw}>
177
250
  <SettingsContent model={model} />
178
251
  <DialogActions>
179
- <Button onClick={() => onClose()} variant="contained" color="primary">
252
+ <Button
253
+ onClick={() => {
254
+ onClose()
255
+ }}
256
+ variant="contained"
257
+ color="primary"
258
+ >
180
259
  Submit
181
260
  </Button>
182
261
  </DialogActions>
@@ -12,9 +12,9 @@ import {
12
12
  import { observer } from 'mobx-react'
13
13
 
14
14
  // locals
15
- import { MsaViewModel } from '../../model'
15
+ import type { MsaViewModel } from '../../model'
16
16
 
17
- export default observer(function ({
17
+ const TracklistDialog = observer(function ({
18
18
  model,
19
19
  onClose,
20
20
  }: {
@@ -24,7 +24,13 @@ export default observer(function ({
24
24
  const { tracks } = model
25
25
 
26
26
  return (
27
- <Dialog onClose={() => onClose()} open title="Add track">
27
+ <Dialog
28
+ onClose={() => {
29
+ onClose()
30
+ }}
31
+ open
32
+ title="Add track"
33
+ >
28
34
  <DialogContent>
29
35
  <Typography>
30
36
  Open relevant per-alignment tracks e.g. protein domains
@@ -49,7 +55,13 @@ export default observer(function ({
49
55
  })}
50
56
  </FormGroup>
51
57
  <DialogActions>
52
- <Button onClick={() => onClose()} variant="contained" color="primary">
58
+ <Button
59
+ onClick={() => {
60
+ onClose()
61
+ }}
62
+ variant="contained"
63
+ color="primary"
64
+ >
53
65
  Close
54
66
  </Button>
55
67
  </DialogActions>
@@ -57,3 +69,5 @@ export default observer(function ({
57
69
  </Dialog>
58
70
  )
59
71
  })
72
+
73
+ export default TracklistDialog
@@ -0,0 +1,139 @@
1
+ import React, { useState } from 'react'
2
+ import { observer } from 'mobx-react'
3
+ import {
4
+ Button,
5
+ DialogActions,
6
+ DialogContent,
7
+ FormControlLabel,
8
+ FormControl,
9
+ Radio,
10
+ RadioGroup,
11
+ TextField,
12
+ Typography,
13
+ } from '@mui/material'
14
+ import { getSession } from '@jbrowse/core/util'
15
+ import { Dialog } from '@jbrowse/core/ui'
16
+
17
+ // locals
18
+ import type { MsaViewModel } from '../../model'
19
+ import { jsonfetch } from '../../fetchUtils'
20
+ import type { InterProScanResponse } from '../../launchInterProScan'
21
+
22
+ const UserProvidedDomainsDialog = observer(function ({
23
+ handleClose,
24
+ model,
25
+ }: {
26
+ handleClose: () => void
27
+ model: MsaViewModel
28
+ }) {
29
+ const [file, setFile] = useState<File>()
30
+ const [choice, setChoice] = useState('file')
31
+ const [interProURL, setInterProURL] = useState('')
32
+
33
+ return (
34
+ <Dialog
35
+ maxWidth="xl"
36
+ title="Open protein domains from file"
37
+ onClose={() => {
38
+ handleClose()
39
+ }}
40
+ open
41
+ >
42
+ <DialogContent>
43
+ <div>
44
+ <Typography>
45
+ Open a JSON file of InterProScan results that you run remotely on
46
+ EBI servers or locally
47
+ </Typography>
48
+
49
+ <div style={{ display: 'flex', margin: 30 }}>
50
+ <FormControl component="fieldset">
51
+ <RadioGroup
52
+ value={choice}
53
+ onChange={event => {
54
+ setChoice(event.target.value)
55
+ }}
56
+ >
57
+ <FormControlLabel value="url" control={<Radio />} label="URL" />
58
+ <FormControlLabel
59
+ value="file"
60
+ control={<Radio />}
61
+ label="File"
62
+ />
63
+ </RadioGroup>
64
+ </FormControl>
65
+ {choice === 'url' ? (
66
+ <div>
67
+ <Typography>
68
+ Open a InterProScan JSON file remote URL
69
+ </Typography>
70
+ <TextField
71
+ label="URL"
72
+ value={interProURL}
73
+ onChange={event => {
74
+ setInterProURL(event.target.value)
75
+ }}
76
+ />
77
+ </div>
78
+ ) : null}
79
+ {choice === 'file' ? (
80
+ <div style={{ paddingTop: 20 }}>
81
+ <Typography>
82
+ Open a InterProScan JSON file file from your local drive
83
+ </Typography>
84
+ <Button variant="outlined" component="label">
85
+ Choose File
86
+ <input
87
+ type="file"
88
+ hidden
89
+ onChange={({ target }) => {
90
+ const file = target.files?.[0]
91
+ if (file) {
92
+ setFile(file)
93
+ }
94
+ }}
95
+ />
96
+ </Button>
97
+ </div>
98
+ ) : null}
99
+ </div>
100
+ </div>
101
+ </DialogContent>
102
+ <DialogActions>
103
+ <Button
104
+ variant="contained"
105
+ color="primary"
106
+ onClick={() => {
107
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
108
+ ;(async () => {
109
+ try {
110
+ const ret: InterProScanResponse = file
111
+ ? JSON.parse(await file.text())
112
+ : await jsonfetch(interProURL)
113
+
114
+ model.setInterProAnnotations(
115
+ Object.fromEntries(ret.results.map(r => [r.xref[0]!.id, r])),
116
+ )
117
+ model.setShowDomains(true)
118
+ getSession(model).notify(
119
+ 'Loaded interproscan results',
120
+ 'success',
121
+ )
122
+ } catch (e) {
123
+ console.error(e)
124
+ getSession(model).notifyError(`${e}`, e)
125
+ } finally {
126
+ model.setStatus()
127
+ }
128
+ })()
129
+ handleClose()
130
+ }}
131
+ >
132
+ Open results
133
+ </Button>
134
+ </DialogActions>
135
+ </Dialog>
136
+ )
137
+ })
138
+
139
+ export default UserProvidedDomainsDialog
@@ -1,9 +1,10 @@
1
- import React, { lazy } from 'react'
1
+ import React, { lazy, useEffect } from 'react'
2
2
  import { IconButton } from '@mui/material'
3
3
  import { observer } from 'mobx-react'
4
+ import useMeasure from '@jbrowse/core/util/useMeasure'
4
5
 
5
6
  // locals
6
- import { MsaViewModel } from '../../model'
7
+ import type { MsaViewModel } from '../../model'
7
8
 
8
9
  // icons
9
10
  import Help from '@mui/icons-material/Help'
@@ -18,16 +19,22 @@ import HeaderMenuExtra from './HeaderMenuExtra'
18
19
  const AboutDialog = lazy(() => import('../dialogs/AboutDialog'))
19
20
 
20
21
  const Header = observer(function ({ model }: { model: MsaViewModel }) {
22
+ const [ref, { height }] = useMeasure()
23
+ useEffect(() => {
24
+ model.setHeaderHeight(height || 0)
25
+ }, [model, height])
21
26
  return (
22
- <div style={{ display: 'flex' }}>
23
- <ZoomControls model={model} />
27
+ <div ref={ref} style={{ display: 'flex' }}>
24
28
  <HeaderMenuExtra model={model} />
29
+ <ZoomControls model={model} />
25
30
  <MultiAlignmentSelector model={model} />
26
31
  <HeaderInfoArea model={model} />
27
32
  <Spacer />
28
33
  <HeaderStatusArea model={model} />
29
34
  <IconButton
30
- onClick={() => model.queueDialog(onClose => [AboutDialog, { onClose }])}
35
+ onClick={() => {
36
+ model.queueDialog(onClose => [AboutDialog, { onClose }])
37
+ }}
31
38
  >
32
39
  <Help />
33
40
  </IconButton>
@@ -4,7 +4,7 @@ import { observer } from 'mobx-react'
4
4
  import { makeStyles } from 'tss-react/mui'
5
5
 
6
6
  // locals
7
- import { MsaViewModel } from '../../model'
7
+ import type { MsaViewModel } from '../../model'
8
8
 
9
9
  const useStyles = makeStyles()({
10
10
  margin: {
@@ -13,13 +13,14 @@ const useStyles = makeStyles()({
13
13
  },
14
14
  })
15
15
 
16
- const HeaderInfoArea = observer(({ model }: { model: MsaViewModel }) => {
16
+ const HeaderInfoArea = observer(function ({ model }: { model: MsaViewModel }) {
17
17
  const { mouseOverRowName, mouseCol } = model
18
18
  const { classes } = useStyles()
19
19
  return mouseOverRowName && mouseCol !== undefined ? (
20
20
  <Typography className={classes.margin}>
21
21
  {mouseOverRowName}:
22
- {model.globalCoordToRowSpecificSeqCoord(mouseOverRowName, mouseCol)}
22
+ {model.mouseOverCoordToGapRemovedRowCoord(mouseOverRowName, mouseCol)} (
23
+ {model.mouseOverCoordToRowLetter(mouseOverRowName, mouseCol)})
23
24
  </Typography>
24
25
  ) : null
25
26
  })
@@ -10,7 +10,7 @@ import List from '@mui/icons-material/List'
10
10
  import Menu from '@mui/icons-material/Menu'
11
11
 
12
12
  // locals
13
- import { MsaViewModel } from '../../model'
13
+ import type { MsaViewModel } from '../../model'
14
14
 
15
15
  // lazies
16
16
  const SettingsDialog = lazy(() => import('../dialogs/SettingsDialog'))
@@ -24,24 +24,29 @@ const HeaderMenu = observer(function ({ model }: { model: MsaViewModel }) {
24
24
  {
25
25
  label: 'Return to import form',
26
26
  icon: FolderOpen,
27
- onClick: () => model.reset(),
27
+ onClick: () => {
28
+ model.reset()
29
+ },
28
30
  },
29
31
  {
30
32
  label: 'Settings',
31
- onClick: () =>
32
- model.queueDialog(onClose => [SettingsDialog, { model, onClose }]),
33
+ onClick: () => {
34
+ model.queueDialog(onClose => [SettingsDialog, { model, onClose }])
35
+ },
33
36
  icon: Settings,
34
37
  },
35
38
  {
36
39
  label: 'Metadata',
37
- onClick: () =>
38
- model.queueDialog(onClose => [MetadataDialog, { model, onClose }]),
40
+ onClick: () => {
41
+ model.queueDialog(onClose => [MetadataDialog, { model, onClose }])
42
+ },
39
43
  icon: Assignment,
40
44
  },
41
45
  {
42
46
  label: 'Extra tracks',
43
- onClick: () =>
44
- model.queueDialog(onClose => [TracklistDialog, { model, onClose }]),
47
+ onClick: () => {
48
+ model.queueDialog(onClose => [TracklistDialog, { model, onClose }])
49
+ },
45
50
  icon: List,
46
51
  },
47
52
  ]}