@jbrowse/plugin-wiggle 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/BigWigAdapter/BigWigAdapter.d.ts +4 -3
- package/dist/BigWigAdapter/BigWigAdapter.js +3 -8
- package/dist/BigWigAdapter/configSchema.d.ts +0 -9
- package/dist/BigWigAdapter/configSchema.js +1 -13
- package/dist/BigWigAdapter/index.d.ts +1 -1
- package/dist/CreateMultiWiggleExtension/ConfirmDialog.d.ts +1 -1
- package/dist/CreateMultiWiggleExtension/ConfirmDialog.js +2 -2
- package/dist/CreateMultiWiggleExtension/index.d.ts +1 -1
- package/dist/CreateMultiWiggleExtension/index.js +26 -26
- package/dist/DensityRenderer/DensityRenderer.d.ts +2 -1
- package/dist/DensityRenderer/DensityRenderer.js +1 -1
- package/dist/DensityRenderer/configSchema.js +1 -7
- package/dist/DensityRenderer/index.d.ts +1 -1
- package/dist/DensityRenderer/index.js +1 -1
- package/dist/LinePlotRenderer/LinePlotRenderer.d.ts +3 -2
- package/dist/LinePlotRenderer/LinePlotRenderer.js +1 -1
- package/dist/LinePlotRenderer/configSchema.d.ts +0 -3
- package/dist/LinePlotRenderer/configSchema.js +1 -10
- package/dist/LinePlotRenderer/index.d.ts +1 -1
- package/dist/LinearWiggleDisplay/components/SetColorDialog.js +2 -2
- package/dist/LinearWiggleDisplay/components/Tooltip.d.ts +2 -2
- package/dist/LinearWiggleDisplay/components/Tooltip.js +1 -2
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js +2 -2
- package/dist/LinearWiggleDisplay/{models/configSchema.d.ts → configSchema.d.ts} +1 -12
- package/dist/LinearWiggleDisplay/{models/configSchema.js → configSchema.js} +2 -17
- package/dist/LinearWiggleDisplay/index.d.ts +2 -2
- package/dist/LinearWiggleDisplay/index.js +4 -4
- package/{esm/LinearWiggleDisplay/models → dist/LinearWiggleDisplay}/model.d.ts +21 -63
- package/dist/LinearWiggleDisplay/{models/model.js → model.js} +66 -80
- package/dist/LinearWiggleDisplay/{models/renderSvg.d.ts → renderSvg.d.ts} +2 -2
- package/dist/LinearWiggleDisplay/{models/renderSvg.js → renderSvg.js} +2 -2
- package/dist/MultiDensityRenderer/MultiDensityRenderer.d.ts +4 -3
- package/dist/MultiDensityRenderer/MultiDensityRenderer.js +2 -3
- package/dist/MultiDensityRenderer/configSchema.js +1 -7
- package/dist/MultiDensityRenderer/index.d.ts +1 -1
- package/dist/MultiLineRenderer/MultiLineRenderer.d.ts +3 -2
- package/dist/MultiLineRenderer/MultiLineRenderer.js +1 -2
- package/dist/MultiLineRenderer/configSchema.d.ts +0 -6
- package/dist/MultiLineRenderer/configSchema.js +1 -13
- package/dist/MultiLineRenderer/index.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/ColorLegend.js +0 -1
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/DraggableDialog.js +3 -7
- package/dist/MultiLinearWiggleDisplay/components/RectBg.js +1 -1
- package/dist/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/SetColorDialog.js +3 -5
- package/dist/MultiLinearWiggleDisplay/components/SourcesGrid.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/SourcesGrid.js +15 -26
- package/dist/MultiLinearWiggleDisplay/components/Tooltip.d.ts +3 -3
- package/dist/MultiLinearWiggleDisplay/components/Tooltip.js +1 -2
- package/dist/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/YScaleBars.js +1 -1
- package/dist/MultiLinearWiggleDisplay/components/util.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/components/util.js +1 -1
- package/dist/MultiLinearWiggleDisplay/{models/configSchema.d.ts → configSchema.d.ts} +1 -10
- package/dist/MultiLinearWiggleDisplay/{models/configSchema.js → configSchema.js} +3 -21
- package/dist/MultiLinearWiggleDisplay/index.d.ts +1 -1
- package/dist/MultiLinearWiggleDisplay/index.js +3 -3
- package/dist/MultiLinearWiggleDisplay/{models/model.d.ts → model.d.ts} +25 -129
- package/dist/MultiLinearWiggleDisplay/{models/model.js → model.js} +108 -183
- package/dist/MultiLinearWiggleDisplay/{models/renderSvg.d.ts → renderSvg.d.ts} +2 -2
- package/dist/MultiLinearWiggleDisplay/{models/renderSvg.js → renderSvg.js} +2 -2
- package/dist/MultiQuantitativeTrack/configSchema.d.ts +1 -1
- package/dist/MultiQuantitativeTrack/configSchema.js +1 -7
- package/dist/MultiQuantitativeTrack/index.d.ts +1 -1
- package/dist/MultiQuantitativeTrack/index.js +1 -1
- package/dist/MultiRowLineRenderer/MultiRowLineRenderer.d.ts +3 -2
- package/dist/MultiRowLineRenderer/MultiRowLineRenderer.js +1 -2
- package/dist/MultiRowLineRenderer/configSchema.d.ts +0 -6
- package/dist/MultiRowLineRenderer/configSchema.js +2 -14
- package/dist/MultiRowLineRenderer/index.d.ts +1 -1
- package/dist/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.d.ts +3 -2
- package/dist/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +1 -2
- package/dist/MultiRowXYPlotRenderer/configSchema.d.ts +0 -12
- package/dist/MultiRowXYPlotRenderer/configSchema.js +3 -21
- package/dist/MultiRowXYPlotRenderer/index.d.ts +1 -1
- package/dist/MultiWiggleAdapter/MultiWiggleAdapter.d.ts +5 -4
- package/dist/MultiWiggleAdapter/MultiWiggleAdapter.js +12 -15
- package/dist/MultiWiggleAdapter/configSchema.d.ts +0 -6
- package/dist/MultiWiggleAdapter/configSchema.js +1 -10
- package/dist/MultiWiggleAdapter/index.d.ts +1 -1
- package/dist/MultiWiggleAdapter/index.js +1 -1
- package/dist/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.d.ts +1 -1
- package/dist/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +2 -4
- package/dist/MultiWiggleAddTrackWorkflow/index.d.ts +1 -1
- package/dist/MultiWiggleAddTrackWorkflow/index.js +1 -2
- package/dist/MultiWiggleRendering.d.ts +3 -3
- package/dist/MultiWiggleRendering.js +2 -2
- package/dist/MultiXYPlotRenderer/MultiXYPlotRenderer.d.ts +3 -2
- package/dist/MultiXYPlotRenderer/MultiXYPlotRenderer.js +1 -2
- package/dist/MultiXYPlotRenderer/configSchema.d.ts +0 -12
- package/dist/MultiXYPlotRenderer/configSchema.js +2 -20
- package/dist/MultiXYPlotRenderer/index.d.ts +1 -1
- package/dist/QuantitativeTrack/configSchema.d.ts +1 -1
- package/dist/QuantitativeTrack/configSchema.js +1 -7
- package/dist/QuantitativeTrack/index.d.ts +1 -1
- package/dist/QuantitativeTrack/index.js +1 -1
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +1 -2
- package/dist/WiggleBaseRenderer.d.ts +6 -9
- package/dist/WiggleBaseRenderer.js +0 -1
- package/dist/WiggleRPC/MultiWiggleGetSources.d.ts +5 -12
- package/dist/WiggleRPC/MultiWiggleGetSources.js +2 -29
- package/dist/WiggleRPC/WiggleGetGlobalQuantitativeStats.d.ts +5 -7
- package/dist/WiggleRPC/WiggleGetGlobalQuantitativeStats.js +2 -15
- package/dist/WiggleRPC/WiggleGetMultiRegionQuantitativeStats.d.ts +4 -11
- package/dist/WiggleRPC/WiggleGetMultiRegionQuantitativeStats.js +2 -29
- package/dist/WiggleRendering.d.ts +2 -2
- package/dist/WiggleRendering.js +1 -3
- package/dist/XYPlotRenderer/XYPlotRenderer.d.ts +3 -2
- package/dist/XYPlotRenderer/XYPlotRenderer.js +3 -5
- package/dist/XYPlotRenderer/configSchema.d.ts +0 -12
- package/dist/XYPlotRenderer/configSchema.js +3 -21
- package/dist/XYPlotRenderer/index.d.ts +1 -1
- package/dist/configSchema.d.ts +0 -18
- package/dist/configSchema.js +1 -23
- package/dist/drawDensity.d.ts +3 -3
- package/dist/drawDensity.js +0 -4
- package/dist/drawLine.d.ts +3 -3
- package/dist/drawLine.js +0 -5
- package/dist/drawXY.d.ts +4 -3
- package/dist/drawXY.js +28 -12
- package/dist/getMultiWiggleSourcesAutorun.d.ts +17 -0
- package/dist/getMultiWiggleSourcesAutorun.js +38 -0
- package/dist/getQuantitativeStats.d.ts +13 -0
- package/dist/getQuantitativeStats.js +70 -0
- package/dist/getQuantitativeStatsAutorun.d.ts +13 -0
- package/dist/getQuantitativeStatsAutorun.js +35 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +21 -24
- package/dist/shared/SetMinMaxDialog.js +1 -1
- package/{esm/shared/configShared.d.ts → dist/shared/SharedWiggleConfigSchema.d.ts} +0 -26
- package/dist/shared/{configShared.js → SharedWiggleConfigSchema.js} +1 -30
- package/{esm/shared/modelShared.d.ts → dist/shared/SharedWiggleMixin.d.ts} +22 -213
- package/dist/shared/{modelShared.js → SharedWiggleMixin.js} +15 -174
- package/dist/util.d.ts +1 -53
- package/dist/util.js +1 -141
- package/esm/BigWigAdapter/BigWigAdapter.d.ts +4 -3
- package/esm/BigWigAdapter/BigWigAdapter.js +5 -10
- package/esm/BigWigAdapter/configSchema.d.ts +0 -9
- package/esm/BigWigAdapter/configSchema.js +1 -13
- package/esm/BigWigAdapter/index.d.ts +1 -1
- package/esm/CreateMultiWiggleExtension/ConfirmDialog.d.ts +1 -1
- package/esm/CreateMultiWiggleExtension/ConfirmDialog.js +2 -2
- package/esm/CreateMultiWiggleExtension/index.d.ts +1 -1
- package/esm/CreateMultiWiggleExtension/index.js +26 -26
- package/esm/DensityRenderer/DensityRenderer.d.ts +2 -1
- package/esm/DensityRenderer/DensityRenderer.js +1 -1
- package/esm/DensityRenderer/configSchema.js +1 -7
- package/esm/DensityRenderer/index.d.ts +1 -1
- package/esm/DensityRenderer/index.js +1 -1
- package/esm/LinePlotRenderer/LinePlotRenderer.d.ts +3 -2
- package/esm/LinePlotRenderer/LinePlotRenderer.js +1 -1
- package/esm/LinePlotRenderer/configSchema.d.ts +0 -3
- package/esm/LinePlotRenderer/configSchema.js +1 -10
- package/esm/LinePlotRenderer/index.d.ts +1 -1
- package/esm/LinearWiggleDisplay/components/SetColorDialog.js +2 -2
- package/esm/LinearWiggleDisplay/components/Tooltip.d.ts +2 -2
- package/esm/LinearWiggleDisplay/components/Tooltip.js +1 -2
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
- package/esm/LinearWiggleDisplay/components/WiggleDisplayComponent.js +3 -3
- package/esm/LinearWiggleDisplay/{models/configSchema.d.ts → configSchema.d.ts} +1 -12
- package/esm/LinearWiggleDisplay/{models/configSchema.js → configSchema.js} +1 -16
- package/esm/LinearWiggleDisplay/index.d.ts +2 -2
- package/esm/LinearWiggleDisplay/index.js +4 -4
- package/{dist/LinearWiggleDisplay/models → esm/LinearWiggleDisplay}/model.d.ts +21 -63
- package/esm/LinearWiggleDisplay/{models/model.js → model.js} +67 -81
- package/esm/LinearWiggleDisplay/{models/renderSvg.d.ts → renderSvg.d.ts} +2 -2
- package/esm/LinearWiggleDisplay/{models/renderSvg.js → renderSvg.js} +2 -2
- package/esm/MultiDensityRenderer/MultiDensityRenderer.d.ts +4 -3
- package/esm/MultiDensityRenderer/MultiDensityRenderer.js +1 -2
- package/esm/MultiDensityRenderer/configSchema.js +1 -7
- package/esm/MultiDensityRenderer/index.d.ts +1 -1
- package/esm/MultiLineRenderer/MultiLineRenderer.d.ts +3 -2
- package/esm/MultiLineRenderer/MultiLineRenderer.js +1 -2
- package/esm/MultiLineRenderer/configSchema.d.ts +0 -6
- package/esm/MultiLineRenderer/configSchema.js +1 -13
- package/esm/MultiLineRenderer/index.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/ColorLegend.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/ColorLegend.js +0 -1
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/DraggableDialog.js +4 -8
- package/esm/MultiLinearWiggleDisplay/components/RectBg.js +1 -1
- package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/ScoreLegend.js +1 -1
- package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/SetColorDialog.js +4 -6
- package/esm/MultiLinearWiggleDisplay/components/SourcesGrid.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/SourcesGrid.js +16 -27
- package/esm/MultiLinearWiggleDisplay/components/Tooltip.d.ts +3 -3
- package/esm/MultiLinearWiggleDisplay/components/Tooltip.js +1 -2
- package/esm/MultiLinearWiggleDisplay/components/WiggleDisplayComponent.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/YScaleBars.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/YScaleBars.js +2 -2
- package/esm/MultiLinearWiggleDisplay/components/util.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/components/util.js +1 -1
- package/esm/MultiLinearWiggleDisplay/{models/configSchema.d.ts → configSchema.d.ts} +1 -10
- package/esm/MultiLinearWiggleDisplay/{models/configSchema.js → configSchema.js} +2 -20
- package/esm/MultiLinearWiggleDisplay/index.d.ts +1 -1
- package/esm/MultiLinearWiggleDisplay/index.js +3 -3
- package/esm/MultiLinearWiggleDisplay/{models/model.d.ts → model.d.ts} +25 -129
- package/esm/MultiLinearWiggleDisplay/{models/model.js → model.js} +108 -183
- package/esm/MultiLinearWiggleDisplay/{models/renderSvg.d.ts → renderSvg.d.ts} +2 -2
- package/esm/MultiLinearWiggleDisplay/{models/renderSvg.js → renderSvg.js} +2 -2
- package/esm/MultiQuantitativeTrack/configSchema.d.ts +1 -1
- package/esm/MultiQuantitativeTrack/configSchema.js +1 -7
- package/esm/MultiQuantitativeTrack/index.d.ts +1 -1
- package/esm/MultiQuantitativeTrack/index.js +1 -1
- package/esm/MultiRowLineRenderer/MultiRowLineRenderer.d.ts +3 -2
- package/esm/MultiRowLineRenderer/MultiRowLineRenderer.js +1 -2
- package/esm/MultiRowLineRenderer/configSchema.d.ts +0 -6
- package/esm/MultiRowLineRenderer/configSchema.js +2 -14
- package/esm/MultiRowLineRenderer/index.d.ts +1 -1
- package/esm/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.d.ts +3 -2
- package/esm/MultiRowXYPlotRenderer/MultiRowXYPlotRenderer.js +1 -2
- package/esm/MultiRowXYPlotRenderer/configSchema.d.ts +0 -12
- package/esm/MultiRowXYPlotRenderer/configSchema.js +3 -21
- package/esm/MultiRowXYPlotRenderer/index.d.ts +1 -1
- package/esm/MultiWiggleAdapter/MultiWiggleAdapter.d.ts +5 -4
- package/esm/MultiWiggleAdapter/MultiWiggleAdapter.js +13 -16
- package/esm/MultiWiggleAdapter/configSchema.d.ts +0 -6
- package/esm/MultiWiggleAdapter/configSchema.js +1 -10
- package/esm/MultiWiggleAdapter/index.d.ts +1 -1
- package/esm/MultiWiggleAdapter/index.js +1 -1
- package/esm/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.d.ts +1 -1
- package/esm/MultiWiggleAddTrackWorkflow/AddTrackWorkflow.js +2 -4
- package/esm/MultiWiggleAddTrackWorkflow/index.d.ts +1 -1
- package/esm/MultiWiggleAddTrackWorkflow/index.js +1 -2
- package/esm/MultiWiggleRendering.d.ts +3 -3
- package/esm/MultiWiggleRendering.js +2 -2
- package/esm/MultiXYPlotRenderer/MultiXYPlotRenderer.d.ts +3 -2
- package/esm/MultiXYPlotRenderer/MultiXYPlotRenderer.js +1 -2
- package/esm/MultiXYPlotRenderer/configSchema.d.ts +0 -12
- package/esm/MultiXYPlotRenderer/configSchema.js +2 -20
- package/esm/MultiXYPlotRenderer/index.d.ts +1 -1
- package/esm/QuantitativeTrack/configSchema.d.ts +1 -1
- package/esm/QuantitativeTrack/configSchema.js +1 -7
- package/esm/QuantitativeTrack/index.d.ts +1 -1
- package/esm/QuantitativeTrack/index.js +1 -1
- package/esm/Tooltip.d.ts +1 -1
- package/esm/Tooltip.js +1 -2
- package/esm/WiggleBaseRenderer.d.ts +6 -9
- package/esm/WiggleBaseRenderer.js +0 -1
- package/esm/WiggleRPC/MultiWiggleGetSources.d.ts +5 -12
- package/esm/WiggleRPC/MultiWiggleGetSources.js +2 -29
- package/esm/WiggleRPC/WiggleGetGlobalQuantitativeStats.d.ts +5 -7
- package/esm/WiggleRPC/WiggleGetGlobalQuantitativeStats.js +2 -15
- package/esm/WiggleRPC/WiggleGetMultiRegionQuantitativeStats.d.ts +4 -11
- package/esm/WiggleRPC/WiggleGetMultiRegionQuantitativeStats.js +2 -29
- package/esm/WiggleRendering.d.ts +2 -2
- package/esm/WiggleRendering.js +1 -3
- package/esm/XYPlotRenderer/XYPlotRenderer.d.ts +3 -2
- package/esm/XYPlotRenderer/XYPlotRenderer.js +3 -5
- package/esm/XYPlotRenderer/configSchema.d.ts +0 -12
- package/esm/XYPlotRenderer/configSchema.js +3 -21
- package/esm/XYPlotRenderer/index.d.ts +1 -1
- package/esm/configSchema.d.ts +0 -18
- package/esm/configSchema.js +1 -23
- package/esm/drawDensity.d.ts +3 -3
- package/esm/drawDensity.js +1 -5
- package/esm/drawLine.d.ts +3 -3
- package/esm/drawLine.js +1 -6
- package/esm/drawXY.d.ts +4 -3
- package/esm/drawXY.js +29 -13
- package/esm/getMultiWiggleSourcesAutorun.d.ts +17 -0
- package/esm/getMultiWiggleSourcesAutorun.js +35 -0
- package/esm/getQuantitativeStats.d.ts +13 -0
- package/esm/getQuantitativeStats.js +67 -0
- package/esm/getQuantitativeStatsAutorun.d.ts +13 -0
- package/esm/getQuantitativeStatsAutorun.js +32 -0
- package/esm/index.d.ts +6 -6
- package/esm/index.js +13 -16
- package/esm/shared/SetMinMaxDialog.js +1 -1
- package/{dist/shared/configShared.d.ts → esm/shared/SharedWiggleConfigSchema.d.ts} +0 -26
- package/esm/shared/{configShared.js → SharedWiggleConfigSchema.js} +1 -30
- package/{dist/shared/modelShared.d.ts → esm/shared/SharedWiggleMixin.d.ts} +22 -213
- package/esm/shared/{modelShared.js → SharedWiggleMixin.js} +16 -175
- package/esm/util.d.ts +1 -53
- package/esm/util.js +1 -139
- package/package.json +2 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import WiggleBaseRenderer from '../WiggleBaseRenderer';
|
|
2
|
+
import type { RenderArgsDeserializedWithFeatures } from '../WiggleBaseRenderer';
|
|
3
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
3
4
|
export default class XYPlotRenderer extends WiggleBaseRenderer {
|
|
4
5
|
draw(ctx: CanvasRenderingContext2D, props: RenderArgsDeserializedWithFeatures): Promise<{
|
|
5
6
|
reducedFeatures: Feature[];
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
|
-
import { drawXY } from '../drawXY';
|
|
3
2
|
import WiggleBaseRenderer from '../WiggleBaseRenderer';
|
|
3
|
+
import { drawXY } from '../drawXY';
|
|
4
4
|
import { YSCALEBAR_LABEL_OFFSET } from '../util';
|
|
5
5
|
export default class XYPlotRenderer extends WiggleBaseRenderer {
|
|
6
6
|
async draw(ctx, props) {
|
|
7
|
-
const { features, config } = props;
|
|
8
|
-
// the adjusted height takes into account YSCALEBAR_LABEL_OFFSET from the
|
|
9
|
-
// wiggle display, and makes the height of the actual drawn area add
|
|
10
|
-
// "padding" to the top and bottom of the display
|
|
7
|
+
const { stopToken, features, config } = props;
|
|
11
8
|
const pivotValue = readConfObject(config, 'bicolorPivotValue');
|
|
12
9
|
const negColor = readConfObject(config, 'negColor');
|
|
13
10
|
const posColor = readConfObject(config, 'posColor');
|
|
@@ -18,6 +15,7 @@ export default class XYPlotRenderer extends WiggleBaseRenderer {
|
|
|
18
15
|
: (feature, _score) => readConfObject(config, 'color', { feature }),
|
|
19
16
|
offset: YSCALEBAR_LABEL_OFFSET,
|
|
20
17
|
features: [...features.values()],
|
|
18
|
+
stopToken,
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
}
|
|
@@ -1,31 +1,19 @@
|
|
|
1
1
|
declare const configSchema: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
filled: {
|
|
6
3
|
type: string;
|
|
7
4
|
defaultValue: boolean;
|
|
8
5
|
};
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
displayCrossHatches: {
|
|
13
7
|
type: string;
|
|
14
8
|
description: string;
|
|
15
9
|
defaultValue: boolean;
|
|
16
10
|
};
|
|
17
|
-
/**
|
|
18
|
-
* #slot
|
|
19
|
-
*/
|
|
20
11
|
summaryScoreMode: {
|
|
21
12
|
type: string;
|
|
22
13
|
model: import("mobx-state-tree").ISimpleType<string>;
|
|
23
14
|
description: string;
|
|
24
15
|
defaultValue: string;
|
|
25
16
|
};
|
|
26
|
-
/**
|
|
27
|
-
* #slot
|
|
28
|
-
*/
|
|
29
17
|
minSize: {
|
|
30
18
|
type: string;
|
|
31
19
|
defaultValue: number;
|
|
@@ -1,46 +1,28 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
import baseWiggleRendererConfigSchema from '../configSchema';
|
|
3
2
|
import { types } from 'mobx-state-tree';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
import baseWiggleRendererConfigSchema from '../configSchema';
|
|
4
|
+
function x() { }
|
|
8
5
|
const configSchema = ConfigurationSchema('XYPlotRenderer', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
filled: {
|
|
13
7
|
type: 'boolean',
|
|
14
8
|
defaultValue: true,
|
|
15
9
|
},
|
|
16
|
-
/**
|
|
17
|
-
* #slot
|
|
18
|
-
*/
|
|
19
10
|
displayCrossHatches: {
|
|
20
11
|
type: 'boolean',
|
|
21
12
|
description: 'choose to draw cross hatches (sideways lines)',
|
|
22
13
|
defaultValue: false,
|
|
23
14
|
},
|
|
24
|
-
/**
|
|
25
|
-
* #slot
|
|
26
|
-
*/
|
|
27
15
|
summaryScoreMode: {
|
|
28
16
|
type: 'stringEnum',
|
|
29
17
|
model: types.enumeration('Score type', ['max', 'min', 'avg', 'whiskers']),
|
|
30
18
|
description: 'choose whether to use max/min/average or whiskers which combines all three into the same rendering',
|
|
31
19
|
defaultValue: 'whiskers',
|
|
32
20
|
},
|
|
33
|
-
/**
|
|
34
|
-
* #slot
|
|
35
|
-
*/
|
|
36
21
|
minSize: {
|
|
37
22
|
type: 'number',
|
|
38
|
-
defaultValue: 0,
|
|
23
|
+
defaultValue: 0.7,
|
|
39
24
|
},
|
|
40
25
|
}, {
|
|
41
|
-
/**
|
|
42
|
-
* #baseConfiguration
|
|
43
|
-
*/
|
|
44
26
|
baseConfiguration: baseWiggleRendererConfigSchema,
|
|
45
27
|
explicitlyTyped: true,
|
|
46
28
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
1
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
2
2
|
export default function XYPlotRendererF(pluginManager: PluginManager): void;
|
|
3
3
|
export { default as XYPlotRenderer } from './XYPlotRenderer';
|
|
4
4
|
export { default as ReactComponent } from '../WiggleRendering';
|
package/esm/configSchema.d.ts
CHANGED
|
@@ -1,48 +1,30 @@
|
|
|
1
1
|
declare const WiggleRenderer: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
|
|
2
|
-
/**
|
|
3
|
-
* #slot
|
|
4
|
-
*/
|
|
5
2
|
color: {
|
|
6
3
|
type: string;
|
|
7
4
|
description: string;
|
|
8
5
|
defaultValue: string;
|
|
9
6
|
};
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
7
|
posColor: {
|
|
14
8
|
type: string;
|
|
15
9
|
description: string;
|
|
16
10
|
defaultValue: string;
|
|
17
11
|
};
|
|
18
|
-
/**
|
|
19
|
-
* #slot
|
|
20
|
-
*/
|
|
21
12
|
negColor: {
|
|
22
13
|
type: string;
|
|
23
14
|
description: string;
|
|
24
15
|
defaultValue: string;
|
|
25
16
|
};
|
|
26
|
-
/**
|
|
27
|
-
* #slot
|
|
28
|
-
*/
|
|
29
17
|
clipColor: {
|
|
30
18
|
type: string;
|
|
31
19
|
description: string;
|
|
32
20
|
defaultValue: string;
|
|
33
21
|
};
|
|
34
|
-
/**
|
|
35
|
-
* #slot
|
|
36
|
-
*/
|
|
37
22
|
bicolorPivot: {
|
|
38
23
|
type: string;
|
|
39
24
|
model: import("mobx-state-tree").ISimpleType<string>;
|
|
40
25
|
description: string;
|
|
41
26
|
defaultValue: string;
|
|
42
27
|
};
|
|
43
|
-
/**
|
|
44
|
-
* #slot
|
|
45
|
-
*/
|
|
46
28
|
bicolorPivotValue: {
|
|
47
29
|
type: string;
|
|
48
30
|
defaultValue: number;
|
package/esm/configSchema.js
CHANGED
|
@@ -1,46 +1,27 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
2
|
import { types } from 'mobx-state-tree';
|
|
3
|
-
|
|
4
|
-
* #config WiggleRenderer
|
|
5
|
-
* this is the "base wiggle renderer config schema"
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
3
|
+
function x() { }
|
|
8
4
|
const WiggleRenderer = ConfigurationSchema('WiggleRenderer', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
5
|
color: {
|
|
13
6
|
type: 'color',
|
|
14
7
|
description: 'the color of track, overrides posColor and negColor',
|
|
15
8
|
defaultValue: '#f0f',
|
|
16
9
|
},
|
|
17
|
-
/**
|
|
18
|
-
* #slot
|
|
19
|
-
*/
|
|
20
10
|
posColor: {
|
|
21
11
|
type: 'color',
|
|
22
12
|
description: 'the color to use when the score is positive',
|
|
23
13
|
defaultValue: 'blue',
|
|
24
14
|
},
|
|
25
|
-
/**
|
|
26
|
-
* #slot
|
|
27
|
-
*/
|
|
28
15
|
negColor: {
|
|
29
16
|
type: 'color',
|
|
30
17
|
description: 'the color to use when the score is negative',
|
|
31
18
|
defaultValue: 'red',
|
|
32
19
|
},
|
|
33
|
-
/**
|
|
34
|
-
* #slot
|
|
35
|
-
*/
|
|
36
20
|
clipColor: {
|
|
37
21
|
type: 'color',
|
|
38
22
|
description: 'the color of the clipping marker',
|
|
39
23
|
defaultValue: 'red',
|
|
40
24
|
},
|
|
41
|
-
/**
|
|
42
|
-
* #slot
|
|
43
|
-
*/
|
|
44
25
|
bicolorPivot: {
|
|
45
26
|
type: 'stringEnum',
|
|
46
27
|
model: types.enumeration('Scale type', [
|
|
@@ -52,9 +33,6 @@ const WiggleRenderer = ConfigurationSchema('WiggleRenderer', {
|
|
|
52
33
|
description: 'type of bicolor pivot',
|
|
53
34
|
defaultValue: 'numeric',
|
|
54
35
|
},
|
|
55
|
-
/**
|
|
56
|
-
* #slot
|
|
57
|
-
*/
|
|
58
36
|
bicolorPivotValue: {
|
|
59
37
|
type: 'number',
|
|
60
38
|
defaultValue: 0,
|
package/esm/drawDensity.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ScaleOpts } from './util';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
4
|
export declare function drawDensity(ctx: CanvasRenderingContext2D, props: {
|
|
5
5
|
features: Map<string, Feature> | Feature[];
|
|
6
6
|
regions: Region[];
|
package/esm/drawDensity.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { readConfObject
|
|
1
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
2
|
import { featureSpanPx } from '@jbrowse/core/util';
|
|
3
|
-
// locals
|
|
4
3
|
import { fillRectCtx, getScale } from './util';
|
|
5
4
|
const fudgeFactor = 0.3;
|
|
6
5
|
const clipHeight = 2;
|
|
@@ -31,7 +30,6 @@ export function drawDensity(ctx, props) {
|
|
|
31
30
|
const reducedFeatures = [];
|
|
32
31
|
for (const feature of features.values()) {
|
|
33
32
|
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
|
|
34
|
-
// create reduced features, avoiding multiple features per px
|
|
35
33
|
if (Math.floor(leftPx) !== Math.floor(prevLeftPx)) {
|
|
36
34
|
reducedFeatures.push(feature);
|
|
37
35
|
prevLeftPx = leftPx;
|
|
@@ -42,8 +40,6 @@ export function drawDensity(ctx, props) {
|
|
|
42
40
|
ctx.fillStyle = cb(feature, score);
|
|
43
41
|
ctx.fillRect(leftPx, 0, w, height);
|
|
44
42
|
}
|
|
45
|
-
// second pass: draw clipping
|
|
46
|
-
// avoid persisting the red fillstyle with save/restore
|
|
47
43
|
ctx.save();
|
|
48
44
|
if (hasClipping) {
|
|
49
45
|
ctx.fillStyle = clipColor;
|
package/esm/drawLine.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ScaleOpts } from './util';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
4
|
export declare function drawLine(ctx: CanvasRenderingContext2D, props: {
|
|
5
5
|
features: Map<string, Feature> | Feature[];
|
|
6
6
|
regions: Region[];
|
package/esm/drawLine.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { readConfObject
|
|
1
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
2
2
|
import { clamp, featureSpanPx } from '@jbrowse/core/util';
|
|
3
|
-
// locals
|
|
4
3
|
import { getScale } from './util';
|
|
5
4
|
const fudgeFactor = 0.3;
|
|
6
5
|
const clipHeight = 2;
|
|
@@ -8,9 +7,6 @@ export function drawLine(ctx, props) {
|
|
|
8
7
|
const { features, regions, bpPerPx, scaleOpts, height: unadjustedHeight, ticks: { values }, displayCrossHatches, colorCallback, config, offset = 0, } = props;
|
|
9
8
|
const region = regions[0];
|
|
10
9
|
const width = (region.end - region.start) / bpPerPx;
|
|
11
|
-
// the adjusted height takes into account YSCALEBAR_LABEL_OFFSET from the
|
|
12
|
-
// wiggle display, and makes the height of the actual drawn area add
|
|
13
|
-
// "padding" to the top and bottom of the display
|
|
14
10
|
const height = unadjustedHeight - offset * 2;
|
|
15
11
|
const clipColor = readConfObject(config, 'clipColor');
|
|
16
12
|
const scale = getScale({ ...scaleOpts, range: [0, height] });
|
|
@@ -23,7 +19,6 @@ export function drawLine(ctx, props) {
|
|
|
23
19
|
const reducedFeatures = [];
|
|
24
20
|
for (const feature of features.values()) {
|
|
25
21
|
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
|
|
26
|
-
// create reduced features, avoiding multiple features per px
|
|
27
22
|
if (Math.floor(leftPx) !== Math.floor(prevLeftPx)) {
|
|
28
23
|
reducedFeatures.push(feature);
|
|
29
24
|
prevLeftPx = leftPx;
|
package/esm/drawXY.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { ScaleOpts } from './util';
|
|
2
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
|
+
import type { Feature, Region } from '@jbrowse/core/util';
|
|
4
4
|
export declare function drawXY(ctx: CanvasRenderingContext2D, props: {
|
|
5
|
+
stopToken?: string;
|
|
5
6
|
features: Map<string, Feature> | Feature[];
|
|
6
7
|
bpPerPx: number;
|
|
7
8
|
regions: Region[];
|
package/esm/drawXY.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readConfObject
|
|
2
|
-
import { colord } from '@jbrowse/core/util/colord';
|
|
1
|
+
import { readConfObject } from '@jbrowse/core/configuration';
|
|
3
2
|
import { clamp, featureSpanPx } from '@jbrowse/core/util';
|
|
4
|
-
|
|
3
|
+
import { colord } from '@jbrowse/core/util/colord';
|
|
4
|
+
import { checkStopToken } from '@jbrowse/core/util/stopToken';
|
|
5
5
|
import { fillRectCtx, getOrigin, getScale } from './util';
|
|
6
6
|
function lighten(color, amount) {
|
|
7
7
|
const hslColor = color.toHsl();
|
|
@@ -19,9 +19,6 @@ export function drawXY(ctx, props) {
|
|
|
19
19
|
const { features, bpPerPx, regions, scaleOpts, height: unadjustedHeight, config, ticks, displayCrossHatches, offset = 0, colorCallback, } = props;
|
|
20
20
|
const region = regions[0];
|
|
21
21
|
const width = (region.end - region.start) / bpPerPx;
|
|
22
|
-
// the adjusted height takes into account YSCALEBAR_LABEL_OFFSET from the
|
|
23
|
-
// wiggle display, and makes the height of the actual drawn area add
|
|
24
|
-
// "padding" to the top and bottom of the display
|
|
25
22
|
const height = unadjustedHeight - offset * 2;
|
|
26
23
|
const filled = readConfObject(config, 'filled');
|
|
27
24
|
const clipColor = readConfObject(config, 'clipColor');
|
|
@@ -40,13 +37,16 @@ export function drawXY(ctx, props) {
|
|
|
40
37
|
let prevLeftPx = Number.NEGATIVE_INFINITY;
|
|
41
38
|
const reducedFeatures = [];
|
|
42
39
|
const crossingOrigin = niceMin < pivotValue && niceMax > pivotValue;
|
|
43
|
-
|
|
44
|
-
// passes. this reduces subpixel rendering issues. note: for stylistic
|
|
45
|
-
// reasons, clipping indicator is only drawn for score, not min/max score
|
|
40
|
+
let start = performance.now();
|
|
46
41
|
if (summaryScoreMode === 'whiskers') {
|
|
47
42
|
let lastCol;
|
|
48
43
|
let lastMix;
|
|
44
|
+
start = performance.now();
|
|
49
45
|
for (const feature of features.values()) {
|
|
46
|
+
if (performance.now() - start > 400) {
|
|
47
|
+
checkStopToken();
|
|
48
|
+
start = performance.now();
|
|
49
|
+
}
|
|
50
50
|
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
|
|
51
51
|
if (feature.get('summary')) {
|
|
52
52
|
const w = Math.max(rightPx - leftPx + fudgeFactor, minSize);
|
|
@@ -63,7 +63,12 @@ export function drawXY(ctx, props) {
|
|
|
63
63
|
}
|
|
64
64
|
lastMix = undefined;
|
|
65
65
|
lastCol = undefined;
|
|
66
|
+
start = performance.now();
|
|
66
67
|
for (const feature of features.values()) {
|
|
68
|
+
if (performance.now() - start > 400) {
|
|
69
|
+
checkStopToken();
|
|
70
|
+
start = performance.now();
|
|
71
|
+
}
|
|
67
72
|
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
|
|
68
73
|
const score = feature.get('score');
|
|
69
74
|
const max = feature.get('maxScore');
|
|
@@ -78,7 +83,6 @@ export function drawXY(ctx, props) {
|
|
|
78
83
|
.toString())
|
|
79
84
|
: c;
|
|
80
85
|
const w = Math.max(rightPx - leftPx + fudgeFactor, minSize);
|
|
81
|
-
// create reduced features, avoiding multiple features per px
|
|
82
86
|
if (Math.floor(leftPx) !== Math.floor(prevLeftPx)) {
|
|
83
87
|
reducedFeatures.push(feature);
|
|
84
88
|
prevLeftPx = leftPx;
|
|
@@ -89,7 +93,12 @@ export function drawXY(ctx, props) {
|
|
|
89
93
|
}
|
|
90
94
|
lastMix = undefined;
|
|
91
95
|
lastCol = undefined;
|
|
96
|
+
start = performance.now();
|
|
92
97
|
for (const feature of features.values()) {
|
|
98
|
+
if (performance.now() - start > 400) {
|
|
99
|
+
checkStopToken();
|
|
100
|
+
start = performance.now();
|
|
101
|
+
}
|
|
93
102
|
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
|
|
94
103
|
if (feature.get('summary')) {
|
|
95
104
|
const min = feature.get('minScore');
|
|
@@ -106,9 +115,13 @@ export function drawXY(ctx, props) {
|
|
|
106
115
|
}
|
|
107
116
|
}
|
|
108
117
|
else {
|
|
118
|
+
start = performance.now();
|
|
109
119
|
for (const feature of features.values()) {
|
|
120
|
+
if (performance.now() - start > 400) {
|
|
121
|
+
checkStopToken();
|
|
122
|
+
start = performance.now();
|
|
123
|
+
}
|
|
110
124
|
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
|
|
111
|
-
// create reduced features, avoiding multiple features per px
|
|
112
125
|
if (Math.floor(leftPx) !== Math.floor(prevLeftPx)) {
|
|
113
126
|
reducedFeatures.push(feature);
|
|
114
127
|
prevLeftPx = leftPx;
|
|
@@ -130,12 +143,15 @@ export function drawXY(ctx, props) {
|
|
|
130
143
|
}
|
|
131
144
|
}
|
|
132
145
|
}
|
|
133
|
-
// second pass: draw clipping
|
|
134
|
-
// avoid persisting the red fillstyle with save/restore
|
|
135
146
|
ctx.save();
|
|
136
147
|
if (hasClipping) {
|
|
137
148
|
ctx.fillStyle = clipColor;
|
|
149
|
+
start = performance.now();
|
|
138
150
|
for (const feature of features.values()) {
|
|
151
|
+
if (performance.now() - start > 400) {
|
|
152
|
+
checkStopToken();
|
|
153
|
+
start = performance.now();
|
|
154
|
+
}
|
|
139
155
|
const [leftPx, rightPx] = featureSpanPx(feature, region, bpPerPx);
|
|
140
156
|
const w = rightPx - leftPx + fudgeFactor;
|
|
141
157
|
const score = feature.get('score');
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
+
export interface Source {
|
|
3
|
+
name: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
group?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function getMultiWiggleSourcesAutorun(self: {
|
|
8
|
+
quantitativeStatsReady: boolean;
|
|
9
|
+
configuration: AnyConfigurationModel;
|
|
10
|
+
adapterConfig: AnyConfigurationModel;
|
|
11
|
+
autoscaleType: string;
|
|
12
|
+
adapterProps: () => Record<string, unknown>;
|
|
13
|
+
setSourcesLoading: (aborter: string) => void;
|
|
14
|
+
setError: (error: unknown) => void;
|
|
15
|
+
setMessage: (str: string) => void;
|
|
16
|
+
setSources: (sources: Source[]) => void;
|
|
17
|
+
}): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
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 getMultiWiggleSourcesAutorun(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, 'MultiWiggleGetSources', {
|
|
20
|
+
regions: view.staticBlocks.contentBlocks,
|
|
21
|
+
sessionId,
|
|
22
|
+
adapterConfig,
|
|
23
|
+
}));
|
|
24
|
+
if (isAlive(self)) {
|
|
25
|
+
self.setSources(sources);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
if (!isAbortException(e) && isAlive(self)) {
|
|
30
|
+
console.error(e);
|
|
31
|
+
getSession(self).notifyError(`${e}`, e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
+
import type { QuantitativeStats } from '@jbrowse/core/util/stats';
|
|
3
|
+
export declare function getQuantitativeStats(self: {
|
|
4
|
+
adapterConfig: AnyConfigurationModel;
|
|
5
|
+
configuration: AnyConfigurationModel;
|
|
6
|
+
autoscaleType: string;
|
|
7
|
+
setMessage: (str: string) => void;
|
|
8
|
+
}, opts: {
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
stopToken?: string;
|
|
11
|
+
filters: string[];
|
|
12
|
+
currStatsBpPerPx: number;
|
|
13
|
+
}): Promise<QuantitativeStats>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { getConf } from '@jbrowse/core/configuration';
|
|
2
|
+
import { getContainingView, getSession } from '@jbrowse/core/util';
|
|
3
|
+
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
4
|
+
import { isAlive } from 'mobx-state-tree';
|
|
5
|
+
export async function getQuantitativeStats(self, opts) {
|
|
6
|
+
const { rpcManager } = getSession(self);
|
|
7
|
+
const numStdDev = getConf(self, 'numStdDev') || 3;
|
|
8
|
+
const { adapterConfig, autoscaleType } = self;
|
|
9
|
+
const sessionId = getRpcSessionId(self);
|
|
10
|
+
const { currStatsBpPerPx } = opts;
|
|
11
|
+
const params = {
|
|
12
|
+
sessionId,
|
|
13
|
+
adapterConfig,
|
|
14
|
+
statusCallback: (message) => {
|
|
15
|
+
if (isAlive(self)) {
|
|
16
|
+
self.setMessage(message);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
...opts,
|
|
20
|
+
};
|
|
21
|
+
if (autoscaleType === 'global' || autoscaleType === 'globalsd') {
|
|
22
|
+
const results = (await rpcManager.call(sessionId, 'WiggleGetGlobalQuantitativeStats', params));
|
|
23
|
+
const { scoreMin, scoreMean, scoreStdDev } = results;
|
|
24
|
+
return autoscaleType === 'globalsd'
|
|
25
|
+
? {
|
|
26
|
+
...results,
|
|
27
|
+
scoreMin: scoreMin >= 0 ? 0 : scoreMean - numStdDev * scoreStdDev,
|
|
28
|
+
scoreMax: scoreMean + numStdDev * scoreStdDev,
|
|
29
|
+
currStatsBpPerPx,
|
|
30
|
+
}
|
|
31
|
+
: {
|
|
32
|
+
...results,
|
|
33
|
+
currStatsBpPerPx,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (autoscaleType === 'local' || autoscaleType === 'localsd') {
|
|
37
|
+
const { dynamicBlocks, bpPerPx } = getContainingView(self);
|
|
38
|
+
const results = (await rpcManager.call(sessionId, 'WiggleGetMultiRegionQuantitativeStats', {
|
|
39
|
+
...params,
|
|
40
|
+
regions: dynamicBlocks.contentBlocks.map(region => {
|
|
41
|
+
const { start, end } = region;
|
|
42
|
+
return {
|
|
43
|
+
...JSON.parse(JSON.stringify(region)),
|
|
44
|
+
start: Math.floor(start),
|
|
45
|
+
end: Math.ceil(end),
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
48
|
+
bpPerPx,
|
|
49
|
+
}));
|
|
50
|
+
const { scoreMin, scoreMean, scoreStdDev } = results;
|
|
51
|
+
return autoscaleType === 'localsd'
|
|
52
|
+
? {
|
|
53
|
+
...results,
|
|
54
|
+
scoreMin: scoreMin >= 0 ? 0 : scoreMean - numStdDev * scoreStdDev,
|
|
55
|
+
scoreMax: scoreMean + numStdDev * scoreStdDev,
|
|
56
|
+
currStatsBpPerPx,
|
|
57
|
+
}
|
|
58
|
+
: {
|
|
59
|
+
...results,
|
|
60
|
+
currStatsBpPerPx,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (autoscaleType === 'zscale') {
|
|
64
|
+
return rpcManager.call(sessionId, 'WiggleGetGlobalQuantitativeStats', params);
|
|
65
|
+
}
|
|
66
|
+
throw new Error(`invalid autoscaleType '${autoscaleType}'`);
|
|
67
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
2
|
+
import type { QuantitativeStats } from '@jbrowse/core/util/stats';
|
|
3
|
+
export declare function getQuantitativeStatsAutorun(self: {
|
|
4
|
+
quantitativeStatsReady: boolean;
|
|
5
|
+
configuration: AnyConfigurationModel;
|
|
6
|
+
adapterConfig: AnyConfigurationModel;
|
|
7
|
+
autoscaleType: string;
|
|
8
|
+
adapterProps: () => Record<string, unknown>;
|
|
9
|
+
setStatsLoading: (token: string) => void;
|
|
10
|
+
setError: (error: unknown) => void;
|
|
11
|
+
setMessage: (str: string) => void;
|
|
12
|
+
updateQuantitativeStats: (stats: QuantitativeStats, region: string) => void;
|
|
13
|
+
}): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getContainingView, isAbortException } from '@jbrowse/core/util';
|
|
2
|
+
import { createStopToken } from '@jbrowse/core/util/stopToken';
|
|
3
|
+
import { autorun } from 'mobx';
|
|
4
|
+
import { addDisposer, isAlive } from 'mobx-state-tree';
|
|
5
|
+
import { getQuantitativeStats } from './getQuantitativeStats';
|
|
6
|
+
export function getQuantitativeStatsAutorun(self) {
|
|
7
|
+
addDisposer(self, autorun(async () => {
|
|
8
|
+
try {
|
|
9
|
+
if (self.quantitativeStatsReady) {
|
|
10
|
+
const view = getContainingView(self);
|
|
11
|
+
const stopToken = createStopToken();
|
|
12
|
+
self.setStatsLoading(stopToken);
|
|
13
|
+
const statsRegion = JSON.stringify(view.dynamicBlocks);
|
|
14
|
+
const wiggleStats = await getQuantitativeStats(self, {
|
|
15
|
+
stopToken,
|
|
16
|
+
filters: [],
|
|
17
|
+
currStatsBpPerPx: view.bpPerPx,
|
|
18
|
+
...self.adapterProps(),
|
|
19
|
+
});
|
|
20
|
+
if (isAlive(self)) {
|
|
21
|
+
self.updateQuantitativeStats(wiggleStats, statsRegion);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
if (isAlive(self) && !isAbortException(e)) {
|
|
27
|
+
console.error(e);
|
|
28
|
+
self.setError(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}, { delay: 1000 }));
|
|
32
|
+
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import Plugin from '@jbrowse/core/Plugin';
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
-
import WiggleBaseRenderer from './WiggleBaseRenderer';
|
|
4
|
-
import * as utils from './util';
|
|
5
2
|
import { modelFactory as linearWiggleDisplayModelFactory } from './LinearWiggleDisplay';
|
|
3
|
+
import WiggleBaseRenderer from './WiggleBaseRenderer';
|
|
6
4
|
import { XYPlotRenderer } from './XYPlotRenderer';
|
|
5
|
+
import * as utils from './util';
|
|
6
|
+
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
7
7
|
export default class WigglePlugin extends Plugin {
|
|
8
8
|
name: string;
|
|
9
9
|
install(pm: PluginManager): void;
|
|
10
10
|
exports: {
|
|
11
11
|
LinearWiggleDisplayReactComponent: (props: {
|
|
12
|
-
model: import("./LinearWiggleDisplay/
|
|
12
|
+
model: import("./LinearWiggleDisplay/model").WiggleDisplayModel;
|
|
13
13
|
}) => import("react").JSX.Element;
|
|
14
14
|
XYPlotRendererReactComponent: (props: {
|
|
15
15
|
regions: import("@jbrowse/core/util/types").Region[];
|
|
@@ -83,6 +83,6 @@ export default class WigglePlugin extends Plugin {
|
|
|
83
83
|
}
|
|
84
84
|
export * from './util';
|
|
85
85
|
export { default as WiggleRendering } from './WiggleRendering';
|
|
86
|
-
export {
|
|
87
|
-
export {
|
|
86
|
+
export { ReactComponent as LinearWiggleDisplayReactComponent, Tooltip, modelFactory as linearWiggleDisplayModelFactory, } from './LinearWiggleDisplay';
|
|
87
|
+
export type { TooltipContentsComponent } from './Tooltip';
|
|
88
88
|
export { default as WiggleBaseRenderer } from './WiggleBaseRenderer';
|