@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,76 +1,30 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
1
2
|
import { ConfigurationReference, getConf, readConfObject, } from '@jbrowse/core/configuration';
|
|
2
|
-
import { getEnv, getSession, isSelectionContainer
|
|
3
|
+
import { getEnv, getSession, isSelectionContainer } from '@jbrowse/core/util';
|
|
4
|
+
import { stopStopToken } from '@jbrowse/core/util/stopToken';
|
|
3
5
|
import { BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view';
|
|
4
6
|
import { types } from 'mobx-state-tree';
|
|
5
|
-
// locals
|
|
6
7
|
import { getNiceDomain } from '../util';
|
|
7
|
-
import { lazy } from 'react';
|
|
8
|
-
// lazies
|
|
9
8
|
const SetMinMaxDialog = lazy(() => import('./SetMinMaxDialog'));
|
|
10
|
-
/**
|
|
11
|
-
* #stateModel SharedWiggleMixin
|
|
12
|
-
*/
|
|
13
9
|
export default function SharedWiggleMixin(configSchema) {
|
|
14
10
|
return types
|
|
15
11
|
.compose(BaseLinearDisplay, types.model({
|
|
16
|
-
/**
|
|
17
|
-
* #property
|
|
18
|
-
*/
|
|
19
12
|
selectedRendering: types.optional(types.string, ''),
|
|
20
|
-
/**
|
|
21
|
-
* #property
|
|
22
|
-
*/
|
|
23
13
|
resolution: types.optional(types.number, 1),
|
|
24
|
-
/**
|
|
25
|
-
* #property
|
|
26
|
-
*/
|
|
27
14
|
fill: types.maybe(types.boolean),
|
|
28
|
-
/**
|
|
29
|
-
* #property
|
|
30
|
-
*/
|
|
31
15
|
minSize: types.maybe(types.number),
|
|
32
|
-
/**
|
|
33
|
-
* #property
|
|
34
|
-
*/
|
|
35
16
|
color: types.maybe(types.string),
|
|
36
|
-
/**
|
|
37
|
-
* #property
|
|
38
|
-
*/
|
|
39
17
|
posColor: types.maybe(types.string),
|
|
40
|
-
/**
|
|
41
|
-
* #property
|
|
42
|
-
*/
|
|
43
18
|
negColor: types.maybe(types.string),
|
|
44
|
-
/**
|
|
45
|
-
* #property
|
|
46
|
-
*/
|
|
47
19
|
summaryScoreMode: types.maybe(types.string),
|
|
48
|
-
/**
|
|
49
|
-
* #property
|
|
50
|
-
*/
|
|
51
20
|
rendererTypeNameState: types.maybe(types.string),
|
|
52
|
-
/**
|
|
53
|
-
* #property
|
|
54
|
-
*/
|
|
55
21
|
scale: types.maybe(types.string),
|
|
56
|
-
/**
|
|
57
|
-
* #property
|
|
58
|
-
*/
|
|
59
22
|
autoscale: types.maybe(types.string),
|
|
60
|
-
/**
|
|
61
|
-
* #property
|
|
62
|
-
*/
|
|
63
23
|
displayCrossHatches: types.maybe(types.boolean),
|
|
64
|
-
/**
|
|
65
|
-
* #property
|
|
66
|
-
*/
|
|
67
24
|
constraints: types.optional(types.model({
|
|
68
25
|
max: types.maybe(types.number),
|
|
69
26
|
min: types.maybe(types.number),
|
|
70
27
|
}), {}),
|
|
71
|
-
/**
|
|
72
|
-
* #property
|
|
73
|
-
*/
|
|
74
28
|
configuration: ConfigurationReference(configSchema),
|
|
75
29
|
}))
|
|
76
30
|
.volatile(() => ({
|
|
@@ -79,69 +33,43 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
79
33
|
statsFetchInProgress: undefined,
|
|
80
34
|
}))
|
|
81
35
|
.actions(self => ({
|
|
82
|
-
/**
|
|
83
|
-
* #action
|
|
84
|
-
*/
|
|
85
36
|
updateQuantitativeStats(stats) {
|
|
86
|
-
const { scoreMin, scoreMax } = stats;
|
|
37
|
+
const { currStatsBpPerPx, scoreMin, scoreMax } = stats;
|
|
87
38
|
const EPSILON = 0.000001;
|
|
88
|
-
if (!self.stats
|
|
89
|
-
self.stats
|
|
90
|
-
}
|
|
91
|
-
else if (Math.abs(self.stats.scoreMax - scoreMax) > EPSILON ||
|
|
39
|
+
if (!self.stats ||
|
|
40
|
+
Math.abs(self.stats.scoreMax - scoreMax) > EPSILON ||
|
|
92
41
|
Math.abs(self.stats.scoreMin - scoreMin) > EPSILON) {
|
|
93
|
-
self.stats = {
|
|
42
|
+
self.stats = {
|
|
43
|
+
currStatsBpPerPx,
|
|
44
|
+
scoreMin,
|
|
45
|
+
scoreMax,
|
|
46
|
+
};
|
|
94
47
|
}
|
|
95
48
|
},
|
|
96
|
-
/**
|
|
97
|
-
* #action
|
|
98
|
-
*/
|
|
99
49
|
setColor(color) {
|
|
100
50
|
self.color = color;
|
|
101
51
|
},
|
|
102
|
-
/**
|
|
103
|
-
* #action
|
|
104
|
-
*/
|
|
105
52
|
setPosColor(color) {
|
|
106
53
|
self.posColor = color;
|
|
107
54
|
},
|
|
108
|
-
/**
|
|
109
|
-
* #action
|
|
110
|
-
*/
|
|
111
55
|
setNegColor(color) {
|
|
112
56
|
self.negColor = color;
|
|
113
57
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
setLoading(aborter) {
|
|
118
|
-
const { statsFetchInProgress: statsFetch } = self;
|
|
119
|
-
if (statsFetch !== undefined && !statsFetch.signal.aborted) {
|
|
120
|
-
statsFetch.abort();
|
|
58
|
+
setStatsLoading(arg) {
|
|
59
|
+
if (self.statsFetchInProgress) {
|
|
60
|
+
stopStopToken(self.statsFetchInProgress);
|
|
121
61
|
}
|
|
122
|
-
self.statsFetchInProgress =
|
|
123
|
-
},
|
|
124
|
-
/**
|
|
125
|
-
* #action
|
|
126
|
-
* this overrides the BaseLinearDisplayModel to avoid popping up a
|
|
127
|
-
* feature detail display, but still sets the feature selection on the
|
|
128
|
-
* model so listeners can detect a click
|
|
129
|
-
*/
|
|
62
|
+
self.statsFetchInProgress = arg;
|
|
63
|
+
},
|
|
130
64
|
selectFeature(feature) {
|
|
131
65
|
const session = getSession(self);
|
|
132
66
|
if (isSelectionContainer(session)) {
|
|
133
67
|
session.setSelection(feature);
|
|
134
68
|
}
|
|
135
69
|
},
|
|
136
|
-
/**
|
|
137
|
-
* #action
|
|
138
|
-
*/
|
|
139
70
|
setResolution(res) {
|
|
140
71
|
self.resolution = res;
|
|
141
72
|
},
|
|
142
|
-
/**
|
|
143
|
-
* #action
|
|
144
|
-
*/
|
|
145
73
|
setFill(fill) {
|
|
146
74
|
if (fill === 0) {
|
|
147
75
|
self.fill = true;
|
|
@@ -156,116 +84,64 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
156
84
|
self.minSize = 2;
|
|
157
85
|
}
|
|
158
86
|
},
|
|
159
|
-
/**
|
|
160
|
-
* #action
|
|
161
|
-
*/
|
|
162
87
|
toggleLogScale() {
|
|
163
88
|
self.scale = self.scale === 'log' ? 'linear' : 'log';
|
|
164
89
|
},
|
|
165
|
-
/**
|
|
166
|
-
* #action
|
|
167
|
-
*/
|
|
168
90
|
setScaleType(scale) {
|
|
169
91
|
self.scale = scale;
|
|
170
92
|
},
|
|
171
|
-
/**
|
|
172
|
-
* #action
|
|
173
|
-
*/
|
|
174
93
|
setSummaryScoreMode(val) {
|
|
175
94
|
self.summaryScoreMode = val;
|
|
176
95
|
},
|
|
177
|
-
/**
|
|
178
|
-
* #action
|
|
179
|
-
*/
|
|
180
96
|
setAutoscale(val) {
|
|
181
97
|
self.autoscale = val;
|
|
182
98
|
},
|
|
183
|
-
/**
|
|
184
|
-
* #action
|
|
185
|
-
*/
|
|
186
99
|
setMaxScore(val) {
|
|
187
100
|
self.constraints.max = val;
|
|
188
101
|
},
|
|
189
|
-
/**
|
|
190
|
-
* #action
|
|
191
|
-
*/
|
|
192
102
|
setRendererType(val) {
|
|
193
103
|
self.rendererTypeNameState = val;
|
|
194
104
|
},
|
|
195
|
-
/**
|
|
196
|
-
* #action
|
|
197
|
-
*/
|
|
198
105
|
setMinScore(val) {
|
|
199
106
|
self.constraints.min = val;
|
|
200
107
|
},
|
|
201
|
-
/**
|
|
202
|
-
* #action
|
|
203
|
-
*/
|
|
204
108
|
toggleCrossHatches() {
|
|
205
109
|
self.displayCrossHatches = !self.displayCrossHatches;
|
|
206
110
|
},
|
|
207
|
-
/**
|
|
208
|
-
* #action
|
|
209
|
-
*/
|
|
210
111
|
setCrossHatches(cross) {
|
|
211
112
|
self.displayCrossHatches = cross;
|
|
212
113
|
},
|
|
213
114
|
}))
|
|
214
115
|
.views(self => ({
|
|
215
|
-
/**
|
|
216
|
-
* #getter
|
|
217
|
-
*/
|
|
218
116
|
get adapterTypeName() {
|
|
219
117
|
return self.adapterConfig.type;
|
|
220
118
|
},
|
|
221
|
-
/**
|
|
222
|
-
* #getter
|
|
223
|
-
*/
|
|
224
119
|
get rendererTypeNameSimple() {
|
|
225
120
|
var _a;
|
|
226
121
|
return (_a = self.rendererTypeNameState) !== null && _a !== void 0 ? _a : getConf(self, 'defaultRendering');
|
|
227
122
|
},
|
|
228
|
-
/**
|
|
229
|
-
* #getter
|
|
230
|
-
* subclasses can define these, as snpcoverage track does
|
|
231
|
-
*/
|
|
232
123
|
get filters() {
|
|
233
124
|
return undefined;
|
|
234
125
|
},
|
|
235
|
-
/**
|
|
236
|
-
* #getter
|
|
237
|
-
*/
|
|
238
126
|
get scaleType() {
|
|
239
127
|
var _a;
|
|
240
128
|
return (_a = self.scale) !== null && _a !== void 0 ? _a : getConf(self, 'scaleType');
|
|
241
129
|
},
|
|
242
|
-
/**
|
|
243
|
-
* #getter
|
|
244
|
-
*/
|
|
245
130
|
get maxScore() {
|
|
246
131
|
var _a;
|
|
247
132
|
return (_a = self.constraints.max) !== null && _a !== void 0 ? _a : getConf(self, 'maxScore');
|
|
248
133
|
},
|
|
249
|
-
/**
|
|
250
|
-
* #getter
|
|
251
|
-
*/
|
|
252
134
|
get minScore() {
|
|
253
135
|
var _a;
|
|
254
136
|
return (_a = self.constraints.min) !== null && _a !== void 0 ? _a : getConf(self, 'minScore');
|
|
255
137
|
},
|
|
256
138
|
}))
|
|
257
139
|
.views(self => ({
|
|
258
|
-
/**
|
|
259
|
-
* #getter
|
|
260
|
-
*/
|
|
261
140
|
get adapterCapabilities() {
|
|
262
141
|
const type = self.adapterTypeName;
|
|
263
142
|
const { pluginManager } = getEnv(self);
|
|
264
143
|
return pluginManager.getAdapterType(type).adapterCapabilities;
|
|
265
144
|
},
|
|
266
|
-
/**
|
|
267
|
-
* #getter
|
|
268
|
-
*/
|
|
269
145
|
get rendererConfig() {
|
|
270
146
|
const { color, displayCrossHatches, fill, minSize, negColor, posColor, summaryScoreMode, scaleType, rendererTypeName, } = self;
|
|
271
147
|
const configBlob = getConf(self, ['renderers', rendererTypeName]) || {};
|
|
@@ -283,9 +159,6 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
283
159
|
...(minSize !== undefined ? { minSize } : {}),
|
|
284
160
|
}, getEnv(self));
|
|
285
161
|
},
|
|
286
|
-
/**
|
|
287
|
-
* #getter
|
|
288
|
-
*/
|
|
289
162
|
get autoscaleType() {
|
|
290
163
|
var _a;
|
|
291
164
|
return (_a = self.autoscale) !== null && _a !== void 0 ? _a : getConf(self, 'autoscale');
|
|
@@ -294,9 +167,6 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
294
167
|
.views(self => {
|
|
295
168
|
let oldDomain = [0, 0];
|
|
296
169
|
return {
|
|
297
|
-
/**
|
|
298
|
-
* #getter
|
|
299
|
-
*/
|
|
300
170
|
get domain() {
|
|
301
171
|
const { stats, scaleType, minScore, maxScore } = self;
|
|
302
172
|
if (!stats) {
|
|
@@ -307,11 +177,9 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
307
177
|
bounds: [minScore, maxScore],
|
|
308
178
|
scaleType,
|
|
309
179
|
});
|
|
310
|
-
// avoid weird scalebar if log value and empty region displayed
|
|
311
180
|
if (scaleType === 'log' && ret[1] === Number.MIN_VALUE) {
|
|
312
181
|
return [0, Number.MIN_VALUE];
|
|
313
182
|
}
|
|
314
|
-
// avoid returning a new object if it matches the old value
|
|
315
183
|
if (JSON.stringify(oldDomain) !== JSON.stringify(ret)) {
|
|
316
184
|
oldDomain = ret;
|
|
317
185
|
}
|
|
@@ -320,23 +188,14 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
320
188
|
};
|
|
321
189
|
})
|
|
322
190
|
.views(self => ({
|
|
323
|
-
/**
|
|
324
|
-
* #getter
|
|
325
|
-
*/
|
|
326
191
|
get filled() {
|
|
327
192
|
const { fill, rendererConfig } = self;
|
|
328
193
|
return fill !== null && fill !== void 0 ? fill : readConfObject(rendererConfig, 'filled');
|
|
329
194
|
},
|
|
330
|
-
/**
|
|
331
|
-
* #getter
|
|
332
|
-
*/
|
|
333
195
|
get summaryScoreModeSetting() {
|
|
334
196
|
const { summaryScoreMode: mode, rendererConfig } = self;
|
|
335
197
|
return mode !== null && mode !== void 0 ? mode : readConfObject(rendererConfig, 'summaryScoreMode');
|
|
336
198
|
},
|
|
337
|
-
/**
|
|
338
|
-
* #getter
|
|
339
|
-
*/
|
|
340
199
|
get scaleOpts() {
|
|
341
200
|
return {
|
|
342
201
|
domain: self.domain,
|
|
@@ -346,36 +205,21 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
346
205
|
inverted: getConf(self, 'inverted'),
|
|
347
206
|
};
|
|
348
207
|
},
|
|
349
|
-
/**
|
|
350
|
-
* #getter
|
|
351
|
-
*/
|
|
352
208
|
get canHaveFill() {
|
|
353
209
|
return self.rendererTypeName === 'XYPlotRenderer';
|
|
354
210
|
},
|
|
355
|
-
/**
|
|
356
|
-
* #getter
|
|
357
|
-
*/
|
|
358
211
|
get displayCrossHatchesSetting() {
|
|
359
212
|
const { displayCrossHatches: hatches, rendererConfig } = self;
|
|
360
213
|
return hatches !== null && hatches !== void 0 ? hatches : readConfObject(rendererConfig, 'displayCrossHatches');
|
|
361
214
|
},
|
|
362
|
-
/**
|
|
363
|
-
* #getter
|
|
364
|
-
*/
|
|
365
215
|
get hasResolution() {
|
|
366
216
|
return self.adapterCapabilities.includes('hasResolution');
|
|
367
217
|
},
|
|
368
|
-
/**
|
|
369
|
-
* #getter
|
|
370
|
-
*/
|
|
371
218
|
get hasGlobalStats() {
|
|
372
219
|
return self.adapterCapabilities.includes('hasGlobalStats');
|
|
373
220
|
},
|
|
374
221
|
}))
|
|
375
222
|
.views(self => ({
|
|
376
|
-
/**
|
|
377
|
-
* #method
|
|
378
|
-
*/
|
|
379
223
|
scoreTrackMenuItems() {
|
|
380
224
|
return [
|
|
381
225
|
...(self.hasResolution
|
|
@@ -451,9 +295,6 @@ export default function SharedWiggleMixin(configSchema) {
|
|
|
451
295
|
.actions(self => {
|
|
452
296
|
const { reload: superReload } = self;
|
|
453
297
|
return {
|
|
454
|
-
/**
|
|
455
|
-
* #action
|
|
456
|
-
*/
|
|
457
298
|
async reload() {
|
|
458
299
|
self.setError();
|
|
459
300
|
superReload();
|
package/esm/util.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { QuantitativeStats } from '@jbrowse/core/util/stats';
|
|
2
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
3
1
|
export declare const YSCALEBAR_LABEL_OFFSET = 5;
|
|
4
2
|
export interface ScaleOpts {
|
|
5
3
|
domain: number[];
|
|
@@ -14,63 +12,13 @@ export interface Source {
|
|
|
14
12
|
color?: string;
|
|
15
13
|
group?: string;
|
|
16
14
|
}
|
|
17
|
-
/**
|
|
18
|
-
* produces a d3-scale from arguments. applies a "nice domain" adjustment
|
|
19
|
-
*
|
|
20
|
-
* @param object - containing attributes
|
|
21
|
-
* - domain [min,max]
|
|
22
|
-
* - range [min,max]
|
|
23
|
-
* - bounds [min,max]
|
|
24
|
-
* - scaleType (linear or log)
|
|
25
|
-
* - pivotValue (number)
|
|
26
|
-
* - inverted (boolean)
|
|
27
|
-
*/
|
|
28
15
|
export declare function getScale({ domain, range, scaleType, pivotValue, inverted, }: ScaleOpts): import("d3-scale").ScaleLinear<number, number, never> | import("d3-scale").ScaleLogarithmic<number, number, never> | import("d3-scale").ScaleQuantize<number, never>;
|
|
29
|
-
|
|
30
|
-
* gets the origin for drawing the graph. for linear this is 0, for log this is arbitrarily set to log(1)==0
|
|
31
|
-
*
|
|
32
|
-
* @param scaleType -
|
|
33
|
-
*/
|
|
34
|
-
export declare function getOrigin(scaleType: string): 0 | 1;
|
|
35
|
-
/**
|
|
36
|
-
* produces a "nice" domain that actually rounds down to 0 for the min
|
|
37
|
-
* or 0 to the max depending on if all values are positive or negative
|
|
38
|
-
*
|
|
39
|
-
* @param object - containing attributes
|
|
40
|
-
* - domain [min,max]
|
|
41
|
-
* - bounds [min,max]
|
|
42
|
-
* - mean
|
|
43
|
-
* - stddev
|
|
44
|
-
* - scaleType (linear or log)
|
|
45
|
-
*/
|
|
16
|
+
export declare function getOrigin(scaleType: string): 1 | 0;
|
|
46
17
|
export declare function getNiceDomain({ scaleType, domain, bounds, }: {
|
|
47
18
|
scaleType: string;
|
|
48
19
|
domain: readonly [number, number];
|
|
49
20
|
bounds: readonly [number | undefined, number | undefined];
|
|
50
21
|
}): [number, number];
|
|
51
|
-
export declare function getQuantitativeStats(self: {
|
|
52
|
-
adapterConfig: AnyConfigurationModel;
|
|
53
|
-
configuration: AnyConfigurationModel;
|
|
54
|
-
autoscaleType: string;
|
|
55
|
-
setMessage: (str: string) => void;
|
|
56
|
-
}, opts: {
|
|
57
|
-
headers?: Record<string, string>;
|
|
58
|
-
signal?: AbortSignal;
|
|
59
|
-
filters: string[];
|
|
60
|
-
}): Promise<QuantitativeStats>;
|
|
61
|
-
export declare function quantitativeStatsAutorun(self: {
|
|
62
|
-
featureDensityStatsReady: boolean;
|
|
63
|
-
regionTooLarge: boolean;
|
|
64
|
-
error: unknown;
|
|
65
|
-
setLoading: (aborter: AbortController) => void;
|
|
66
|
-
setError: (error: unknown) => void;
|
|
67
|
-
updateQuantitativeStats: (stats: QuantitativeStats, statsRegion: string) => void;
|
|
68
|
-
renderProps: () => Record<string, unknown>;
|
|
69
|
-
configuration: AnyConfigurationModel;
|
|
70
|
-
adapterConfig: AnyConfigurationModel;
|
|
71
|
-
autoscaleType: string;
|
|
72
|
-
setMessage: (str: string) => void;
|
|
73
|
-
}): void;
|
|
74
22
|
export declare function toP(s?: number): number;
|
|
75
23
|
export declare function round(value: number): number;
|
|
76
24
|
export declare function fillRectCtx(x: number, y: number, width: number, height: number, ctx: CanvasRenderingContext2D, color?: string): void;
|
package/esm/util.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { scaleLinear, scaleLog, scaleQuantize, } from '@mui/x-charts-vendor/d3-scale';
|
|
2
|
-
import { autorun } from 'mobx';
|
|
3
|
-
import { isAbortException, getSession, getContainingView, } from '@jbrowse/core/util';
|
|
4
|
-
import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
5
|
-
import { addDisposer, isAlive } from 'mobx-state-tree';
|
|
6
|
-
import { getConf } from '@jbrowse/core/configuration';
|
|
7
2
|
export const YSCALEBAR_LABEL_OFFSET = 5;
|
|
8
|
-
/**
|
|
9
|
-
* produces a d3-scale from arguments. applies a "nice domain" adjustment
|
|
10
|
-
*
|
|
11
|
-
* @param object - containing attributes
|
|
12
|
-
* - domain [min,max]
|
|
13
|
-
* - range [min,max]
|
|
14
|
-
* - bounds [min,max]
|
|
15
|
-
* - scaleType (linear or log)
|
|
16
|
-
* - pivotValue (number)
|
|
17
|
-
* - inverted (boolean)
|
|
18
|
-
*/
|
|
19
3
|
export function getScale({ domain = [], range = [], scaleType, pivotValue, inverted, }) {
|
|
20
4
|
let scale;
|
|
21
5
|
const [min, max] = domain;
|
|
@@ -43,40 +27,12 @@ export function getScale({ domain = [], range = [], scaleType, pivotValue, inver
|
|
|
43
27
|
scale.range(inverted ? range.slice().reverse() : range);
|
|
44
28
|
return scale;
|
|
45
29
|
}
|
|
46
|
-
|
|
47
|
-
* gets the origin for drawing the graph. for linear this is 0, for log this is arbitrarily set to log(1)==0
|
|
48
|
-
*
|
|
49
|
-
* @param scaleType -
|
|
50
|
-
*/
|
|
51
|
-
export function getOrigin(scaleType /* , pivot, stats */) {
|
|
52
|
-
// if (pivot) {
|
|
53
|
-
// if (pivot === 'mean') {
|
|
54
|
-
// return stats.scoreMean || 0
|
|
55
|
-
// }
|
|
56
|
-
// if (pivot === 'zero') {
|
|
57
|
-
// return 0
|
|
58
|
-
// }
|
|
59
|
-
// return parseFloat()
|
|
60
|
-
// }
|
|
61
|
-
// if (scaleType === 'z_score') {
|
|
62
|
-
// return stats.scoreMean || 0
|
|
63
|
-
// }
|
|
30
|
+
export function getOrigin(scaleType) {
|
|
64
31
|
if (scaleType === 'log') {
|
|
65
32
|
return 1;
|
|
66
33
|
}
|
|
67
34
|
return 0;
|
|
68
35
|
}
|
|
69
|
-
/**
|
|
70
|
-
* produces a "nice" domain that actually rounds down to 0 for the min
|
|
71
|
-
* or 0 to the max depending on if all values are positive or negative
|
|
72
|
-
*
|
|
73
|
-
* @param object - containing attributes
|
|
74
|
-
* - domain [min,max]
|
|
75
|
-
* - bounds [min,max]
|
|
76
|
-
* - mean
|
|
77
|
-
* - stddev
|
|
78
|
-
* - scaleType (linear or log)
|
|
79
|
-
*/
|
|
80
36
|
export function getNiceDomain({ scaleType, domain, bounds, }) {
|
|
81
37
|
const [minScore, maxScore] = bounds;
|
|
82
38
|
let [min, max] = domain;
|
|
@@ -89,9 +45,6 @@ export function getNiceDomain({ scaleType, domain, bounds, }) {
|
|
|
89
45
|
}
|
|
90
46
|
}
|
|
91
47
|
if (scaleType === 'log') {
|
|
92
|
-
// for min>0 and max>1, set log min to 1, which works for most coverage
|
|
93
|
-
// types tracks. if max is not >1, might be like raw p-values so then it'll
|
|
94
|
-
// display negative values
|
|
95
48
|
if (min >= 0 && max > 1) {
|
|
96
49
|
min = 1;
|
|
97
50
|
}
|
|
@@ -121,103 +74,12 @@ export function getNiceDomain({ scaleType, domain, bounds, }) {
|
|
|
121
74
|
scale.nice();
|
|
122
75
|
return scale.domain();
|
|
123
76
|
}
|
|
124
|
-
export async function getQuantitativeStats(self, opts) {
|
|
125
|
-
const { rpcManager } = getSession(self);
|
|
126
|
-
const numStdDev = getConf(self, 'numStdDev') || 3;
|
|
127
|
-
const { adapterConfig, autoscaleType } = self;
|
|
128
|
-
const sessionId = getRpcSessionId(self);
|
|
129
|
-
const params = {
|
|
130
|
-
sessionId,
|
|
131
|
-
adapterConfig,
|
|
132
|
-
statusCallback: (message) => {
|
|
133
|
-
if (isAlive(self)) {
|
|
134
|
-
self.setMessage(message);
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
...opts,
|
|
138
|
-
};
|
|
139
|
-
if (autoscaleType === 'global' || autoscaleType === 'globalsd') {
|
|
140
|
-
const results = (await rpcManager.call(sessionId, 'WiggleGetGlobalQuantitativeStats', params));
|
|
141
|
-
const { scoreMin, scoreMean, scoreStdDev } = results;
|
|
142
|
-
// globalsd uses heuristic to avoid unnecessary scoreMin<0
|
|
143
|
-
// if the scoreMin is never less than 0
|
|
144
|
-
// helps with most coverage bigwigs just being >0
|
|
145
|
-
return autoscaleType === 'globalsd'
|
|
146
|
-
? {
|
|
147
|
-
...results,
|
|
148
|
-
scoreMin: scoreMin >= 0 ? 0 : scoreMean - numStdDev * scoreStdDev,
|
|
149
|
-
scoreMax: scoreMean + numStdDev * scoreStdDev,
|
|
150
|
-
}
|
|
151
|
-
: results;
|
|
152
|
-
}
|
|
153
|
-
if (autoscaleType === 'local' || autoscaleType === 'localsd') {
|
|
154
|
-
const { dynamicBlocks, bpPerPx } = getContainingView(self);
|
|
155
|
-
const results = (await rpcManager.call(sessionId, 'WiggleGetMultiRegionQuantitativeStats', {
|
|
156
|
-
...params,
|
|
157
|
-
regions: dynamicBlocks.contentBlocks.map(region => {
|
|
158
|
-
const { start, end } = region;
|
|
159
|
-
return {
|
|
160
|
-
...JSON.parse(JSON.stringify(region)),
|
|
161
|
-
start: Math.floor(start),
|
|
162
|
-
end: Math.ceil(end),
|
|
163
|
-
};
|
|
164
|
-
}),
|
|
165
|
-
bpPerPx,
|
|
166
|
-
}));
|
|
167
|
-
const { scoreMin, scoreMean, scoreStdDev } = results;
|
|
168
|
-
// localsd uses heuristic to avoid unnecessary scoreMin<0 if the
|
|
169
|
-
// scoreMin is never less than 0 helps with most coverage bigwigs
|
|
170
|
-
// just being >0
|
|
171
|
-
return autoscaleType === 'localsd'
|
|
172
|
-
? {
|
|
173
|
-
...results,
|
|
174
|
-
scoreMin: scoreMin >= 0 ? 0 : scoreMean - numStdDev * scoreStdDev,
|
|
175
|
-
scoreMax: scoreMean + numStdDev * scoreStdDev,
|
|
176
|
-
}
|
|
177
|
-
: results;
|
|
178
|
-
}
|
|
179
|
-
if (autoscaleType === 'zscale') {
|
|
180
|
-
return rpcManager.call(sessionId, 'WiggleGetGlobalQuantitativeStats', params);
|
|
181
|
-
}
|
|
182
|
-
throw new Error(`invalid autoscaleType '${autoscaleType}'`);
|
|
183
|
-
}
|
|
184
|
-
export function quantitativeStatsAutorun(self) {
|
|
185
|
-
addDisposer(self, autorun(async () => {
|
|
186
|
-
try {
|
|
187
|
-
const aborter = new AbortController();
|
|
188
|
-
const view = getContainingView(self);
|
|
189
|
-
self.setLoading(aborter);
|
|
190
|
-
if (!view.initialized ||
|
|
191
|
-
!self.featureDensityStatsReady ||
|
|
192
|
-
self.regionTooLarge ||
|
|
193
|
-
self.error) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
const statsRegion = JSON.stringify(view.dynamicBlocks);
|
|
197
|
-
const wiggleStats = await getQuantitativeStats(self, {
|
|
198
|
-
signal: aborter.signal,
|
|
199
|
-
filters: [],
|
|
200
|
-
...self.renderProps(),
|
|
201
|
-
});
|
|
202
|
-
if (isAlive(self)) {
|
|
203
|
-
self.updateQuantitativeStats(wiggleStats, statsRegion);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
catch (e) {
|
|
207
|
-
if (!isAbortException(e) && isAlive(self)) {
|
|
208
|
-
console.error(e);
|
|
209
|
-
self.setError(e);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}, { delay: 1000 }));
|
|
213
|
-
}
|
|
214
77
|
export function toP(s = 0) {
|
|
215
78
|
return +(+s).toPrecision(6);
|
|
216
79
|
}
|
|
217
80
|
export function round(value) {
|
|
218
81
|
return Math.round(value * 1e5) / 1e5;
|
|
219
82
|
}
|
|
220
|
-
// avoid drawing negative width features for SVG exports
|
|
221
83
|
export function fillRectCtx(x, y, width, height, ctx, color) {
|
|
222
84
|
if (width < 0) {
|
|
223
85
|
x += width;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-wiggle",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.18.0",
|
|
4
4
|
"description": "JBrowse 2 wiggle adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -36,12 +36,10 @@
|
|
|
36
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@floating-ui/react": "^0.26.3",
|
|
40
39
|
"@gmod/bbi": "^5.0.0",
|
|
41
40
|
"@mui/icons-material": "^6.0.0",
|
|
42
41
|
"@mui/x-charts-vendor": "^7.12.0",
|
|
43
42
|
"@mui/x-data-grid": "^7.0.0",
|
|
44
|
-
"clone": "^2.1.2",
|
|
45
43
|
"fast-deep-equal": "^3.1.3",
|
|
46
44
|
"is-object": "^1.0.1",
|
|
47
45
|
"react-d3-axis-mod": "^0.1.9",
|
|
@@ -65,5 +63,5 @@
|
|
|
65
63
|
"distModule": "esm/index.js",
|
|
66
64
|
"srcModule": "src/index.ts",
|
|
67
65
|
"module": "esm/index.js",
|
|
68
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
|
|
69
67
|
}
|