react-msaview 1.3.2 → 2.1.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.
- package/bundle/index.js +285 -97099
- package/dist/StructureModel.d.ts +9 -0
- package/dist/StructureModel.js +11 -0
- package/dist/StructureModel.js.map +1 -0
- package/dist/UniprotTrack.d.ts +27 -0
- package/dist/UniprotTrack.js +53 -0
- package/dist/UniprotTrack.js.map +1 -0
- package/dist/colorSchemes.d.ts +5 -11
- package/dist/colorSchemes.js +27 -32
- package/dist/colorSchemes.js.map +1 -0
- package/dist/components/BoxTrack.d.ts +6 -6
- package/dist/components/BoxTrack.js +9 -137
- package/dist/components/BoxTrack.js.map +1 -0
- package/dist/components/BoxTrackBlock.d.ts +8 -0
- package/dist/components/BoxTrackBlock.js +136 -0
- package/dist/components/BoxTrackBlock.js.map +1 -0
- package/dist/components/Header.d.ts +2 -2
- package/dist/components/Header.js +55 -48
- package/dist/components/Header.js.map +1 -0
- package/dist/components/ImportForm.d.ts +2 -2
- package/dist/components/ImportForm.js +59 -71
- package/dist/components/ImportForm.js.map +1 -0
- package/dist/components/MSABlock.d.ts +8 -0
- package/dist/components/MSABlock.js +103 -0
- package/dist/components/MSABlock.js.map +1 -0
- package/dist/components/MSACanvas.d.ts +2 -2
- package/dist/components/MSACanvas.js +32 -133
- package/dist/components/MSACanvas.js.map +1 -0
- package/dist/components/MSAMouseoverCanvas.d.ts +6 -0
- package/dist/components/MSAMouseoverCanvas.js +52 -0
- package/dist/components/MSAMouseoverCanvas.js.map +1 -0
- package/dist/components/MSAView.d.ts +2 -2
- package/dist/components/MSAView.js +17 -62
- package/dist/components/MSAView.js.map +1 -0
- package/dist/components/MultiAlignmentSelector.d.ts +6 -0
- package/dist/components/MultiAlignmentSelector.js +13 -0
- package/dist/components/MultiAlignmentSelector.js.map +1 -0
- package/dist/components/ResizeHandles.d.ts +5 -5
- package/dist/components/ResizeHandles.js +31 -32
- package/dist/components/ResizeHandles.js.map +1 -0
- package/dist/components/Rubberband.d.ts +3 -2
- package/dist/components/Rubberband.js +41 -64
- package/dist/components/Rubberband.js.map +1 -0
- package/dist/components/Ruler.d.ts +2 -16
- package/dist/components/Ruler.js +19 -88
- package/dist/components/Ruler.js.map +1 -0
- package/dist/components/TextTrack.d.ts +5 -5
- package/dist/components/TextTrack.js +23 -24
- package/dist/components/TextTrack.js.map +1 -0
- package/dist/components/Track.d.ts +5 -5
- package/dist/components/Track.js +41 -40
- package/dist/components/Track.js.map +1 -0
- package/dist/components/TreeBranchMenu.d.ts +14 -0
- package/dist/components/TreeBranchMenu.js +26 -0
- package/dist/components/TreeBranchMenu.js.map +1 -0
- package/dist/components/TreeCanvas.d.ts +2 -2
- package/dist/components/TreeCanvas.js +24 -356
- package/dist/components/TreeCanvas.js.map +1 -0
- package/dist/components/TreeCanvasBlock.d.ts +7 -0
- package/dist/components/TreeCanvasBlock.js +252 -0
- package/dist/components/TreeCanvasBlock.js.map +1 -0
- package/dist/components/TreeMenu.d.ts +12 -0
- package/dist/components/TreeMenu.js +56 -0
- package/dist/components/TreeMenu.js.map +1 -0
- package/dist/components/TreeRuler.d.ts +2 -2
- package/dist/components/TreeRuler.js +3 -3
- package/dist/components/TreeRuler.js.map +1 -0
- package/dist/components/VerticalGuide.d.ts +7 -0
- package/dist/components/VerticalGuide.js +30 -0
- package/dist/components/VerticalGuide.js.map +1 -0
- package/dist/components/ZoomControls.d.ts +6 -0
- package/dist/components/ZoomControls.js +58 -0
- package/dist/components/ZoomControls.js.map +1 -0
- package/dist/components/data/seq2.d.ts +3 -3
- package/dist/components/data/seq2.js +33 -3
- package/dist/components/data/seq2.js.map +1 -0
- package/dist/components/dialogs/AboutDlg.d.ts +4 -0
- package/dist/components/dialogs/AboutDlg.js +40 -0
- package/dist/components/dialogs/AboutDlg.js.map +1 -0
- package/{bundle/components → dist/components/dialogs}/AddTrackDlg.d.ts +3 -3
- package/dist/components/dialogs/AddTrackDlg.js +26 -0
- package/dist/components/dialogs/AddTrackDlg.js.map +1 -0
- package/dist/components/{AnnotationDlg.d.ts → dialogs/AnnotationDlg.d.ts} +3 -3
- package/dist/components/dialogs/AnnotationDlg.js +65 -0
- package/dist/components/dialogs/AnnotationDlg.js.map +1 -0
- package/dist/components/dialogs/DetailsDlg.d.ts +7 -0
- package/dist/components/dialogs/DetailsDlg.js +13 -0
- package/dist/components/dialogs/DetailsDlg.js.map +1 -0
- package/dist/components/dialogs/MoreInfoDlg.d.ts +6 -0
- package/dist/components/dialogs/MoreInfoDlg.js +11 -0
- package/dist/components/dialogs/MoreInfoDlg.js.map +1 -0
- package/dist/components/dialogs/SettingsDlg.d.ts +7 -0
- package/dist/components/dialogs/SettingsDlg.js +48 -0
- package/dist/components/dialogs/SettingsDlg.js.map +1 -0
- package/dist/components/dialogs/TrackInfoDlg.d.ts +9 -0
- package/{bundle/components → dist/components/dialogs}/TrackInfoDlg.js +12 -13
- package/dist/components/dialogs/TrackInfoDlg.js.map +1 -0
- package/dist/components/dialogs/TracklistDlg.d.ts +7 -0
- package/dist/components/dialogs/TracklistDlg.js +18 -0
- package/dist/components/dialogs/TracklistDlg.js.map +1 -0
- package/{bundle/components/Ruler.d.ts → dist/components/util.d.ts} +1 -6
- package/dist/components/util.js +68 -0
- package/dist/components/util.js.map +1 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -0
- package/dist/layout.js +14 -20
- package/dist/layout.js.map +1 -0
- package/dist/model.d.ts +114 -97
- package/dist/model.js +248 -486
- package/dist/model.js.map +1 -0
- package/dist/parseNewick.d.ts +1 -5
- package/dist/parseNewick.js +11 -8
- package/dist/parseNewick.js.map +1 -0
- package/dist/parsers/ClustalMSA.d.ts +6 -18
- package/dist/parsers/ClustalMSA.js +55 -64
- package/dist/parsers/ClustalMSA.js.map +1 -0
- package/dist/parsers/FastaMSA.d.ts +5 -12
- package/dist/parsers/FastaMSA.js +55 -64
- package/dist/parsers/FastaMSA.js.map +1 -0
- package/dist/parsers/StockholmMSA.d.ts +10 -17
- package/dist/parsers/StockholmMSA.js +81 -110
- package/dist/parsers/StockholmMSA.js.map +1 -0
- package/dist/util.d.ts +34 -7
- package/dist/util.js +76 -24
- package/dist/util.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +34 -34
- package/src/StructureModel.ts +11 -0
- package/src/UniprotTrack.ts +59 -0
- package/src/colorSchemes.ts +520 -0
- package/src/components/BoxTrack.tsx +33 -0
- package/src/components/BoxTrackBlock.tsx +198 -0
- package/src/components/Header.tsx +106 -0
- package/src/components/ImportForm.tsx +192 -0
- package/src/components/MSABlock.tsx +164 -0
- package/src/components/MSACanvas.tsx +142 -0
- package/src/components/MSAMouseoverCanvas.tsx +87 -0
- package/src/components/MSAView.tsx +88 -0
- package/src/components/MultiAlignmentSelector.tsx +33 -0
- package/src/components/ResizeHandles.tsx +137 -0
- package/src/components/Rubberband.tsx +270 -0
- package/src/components/Ruler.tsx +123 -0
- package/src/components/TextTrack.tsx +120 -0
- package/src/components/Track.tsx +153 -0
- package/src/components/TreeBranchMenu.tsx +67 -0
- package/src/components/TreeCanvas.tsx +128 -0
- package/src/components/TreeCanvasBlock.tsx +359 -0
- package/src/components/TreeMenu.tsx +105 -0
- package/src/components/TreeRuler.tsx +12 -0
- package/src/components/VerticalGuide.tsx +50 -0
- package/src/components/ZoomControls.tsx +78 -0
- package/src/components/data/seq2.ts +35 -0
- package/src/components/dialogs/AboutDlg.tsx +58 -0
- package/src/components/dialogs/AddTrackDlg.tsx +74 -0
- package/src/components/dialogs/AnnotationDlg.tsx +144 -0
- package/src/components/dialogs/DetailsDlg.tsx +28 -0
- package/src/components/dialogs/MoreInfoDlg.tsx +21 -0
- package/src/components/dialogs/SettingsDlg.tsx +154 -0
- package/src/components/dialogs/TrackInfoDlg.tsx +59 -0
- package/src/components/dialogs/TracklistDlg.tsx +59 -0
- package/src/components/util.ts +93 -0
- package/src/declare.d.ts +1 -0
- package/src/index.ts +2 -0
- package/src/layout.ts +83 -0
- package/src/model.ts +793 -0
- package/{bundle/parseNewick.d.ts → src/parseNewick.ts} +35 -5
- package/src/parsers/ClustalMSA.ts +79 -0
- package/src/parsers/FastaMSA.ts +82 -0
- package/src/parsers/StockholmMSA.ts +137 -0
- package/src/util.ts +142 -0
- package/src/version.ts +1 -0
- package/bundle/colorSchemes.d.ts +0 -16
- package/bundle/colorSchemes.js +0 -455
- package/bundle/components/AboutDlg.d.ts +0 -5
- package/bundle/components/AboutDlg.js +0 -47
- package/bundle/components/AddTrackDlg.js +0 -26
- package/bundle/components/AnnotationDlg.d.ts +0 -11
- package/bundle/components/AnnotationDlg.js +0 -77
- package/bundle/components/BoxTrack.d.ts +0 -7
- package/bundle/components/BoxTrack.js +0 -143
- package/bundle/components/DetailsDlg.d.ts +0 -8
- package/bundle/components/DetailsDlg.js +0 -12
- package/bundle/components/Header.d.ts +0 -6
- package/bundle/components/Header.js +0 -63
- package/bundle/components/ImportForm.d.ts +0 -6
- package/bundle/components/ImportForm.js +0 -89
- package/bundle/components/MSACanvas.d.ts +0 -6
- package/bundle/components/MSACanvas.js +0 -210
- package/bundle/components/MSAView.d.ts +0 -6
- package/bundle/components/MSAView.js +0 -88
- package/bundle/components/MoreInfoDlg.d.ts +0 -6
- package/bundle/components/MoreInfoDlg.js +0 -11
- package/bundle/components/ResizeHandles.d.ts +0 -8
- package/bundle/components/ResizeHandles.js +0 -110
- package/bundle/components/Rubberband.d.ts +0 -7
- package/bundle/components/Rubberband.js +0 -196
- package/bundle/components/Ruler.js +0 -121
- package/bundle/components/SettingsDlg.d.ts +0 -8
- package/bundle/components/SettingsDlg.js +0 -40
- package/bundle/components/TextTrack.d.ts +0 -7
- package/bundle/components/TextTrack.js +0 -72
- package/bundle/components/Track.d.ts +0 -11
- package/bundle/components/Track.js +0 -81
- package/bundle/components/TrackInfoDlg.d.ts +0 -6
- package/bundle/components/TracklistDlg.d.ts +0 -8
- package/bundle/components/TracklistDlg.js +0 -18
- package/bundle/components/TreeCanvas.d.ts +0 -6
- package/bundle/components/TreeCanvas.js +0 -431
- package/bundle/components/TreeRuler.d.ts +0 -6
- package/bundle/components/TreeRuler.js +0 -8
- package/bundle/components/data/seq2.d.ts +0 -3
- package/bundle/components/data/seq2.js +0 -3
- package/bundle/index.d.ts +0 -4
- package/bundle/layout.d.ts +0 -23
- package/bundle/layout.js +0 -53
- package/bundle/model.d.ts +0 -364
- package/bundle/model.js +0 -894
- package/bundle/parseNewick.js +0 -94
- package/bundle/parsers/ClustalMSA.d.ts +0 -39
- package/bundle/parsers/ClustalMSA.js +0 -77
- package/bundle/parsers/FastaMSA.d.ts +0 -26
- package/bundle/parsers/FastaMSA.js +0 -78
- package/bundle/parsers/StockholmMSA.d.ts +0 -75
- package/bundle/parsers/StockholmMSA.js +0 -142
- package/bundle/util.d.ts +0 -17
- package/bundle/util.js +0 -33
- package/dist/components/AboutDlg.d.ts +0 -5
- package/dist/components/AboutDlg.js +0 -50
- package/dist/components/AddTrackDlg.d.ts +0 -8
- package/dist/components/AddTrackDlg.js +0 -26
- package/dist/components/AnnotationDlg.js +0 -77
- package/dist/components/DetailsDlg.d.ts +0 -8
- package/dist/components/DetailsDlg.js +0 -12
- package/dist/components/MoreInfoDlg.d.ts +0 -6
- package/dist/components/MoreInfoDlg.js +0 -11
- package/dist/components/SettingsDlg.d.ts +0 -8
- package/dist/components/SettingsDlg.js +0 -40
- package/dist/components/TrackInfoDlg.d.ts +0 -6
- package/dist/components/TrackInfoDlg.js +0 -33
- package/dist/components/TracklistDlg.d.ts +0 -8
- package/dist/components/TracklistDlg.js +0 -18
- package/dist/components/package.json +0 -62
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { IconButton } from '@mui/material'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
|
|
5
|
+
|
|
6
|
+
// locals
|
|
7
|
+
import { MsaViewModel } from '../model'
|
|
8
|
+
|
|
9
|
+
// icons
|
|
10
|
+
import MoreVert from '@mui/icons-material/MoreVert'
|
|
11
|
+
import ZoomIn from '@mui/icons-material/ZoomIn'
|
|
12
|
+
import ZoomOut from '@mui/icons-material/ZoomOut'
|
|
13
|
+
|
|
14
|
+
const ZoomControls = observer(function ZoomControls({
|
|
15
|
+
model,
|
|
16
|
+
}: {
|
|
17
|
+
model: MsaViewModel
|
|
18
|
+
}) {
|
|
19
|
+
const { colWidth, rowHeight } = model
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<IconButton
|
|
23
|
+
onClick={() => {
|
|
24
|
+
model.setColWidth(Math.ceil(colWidth * 1.5))
|
|
25
|
+
model.setRowHeight(Math.ceil(rowHeight * 1.5))
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<ZoomIn />
|
|
29
|
+
</IconButton>
|
|
30
|
+
<IconButton
|
|
31
|
+
onClick={() => {
|
|
32
|
+
model.setColWidth(Math.max(1, Math.floor(colWidth * 0.75)))
|
|
33
|
+
model.setRowHeight(Math.max(1.5, Math.floor(rowHeight * 0.75)))
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<ZoomOut />
|
|
37
|
+
</IconButton>
|
|
38
|
+
<CascadingMenuButton
|
|
39
|
+
menuItems={[
|
|
40
|
+
{
|
|
41
|
+
label: 'Decrease row height',
|
|
42
|
+
onClick: () => {
|
|
43
|
+
model.setRowHeight(Math.max(1.5, rowHeight * 0.75))
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Increase row height',
|
|
48
|
+
onClick: () => {
|
|
49
|
+
model.setRowHeight(rowHeight * 1.5)
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'Decrease col width',
|
|
54
|
+
onClick: () => {
|
|
55
|
+
model.setColWidth(Math.max(1, colWidth * 0.75))
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'Increase col width',
|
|
60
|
+
onClick: () => {
|
|
61
|
+
model.setColWidth(colWidth * 1.5)
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'Reset zoom to default',
|
|
66
|
+
onClick: () => {
|
|
67
|
+
model.setColWidth(16)
|
|
68
|
+
model.setRowHeight(20)
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
>
|
|
73
|
+
<MoreVert />
|
|
74
|
+
</CascadingMenuButton>
|
|
75
|
+
</>
|
|
76
|
+
)
|
|
77
|
+
})
|
|
78
|
+
export default ZoomControls
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const smallMSA = `CLUSTAL O(1.2.3) multiple sequence alignment
|
|
2
|
+
UniProt/Swiss-Prot|P26898|IL2RA_SHEEP MEPSLLMWRFFVFIVVPGCVTEACHDDPPSLRNA----------MFKVLRYE----VGTM
|
|
3
|
+
UniProt/Swiss-Prot|P01590|IL2RA_MOUSE MEPRLLMLGFLSLTIVPSCRAELCLYDPPEVPNA----------TFKALSYK----NGTI
|
|
4
|
+
UniProt/Swiss-Prot|P41690|IL2RA_FELCA MEPSLLLWGILTFVVVHGHVTELCDENPPDIQHA----------TFKALTYK----TGTM
|
|
5
|
+
UniProt/Swiss-Prot|P01589|IL2RA_HUMAN MDSYLLMWGLLTFIMVPGCQAELCDDDPPEIPHA----------TFKAMAYK----EGTM
|
|
6
|
+
UniProt/Swiss-Prot|Q5MNY4|IL2RA_MACMU MDPYLLMWGLLTFITVPGCQAELCDDDPPKITHA----------TFKAVAYK----EGTM
|
|
7
|
+
UniProt/Swiss-Prot|Q95118|IL2RG_BOVIN -----------------------------------LLMWGLLT-----------------
|
|
8
|
+
UniProt/Swiss-Prot|P40321|IL2RG_CANFA MLKPPLPLRSLLFLQLSLLGVGLNSTVPMPNGNEDIT------PDFFLTATPSETLSVSS
|
|
9
|
+
UniProt/Swiss-Prot|P26896|IL2RB_RAT MATVDLSWRLPLYILLLLLATT--------------------------------WVSAAV
|
|
10
|
+
UniProt/Swiss-Prot|Q8BZM1|GLMN_MOUSE PLPLRSLLFLQLPLLGVGLNP------------------PLPLRSLLFLQLPLLGVGLNP
|
|
11
|
+
UniProt/Swiss-Prot|P36835|IL2_CAPHI -----------LLGVGLNPKFLTP------------------------------------
|
|
12
|
+
UniProt/Swiss-Prot|Q7JFM4|IL2_AOTVO MLKPPLPLRSLLFLQLPLLGVGLNPKFLTPSGNEDIGGKPGTGGDFFLTSTPAGTLDVST
|
|
13
|
+
UniProt/Swiss-Prot|Q29416|IL2_CANFA --------------LFLQLSLLG-------------------------------------
|
|
14
|
+
`
|
|
15
|
+
|
|
16
|
+
export const smallMSAOnly = `CLUSTAL O(1.2.4) multiple sequence alignment
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
sp|P69905|HBA_HUMAN MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHG 60
|
|
20
|
+
sp|P01942|HBA_MOUSE MVLSGEDKSNIKAAWGKIGGHGAEYGAEALERMFASFPTTKTYFPHFDVSHGSAQVKGHG 60
|
|
21
|
+
sp|P13786|HBAZ_CAPHI MSLTRTERTIILSLWSKISTQADVIGTETLERLFSCYPQAKTYFPHFDLHSGSAQLRAHG 60
|
|
22
|
+
* *: ::: : : *.*:. :. *:*:***:* .:* :********: ****::.**
|
|
23
|
+
|
|
24
|
+
sp|P69905|HBA_HUMAN KKVADALTNAVAHVDDMPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTP 120
|
|
25
|
+
sp|P01942|HBA_MOUSE KKVADALASAAGHLDDLPGALSALSDLHAHKLRVDPVNFKLLSHCLLVTLASHHPADFTP 120
|
|
26
|
+
sp|P13786|HBAZ_CAPHI SKVVAAVGDAVKSIDNVTSALSKLSELHAYVLRVDPVNFKFLSHCLLVTLASHFPADFTA 120
|
|
27
|
+
.**. *: .*. :*:: .*** **:***: *********:**********:* **:**
|
|
28
|
+
|
|
29
|
+
sp|P69905|HBA_HUMAN AVHASLDKFLASVSTVLTSKYR 142
|
|
30
|
+
sp|P01942|HBA_MOUSE AVHASLDKFLASVSTVLTSKYR 142
|
|
31
|
+
sp|P13786|HBAZ_CAPHI DAHAAWDKFLSIVSGVLTEKYR 142
|
|
32
|
+
.**: ****: ** ***.***`
|
|
33
|
+
|
|
34
|
+
export const smallTree =
|
|
35
|
+
'(((UniProt/Swiss-Prot|P26898|IL2RA_SHEEP:0.24036,(UniProt/Swiss-Prot|P41690|IL2RA_FELCA:0.17737,(UniProt/Swiss-Prot|P01589|IL2RA_HUMAN:0.03906,UniProt/Swiss-Prot|Q5MNY4|IL2RA_MACMU:0.03787):0.13033):0.04964):0.02189,UniProt/Swiss-Prot|P01590|IL2RA_MOUSE:0.23072):0.06814,(((UniProt/Swiss-Prot|Q95118|IL2RG_BOVIN:0.09600,UniProt/Swiss-Prot|P40321|IL2RG_CANFA:0.09845):0.25333,UniProt/Swiss-Prot|Q29416|IL2_CANFA:-0.35055):0.10231,(UniProt/Swiss-Prot|P26896|IL2RB_RAT:0.33631,UniProt/Swiss-Prot|Q7JFM4|IL2_AOTVO:-0.33631):0.10166):0.01607,(UniProt/Swiss-Prot|Q8BZM1|GLMN_MOUSE:0.32378,UniProt/Swiss-Prot|P36835|IL2_CAPHI:-0.32378):0.09999)'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
3
|
+
import { DialogContent, Typography, Link } from '@mui/material'
|
|
4
|
+
import { version } from '../../version'
|
|
5
|
+
|
|
6
|
+
export default function AboutDialog({ onClose }: { onClose: () => void }) {
|
|
7
|
+
return (
|
|
8
|
+
<Dialog onClose={() => onClose()} open title="About this plugin">
|
|
9
|
+
<DialogContent>
|
|
10
|
+
<Typography>
|
|
11
|
+
MSAView {version} (
|
|
12
|
+
<Link href="https://github.com/gmod/jbrowse-plugin-msaview">
|
|
13
|
+
Github
|
|
14
|
+
</Link>
|
|
15
|
+
)
|
|
16
|
+
</Typography>
|
|
17
|
+
|
|
18
|
+
<ul>
|
|
19
|
+
<li>
|
|
20
|
+
<Typography>
|
|
21
|
+
We use some color schemes from the{' '}
|
|
22
|
+
<Link href="https://github.com/biotite-dev/biotite">biotite</Link>{' '}
|
|
23
|
+
project, and their license is reproduced{' '}
|
|
24
|
+
<Link href="https://github.com/biotite-dev/biotite/blob/master/LICENSE.rst">
|
|
25
|
+
here
|
|
26
|
+
</Link>
|
|
27
|
+
</Typography>
|
|
28
|
+
</li>
|
|
29
|
+
<li>
|
|
30
|
+
<Typography>
|
|
31
|
+
See this page for some information on jalview colorings{' '}
|
|
32
|
+
<Link href="https://www.jalview.org/help/html/colourSchemes/">
|
|
33
|
+
here
|
|
34
|
+
</Link>
|
|
35
|
+
</Typography>
|
|
36
|
+
</li>
|
|
37
|
+
<li>
|
|
38
|
+
<Typography>
|
|
39
|
+
See this page for some info on the clustal, cinema, maeditor, and
|
|
40
|
+
lesk color schemes{' '}
|
|
41
|
+
<Link href="http://www.bioinformatics.nl/~berndb/aacolour.html">
|
|
42
|
+
here
|
|
43
|
+
</Link>
|
|
44
|
+
</Typography>
|
|
45
|
+
</li>
|
|
46
|
+
<li>
|
|
47
|
+
<Typography>
|
|
48
|
+
See this paper about the flower color scheme{' '}
|
|
49
|
+
<Link href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/">
|
|
50
|
+
here
|
|
51
|
+
</Link>
|
|
52
|
+
</Typography>
|
|
53
|
+
</li>
|
|
54
|
+
</ul>
|
|
55
|
+
</DialogContent>
|
|
56
|
+
</Dialog>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogActions,
|
|
5
|
+
Button,
|
|
6
|
+
TextField,
|
|
7
|
+
MenuItem,
|
|
8
|
+
Typography,
|
|
9
|
+
} from '@mui/material'
|
|
10
|
+
import { Dialog, FileSelector } from '@jbrowse/core/ui'
|
|
11
|
+
import { FileLocation } from '@jbrowse/core/util/types'
|
|
12
|
+
import { observer } from 'mobx-react'
|
|
13
|
+
import { MsaViewModel } from '../../model'
|
|
14
|
+
|
|
15
|
+
export default observer(function ({
|
|
16
|
+
model,
|
|
17
|
+
onClose,
|
|
18
|
+
open,
|
|
19
|
+
}: {
|
|
20
|
+
model: MsaViewModel
|
|
21
|
+
onClose: () => void
|
|
22
|
+
open: boolean
|
|
23
|
+
}) {
|
|
24
|
+
const options = model.rows.map(r => r[0])
|
|
25
|
+
const [trackFile, setTrackFile] = useState<FileLocation>()
|
|
26
|
+
const [currentOption, setCurrentOption] = useState('')
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Dialog onClose={() => onClose()} open={open} title="Add track">
|
|
30
|
+
<DialogContent>
|
|
31
|
+
<Typography>
|
|
32
|
+
Open relevant per-alignment tracks e.g. protein domains
|
|
33
|
+
</Typography>
|
|
34
|
+
<TextField
|
|
35
|
+
select
|
|
36
|
+
helperText="Which row does this track apply to?"
|
|
37
|
+
value={currentOption}
|
|
38
|
+
onChange={event => {
|
|
39
|
+
setCurrentOption(event.target.value)
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
{options.map((option, index) => (
|
|
43
|
+
<MenuItem key={`${option}-${index}`} value={option}>
|
|
44
|
+
{option}
|
|
45
|
+
</MenuItem>
|
|
46
|
+
))}
|
|
47
|
+
</TextField>
|
|
48
|
+
<FileSelector location={trackFile} setLocation={setTrackFile} />
|
|
49
|
+
<DialogActions>
|
|
50
|
+
<Button
|
|
51
|
+
onClick={() => {
|
|
52
|
+
model.setError(undefined)
|
|
53
|
+
if (trackFile) {
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
55
|
+
model.setMSAFilehandle(trackFile)
|
|
56
|
+
}
|
|
57
|
+
}}
|
|
58
|
+
variant="contained"
|
|
59
|
+
color="primary"
|
|
60
|
+
>
|
|
61
|
+
Open
|
|
62
|
+
</Button>
|
|
63
|
+
<Button
|
|
64
|
+
color="secondary"
|
|
65
|
+
variant="contained"
|
|
66
|
+
onClick={() => onClose()}
|
|
67
|
+
>
|
|
68
|
+
Cancel
|
|
69
|
+
</Button>
|
|
70
|
+
</DialogActions>
|
|
71
|
+
</DialogContent>
|
|
72
|
+
</Dialog>
|
|
73
|
+
)
|
|
74
|
+
})
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { observer } from 'mobx-react'
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
DialogActions,
|
|
6
|
+
DialogContent,
|
|
7
|
+
IconButton,
|
|
8
|
+
TextField,
|
|
9
|
+
Typography,
|
|
10
|
+
} from '@mui/material'
|
|
11
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
12
|
+
|
|
13
|
+
// icons
|
|
14
|
+
import DeleteIcon from '@mui/icons-material/Delete'
|
|
15
|
+
|
|
16
|
+
// locals
|
|
17
|
+
import { MsaViewModel } from '../../model'
|
|
18
|
+
|
|
19
|
+
const specialFromEntries = (val: string[][]) => {
|
|
20
|
+
const ret = {} as Record<string, string[]>
|
|
21
|
+
val.forEach(([key, val]) => {
|
|
22
|
+
if (!ret[key]) {
|
|
23
|
+
ret[key] = [] as string[]
|
|
24
|
+
}
|
|
25
|
+
ret[key].push(val)
|
|
26
|
+
})
|
|
27
|
+
return ret
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const Row = observer(function ({
|
|
31
|
+
name,
|
|
32
|
+
value,
|
|
33
|
+
setValue,
|
|
34
|
+
setName,
|
|
35
|
+
onDelete,
|
|
36
|
+
}: {
|
|
37
|
+
name: string
|
|
38
|
+
value: string
|
|
39
|
+
setValue: (arg: string) => void
|
|
40
|
+
setName: (arg: string) => void
|
|
41
|
+
onDelete: () => void
|
|
42
|
+
}) {
|
|
43
|
+
return (
|
|
44
|
+
<div>
|
|
45
|
+
<IconButton onClick={onDelete} style={{ margin: 10 }}>
|
|
46
|
+
<DeleteIcon />
|
|
47
|
+
</IconButton>
|
|
48
|
+
<TextField
|
|
49
|
+
value={name}
|
|
50
|
+
onChange={event => setName(event.target.value)}
|
|
51
|
+
label="Key"
|
|
52
|
+
/>
|
|
53
|
+
<TextField
|
|
54
|
+
value={value}
|
|
55
|
+
onChange={event => setValue(event.target.value)}
|
|
56
|
+
label="Value"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
export default observer(
|
|
63
|
+
({
|
|
64
|
+
onClose,
|
|
65
|
+
data,
|
|
66
|
+
model,
|
|
67
|
+
}: {
|
|
68
|
+
model: MsaViewModel
|
|
69
|
+
onClose: () => void
|
|
70
|
+
data: { left: number; right: number }
|
|
71
|
+
}) => {
|
|
72
|
+
const { blanks } = model
|
|
73
|
+
const { left: l, right: r } = data
|
|
74
|
+
const [rows, setRows] = useState([
|
|
75
|
+
['Name', ''],
|
|
76
|
+
['ID', ''],
|
|
77
|
+
['Note', ''],
|
|
78
|
+
])
|
|
79
|
+
return (
|
|
80
|
+
<Dialog
|
|
81
|
+
onClose={() => onClose()}
|
|
82
|
+
open
|
|
83
|
+
title="Create new region annotation"
|
|
84
|
+
>
|
|
85
|
+
<DialogContent>
|
|
86
|
+
<Typography>
|
|
87
|
+
Do you want to add an annotation to the MSA at {l}..{r}{' '}
|
|
88
|
+
{blanks.length
|
|
89
|
+
? ` (gapped ${model.getPos(l)}..${model.getPos(r)}`
|
|
90
|
+
: ''}
|
|
91
|
+
</Typography>
|
|
92
|
+
{rows.map(([key, val], index) => (
|
|
93
|
+
<Row
|
|
94
|
+
key={index}
|
|
95
|
+
name={key}
|
|
96
|
+
value={val}
|
|
97
|
+
setValue={newValue => {
|
|
98
|
+
const newRows = [...rows]
|
|
99
|
+
newRows[index][1] = newValue
|
|
100
|
+
setRows(newRows)
|
|
101
|
+
}}
|
|
102
|
+
setName={newName => {
|
|
103
|
+
const newRows = [...rows]
|
|
104
|
+
newRows[index][0] = newName
|
|
105
|
+
setRows(newRows)
|
|
106
|
+
}}
|
|
107
|
+
onDelete={() => {
|
|
108
|
+
rows.splice(index, 1)
|
|
109
|
+
setRows([...rows])
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
))}
|
|
113
|
+
<Button
|
|
114
|
+
onClick={() => {
|
|
115
|
+
setRows([...rows, ['', '']])
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
Add row
|
|
119
|
+
</Button>
|
|
120
|
+
|
|
121
|
+
<DialogActions>
|
|
122
|
+
<Button
|
|
123
|
+
onClick={() => {
|
|
124
|
+
model.addAnnotation(l, r, specialFromEntries(rows))
|
|
125
|
+
onClose()
|
|
126
|
+
}}
|
|
127
|
+
variant="contained"
|
|
128
|
+
color="primary"
|
|
129
|
+
>
|
|
130
|
+
Submit
|
|
131
|
+
</Button>
|
|
132
|
+
<Button
|
|
133
|
+
variant="contained"
|
|
134
|
+
color="secondary"
|
|
135
|
+
onClick={() => onClose()}
|
|
136
|
+
>
|
|
137
|
+
Cancel
|
|
138
|
+
</Button>
|
|
139
|
+
</DialogActions>
|
|
140
|
+
</DialogContent>
|
|
141
|
+
</Dialog>
|
|
142
|
+
)
|
|
143
|
+
},
|
|
144
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { DialogContent } from '@mui/material'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
5
|
+
import { Attributes } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
6
|
+
|
|
7
|
+
// locals
|
|
8
|
+
import { MsaViewModel } from '../../model'
|
|
9
|
+
|
|
10
|
+
const DetailsDialog = observer(function ({
|
|
11
|
+
model,
|
|
12
|
+
onClose,
|
|
13
|
+
}: {
|
|
14
|
+
model: MsaViewModel
|
|
15
|
+
onClose: () => void
|
|
16
|
+
}) {
|
|
17
|
+
const { header } = model
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Dialog onClose={() => onClose()} open title="Metadata">
|
|
21
|
+
<DialogContent>
|
|
22
|
+
<Attributes attributes={header} />
|
|
23
|
+
</DialogContent>
|
|
24
|
+
</Dialog>
|
|
25
|
+
)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export default DetailsDialog
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
3
|
+
import { DialogContent } from '@mui/material'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
5
|
+
import { Attributes } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail'
|
|
6
|
+
|
|
7
|
+
export default observer(function ({
|
|
8
|
+
info,
|
|
9
|
+
onClose,
|
|
10
|
+
}: {
|
|
11
|
+
info: Record<string, unknown>
|
|
12
|
+
onClose: () => void
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<Dialog onClose={() => onClose()} open title="Metadata">
|
|
16
|
+
<DialogContent>
|
|
17
|
+
<Attributes attributes={info} />
|
|
18
|
+
</DialogContent>
|
|
19
|
+
</Dialog>
|
|
20
|
+
)
|
|
21
|
+
})
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { observer } from 'mobx-react'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
5
|
+
import {
|
|
6
|
+
Button,
|
|
7
|
+
Checkbox,
|
|
8
|
+
DialogActions,
|
|
9
|
+
DialogContent,
|
|
10
|
+
FormControlLabel,
|
|
11
|
+
MenuItem,
|
|
12
|
+
TextField,
|
|
13
|
+
} from '@mui/material'
|
|
14
|
+
|
|
15
|
+
import { MsaViewModel } from '../../model'
|
|
16
|
+
import colorSchemes from '../../colorSchemes'
|
|
17
|
+
|
|
18
|
+
const useStyles = makeStyles()(theme => ({
|
|
19
|
+
field: {
|
|
20
|
+
margin: theme.spacing(4),
|
|
21
|
+
},
|
|
22
|
+
}))
|
|
23
|
+
|
|
24
|
+
const SettingsDialog = observer(function ({
|
|
25
|
+
model,
|
|
26
|
+
onClose,
|
|
27
|
+
}: {
|
|
28
|
+
model: MsaViewModel
|
|
29
|
+
onClose: () => void
|
|
30
|
+
}) {
|
|
31
|
+
const { classes } = useStyles()
|
|
32
|
+
const { colorSchemeName, noTree } = model
|
|
33
|
+
const [rowHeight, setRowHeight] = useState(`${model.rowHeight}`)
|
|
34
|
+
const [colWidth, setColWidth] = useState(`${model.colWidth}`)
|
|
35
|
+
const [treeWidth, setTreeWidth] = useState(`${model.treeWidth}`)
|
|
36
|
+
|
|
37
|
+
function error(n: string) {
|
|
38
|
+
return Number.isNaN(+n) || +n < 0
|
|
39
|
+
}
|
|
40
|
+
const rowHeightError = error(rowHeight)
|
|
41
|
+
const colWidthError = error(colWidth)
|
|
42
|
+
const treeWidthError = error(treeWidth)
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<Dialog open onClose={() => onClose()} title="Settings">
|
|
46
|
+
<DialogContent>
|
|
47
|
+
<FormControlLabel
|
|
48
|
+
control={
|
|
49
|
+
<Checkbox
|
|
50
|
+
checked={model.showBranchLen}
|
|
51
|
+
onChange={() => model.toggleBranchLen()}
|
|
52
|
+
/>
|
|
53
|
+
}
|
|
54
|
+
label="Show branch length"
|
|
55
|
+
/>
|
|
56
|
+
<FormControlLabel
|
|
57
|
+
control={
|
|
58
|
+
<Checkbox
|
|
59
|
+
checked={model.bgColor}
|
|
60
|
+
onChange={() => model.toggleBgColor()}
|
|
61
|
+
/>
|
|
62
|
+
}
|
|
63
|
+
label="Color background"
|
|
64
|
+
/>
|
|
65
|
+
<FormControlLabel
|
|
66
|
+
control={
|
|
67
|
+
<Checkbox
|
|
68
|
+
checked={model.drawNodeBubbles}
|
|
69
|
+
onChange={() => model.toggleNodeBubbles()}
|
|
70
|
+
/>
|
|
71
|
+
}
|
|
72
|
+
label="Draw node bubbles"
|
|
73
|
+
/>
|
|
74
|
+
<FormControlLabel
|
|
75
|
+
control={
|
|
76
|
+
<Checkbox
|
|
77
|
+
checked={model.drawTree}
|
|
78
|
+
onChange={() => model.toggleDrawTree()}
|
|
79
|
+
/>
|
|
80
|
+
}
|
|
81
|
+
label="Draw tree (if available)"
|
|
82
|
+
/>
|
|
83
|
+
<FormControlLabel
|
|
84
|
+
control={
|
|
85
|
+
<Checkbox
|
|
86
|
+
checked={model.labelsAlignRight}
|
|
87
|
+
onChange={() => model.toggleLabelsAlignRight()}
|
|
88
|
+
/>
|
|
89
|
+
}
|
|
90
|
+
label="Labels align right (note: labels may draw over tree, but can adjust tree width or tree area width in UI)"
|
|
91
|
+
/>
|
|
92
|
+
|
|
93
|
+
<TextField
|
|
94
|
+
className={classes.field}
|
|
95
|
+
label="Row height (px)"
|
|
96
|
+
value={rowHeight}
|
|
97
|
+
error={rowHeightError}
|
|
98
|
+
onChange={event => setRowHeight(event.target.value)}
|
|
99
|
+
/>
|
|
100
|
+
<TextField
|
|
101
|
+
className={classes.field}
|
|
102
|
+
label="Column width (px)"
|
|
103
|
+
value={colWidth}
|
|
104
|
+
error={colWidthError}
|
|
105
|
+
onChange={event => setColWidth(event.target.value)}
|
|
106
|
+
/>
|
|
107
|
+
<br />
|
|
108
|
+
{!noTree ? (
|
|
109
|
+
<TextField
|
|
110
|
+
className={classes.field}
|
|
111
|
+
label="Tree width (px)"
|
|
112
|
+
value={treeWidth}
|
|
113
|
+
error={treeWidthError}
|
|
114
|
+
onChange={event => setTreeWidth(event.target.value)}
|
|
115
|
+
/>
|
|
116
|
+
) : null}
|
|
117
|
+
|
|
118
|
+
<br />
|
|
119
|
+
|
|
120
|
+
<TextField
|
|
121
|
+
select
|
|
122
|
+
label="Color scheme"
|
|
123
|
+
value={colorSchemeName}
|
|
124
|
+
onChange={event => model.setColorSchemeName(event.target.value)}
|
|
125
|
+
>
|
|
126
|
+
{Object.keys(colorSchemes).map(option => (
|
|
127
|
+
<MenuItem key={option} value={option}>
|
|
128
|
+
{option}
|
|
129
|
+
</MenuItem>
|
|
130
|
+
))}
|
|
131
|
+
</TextField>
|
|
132
|
+
<DialogActions>
|
|
133
|
+
<Button
|
|
134
|
+
disabled={rowHeightError || colWidthError || treeWidthError}
|
|
135
|
+
onClick={() => {
|
|
136
|
+
model.setRowHeight(+rowHeight)
|
|
137
|
+
model.setColWidth(+colWidth)
|
|
138
|
+
if (!noTree) {
|
|
139
|
+
model.setTreeWidth(+treeWidth)
|
|
140
|
+
}
|
|
141
|
+
onClose()
|
|
142
|
+
}}
|
|
143
|
+
variant="contained"
|
|
144
|
+
color="primary"
|
|
145
|
+
>
|
|
146
|
+
Submit
|
|
147
|
+
</Button>
|
|
148
|
+
</DialogActions>
|
|
149
|
+
</DialogContent>
|
|
150
|
+
</Dialog>
|
|
151
|
+
)
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
export default SettingsDialog
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import copy from 'copy-to-clipboard'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
import { Dialog } from '@jbrowse/core/ui'
|
|
5
|
+
import { Button, DialogActions, DialogContent } from '@mui/material'
|
|
6
|
+
import { makeStyles } from 'tss-react/mui'
|
|
7
|
+
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
|
+
textArea: {
|
|
10
|
+
padding: theme.spacing(2),
|
|
11
|
+
overflow: 'auto',
|
|
12
|
+
background: '#ddd',
|
|
13
|
+
wordBreak: 'break-word',
|
|
14
|
+
},
|
|
15
|
+
}))
|
|
16
|
+
|
|
17
|
+
const TrackInfoDialog = observer(function ({
|
|
18
|
+
model,
|
|
19
|
+
onClose,
|
|
20
|
+
}: {
|
|
21
|
+
model: { name: string; data: string }
|
|
22
|
+
onClose: () => void
|
|
23
|
+
}) {
|
|
24
|
+
const [label, setLabel] = useState('Copy to clipboard')
|
|
25
|
+
const { classes } = useStyles()
|
|
26
|
+
return (
|
|
27
|
+
<Dialog
|
|
28
|
+
open
|
|
29
|
+
onClose={onClose}
|
|
30
|
+
fullWidth
|
|
31
|
+
maxWidth="lg"
|
|
32
|
+
title={`Track info - ${model.name}`}
|
|
33
|
+
>
|
|
34
|
+
<DialogContent>
|
|
35
|
+
<Button
|
|
36
|
+
variant="contained"
|
|
37
|
+
color="primary"
|
|
38
|
+
onClick={() => {
|
|
39
|
+
copy(model.data)
|
|
40
|
+
setLabel('Copied!')
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
setLabel('Copy to clipboard')
|
|
43
|
+
}, 300)
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
{label}
|
|
47
|
+
</Button>
|
|
48
|
+
<pre className={classes.textArea}>{model.data}</pre>
|
|
49
|
+
</DialogContent>
|
|
50
|
+
<DialogActions>
|
|
51
|
+
<Button variant="contained" onClick={onClose} color="secondary">
|
|
52
|
+
Close
|
|
53
|
+
</Button>
|
|
54
|
+
</DialogActions>
|
|
55
|
+
</Dialog>
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
export default TrackInfoDialog
|