react-msaview 6.5.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/bundle/index.js +122 -112
- package/bundle/index.js.map +4 -4
- package/dist/colorSchemes.js +1 -2
- package/dist/colorSchemes.js.map +1 -1
- package/dist/columnStats.d.ts +28 -0
- package/dist/columnStats.js +34 -0
- package/dist/columnStats.js.map +1 -0
- package/dist/components/DragHandle.d.ts +3 -2
- package/dist/components/DragHandle.js +11 -5
- package/dist/components/DragHandle.js.map +1 -1
- package/dist/components/Loading.js +2 -2
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/MSAView.js +17 -6
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/MSAViewer.d.ts +69 -4
- package/dist/components/MSAViewer.js +201 -8
- package/dist/components/MSAViewer.js.map +1 -1
- package/dist/components/PortalTooltip.d.ts +11 -0
- package/dist/components/PortalTooltip.js +29 -0
- package/dist/components/PortalTooltip.js.map +1 -0
- package/dist/components/ResizeHandles.d.ts +3 -3
- package/dist/components/ResizeHandles.js +13 -24
- package/dist/components/ResizeHandles.js.map +1 -1
- package/dist/components/SequenceTextArea.js +3 -3
- package/dist/components/SequenceTextArea.js.map +1 -1
- package/dist/components/Track.js +41 -22
- package/dist/components/Track.js.map +1 -1
- package/dist/components/dialogs/{InterProScanDialog.d.ts → AnnotationFileDialog.d.ts} +2 -2
- package/dist/components/dialogs/AnnotationFileDialog.js +92 -0
- package/dist/components/dialogs/AnnotationFileDialog.js.map +1 -0
- package/dist/components/dialogs/ExportSVGDialog.js +5 -3
- package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
- package/dist/components/dialogs/FeatureDialog.js +13 -9
- package/dist/components/dialogs/FeatureDialog.js.map +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
- package/dist/components/header/GappynessSlider.js +6 -11
- package/dist/components/header/GappynessSlider.js.map +1 -1
- package/dist/components/header/Header.js +7 -0
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/HeaderStatusArea.js +0 -2
- package/dist/components/header/HeaderStatusArea.js.map +1 -1
- package/dist/components/header/LoadWarnings.d.ts +6 -0
- package/dist/components/header/LoadWarnings.js +35 -0
- package/dist/components/header/LoadWarnings.js.map +1 -0
- package/dist/components/header/MultiAlignmentSelector.js +0 -0
- package/dist/components/header/MultiAlignmentSelector.js.map +1 -1
- package/dist/components/header/ScrollZoomIcons.d.ts +6 -0
- package/dist/components/header/ScrollZoomIcons.js +35 -0
- package/dist/components/header/ScrollZoomIcons.js.map +1 -0
- package/dist/components/header/TreeSettingsMenu.js +7 -1
- package/dist/components/header/TreeSettingsMenu.js.map +1 -1
- package/dist/components/header/UnshareableDataWarning.d.ts +6 -0
- package/dist/components/header/UnshareableDataWarning.js +40 -0
- package/dist/components/header/UnshareableDataWarning.js.map +1 -0
- package/dist/components/header/ZoomControls.js +49 -6
- package/dist/components/header/ZoomControls.js.map +1 -1
- package/dist/components/header/getAnnotationsMenu.js +11 -14
- package/dist/components/header/getAnnotationsMenu.js.map +1 -1
- package/dist/components/header/settingsMenuItems.js +10 -7
- package/dist/components/header/settingsMenuItems.js.map +1 -1
- package/dist/components/import/ImportForm.js +1 -1
- package/dist/components/import/ImportForm.js.map +1 -1
- package/dist/components/import/ImportFormExamples.js +2 -6
- package/dist/components/import/ImportFormExamples.js.map +1 -1
- package/dist/components/import/util.js +2 -0
- package/dist/components/import/util.js.map +1 -1
- package/dist/components/minimap/Minimap.js +1 -2
- package/dist/components/minimap/Minimap.js.map +1 -1
- package/dist/components/msa/AnnotationLegend.js +27 -19
- package/dist/components/msa/AnnotationLegend.js.map +1 -1
- package/dist/components/msa/MSACanvas.js +1 -1
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.js +17 -20
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js +2 -1
- package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
- package/dist/components/msa/domainBandCursor.d.ts +7 -11
- package/dist/components/msa/domainBandCursor.js +7 -11
- package/dist/components/msa/domainBandCursor.js.map +1 -1
- package/dist/components/msa/drawFeatureSpans.d.ts +53 -0
- package/dist/components/msa/drawFeatureSpans.js +78 -0
- package/dist/components/msa/drawFeatureSpans.js.map +1 -0
- package/dist/components/msa/legendRows.d.ts +8 -0
- package/dist/components/msa/legendRows.js +16 -0
- package/dist/components/msa/legendRows.js.map +1 -0
- package/dist/components/msa/msaRaster.d.ts +30 -27
- package/dist/components/msa/msaRaster.js +193 -90
- package/dist/components/msa/msaRaster.js.map +1 -1
- package/dist/components/msa/packDomainLanes.d.ts +20 -0
- package/dist/components/msa/packDomainLanes.js +33 -0
- package/dist/components/msa/packDomainLanes.js.map +1 -0
- package/dist/components/msa/renderBoxFeatureCanvasBlock.d.ts +3 -1
- package/dist/components/msa/renderBoxFeatureCanvasBlock.js +51 -87
- package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
- package/dist/components/msa/renderHighlights.d.ts +44 -4
- package/dist/components/msa/renderHighlights.js +99 -11
- package/dist/components/msa/renderHighlights.js.map +1 -1
- package/dist/components/msa/renderMSABlock.d.ts +1 -2
- package/dist/components/msa/renderMSABlock.js +28 -31
- package/dist/components/msa/renderMSABlock.js.map +1 -1
- package/dist/components/msa/renderMSAMouseover.js +9 -30
- package/dist/components/msa/renderMSAMouseover.js.map +1 -1
- package/dist/components/msa/tileColor.js +4 -7
- package/dist/components/msa/tileColor.js.map +1 -1
- package/dist/components/msa/useMsaBlockMouse.d.ts +5 -3
- package/dist/components/msa/useMsaBlockMouse.js +6 -6
- package/dist/components/msa/useMsaBlockMouse.js.map +1 -1
- package/dist/components/renderCtx.d.ts +1 -1
- package/dist/components/rowpanels/RowPanelBlock.d.ts +9 -0
- package/dist/components/rowpanels/RowPanelBlock.js +86 -0
- package/dist/components/rowpanels/RowPanelBlock.js.map +1 -0
- package/dist/components/rowpanels/RowPanelHeaders.d.ts +12 -0
- package/dist/components/rowpanels/RowPanelHeaders.js +38 -0
- package/dist/components/rowpanels/RowPanelHeaders.js.map +1 -0
- package/dist/components/{msa/ColumnStats.d.ts → rowpanels/RowPanels.d.ts} +2 -2
- package/dist/components/rowpanels/RowPanels.js +32 -0
- package/dist/components/rowpanels/RowPanels.js.map +1 -0
- package/dist/components/rowpanels/headerLayout.d.ts +1 -0
- package/dist/components/rowpanels/headerLayout.js +5 -0
- package/dist/components/rowpanels/headerLayout.js.map +1 -0
- package/dist/components/rowpanels/renderFeaturePanel.d.ts +21 -0
- package/dist/components/rowpanels/renderFeaturePanel.js +37 -0
- package/dist/components/rowpanels/renderFeaturePanel.js.map +1 -0
- package/dist/components/rowpanels/renderRowPanel.d.ts +23 -0
- package/dist/components/rowpanels/renderRowPanel.js +22 -0
- package/dist/components/rowpanels/renderRowPanel.js.map +1 -0
- package/dist/components/rowpanels/renderStrip.d.ts +20 -0
- package/dist/components/rowpanels/renderStrip.js +26 -0
- package/dist/components/rowpanels/renderStrip.js.map +1 -0
- package/dist/components/tracks/TrackBlocks.js +13 -16
- package/dist/components/tracks/TrackBlocks.js.map +1 -1
- package/dist/components/tracks/TrackTooltipContent.d.ts +15 -0
- package/dist/components/tracks/TrackTooltipContent.js +109 -0
- package/dist/components/tracks/TrackTooltipContent.js.map +1 -0
- package/dist/components/tracks/drawTracks.d.ts +30 -12
- package/dist/components/tracks/drawTracks.js +127 -34
- package/dist/components/tracks/drawTracks.js.map +1 -1
- package/dist/components/tracks/useTrackHover.d.ts +22 -0
- package/dist/components/tracks/useTrackHover.js +30 -0
- package/dist/components/tracks/useTrackHover.js.map +1 -0
- package/dist/components/tree/CladeLabels.d.ts +12 -0
- package/dist/components/tree/CladeLabels.js +48 -0
- package/dist/components/tree/CladeLabels.js.map +1 -0
- package/dist/components/tree/TreeCanvas.js +6 -4
- package/dist/components/tree/TreeCanvas.js.map +1 -1
- package/dist/components/tree/TreeCanvasBlock.js +6 -21
- package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
- package/dist/components/tree/TreeOverview.d.ts +14 -0
- package/dist/components/tree/TreeOverview.js +75 -0
- package/dist/components/tree/TreeOverview.js.map +1 -0
- package/dist/components/tree/TreeRuler.js +11 -5
- package/dist/components/tree/TreeRuler.js.map +1 -1
- package/dist/components/tree/cladeBrackets.d.ts +25 -0
- package/dist/components/tree/cladeBrackets.js +51 -0
- package/dist/components/tree/cladeBrackets.js.map +1 -0
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +2 -2
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.d.ts +0 -1
- package/dist/components/tree/renderTreeCanvas.js +221 -47
- package/dist/components/tree/renderTreeCanvas.js.map +1 -1
- package/dist/components/tree/renderTreeOverview.d.ts +52 -0
- package/dist/components/tree/renderTreeOverview.js +138 -0
- package/dist/components/tree/renderTreeOverview.js.map +1 -0
- package/dist/components/tree/scaleBar.d.ts +10 -0
- package/dist/components/tree/scaleBar.js +24 -0
- package/dist/components/tree/scaleBar.js.map +1 -0
- package/dist/components/tree/useTreeHover.js +2 -4
- package/dist/components/tree/useTreeHover.js.map +1 -1
- package/dist/constants.d.ts +18 -1
- package/dist/constants.js +51 -8
- package/dist/constants.js.map +1 -1
- package/dist/createPaletteMap.d.ts +7 -6
- package/dist/createPaletteMap.js +10 -9
- package/dist/createPaletteMap.js.map +1 -1
- package/dist/element.d.ts +13 -0
- package/dist/element.js +269 -0
- package/dist/element.js.map +1 -0
- package/dist/featureFields.d.ts +11 -0
- package/dist/featureFields.js +17 -0
- package/dist/featureFields.js.map +1 -0
- package/dist/fetchUtils.d.ts +7 -7
- package/dist/fetchUtils.js +4 -32
- package/dist/fetchUtils.js.map +1 -1
- package/dist/flatToTree.js +1 -2
- package/dist/flatToTree.js.map +1 -1
- package/dist/ggplotPalettes.d.ts +10 -0
- package/dist/ggplotPalettes.js +58 -0
- package/dist/ggplotPalettes.js.map +1 -1
- package/dist/hierarchy.d.ts +29 -1
- package/dist/hierarchy.js +82 -19
- package/dist/hierarchy.js.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/model/DataModel.js +4 -4
- package/dist/model/DataModel.js.map +1 -1
- package/dist/model/msaModel.d.ts +3 -2
- package/dist/model/msaModel.js +3 -2
- package/dist/model/msaModel.js.map +1 -1
- package/dist/model/treeModel.d.ts +30 -0
- package/dist/model/treeModel.js +37 -1
- package/dist/model/treeModel.js.map +1 -1
- package/dist/model.d.ts +792 -259
- package/dist/model.js +2092 -675
- package/dist/model.js.map +1 -1
- package/dist/mount.d.ts +11 -0
- package/dist/mount.js +22 -0
- package/dist/mount.js.map +1 -0
- package/dist/neighborJoining.js +8 -32
- package/dist/neighborJoining.js.map +1 -1
- package/dist/renderToStaticMarkup.d.ts +15 -13
- package/dist/renderToStaticMarkup.js +37 -25
- package/dist/renderToStaticMarkup.js.map +1 -1
- package/dist/renderToSvg.js +198 -68
- package/dist/renderToSvg.js.map +1 -1
- package/dist/rowCoordinateCalculations.d.ts +26 -28
- package/dist/rowCoordinateCalculations.js +13 -39
- package/dist/rowCoordinateCalculations.js.map +1 -1
- package/dist/scales.d.ts +22 -0
- package/dist/scales.js +30 -0
- package/dist/scales.js.map +1 -0
- package/dist/seqPosToGlobalCol.d.ts +2 -3
- package/dist/seqPosToGlobalCol.js +5 -4
- package/dist/seqPosToGlobalCol.js.map +1 -1
- package/dist/sequenceLogo.d.ts +6 -11
- package/dist/sequenceLogo.js +6 -11
- package/dist/sequenceLogo.js.map +1 -1
- package/dist/stripDefault.d.ts +7 -14
- package/dist/stripDefault.js +7 -14
- package/dist/stripDefault.js.map +1 -1
- package/dist/svgTestUtil.d.ts +306 -124
- package/dist/types.d.ts +295 -3
- package/dist/umd.d.ts +2 -0
- package/dist/umd.js +4 -2
- package/dist/umd.js.map +1 -1
- package/dist/useCanvasAutorun.d.ts +5 -10
- package/dist/useCanvasAutorun.js +5 -10
- package/dist/useCanvasAutorun.js.map +1 -1
- package/dist/useMsaSvgFigure.d.ts +20 -0
- package/dist/useMsaSvgFigure.js +46 -0
- package/dist/useMsaSvgFigure.js.map +1 -0
- package/dist/util.d.ts +10 -4
- package/dist/util.js +37 -10
- package/dist/util.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wuss.d.ts +14 -0
- package/dist/wuss.js +55 -0
- package/dist/wuss.js.map +1 -0
- package/package.json +23 -14
- package/src/colorSchemes.ts +1 -2
- package/src/columnStats.ts +58 -0
- package/src/components/DragHandle.tsx +18 -7
- package/src/components/Loading.tsx +14 -8
- package/src/components/MSAView.tsx +19 -5
- package/src/components/MSAViewer.tsx +326 -10
- package/src/components/PortalTooltip.tsx +47 -0
- package/src/components/ResizeHandles.tsx +21 -36
- package/src/components/SequenceTextArea.tsx +3 -3
- package/src/components/Track.tsx +55 -18
- package/src/components/dialogs/AnnotationFileDialog.tsx +162 -0
- package/src/components/dialogs/ExportSVGDialog.tsx +7 -2
- package/src/components/dialogs/FeatureDialog.tsx +13 -9
- package/src/components/dialogs/TrackInfoDialog.tsx +1 -1
- package/src/components/header/GappynessSlider.tsx +6 -11
- package/src/components/header/Header.tsx +10 -0
- package/src/components/header/HeaderStatusArea.tsx +0 -5
- package/src/components/header/LoadWarnings.tsx +48 -0
- package/src/components/header/MultiAlignmentSelector.tsx +0 -0
- package/src/components/header/ScrollZoomIcons.tsx +52 -0
- package/src/components/header/TreeSettingsMenu.tsx +7 -1
- package/src/components/header/UnshareableDataWarning.tsx +56 -0
- package/src/components/header/ZoomControls.tsx +74 -14
- package/src/components/header/getAnnotationsMenu.ts +13 -17
- package/src/components/header/settingsMenuItems.ts +11 -6
- package/src/components/import/ImportForm.tsx +2 -2
- package/src/components/import/ImportFormExamples.tsx +4 -8
- package/src/components/import/util.ts +2 -0
- package/src/components/minimap/Minimap.tsx +1 -2
- package/src/components/msa/AnnotationLegend.tsx +48 -38
- package/src/components/msa/MSACanvas.tsx +3 -5
- package/src/components/msa/MSACanvasBlock.tsx +17 -21
- package/src/components/msa/MSAMouseoverCanvas.tsx +2 -1
- package/src/components/msa/domainBandCursor.ts +7 -11
- package/src/components/msa/drawFeatureSpans.ts +150 -0
- package/src/components/msa/legendRows.ts +24 -0
- package/src/components/msa/msaRaster.ts +236 -88
- package/src/components/msa/packDomainLanes.ts +36 -0
- package/src/components/msa/renderBoxFeatureCanvasBlock.ts +69 -123
- package/src/components/msa/renderHighlights.ts +141 -10
- package/src/components/msa/renderMSABlock.ts +29 -38
- package/src/components/msa/renderMSAMouseover.ts +9 -39
- package/src/components/msa/tileColor.ts +4 -7
- package/src/components/msa/useMsaBlockMouse.ts +6 -6
- package/src/components/renderCtx.ts +1 -0
- package/src/components/rowpanels/RowPanelBlock.tsx +139 -0
- package/src/components/rowpanels/RowPanelHeaders.tsx +57 -0
- package/src/components/rowpanels/RowPanels.tsx +77 -0
- package/src/components/rowpanels/headerLayout.ts +5 -0
- package/src/components/rowpanels/renderFeaturePanel.ts +66 -0
- package/src/components/rowpanels/renderRowPanel.ts +41 -0
- package/src/components/rowpanels/renderStrip.ts +46 -0
- package/src/components/tracks/TrackBlocks.tsx +13 -18
- package/src/components/tracks/TrackTooltipContent.tsx +156 -0
- package/src/components/tracks/drawTracks.ts +169 -38
- package/src/components/tracks/useTrackHover.ts +42 -0
- package/src/components/tree/CladeLabels.tsx +77 -0
- package/src/components/tree/TreeCanvas.tsx +4 -3
- package/src/components/tree/TreeCanvasBlock.tsx +10 -32
- package/src/components/tree/TreeOverview.tsx +106 -0
- package/src/components/tree/TreeRuler.tsx +29 -5
- package/src/components/tree/cladeBrackets.ts +73 -0
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +2 -2
- package/src/components/tree/renderTreeCanvas.ts +312 -48
- package/src/components/tree/renderTreeOverview.ts +212 -0
- package/src/components/tree/scaleBar.ts +23 -0
- package/src/components/tree/useTreeHover.ts +2 -4
- package/src/constants.ts +61 -8
- package/src/createPaletteMap.ts +10 -9
- package/src/element.ts +321 -0
- package/src/featureFields.ts +19 -0
- package/src/fetchUtils.ts +7 -40
- package/src/flatToTree.ts +1 -2
- package/src/ggplotPalettes.ts +60 -0
- package/src/hierarchy.ts +97 -20
- package/src/index.ts +46 -6
- package/src/model/DataModel.ts +5 -4
- package/src/model/msaModel.ts +3 -2
- package/src/model/treeModel.ts +42 -0
- package/src/model.ts +2492 -793
- package/src/mount.tsx +32 -0
- package/src/neighborJoining.ts +8 -32
- package/src/rawImports.d.ts +9 -0
- package/src/renderToStaticMarkup.ts +41 -25
- package/src/renderToSvg.tsx +365 -92
- package/src/rowCoordinateCalculations.ts +16 -62
- package/src/scales.ts +47 -0
- package/src/seqPosToGlobalCol.ts +5 -4
- package/src/sequenceLogo.ts +6 -11
- package/src/stripDefault.ts +7 -14
- package/src/types.ts +352 -12
- package/src/umd.ts +4 -2
- package/src/useCanvasAutorun.ts +5 -10
- package/src/useMsaSvgFigure.ts +72 -0
- package/src/util.ts +40 -14
- package/src/version.ts +1 -1
- package/src/wuss.ts +62 -0
- package/dist/components/dialogs/InterProScanDialog.js +0 -137
- package/dist/components/dialogs/InterProScanDialog.js.map +0 -1
- package/dist/components/dialogs/InterProScanFileDialog.d.ts +0 -7
- package/dist/components/dialogs/InterProScanFileDialog.js +0 -64
- package/dist/components/dialogs/InterProScanFileDialog.js.map +0 -1
- package/dist/components/msa/ColumnStats.js +0 -42
- package/dist/components/msa/ColumnStats.js.map +0 -1
- package/dist/launchInterProScan.d.ts +0 -13
- package/dist/launchInterProScan.js +0 -110
- package/dist/launchInterProScan.js.map +0 -1
- package/dist/useColorContrast.d.ts +0 -10
- package/dist/useColorContrast.js +0 -13
- package/dist/useColorContrast.js.map +0 -1
- package/src/clustalX.test.ts +0 -74
- package/src/colSpace.test.ts +0 -67
- package/src/collapseLogic.test.ts +0 -115
- package/src/colorSchemes.docs.test.ts +0 -57
- package/src/columnCounts.test.ts +0 -73
- package/src/columnStats.test.ts +0 -94
- package/src/columnTracks.test.ts +0 -97
- package/src/components/dialogs/InterProScanDialog.tsx +0 -214
- package/src/components/dialogs/InterProScanFileDialog.tsx +0 -138
- package/src/components/minimap/minimapLayout.test.ts +0 -71
- package/src/components/msa/ColumnStats.tsx +0 -54
- package/src/components/msa/msaRaster.test.ts +0 -145
- package/src/components/msa/renderBoxFeatureCanvasBlock.test.ts +0 -51
- package/src/components/tree/renderTreeCanvas.test.ts +0 -296
- package/src/dataInitialized.test.ts +0 -42
- package/src/domainBands.test.ts +0 -122
- package/src/domainLetterColor.test.ts +0 -80
- package/src/exportFileName.test.ts +0 -40
- package/src/fetchUtils.test.ts +0 -83
- package/src/flatToTree.test.ts +0 -51
- package/src/hierarchy.test.ts +0 -228
- package/src/highlights.test.ts +0 -70
- package/src/impgRender.test.tsx +0 -68
- package/src/largeTree.test.ts +0 -67
- package/src/launchInterProScan.ts +0 -167
- package/src/loadErrorDisplay.test.tsx +0 -102
- package/src/modelFilehandleLoaders.test.ts +0 -137
- package/src/modelReset.test.ts +0 -120
- package/src/neighborJoining.test.ts +0 -164
- package/src/parseAsn1.test.ts +0 -36
- package/src/propertyConservation.test.ts +0 -36
- package/src/renderColumnTracksSvg.test.tsx +0 -108
- package/src/renderDomainsSvg.test.tsx +0 -118
- package/src/renderHighlightsSvg.test.tsx +0 -85
- package/src/renderMinimapSvg.test.tsx +0 -62
- package/src/renderRasterSvg.test.tsx +0 -144
- package/src/renderSequenceLogoSvg.test.tsx +0 -165
- package/src/renderToSvg.test.tsx +0 -65
- package/src/reset.test.ts +0 -61
- package/src/rowCoordinateCalculations.test.ts +0 -211
- package/src/rowSpace.test.ts +0 -46
- package/src/segmentOverlay.test.ts +0 -70
- package/src/seqPosToGlobalCol.test.ts +0 -59
- package/src/sequenceLogo.test.ts +0 -88
- package/src/setFontSize.test.ts +0 -33
- package/src/stripDefault.test.ts +0 -48
- package/src/stripDefaultSnapshot.test.ts +0 -87
- package/src/treeMetadata.test.ts +0 -39
- package/src/useCanvasAutorun.test.tsx +0 -98
- package/src/useColorContrast.ts +0 -18
- package/src/viewChrome.test.tsx +0 -134
- package/src/wheelZoom.test.ts +0 -46
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { isBlank } from './util.ts'
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* MSA Coordinate Systems:
|
|
5
3
|
*
|
|
@@ -81,9 +79,8 @@ function countBlanksBefore(blanks: number[], globalCol: number) {
|
|
|
81
79
|
* that is its own visible index; for a hidden one it is the index of the next
|
|
82
80
|
* visible column, i.e. where the hidden column collapses to.
|
|
83
81
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* in a hidden column.
|
|
82
|
+
* Spans use this, since globalColToVisibleCol drops a span whenever either end
|
|
83
|
+
* lands in a hidden column.
|
|
87
84
|
*
|
|
88
85
|
* @param blanks - Sorted array of global column indices that are hidden
|
|
89
86
|
* @param globalCol - The global column index in the full MSA
|
|
@@ -93,65 +90,22 @@ export function visibleColsBefore(blanks: number[], globalCol: number) {
|
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
/**
|
|
96
|
-
*
|
|
97
|
-
*
|
|
93
|
+
* The ungapped position a row holds at a global column, or undefined when that
|
|
94
|
+
* column is a gap in the row or past its end.
|
|
98
95
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* @
|
|
96
|
+
* Binary-searches the row's ascending seqPos index; it runs on every mouse
|
|
97
|
+
* move, and scanning a 30k-column row per event takes the whole frame.
|
|
98
|
+
*
|
|
99
|
+
* @param index - The row's seqPos -> global column index (buildSeqPosIndex)
|
|
100
|
+
* @param globalCol - The global column index in the full MSA
|
|
103
101
|
*/
|
|
104
|
-
export function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
seq: string
|
|
110
|
-
blanks: number[]
|
|
111
|
-
visibleCol: number
|
|
112
|
-
}) {
|
|
113
|
-
// First convert the visible column to global column
|
|
114
|
-
const globalCol = visibleColToGlobalCol(blanks, visibleCol)
|
|
115
|
-
const seqLen = seq.length
|
|
116
|
-
|
|
117
|
-
// Check if the position in the sequence is a gap
|
|
118
|
-
if (globalCol < seqLen && isBlank(seq[globalCol])) {
|
|
102
|
+
export function seqPosOfGlobalCol(
|
|
103
|
+
index: Int32Array | undefined,
|
|
104
|
+
globalCol: number,
|
|
105
|
+
) {
|
|
106
|
+
if (!index) {
|
|
119
107
|
return undefined
|
|
120
108
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
let seqPos = 0
|
|
124
|
-
for (let i = 0; i < globalCol && i < seqLen; i++) {
|
|
125
|
-
if (!isBlank(seq[i])) {
|
|
126
|
-
seqPos++
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return globalCol < seqLen ? seqPos : undefined
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Convert a visible column to a row-specific sequence position, with row lookup.
|
|
135
|
-
*
|
|
136
|
-
* @param rowName - The name of the row
|
|
137
|
-
* @param visibleCol - The visible column index
|
|
138
|
-
* @param rowMap - Map from row name to sequence string
|
|
139
|
-
* @param blanks - Sorted array of global column indices that are hidden
|
|
140
|
-
* @returns The sequence position, or undefined if row not found or position is a gap
|
|
141
|
-
*/
|
|
142
|
-
export function visibleColToSeqPosForRow({
|
|
143
|
-
rowName,
|
|
144
|
-
visibleCol,
|
|
145
|
-
rowMap,
|
|
146
|
-
blanks,
|
|
147
|
-
}: {
|
|
148
|
-
rowName: string
|
|
149
|
-
visibleCol: number
|
|
150
|
-
rowMap: Map<string, string>
|
|
151
|
-
blanks: number[]
|
|
152
|
-
}) {
|
|
153
|
-
const seq = rowMap.get(rowName)
|
|
154
|
-
return seq !== undefined
|
|
155
|
-
? visibleColToSeqPos({ seq, visibleCol, blanks })
|
|
156
|
-
: undefined
|
|
109
|
+
const seqPos = partitionPoint(index.length, i => index[i]! >= globalCol)
|
|
110
|
+
return index[seqPos] === globalCol ? seqPos : undefined
|
|
157
111
|
}
|
package/src/scales.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createPaletteMap } from './createPaletteMap.ts'
|
|
2
|
+
import { paletteNamed } from './ggplotPalettes.ts'
|
|
3
|
+
|
|
4
|
+
import type { LegendEntry } from './types.ts'
|
|
5
|
+
|
|
6
|
+
/** how a channel reads a field: a palette by name, or a color per value */
|
|
7
|
+
export interface ScaleSpec {
|
|
8
|
+
palette?: string
|
|
9
|
+
map?: Record<string, string>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ResolvedScale {
|
|
13
|
+
kind: 'categorical'
|
|
14
|
+
colorOf: (value: string) => string | undefined
|
|
15
|
+
legend: LegendEntry[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The scale a channel reads its field through. `values` are the field's values,
|
|
20
|
+
* in any order and with repeats; the domain is their distinct values sorted, so
|
|
21
|
+
* a value keeps its color when rows are re-ordered, collapsed or filtered.
|
|
22
|
+
*
|
|
23
|
+
* `{map}` colors the values the producer named and leaves the rest uncolored.
|
|
24
|
+
* `{palette}` takes the colors of a named palette, and a spec with neither
|
|
25
|
+
* takes the ggplot palette of the domain's size. Every scale is categorical
|
|
26
|
+
* today; a continuous one waits for a caller.
|
|
27
|
+
*/
|
|
28
|
+
export function resolveScale(
|
|
29
|
+
spec: ScaleSpec | undefined,
|
|
30
|
+
values: Iterable<string>,
|
|
31
|
+
): ResolvedScale {
|
|
32
|
+
const domain = [...new Set(values)].sort((a, b) => a.localeCompare(b))
|
|
33
|
+
const { map, palette } = spec ?? {}
|
|
34
|
+
const colors = map ?? createPaletteMap(domain, paletteNamed(palette))
|
|
35
|
+
const present = new Set(domain)
|
|
36
|
+
const labels = map ? Object.keys(map).filter(v => present.has(v)) : domain
|
|
37
|
+
return {
|
|
38
|
+
kind: 'categorical',
|
|
39
|
+
colorOf: (value: string) => colors[value],
|
|
40
|
+
// a categorical value is its own label, and the id a legend keys on
|
|
41
|
+
legend: labels.map(value => ({
|
|
42
|
+
id: value,
|
|
43
|
+
label: value,
|
|
44
|
+
color: colors[value]!,
|
|
45
|
+
})),
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/seqPosToGlobalCol.ts
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* The global column of every ungapped sequence position in a row, i.e.
|
|
3
3
|
* index[seqPos] is the column holding the seqPos-th non-gap character.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* per row on every redraw, and scanning the row for each would be quadratic.
|
|
5
|
+
* The domain overlay resolves one position per feature per row on every redraw,
|
|
6
|
+
* and scanning the row for each would be quadratic.
|
|
8
7
|
*
|
|
9
8
|
* @example
|
|
10
9
|
* // Row: "A-TG-C" (A at 0, T at 2, G at 3, C at 5)
|
|
@@ -19,5 +18,7 @@ export function buildSeqPosIndex(row: string) {
|
|
|
19
18
|
index[n++] = col
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
|
-
|
|
21
|
+
// slice, not subarray: a subarray keeps the whole row-length buffer alive,
|
|
22
|
+
// and a gappy alignment's indexes are held for as long as the parse is
|
|
23
|
+
return index.slice(0, n)
|
|
23
24
|
}
|
package/src/sequenceLogo.ts
CHANGED
|
@@ -19,18 +19,13 @@ export function maxBitsFor(sequenceType: 'dna' | 'rna' | 'amino') {
|
|
|
19
19
|
* stack bottom-up in array order.
|
|
20
20
|
*
|
|
21
21
|
* Heights follow Schneider & Stephens: the column's information content is
|
|
22
|
-
* `log2(alphabet) - H` bits,
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* ten-way one -- otherwise every gappy column would look uninformative for the
|
|
26
|
-
* wrong reason.
|
|
22
|
+
* `log2(alphabet) - H` bits, split among residues by frequency. Frequencies
|
|
23
|
+
* count non-gap residues only, so two residues and eight gaps form a two-way
|
|
24
|
+
* choice.
|
|
27
25
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* full-height stack off its one remaining pair of residues reads as a conserved
|
|
32
|
-
* site. Scaling makes stack height mean "how much this column tells you about
|
|
33
|
-
* the family", matching what the conservation track above it already plots.
|
|
26
|
+
* Unlike plain WebLogo, the stack is then scaled by the non-gap fraction, so a
|
|
27
|
+
* 90%-gap column with one conserved pair does not draw a full-height stack, and
|
|
28
|
+
* stack height matches the conservation track.
|
|
34
29
|
*/
|
|
35
30
|
export function columnLogoStack(
|
|
36
31
|
colStats: ColumnCounts,
|
package/src/stripDefault.ts
CHANGED
|
@@ -9,21 +9,14 @@ import type {
|
|
|
9
9
|
/**
|
|
10
10
|
* `types.stripDefault`, degrading to `types.optional` on hosts that lack it.
|
|
11
11
|
*
|
|
12
|
-
* stripDefault keeps defaulted properties out of snapshots,
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* stripDefault keeps defaulted properties out of snapshots, and only the
|
|
13
|
+
* mobx-state-tree in unreleased @jbrowse/core has it. The plugin bundle
|
|
14
|
+
* externalizes mobx-state-tree, so the host's copy is known only at runtime, and
|
|
15
|
+
* calling a missing stripDefault during model construction makes PluginLoader
|
|
16
|
+
* reject and the whole app show its error page.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* its error page. Losing minimal snapshots is a far better failure than losing
|
|
21
|
-
* the session, so this degrades instead.
|
|
22
|
-
*
|
|
23
|
-
* The two signatures are identical, so behaviour differs only in that defaults
|
|
24
|
-
* reappear in snapshots on older hosts (bigger session snapshots and shared
|
|
25
|
-
* URLs, nothing incorrect). stripDefaultSnapshot.test.ts still pins the stripped
|
|
26
|
-
* behaviour, since dev runs against a version that has it.
|
|
18
|
+
* The signatures are identical; on older hosts, defaults reappear in snapshots
|
|
19
|
+
* and shared URLs. stripDefaultSnapshot.test.ts pins the stripped behaviour.
|
|
27
20
|
*/
|
|
28
21
|
export function stripDefault<IT extends IAnyType>(
|
|
29
22
|
type: IT,
|
package/src/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResolvedScale, ScaleSpec } from './scales.ts'
|
|
1
2
|
import type { Annotation } from 'msa-parsers'
|
|
2
3
|
|
|
3
4
|
export interface Accession {
|
|
@@ -5,10 +6,16 @@ export interface Accession {
|
|
|
5
6
|
name: string
|
|
6
7
|
description: string
|
|
7
8
|
}
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
// every kind draws into the same per-column space; drawTracks.ts dispatches on
|
|
10
|
+
// it to pick the draw function
|
|
11
|
+
export type TrackKind = 'text' | 'bar' | 'logo' | 'arc' | 'ruler'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Which channel the color scheme paints. `fill` colors the cell a residue sits
|
|
15
|
+
* in, `color` colors the letter itself, the same distinction a grammar of
|
|
16
|
+
* graphics draws between a shape's interior and its own ink.
|
|
17
|
+
*/
|
|
18
|
+
export type ResidueEncoding = 'fill' | 'color'
|
|
12
19
|
|
|
13
20
|
export interface BasicTrackModel {
|
|
14
21
|
id: string
|
|
@@ -16,6 +23,11 @@ export interface BasicTrackModel {
|
|
|
16
23
|
associatedRowName?: string
|
|
17
24
|
height: number
|
|
18
25
|
kind: TrackKind
|
|
26
|
+
// the model height this track's divider writes, shared with every track
|
|
27
|
+
// carrying the same key. Absent on a track no divider resizes.
|
|
28
|
+
heightKey?: string
|
|
29
|
+
// hidden until the user asks for it, unless they have already chosen
|
|
30
|
+
defaultOff?: boolean
|
|
19
31
|
}
|
|
20
32
|
|
|
21
33
|
export interface TextTrackModel extends BasicTrackModel {
|
|
@@ -29,20 +41,45 @@ export interface BarTrackModel extends BasicTrackModel {
|
|
|
29
41
|
barColor?: string
|
|
30
42
|
}
|
|
31
43
|
|
|
44
|
+
// a pair of columns joined by an arc, resolved to 0-based visible columns for
|
|
45
|
+
// the renderer
|
|
46
|
+
export interface Arc {
|
|
47
|
+
start: number
|
|
48
|
+
end: number
|
|
49
|
+
color?: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// a track that joins pairs of columns with arcs (RNA base pairs, disulfide
|
|
53
|
+
// bonds, residue contacts)
|
|
54
|
+
export interface ArcTrackModel extends BasicTrackModel {
|
|
55
|
+
arcs?: Arc[]
|
|
56
|
+
arcColor?: string
|
|
57
|
+
}
|
|
58
|
+
|
|
32
59
|
export interface BasicTrack {
|
|
33
60
|
ReactComponent: React.FC<any>
|
|
34
|
-
model: TextTrackModel & BarTrackModel
|
|
61
|
+
model: TextTrackModel & BarTrackModel & ArcTrackModel
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// one arc of an arc track, in the snapshot's own coordinates: 1-based and
|
|
65
|
+
// inclusive, alignment columns unless the track names a `row`
|
|
66
|
+
export interface ArcSpec {
|
|
67
|
+
start: number
|
|
68
|
+
end: number
|
|
69
|
+
color?: string
|
|
35
70
|
}
|
|
36
71
|
|
|
37
72
|
// a track supplied as data in the snapshot rather than computed from the
|
|
38
73
|
// alignment. `values` (bar) or `data` (text) index alignment columns, or the
|
|
39
|
-
// 1-based residues of `row` when it names one
|
|
74
|
+
// 1-based residues of `row` when it names one; `arcs` (arc) name two such
|
|
75
|
+
// positions each
|
|
40
76
|
export interface ColumnTrackSpec {
|
|
41
77
|
id: string
|
|
42
78
|
name: string
|
|
43
|
-
kind: 'bar' | 'text'
|
|
79
|
+
kind: 'bar' | 'text' | 'arc'
|
|
44
80
|
values?: number[]
|
|
45
81
|
data?: string
|
|
82
|
+
arcs?: ArcSpec[]
|
|
46
83
|
max?: number
|
|
47
84
|
color?: string
|
|
48
85
|
colors?: Record<string, string>
|
|
@@ -50,20 +87,225 @@ export interface ColumnTrackSpec {
|
|
|
50
87
|
height?: number
|
|
51
88
|
}
|
|
52
89
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
90
|
+
/**
|
|
91
|
+
* A strip panel: one cell per row, colored from a `rowData` field through
|
|
92
|
+
* `scale`, which is ggtree's `gheatmap`. `width` is in pixels and defaults to
|
|
93
|
+
* the row height, and `header` labels the column and defaults to the field.
|
|
94
|
+
* `legend` titles the strip's legend and defaults to the field, and strips
|
|
95
|
+
* naming one title share one legend.
|
|
96
|
+
*/
|
|
97
|
+
export interface RowStripSpec {
|
|
98
|
+
kind: 'strip'
|
|
99
|
+
field: string
|
|
100
|
+
scale?: ScaleSpec
|
|
101
|
+
width?: number
|
|
102
|
+
header?: string
|
|
103
|
+
legend?: string
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** the channels a `features` panel reads off the feature table */
|
|
107
|
+
export interface FeatureEncodingSpec {
|
|
108
|
+
color?: { field: string; scale?: ScaleSpec }
|
|
109
|
+
label?: string
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Shifts each row so that the first feature named `on` starts at zero, which
|
|
114
|
+
* is gggenes' `make_alignment_dummies`. Only `x: "position"` reads it.
|
|
115
|
+
*/
|
|
116
|
+
export interface AlignTransform {
|
|
117
|
+
type: 'align'
|
|
118
|
+
on: string
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A features panel: the GFF's spans per row, as arrows where they carry a
|
|
123
|
+
* strand. `x: "column"` draws them in the alignment's columns, and
|
|
124
|
+
* `x: "position"` in each row's own residue positions on one linear scale, so
|
|
125
|
+
* a genome with no alignment has an x.
|
|
126
|
+
*/
|
|
127
|
+
export interface RowFeaturesSpec {
|
|
128
|
+
kind: 'features'
|
|
129
|
+
x: 'column' | 'position'
|
|
130
|
+
width?: number
|
|
131
|
+
header?: string
|
|
132
|
+
encoding?: FeatureEncodingSpec
|
|
133
|
+
transform?: AlignTransform[]
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* A panel left of the alignment on the row scale, the counterpart of
|
|
138
|
+
* ColumnTrackSpec on the column scale. See docs/layers.md
|
|
139
|
+
*/
|
|
140
|
+
export type RowPanelSpec = RowStripSpec | RowFeaturesSpec
|
|
141
|
+
|
|
142
|
+
interface ResolvedPanelBase {
|
|
143
|
+
id: string
|
|
144
|
+
header: string
|
|
145
|
+
width: number
|
|
146
|
+
offsetX: number
|
|
147
|
+
legend: LegendEntry[]
|
|
148
|
+
/** the legend this panel's entries go under; absent means the domain key */
|
|
149
|
+
legendTitle?: string
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A strip with its scale resolved: the color each row takes, keyed by row
|
|
154
|
+
* name, and the pixel column the panel draws in.
|
|
155
|
+
*/
|
|
156
|
+
export interface ResolvedStripPanel extends ResolvedPanelBase {
|
|
157
|
+
kind: 'strip'
|
|
158
|
+
field: string
|
|
159
|
+
colors: Map<string, string>
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** one feature of a features panel, at its pixel span inside the panel */
|
|
163
|
+
export interface RowPanelSpan {
|
|
164
|
+
annotation: Annotation
|
|
165
|
+
xStart: number
|
|
166
|
+
xEnd: number
|
|
167
|
+
lane: number
|
|
168
|
+
laneCount: number
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* A features panel with its x mapping and its scale resolved: the spans per
|
|
173
|
+
* row name in panel pixels, the fill and outline of each feature, and the
|
|
174
|
+
* label its `label` channel draws. `field` is the field its color scale reads,
|
|
175
|
+
* which its legend is titled by.
|
|
176
|
+
*/
|
|
177
|
+
export interface ResolvedFeaturePanel extends ResolvedPanelBase {
|
|
178
|
+
kind: 'features'
|
|
179
|
+
x: 'column' | 'position'
|
|
180
|
+
field?: string
|
|
181
|
+
spans: Map<string, RowPanelSpan[]>
|
|
182
|
+
colors: Map<Annotation, { fill: string; stroke: string }>
|
|
183
|
+
labels?: Map<Annotation, string>
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type ResolvedRowPanel = ResolvedStripPanel | ResolvedFeaturePanel
|
|
187
|
+
|
|
188
|
+
// One contiguous run where a row's residues and a structure's line up 1:1, as
|
|
189
|
+
// SIFTS reports them. A position no segment covers is unmapped.
|
|
190
|
+
export interface ResidueSegment {
|
|
191
|
+
rowStart: number
|
|
192
|
+
rowEnd: number
|
|
193
|
+
structStart: number
|
|
194
|
+
structEnd: number
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// the structure half of a mapping. `id` is whatever the producer calls the
|
|
198
|
+
// entry (a PDB id, an AlphaFold accession); `asymId` names the chain and
|
|
199
|
+
// distinguishes two mappings onto the same entry
|
|
200
|
+
export interface MappedStructure {
|
|
201
|
+
id: string
|
|
202
|
+
kind?: 'experimental' | 'predicted'
|
|
203
|
+
asymId?: string
|
|
204
|
+
url?: string
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The structure residue for each residue of a row, computed outside the viewer
|
|
209
|
+
* (SIFTS, an AlphaFold model, a curator). Sequence equality misplaces tagged
|
|
210
|
+
* constructs, truncations and subsequence rows; see docs/layers.md.
|
|
211
|
+
*
|
|
212
|
+
* Positions are 1-based and inclusive on both sides, as GFF and `highlights`
|
|
213
|
+
* are. Structure positions are `label_seq_id`, the index into the entity's
|
|
214
|
+
* SEQRES; author numbering carries insertion codes and is not used.
|
|
215
|
+
*
|
|
216
|
+
* `unobserved` is in structure positions: present in SEQRES with no
|
|
217
|
+
* coordinates, as distinct from a residue the structure lacks.
|
|
218
|
+
*/
|
|
219
|
+
export interface ResidueMapping {
|
|
220
|
+
row: string
|
|
221
|
+
accession?: string
|
|
222
|
+
structure: MappedStructure
|
|
223
|
+
segments: ResidueSegment[]
|
|
224
|
+
unobserved?: [number, number][]
|
|
225
|
+
/**
|
|
226
|
+
* ungapped length of the row this was computed against. When set, the viewer
|
|
227
|
+
* ignores the mapping if the loaded row's length differs, as it does after a
|
|
228
|
+
* re-alignment, revision or swapped sequence.
|
|
229
|
+
*/
|
|
230
|
+
rowLength?: number
|
|
231
|
+
generated?: {
|
|
232
|
+
by?: string
|
|
233
|
+
date?: string
|
|
234
|
+
sourceSha256?: string
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// why a mapping, or one segment of it, is ignored, so a host can tell "no
|
|
239
|
+
// structure for this row" from "the mapping no longer matches what is loaded"
|
|
240
|
+
export interface ResidueMappingProblem {
|
|
241
|
+
row: string
|
|
242
|
+
structureId: string
|
|
243
|
+
/**
|
|
244
|
+
* `mapping` ignores the whole mapping, because the problem concerns its row.
|
|
245
|
+
* `segment` ignores only that segment and keeps the rest.
|
|
246
|
+
*/
|
|
247
|
+
scope: 'mapping' | 'segment'
|
|
248
|
+
reason: string
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// a lookup result in either direction. `observed` is false for a residue in
|
|
252
|
+
// SEQRES with no coordinates.
|
|
253
|
+
export interface StructureResidue {
|
|
254
|
+
structure: MappedStructure
|
|
255
|
+
position: number
|
|
256
|
+
observed: boolean
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface RowResidue {
|
|
260
|
+
rowName: string
|
|
261
|
+
seqPos: number
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* One loaded document that the snapshot omits, and its size. `what` uses the
|
|
266
|
+
* import form's names for the documents.
|
|
267
|
+
*/
|
|
268
|
+
export interface UnshareableData {
|
|
269
|
+
what: 'alignment' | 'tree' | 'annotations' | 'row metadata' | 'data tracks'
|
|
270
|
+
bytes: number
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// Annotation is defined in msa-parsers. Downstream plugins' emitted
|
|
274
|
+
// declarations still name TidyDomainAnnotation.
|
|
56
275
|
export type { Annotation }
|
|
57
276
|
export type TidyDomainAnnotation = Annotation
|
|
58
277
|
|
|
59
278
|
// an annotation resolved to the visible column span it is drawn across.
|
|
60
|
-
// stackIndex is its position
|
|
61
|
-
//
|
|
279
|
+
// stackIndex is its position in its row's paint order; lane is the sub-row it
|
|
280
|
+
// occupies, out of the laneCount the row's overlaps need.
|
|
62
281
|
export interface DomainBand {
|
|
63
282
|
annotation: Annotation
|
|
64
283
|
startCol: number
|
|
65
284
|
endCol: number
|
|
66
285
|
stackIndex: number
|
|
286
|
+
lane: number
|
|
287
|
+
laneCount: number
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* One swatch of a categorical color key. `id` is the value the scale read, and
|
|
292
|
+
* `label` is the text drawn beside the swatch.
|
|
293
|
+
*/
|
|
294
|
+
export interface LegendEntry {
|
|
295
|
+
id: string
|
|
296
|
+
label: string
|
|
297
|
+
color: string
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* A categorical color key, drawn by the on-screen overlay and reserved as a
|
|
302
|
+
* column in the SVG export. `title` names the legend where the viewer draws
|
|
303
|
+
* more than one.
|
|
304
|
+
*/
|
|
305
|
+
export interface Legend {
|
|
306
|
+
id: string
|
|
307
|
+
title: string
|
|
308
|
+
entries: LegendEntry[]
|
|
67
309
|
}
|
|
68
310
|
|
|
69
311
|
/**
|
|
@@ -80,6 +322,104 @@ export interface Highlight {
|
|
|
80
322
|
color?: string
|
|
81
323
|
}
|
|
82
324
|
|
|
325
|
+
/**
|
|
326
|
+
* What the viewer draws over a clade. `highlight` fills the rows behind it,
|
|
327
|
+
* across the tree and the alignment. `bracket` draws a bar and the clade's
|
|
328
|
+
* `label` in the gutter right of the tip labels. `collapse` and `focus` seed
|
|
329
|
+
* the collapsed list and the subtree in focus at load.
|
|
330
|
+
*/
|
|
331
|
+
export type CladeMark = 'highlight' | 'bracket' | 'collapse' | 'focus'
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* A clade of the tree and the mark drawn over it. `mrca` names tips whose most
|
|
335
|
+
* recent common ancestor is the clade; `range` names the first and last tip of
|
|
336
|
+
* a run in display order, in either order. `tips` is the leaf count the
|
|
337
|
+
* producer measured, and a clade that resolves to a different count is dropped.
|
|
338
|
+
* `label` names the clade beside a bracket, and a highlight carrying one draws
|
|
339
|
+
* the label without the bar. See docs/layers.md
|
|
340
|
+
*/
|
|
341
|
+
export interface Clade {
|
|
342
|
+
mrca?: string[]
|
|
343
|
+
range?: [string, string]
|
|
344
|
+
tips: number
|
|
345
|
+
mark: CladeMark
|
|
346
|
+
color?: string
|
|
347
|
+
label?: string
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* A Clade resolved to the rows it covers, with its fill color settled. `color`
|
|
352
|
+
* is the highlight fill; `markColor` is the producer's own color for a bracket
|
|
353
|
+
* bar and its label, unset where the theme's text color stands. `nodeId` is the
|
|
354
|
+
* node an `mrca` resolved to, which `collapse` and `focus` seed themselves
|
|
355
|
+
* with, and a `range` record has none.
|
|
356
|
+
*/
|
|
357
|
+
export interface ResolvedClade {
|
|
358
|
+
rows: [number, number]
|
|
359
|
+
mark: CladeMark
|
|
360
|
+
color: string
|
|
361
|
+
markColor?: string
|
|
362
|
+
label?: string
|
|
363
|
+
nodeId?: string
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* A span in Highlight coordinates: 1-based inclusive residues of `row`, or
|
|
368
|
+
* columns of the file without it
|
|
369
|
+
*/
|
|
370
|
+
export interface Region {
|
|
371
|
+
row?: string
|
|
372
|
+
start: number
|
|
373
|
+
end: number
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* A cell of the alignment in the host's coordinates, 1-based like Highlight:
|
|
378
|
+
* `column` counts every column of the file, hidden gappy ones included, and
|
|
379
|
+
* `residue` counts the row's own letters, absent on a gap. A pointer over a
|
|
380
|
+
* track has a column and no row.
|
|
381
|
+
*/
|
|
382
|
+
export interface Cell {
|
|
383
|
+
column: number
|
|
384
|
+
row?: string
|
|
385
|
+
residue?: number
|
|
386
|
+
letter?: string
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/** the alignment columns on screen, 1-based and inclusive */
|
|
390
|
+
export interface Viewport {
|
|
391
|
+
startColumn: number
|
|
392
|
+
endColumn: number
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* A channel of a mark the viewer always draws. `tipLabel` colors each tip label
|
|
397
|
+
* in the tree, `rowTint` washes the row across the tree gutter and the
|
|
398
|
+
* alignment, and `branch` colors a tree edge whose tips all share one value;
|
|
399
|
+
* all three read a field of `rowData`. `featureFill` colors each span of the
|
|
400
|
+
* annotation overlay and `featureLabel` names the field drawn inside a span,
|
|
401
|
+
* both from a field of the feature table.
|
|
402
|
+
*/
|
|
403
|
+
export type EncodingChannel =
|
|
404
|
+
| 'tipLabel'
|
|
405
|
+
| 'rowTint'
|
|
406
|
+
| 'branch'
|
|
407
|
+
| 'featureFill'
|
|
408
|
+
| 'featureLabel'
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* A channel, the field feeding it, and the scale it reads that field through.
|
|
412
|
+
* See docs/layers.md
|
|
413
|
+
*/
|
|
414
|
+
export interface Encoding {
|
|
415
|
+
channel: EncodingChannel
|
|
416
|
+
field: string
|
|
417
|
+
scale?: ScaleSpec
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** an Encoding with its scale resolved against the values in the table */
|
|
421
|
+
export type ResolvedEncoding = Encoding & ResolvedScale
|
|
422
|
+
|
|
83
423
|
/** a Highlight resolved to visible column indices and row indices */
|
|
84
424
|
export interface ResolvedHighlight {
|
|
85
425
|
startCol?: number
|
package/src/umd.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
|
-
// a
|
|
4
|
-
//
|
|
3
|
+
// a page that builds models with MSAModelF destroys each one it replaces, so
|
|
4
|
+
// the disposers its autoruns registered run
|
|
5
5
|
export { destroy } from '@jbrowse/mobx-state-tree'
|
|
6
6
|
export { default as MSAView } from './components/Loading.tsx'
|
|
7
|
+
export { mount } from './mount.tsx'
|
|
8
|
+
export { defineMsaElement } from './element.ts'
|
|
7
9
|
export { type MsaViewModel, default as MSAModelF } from './model.ts'
|
|
8
10
|
|
|
9
11
|
export * from 'react-dom/client'
|