@jbrowse/plugin-variants 3.1.0 → 3.3.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/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +3 -3
- package/dist/MultiLinearVariantDisplay/index.js +1 -1
- package/dist/MultiLinearVariantDisplay/model.d.ts +58 -3
- 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 +59 -2
- package/dist/MultiLinearVariantMatrixDisplay/model.js +5 -1
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -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 +2 -2
- package/dist/MultiLinearVariantMatrixRenderer/makeImageData.js +15 -8
- package/dist/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- 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 +63 -23
- package/dist/MultiLinearVariantRenderer/types.d.ts +1 -0
- 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 +7 -2
- 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/types.js +2 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/dist/VariantFeatureWidget/VariantSampleGrid/util.js +14 -0
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +14 -0
- package/dist/VariantRPC/MultiVariantClusterGenotypeMatrix.js +30 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -13
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +5 -57
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -10
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +15 -10
- package/dist/VariantRPC/getGenotypeMatrix.d.ts +6 -0
- package/dist/VariantRPC/getGenotypeMatrix.js +60 -0
- package/dist/VariantRPC/types.d.ts +36 -0
- package/dist/VariantRPC/types.js +2 -0
- package/dist/VcfAdapter/VcfAdapter.js +6 -3
- package/dist/VcfFeature/index.js +0 -1
- package/dist/VcfFeature/util.d.ts +2 -0
- package/dist/VcfFeature/util.js +125 -27
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +17 -7
- package/dist/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/dist/getMultiVariantFeaturesAutorun.js +9 -2
- package/dist/getMultiVariantSourcesAutorun.js +3 -2
- package/dist/index.js +2 -0
- package/dist/shared/MultiVariantBaseModel.d.ts +59 -3
- package/dist/shared/MultiVariantBaseModel.js +95 -37
- 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/MultiVariantClusterDialog/ClusterDialog.d.ts +6 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialog.js +29 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +7 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +74 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +7 -0
- package/dist/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +145 -0
- package/dist/shared/components/MultiVariantClusterDialog/types.d.ts +10 -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 +2 -2
- package/dist/shared/components/SourcesGrid.js +1 -1
- package/dist/shared/components/SourcesGridHeader.d.ts +2 -1
- package/dist/shared/components/SourcesGridHeader.js +2 -2
- package/dist/shared/drawAlleleCount.d.ts +1 -1
- package/dist/shared/drawAlleleCount.js +29 -5
- package/dist/shared/drawPhased.d.ts +1 -1
- package/dist/shared/drawPhased.js +14 -10
- package/dist/shared/getSources.d.ts +15 -0
- package/dist/shared/getSources.js +34 -0
- package/dist/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/dist/shared/minorAlleleFrequencyUtils.js +4 -5
- package/dist/shared/sourcesGridUtils.d.ts +3 -2
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +2 -2
- package/esm/MultiLinearVariantDisplay/index.js +1 -1
- package/esm/MultiLinearVariantDisplay/model.d.ts +58 -3
- 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 +59 -2
- package/esm/MultiLinearVariantMatrixDisplay/model.js +5 -1
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +1 -1
- package/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.d.ts → MultiLinearVariantMatrixRenderer.d.ts} +7 -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 +2 -2
- package/esm/MultiLinearVariantMatrixRenderer/makeImageData.js +16 -9
- package/esm/MultiLinearVariantMatrixRenderer/types.d.ts +2 -4
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +30 -1
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +11 -5
- 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 +64 -24
- package/esm/MultiLinearVariantRenderer/types.d.ts +1 -0
- 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 +7 -2
- 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/types.js +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.d.ts +1 -0
- package/esm/VariantFeatureWidget/VariantSampleGrid/util.js +11 -0
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.d.ts +14 -0
- package/esm/VariantRPC/MultiVariantClusterGenotypeMatrix.js +23 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +2 -13
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +5 -57
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +3 -10
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +15 -10
- package/esm/VariantRPC/getGenotypeMatrix.d.ts +6 -0
- package/esm/VariantRPC/getGenotypeMatrix.js +57 -0
- package/esm/VariantRPC/types.d.ts +36 -0
- package/esm/VariantRPC/types.js +1 -0
- package/esm/VcfAdapter/VcfAdapter.js +7 -4
- package/esm/VcfFeature/index.js +0 -1
- package/esm/VcfFeature/util.d.ts +2 -0
- package/esm/VcfFeature/util.js +123 -27
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +18 -8
- package/esm/getMultiVariantFeaturesAutorun.d.ts +2 -0
- package/esm/getMultiVariantFeaturesAutorun.js +9 -2
- package/esm/getMultiVariantSourcesAutorun.js +3 -2
- package/esm/index.js +2 -0
- package/esm/shared/MultiVariantBaseModel.d.ts +59 -3
- package/esm/shared/MultiVariantBaseModel.js +97 -39
- 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/MultiVariantClusterDialog/ClusterDialog.d.ts +6 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialog.js +24 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.d.ts +7 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogAuto.js +72 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.d.ts +7 -0
- package/esm/shared/components/MultiVariantClusterDialog/ClusterDialogManual.js +140 -0
- package/esm/shared/components/MultiVariantClusterDialog/types.d.ts +10 -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 +2 -2
- package/esm/shared/components/SourcesGrid.js +1 -1
- package/esm/shared/components/SourcesGridHeader.d.ts +2 -1
- package/esm/shared/components/SourcesGridHeader.js +2 -2
- package/esm/shared/drawAlleleCount.d.ts +1 -1
- package/esm/shared/drawAlleleCount.js +29 -5
- package/esm/shared/drawPhased.d.ts +1 -1
- package/esm/shared/drawPhased.js +14 -10
- package/esm/shared/getSources.d.ts +15 -0
- package/esm/shared/getSources.js +31 -0
- package/esm/shared/minorAlleleFrequencyUtils.d.ts +6 -1
- package/esm/shared/minorAlleleFrequencyUtils.js +5 -6
- package/esm/shared/sourcesGridUtils.d.ts +3 -2
- package/package.json +10 -9
- 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/shared/components/ClusterDialog.d.ts +0 -11
- package/dist/shared/components/ClusterDialog.js +0 -113
- 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/shared/components/ClusterDialog.d.ts +0 -11
- package/esm/shared/components/ClusterDialog.js +0 -107
- package/esm/shared/components/LegendBar.d.ts +0 -18
- /package/dist/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +0 -0
- /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/esm/MultiLinearVariantMatrixRenderer/{LinearVariantMatrixRenderer.js → MultiLinearVariantMatrixRenderer.js} +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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SampleInfo, Source } from '
|
|
1
|
+
import type { SampleInfo, Source } from './types';
|
|
2
2
|
import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
3
|
import type { Feature } from '@jbrowse/core/util';
|
|
4
4
|
import type { Instance } from 'mobx-state-tree';
|
|
@@ -90,6 +90,9 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
90
90
|
renderingMode: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
91
91
|
rowHeightSetting: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
92
92
|
autoHeight: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
93
|
+
lengthCutoffFilter: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
94
|
+
jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
|
|
95
|
+
referenceDrawingMode: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
93
96
|
}, {
|
|
94
97
|
rendererTypeName: string;
|
|
95
98
|
error: unknown;
|
|
@@ -233,19 +236,28 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
233
236
|
renderProps(): any;
|
|
234
237
|
} & {
|
|
235
238
|
sourcesLoadingStopToken: string | undefined;
|
|
239
|
+
simplifiedFeaturesStopToken: string | undefined;
|
|
236
240
|
featureUnderMouseVolatile: Feature | undefined;
|
|
237
241
|
sourcesVolatile: Source[] | undefined;
|
|
238
242
|
featuresVolatile: Feature[] | undefined;
|
|
239
243
|
hasPhased: boolean;
|
|
240
244
|
sampleInfo: undefined | Record<string, SampleInfo>;
|
|
241
|
-
hoveredGenotype:
|
|
245
|
+
hoveredGenotype: {
|
|
246
|
+
genotype: string;
|
|
247
|
+
name: string;
|
|
248
|
+
} | undefined;
|
|
242
249
|
} & {
|
|
250
|
+
setJexlFilters(f?: string[]): void;
|
|
243
251
|
setRowHeight(arg: number): void;
|
|
244
|
-
setHoveredGenotype(arg
|
|
252
|
+
setHoveredGenotype(arg?: {
|
|
253
|
+
genotype: string;
|
|
254
|
+
name: string;
|
|
255
|
+
}): void;
|
|
245
256
|
setFeatures(f: Feature[]): void;
|
|
246
257
|
setLayout(layout: Source[]): void;
|
|
247
258
|
clearLayout(): void;
|
|
248
259
|
setSourcesLoading(str: string): void;
|
|
260
|
+
setSimplifiedFeaturesLoading(str: string): void;
|
|
249
261
|
setSources(sources: Source[]): void;
|
|
250
262
|
setMafFilter(arg: number): void;
|
|
251
263
|
setShowSidebarLabels(arg: boolean): void;
|
|
@@ -253,8 +265,19 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
253
265
|
setAutoHeight(arg: boolean): void;
|
|
254
266
|
setHasPhased(arg: boolean): void;
|
|
255
267
|
setSampleInfo(arg: Record<string, SampleInfo>): void;
|
|
268
|
+
setReferenceDrawingMode(arg: string): void;
|
|
256
269
|
} & {
|
|
270
|
+
readonly activeFilters: any;
|
|
257
271
|
readonly preSources: Source[] | undefined;
|
|
272
|
+
readonly sourcesWithoutLayout: {
|
|
273
|
+
label: string;
|
|
274
|
+
id: string;
|
|
275
|
+
baseUri?: string;
|
|
276
|
+
name: string;
|
|
277
|
+
color?: string;
|
|
278
|
+
group?: string;
|
|
279
|
+
HP?: number;
|
|
280
|
+
}[] | undefined;
|
|
258
281
|
readonly sources: {
|
|
259
282
|
label: string;
|
|
260
283
|
id: string;
|
|
@@ -265,6 +288,17 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
265
288
|
HP?: number;
|
|
266
289
|
}[] | undefined;
|
|
267
290
|
} & {
|
|
291
|
+
readonly sourceMap: {
|
|
292
|
+
[k: string]: {
|
|
293
|
+
label: string;
|
|
294
|
+
id: string;
|
|
295
|
+
baseUri?: string;
|
|
296
|
+
name: string;
|
|
297
|
+
color?: string;
|
|
298
|
+
group?: string;
|
|
299
|
+
HP?: number;
|
|
300
|
+
};
|
|
301
|
+
} | undefined;
|
|
268
302
|
readonly rowHeight: number;
|
|
269
303
|
adapterProps(): any;
|
|
270
304
|
trackMenuItems(): (import("@jbrowse/core/ui").MenuDivider | import("@jbrowse/core/ui").MenuSubHeader | import("@jbrowse/core/ui").NormalMenuItem | import("@jbrowse/core/ui").CheckboxMenuItem | import("@jbrowse/core/ui").RadioMenuItem | import("@jbrowse/core/ui").SubMenuItem | {
|
|
@@ -318,6 +352,18 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
318
352
|
type?: undefined;
|
|
319
353
|
checked?: undefined;
|
|
320
354
|
onClick?: undefined;
|
|
355
|
+
} | {
|
|
356
|
+
label: string;
|
|
357
|
+
type: string;
|
|
358
|
+
subMenu: {
|
|
359
|
+
label: string;
|
|
360
|
+
type: string;
|
|
361
|
+
checked: boolean;
|
|
362
|
+
onClick: () => void;
|
|
363
|
+
}[];
|
|
364
|
+
icon?: undefined;
|
|
365
|
+
checked?: undefined;
|
|
366
|
+
onClick?: undefined;
|
|
321
367
|
} | {
|
|
322
368
|
label: string;
|
|
323
369
|
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
@@ -330,10 +376,20 @@ export default function MultiVariantBaseModelF(configSchema: AnyConfigurationSch
|
|
|
330
376
|
type?: undefined;
|
|
331
377
|
checked?: undefined;
|
|
332
378
|
onClick?: undefined;
|
|
379
|
+
} | {
|
|
380
|
+
label: string;
|
|
381
|
+
icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
382
|
+
muiName: string;
|
|
383
|
+
};
|
|
384
|
+
onClick: () => void;
|
|
385
|
+
type?: undefined;
|
|
386
|
+
checked?: undefined;
|
|
387
|
+
subMenu?: undefined;
|
|
333
388
|
})[];
|
|
334
389
|
} & {
|
|
335
390
|
readonly canDisplayLabels: boolean;
|
|
336
391
|
readonly totalHeight: number;
|
|
392
|
+
readonly featuresReady: boolean;
|
|
337
393
|
} & {
|
|
338
394
|
renderProps(): any;
|
|
339
395
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -1,17 +1,21 @@
|
|
|
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';
|
|
7
|
+
import CategoryIcon from '@mui/icons-material/Category';
|
|
6
8
|
import FilterListIcon from '@mui/icons-material/FilterList';
|
|
7
9
|
import HeightIcon from '@mui/icons-material/Height';
|
|
8
10
|
import SplitscreenIcon from '@mui/icons-material/Splitscreen';
|
|
9
11
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
10
12
|
import deepEqual from 'fast-deep-equal';
|
|
11
|
-
import { types } from 'mobx-state-tree';
|
|
13
|
+
import { cast, types } from 'mobx-state-tree';
|
|
14
|
+
import { getSources } from './getSources';
|
|
12
15
|
const SetColorDialog = lazy(() => import('./components/SetColorDialog'));
|
|
13
16
|
const MAFFilterDialog = lazy(() => import('./components/MAFFilterDialog'));
|
|
14
|
-
const
|
|
17
|
+
const AddFiltersDialog = lazy(() => import('./components/AddFiltersDialog'));
|
|
18
|
+
const ClusterDialog = lazy(() => import('./components/MultiVariantClusterDialog/ClusterDialog'));
|
|
15
19
|
const SetRowHeightDialog = lazy(() => import('./components/SetRowHeightDialog'));
|
|
16
20
|
export default function MultiVariantBaseModelF(configSchema) {
|
|
17
21
|
return types
|
|
@@ -19,14 +23,18 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
19
23
|
type: types.literal('LinearVariantMatrixDisplay'),
|
|
20
24
|
layout: types.optional(types.frozen(), []),
|
|
21
25
|
configuration: ConfigurationReference(configSchema),
|
|
22
|
-
minorAlleleFrequencyFilter: types.optional(types.number, 0
|
|
26
|
+
minorAlleleFrequencyFilter: types.optional(types.number, 0),
|
|
23
27
|
showSidebarLabelsSetting: true,
|
|
24
28
|
renderingMode: types.optional(types.string, 'alleleCount'),
|
|
25
29
|
rowHeightSetting: types.optional(types.number, 8),
|
|
26
30
|
autoHeight: true,
|
|
31
|
+
lengthCutoffFilter: Number.MAX_SAFE_INTEGER,
|
|
32
|
+
jexlFilters: types.maybe(types.array(types.string)),
|
|
33
|
+
referenceDrawingMode: 'skip',
|
|
27
34
|
}))
|
|
28
35
|
.volatile(() => ({
|
|
29
36
|
sourcesLoadingStopToken: undefined,
|
|
37
|
+
simplifiedFeaturesStopToken: undefined,
|
|
30
38
|
featureUnderMouseVolatile: undefined,
|
|
31
39
|
sourcesVolatile: undefined,
|
|
32
40
|
featuresVolatile: undefined,
|
|
@@ -35,6 +43,9 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
35
43
|
hoveredGenotype: undefined,
|
|
36
44
|
}))
|
|
37
45
|
.actions(self => ({
|
|
46
|
+
setJexlFilters(f) {
|
|
47
|
+
self.jexlFilters = cast(f);
|
|
48
|
+
},
|
|
38
49
|
setRowHeight(arg) {
|
|
39
50
|
self.rowHeightSetting = arg;
|
|
40
51
|
},
|
|
@@ -56,6 +67,12 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
56
67
|
}
|
|
57
68
|
self.sourcesLoadingStopToken = str;
|
|
58
69
|
},
|
|
70
|
+
setSimplifiedFeaturesLoading(str) {
|
|
71
|
+
if (self.simplifiedFeaturesStopToken) {
|
|
72
|
+
stopStopToken(self.simplifiedFeaturesStopToken);
|
|
73
|
+
}
|
|
74
|
+
self.simplifiedFeaturesStopToken = str;
|
|
75
|
+
},
|
|
59
76
|
setSources(sources) {
|
|
60
77
|
if (!deepEqual(sources, self.sourcesVolatile)) {
|
|
61
78
|
self.sourcesVolatile = sources;
|
|
@@ -81,50 +98,48 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
81
98
|
self.sampleInfo = arg;
|
|
82
99
|
}
|
|
83
100
|
},
|
|
101
|
+
setReferenceDrawingMode(arg) {
|
|
102
|
+
self.referenceDrawingMode = arg;
|
|
103
|
+
},
|
|
84
104
|
}))
|
|
85
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
|
+
},
|
|
86
110
|
get preSources() {
|
|
87
111
|
return self.layout.length ? self.layout : self.sourcesVolatile;
|
|
88
112
|
},
|
|
113
|
+
get sourcesWithoutLayout() {
|
|
114
|
+
return self.sourcesVolatile
|
|
115
|
+
? getSources({
|
|
116
|
+
sources: self.sourcesVolatile,
|
|
117
|
+
renderingMode: self.renderingMode,
|
|
118
|
+
sampleInfo: self.sampleInfo,
|
|
119
|
+
})
|
|
120
|
+
: undefined;
|
|
121
|
+
},
|
|
89
122
|
get sources() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const id = `${row.name} HP${i}`;
|
|
101
|
-
rows.push({
|
|
102
|
-
...sources[row.name],
|
|
103
|
-
...row,
|
|
104
|
-
label: id,
|
|
105
|
-
HP: i,
|
|
106
|
-
id: id,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
rows.push({
|
|
113
|
-
...sources[row.name],
|
|
114
|
-
...row,
|
|
115
|
-
label: row.name,
|
|
116
|
-
id: row.name,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return rows;
|
|
121
|
-
}
|
|
122
|
-
return undefined;
|
|
123
|
+
const sourcesWithLayout = self.layout.length
|
|
124
|
+
? self.layout
|
|
125
|
+
: self.sourcesVolatile;
|
|
126
|
+
return sourcesWithLayout
|
|
127
|
+
? getSources({
|
|
128
|
+
sources: sourcesWithLayout,
|
|
129
|
+
renderingMode: self.renderingMode,
|
|
130
|
+
sampleInfo: self.sampleInfo,
|
|
131
|
+
})
|
|
132
|
+
: undefined;
|
|
123
133
|
},
|
|
124
134
|
}))
|
|
125
135
|
.views(self => {
|
|
126
136
|
const { trackMenuItems: superTrackMenuItems, renderProps: superRenderProps, } = self;
|
|
127
137
|
return {
|
|
138
|
+
get sourceMap() {
|
|
139
|
+
return self.sources
|
|
140
|
+
? Object.fromEntries(self.sources.map(source => [source.name, source]))
|
|
141
|
+
: undefined;
|
|
142
|
+
},
|
|
128
143
|
get rowHeight() {
|
|
129
144
|
const { sources, autoHeight, rowHeightSetting, height } = self;
|
|
130
145
|
return autoHeight ? height / ((sources === null || sources === void 0 ? void 0 : sources.length) || 1) : rowHeightSetting;
|
|
@@ -202,6 +217,28 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
202
217
|
},
|
|
203
218
|
],
|
|
204
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
|
+
},
|
|
205
242
|
{
|
|
206
243
|
label: 'Filter by',
|
|
207
244
|
icon: FilterListIcon,
|
|
@@ -218,10 +255,23 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
218
255
|
]);
|
|
219
256
|
},
|
|
220
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
|
+
},
|
|
221
270
|
],
|
|
222
271
|
},
|
|
223
272
|
{
|
|
224
273
|
label: 'Cluster by genotype',
|
|
274
|
+
icon: CategoryIcon,
|
|
225
275
|
onClick: () => {
|
|
226
276
|
getSession(self).queueDialog(handleClose => [
|
|
227
277
|
ClusterDialog,
|
|
@@ -250,26 +300,34 @@ export default function MultiVariantBaseModelF(configSchema) {
|
|
|
250
300
|
})
|
|
251
301
|
.views(self => ({
|
|
252
302
|
get canDisplayLabels() {
|
|
253
|
-
return self.rowHeight
|
|
303
|
+
return self.rowHeight >= 8 && self.showSidebarLabelsSetting;
|
|
254
304
|
},
|
|
255
305
|
get totalHeight() {
|
|
256
306
|
var _a;
|
|
257
307
|
return self.rowHeight * (((_a = self.sources) === null || _a === void 0 ? void 0 : _a.length) || 1);
|
|
258
308
|
},
|
|
309
|
+
get featuresReady() {
|
|
310
|
+
return !!self.featuresVolatile;
|
|
311
|
+
},
|
|
259
312
|
}))
|
|
260
313
|
.views(self => ({
|
|
261
314
|
renderProps() {
|
|
262
315
|
const superProps = self.adapterProps();
|
|
263
316
|
return {
|
|
264
317
|
...superProps,
|
|
265
|
-
notReady: superProps.notReady || !self.sources || !self.
|
|
318
|
+
notReady: superProps.notReady || !self.sources || !self.featuresReady,
|
|
266
319
|
height: self.height,
|
|
267
320
|
totalHeight: self.totalHeight,
|
|
268
321
|
renderingMode: self.renderingMode,
|
|
269
322
|
minorAlleleFrequencyFilter: self.minorAlleleFrequencyFilter,
|
|
323
|
+
lengthCutoffFilter: self.lengthCutoffFilter,
|
|
270
324
|
rowHeight: self.rowHeight,
|
|
271
325
|
sources: self.sources,
|
|
272
326
|
scrollTop: self.scrollTop,
|
|
327
|
+
referenceDrawingMode: self.referenceDrawingMode,
|
|
328
|
+
filters: new SerializableFilterChain({
|
|
329
|
+
filters: self.activeFilters,
|
|
330
|
+
}),
|
|
273
331
|
};
|
|
274
332
|
},
|
|
275
333
|
}));
|
|
@@ -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;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Dialog } from '@jbrowse/core/ui';
|
|
4
|
+
import { FormControlLabel, Radio, RadioGroup, Typography } from '@mui/material';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
|
+
import ClusterDialogAuto from './ClusterDialogAuto';
|
|
7
|
+
import ClusterDialogManual from './ClusterDialogManual';
|
|
8
|
+
function Header({ activeMode, setActiveMode, }) {
|
|
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 (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
|
+
}).map(([key, val]) => (_jsx(FormControlLabel, { control: _jsx(Radio, { checked: activeMode === key, onChange: () => {
|
|
13
|
+
setActiveMode(key);
|
|
14
|
+
} }), label: val }, key))) })] }));
|
|
15
|
+
}
|
|
16
|
+
const ClusterDialog = observer(function ({ model, handleClose, }) {
|
|
17
|
+
const [activeMode, setActiveMode] = useState('auto');
|
|
18
|
+
return (_jsx(Dialog, { open: true, title: "Cluster by genotype", onClose: (_, reason) => {
|
|
19
|
+
if (reason !== 'backdropClick') {
|
|
20
|
+
handleClose();
|
|
21
|
+
}
|
|
22
|
+
}, children: activeMode === 'auto' ? (_jsx(ClusterDialogAuto, { model: model, handleClose: handleClose, children: _jsx(Header, { activeMode: activeMode, setActiveMode: setActiveMode }) })) : (_jsx(ClusterDialogManual, { model: model, handleClose: handleClose, children: _jsx(Header, { activeMode: activeMode, setActiveMode: setActiveMode }) })) }));
|
|
23
|
+
});
|
|
24
|
+
export default ClusterDialog;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReducedModel } from './types';
|
|
2
|
+
declare const ClusterDialogAuto: ({ model, children, handleClose, }: {
|
|
3
|
+
model: ReducedModel;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
handleClose: () => void;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ClusterDialogAuto;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
4
|
+
import { getContainingView, getSession, isAbortException, } from '@jbrowse/core/util';
|
|
5
|
+
import { createStopToken, stopStopToken } from '@jbrowse/core/util/stopToken';
|
|
6
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
7
|
+
import { Button, DialogActions, DialogContent } from '@mui/material';
|
|
8
|
+
import { observer } from 'mobx-react';
|
|
9
|
+
import { isAlive } from 'mobx-state-tree';
|
|
10
|
+
const ClusterDialogAuto = observer(function ({ model, children, handleClose, }) {
|
|
11
|
+
const [progress, setProgress] = useState('');
|
|
12
|
+
const [loading, setLoading] = useState(false);
|
|
13
|
+
const [error, setError] = useState();
|
|
14
|
+
const [stopToken, setStopToken] = useState('');
|
|
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: () => {
|
|
16
|
+
stopStopToken(stopToken);
|
|
17
|
+
}, children: "Stop" })] })) : null, error ? _jsx(ErrorMessage, { error: error }) : null] })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", disabled: loading, onClick: async () => {
|
|
18
|
+
try {
|
|
19
|
+
setError(undefined);
|
|
20
|
+
setProgress('Initializing');
|
|
21
|
+
setLoading(true);
|
|
22
|
+
const view = getContainingView(model);
|
|
23
|
+
if (!view.initialized) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const { rpcManager } = getSession(model);
|
|
27
|
+
const { sourcesWithoutLayout, minorAlleleFrequencyFilter, lengthCutoffFilter, adapterConfig, } = model;
|
|
28
|
+
if (sourcesWithoutLayout) {
|
|
29
|
+
const sessionId = getRpcSessionId(model);
|
|
30
|
+
const stopToken = createStopToken();
|
|
31
|
+
setStopToken(stopToken);
|
|
32
|
+
const ret = (await rpcManager.call(sessionId, 'MultiVariantClusterGenotypeMatrix', {
|
|
33
|
+
regions: view.dynamicBlocks.contentBlocks,
|
|
34
|
+
sources: sourcesWithoutLayout,
|
|
35
|
+
minorAlleleFrequencyFilter,
|
|
36
|
+
lengthCutoffFilter,
|
|
37
|
+
sessionId,
|
|
38
|
+
adapterConfig,
|
|
39
|
+
stopToken,
|
|
40
|
+
statusCallback: (arg) => {
|
|
41
|
+
setProgress(arg);
|
|
42
|
+
},
|
|
43
|
+
}));
|
|
44
|
+
model.setLayout(ret.order.map(idx => {
|
|
45
|
+
const ret = sourcesWithoutLayout[idx];
|
|
46
|
+
if (!ret) {
|
|
47
|
+
throw new Error(`out of bounds at ${idx}`);
|
|
48
|
+
}
|
|
49
|
+
return ret;
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
handleClose();
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
if (!isAbortException(e) && isAlive(model)) {
|
|
56
|
+
console.error(e);
|
|
57
|
+
setError(e);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
setLoading(false);
|
|
62
|
+
setProgress('');
|
|
63
|
+
setStopToken('');
|
|
64
|
+
}
|
|
65
|
+
}, children: "Run clustering" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
66
|
+
handleClose();
|
|
67
|
+
if (stopToken) {
|
|
68
|
+
stopStopToken(stopToken);
|
|
69
|
+
}
|
|
70
|
+
}, children: "Cancel" })] })] }));
|
|
71
|
+
});
|
|
72
|
+
export default ClusterDialogAuto;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReducedModel } from './types';
|
|
2
|
+
declare const ClusterDialogManuals: ({ model, handleClose, children, }: {
|
|
3
|
+
model: ReducedModel;
|
|
4
|
+
handleClose: () => void;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default ClusterDialogManuals;
|