@jbrowse/plugin-variants 3.2.0 → 3.4.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/dist/LinearVariantDisplay/model.d.ts +1 -1
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantDisplay/index.js +1 -1
- package/dist/MultiLinearVariantDisplay/model.d.ts +40 -4
- package/dist/MultiLinearVariantDisplay/model.js +0 -1
- package/dist/MultiLinearVariantDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -5
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +40 -3
- package/dist/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +14 -11
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +3 -3
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +41 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +3 -3
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +71 -17
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +34 -5
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +13 -7
- package/dist/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/dist/MultiLinearVariantRenderer/{MultiVariantRendering.js → components/MultiLinearVariantRendering.js} +25 -7
- package/dist/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/dist/MultiLinearVariantRenderer/components/util.js +15 -0
- package/dist/MultiLinearVariantRenderer/index.js +2 -2
- package/dist/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/dist/MultiLinearVariantRenderer/makeImageData.js +104 -41
- package/dist/MultiLinearVariantRenderer/types.d.ts +2 -0
- package/dist/MultiVariantBaseRenderer.d.ts +4 -4
- package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.d.ts +0 -1
- package/dist/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +0 -1
- package/dist/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/dist/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/dist/VariantFeatureWidget/AltFormatter.js +13 -0
- package/dist/VariantFeatureWidget/Checkbox2.js +1 -8
- package/dist/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/dist/VariantFeatureWidget/Formatter.js +23 -0
- package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +3 -5
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +16 -6
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +80 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/dist/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +41 -20
- package/dist/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
- package/dist/VariantFeatureWidget/stateModelFactory.d.ts +9 -6
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/dist/VariantRPC/getGenotypeMatrix.js +20 -7
- package/dist/VariantRPC/types.d.ts +23 -0
- package/dist/VcfAdapter/VcfAdapter.d.ts +0 -1
- package/dist/VcfAdapter/VcfAdapter.js +0 -1
- package/dist/VcfFeature/index.js +0 -1
- package/dist/VcfFeature/util.d.ts +2 -0
- package/dist/VcfFeature/util.js +123 -25
- package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +0 -1
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +12 -8
- package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/dist/getMultiVariantFeaturesAutorun.js +9 -2
- package/dist/getMultiVariantSourcesAutorun.js +3 -2
- package/dist/shared/MultiVariantBaseModel.d.ts +41 -4
- package/dist/shared/MultiVariantBaseModel.js +69 -3
- package/dist/shared/SharedVariantMixin.d.ts +1 -1
- package/dist/shared/components/AddFiltersDialog.d.ts +9 -0
- package/dist/shared/components/AddFiltersDialog.js +61 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/dist/shared/components/MultiVariantBaseDisplayComponent.js +29 -0
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +8 -3
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
- package/dist/shared/components/MultiVariantClusterDialog/types.js +2 -0
- package/{esm/shared/components/ColorLegend.d.ts → dist/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/dist/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +5 -3
- package/dist/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/dist/shared/components/MultiVariantCrosshairs.js +40 -0
- package/dist/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/dist/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +2 -2
- package/dist/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/dist/shared/components/MultiVariantTooltip.js +3 -2
- package/dist/shared/components/RectBg.js +4 -2
- package/dist/shared/components/SetColorDialog.js +1 -1
- package/dist/shared/components/SourcesDataGrid.d.ts +2 -1
- package/dist/shared/components/SourcesDataGrid.js +40 -47
- package/dist/shared/components/SourcesGrid.js +1 -1
- package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
- package/dist/shared/drawAlleleCount.d.ts +2 -1
- package/dist/shared/drawAlleleCount.js +26 -24
- package/dist/shared/drawPhased.d.ts +1 -1
- package/dist/shared/drawPhased.js +14 -10
- package/dist/shared/minorAlleleFrequencyUtils.d.ts +9 -4
- package/dist/shared/minorAlleleFrequencyUtils.js +19 -14
- package/dist/shared/sourcesGridUtils.d.ts +3 -2
- package/esm/LinearVariantDisplay/model.d.ts +1 -1
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +40 -4
- package/esm/MultiLinearVariantDisplay/model.js +0 -1
- package/esm/MultiLinearVariantDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +15 -8
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantMatrixDisplay/index.js +1 -1
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +40 -3
- package/esm/MultiLinearVariantMatrixDisplay/model.js +1 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +14 -11
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +3 -3
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.d.ts +8 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/MultiLinearVariantMatrixRendering.js +39 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.js +4 -4
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.d.ts +3 -3
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +73 -19
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +34 -5
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +13 -7
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.d.ts → MultiLinearVariantRendering.d.ts} +10 -4
- package/esm/MultiLinearVariantRenderer/components/{MultiVariantRendering.js → MultiLinearVariantRendering.js} +25 -7
- package/esm/MultiLinearVariantRenderer/components/util.d.ts +1 -0
- package/esm/MultiLinearVariantRenderer/components/util.js +12 -0
- package/esm/MultiLinearVariantRenderer/index.js +1 -1
- package/esm/MultiLinearVariantRenderer/makeImageData.d.ts +9 -0
- package/esm/MultiLinearVariantRenderer/makeImageData.js +106 -43
- package/esm/MultiLinearVariantRenderer/types.d.ts +2 -0
- package/esm/MultiVariantBaseRenderer.d.ts +4 -4
- package/esm/SplitVcfTabixAdapter/SplitVcfTabixAdapter.d.ts +0 -1
- package/esm/SplitVcfTabixAdapter/SplitVcfTabixAdapter.js +0 -1
- package/esm/SplitVcfTabixAdapter/configSchema.js +4 -2
- package/esm/VariantFeatureWidget/AltFormatter.d.ts +4 -0
- package/esm/VariantFeatureWidget/AltFormatter.js +10 -0
- package/esm/VariantFeatureWidget/Checkbox2.js +2 -9
- package/esm/VariantFeatureWidget/Formatter.d.ts +3 -0
- package/esm/VariantFeatureWidget/Formatter.js +17 -0
- package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.js → VariantConsequence/VariantConsequenceDataGridWrapper.js} +4 -6
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +16 -6
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.d.ts +4 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantGenotypeFrequencyTable.js +74 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.d.ts +3 -9
- package/esm/VariantFeatureWidget/VariantSampleGrid/VariantSampleGrid.js +43 -22
- package/esm/VariantFeatureWidget/VariantSampleGrid/types.d.ts +21 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
- package/esm/VariantFeatureWidget/stateModelFactory.d.ts +9 -6
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +2 -16
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +4 -7
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -15
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -13
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +14 -8
- package/esm/VariantRPC/getGenotypeMatrix.js +20 -7
- package/esm/VariantRPC/types.d.ts +23 -0
- package/esm/VcfAdapter/VcfAdapter.d.ts +0 -1
- package/esm/VcfAdapter/VcfAdapter.js +0 -1
- package/esm/VcfFeature/index.js +0 -1
- package/esm/VcfFeature/util.d.ts +2 -0
- package/esm/VcfFeature/util.js +121 -25
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +0 -1
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +13 -9
- package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/esm/getMultiVariantFeaturesAutorun.js +9 -2
- package/esm/getMultiVariantSourcesAutorun.js +3 -2
- package/esm/shared/MultiVariantBaseModel.d.ts +41 -4
- package/esm/shared/MultiVariantBaseModel.js +71 -5
- package/esm/shared/SharedVariantMixin.d.ts +1 -1
- package/esm/shared/components/AddFiltersDialog.d.ts +9 -0
- package/esm/shared/components/AddFiltersDialog.js +59 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.d.ts +5 -0
- package/esm/shared/components/MultiVariantBaseDisplayComponent.js +24 -0
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.js +2 -2
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js +9 -4
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js +29 -28
- package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/types.d.ts +1 -0
- package/esm/shared/components/MultiVariantClusterDialog/types.js +1 -0
- package/{dist/shared/components/ColorLegend.d.ts → esm/shared/components/MultiVariantColorLegend.d.ts} +2 -2
- package/esm/shared/components/{ColorLegend.js → MultiVariantColorLegend.js} +6 -4
- package/esm/shared/components/MultiVariantCrosshairs.d.ts +7 -0
- package/esm/shared/components/MultiVariantCrosshairs.js +35 -0
- package/esm/shared/components/MultiVariantLegendBar.d.ts +7 -0
- package/esm/shared/components/{LegendBar.js → MultiVariantLegendBar.js} +1 -1
- package/esm/shared/components/MultiVariantTooltip.d.ts +4 -0
- package/esm/shared/components/MultiVariantTooltip.js +3 -2
- package/esm/shared/components/RectBg.js +4 -2
- package/esm/shared/components/SetColorDialog.js +1 -1
- package/esm/shared/components/SourcesDataGrid.d.ts +2 -1
- package/esm/shared/components/SourcesDataGrid.js +40 -47
- package/esm/shared/components/SourcesGrid.js +1 -1
- package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
- package/esm/shared/drawAlleleCount.d.ts +2 -1
- package/esm/shared/drawAlleleCount.js +25 -24
- package/esm/shared/drawPhased.d.ts +1 -1
- package/esm/shared/drawPhased.js +14 -10
- package/esm/shared/minorAlleleFrequencyUtils.d.ts +9 -4
- package/esm/shared/minorAlleleFrequencyUtils.js +20 -15
- package/esm/shared/sourcesGridUtils.d.ts +3 -2
- package/package.json +12 -11
- package/dist/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantDisplay/components/Crosshair.js +0 -35
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -28
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -38
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/dist/MultiLinearVariantRenderer/components/MultiVariantRendering.js +0 -52
- package/dist/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/dist/VariantFeatureWidget/VariantConsequencePanel.js +0 -15
- package/dist/VariantRPC/cluster.d.ts +0 -17
- package/dist/VariantRPC/cluster.js +0 -84
- package/dist/shared/components/LegendBar.d.ts +0 -18
- package/esm/MultiLinearVariantDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantDisplay/components/Crosshair.js +0 -30
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixDisplay/components/Crosshair.js +0 -23
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +0 -7
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +0 -36
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +0 -22
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +0 -47
- package/esm/VariantFeatureWidget/VariantConsequencePanel.d.ts +0 -5
- package/esm/VariantFeatureWidget/VariantConsequencePanel.js +0 -9
- package/esm/VariantRPC/cluster.d.ts +0 -17
- package/esm/VariantRPC/cluster.js +0 -79
- package/esm/shared/components/LegendBar.d.ts +0 -18
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/dist/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
- /package/dist/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/dist/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.d.ts → VariantConsequence/VariantConsequenceDataGrid.d.ts} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGrid.js → VariantConsequence/VariantConsequenceDataGrid.js} +0 -0
- /package/esm/VariantFeatureWidget/{VariantConsequenceDataGridWrapper.d.ts → VariantConsequence/VariantConsequenceDataGridWrapper.d.ts} +0 -0
- /package/esm/{shared/components/ClusterDialog → VariantFeatureWidget/VariantSampleGrid}/types.js +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialog.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.d.ts +0 -0
- /package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
-
import { ConfigurationReference } from '@jbrowse/core/configuration';
|
|
2
|
+
import { ConfigurationReference, getConf } from '@jbrowse/core/configuration';
|
|
3
|
+
import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
|
|
3
4
|
import { getSession } from '@jbrowse/core/util';
|
|
4
5
|
import { stopStopToken } from '@jbrowse/core/util/stopToken';
|
|
5
6
|
import { linearBareDisplayStateModelFactory } from '@jbrowse/plugin-linear-genome-view';
|
|
@@ -9,11 +10,12 @@ import HeightIcon from '@mui/icons-material/Height';
|
|
|
9
10
|
import SplitscreenIcon from '@mui/icons-material/Splitscreen';
|
|
10
11
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
11
12
|
import deepEqual from 'fast-deep-equal';
|
|
12
|
-
import { types } from 'mobx-state-tree';
|
|
13
|
+
import { cast, types } from 'mobx-state-tree';
|
|
13
14
|
import { getSources } from './getSources';
|
|
14
15
|
const SetColorDialog = lazy(() => import('./components/SetColorDialog'));
|
|
15
16
|
const MAFFilterDialog = lazy(() => import('./components/MAFFilterDialog'));
|
|
16
|
-
const
|
|
17
|
+
const AddFiltersDialog = lazy(() => import('./components/AddFiltersDialog'));
|
|
18
|
+
const ClusterDialog = lazy(() => import('./components/MultiVariantClusterDialog/ClusterDialog'));
|
|
17
19
|
const SetRowHeightDialog = lazy(() => import('./components/SetRowHeightDialog'));
|
|
18
20
|
export default function MultiVariantBaseModelF(configSchema) {
|
|
19
21
|
return types
|
|
@@ -21,14 +23,18 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
21
23
|
type: types.literal('LinearVariantMatrixDisplay'),
|
|
22
24
|
layout: types.optional(types.frozen(), []),
|
|
23
25
|
configuration: ConfigurationReference(configSchema),
|
|
24
|
-
minorAlleleFrequencyFilter: types.optional(types.number, 0
|
|
26
|
+
minorAlleleFrequencyFilter: types.optional(types.number, 0),
|
|
25
27
|
showSidebarLabelsSetting: true,
|
|
26
28
|
renderingMode: types.optional(types.string, 'alleleCount'),
|
|
27
29
|
rowHeightSetting: types.optional(types.number, 8),
|
|
28
30
|
autoHeight: true,
|
|
31
|
+
lengthCutoffFilter: Number.MAX_SAFE_INTEGER,
|
|
32
|
+
jexlFilters: types.maybe(types.array(types.string)),
|
|
33
|
+
referenceDrawingMode: 'skip',
|
|
29
34
|
}))
|
|
30
35
|
.volatile(() => ({
|
|
31
36
|
sourcesLoadingStopToken: undefined,
|
|
37
|
+
simplifiedFeaturesStopToken: undefined,
|
|
32
38
|
featureUnderMouseVolatile: undefined,
|
|
33
39
|
sourcesVolatile: undefined,
|
|
34
40
|
featuresVolatile: undefined,
|
|
@@ -37,6 +43,9 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
37
43
|
hoveredGenotype: undefined,
|
|
38
44
|
}))
|
|
39
45
|
.actions(self => ({
|
|
46
|
+
setJexlFilters(f) {
|
|
47
|
+
self.jexlFilters = cast(f);
|
|
48
|
+
},
|
|
40
49
|
setRowHeight(arg) {
|
|
41
50
|
self.rowHeightSetting = arg;
|
|
42
51
|
},
|
|
@@ -58,6 +67,12 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
58
67
|
}
|
|
59
68
|
self.sourcesLoadingStopToken = str;
|
|
60
69
|
},
|
|
70
|
+
setSimplifiedFeaturesLoading(str) {
|
|
71
|
+
if (self.simplifiedFeaturesStopToken) {
|
|
72
|
+
stopStopToken(self.simplifiedFeaturesStopToken);
|
|
73
|
+
}
|
|
74
|
+
self.simplifiedFeaturesStopToken = str;
|
|
75
|
+
},
|
|
61
76
|
setSources(sources) {
|
|
62
77
|
if (!deepEqual(sources, self.sourcesVolatile)) {
|
|
63
78
|
self.sourcesVolatile = sources;
|
|
@@ -83,8 +98,15 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
83
98
|
self.sampleInfo = arg;
|
|
84
99
|
}
|
|
85
100
|
},
|
|
101
|
+
setReferenceDrawingMode(arg) {
|
|
102
|
+
self.referenceDrawingMode = arg;
|
|
103
|
+
},
|
|
86
104
|
}))
|
|
87
105
|
.views(self => ({
|
|
106
|
+
get activeFilters() {
|
|
107
|
+
var _a;
|
|
108
|
+
return ((_a = self.jexlFilters) !== null && _a !== void 0 ? _a : getConf(self, 'jexlFilters').map((r) => `jexl:${r}`));
|
|
109
|
+
},
|
|
88
110
|
get preSources() {
|
|
89
111
|
return self.layout.length ? self.layout : self.sourcesVolatile;
|
|
90
112
|
},
|
|
@@ -113,6 +135,11 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
113
135
|
.views(self => {
|
|
114
136
|
const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, } = self;
|
|
115
137
|
return {
|
|
138
|
+
get sourceMap() {
|
|
139
|
+
return self.sources
|
|
140
|
+
? Object.fromEntries(self.sources.map(source => [source.name, source]))
|
|
141
|
+
: undefined;
|
|
142
|
+
},
|
|
116
143
|
get rowHeight() {
|
|
117
144
|
const { sources, autoHeight, rowHeightSetting, height } = self;
|
|
118
145
|
return autoHeight ? height / ((sources === null || sources === void 0 ? void 0 : sources.length) || 1) : rowHeightSetting;
|
|
@@ -190,6 +217,28 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
190
217
|
},
|
|
191
218
|
],
|
|
192
219
|
},
|
|
220
|
+
{
|
|
221
|
+
label: 'Reference mode',
|
|
222
|
+
type: 'subMenu',
|
|
223
|
+
subMenu: [
|
|
224
|
+
{
|
|
225
|
+
label: 'Fill background grey, skip reference allele mouseovers (helps with large overlapping SVs)',
|
|
226
|
+
type: 'radio',
|
|
227
|
+
checked: self.referenceDrawingMode === 'skip',
|
|
228
|
+
onClick: () => {
|
|
229
|
+
self.setReferenceDrawingMode('skip');
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
label: "Don't fill background grey, only draw actual reference alleles as grey",
|
|
234
|
+
type: 'radio',
|
|
235
|
+
checked: self.referenceDrawingMode === 'draw',
|
|
236
|
+
onClick: () => {
|
|
237
|
+
self.setReferenceDrawingMode('draw');
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
},
|
|
193
242
|
{
|
|
194
243
|
label: 'Filter by',
|
|
195
244
|
icon: FilterListIcon,
|
|
@@ -206,6 +255,18 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
206
255
|
]);
|
|
207
256
|
},
|
|
208
257
|
},
|
|
258
|
+
{
|
|
259
|
+
label: 'Edit filters',
|
|
260
|
+
onClick: () => {
|
|
261
|
+
getSession(self).queueDialog(handleClose => [
|
|
262
|
+
AddFiltersDialog,
|
|
263
|
+
{
|
|
264
|
+
model: self,
|
|
265
|
+
handleClose,
|
|
266
|
+
},
|
|
267
|
+
]);
|
|
268
|
+
},
|
|
269
|
+
},
|
|
209
270
|
],
|
|
210
271
|
},
|
|
211
272
|
{
|
|
@@ -239,7 +300,7 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
239
300
|
})
|
|
240
301
|
.views(self => ({
|
|
241
302
|
get canDisplayLabels() {
|
|
242
|
-
return self.rowHeight
|
|
303
|
+
return self.rowHeight >= 8 && self.showSidebarLabelsSetting;
|
|
243
304
|
},
|
|
244
305
|
get totalHeight() {
|
|
245
306
|
var _a;
|
|
@@ -259,9 +320,14 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
259
320
|
totalHeight: self.totalHeight,
|
|
260
321
|
renderingMode: self.renderingMode,
|
|
261
322
|
minorAlleleFrequencyFilter: self.minorAlleleFrequencyFilter,
|
|
323
|
+
lengthCutoffFilter: self.lengthCutoffFilter,
|
|
262
324
|
rowHeight: self.rowHeight,
|
|
263
325
|
sources: self.sources,
|
|
264
326
|
scrollTop: self.scrollTop,
|
|
327
|
+
referenceDrawingMode: self.referenceDrawingMode,
|
|
328
|
+
filters: new SerializableFilterChain({
|
|
329
|
+
filters: self.activeFilters,
|
|
330
|
+
}),
|
|
265
331
|
};
|
|
266
332
|
},
|
|
267
333
|
}));
|
|
@@ -193,7 +193,7 @@ export default function SharedVariantMixin(configSchema: AnyConfigurationSchemaT
|
|
|
193
193
|
} & {
|
|
194
194
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
195
195
|
deleteBlock(key: string): void;
|
|
196
|
-
selectFeature(feature: Feature): void
|
|
196
|
+
selectFeature(feature: Feature): Promise<void>;
|
|
197
197
|
navToFeature(feature: Feature): void;
|
|
198
198
|
clearFeatureSelection(): void;
|
|
199
199
|
setFeatureIdUnderMouse(feature?: string): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const AddFiltersDialog: ({ model, handleClose, }: {
|
|
2
|
+
model: {
|
|
3
|
+
jexlFilters?: string[];
|
|
4
|
+
activeFilters: string[];
|
|
5
|
+
setJexlFilters: (arg?: string[]) => void;
|
|
6
|
+
};
|
|
7
|
+
handleClose: () => void;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default AddFiltersDialog;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Dialog } from '@jbrowse/core/ui';
|
|
4
|
+
import { stringToJexlExpression } from '@jbrowse/core/util/jexlStrings';
|
|
5
|
+
import { Button, DialogActions, DialogContent, TextField } from '@mui/material';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
7
|
+
import { makeStyles } from 'tss-react/mui';
|
|
8
|
+
const useStyles = makeStyles()({
|
|
9
|
+
dialogContent: {
|
|
10
|
+
width: '80em',
|
|
11
|
+
},
|
|
12
|
+
textAreaFont: {
|
|
13
|
+
fontFamily: 'Courier New',
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
color: 'red',
|
|
17
|
+
fontSize: '0.8em',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
function checkJexl(code) {
|
|
21
|
+
stringToJexlExpression(code);
|
|
22
|
+
}
|
|
23
|
+
const AddFiltersDialog = observer(function ({ model, handleClose, }) {
|
|
24
|
+
const { classes } = useStyles();
|
|
25
|
+
const { activeFilters } = model;
|
|
26
|
+
const [data, setData] = useState(activeFilters.join('\n'));
|
|
27
|
+
const [error, setError] = useState();
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
try {
|
|
30
|
+
data
|
|
31
|
+
.split('\n')
|
|
32
|
+
.map(line => line.trim())
|
|
33
|
+
.filter(line => !!line)
|
|
34
|
+
.map(line => {
|
|
35
|
+
checkJexl(line.trim());
|
|
36
|
+
});
|
|
37
|
+
setError(undefined);
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
console.error(e);
|
|
41
|
+
setError(e);
|
|
42
|
+
}
|
|
43
|
+
}, [data]);
|
|
44
|
+
return (_jsxs(Dialog, { maxWidth: "xl", open: true, onClose: handleClose, title: "Add track filters", children: [_jsxs(DialogContent, { children: [_jsxs("div", { children: ["Add filters, in jexl format, one per line, starting with the string jexl:. Examples:", ' ', _jsxs("ul", { children: [_jsxs("li", { children: [_jsx("code", { children: "jexl:get(feature,'name')=='BRCA1'" }), " - show only feature where the name attribute is BRCA1"] }), _jsxs("li", { children: [_jsx("code", { children: "jexl:get(feature,'type')=='gene'" }), " - show only gene type features in a GFF that has many other feature types"] }), _jsxs("li", { children: [_jsx("code", { children: "jexl:get(feature,'score') > 400" }), " - show only features that have a score greater than 400"] }), _jsxs("li", { children: [_jsx("code", { children: "jexl:get(feature,'end') - get(feature,'start') < 1000000" }), ' ', "- show only features with length less than 1Mbp"] })] })] }), error ? _jsx("p", { className: classes.error, children: `${error}` }) : null, _jsx(TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, className: classes.dialogContent, fullWidth: true, value: data, onChange: event => {
|
|
45
|
+
setData(event.target.value);
|
|
46
|
+
}, slotProps: {
|
|
47
|
+
input: {
|
|
48
|
+
classes: {
|
|
49
|
+
input: classes.textAreaFont,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
} })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, disabled: !!error, onClick: () => {
|
|
53
|
+
model.setJexlFilters(data.split('\n'));
|
|
54
|
+
handleClose();
|
|
55
|
+
}, children: "Submit" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
56
|
+
handleClose();
|
|
57
|
+
}, children: "Cancel" })] })] }));
|
|
58
|
+
});
|
|
59
|
+
export default AddFiltersDialog;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from 'react';
|
|
3
|
+
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import Crosshair from './MultiVariantCrosshairs';
|
|
6
|
+
import LegendBar from './MultiVariantLegendBar';
|
|
7
|
+
const MultiVariantBaseDisplayComponent = observer(function (props) {
|
|
8
|
+
const { model } = props;
|
|
9
|
+
const ref = useRef(null);
|
|
10
|
+
const [mouseY, setMouseY] = useState();
|
|
11
|
+
const [mouseX, setMouseX] = useState();
|
|
12
|
+
return (_jsxs("div", { ref: ref, onMouseMove: event => {
|
|
13
|
+
var _a;
|
|
14
|
+
const rect = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
15
|
+
const top = (rect === null || rect === void 0 ? void 0 : rect.top) || 0;
|
|
16
|
+
const left = (rect === null || rect === void 0 ? void 0 : rect.left) || 0;
|
|
17
|
+
setMouseY(event.clientY - top);
|
|
18
|
+
setMouseX(event.clientX - left);
|
|
19
|
+
}, onMouseLeave: () => {
|
|
20
|
+
setMouseY(undefined);
|
|
21
|
+
setMouseX(undefined);
|
|
22
|
+
}, children: [_jsx(BaseLinearDisplayComponent, { ...props }), _jsx(LegendBar, { model: model }), mouseX && mouseY ? (_jsx(Crosshair, { mouseX: mouseX, mouseY: mouseY, model: model })) : null] }));
|
|
23
|
+
});
|
|
24
|
+
export default MultiVariantBaseDisplayComponent;
|
|
@@ -7,8 +7,8 @@ import ClusterDialogAuto from './ClusterDialogAuto';
|
|
|
7
7
|
import ClusterDialogManual from './ClusterDialogManual';
|
|
8
8
|
function Header({ activeMode, setActiveMode, }) {
|
|
9
9
|
return (_jsxs("div", { children: [_jsx(Typography, { style: { marginBottom: 30 }, children: "This procedure will cluster the visible genotype data using hierarchical clustering" }), _jsx(RadioGroup, { children: Object.entries({
|
|
10
|
-
auto: (_jsx("div", { children: "Run in-app clustering (
|
|
11
|
-
manual: (_jsx("div", { children: "Download R script to run clustering (faster
|
|
10
|
+
auto: (_jsx("div", { children: "Run in-app clustering (slower, particularly for large numbers of samples, uses JS implementation of hclust)" })),
|
|
11
|
+
manual: (_jsx("div", { children: "Download R script to run clustering (faster, uses R implementation of hclust)" })),
|
|
12
12
|
}).map(([key, val]) => (_jsx(FormControlLabel, { control: _jsx(Radio, { checked: activeMode === key, onChange: () => {
|
|
13
13
|
setActiveMode(key);
|
|
14
14
|
} }), label: val }, key))) })] }));
|
package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogAuto.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
4
4
|
import { getContainingView, getSession, isAbortException, } from '@jbrowse/core/util';
|
|
@@ -9,19 +9,22 @@ import { observer } from 'mobx-react';
|
|
|
9
9
|
import { isAlive } from 'mobx-state-tree';
|
|
10
10
|
const ClusterDialogAuto = observer(function ({ model, children, handleClose, }) {
|
|
11
11
|
const [progress, setProgress] = useState('');
|
|
12
|
+
const [loading, setLoading] = useState(false);
|
|
12
13
|
const [error, setError] = useState();
|
|
13
14
|
const [stopToken, setStopToken] = useState('');
|
|
14
|
-
return (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { children: [children, _jsxs("div", { children: [
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { children: [children, _jsxs("div", { children: [loading ? (_jsxs("div", { style: { padding: 50 }, children: [_jsx("span", { children: progress || 'Loading...' }), _jsx(Button, { onClick: () => {
|
|
15
16
|
stopStopToken(stopToken);
|
|
16
|
-
}, children: "Stop" })] })) : null, error ? _jsx(ErrorMessage, { error: error }) : null] })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", onClick: async () => {
|
|
17
|
+
}, children: "Stop" })] })) : null, error ? _jsx(ErrorMessage, { error: error }) : null] })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", disabled: loading, onClick: async () => {
|
|
17
18
|
try {
|
|
18
19
|
setError(undefined);
|
|
20
|
+
setProgress('Initializing');
|
|
21
|
+
setLoading(true);
|
|
19
22
|
const view = getContainingView(model);
|
|
20
23
|
if (!view.initialized) {
|
|
21
24
|
return;
|
|
22
25
|
}
|
|
23
26
|
const { rpcManager } = getSession(model);
|
|
24
|
-
const { sourcesWithoutLayout, minorAlleleFrequencyFilter, adapterConfig, } = model;
|
|
27
|
+
const { sourcesWithoutLayout, minorAlleleFrequencyFilter, lengthCutoffFilter, adapterConfig, } = model;
|
|
25
28
|
if (sourcesWithoutLayout) {
|
|
26
29
|
const sessionId = getRpcSessionId(model);
|
|
27
30
|
const stopToken = createStopToken();
|
|
@@ -30,6 +33,7 @@ const ClusterDialogAuto = observer(function ({ model, children, handleClose, })
|
|
|
30
33
|
regions: view.dynamicBlocks.contentBlocks,
|
|
31
34
|
sources: sourcesWithoutLayout,
|
|
32
35
|
minorAlleleFrequencyFilter,
|
|
36
|
+
lengthCutoffFilter,
|
|
33
37
|
sessionId,
|
|
34
38
|
adapterConfig,
|
|
35
39
|
stopToken,
|
|
@@ -54,6 +58,7 @@ const ClusterDialogAuto = observer(function ({ model, children, handleClose, })
|
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
finally {
|
|
61
|
+
setLoading(false);
|
|
57
62
|
setProgress('');
|
|
58
63
|
setStopToken('');
|
|
59
64
|
}
|
package/esm/shared/components/{ClusterDialog → MultiVariantClusterDialog}/ClusterDialogManual.js
RENAMED
|
@@ -25,8 +25,8 @@ const ClusterDialogManuals = observer(function ({ model, handleClose, children,
|
|
|
25
25
|
const [ret, setRet] = useState();
|
|
26
26
|
const [error, setError] = useState();
|
|
27
27
|
const [loading, setLoading] = useState(false);
|
|
28
|
-
const [showAdvanced, setShowAdvanced] =
|
|
29
|
-
const [clusterMethod, setClusterMethod] =
|
|
28
|
+
const [showAdvanced, setShowAdvanced] = useLocalStorage('cluster-showAdvanced', false);
|
|
29
|
+
const [clusterMethod, setClusterMethod] = useState('single');
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
;
|
|
32
32
|
(async () => {
|
|
@@ -39,12 +39,13 @@ const ClusterDialogManuals = observer(function ({ model, handleClose, children,
|
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
const { rpcManager } = getSession(model);
|
|
42
|
-
const { sourcesWithoutLayout, minorAlleleFrequencyFilter, adapterConfig, } = model;
|
|
42
|
+
const { sourcesWithoutLayout, minorAlleleFrequencyFilter, lengthCutoffFilter, adapterConfig, } = model;
|
|
43
43
|
const sessionId = getRpcSessionId(model);
|
|
44
44
|
const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
|
|
45
45
|
regions: view.dynamicBlocks.contentBlocks,
|
|
46
46
|
sources: sourcesWithoutLayout,
|
|
47
47
|
minorAlleleFrequencyFilter,
|
|
48
|
+
lengthCutoffFilter,
|
|
48
49
|
sessionId,
|
|
49
50
|
adapterConfig,
|
|
50
51
|
}));
|
|
@@ -77,31 +78,31 @@ cat(resultClusters$order,sep='\\n')`
|
|
|
77
78
|
.map(([key, val]) => [key, ...val].join('\t'))
|
|
78
79
|
.join('\n')
|
|
79
80
|
: undefined;
|
|
80
|
-
return (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { children: [children, _jsxs(Paper, { style: { padding: 16 }, children: [_jsxs("div", { style: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
81
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DialogContent, { children: [children, _jsxs(Paper, { style: { padding: 16 }, children: [_jsxs("div", { children: [_jsxs("div", { style: {
|
|
82
|
+
display: 'flex',
|
|
83
|
+
gap: '8px',
|
|
84
|
+
flexWrap: 'wrap',
|
|
85
|
+
marginBottom: '16px',
|
|
86
|
+
}, children: [_jsx(Button, { variant: "contained", onClick: () => {
|
|
87
|
+
saveAs(new Blob([results || ''], {
|
|
88
|
+
type: 'text/plain;charset=utf-8',
|
|
89
|
+
}), 'cluster.R');
|
|
90
|
+
}, children: "Download Rscript" }), ' ', "or", ' ', _jsx(Button, { variant: "contained", onClick: () => {
|
|
91
|
+
copy(results || '');
|
|
92
|
+
}, children: "Copy Rscript to clipboard" }), ' ', "or", ' ', _jsx(Button, { variant: "contained", onClick: () => {
|
|
93
|
+
saveAs(new Blob([resultsTsv || ''], {
|
|
94
|
+
type: 'text/plain;charset=utf-8',
|
|
95
|
+
}), 'genotypes.tsv');
|
|
96
|
+
}, children: "Download TSV" }), _jsx("div", { children: _jsx(Button, { variant: "contained", onClick: () => {
|
|
97
|
+
setShowAdvanced(!showAdvanced);
|
|
98
|
+
}, children: showAdvanced
|
|
99
|
+
? 'Hide advanced options'
|
|
100
|
+
: 'Show advanced options' }) })] }), showAdvanced ? (_jsxs("div", { children: [_jsx(Typography, { variant: "h6", children: "Advanced options" }), _jsx(RadioGroup, { children: Object.entries({
|
|
101
|
+
single: 'Single',
|
|
102
|
+
complete: 'Complete',
|
|
103
|
+
}).map(([key, val]) => (_jsx(FormControlLabel, { control: _jsx(Radio, { checked: clusterMethod === key, onChange: () => {
|
|
104
|
+
setClusterMethod(key);
|
|
105
|
+
} }), label: val }, key))) })] })) : null, results ? (_jsx("div", {})) : loading ? (_jsx(LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })) : error ? (_jsx(ErrorMessage, { error: error })) : null] }), _jsxs("div", { children: [_jsx(Typography, { variant: "subtitle2", gutterBottom: true, style: { marginTop: '16px' }, children: "Clustering Results:" }), _jsx(TextField, { multiline: true, fullWidth: true, variant: "outlined", placeholder: "Paste results from Rscript here (sequence of numbers, one per line, specifying the new ordering)", rows: 10, value: paste, onChange: event => {
|
|
105
106
|
setPaste(event.target.value);
|
|
106
107
|
}, slotProps: {
|
|
107
108
|
input: {
|
|
@@ -3,6 +3,7 @@ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
|
3
3
|
export interface ReducedModel {
|
|
4
4
|
sourcesWithoutLayout?: Source[];
|
|
5
5
|
minorAlleleFrequencyFilter?: number;
|
|
6
|
+
lengthCutoffFilter: number;
|
|
6
7
|
adapterConfig: AnyConfigurationModel;
|
|
7
8
|
setLayout: (arg: Source[]) => void;
|
|
8
9
|
clearLayout: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Source } from '../types';
|
|
2
|
-
declare const
|
|
2
|
+
declare const MultiVariantColorLegend: ({ model, labelWidth, }: {
|
|
3
3
|
model: {
|
|
4
4
|
canDisplayLabels: boolean;
|
|
5
5
|
rowHeight: number;
|
|
@@ -7,4 +7,4 @@ declare const ColorLegend: ({ model, labelWidth, }: {
|
|
|
7
7
|
};
|
|
8
8
|
labelWidth: number;
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
-
export default
|
|
10
|
+
export default MultiVariantColorLegend;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
|
-
import { clamp } from '@jbrowse/core/util';
|
|
3
|
+
import { clamp, getFillProps } from '@jbrowse/core/util';
|
|
4
|
+
import { useTheme } from '@mui/material';
|
|
4
5
|
import { observer } from 'mobx-react';
|
|
5
6
|
import RectBg from './RectBg';
|
|
6
|
-
const
|
|
7
|
+
const MultiVariantColorLegend = observer(function ({ model, labelWidth, }) {
|
|
7
8
|
const { canDisplayLabels, rowHeight, sources } = model;
|
|
8
9
|
const svgFontSize = clamp(rowHeight, 8, 12);
|
|
9
10
|
const colorBoxWidth = 15;
|
|
10
11
|
const hasColors = sources === null || sources === void 0 ? void 0 : sources.some(s => s.color);
|
|
11
12
|
const legendWidth = labelWidth + (hasColors ? colorBoxWidth + 5 : 0);
|
|
13
|
+
const theme = useTheme();
|
|
12
14
|
return sources ? (_jsxs(_Fragment, { children: [canDisplayLabels ? (_jsx(RectBg, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null, sources.map((source, idx) => {
|
|
13
15
|
const { color, name, label } = source;
|
|
14
|
-
return (_jsxs(Fragment, { children: [color ? (_jsx(RectBg, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? (_jsx("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, children: label || name })) : null] }, `${label}-${idx}`));
|
|
16
|
+
return (_jsxs(Fragment, { children: [color ? (_jsx(RectBg, { y: idx * rowHeight, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null, canDisplayLabels ? (_jsx("text", { y: idx * rowHeight + svgFontSize, x: color ? colorBoxWidth + 2 : 0, fontSize: svgFontSize, ...getFillProps(theme.palette.text.primary), children: label || name })) : null] }, `${label}-${idx}`));
|
|
15
17
|
})] })) : null;
|
|
16
18
|
});
|
|
17
|
-
export default
|
|
19
|
+
export default MultiVariantColorLegend;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
|
|
2
|
+
declare const MultiVariantCrosshairs: ({ mouseX, mouseY, model, }: {
|
|
3
|
+
mouseX: number;
|
|
4
|
+
mouseY: number;
|
|
5
|
+
model: MultiVariantBaseModel;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default MultiVariantCrosshairs;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
3
|
+
import { useTheme } from '@mui/material';
|
|
4
|
+
import { observer } from 'mobx-react';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
import MultiVariantTooltip from './MultiVariantTooltip';
|
|
7
|
+
const useStyles = makeStyles()({
|
|
8
|
+
rel: {
|
|
9
|
+
position: 'relative',
|
|
10
|
+
},
|
|
11
|
+
cursor: {
|
|
12
|
+
pointerEvents: 'none',
|
|
13
|
+
zIndex: 800,
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
},
|
|
16
|
+
color: {
|
|
17
|
+
width: 10,
|
|
18
|
+
height: 10,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const MultiVariantCrosshairs = observer(function ({ mouseX, mouseY, model, }) {
|
|
22
|
+
const { classes } = useStyles();
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
const { hoveredGenotype, height, scrollTop, sourceMap } = model;
|
|
25
|
+
const { width } = getContainingView(model);
|
|
26
|
+
const source = hoveredGenotype ? sourceMap === null || sourceMap === void 0 ? void 0 : sourceMap[hoveredGenotype.name] : undefined;
|
|
27
|
+
const y = mouseY - scrollTop;
|
|
28
|
+
return (_jsxs("div", { className: classes.rel, children: [_jsxs("svg", { className: classes.cursor, width: width, height: height, style: {
|
|
29
|
+
top: scrollTop,
|
|
30
|
+
}, children: [_jsx("line", { x1: 0, x2: width, y1: y, y2: y, stroke: theme.palette.text.primary }), _jsx("line", { x1: mouseX, x2: mouseX, y1: 0, y2: height, stroke: theme.palette.text.primary })] }), source ? (_jsx(MultiVariantTooltip, { source: {
|
|
31
|
+
...source,
|
|
32
|
+
...hoveredGenotype,
|
|
33
|
+
} })) : null] }));
|
|
34
|
+
});
|
|
35
|
+
export default MultiVariantCrosshairs;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MultiVariantBaseModel } from '../MultiVariantBaseModel';
|
|
2
|
+
export declare const LegendBar: (props: {
|
|
3
|
+
model: MultiVariantBaseModel;
|
|
4
|
+
orientation?: string;
|
|
5
|
+
exportSVG?: boolean;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default LegendBar;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { clamp, getContainingView, max, measureText } from '@jbrowse/core/util';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
|
-
import ColorLegend from './
|
|
4
|
+
import ColorLegend from './MultiVariantColorLegend';
|
|
5
5
|
const Wrapper = observer(function ({ children, model, exportSVG, }) {
|
|
6
6
|
const { id, scrollTop, height } = model;
|
|
7
7
|
const clipid = `legend-${id}`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SanitizedHTML } from '@jbrowse/core/ui';
|
|
3
3
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
4
|
+
import escapeHTML from 'escape-html';
|
|
4
5
|
export default function MultiVariantTooltip({ source, }) {
|
|
5
6
|
return (_jsxs(BaseTooltip, { children: [source.color ? (_jsx("div", { style: {
|
|
6
7
|
width: 10,
|
|
@@ -8,10 +9,10 @@ export default function MultiVariantTooltip({ source, }) {
|
|
|
8
9
|
backgroundColor: source.color,
|
|
9
10
|
} })) : null, _jsx(SanitizedHTML, { html: Object.entries(source)
|
|
10
11
|
.filter(([key, val]) => key !== 'color' &&
|
|
11
|
-
key !== 'name' &&
|
|
12
12
|
key !== 'HP' &&
|
|
13
|
+
key !== 'name' &&
|
|
13
14
|
key !== 'id' &&
|
|
14
15
|
val !== undefined)
|
|
15
|
-
.map(([key, value]) => `${key}:${value}`)
|
|
16
|
+
.map(([key, value]) => `${key}:${escapeHTML(`${value}`)}`)
|
|
16
17
|
.join('<br/>') })] }));
|
|
17
18
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getFillProps } from '@jbrowse/core/util';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { alpha, useTheme } from '@mui/material';
|
|
4
|
+
const RectBg = ({ x, y, width, height, color, }) => {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
return (_jsx("rect", { pointerEvents: "auto", x: x, y: y, width: width, height: height, ...getFillProps(color || alpha(theme.palette.background.paper, 0.3)) }));
|
|
5
7
|
};
|
|
6
8
|
export default RectBg;
|
|
@@ -27,7 +27,7 @@ export default function SetColorDialog({ model, handleClose, }) {
|
|
|
27
27
|
const [showBulkEditor, setShowBulkEditor] = useState(false);
|
|
28
28
|
const [currLayout, setCurrLayout] = useState(sources || []);
|
|
29
29
|
const [showTips, setShowTips] = useLocalStorage('multivariant-showTips', false);
|
|
30
|
-
return (_jsx(DraggableDialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-variant
|
|
30
|
+
return (_jsx(DraggableDialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Multi-sample variant display - Color/arrangement editor", children: showBulkEditor ? (_jsx(BulkEditPanel, { currLayout: currLayout, onClose: arg => {
|
|
31
31
|
if (arg) {
|
|
32
32
|
setCurrLayout(arg);
|
|
33
33
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Source } from '../types';
|
|
2
|
+
import type { GridRowId } from '@mui/x-data-grid';
|
|
2
3
|
export default function SourcesDataGrid({ rows, onChange, setSelected, }: {
|
|
3
4
|
rows: Source[];
|
|
4
5
|
onChange: (arg: Source[]) => void;
|
|
5
|
-
setSelected: (arg:
|
|
6
|
+
setSelected: (arg: GridRowId[]) => void;
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|