@jbrowse/plugin-variants 2.17.0 → 2.18.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/ChordVariantDisplay/index.d.ts +1 -1
- package/dist/ChordVariantDisplay/index.js +1 -2
- package/dist/ChordVariantDisplay/models/configSchema.d.ts +1 -4
- package/dist/ChordVariantDisplay/models/configSchema.js +1 -10
- package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -27
- package/dist/ChordVariantDisplay/models/stateModelFactory.js +2 -23
- package/dist/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/dist/LinearVariantDisplay/configSchema.js +1 -10
- package/dist/LinearVariantDisplay/index.d.ts +1 -1
- package/dist/LinearVariantDisplay/index.js +2 -2
- package/dist/LinearVariantDisplay/model.d.ts +8 -38
- package/dist/LinearVariantDisplay/model.js +1 -17
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/dist/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +73 -0
- package/dist/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
- package/dist/MultiLinearVariantDisplay/configSchema.js +30 -0
- package/dist/MultiLinearVariantDisplay/index.d.ts +2 -0
- package/dist/MultiLinearVariantDisplay/index.js +47 -0
- package/dist/MultiLinearVariantDisplay/model.d.ts +278 -0
- package/dist/MultiLinearVariantDisplay/model.js +235 -0
- package/dist/MultiLinearVariantDisplay/renderSvg.d.ts +4 -0
- package/dist/MultiLinearVariantDisplay/renderSvg.js +18 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +7 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +42 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/dist/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +81 -0
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
- package/dist/MultiLinearVariantMatrixDisplay/configSchema.js +22 -0
- package/dist/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixDisplay/index.js +24 -0
- package/dist/MultiLinearVariantMatrixDisplay/model.d.ts +274 -0
- package/dist/MultiLinearVariantMatrixDisplay/model.js +218 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +4 -0
- package/dist/MultiLinearVariantMatrixDisplay/renderSvg.js +21 -0
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +62 -0
- package/dist/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +106 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +6 -0
- package/dist/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +12 -0
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixRenderer/configSchema.js +6 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
- package/dist/MultiLinearVariantMatrixRenderer/index.js +20 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +48 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRenderer.js +60 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +18 -0
- package/dist/MultiLinearVariantRenderer/MultiVariantRendering.js +43 -0
- package/dist/MultiLinearVariantRenderer/configSchema.d.ts +34 -0
- package/dist/MultiLinearVariantRenderer/configSchema.js +13 -0
- package/dist/MultiLinearVariantRenderer/index.d.ts +2 -0
- package/dist/MultiLinearVariantRenderer/index.js +19 -0
- package/dist/MultiVariantBaseRenderer.d.ts +46 -0
- package/dist/MultiVariantBaseRenderer.js +39 -0
- package/dist/StructuralVariantChordRenderer/Chord.d.ts +2 -2
- package/dist/StructuralVariantChordRenderer/Chord.js +5 -9
- package/dist/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +0 -1
- package/dist/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
- package/dist/StructuralVariantChordRenderer/configSchema.js +1 -13
- package/dist/StructuralVariantChordRenderer/index.d.ts +1 -1
- package/dist/StructuralVariantChordRenderer/index.js +1 -1
- package/dist/Tooltip.d.ts +19 -0
- package/dist/Tooltip.js +58 -0
- package/dist/VariantFeatureWidget/AnnotGrid.d.ts +1 -1
- package/dist/VariantFeatureWidget/AnnotGrid.js +2 -2
- package/dist/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
- package/dist/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -2
- package/dist/VariantFeatureWidget/LaunchBreakendPanel.js +15 -19
- package/dist/VariantFeatureWidget/VariantAnnotationTable.js +1 -1
- package/dist/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +4 -6
- package/dist/VariantFeatureWidget/VariantSampleGrid.d.ts +1 -1
- package/dist/VariantFeatureWidget/VariantSampleGrid.js +9 -13
- package/dist/VariantFeatureWidget/index.d.ts +1 -1
- package/dist/VariantFeatureWidget/index.js +1 -1
- package/dist/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
- package/dist/VariantFeatureWidget/stateModelFactory.js +1 -1
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
- package/dist/VariantRPC/MultiVariantGetGenotypeMatrix.js +67 -0
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +21 -0
- package/dist/VariantRPC/MultiVariantGetSimplifiedFeatures.js +63 -0
- package/dist/VariantRPC/MultiVariantGetSources.d.ts +14 -0
- package/dist/VariantRPC/MultiVariantGetSources.js +22 -0
- package/dist/VariantTrack/configSchema.d.ts +2 -3
- package/dist/VariantTrack/configSchema.js +6 -13
- package/dist/VariantTrack/index.d.ts +1 -1
- package/dist/VcfAdapter/VcfAdapter.d.ts +3 -2
- package/dist/VcfAdapter/VcfAdapter.js +3 -5
- package/dist/VcfAdapter/configSchema.d.ts +0 -3
- package/dist/VcfAdapter/configSchema.js +1 -7
- package/dist/VcfAdapter/index.d.ts +1 -1
- package/dist/VcfFeature/index.d.ts +5 -29
- package/dist/VcfFeature/index.js +35 -26
- package/dist/VcfFeature/util.d.ts +1 -4
- package/dist/VcfFeature/util.js +0 -12
- package/dist/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +10 -5
- package/dist/VcfTabixAdapter/configSchema.d.ts +0 -9
- package/dist/VcfTabixAdapter/configSchema.js +2 -14
- package/dist/VcfTabixAdapter/index.d.ts +1 -1
- package/dist/configSchema.d.ts +34 -0
- package/dist/configSchema.js +44 -0
- package/dist/extensionPoints.d.ts +1 -1
- package/dist/getMultiVariantFeaturesAutorun.d.ts +19 -0
- package/dist/getMultiVariantFeaturesAutorun.js +40 -0
- package/dist/getMultiVariantSourcesAutorun.d.ts +16 -0
- package/dist/getMultiVariantSourcesAutorun.js +37 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -4
- package/dist/shared/BulkEditPanel.d.ts +6 -0
- package/dist/shared/BulkEditPanel.js +103 -0
- package/dist/shared/ClusterDialog.d.ts +12 -0
- package/dist/shared/ClusterDialog.js +150 -0
- package/dist/shared/ColorLegend.d.ts +11 -0
- package/dist/shared/ColorLegend.js +24 -0
- package/dist/shared/DraggableDialog.d.ts +6 -0
- package/dist/shared/DraggableDialog.js +62 -0
- package/dist/shared/LegendBar.d.ts +18 -0
- package/dist/shared/LegendBar.js +38 -0
- package/dist/shared/MAFFilterDialog.d.ts +9 -0
- package/dist/shared/MAFFilterDialog.js +56 -0
- package/dist/shared/RectBg.d.ts +9 -0
- package/dist/shared/RectBg.js +12 -0
- package/dist/shared/RowPalettizer.d.ts +6 -0
- package/dist/shared/RowPalettizer.js +38 -0
- package/dist/shared/SetColorDialog.d.ts +12 -0
- package/dist/shared/SetColorDialog.js +94 -0
- package/dist/shared/SetMinMaxDialog.d.ts +11 -0
- package/dist/shared/SetMinMaxDialog.js +56 -0
- package/dist/shared/SharedVariantConfigSchema.d.ts +66 -0
- package/dist/shared/SharedVariantConfigSchema.js +56 -0
- package/dist/shared/SharedVariantMixin.d.ts +309 -0
- package/dist/shared/SharedVariantMixin.js +58 -0
- package/dist/shared/SourcesGrid.d.ts +8 -0
- package/dist/shared/SourcesGrid.js +143 -0
- package/dist/shared/Tooltip.d.ts +18 -0
- package/dist/shared/Tooltip.js +38 -0
- package/dist/shared/util.d.ts +10 -0
- package/dist/shared/util.js +32 -0
- package/dist/util.d.ts +11 -0
- package/dist/util.js +53 -0
- package/esm/ChordVariantDisplay/index.d.ts +1 -1
- package/esm/ChordVariantDisplay/index.js +1 -2
- package/esm/ChordVariantDisplay/models/configSchema.d.ts +1 -4
- package/esm/ChordVariantDisplay/models/configSchema.js +1 -10
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +9 -27
- package/esm/ChordVariantDisplay/models/stateModelFactory.js +3 -24
- package/esm/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/esm/LinearVariantDisplay/configSchema.js +1 -10
- package/esm/LinearVariantDisplay/index.d.ts +1 -1
- package/esm/LinearVariantDisplay/index.js +2 -2
- package/esm/LinearVariantDisplay/model.d.ts +8 -38
- package/esm/LinearVariantDisplay/model.js +2 -18
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/esm/MultiLinearVariantDisplay/components/VariantDisplayComponent.js +45 -0
- package/esm/MultiLinearVariantDisplay/configSchema.d.ts +80 -0
- package/esm/MultiLinearVariantDisplay/configSchema.js +24 -0
- package/esm/MultiLinearVariantDisplay/index.d.ts +2 -0
- package/esm/MultiLinearVariantDisplay/index.js +18 -0
- package/esm/MultiLinearVariantDisplay/model.d.ts +278 -0
- package/esm/MultiLinearVariantDisplay/model.js +206 -0
- package/esm/MultiLinearVariantDisplay/renderSvg.d.ts +4 -0
- package/esm/MultiLinearVariantDisplay/renderSvg.js +12 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.d.ts +7 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/LinesConnectingMatrixToGenomicPosition.js +37 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.d.ts +6 -0
- package/esm/MultiLinearVariantMatrixDisplay/components/VariantDisplayComponent.js +53 -0
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.d.ts +37 -0
- package/esm/MultiLinearVariantMatrixDisplay/configSchema.js +16 -0
- package/esm/MultiLinearVariantMatrixDisplay/index.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixDisplay/index.js +18 -0
- package/esm/MultiLinearVariantMatrixDisplay/model.d.ts +274 -0
- package/esm/MultiLinearVariantMatrixDisplay/model.js +189 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.d.ts +4 -0
- package/esm/MultiLinearVariantMatrixDisplay/renderSvg.js +15 -0
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.d.ts +62 -0
- package/esm/MultiLinearVariantMatrixRenderer/LinearVariantMatrixRenderer.js +100 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.d.ts +6 -0
- package/esm/MultiLinearVariantMatrixRenderer/components/LinearVariantMatrixRendering.js +7 -0
- package/esm/MultiLinearVariantMatrixRenderer/configSchema.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixRenderer/configSchema.js +4 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.d.ts +2 -0
- package/esm/MultiLinearVariantMatrixRenderer/index.js +14 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.d.ts +48 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRenderer.js +54 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.d.ts +18 -0
- package/esm/MultiLinearVariantRenderer/MultiVariantRendering.js +18 -0
- package/esm/MultiLinearVariantRenderer/configSchema.d.ts +34 -0
- package/esm/MultiLinearVariantRenderer/configSchema.js +8 -0
- package/esm/MultiLinearVariantRenderer/index.d.ts +2 -0
- package/esm/MultiLinearVariantRenderer/index.js +13 -0
- package/esm/MultiVariantBaseRenderer.d.ts +46 -0
- package/esm/MultiVariantBaseRenderer.js +33 -0
- package/esm/StructuralVariantChordRenderer/Chord.d.ts +2 -2
- package/esm/StructuralVariantChordRenderer/Chord.js +5 -9
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +3 -3
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +0 -1
- package/esm/StructuralVariantChordRenderer/configSchema.d.ts +0 -9
- package/esm/StructuralVariantChordRenderer/configSchema.js +1 -13
- package/esm/StructuralVariantChordRenderer/index.d.ts +1 -1
- package/esm/StructuralVariantChordRenderer/index.js +1 -1
- package/esm/Tooltip.d.ts +19 -0
- package/esm/Tooltip.js +30 -0
- package/esm/VariantFeatureWidget/AnnotGrid.d.ts +1 -1
- package/esm/VariantFeatureWidget/AnnotGrid.js +2 -2
- package/esm/VariantFeatureWidget/BreakendMultiLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/BreakendSingleLevelOptionDialog.js +0 -1
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.d.ts +2 -2
- package/esm/VariantFeatureWidget/LaunchBreakendPanel.js +15 -19
- package/esm/VariantFeatureWidget/VariantAnnotationTable.js +1 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +1 -1
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +5 -7
- package/esm/VariantFeatureWidget/VariantSampleGrid.d.ts +1 -1
- package/esm/VariantFeatureWidget/VariantSampleGrid.js +10 -14
- package/esm/VariantFeatureWidget/index.d.ts +1 -1
- package/esm/VariantFeatureWidget/index.js +1 -1
- package/esm/VariantFeatureWidget/stateModelFactory.d.ts +2 -2
- package/esm/VariantFeatureWidget/stateModelFactory.js +1 -1
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.d.ts +17 -0
- package/esm/VariantRPC/MultiVariantGetGenotypeMatrix.js +60 -0
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.d.ts +21 -0
- package/esm/VariantRPC/MultiVariantGetSimplifiedFeatures.js +56 -0
- package/esm/VariantRPC/MultiVariantGetSources.d.ts +14 -0
- package/esm/VariantRPC/MultiVariantGetSources.js +15 -0
- package/esm/VariantTrack/configSchema.d.ts +2 -3
- package/esm/VariantTrack/configSchema.js +5 -13
- package/esm/VariantTrack/index.d.ts +1 -1
- package/esm/VcfAdapter/VcfAdapter.d.ts +3 -2
- package/esm/VcfAdapter/VcfAdapter.js +4 -6
- package/esm/VcfAdapter/configSchema.d.ts +0 -3
- package/esm/VcfAdapter/configSchema.js +1 -7
- package/esm/VcfAdapter/index.d.ts +1 -1
- package/esm/VcfFeature/index.d.ts +5 -29
- package/esm/VcfFeature/index.js +35 -26
- package/esm/VcfFeature/util.d.ts +1 -4
- package/esm/VcfFeature/util.js +0 -12
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +7 -3
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +11 -6
- package/esm/VcfTabixAdapter/configSchema.d.ts +0 -9
- package/esm/VcfTabixAdapter/configSchema.js +2 -14
- package/esm/VcfTabixAdapter/index.d.ts +1 -1
- package/esm/configSchema.d.ts +34 -0
- package/esm/configSchema.js +42 -0
- package/esm/extensionPoints.d.ts +1 -1
- package/esm/extensionPoints.js +1 -1
- package/esm/getMultiVariantFeaturesAutorun.d.ts +19 -0
- package/esm/getMultiVariantFeaturesAutorun.js +37 -0
- package/esm/getMultiVariantSourcesAutorun.d.ts +16 -0
- package/esm/getMultiVariantSourcesAutorun.js +34 -0
- package/esm/index.d.ts +1 -1
- package/esm/index.js +18 -4
- package/esm/shared/BulkEditPanel.d.ts +6 -0
- package/esm/shared/BulkEditPanel.js +77 -0
- package/esm/shared/ClusterDialog.d.ts +12 -0
- package/esm/shared/ClusterDialog.js +121 -0
- package/esm/shared/ColorLegend.d.ts +11 -0
- package/esm/shared/ColorLegend.js +19 -0
- package/esm/shared/DraggableDialog.d.ts +6 -0
- package/esm/shared/DraggableDialog.js +34 -0
- package/esm/shared/LegendBar.d.ts +18 -0
- package/esm/shared/LegendBar.js +32 -0
- package/esm/shared/MAFFilterDialog.d.ts +9 -0
- package/esm/shared/MAFFilterDialog.js +31 -0
- package/esm/shared/RectBg.d.ts +9 -0
- package/esm/shared/RectBg.js +7 -0
- package/esm/shared/RowPalettizer.d.ts +6 -0
- package/esm/shared/RowPalettizer.js +32 -0
- package/esm/shared/SetColorDialog.d.ts +12 -0
- package/esm/shared/SetColorDialog.js +65 -0
- package/esm/shared/SetMinMaxDialog.d.ts +11 -0
- package/esm/shared/SetMinMaxDialog.js +30 -0
- package/esm/shared/SharedVariantConfigSchema.d.ts +66 -0
- package/esm/shared/SharedVariantConfigSchema.js +53 -0
- package/esm/shared/SharedVariantMixin.d.ts +309 -0
- package/esm/shared/SharedVariantMixin.js +55 -0
- package/esm/shared/SourcesGrid.d.ts +8 -0
- package/esm/shared/SourcesGrid.js +115 -0
- package/esm/shared/Tooltip.d.ts +18 -0
- package/esm/shared/Tooltip.js +33 -0
- package/esm/shared/util.d.ts +10 -0
- package/esm/shared/util.js +28 -0
- package/esm/util.d.ts +11 -0
- package/esm/util.js +47 -0
- package/package.json +4 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMultiVariantSourcesAutorun = getMultiVariantSourcesAutorun;
|
|
4
|
+
const util_1 = require("@jbrowse/core/util");
|
|
5
|
+
const aborting_1 = require("@jbrowse/core/util/aborting");
|
|
6
|
+
const stopToken_1 = require("@jbrowse/core/util/stopToken");
|
|
7
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
8
|
+
const mobx_1 = require("mobx");
|
|
9
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
10
|
+
function getMultiVariantSourcesAutorun(self) {
|
|
11
|
+
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(async () => {
|
|
12
|
+
try {
|
|
13
|
+
const view = (0, util_1.getContainingView)(self);
|
|
14
|
+
if (!view.initialized) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { rpcManager } = (0, util_1.getSession)(self);
|
|
18
|
+
const { adapterConfig } = self;
|
|
19
|
+
const token = (0, stopToken_1.createStopToken)();
|
|
20
|
+
self.setSourcesLoading(token);
|
|
21
|
+
const sessionId = (0, tracks_1.getRpcSessionId)(self);
|
|
22
|
+
const sources = (await rpcManager.call(sessionId, 'MultiVariantGetSources', {
|
|
23
|
+
sessionId,
|
|
24
|
+
adapterConfig,
|
|
25
|
+
}));
|
|
26
|
+
if ((0, mobx_state_tree_1.isAlive)(self)) {
|
|
27
|
+
self.setSources(sources);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
if (!(0, aborting_1.isAbortException)(e) && (0, mobx_state_tree_1.isAlive)(self)) {
|
|
32
|
+
console.error(e);
|
|
33
|
+
(0, util_1.getSession)(self).notifyError(`${e}`, e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, { delay: 1000 }));
|
|
37
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
3
|
export default class VariantsPlugin extends Plugin {
|
|
4
4
|
name: string;
|
|
5
5
|
install(pluginManager: PluginManager): void;
|
package/dist/index.js
CHANGED
|
@@ -4,15 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.VcfFeature = void 0;
|
|
7
|
-
const VcfAdapter_1 = __importDefault(require("./VcfAdapter"));
|
|
8
|
-
const VcfTabixAdapter_1 = __importDefault(require("./VcfTabixAdapter"));
|
|
9
|
-
const extensionPoints_1 = __importDefault(require("./extensionPoints"));
|
|
10
|
-
const VariantTrack_1 = __importDefault(require("./VariantTrack"));
|
|
11
7
|
const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
|
|
12
8
|
const ChordVariantDisplay_1 = __importDefault(require("./ChordVariantDisplay"));
|
|
13
9
|
const LinearVariantDisplay_1 = __importDefault(require("./LinearVariantDisplay"));
|
|
10
|
+
const MultiLinearVariantDisplay_1 = __importDefault(require("./MultiLinearVariantDisplay"));
|
|
11
|
+
const MultiLinearVariantMatrixDisplay_1 = __importDefault(require("./MultiLinearVariantMatrixDisplay"));
|
|
12
|
+
const MultiLinearVariantMatrixRenderer_1 = __importDefault(require("./MultiLinearVariantMatrixRenderer"));
|
|
13
|
+
const MultiLinearVariantRenderer_1 = __importDefault(require("./MultiLinearVariantRenderer"));
|
|
14
14
|
const StructuralVariantChordRenderer_1 = __importDefault(require("./StructuralVariantChordRenderer"));
|
|
15
15
|
const VariantFeatureWidget_1 = __importDefault(require("./VariantFeatureWidget"));
|
|
16
|
+
const MultiVariantGetGenotypeMatrix_1 = require("./VariantRPC/MultiVariantGetGenotypeMatrix");
|
|
17
|
+
const MultiVariantGetSimplifiedFeatures_1 = require("./VariantRPC/MultiVariantGetSimplifiedFeatures");
|
|
18
|
+
const MultiVariantGetSources_1 = require("./VariantRPC/MultiVariantGetSources");
|
|
19
|
+
const VariantTrack_1 = __importDefault(require("./VariantTrack"));
|
|
20
|
+
const VcfAdapter_1 = __importDefault(require("./VcfAdapter"));
|
|
21
|
+
const VcfTabixAdapter_1 = __importDefault(require("./VcfTabixAdapter"));
|
|
22
|
+
const extensionPoints_1 = __importDefault(require("./extensionPoints"));
|
|
16
23
|
class VariantsPlugin extends Plugin_1.default {
|
|
17
24
|
constructor() {
|
|
18
25
|
super(...arguments);
|
|
@@ -25,8 +32,15 @@ class VariantsPlugin extends Plugin_1.default {
|
|
|
25
32
|
(0, VariantTrack_1.default)(pluginManager);
|
|
26
33
|
(0, extensionPoints_1.default)(pluginManager);
|
|
27
34
|
(0, LinearVariantDisplay_1.default)(pluginManager);
|
|
35
|
+
(0, MultiLinearVariantMatrixDisplay_1.default)(pluginManager);
|
|
36
|
+
(0, MultiLinearVariantDisplay_1.default)(pluginManager);
|
|
37
|
+
(0, MultiLinearVariantRenderer_1.default)(pluginManager);
|
|
38
|
+
(0, MultiLinearVariantMatrixRenderer_1.default)(pluginManager);
|
|
28
39
|
(0, StructuralVariantChordRenderer_1.default)(pluginManager);
|
|
29
40
|
(0, ChordVariantDisplay_1.default)(pluginManager);
|
|
41
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetSources_1.MultiVariantGetSources(pluginManager));
|
|
42
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetGenotypeMatrix_1.MultiVariantGetGenotypeMatrix(pluginManager));
|
|
43
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetSimplifiedFeatures_1.MultiVariantGetSimplifiedFeatures(pluginManager));
|
|
30
44
|
}
|
|
31
45
|
}
|
|
32
46
|
exports.default = VariantsPlugin;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.default = BulkEditPanel;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
29
|
+
const material_1 = require("@mui/material");
|
|
30
|
+
const mui_1 = require("tss-react/mui");
|
|
31
|
+
const useStyles = (0, mui_1.makeStyles)()({
|
|
32
|
+
textAreaFont: {
|
|
33
|
+
fontFamily: 'Courier New',
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
function BulkEditPanel({ setCurrLayout, currLayout, }) {
|
|
37
|
+
const { classes } = useStyles();
|
|
38
|
+
const [val, setVal] = (0, react_1.useState)('');
|
|
39
|
+
const [error, setError] = (0, react_1.useState)();
|
|
40
|
+
return (react_1.default.createElement("div", null,
|
|
41
|
+
react_1.default.createElement(material_1.Typography, null, "Paste CSV or TSV. If a header column is present. First line is a header. If a column called \"name\" is present, it uses that to connect to IDs in the table, otherwise it uses the first column no."),
|
|
42
|
+
react_1.default.createElement(material_1.TextField, { variant: "outlined", multiline: true, minRows: 5, placeholder: 'name,population\nHG00098,GBR\nHG00101,GBR\nHG00459,CHS\n...', maxRows: 10, fullWidth: true, value: val, onChange: event => {
|
|
43
|
+
setVal(event.target.value);
|
|
44
|
+
}, slotProps: {
|
|
45
|
+
input: {
|
|
46
|
+
classes: {
|
|
47
|
+
input: classes.textAreaFont,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
} }),
|
|
51
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
|
|
52
|
+
const lines = val
|
|
53
|
+
.split('\n')
|
|
54
|
+
.map(f => f.trim())
|
|
55
|
+
.filter(f => !!f);
|
|
56
|
+
const fields = lines[0].split(/[,\t]/gm);
|
|
57
|
+
if (fields.includes('name')) {
|
|
58
|
+
setError('');
|
|
59
|
+
const oldLayout = currLayout.map(record => [record.name, record]);
|
|
60
|
+
const newData = Object.fromEntries(lines.slice(1).map(line => {
|
|
61
|
+
const cols = line.split(/[,\t]/gm);
|
|
62
|
+
const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
|
|
63
|
+
return [
|
|
64
|
+
newRecord.name,
|
|
65
|
+
{ ...newRecord, ...oldLayout[newRecord.name] },
|
|
66
|
+
];
|
|
67
|
+
}));
|
|
68
|
+
setCurrLayout(currLayout.map(record => ({
|
|
69
|
+
...record,
|
|
70
|
+
...newData[record.name],
|
|
71
|
+
})));
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
setError(new Error('No "name" column found on line 1'));
|
|
75
|
+
}
|
|
76
|
+
} }, "Update rows"),
|
|
77
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
|
|
78
|
+
const lines = val
|
|
79
|
+
.split('\n')
|
|
80
|
+
.map(f => f.trim())
|
|
81
|
+
.filter(f => !!f);
|
|
82
|
+
const fields = lines[0].split(/[,\t]/gm);
|
|
83
|
+
if (fields.includes('name')) {
|
|
84
|
+
setError('');
|
|
85
|
+
const oldLayout = currLayout.map(record => [record.name, record]);
|
|
86
|
+
const newData = Object.fromEntries(lines.slice(1).map(line => {
|
|
87
|
+
const cols = line.split(/[,\t]/gm);
|
|
88
|
+
const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
|
|
89
|
+
return [
|
|
90
|
+
newRecord.name,
|
|
91
|
+
{ ...newRecord, ...oldLayout[newRecord.name] },
|
|
92
|
+
];
|
|
93
|
+
}));
|
|
94
|
+
setCurrLayout(currLayout.map(record => ({
|
|
95
|
+
...newData[record.name],
|
|
96
|
+
})));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
setError(new Error('No "name" column found on line 1'));
|
|
100
|
+
}
|
|
101
|
+
} }, "Replace rows"),
|
|
102
|
+
error ? react_1.default.createElement(ui_1.ErrorMessage, { error: error }) : null));
|
|
103
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Source } from '../util';
|
|
3
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
4
|
+
export default function HierarchicalCluster({ model, handleClose, }: {
|
|
5
|
+
model: {
|
|
6
|
+
sources?: Source[];
|
|
7
|
+
mafFilter?: number;
|
|
8
|
+
adapterConfig: AnyConfigurationModel;
|
|
9
|
+
setLayout: (arg: Source[]) => void;
|
|
10
|
+
};
|
|
11
|
+
handleClose: () => void;
|
|
12
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.default = HierarchicalCluster;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const ui_1 = require("@jbrowse/core/ui");
|
|
32
|
+
const util_1 = require("@jbrowse/core/util");
|
|
33
|
+
const tracks_1 = require("@jbrowse/core/util/tracks");
|
|
34
|
+
const material_1 = require("@mui/material");
|
|
35
|
+
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
36
|
+
const file_saver_1 = require("file-saver");
|
|
37
|
+
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
38
|
+
const mui_1 = require("tss-react/mui");
|
|
39
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
40
|
+
textAreaFont: {
|
|
41
|
+
fontFamily: 'Courier New',
|
|
42
|
+
},
|
|
43
|
+
mgap: {
|
|
44
|
+
display: 'flex',
|
|
45
|
+
flexDirection: 'column',
|
|
46
|
+
gap: theme.spacing(4),
|
|
47
|
+
},
|
|
48
|
+
}));
|
|
49
|
+
function HierarchicalCluster({ model, handleClose, }) {
|
|
50
|
+
const { classes } = useStyles();
|
|
51
|
+
const [results, setResults] = (0, react_1.useState)();
|
|
52
|
+
const [error, setError] = (0, react_1.useState)();
|
|
53
|
+
const [paste, setPaste] = (0, react_1.useState)('');
|
|
54
|
+
(0, react_1.useEffect)(() => {
|
|
55
|
+
;
|
|
56
|
+
(async () => {
|
|
57
|
+
try {
|
|
58
|
+
setError(undefined);
|
|
59
|
+
const view = (0, util_1.getContainingView)(model);
|
|
60
|
+
if (!view.initialized) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const { rpcManager } = (0, util_1.getSession)(model);
|
|
64
|
+
const { sources, mafFilter, adapterConfig } = model;
|
|
65
|
+
const sessionId = (0, tracks_1.getRpcSessionId)(model);
|
|
66
|
+
const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
|
|
67
|
+
regions: view.dynamicBlocks.contentBlocks,
|
|
68
|
+
sources,
|
|
69
|
+
mafFilter,
|
|
70
|
+
sessionId,
|
|
71
|
+
adapterConfig,
|
|
72
|
+
}));
|
|
73
|
+
const entries = Object.values(ret);
|
|
74
|
+
const keys = Object.keys(ret);
|
|
75
|
+
const text = `try(library(fastcluster), silent=TRUE)
|
|
76
|
+
inputMatrix<-matrix(c(${entries.map(val => val.genotypes.join(',')).join(',\n')}
|
|
77
|
+
),nrow=${entries.length},byrow=TRUE)
|
|
78
|
+
rownames(inputMatrix)<-c(${keys.map(key => `'${key}'`).join(',')})
|
|
79
|
+
resultClusters<-hclust(dist(inputMatrix), method='single')
|
|
80
|
+
cat(resultClusters$order,sep='\\n')`;
|
|
81
|
+
setResults(text);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
if (!(0, util_1.isAbortException)(e) && (0, mobx_state_tree_1.isAlive)(model)) {
|
|
85
|
+
console.error(e);
|
|
86
|
+
setError(e);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
})();
|
|
90
|
+
}, [model]);
|
|
91
|
+
return (react_1.default.createElement(ui_1.Dialog, { open: true, title: "Cluster by genotype", onClose: handleClose },
|
|
92
|
+
react_1.default.createElement(material_1.DialogContent, null,
|
|
93
|
+
react_1.default.createElement("div", { className: classes.mgap },
|
|
94
|
+
react_1.default.createElement(material_1.Typography, null, "This page will produce an R script that will perform hierarchical clustering on the visible genotype data using `hclust`."),
|
|
95
|
+
react_1.default.createElement(material_1.Typography, null, "You can then paste the results in this form to specify the row ordering."),
|
|
96
|
+
results ? (react_1.default.createElement("div", null,
|
|
97
|
+
react_1.default.createElement("div", null,
|
|
98
|
+
"Step 1:",
|
|
99
|
+
' ',
|
|
100
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
|
|
101
|
+
(0, file_saver_1.saveAs)(new Blob([results || ''], {
|
|
102
|
+
type: 'text/plain;charset=utf-8',
|
|
103
|
+
}), 'cluster.R');
|
|
104
|
+
} }, "Download Rscript"),
|
|
105
|
+
' ',
|
|
106
|
+
"or",
|
|
107
|
+
' ',
|
|
108
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => {
|
|
109
|
+
(0, copy_to_clipboard_1.default)(results || '');
|
|
110
|
+
} }, "Copy Rscript to clipboard"),
|
|
111
|
+
react_1.default.createElement("div", null,
|
|
112
|
+
react_1.default.createElement(material_1.TextField, { multiline: true, fullWidth: true, variant: "outlined", placeholder: "Step 2. Paste results from Rscript here (sequence of numbers, one per line, specifying the new ordering)", rows: 10, value: paste, onChange: event => {
|
|
113
|
+
setPaste(event.target.value);
|
|
114
|
+
}, slotProps: {
|
|
115
|
+
input: {
|
|
116
|
+
classes: {
|
|
117
|
+
input: classes.textAreaFont,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
} }))))) : (react_1.default.createElement(ui_1.LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })),
|
|
121
|
+
error ? react_1.default.createElement(ui_1.ErrorMessage, { error: error }) : null)),
|
|
122
|
+
react_1.default.createElement(material_1.DialogActions, null,
|
|
123
|
+
react_1.default.createElement(material_1.Button, { disabled: !results, variant: "contained", onClick: () => {
|
|
124
|
+
const { sources } = model;
|
|
125
|
+
if (sources) {
|
|
126
|
+
try {
|
|
127
|
+
model.setLayout(paste
|
|
128
|
+
.split('\n')
|
|
129
|
+
.map(t => t.trim())
|
|
130
|
+
.filter(f => !!f)
|
|
131
|
+
.map(r => +r)
|
|
132
|
+
.map(idx => {
|
|
133
|
+
const ret = sources[idx - 1];
|
|
134
|
+
if (!ret) {
|
|
135
|
+
throw new Error(`out of bounds at ${idx}`);
|
|
136
|
+
}
|
|
137
|
+
return ret;
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
console.error(e);
|
|
142
|
+
setError(e);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
handleClose();
|
|
146
|
+
} }, "Apply clustering"),
|
|
147
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
148
|
+
handleClose();
|
|
149
|
+
} }, "Cancel"))));
|
|
150
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Source } from '../util';
|
|
3
|
+
declare const ColorLegend: ({ model, labelWidth, }: {
|
|
4
|
+
model: {
|
|
5
|
+
canDisplayLabels: boolean;
|
|
6
|
+
rowHeight: number;
|
|
7
|
+
sources?: Source[];
|
|
8
|
+
};
|
|
9
|
+
labelWidth: number;
|
|
10
|
+
}) => React.JSX.Element | null;
|
|
11
|
+
export default ColorLegend;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const util_1 = require("@jbrowse/core/util");
|
|
8
|
+
const mobx_react_1 = require("mobx-react");
|
|
9
|
+
const RectBg_1 = __importDefault(require("./RectBg"));
|
|
10
|
+
const ColorLegend = (0, mobx_react_1.observer)(function ({ model, labelWidth, }) {
|
|
11
|
+
const { canDisplayLabels, rowHeight, sources } = model;
|
|
12
|
+
const svgFontSize = (0, util_1.clamp)(rowHeight, 8, 12);
|
|
13
|
+
const colorBoxWidth = 15;
|
|
14
|
+
const legendWidth = labelWidth + colorBoxWidth + 5;
|
|
15
|
+
return sources ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
16
|
+
canDisplayLabels ? (react_1.default.createElement(RectBg_1.default, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null,
|
|
17
|
+
sources.map((source, idx) => {
|
|
18
|
+
const { color, name } = source;
|
|
19
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: `${name}-${idx}` },
|
|
20
|
+
color ? (react_1.default.createElement(RectBg_1.default, { y: idx * rowHeight + 1, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null,
|
|
21
|
+
canDisplayLabels ? (react_1.default.createElement("text", { y: idx * rowHeight + svgFontSize, x: colorBoxWidth + 2, fontSize: svgFontSize }, name)) : null));
|
|
22
|
+
}))) : null;
|
|
23
|
+
});
|
|
24
|
+
exports.default = ColorLegend;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
31
|
+
const material_1 = require("@mui/material");
|
|
32
|
+
const mobx_react_1 = require("mobx-react");
|
|
33
|
+
const react_draggable_1 = __importDefault(require("react-draggable"));
|
|
34
|
+
const mui_1 = require("tss-react/mui");
|
|
35
|
+
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
36
|
+
closeButton: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
right: theme.spacing(1),
|
|
39
|
+
top: theme.spacing(1),
|
|
40
|
+
color: theme.palette.grey[500],
|
|
41
|
+
},
|
|
42
|
+
}));
|
|
43
|
+
function PaperComponent(props) {
|
|
44
|
+
const ref = (0, react_1.useRef)(null);
|
|
45
|
+
return (react_1.default.createElement(react_draggable_1.default, { nodeRef: ref, cancel: '[class*="MuiDialogContent-root"]', onStart: arg => { var _a, _b; return (_b = (_a = arg.target) === null || _a === void 0 ? void 0 : _a.className) === null || _b === void 0 ? void 0 : _b.includes('MuiDialogTitle'); } },
|
|
46
|
+
react_1.default.createElement(material_1.Paper, { ref: ref, ...props })));
|
|
47
|
+
}
|
|
48
|
+
const DraggableDialog = (0, mobx_react_1.observer)(function DraggableDialog(props) {
|
|
49
|
+
const { classes } = useStyles();
|
|
50
|
+
const { title, children, onClose } = props;
|
|
51
|
+
return (react_1.default.createElement(material_1.Dialog, { ...props, PaperComponent: PaperComponent },
|
|
52
|
+
react_1.default.createElement(material_1.ScopedCssBaseline, null,
|
|
53
|
+
react_1.default.createElement(material_1.DialogTitle, { style: { cursor: 'move' } },
|
|
54
|
+
title,
|
|
55
|
+
onClose ? (react_1.default.createElement(material_1.IconButton, { className: classes.closeButton, onClick: () => {
|
|
56
|
+
onClose();
|
|
57
|
+
} },
|
|
58
|
+
react_1.default.createElement(Close_1.default, null))) : null),
|
|
59
|
+
react_1.default.createElement(material_1.Divider, null),
|
|
60
|
+
children)));
|
|
61
|
+
});
|
|
62
|
+
exports.default = DraggableDialog;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Source } from '../util';
|
|
3
|
+
interface ReducedModel {
|
|
4
|
+
scrollTop: number;
|
|
5
|
+
totalHeight: number;
|
|
6
|
+
rowHeight: number;
|
|
7
|
+
lineZoneHeight?: number;
|
|
8
|
+
sources?: Source[];
|
|
9
|
+
canDisplayLabels: boolean;
|
|
10
|
+
height: number;
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const LegendBar: (props: {
|
|
14
|
+
model: ReducedModel;
|
|
15
|
+
orientation?: string;
|
|
16
|
+
exportSVG?: boolean;
|
|
17
|
+
}) => React.JSX.Element | null;
|
|
18
|
+
export default LegendBar;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LegendBar = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const util_1 = require("@jbrowse/core/util");
|
|
9
|
+
const mobx_react_1 = require("mobx-react");
|
|
10
|
+
const ColorLegend_1 = __importDefault(require("./ColorLegend"));
|
|
11
|
+
const Wrapper = (0, mobx_react_1.observer)(function ({ children, model, exportSVG, }) {
|
|
12
|
+
const { id, scrollTop, height } = model;
|
|
13
|
+
const clipid = `legend-${id}`;
|
|
14
|
+
return exportSVG ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
|
+
react_1.default.createElement("defs", null,
|
|
16
|
+
react_1.default.createElement("clipPath", { id: clipid },
|
|
17
|
+
react_1.default.createElement("rect", { x: 0, y: 0, width: 1000, height: height }))),
|
|
18
|
+
react_1.default.createElement("g", { clipPath: `url(#${clipid})` },
|
|
19
|
+
react_1.default.createElement("g", { transform: `translate(0,${-scrollTop})` }, children)))) : (react_1.default.createElement("svg", { style: {
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0,
|
|
23
|
+
zIndex: 100,
|
|
24
|
+
pointerEvents: 'none',
|
|
25
|
+
height: model.totalHeight,
|
|
26
|
+
width: (0, util_1.getContainingView)(model).width,
|
|
27
|
+
} }, children));
|
|
28
|
+
});
|
|
29
|
+
exports.LegendBar = (0, mobx_react_1.observer)(function (props) {
|
|
30
|
+
const { model } = props;
|
|
31
|
+
const { canDisplayLabels, rowHeight, sources } = model;
|
|
32
|
+
const svgFontSize = (0, util_1.clamp)(rowHeight, 8, 12);
|
|
33
|
+
return sources ? (react_1.default.createElement(Wrapper, { ...props },
|
|
34
|
+
react_1.default.createElement(ColorLegend_1.default, { model: model, labelWidth: Math.max(...sources
|
|
35
|
+
.map(s => (0, util_1.measureText)(s.name, svgFontSize) + 10)
|
|
36
|
+
.map(width => (canDisplayLabels ? width : 20))) }))) : null;
|
|
37
|
+
});
|
|
38
|
+
exports.default = exports.LegendBar;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const material_1 = require("@mui/material");
|
|
28
|
+
const mobx_react_1 = require("mobx-react");
|
|
29
|
+
const mui_1 = require("tss-react/mui");
|
|
30
|
+
const useStyles = (0, mui_1.makeStyles)()({
|
|
31
|
+
root: {
|
|
32
|
+
width: 500,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
const MAFFilterDialog = (0, mobx_react_1.observer)(function ({ model, handleClose, }) {
|
|
36
|
+
const { mafFilter = '' } = model;
|
|
37
|
+
const { classes } = useStyles();
|
|
38
|
+
const [maf, setMaf] = (0, react_1.useState)(`${mafFilter}`);
|
|
39
|
+
return (react_1.default.createElement(material_1.Dialog, { open: true, onClose: handleClose, title: "Set minor allele frequency (MAF)" },
|
|
40
|
+
react_1.default.createElement(material_1.DialogContent, { className: classes.root },
|
|
41
|
+
react_1.default.createElement(material_1.Typography, null, "Set minor allele frequency cutoff track. This will filter out rare variants that might not contribute to meaningful large scale patterns"),
|
|
42
|
+
react_1.default.createElement(material_1.TextField, { value: maf, autoFocus: true, placeholder: "Enter MAF", onChange: event => {
|
|
43
|
+
setMaf(event.target.value);
|
|
44
|
+
} }),
|
|
45
|
+
react_1.default.createElement(material_1.DialogActions, null,
|
|
46
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, onClick: () => {
|
|
47
|
+
if (!Number.isNaN(+maf)) {
|
|
48
|
+
model.setMafFilter(+maf);
|
|
49
|
+
}
|
|
50
|
+
handleClose();
|
|
51
|
+
} }, "Submit"),
|
|
52
|
+
react_1.default.createElement(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
53
|
+
handleClose();
|
|
54
|
+
} }, "Cancel")))));
|
|
55
|
+
});
|
|
56
|
+
exports.default = MAFFilterDialog;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const util_1 = require("@jbrowse/core/util");
|
|
8
|
+
const RectBg = (props) => {
|
|
9
|
+
const { color = 'rgb(255,255,255)' } = props;
|
|
10
|
+
return react_1.default.createElement("rect", { pointerEvents: "auto", ...props, ...(0, util_1.getFillProps)(color) });
|
|
11
|
+
};
|
|
12
|
+
exports.default = RectBg;
|