react-msaview 5.0.7 → 5.0.13
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/index.js +25 -25
- package/bundle/index.js.map +1 -1
- package/dist/components/Checkbox2.js +3 -6
- package/dist/components/Checkbox2.js.map +1 -1
- package/dist/components/MSAViewer.d.ts +14 -0
- package/dist/components/MSAViewer.js +34 -0
- package/dist/components/MSAViewer.js.map +1 -0
- package/dist/components/Track.js +5 -24
- package/dist/components/Track.js.map +1 -1
- package/dist/components/dialogs/DomainDialog.js +2 -5
- package/dist/components/dialogs/DomainDialog.js.map +1 -1
- package/dist/components/dialogs/InterProScanDialog.js +7 -7
- package/dist/components/dialogs/InterProScanDialog.js.map +1 -1
- package/dist/components/dialogs/SettingsDialog.js +3 -19
- package/dist/components/dialogs/SettingsDialog.js.map +1 -1
- package/dist/components/header/ColorSchemeMenu.d.ts +6 -0
- package/dist/components/header/ColorSchemeMenu.js +19 -0
- package/dist/components/header/ColorSchemeMenu.js.map +1 -0
- package/dist/components/header/{ZoomStar.d.ts → FileMenu.d.ts} +2 -2
- package/dist/components/header/FileMenu.js +71 -0
- package/dist/components/header/FileMenu.js.map +1 -0
- package/dist/components/header/Header.js +8 -6
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/HeaderMenu.js +3 -145
- package/dist/components/header/HeaderMenu.js.map +1 -1
- package/dist/components/header/MSASettingsMenu.d.ts +6 -0
- package/dist/components/header/MSASettingsMenu.js +36 -0
- package/dist/components/header/MSASettingsMenu.js.map +1 -0
- package/dist/components/header/SettingsMenu.js +1 -21
- package/dist/components/header/SettingsMenu.js.map +1 -1
- package/dist/components/header/TreeSettingsMenu.d.ts +6 -0
- package/dist/components/header/TreeSettingsMenu.js +74 -0
- package/dist/components/header/TreeSettingsMenu.js.map +1 -0
- package/dist/components/header/ZoomMenu.js +0 -8
- package/dist/components/header/ZoomMenu.js.map +1 -1
- package/dist/components/header/getDomainsMenu.d.ts +31 -0
- package/dist/components/header/getDomainsMenu.js +75 -0
- package/dist/components/header/getDomainsMenu.js.map +1 -0
- package/dist/components/import/ImportFormExamples.js +21 -19
- package/dist/components/import/ImportFormExamples.js.map +1 -1
- package/dist/components/msa/MSACanvas.js +13 -84
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.js +1 -3
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/renderMSABlock.js +2 -4
- package/dist/components/msa/renderMSABlock.js.map +1 -1
- package/dist/components/msa/renderMSAMouseover.js +1 -7
- package/dist/components/msa/renderMSAMouseover.js.map +1 -1
- package/dist/components/tree/TreeCanvas.js +14 -91
- package/dist/components/tree/TreeCanvas.js.map +1 -1
- package/dist/components/tree/TreeNodeMenu.js +5 -16
- package/dist/components/tree/TreeNodeMenu.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.js +4 -12
- package/dist/components/tree/renderTreeCanvas.js.map +1 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +1 -1
- package/dist/fetchUtils.d.ts +0 -1
- package/dist/fetchUtils.js +0 -4
- package/dist/fetchUtils.js.map +1 -1
- package/dist/flatToTree.d.ts +0 -5
- package/dist/flatToTree.js +13 -30
- package/dist/flatToTree.js.map +1 -1
- package/dist/hierarchy.d.ts +28 -0
- package/dist/hierarchy.js +164 -0
- package/dist/hierarchy.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/launchInterProScan.d.ts +0 -5
- package/dist/launchInterProScan.js +5 -3
- package/dist/launchInterProScan.js.map +1 -1
- package/dist/model/DataModel.d.ts +9 -0
- package/dist/model/DataModel.js +12 -1
- package/dist/model/DataModel.js.map +1 -1
- package/dist/model/msaModel.d.ts +3 -0
- package/dist/model/msaModel.js +0 -1
- package/dist/model/msaModel.js.map +1 -1
- package/dist/model/treeModel.d.ts +3 -6
- package/dist/model/treeModel.js +3 -15
- package/dist/model/treeModel.js.map +1 -1
- package/dist/model.d.ts +24 -77
- package/dist/model.js +117 -239
- package/dist/model.js.map +1 -1
- package/dist/neighborJoining.js +38 -629
- package/dist/neighborJoining.js.map +1 -1
- package/dist/parseAsn1.d.ts +0 -12
- package/dist/parseAsn1.js +125 -332
- package/dist/parseAsn1.js.map +1 -1
- package/dist/useWheelScroll.d.ts +8 -0
- package/dist/useWheelScroll.js +93 -0
- package/dist/useWheelScroll.js.map +1 -0
- package/dist/util.d.ts +1 -6
- package/dist/util.js +5 -34
- package/dist/util.js.map +1 -1
- package/dist/vendor/copyToClipboard.d.ts +1 -10
- package/dist/vendor/copyToClipboard.js +14 -109
- package/dist/vendor/copyToClipboard.js.map +1 -1
- package/dist/vendor/fileSaver.d.ts +1 -11
- package/dist/vendor/fileSaver.js +7 -76
- package/dist/vendor/fileSaver.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +10 -13
- package/src/collapseLogic.test.ts +115 -0
- package/src/components/Checkbox2.tsx +9 -18
- package/src/components/MSAViewer.tsx +67 -0
- package/src/components/Track.tsx +10 -26
- package/src/components/dialogs/DomainDialog.tsx +4 -5
- package/src/components/dialogs/InterProScanDialog.tsx +7 -7
- package/src/components/dialogs/SettingsDialog.tsx +0 -37
- package/src/components/header/ColorSchemeMenu.tsx +35 -0
- package/src/components/header/FileMenu.tsx +84 -0
- package/src/components/header/Header.tsx +8 -6
- package/src/components/header/HeaderMenu.tsx +4 -155
- package/src/components/header/MSASettingsMenu.tsx +48 -0
- package/src/components/header/SettingsMenu.tsx +0 -23
- package/src/components/header/TreeSettingsMenu.tsx +96 -0
- package/src/components/header/ZoomMenu.tsx +0 -8
- package/src/components/header/getDomainsMenu.ts +83 -0
- package/src/components/import/ImportFormExamples.tsx +37 -34
- package/src/components/msa/MSACanvas.tsx +21 -91
- package/src/components/msa/MSACanvasBlock.tsx +1 -3
- package/src/components/msa/renderBoxFeatureCanvasBlock.ts +1 -1
- package/src/components/msa/renderMSABlock.ts +2 -5
- package/src/components/msa/renderMSAMouseover.ts +0 -6
- package/src/components/tree/TreeCanvas.tsx +35 -100
- package/src/components/tree/TreeNodeMenu.tsx +5 -14
- package/src/components/tree/renderTreeCanvas.ts +8 -21
- package/src/constants.ts +0 -2
- package/src/fetchUtils.ts +0 -5
- package/src/flatToTree.ts +20 -38
- package/src/hierarchy.test.ts +120 -0
- package/src/hierarchy.ts +220 -0
- package/src/index.ts +2 -0
- package/src/launchInterProScan.ts +4 -3
- package/src/model/DataModel.ts +12 -1
- package/src/model/msaModel.ts +0 -2
- package/src/model/treeModel.ts +2 -18
- package/src/model.ts +179 -278
- package/src/neighborJoining.ts +38 -628
- package/src/parseAsn1.test.ts +4 -1
- package/src/parseAsn1.ts +135 -405
- package/src/useWheelScroll.ts +109 -0
- package/src/util.ts +5 -50
- package/src/vendor/copyToClipboard.ts +14 -122
- package/src/vendor/fileSaver.ts +8 -105
- package/src/version.ts +1 -1
- package/dist/components/dialogs/AddTrackDialog.d.ts +0 -8
- package/dist/components/dialogs/AddTrackDialog.js +0 -30
- package/dist/components/dialogs/AddTrackDialog.js.map +0 -1
- package/dist/components/dialogs/TabPanel.d.ts +0 -6
- package/dist/components/dialogs/TabPanel.js +0 -6
- package/dist/components/dialogs/TabPanel.js.map +0 -1
- package/dist/components/header/ZoomStar.js +0 -40
- package/dist/components/header/ZoomStar.js.map +0 -1
- package/dist/layout.d.ts +0 -26
- package/dist/layout.js +0 -74
- package/dist/layout.js.map +0 -1
- package/dist/reparseTree.d.ts +0 -2
- package/dist/reparseTree.js +0 -15
- package/dist/reparseTree.js.map +0 -1
- package/src/components/dialogs/AddTrackDialog.tsx +0 -85
- package/src/components/dialogs/TabPanel.tsx +0 -19
- package/src/components/header/ZoomStar.tsx +0 -74
- package/src/createPaletteMap.test.ts +0 -57
- package/src/layout.ts +0 -118
- package/src/reparseTree.ts +0 -18
|
@@ -1,75 +1,17 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
|
|
3
3
|
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
|
|
4
|
-
import AccountTree from '@mui/icons-material/AccountTree'
|
|
5
|
-
import Assignment from '@mui/icons-material/Assignment'
|
|
6
|
-
import FilterAlt from '@mui/icons-material/FilterAlt'
|
|
7
|
-
import FolderOpen from '@mui/icons-material/FolderOpen'
|
|
8
4
|
import MoreVert from '@mui/icons-material/Menu'
|
|
9
|
-
import PhotoCamera from '@mui/icons-material/PhotoCamera'
|
|
10
|
-
import Search from '@mui/icons-material/Search'
|
|
11
|
-
import Sort from '@mui/icons-material/Sort'
|
|
12
5
|
import Visibility from '@mui/icons-material/Visibility'
|
|
13
6
|
import { observer } from 'mobx-react'
|
|
14
7
|
|
|
15
8
|
import type { MsaViewModel } from '../../model.ts'
|
|
16
9
|
|
|
17
|
-
// lazies
|
|
18
|
-
const MetadataDialog = lazy(() => import('../dialogs/MetadataDialog.tsx'))
|
|
19
|
-
const ExportSVGDialog = lazy(() => import('../dialogs/ExportSVGDialog.tsx'))
|
|
20
|
-
const FeatureFilterDialog = lazy(() => import('../dialogs/FeatureDialog.tsx'))
|
|
21
|
-
const SettingsDialog = lazy(() => import('../dialogs/SettingsDialog.tsx'))
|
|
22
|
-
const UserProvidedDomainsDialog = lazy(
|
|
23
|
-
() => import('../dialogs/UserProvidedDomainsDialog.tsx'),
|
|
24
|
-
)
|
|
25
|
-
const InterProScanDialog = lazy(
|
|
26
|
-
() => import('../dialogs/InterProScanDialog.tsx'),
|
|
27
|
-
)
|
|
28
|
-
|
|
29
10
|
const HeaderMenu = observer(({ model }: { model: MsaViewModel }) => {
|
|
30
|
-
const {
|
|
31
|
-
showDomains,
|
|
32
|
-
actuallyShowDomains,
|
|
33
|
-
subFeatureRows,
|
|
34
|
-
noDomains,
|
|
35
|
-
tracks,
|
|
36
|
-
turnedOffTracks,
|
|
37
|
-
} = model
|
|
11
|
+
const { tracks, turnedOffTracks } = model
|
|
38
12
|
return (
|
|
39
13
|
<CascadingMenuButton
|
|
40
14
|
menuItems={[
|
|
41
|
-
{
|
|
42
|
-
label: 'Return to import form',
|
|
43
|
-
icon: FolderOpen,
|
|
44
|
-
onClick: () => {
|
|
45
|
-
model.reset()
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
label: 'Metadata',
|
|
50
|
-
icon: Assignment,
|
|
51
|
-
onClick: () => {
|
|
52
|
-
model.queueDialog(onClose => [
|
|
53
|
-
MetadataDialog,
|
|
54
|
-
{
|
|
55
|
-
model,
|
|
56
|
-
onClose,
|
|
57
|
-
},
|
|
58
|
-
])
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: 'More settings',
|
|
63
|
-
onClick: () => {
|
|
64
|
-
model.queueDialog(onClose => [
|
|
65
|
-
SettingsDialog,
|
|
66
|
-
{
|
|
67
|
-
model,
|
|
68
|
-
onClose,
|
|
69
|
-
},
|
|
70
|
-
])
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
15
|
{
|
|
74
16
|
label: 'Tracks',
|
|
75
17
|
icon: Visibility,
|
|
@@ -83,103 +25,10 @@ const HeaderMenu = observer(({ model }: { model: MsaViewModel }) => {
|
|
|
83
25
|
},
|
|
84
26
|
})),
|
|
85
27
|
},
|
|
86
|
-
{
|
|
87
|
-
label: 'Export SVG',
|
|
88
|
-
icon: PhotoCamera,
|
|
89
|
-
onClick: () => {
|
|
90
|
-
model.queueDialog(onClose => [
|
|
91
|
-
ExportSVGDialog,
|
|
92
|
-
{
|
|
93
|
-
onClose,
|
|
94
|
-
model,
|
|
95
|
-
},
|
|
96
|
-
])
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
...(model.rows.length >= 2
|
|
100
|
-
? [
|
|
101
|
-
{
|
|
102
|
-
label: 'Calculate neighbor joining tree (BLOSUM62)',
|
|
103
|
-
icon: AccountTree,
|
|
104
|
-
onClick: () => {
|
|
105
|
-
try {
|
|
106
|
-
model.calculateNeighborJoiningTreeFromMSA()
|
|
107
|
-
} catch (e) {
|
|
108
|
-
console.error('Failed to calculate NJ tree:', e)
|
|
109
|
-
model.setError(e)
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
]
|
|
114
|
-
: []),
|
|
115
|
-
{
|
|
116
|
-
label: 'Features/protein domains',
|
|
117
|
-
type: 'subMenu',
|
|
118
|
-
subMenu: [
|
|
119
|
-
{
|
|
120
|
-
label: 'Open domains...',
|
|
121
|
-
icon: FolderOpen,
|
|
122
|
-
onClick: () => {
|
|
123
|
-
model.queueDialog(handleClose => [
|
|
124
|
-
UserProvidedDomainsDialog,
|
|
125
|
-
{
|
|
126
|
-
handleClose,
|
|
127
|
-
model,
|
|
128
|
-
},
|
|
129
|
-
])
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
label: 'Query InterProScan for domains...',
|
|
134
|
-
icon: Search,
|
|
135
|
-
onClick: () => {
|
|
136
|
-
model.queueDialog(handleClose => [
|
|
137
|
-
InterProScanDialog,
|
|
138
|
-
{
|
|
139
|
-
handleClose,
|
|
140
|
-
model,
|
|
141
|
-
},
|
|
142
|
-
])
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
label: `Show domains${noDomains ? ' (no domains loaded)' : ''}`,
|
|
147
|
-
disabled: noDomains,
|
|
148
|
-
icon: Visibility,
|
|
149
|
-
checked: actuallyShowDomains ? showDomains : false,
|
|
150
|
-
type: 'checkbox',
|
|
151
|
-
onClick: () => {
|
|
152
|
-
model.setShowDomains(!showDomains)
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
label: `Use sub-row layout${noDomains ? ' (no domains loaded)' : ''}`,
|
|
157
|
-
disabled: noDomains,
|
|
158
|
-
checked: actuallyShowDomains ? subFeatureRows : false,
|
|
159
|
-
icon: Sort,
|
|
160
|
-
type: 'checkbox',
|
|
161
|
-
onClick: () => {
|
|
162
|
-
model.setSubFeatureRows(!subFeatureRows)
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
label: `Filter domains${noDomains ? ' (no domains loaded)' : ''}`,
|
|
167
|
-
icon: FilterAlt,
|
|
168
|
-
disabled: noDomains,
|
|
169
|
-
onClick: () => {
|
|
170
|
-
model.queueDialog(onClose => [
|
|
171
|
-
FeatureFilterDialog,
|
|
172
|
-
{
|
|
173
|
-
onClose,
|
|
174
|
-
model,
|
|
175
|
-
},
|
|
176
|
-
])
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
},
|
|
181
28
|
...model.extraViewMenuItems(),
|
|
182
29
|
]}
|
|
30
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
|
31
|
+
transformOrigin={{ vertical: 'top', horizontal: 'left' }}
|
|
183
32
|
>
|
|
184
33
|
<MoreVert />
|
|
185
34
|
</CascadingMenuButton>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
|
|
4
|
+
import Tune from '@mui/icons-material/Tune'
|
|
5
|
+
import { observer } from 'mobx-react'
|
|
6
|
+
|
|
7
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
8
|
+
|
|
9
|
+
const MSASettingsMenu = observer(function ({ model }: { model: MsaViewModel }) {
|
|
10
|
+
const { drawMsaLetters, hideGaps, bgColor } = model
|
|
11
|
+
return (
|
|
12
|
+
<CascadingMenuButton
|
|
13
|
+
closeAfterItemClick={false}
|
|
14
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
|
15
|
+
transformOrigin={{ vertical: 'top', horizontal: 'left' }}
|
|
16
|
+
menuItems={[
|
|
17
|
+
{
|
|
18
|
+
label: 'Draw letters',
|
|
19
|
+
type: 'checkbox',
|
|
20
|
+
checked: drawMsaLetters,
|
|
21
|
+
onClick: () => {
|
|
22
|
+
model.setDrawMsaLetters(!drawMsaLetters)
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'Color letters instead of background of tiles',
|
|
27
|
+
type: 'checkbox',
|
|
28
|
+
checked: !bgColor,
|
|
29
|
+
onClick: () => {
|
|
30
|
+
model.setBgColor(!bgColor)
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: 'Enable hiding gappy columns?',
|
|
35
|
+
type: 'checkbox',
|
|
36
|
+
checked: hideGaps,
|
|
37
|
+
onClick: () => {
|
|
38
|
+
model.setHideGaps(!hideGaps)
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
]}
|
|
42
|
+
>
|
|
43
|
+
<Tune />
|
|
44
|
+
</CascadingMenuButton>
|
|
45
|
+
)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
export default MSASettingsMenu
|
|
@@ -14,7 +14,6 @@ const SettingsMenu = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
14
14
|
const {
|
|
15
15
|
colorSchemeName,
|
|
16
16
|
drawMsaLetters,
|
|
17
|
-
contrastLettering,
|
|
18
17
|
hideGaps,
|
|
19
18
|
bgColor,
|
|
20
19
|
drawTree,
|
|
@@ -22,8 +21,6 @@ const SettingsMenu = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
22
21
|
labelsAlignRight,
|
|
23
22
|
drawNodeBubbles,
|
|
24
23
|
drawLabels,
|
|
25
|
-
treeWidthMatchesArea,
|
|
26
|
-
noTree,
|
|
27
24
|
} = model
|
|
28
25
|
return (
|
|
29
26
|
<CascadingMenuButton
|
|
@@ -65,14 +62,6 @@ const SettingsMenu = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
65
62
|
model.setBgColor(!bgColor)
|
|
66
63
|
},
|
|
67
64
|
},
|
|
68
|
-
{
|
|
69
|
-
label: 'Use contrast lettering',
|
|
70
|
-
type: 'checkbox',
|
|
71
|
-
checked: contrastLettering,
|
|
72
|
-
onClick: () => {
|
|
73
|
-
model.setContrastLettering(!contrastLettering)
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
65
|
{
|
|
77
66
|
label: 'Enable hiding gappy columns?',
|
|
78
67
|
type: 'checkbox',
|
|
@@ -128,18 +117,6 @@ const SettingsMenu = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
128
117
|
model.setDrawLabels(!drawLabels)
|
|
129
118
|
},
|
|
130
119
|
},
|
|
131
|
-
...(noTree
|
|
132
|
-
? []
|
|
133
|
-
: [
|
|
134
|
-
{
|
|
135
|
-
label: 'Make tree width fit to tree area',
|
|
136
|
-
type: 'checkbox' as const,
|
|
137
|
-
checked: treeWidthMatchesArea,
|
|
138
|
-
onClick: () => {
|
|
139
|
-
model.setTreeWidthMatchesArea(!treeWidthMatchesArea)
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
]),
|
|
143
120
|
],
|
|
144
121
|
},
|
|
145
122
|
]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
|
|
4
|
+
import AccountTree from '@mui/icons-material/AccountTree'
|
|
5
|
+
import { observer } from 'mobx-react'
|
|
6
|
+
|
|
7
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
8
|
+
|
|
9
|
+
const TreeSettingsMenu = observer(function ({
|
|
10
|
+
model,
|
|
11
|
+
}: {
|
|
12
|
+
model: MsaViewModel
|
|
13
|
+
}) {
|
|
14
|
+
const {
|
|
15
|
+
drawTree,
|
|
16
|
+
showBranchLen,
|
|
17
|
+
labelsAlignRight,
|
|
18
|
+
drawNodeBubbles,
|
|
19
|
+
drawLabels,
|
|
20
|
+
rows,
|
|
21
|
+
} = model
|
|
22
|
+
return (
|
|
23
|
+
<CascadingMenuButton
|
|
24
|
+
closeAfterItemClick={false}
|
|
25
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'left' }}
|
|
26
|
+
transformOrigin={{ vertical: 'top', horizontal: 'left' }}
|
|
27
|
+
menuItems={[
|
|
28
|
+
{
|
|
29
|
+
label: 'Show branch length',
|
|
30
|
+
type: 'checkbox',
|
|
31
|
+
checked: showBranchLen,
|
|
32
|
+
onClick: () => {
|
|
33
|
+
model.setShowBranchLen(!showBranchLen)
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Show tree',
|
|
38
|
+
type: 'checkbox',
|
|
39
|
+
checked: drawTree,
|
|
40
|
+
onClick: () => {
|
|
41
|
+
model.setDrawTree(!drawTree)
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: 'Draw clickable bubbles on tree branches',
|
|
46
|
+
type: 'checkbox',
|
|
47
|
+
checked: drawNodeBubbles,
|
|
48
|
+
onClick: () => {
|
|
49
|
+
model.setDrawNodeBubbles(!drawNodeBubbles)
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'Tree labels align right',
|
|
54
|
+
type: 'checkbox',
|
|
55
|
+
checked: labelsAlignRight,
|
|
56
|
+
onClick: () => {
|
|
57
|
+
model.setLabelsAlignRight(!labelsAlignRight)
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'Draw labels',
|
|
62
|
+
type: 'checkbox',
|
|
63
|
+
checked: drawLabels,
|
|
64
|
+
onClick: () => {
|
|
65
|
+
model.setDrawLabels(!drawLabels)
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
...(rows.length >= 2
|
|
69
|
+
? [
|
|
70
|
+
{
|
|
71
|
+
label: 'Advanced',
|
|
72
|
+
type: 'subMenu' as const,
|
|
73
|
+
subMenu: [
|
|
74
|
+
{
|
|
75
|
+
label: 'Calculate neighbor joining tree (BLOSUM62)',
|
|
76
|
+
onClick: () => {
|
|
77
|
+
try {
|
|
78
|
+
model.calculateNeighborJoiningTreeFromMSA()
|
|
79
|
+
} catch (e) {
|
|
80
|
+
console.error('Failed to calculate NJ tree:', e)
|
|
81
|
+
model.setError(e)
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
]
|
|
88
|
+
: []),
|
|
89
|
+
]}
|
|
90
|
+
>
|
|
91
|
+
<AccountTree />
|
|
92
|
+
</CascadingMenuButton>
|
|
93
|
+
)
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
export default TreeSettingsMenu
|
|
@@ -37,14 +37,6 @@ const ZoomMenu = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
37
37
|
model.resetZoom()
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
|
-
{
|
|
41
|
-
label: 'Show extra zoom options',
|
|
42
|
-
checked: model.showZoomStar,
|
|
43
|
-
type: 'checkbox',
|
|
44
|
-
onClick: () => {
|
|
45
|
-
model.setShowZoomStar(!model.showZoomStar)
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
40
|
]}
|
|
49
41
|
>
|
|
50
42
|
<MoreVert />
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { lazy } from 'react'
|
|
2
|
+
|
|
3
|
+
import FilterAlt from '@mui/icons-material/FilterAlt'
|
|
4
|
+
import FolderOpen from '@mui/icons-material/FolderOpen'
|
|
5
|
+
import Search from '@mui/icons-material/Search'
|
|
6
|
+
import Sort from '@mui/icons-material/Sort'
|
|
7
|
+
import Visibility from '@mui/icons-material/Visibility'
|
|
8
|
+
|
|
9
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
10
|
+
|
|
11
|
+
const FeatureFilterDialog = lazy(() => import('../dialogs/FeatureDialog.tsx'))
|
|
12
|
+
const UserProvidedDomainsDialog = lazy(
|
|
13
|
+
() => import('../dialogs/UserProvidedDomainsDialog.tsx'),
|
|
14
|
+
)
|
|
15
|
+
const InterProScanDialog = lazy(
|
|
16
|
+
() => import('../dialogs/InterProScanDialog.tsx'),
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
export function getDomainMenu({ model }: { model: MsaViewModel }) {
|
|
20
|
+
const { showDomains, actuallyShowDomains, subFeatureRows, noDomains } = model
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
label: 'Open domains...',
|
|
24
|
+
icon: FolderOpen,
|
|
25
|
+
onClick: () => {
|
|
26
|
+
model.queueDialog(handleClose => [
|
|
27
|
+
UserProvidedDomainsDialog,
|
|
28
|
+
{
|
|
29
|
+
handleClose,
|
|
30
|
+
model,
|
|
31
|
+
},
|
|
32
|
+
])
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Query InterProScan for domains...',
|
|
37
|
+
icon: Search,
|
|
38
|
+
onClick: () => {
|
|
39
|
+
model.queueDialog(handleClose => [
|
|
40
|
+
InterProScanDialog,
|
|
41
|
+
{
|
|
42
|
+
handleClose,
|
|
43
|
+
model,
|
|
44
|
+
},
|
|
45
|
+
])
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: `Show domains${noDomains ? ' (no domains loaded)' : ''}`,
|
|
50
|
+
disabled: noDomains,
|
|
51
|
+
icon: Visibility,
|
|
52
|
+
checked: actuallyShowDomains ? showDomains : false,
|
|
53
|
+
type: 'checkbox' as const,
|
|
54
|
+
onClick: () => {
|
|
55
|
+
model.setShowDomains(!showDomains)
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: `Use sub-row layout${noDomains ? ' (no domains loaded)' : ''}`,
|
|
60
|
+
disabled: noDomains,
|
|
61
|
+
checked: actuallyShowDomains ? subFeatureRows : false,
|
|
62
|
+
icon: Sort,
|
|
63
|
+
type: 'checkbox' as const,
|
|
64
|
+
onClick: () => {
|
|
65
|
+
model.setSubFeatureRows(!subFeatureRows)
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: `Filter domains${noDomains ? ' (no domains loaded)' : ''}`,
|
|
70
|
+
icon: FilterAlt,
|
|
71
|
+
disabled: noDomains,
|
|
72
|
+
onClick: () => {
|
|
73
|
+
model.queueDialog(onClose => [
|
|
74
|
+
FeatureFilterDialog,
|
|
75
|
+
{
|
|
76
|
+
onClose,
|
|
77
|
+
model,
|
|
78
|
+
},
|
|
79
|
+
])
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
]
|
|
83
|
+
}
|
|
@@ -33,29 +33,30 @@ function ListItem({
|
|
|
33
33
|
)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
const BASE = 'https://jbrowse.org/genomes/multiple_sequence_alignments'
|
|
37
|
+
|
|
36
38
|
const ImportFormExamples = observer(function ({
|
|
37
39
|
model,
|
|
38
40
|
}: {
|
|
39
41
|
model: MsaViewModel
|
|
40
42
|
}) {
|
|
41
|
-
function
|
|
43
|
+
function loadUris({
|
|
44
|
+
msa,
|
|
45
|
+
tree,
|
|
46
|
+
gff,
|
|
47
|
+
}: {
|
|
48
|
+
msa?: string
|
|
49
|
+
tree?: string
|
|
50
|
+
gff?: string
|
|
51
|
+
}) {
|
|
42
52
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
43
53
|
;(async () => {
|
|
44
54
|
try {
|
|
45
55
|
await load(
|
|
46
56
|
model,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
locationType: 'UriLocation',
|
|
51
|
-
}
|
|
52
|
-
: undefined,
|
|
53
|
-
uri2
|
|
54
|
-
? {
|
|
55
|
-
uri: uri2,
|
|
56
|
-
locationType: 'UriLocation',
|
|
57
|
-
}
|
|
58
|
-
: undefined,
|
|
57
|
+
msa ? { uri: msa, locationType: 'UriLocation' } : undefined,
|
|
58
|
+
tree ? { uri: tree, locationType: 'UriLocation' } : undefined,
|
|
59
|
+
gff ? { uri: gff, locationType: 'UriLocation' } : undefined,
|
|
59
60
|
)
|
|
60
61
|
} catch (e) {
|
|
61
62
|
console.error(e)
|
|
@@ -68,10 +69,9 @@ const ImportFormExamples = observer(function ({
|
|
|
68
69
|
<ListItem
|
|
69
70
|
model={model}
|
|
70
71
|
onClick={() => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)
|
|
72
|
+
loadUris({
|
|
73
|
+
tree: 'https://jbrowse.org/genomes/newicktrees/sarscov2phylo.pub.ft.nh',
|
|
74
|
+
})
|
|
75
75
|
}}
|
|
76
76
|
>
|
|
77
77
|
230k COVID-19 samples (tree only)
|
|
@@ -95,9 +95,7 @@ const ImportFormExamples = observer(function ({
|
|
|
95
95
|
<ListItem
|
|
96
96
|
model={model}
|
|
97
97
|
onClick={() => {
|
|
98
|
-
|
|
99
|
-
'https://jbrowse.org/genomes/multiple_sequence_alignments/pfam-cov2.stock',
|
|
100
|
-
)
|
|
98
|
+
loadUris({ msa: `${BASE}/pfam-cov2.stock` })
|
|
101
99
|
}}
|
|
102
100
|
>
|
|
103
101
|
PFAM SARS-CoV2 multi-stockholm
|
|
@@ -105,9 +103,18 @@ const ImportFormExamples = observer(function ({
|
|
|
105
103
|
<ListItem
|
|
106
104
|
model={model}
|
|
107
105
|
onClick={() => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
loadUris({
|
|
107
|
+
msa: `${BASE}/pfam-cov2.stock`,
|
|
108
|
+
gff: `${BASE}/pfam-cov2-domains.gff`,
|
|
109
|
+
})
|
|
110
|
+
}}
|
|
111
|
+
>
|
|
112
|
+
PFAM SARS-CoV2 multi-stockholm w/ domains loaded
|
|
113
|
+
</ListItem>
|
|
114
|
+
<ListItem
|
|
115
|
+
model={model}
|
|
116
|
+
onClick={() => {
|
|
117
|
+
loadUris({ msa: `${BASE}/Lysine.stock` })
|
|
111
118
|
}}
|
|
112
119
|
>
|
|
113
120
|
Lysine stockholm file
|
|
@@ -115,9 +122,7 @@ const ImportFormExamples = observer(function ({
|
|
|
115
122
|
<ListItem
|
|
116
123
|
model={model}
|
|
117
124
|
onClick={() => {
|
|
118
|
-
|
|
119
|
-
'https://jbrowse.org/genomes/multiple_sequence_alignments/PF01601_full.txt',
|
|
120
|
-
)
|
|
125
|
+
loadUris({ msa: `${BASE}/PF01601_full.txt` })
|
|
121
126
|
}}
|
|
122
127
|
>
|
|
123
128
|
PF01601 stockholm file (SARS-CoV2 spike protein)
|
|
@@ -125,9 +130,7 @@ const ImportFormExamples = observer(function ({
|
|
|
125
130
|
<ListItem
|
|
126
131
|
model={model}
|
|
127
132
|
onClick={() => {
|
|
128
|
-
|
|
129
|
-
'https://jbrowse.org/genomes/multiple_sequence_alignments/europe_covid.fa',
|
|
130
|
-
)
|
|
133
|
+
loadUris({ msa: `${BASE}/europe_covid.fa` })
|
|
131
134
|
}}
|
|
132
135
|
>
|
|
133
136
|
Europe COVID full genomes (LR883044.1 and 199 other sequences)
|
|
@@ -135,10 +138,10 @@ const ImportFormExamples = observer(function ({
|
|
|
135
138
|
<ListItem
|
|
136
139
|
model={model}
|
|
137
140
|
onClick={() => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
)
|
|
141
|
+
loadUris({
|
|
142
|
+
msa: `${BASE}/rhv_test-only.aligned_with_mafft_auto.fa`,
|
|
143
|
+
tree: `${BASE}/rhv_test-only.aligned_with_mafft_auto.nh`,
|
|
144
|
+
})
|
|
142
145
|
}}
|
|
143
146
|
>
|
|
144
147
|
MAFFT+VeryFastTree(17.9k samples)
|
|
@@ -146,7 +149,7 @@ const ImportFormExamples = observer(function ({
|
|
|
146
149
|
<ListItem
|
|
147
150
|
model={model}
|
|
148
151
|
onClick={() => {
|
|
149
|
-
|
|
152
|
+
loadUris({ msa: 'https://jbrowse.org/demos/ttc39a.mfa' })
|
|
150
153
|
}}
|
|
151
154
|
>
|
|
152
155
|
Human BLAST results mfa
|