@jbrowse/plugin-variants 2.16.1 → 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 +3 -3
- 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 +7 -12
- 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 +3 -3
- 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 +9 -14
- 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
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter, BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
3
|
-
import { Feature } from '@jbrowse/core/util';
|
|
4
1
|
import { TabixIndexedFile } from '@gmod/tabix';
|
|
5
2
|
import VcfParser from '@gmod/vcf';
|
|
3
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
+
import type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
5
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
6
|
+
import type { NoAssemblyRegion } from '@jbrowse/core/util/types';
|
|
6
7
|
export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
7
8
|
private configured?;
|
|
8
9
|
private configurePre;
|
|
@@ -14,5 +15,8 @@ export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
14
15
|
getHeader(): Promise<string>;
|
|
15
16
|
getMetadata(): Promise<any>;
|
|
16
17
|
getFeatures(query: NoAssemblyRegion, opts?: BaseOptions): import("rxjs").Observable<Feature>;
|
|
18
|
+
getSources(): Promise<{
|
|
19
|
+
name: string;
|
|
20
|
+
}[]>;
|
|
17
21
|
freeResources(): void;
|
|
18
22
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter, } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { openLocation } from '@jbrowse/core/util/io';
|
|
3
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
4
1
|
import { TabixIndexedFile } from '@gmod/tabix';
|
|
5
2
|
import VcfParser from '@gmod/vcf';
|
|
6
|
-
|
|
3
|
+
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
4
|
+
import { openLocation } from '@jbrowse/core/util/io';
|
|
5
|
+
import { ObservableCreate } from '@jbrowse/core/util/rxjs';
|
|
7
6
|
import VcfFeature from '../VcfFeature';
|
|
8
7
|
export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
9
8
|
async configurePre() {
|
|
@@ -61,7 +60,13 @@ export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
|
|
|
61
60
|
...opts,
|
|
62
61
|
});
|
|
63
62
|
observer.complete();
|
|
64
|
-
}, opts.
|
|
63
|
+
}, opts.stopToken);
|
|
64
|
+
}
|
|
65
|
+
async getSources() {
|
|
66
|
+
const { parser } = await this.configure();
|
|
67
|
+
return parser.samples.map(name => ({
|
|
68
|
+
name,
|
|
69
|
+
}));
|
|
65
70
|
}
|
|
66
|
-
freeResources(
|
|
71
|
+
freeResources() { }
|
|
67
72
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
vcfGzLocation: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: {
|
|
@@ -10,17 +7,11 @@ declare const VcfTabixAdapter: import("@jbrowse/core/configuration/configuration
|
|
|
10
7
|
};
|
|
11
8
|
};
|
|
12
9
|
index: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
13
|
-
/**
|
|
14
|
-
* #slot index.indexType
|
|
15
|
-
*/
|
|
16
10
|
indexType: {
|
|
17
11
|
model: import("mobx-state-tree").ISimpleType<string>;
|
|
18
12
|
type: string;
|
|
19
13
|
defaultValue: string;
|
|
20
14
|
};
|
|
21
|
-
/**
|
|
22
|
-
* #slot index.location
|
|
23
|
-
*/
|
|
24
15
|
location: {
|
|
25
16
|
type: string;
|
|
26
17
|
defaultValue: {
|
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree';
|
|
2
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
2
|
+
import { types } from 'mobx-state-tree';
|
|
3
|
+
function x() { }
|
|
7
4
|
const VcfTabixAdapter = ConfigurationSchema('VcfTabixAdapter', {
|
|
8
|
-
/**
|
|
9
|
-
* #slot
|
|
10
|
-
*/
|
|
11
5
|
vcfGzLocation: {
|
|
12
6
|
type: 'fileLocation',
|
|
13
7
|
defaultValue: { uri: '/path/to/my.vcf.gz', locationType: 'UriLocation' },
|
|
14
8
|
},
|
|
15
9
|
index: ConfigurationSchema('VcfIndex', {
|
|
16
|
-
/**
|
|
17
|
-
* #slot index.indexType
|
|
18
|
-
*/
|
|
19
10
|
indexType: {
|
|
20
11
|
model: types.enumeration('IndexType', ['TBI', 'CSI']),
|
|
21
12
|
type: 'stringEnum',
|
|
22
13
|
defaultValue: 'TBI',
|
|
23
14
|
},
|
|
24
|
-
/**
|
|
25
|
-
* #slot index.location
|
|
26
|
-
*/
|
|
27
15
|
location: {
|
|
28
16
|
type: 'fileLocation',
|
|
29
17
|
defaultValue: {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const WiggleRenderer: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
+
color: {
|
|
3
|
+
type: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultValue: string;
|
|
6
|
+
};
|
|
7
|
+
posColor: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultValue: string;
|
|
11
|
+
};
|
|
12
|
+
negColor: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultValue: string;
|
|
16
|
+
};
|
|
17
|
+
clipColor: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
defaultValue: string;
|
|
21
|
+
};
|
|
22
|
+
bicolorPivot: {
|
|
23
|
+
type: string;
|
|
24
|
+
model: import("mobx-state-tree").ISimpleType<string>;
|
|
25
|
+
description: string;
|
|
26
|
+
defaultValue: string;
|
|
27
|
+
};
|
|
28
|
+
bicolorPivotValue: {
|
|
29
|
+
type: string;
|
|
30
|
+
defaultValue: number;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
34
|
+
export default WiggleRenderer;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
+
import { types } from 'mobx-state-tree';
|
|
3
|
+
function x() { }
|
|
4
|
+
const WiggleRenderer = ConfigurationSchema('WiggleRenderer', {
|
|
5
|
+
color: {
|
|
6
|
+
type: 'color',
|
|
7
|
+
description: 'the color of track, overrides posColor and negColor',
|
|
8
|
+
defaultValue: '#f0f',
|
|
9
|
+
},
|
|
10
|
+
posColor: {
|
|
11
|
+
type: 'color',
|
|
12
|
+
description: 'the color to use when the score is positive',
|
|
13
|
+
defaultValue: 'blue',
|
|
14
|
+
},
|
|
15
|
+
negColor: {
|
|
16
|
+
type: 'color',
|
|
17
|
+
description: 'the color to use when the score is negative',
|
|
18
|
+
defaultValue: 'red',
|
|
19
|
+
},
|
|
20
|
+
clipColor: {
|
|
21
|
+
type: 'color',
|
|
22
|
+
description: 'the color of the clipping marker',
|
|
23
|
+
defaultValue: 'red',
|
|
24
|
+
},
|
|
25
|
+
bicolorPivot: {
|
|
26
|
+
type: 'stringEnum',
|
|
27
|
+
model: types.enumeration('Scale type', [
|
|
28
|
+
'numeric',
|
|
29
|
+
'mean',
|
|
30
|
+
'z_score',
|
|
31
|
+
'none',
|
|
32
|
+
]),
|
|
33
|
+
description: 'type of bicolor pivot',
|
|
34
|
+
defaultValue: 'numeric',
|
|
35
|
+
},
|
|
36
|
+
bicolorPivotValue: {
|
|
37
|
+
type: 'number',
|
|
38
|
+
defaultValue: 0,
|
|
39
|
+
description: 'value to use for bicolor pivot',
|
|
40
|
+
},
|
|
41
|
+
}, { explicitlyTyped: true });
|
|
42
|
+
export default WiggleRenderer;
|
package/esm/extensionPoints.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function ExtensionPointsF(pluginManager: PluginManager): void;
|
package/esm/extensionPoints.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeIndex, makeIndexType,
|
|
1
|
+
import { getFileName, makeIndex, makeIndexType, } from '@jbrowse/core/util/tracks';
|
|
2
2
|
export default function ExtensionPointsF(pluginManager) {
|
|
3
3
|
pluginManager.addToExtensionPoint('Core-guessAdapterForLocation', (adapterGuesser) => {
|
|
4
4
|
return (file, index, adapterHint) => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
3
|
+
export interface Source {
|
|
4
|
+
name: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
group?: string;
|
|
7
|
+
[key: string]: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function getMultiVariantFeaturesAutorun(self: {
|
|
10
|
+
configuration: AnyConfigurationModel;
|
|
11
|
+
adapterConfig: AnyConfigurationModel;
|
|
12
|
+
sources?: Source[];
|
|
13
|
+
mafFilter: number;
|
|
14
|
+
statsReadyAndRegionNotTooLarge: boolean;
|
|
15
|
+
adapterProps: () => Record<string, unknown>;
|
|
16
|
+
setError: (error: unknown) => void;
|
|
17
|
+
setFeatures: (f: Feature[]) => void;
|
|
18
|
+
setMessage: (str: string) => void;
|
|
19
|
+
}): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SimpleFeature, getContainingView, getSession, } from '@jbrowse/core/util';
|
|
2
|
+
import { isAbortException } from '@jbrowse/core/util/aborting';
|
|
3
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
4
|
+
import { autorun } from 'mobx';
|
|
5
|
+
import { addDisposer, isAlive } from 'mobx-state-tree';
|
|
6
|
+
export function getMultiVariantFeaturesAutorun(self) {
|
|
7
|
+
addDisposer(self, autorun(async () => {
|
|
8
|
+
try {
|
|
9
|
+
const view = getContainingView(self);
|
|
10
|
+
if (!view.initialized || !self.statsReadyAndRegionNotTooLarge) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const { rpcManager } = getSession(self);
|
|
14
|
+
const { sources, mafFilter, adapterConfig } = self;
|
|
15
|
+
if (!sources) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const sessionId = getRpcSessionId(self);
|
|
19
|
+
const features = (await rpcManager.call(sessionId, 'MultiVariantGetSimplifiedFeatures', {
|
|
20
|
+
regions: view.dynamicBlocks.contentBlocks,
|
|
21
|
+
sources,
|
|
22
|
+
mafFilter,
|
|
23
|
+
sessionId,
|
|
24
|
+
adapterConfig,
|
|
25
|
+
}));
|
|
26
|
+
if (isAlive(self)) {
|
|
27
|
+
self.setFeatures(features.map(f => new SimpleFeature(f)));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
if (!isAbortException(e) && isAlive(self)) {
|
|
32
|
+
console.error(e);
|
|
33
|
+
getSession(self).notifyError(`${e}`, e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, { delay: 1000 }));
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
+
export interface Source {
|
|
3
|
+
name: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
group?: string;
|
|
6
|
+
[key: string]: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function getMultiVariantSourcesAutorun(self: {
|
|
9
|
+
configuration: AnyConfigurationModel;
|
|
10
|
+
adapterConfig: AnyConfigurationModel;
|
|
11
|
+
adapterProps: () => Record<string, unknown>;
|
|
12
|
+
setSourcesLoading: (aborter: string) => void;
|
|
13
|
+
setError: (error: unknown) => void;
|
|
14
|
+
setMessage: (str: string) => void;
|
|
15
|
+
setSources: (sources: Source[]) => void;
|
|
16
|
+
}): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
2
|
+
import { isAbortException } from '@jbrowse/core/util/aborting';
|
|
3
|
+
import { createStopToken } from '@jbrowse/core/util/stopToken';
|
|
4
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
5
|
+
import { autorun } from 'mobx';
|
|
6
|
+
import { addDisposer, isAlive } from 'mobx-state-tree';
|
|
7
|
+
export function getMultiVariantSourcesAutorun(self) {
|
|
8
|
+
addDisposer(self, autorun(async () => {
|
|
9
|
+
try {
|
|
10
|
+
const view = getContainingView(self);
|
|
11
|
+
if (!view.initialized) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const { rpcManager } = getSession(self);
|
|
15
|
+
const { adapterConfig } = self;
|
|
16
|
+
const token = createStopToken();
|
|
17
|
+
self.setSourcesLoading(token);
|
|
18
|
+
const sessionId = getRpcSessionId(self);
|
|
19
|
+
const sources = (await rpcManager.call(sessionId, 'MultiVariantGetSources', {
|
|
20
|
+
sessionId,
|
|
21
|
+
adapterConfig,
|
|
22
|
+
}));
|
|
23
|
+
if (isAlive(self)) {
|
|
24
|
+
self.setSources(sources);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
if (!isAbortException(e) && isAlive(self)) {
|
|
29
|
+
console.error(e);
|
|
30
|
+
getSession(self).notifyError(`${e}`, e);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}, { delay: 1000 }));
|
|
34
|
+
}
|
package/esm/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/esm/index.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import VcfAdapterF from './VcfAdapter';
|
|
2
|
-
import VcfTabixAdapterF from './VcfTabixAdapter';
|
|
3
|
-
import ExtensionPointsF from './extensionPoints';
|
|
4
|
-
import VariantTrackF from './VariantTrack';
|
|
5
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
6
2
|
import ChordVariantDisplayF from './ChordVariantDisplay';
|
|
7
3
|
import LinearVariantDisplayF from './LinearVariantDisplay';
|
|
4
|
+
import MultiLinearVariantDisplayF from './MultiLinearVariantDisplay';
|
|
5
|
+
import LinearVariantMatrixDisplayF from './MultiLinearVariantMatrixDisplay';
|
|
6
|
+
import LinearVariantMatrixRendererF from './MultiLinearVariantMatrixRenderer';
|
|
7
|
+
import MultiVariantRendererF from './MultiLinearVariantRenderer';
|
|
8
8
|
import StructuralVariantChordRendererF from './StructuralVariantChordRenderer';
|
|
9
9
|
import VariantFeatureWidgetF from './VariantFeatureWidget';
|
|
10
|
+
import { MultiVariantGetGenotypeMatrix } from './VariantRPC/MultiVariantGetGenotypeMatrix';
|
|
11
|
+
import { MultiVariantGetSimplifiedFeatures } from './VariantRPC/MultiVariantGetSimplifiedFeatures';
|
|
12
|
+
import { MultiVariantGetSources } from './VariantRPC/MultiVariantGetSources';
|
|
13
|
+
import VariantTrackF from './VariantTrack';
|
|
14
|
+
import VcfAdapterF from './VcfAdapter';
|
|
15
|
+
import VcfTabixAdapterF from './VcfTabixAdapter';
|
|
16
|
+
import ExtensionPointsF from './extensionPoints';
|
|
10
17
|
export default class VariantsPlugin extends Plugin {
|
|
11
18
|
constructor() {
|
|
12
19
|
super(...arguments);
|
|
@@ -19,8 +26,15 @@ export default class VariantsPlugin extends Plugin {
|
|
|
19
26
|
VariantTrackF(pluginManager);
|
|
20
27
|
ExtensionPointsF(pluginManager);
|
|
21
28
|
LinearVariantDisplayF(pluginManager);
|
|
29
|
+
LinearVariantMatrixDisplayF(pluginManager);
|
|
30
|
+
MultiLinearVariantDisplayF(pluginManager);
|
|
31
|
+
MultiVariantRendererF(pluginManager);
|
|
32
|
+
LinearVariantMatrixRendererF(pluginManager);
|
|
22
33
|
StructuralVariantChordRendererF(pluginManager);
|
|
23
34
|
ChordVariantDisplayF(pluginManager);
|
|
35
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetSources(pluginManager));
|
|
36
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetGenotypeMatrix(pluginManager));
|
|
37
|
+
pluginManager.addRpcMethod(() => new MultiVariantGetSimplifiedFeatures(pluginManager));
|
|
24
38
|
}
|
|
25
39
|
}
|
|
26
40
|
export { default as VcfFeature } from './VcfFeature';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { ErrorMessage } from '@jbrowse/core/ui';
|
|
3
|
+
import { Button, TextField, Typography } from '@mui/material';
|
|
4
|
+
import { makeStyles } from 'tss-react/mui';
|
|
5
|
+
const useStyles = makeStyles()({
|
|
6
|
+
textAreaFont: {
|
|
7
|
+
fontFamily: 'Courier New',
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
export default function BulkEditPanel({ setCurrLayout, currLayout, }) {
|
|
11
|
+
const { classes } = useStyles();
|
|
12
|
+
const [val, setVal] = useState('');
|
|
13
|
+
const [error, setError] = useState();
|
|
14
|
+
return (React.createElement("div", null,
|
|
15
|
+
React.createElement(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."),
|
|
16
|
+
React.createElement(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 => {
|
|
17
|
+
setVal(event.target.value);
|
|
18
|
+
}, slotProps: {
|
|
19
|
+
input: {
|
|
20
|
+
classes: {
|
|
21
|
+
input: classes.textAreaFont,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
} }),
|
|
25
|
+
React.createElement(Button, { variant: "contained", onClick: () => {
|
|
26
|
+
const lines = val
|
|
27
|
+
.split('\n')
|
|
28
|
+
.map(f => f.trim())
|
|
29
|
+
.filter(f => !!f);
|
|
30
|
+
const fields = lines[0].split(/[,\t]/gm);
|
|
31
|
+
if (fields.includes('name')) {
|
|
32
|
+
setError('');
|
|
33
|
+
const oldLayout = currLayout.map(record => [record.name, record]);
|
|
34
|
+
const newData = Object.fromEntries(lines.slice(1).map(line => {
|
|
35
|
+
const cols = line.split(/[,\t]/gm);
|
|
36
|
+
const newRecord = Object.fromEntries(cols.map((col, idx) => [fields[idx], col]));
|
|
37
|
+
return [
|
|
38
|
+
newRecord.name,
|
|
39
|
+
{ ...newRecord, ...oldLayout[newRecord.name] },
|
|
40
|
+
];
|
|
41
|
+
}));
|
|
42
|
+
setCurrLayout(currLayout.map(record => ({
|
|
43
|
+
...record,
|
|
44
|
+
...newData[record.name],
|
|
45
|
+
})));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
setError(new Error('No "name" column found on line 1'));
|
|
49
|
+
}
|
|
50
|
+
} }, "Update rows"),
|
|
51
|
+
React.createElement(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
|
+
...newData[record.name],
|
|
70
|
+
})));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
setError(new Error('No "name" column found on line 1'));
|
|
74
|
+
}
|
|
75
|
+
} }, "Replace rows"),
|
|
76
|
+
error ? React.createElement(ErrorMessage, { error: error }) : null));
|
|
77
|
+
}
|
|
@@ -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,121 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
|
|
3
|
+
import { getContainingView, getSession, isAbortException, } from '@jbrowse/core/util';
|
|
4
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
5
|
+
import { Button, DialogActions, DialogContent, TextField, Typography, } from '@mui/material';
|
|
6
|
+
import copy from 'copy-to-clipboard';
|
|
7
|
+
import { saveAs } from 'file-saver';
|
|
8
|
+
import { isAlive } from 'mobx-state-tree';
|
|
9
|
+
import { makeStyles } from 'tss-react/mui';
|
|
10
|
+
const useStyles = makeStyles()(theme => ({
|
|
11
|
+
textAreaFont: {
|
|
12
|
+
fontFamily: 'Courier New',
|
|
13
|
+
},
|
|
14
|
+
mgap: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
gap: theme.spacing(4),
|
|
18
|
+
},
|
|
19
|
+
}));
|
|
20
|
+
export default function HierarchicalCluster({ model, handleClose, }) {
|
|
21
|
+
const { classes } = useStyles();
|
|
22
|
+
const [results, setResults] = useState();
|
|
23
|
+
const [error, setError] = useState();
|
|
24
|
+
const [paste, setPaste] = useState('');
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
;
|
|
27
|
+
(async () => {
|
|
28
|
+
try {
|
|
29
|
+
setError(undefined);
|
|
30
|
+
const view = getContainingView(model);
|
|
31
|
+
if (!view.initialized) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const { rpcManager } = getSession(model);
|
|
35
|
+
const { sources, mafFilter, adapterConfig } = model;
|
|
36
|
+
const sessionId = getRpcSessionId(model);
|
|
37
|
+
const ret = (await rpcManager.call(sessionId, 'MultiVariantGetGenotypeMatrix', {
|
|
38
|
+
regions: view.dynamicBlocks.contentBlocks,
|
|
39
|
+
sources,
|
|
40
|
+
mafFilter,
|
|
41
|
+
sessionId,
|
|
42
|
+
adapterConfig,
|
|
43
|
+
}));
|
|
44
|
+
const entries = Object.values(ret);
|
|
45
|
+
const keys = Object.keys(ret);
|
|
46
|
+
const text = `try(library(fastcluster), silent=TRUE)
|
|
47
|
+
inputMatrix<-matrix(c(${entries.map(val => val.genotypes.join(',')).join(',\n')}
|
|
48
|
+
),nrow=${entries.length},byrow=TRUE)
|
|
49
|
+
rownames(inputMatrix)<-c(${keys.map(key => `'${key}'`).join(',')})
|
|
50
|
+
resultClusters<-hclust(dist(inputMatrix), method='single')
|
|
51
|
+
cat(resultClusters$order,sep='\\n')`;
|
|
52
|
+
setResults(text);
|
|
53
|
+
}
|
|
54
|
+
catch (e) {
|
|
55
|
+
if (!isAbortException(e) && isAlive(model)) {
|
|
56
|
+
console.error(e);
|
|
57
|
+
setError(e);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})();
|
|
61
|
+
}, [model]);
|
|
62
|
+
return (React.createElement(Dialog, { open: true, title: "Cluster by genotype", onClose: handleClose },
|
|
63
|
+
React.createElement(DialogContent, null,
|
|
64
|
+
React.createElement("div", { className: classes.mgap },
|
|
65
|
+
React.createElement(Typography, null, "This page will produce an R script that will perform hierarchical clustering on the visible genotype data using `hclust`."),
|
|
66
|
+
React.createElement(Typography, null, "You can then paste the results in this form to specify the row ordering."),
|
|
67
|
+
results ? (React.createElement("div", null,
|
|
68
|
+
React.createElement("div", null,
|
|
69
|
+
"Step 1:",
|
|
70
|
+
' ',
|
|
71
|
+
React.createElement(Button, { variant: "contained", onClick: () => {
|
|
72
|
+
saveAs(new Blob([results || ''], {
|
|
73
|
+
type: 'text/plain;charset=utf-8',
|
|
74
|
+
}), 'cluster.R');
|
|
75
|
+
} }, "Download Rscript"),
|
|
76
|
+
' ',
|
|
77
|
+
"or",
|
|
78
|
+
' ',
|
|
79
|
+
React.createElement(Button, { variant: "contained", onClick: () => {
|
|
80
|
+
copy(results || '');
|
|
81
|
+
} }, "Copy Rscript to clipboard"),
|
|
82
|
+
React.createElement("div", null,
|
|
83
|
+
React.createElement(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 => {
|
|
84
|
+
setPaste(event.target.value);
|
|
85
|
+
}, slotProps: {
|
|
86
|
+
input: {
|
|
87
|
+
classes: {
|
|
88
|
+
input: classes.textAreaFont,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
} }))))) : (React.createElement(LoadingEllipses, { variant: "h6", title: "Generating genotype matrix" })),
|
|
92
|
+
error ? React.createElement(ErrorMessage, { error: error }) : null)),
|
|
93
|
+
React.createElement(DialogActions, null,
|
|
94
|
+
React.createElement(Button, { disabled: !results, variant: "contained", onClick: () => {
|
|
95
|
+
const { sources } = model;
|
|
96
|
+
if (sources) {
|
|
97
|
+
try {
|
|
98
|
+
model.setLayout(paste
|
|
99
|
+
.split('\n')
|
|
100
|
+
.map(t => t.trim())
|
|
101
|
+
.filter(f => !!f)
|
|
102
|
+
.map(r => +r)
|
|
103
|
+
.map(idx => {
|
|
104
|
+
const ret = sources[idx - 1];
|
|
105
|
+
if (!ret) {
|
|
106
|
+
throw new Error(`out of bounds at ${idx}`);
|
|
107
|
+
}
|
|
108
|
+
return ret;
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
console.error(e);
|
|
113
|
+
setError(e);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
handleClose();
|
|
117
|
+
} }, "Apply clustering"),
|
|
118
|
+
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
119
|
+
handleClose();
|
|
120
|
+
} }, "Cancel"))));
|
|
121
|
+
}
|
|
@@ -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,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { clamp } from '@jbrowse/core/util';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import RectBg from './RectBg';
|
|
5
|
+
const ColorLegend = observer(function ({ model, labelWidth, }) {
|
|
6
|
+
const { canDisplayLabels, rowHeight, sources } = model;
|
|
7
|
+
const svgFontSize = clamp(rowHeight, 8, 12);
|
|
8
|
+
const colorBoxWidth = 15;
|
|
9
|
+
const legendWidth = labelWidth + colorBoxWidth + 5;
|
|
10
|
+
return sources ? (React.createElement(React.Fragment, null,
|
|
11
|
+
canDisplayLabels ? (React.createElement(RectBg, { y: 0, x: 0, width: legendWidth, height: (sources.length + 0.25) * rowHeight })) : null,
|
|
12
|
+
sources.map((source, idx) => {
|
|
13
|
+
const { color, name } = source;
|
|
14
|
+
return (React.createElement(React.Fragment, { key: `${name}-${idx}` },
|
|
15
|
+
color ? (React.createElement(RectBg, { y: idx * rowHeight + 1, x: 0, width: colorBoxWidth + 0.5, height: rowHeight + 0.5, color: color })) : null,
|
|
16
|
+
canDisplayLabels ? (React.createElement("text", { y: idx * rowHeight + svgFontSize, x: colorBoxWidth + 2, fontSize: svgFontSize }, name)) : null));
|
|
17
|
+
}))) : null;
|
|
18
|
+
});
|
|
19
|
+
export default ColorLegend;
|