@jbrowse/plugin-wiggle 1.5.9 → 1.6.4
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 +5 -3
- package/dist/LinearWiggleDisplay/components/SetColorDialog.d.ts +4 -2
- package/dist/LinearWiggleDisplay/models/model.d.ts +35 -6
- package/dist/index.d.ts +104 -18
- package/dist/plugin-wiggle.cjs.development.js +176 -106
- package/dist/plugin-wiggle.cjs.development.js.map +1 -1
- package/dist/plugin-wiggle.cjs.production.min.js +1 -1
- package/dist/plugin-wiggle.cjs.production.min.js.map +1 -1
- package/dist/plugin-wiggle.esm.js +178 -108
- package/dist/plugin-wiggle.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/BigWigAdapter/BigWigAdapter.ts +17 -13
- package/src/DensityRenderer/index.ts +3 -4
- package/src/LinearWiggleDisplay/components/SetColorDialog.tsx +84 -45
- package/src/LinearWiggleDisplay/components/WiggleDisplayComponent.tsx +2 -2
- package/src/LinearWiggleDisplay/models/configSchema.ts +1 -0
- package/src/LinearWiggleDisplay/models/model.tsx +34 -18
- package/src/index.ts +10 -5
- package/src/util.ts +1 -4
|
@@ -9,14 +9,14 @@ import { renderToAbstractCanvas } from '@jbrowse/core/util/offscreenCanvasUtils'
|
|
|
9
9
|
import { observer } from 'mobx-react';
|
|
10
10
|
import React, { useRef, useState, useMemo, lazy } from 'react';
|
|
11
11
|
import { PrerenderedCanvas } from '@jbrowse/core/ui';
|
|
12
|
-
import { featureSpanPx, getSession, isSelectionContainer, isAbortException, getContainingView, renameRegionsIfNeeded } from '@jbrowse/core/util';
|
|
12
|
+
import { featureSpanPx, getSession, isSelectionContainer, isAbortException, getContainingView, renameRegionsIfNeeded, updateStatus } from '@jbrowse/core/util';
|
|
13
13
|
import { scaleLinear, scaleLog, scaleQuantize } from 'd3-scale';
|
|
14
14
|
import { types, getEnv, addDisposer, isAlive } from 'mobx-state-tree';
|
|
15
15
|
import { baseLinearDisplayConfigSchema, BaseLinearDisplayComponent, BaseLinearDisplay } from '@jbrowse/plugin-linear-genome-view';
|
|
16
16
|
import { getRpcSessionId, getFileName } from '@jbrowse/core/util/tracks';
|
|
17
17
|
import { observable, autorun, when } from 'mobx';
|
|
18
18
|
import { Axis, LEFT, RIGHT, axisPropsFromTickScale } from 'react-d3-axis';
|
|
19
|
-
import { Portal, makeStyles, alpha, Dialog as Dialog$1, DialogTitle as DialogTitle$1, IconButton as IconButton$1, DialogContent as DialogContent$1, Button as Button$1 } from '@material-ui/core';
|
|
19
|
+
import { Portal, makeStyles, alpha, Dialog as Dialog$1, DialogTitle as DialogTitle$1, IconButton as IconButton$1, DialogContent as DialogContent$1, FormControlLabel, Radio, Typography as Typography$1, DialogActions, Button as Button$1 } from '@material-ui/core';
|
|
20
20
|
import { usePopper } from 'react-popper';
|
|
21
21
|
import Color from 'color';
|
|
22
22
|
import { getAdapter } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
@@ -147,14 +147,14 @@ function _inherits(subClass, superClass) {
|
|
|
147
147
|
throw new TypeError("Super expression must either be null or a function");
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
151
|
+
constructor: {
|
|
152
|
+
value: subClass,
|
|
153
|
+
writable: true,
|
|
154
|
+
configurable: true
|
|
155
|
+
}
|
|
156
|
+
});
|
|
150
157
|
Object.defineProperty(subClass, "prototype", {
|
|
151
|
-
value: Object.create(superClass && superClass.prototype, {
|
|
152
|
-
constructor: {
|
|
153
|
-
value: subClass,
|
|
154
|
-
writable: true,
|
|
155
|
-
configurable: true
|
|
156
|
-
}
|
|
157
|
-
}),
|
|
158
158
|
writable: false
|
|
159
159
|
});
|
|
160
160
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
@@ -1327,8 +1327,7 @@ function getScale(_ref) {
|
|
|
1327
1327
|
throw new Error('undefined scaleType');
|
|
1328
1328
|
}
|
|
1329
1329
|
|
|
1330
|
-
scale.domain(pivotValue !== undefined ? [min, pivotValue, max] : [min, max]);
|
|
1331
|
-
|
|
1330
|
+
scale.domain(pivotValue !== undefined ? [min, pivotValue, max] : [min, max]);
|
|
1332
1331
|
scale.nice();
|
|
1333
1332
|
|
|
1334
1333
|
var _range = _slicedToArray(range, 2),
|
|
@@ -1339,8 +1338,7 @@ function getScale(_ref) {
|
|
|
1339
1338
|
throw new Error('invalid range');
|
|
1340
1339
|
}
|
|
1341
1340
|
|
|
1342
|
-
scale.range(inverted ? range.slice().reverse() : range);
|
|
1343
|
-
|
|
1341
|
+
scale.range(inverted ? range.slice().reverse() : range);
|
|
1344
1342
|
return scale;
|
|
1345
1343
|
}
|
|
1346
1344
|
/**
|
|
@@ -1416,7 +1414,7 @@ function getNiceDomain(_ref2) {
|
|
|
1416
1414
|
}
|
|
1417
1415
|
|
|
1418
1416
|
if (min === undefined || max === undefined) {
|
|
1419
|
-
throw new Error('invalid domain');
|
|
1417
|
+
throw new Error('invalid domain supplied to stats function');
|
|
1420
1418
|
}
|
|
1421
1419
|
|
|
1422
1420
|
if (minScore !== undefined && minScore !== Number.MIN_VALUE) {
|
|
@@ -1551,12 +1549,11 @@ var DensityRenderer = /*#__PURE__*/function (_WiggleBaseRenderer) {
|
|
|
1551
1549
|
var pivotValue = readConfObject(config, 'bicolorPivotValue');
|
|
1552
1550
|
var negColor = readConfObject(config, 'negColor');
|
|
1553
1551
|
var posColor = readConfObject(config, 'posColor');
|
|
1552
|
+
var color = readConfObject(config, 'color');
|
|
1554
1553
|
var colorCallback;
|
|
1555
|
-
var colorScale;
|
|
1556
1554
|
|
|
1557
|
-
if (
|
|
1558
|
-
|
|
1559
|
-
colorScale = pivot !== 'none' ? getScale(_objectSpread2(_objectSpread2({}, scaleOpts), {}, {
|
|
1555
|
+
if (color === '#f0f') {
|
|
1556
|
+
var colorScale = pivot !== 'none' ? getScale(_objectSpread2(_objectSpread2({}, scaleOpts), {}, {
|
|
1560
1557
|
pivotValue: pivotValue,
|
|
1561
1558
|
range: [negColor, 'white', posColor]
|
|
1562
1559
|
})) : getScale(_objectSpread2(_objectSpread2({}, scaleOpts), {}, {
|
|
@@ -1801,11 +1798,10 @@ var YScaleBar = /*#__PURE__*/observer(function (_ref) {
|
|
|
1801
1798
|
});
|
|
1802
1799
|
var LinearWiggleDisplay = /*#__PURE__*/observer(function (props) {
|
|
1803
1800
|
var model = props.model;
|
|
1804
|
-
var
|
|
1805
|
-
stats = model.stats,
|
|
1801
|
+
var stats = model.stats,
|
|
1806
1802
|
height = model.height,
|
|
1807
1803
|
needsScalebar = model.needsScalebar;
|
|
1808
|
-
return React.createElement("div", null, React.createElement(BaseLinearDisplayComponent, Object.assign({}, props)),
|
|
1804
|
+
return React.createElement("div", null, React.createElement(BaseLinearDisplayComponent, Object.assign({}, props)), stats && needsScalebar ? React.createElement("svg", {
|
|
1809
1805
|
style: {
|
|
1810
1806
|
position: 'absolute',
|
|
1811
1807
|
top: 0,
|
|
@@ -1847,6 +1843,8 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
1847
1843
|
resolution: types.optional(types.number, 1),
|
|
1848
1844
|
fill: types.maybe(types["boolean"]),
|
|
1849
1845
|
color: types.maybe(types.string),
|
|
1846
|
+
posColor: types.maybe(types.string),
|
|
1847
|
+
negColor: types.maybe(types.string),
|
|
1850
1848
|
summaryScoreMode: types.maybe(types.string),
|
|
1851
1849
|
rendererTypeNameState: types.maybe(types.string),
|
|
1852
1850
|
scale: types.maybe(types.string),
|
|
@@ -1858,7 +1856,7 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
1858
1856
|
}), {})
|
|
1859
1857
|
}))["volatile"](function () {
|
|
1860
1858
|
return {
|
|
1861
|
-
|
|
1859
|
+
statsReady: false,
|
|
1862
1860
|
message: undefined,
|
|
1863
1861
|
stats: observable({
|
|
1864
1862
|
scoreMin: 0,
|
|
@@ -1871,11 +1869,17 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
1871
1869
|
updateStats: function updateStats(stats) {
|
|
1872
1870
|
self.stats.scoreMin = stats.scoreMin;
|
|
1873
1871
|
self.stats.scoreMax = stats.scoreMax;
|
|
1874
|
-
self.
|
|
1872
|
+
self.statsReady = true;
|
|
1875
1873
|
},
|
|
1876
1874
|
setColor: function setColor(color) {
|
|
1877
1875
|
self.color = color;
|
|
1878
1876
|
},
|
|
1877
|
+
setPosColor: function setPosColor(color) {
|
|
1878
|
+
self.posColor = color;
|
|
1879
|
+
},
|
|
1880
|
+
setNegColor: function setNegColor(color) {
|
|
1881
|
+
self.negColor = color;
|
|
1882
|
+
},
|
|
1879
1883
|
setLoading: function setLoading(aborter) {
|
|
1880
1884
|
var statsFetch = self.statsFetchInProgress;
|
|
1881
1885
|
|
|
@@ -1963,10 +1967,6 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
1963
1967
|
return self.scale || getConf(self, 'scaleType');
|
|
1964
1968
|
},
|
|
1965
1969
|
|
|
1966
|
-
get filled() {
|
|
1967
|
-
return typeof self.fill !== 'undefined' ? self.fill : readConfObject(this.rendererConfig, 'filled');
|
|
1968
|
-
},
|
|
1969
|
-
|
|
1970
1970
|
get maxScore() {
|
|
1971
1971
|
var max = self.constraints.max;
|
|
1972
1972
|
return max !== undefined ? max : getConf(self, 'maxScore');
|
|
@@ -1975,23 +1975,35 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
1975
1975
|
get minScore() {
|
|
1976
1976
|
var min = self.constraints.min;
|
|
1977
1977
|
return min !== undefined ? min : getConf(self, 'minScore');
|
|
1978
|
-
}
|
|
1978
|
+
}
|
|
1979
1979
|
|
|
1980
|
+
};
|
|
1981
|
+
}).views(function (self) {
|
|
1982
|
+
return {
|
|
1980
1983
|
get rendererConfig() {
|
|
1981
|
-
var configBlob = getConf(self, ['renderers',
|
|
1982
|
-
return self.rendererType.configSchema.create(_objectSpread2(_objectSpread2({}, configBlob), {}, {
|
|
1984
|
+
var configBlob = getConf(self, ['renderers', self.rendererTypeName]) || {};
|
|
1985
|
+
return self.rendererType.configSchema.create(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, configBlob), {}, {
|
|
1983
1986
|
filled: self.fill,
|
|
1984
|
-
scaleType:
|
|
1987
|
+
scaleType: self.scaleType,
|
|
1985
1988
|
displayCrossHatches: self.displayCrossHatches,
|
|
1986
|
-
summaryScoreMode: self.summaryScoreMode
|
|
1989
|
+
summaryScoreMode: self.summaryScoreMode
|
|
1990
|
+
}, self.color ? {
|
|
1987
1991
|
color: self.color
|
|
1988
|
-
}),
|
|
1992
|
+
} : {}), self.negColor ? {
|
|
1993
|
+
negColor: self.negColor
|
|
1994
|
+
} : {}), self.posColor ? {
|
|
1995
|
+
posColor: self.posColor
|
|
1996
|
+
} : {}), getEnv(self));
|
|
1989
1997
|
}
|
|
1990
1998
|
|
|
1991
1999
|
};
|
|
1992
2000
|
}).views(function (self) {
|
|
1993
2001
|
var oldDomain = [0, 0];
|
|
1994
2002
|
return {
|
|
2003
|
+
get filled() {
|
|
2004
|
+
return typeof self.fill !== 'undefined' ? self.fill : readConfObject(self.rendererConfig, 'filled');
|
|
2005
|
+
},
|
|
2006
|
+
|
|
1995
2007
|
get summaryScoreModeSetting() {
|
|
1996
2008
|
return self.summaryScoreMode || readConfObject(self.rendererConfig, 'summaryScoreMode');
|
|
1997
2009
|
},
|
|
@@ -2079,8 +2091,9 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
2079
2091
|
var superRenderProps = self.renderProps;
|
|
2080
2092
|
return {
|
|
2081
2093
|
renderProps: function renderProps() {
|
|
2082
|
-
|
|
2083
|
-
|
|
2094
|
+
var superProps = superRenderProps();
|
|
2095
|
+
return _objectSpread2(_objectSpread2({}, superProps), {}, {
|
|
2096
|
+
notReady: superProps.notReady || !self.statsReady,
|
|
2084
2097
|
rpcDriverName: self.rpcDriverName,
|
|
2085
2098
|
displayModel: self,
|
|
2086
2099
|
config: self.rendererConfig,
|
|
@@ -2342,7 +2355,7 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
2342
2355
|
},
|
|
2343
2356
|
afterAttach: function afterAttach() {
|
|
2344
2357
|
addDisposer(self, autorun( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
2345
|
-
var aborter, view,
|
|
2358
|
+
var aborter, view, wiggleStats;
|
|
2346
2359
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
2347
2360
|
while (1) {
|
|
2348
2361
|
switch (_context2.prev = _context2.next) {
|
|
@@ -2360,7 +2373,7 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
2360
2373
|
return _context2.abrupt("return");
|
|
2361
2374
|
|
|
2362
2375
|
case 6:
|
|
2363
|
-
if (
|
|
2376
|
+
if (self.estimatedStatsReady) {
|
|
2364
2377
|
_context2.next = 8;
|
|
2365
2378
|
break;
|
|
2366
2379
|
}
|
|
@@ -2368,24 +2381,32 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
2368
2381
|
return _context2.abrupt("return");
|
|
2369
2382
|
|
|
2370
2383
|
case 8:
|
|
2371
|
-
|
|
2384
|
+
if (!self.regionTooLarge) {
|
|
2385
|
+
_context2.next = 10;
|
|
2386
|
+
break;
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
return _context2.abrupt("return");
|
|
2390
|
+
|
|
2391
|
+
case 10:
|
|
2392
|
+
_context2.next = 12;
|
|
2372
2393
|
return getStats({
|
|
2373
2394
|
signal: aborter.signal,
|
|
2374
2395
|
filters: self.filters
|
|
2375
2396
|
});
|
|
2376
2397
|
|
|
2377
|
-
case
|
|
2378
|
-
|
|
2398
|
+
case 12:
|
|
2399
|
+
wiggleStats = _context2.sent;
|
|
2379
2400
|
|
|
2380
2401
|
if (isAlive(self)) {
|
|
2381
|
-
self.updateStats(
|
|
2402
|
+
self.updateStats(wiggleStats);
|
|
2382
2403
|
}
|
|
2383
2404
|
|
|
2384
|
-
_context2.next =
|
|
2405
|
+
_context2.next = 19;
|
|
2385
2406
|
break;
|
|
2386
2407
|
|
|
2387
|
-
case
|
|
2388
|
-
_context2.prev =
|
|
2408
|
+
case 16:
|
|
2409
|
+
_context2.prev = 16;
|
|
2389
2410
|
_context2.t0 = _context2["catch"](0);
|
|
2390
2411
|
|
|
2391
2412
|
if (!isAbortException(_context2.t0) && isAlive(self)) {
|
|
@@ -2393,12 +2414,12 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
2393
2414
|
self.setError(_context2.t0);
|
|
2394
2415
|
}
|
|
2395
2416
|
|
|
2396
|
-
case
|
|
2417
|
+
case 19:
|
|
2397
2418
|
case "end":
|
|
2398
2419
|
return _context2.stop();
|
|
2399
2420
|
}
|
|
2400
2421
|
}
|
|
2401
|
-
}, _callee2, null, [[0,
|
|
2422
|
+
}, _callee2, null, [[0, 16]]);
|
|
2402
2423
|
})), {
|
|
2403
2424
|
delay: 1000
|
|
2404
2425
|
}));
|
|
@@ -2413,7 +2434,7 @@ var stateModelFactory = function stateModelFactory(pluginManager, configSchema)
|
|
|
2413
2434
|
case 0:
|
|
2414
2435
|
_context3.next = 2;
|
|
2415
2436
|
return when(function () {
|
|
2416
|
-
return self.
|
|
2437
|
+
return self.statsReady && !!self.regionCannotBeRenderedText;
|
|
2417
2438
|
});
|
|
2418
2439
|
|
|
2419
2440
|
case 2:
|
|
@@ -3065,12 +3086,15 @@ var WigglePlugin = /*#__PURE__*/function (_Plugin) {
|
|
|
3065
3086
|
var regexGuess = /\.(bw|bigwig)$/i;
|
|
3066
3087
|
var adapterName = 'BigWigAdapter';
|
|
3067
3088
|
var fileName = getFileName(file);
|
|
3089
|
+
var obj = {
|
|
3090
|
+
type: adapterName,
|
|
3091
|
+
bigWigLocation: file
|
|
3092
|
+
};
|
|
3068
3093
|
|
|
3069
|
-
if (regexGuess.test(fileName)
|
|
3070
|
-
return
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
};
|
|
3094
|
+
if (regexGuess.test(fileName) && !adapterHint) {
|
|
3095
|
+
return obj;
|
|
3096
|
+
} else if (adapterHint === adapterName) {
|
|
3097
|
+
return obj;
|
|
3074
3098
|
}
|
|
3075
3099
|
|
|
3076
3100
|
return adapterGuesser(file, index, adapterHint);
|
|
@@ -3201,9 +3225,8 @@ var SetMinMaxDialog = {
|
|
|
3201
3225
|
'default': SetMinMaxDlg$1
|
|
3202
3226
|
};
|
|
3203
3227
|
|
|
3204
|
-
var useStyles$2 = /*#__PURE__*/makeStyles
|
|
3228
|
+
var useStyles$2 = /*#__PURE__*/makeStyles(function (theme) {
|
|
3205
3229
|
return {
|
|
3206
|
-
root: {},
|
|
3207
3230
|
closeButton: {
|
|
3208
3231
|
position: 'absolute',
|
|
3209
3232
|
right: theme.spacing(1),
|
|
@@ -3214,61 +3237,78 @@ var useStyles$2 = /*#__PURE__*/makeStyles$1(function (theme) {
|
|
|
3214
3237
|
}); // this is needed because passing a entire color object into the react-color
|
|
3215
3238
|
// for alpha, can't pass in an rgba string for example
|
|
3216
3239
|
|
|
3217
|
-
function
|
|
3240
|
+
function serialize(color) {
|
|
3218
3241
|
if (color instanceof Object) {
|
|
3219
3242
|
var r = color.r,
|
|
3220
3243
|
g = color.g,
|
|
3221
|
-
b = color.b
|
|
3222
|
-
|
|
3223
|
-
return "rgb(".concat(r, ",").concat(g, ",").concat(b, ",").concat(a, ")");
|
|
3244
|
+
b = color.b;
|
|
3245
|
+
return "rgb(".concat(r, ",").concat(g, ",").concat(b, ")");
|
|
3224
3246
|
}
|
|
3225
3247
|
|
|
3226
3248
|
return color;
|
|
3227
3249
|
}
|
|
3228
3250
|
|
|
3229
|
-
function SetColorDialog(
|
|
3251
|
+
function SetColorDialog(_ref) {
|
|
3252
|
+
var model = _ref.model,
|
|
3253
|
+
handleClose = _ref.handleClose;
|
|
3230
3254
|
var classes = useStyles$2();
|
|
3231
|
-
|
|
3232
|
-
|
|
3255
|
+
|
|
3256
|
+
var _useState = useState(false),
|
|
3257
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
3258
|
+
posneg = _useState2[0],
|
|
3259
|
+
setPosNeg = _useState2[1];
|
|
3260
|
+
|
|
3233
3261
|
return React.createElement(Dialog$1, {
|
|
3234
3262
|
open: true,
|
|
3235
|
-
onClose: handleClose
|
|
3236
|
-
|
|
3237
|
-
"aria-describedby": "alert-dialog-description"
|
|
3238
|
-
}, React.createElement(DialogTitle$1, {
|
|
3239
|
-
id: "alert-dialog-title"
|
|
3240
|
-
}, "Select a color", React.createElement(IconButton$1, {
|
|
3263
|
+
onClose: handleClose
|
|
3264
|
+
}, React.createElement(DialogTitle$1, null, "Select either an overall color, or the positive/negative colors. Note that density renderers only work properly with positive/negative colors", React.createElement(IconButton$1, {
|
|
3241
3265
|
"aria-label": "close",
|
|
3242
3266
|
className: classes.closeButton,
|
|
3243
3267
|
onClick: handleClose
|
|
3244
|
-
}, React.createElement(CloseIcon, null))), React.createElement(DialogContent$1, {
|
|
3245
|
-
|
|
3246
|
-
|
|
3268
|
+
}, React.createElement(CloseIcon, null))), React.createElement(DialogContent$1, null, React.createElement(FormControlLabel, {
|
|
3269
|
+
checked: !posneg,
|
|
3270
|
+
onClick: function onClick() {
|
|
3271
|
+
return setPosNeg(false);
|
|
3272
|
+
},
|
|
3273
|
+
control: React.createElement(Radio, null),
|
|
3274
|
+
label: 'Overall color'
|
|
3275
|
+
}), React.createElement(FormControlLabel, {
|
|
3276
|
+
checked: posneg,
|
|
3277
|
+
onClick: function onClick() {
|
|
3278
|
+
return setPosNeg(true);
|
|
3279
|
+
},
|
|
3280
|
+
control: React.createElement(Radio, null),
|
|
3281
|
+
label: 'Positive/negative color'
|
|
3282
|
+
}), posneg ? React.createElement(React.Fragment, null, React.createElement(Typography$1, null, "Positive color"), React.createElement(CompactPicker, {
|
|
3283
|
+
onChange: function onChange(event) {
|
|
3284
|
+
model.setPosColor(serialize(event.rgb));
|
|
3285
|
+
model.setColor(undefined);
|
|
3247
3286
|
}
|
|
3248
|
-
}, React.createElement("
|
|
3249
|
-
className: classes.root
|
|
3250
|
-
}, React.createElement(CompactPicker, {
|
|
3287
|
+
}), React.createElement(Typography$1, null, "Negative color"), React.createElement(CompactPicker, {
|
|
3251
3288
|
onChange: function onChange(event) {
|
|
3252
|
-
model.
|
|
3289
|
+
model.setNegColor(serialize(event.rgb));
|
|
3290
|
+
model.setColor(undefined);
|
|
3253
3291
|
}
|
|
3254
|
-
})
|
|
3255
|
-
|
|
3256
|
-
|
|
3292
|
+
})) : React.createElement(React.Fragment, null, React.createElement(Typography$1, null, "Overall color"), React.createElement(CompactPicker, {
|
|
3293
|
+
onChange: function onChange(event) {
|
|
3294
|
+
model.setColor(serialize(event.rgb));
|
|
3257
3295
|
}
|
|
3258
|
-
}, React.createElement(Button$1, {
|
|
3296
|
+
}))), React.createElement(DialogActions, null, React.createElement(Button$1, {
|
|
3259
3297
|
onClick: function onClick() {
|
|
3298
|
+
model.setPosColor(undefined);
|
|
3299
|
+
model.setNegColor(undefined);
|
|
3260
3300
|
model.setColor(undefined);
|
|
3261
3301
|
},
|
|
3262
3302
|
color: "secondary",
|
|
3263
3303
|
variant: "contained"
|
|
3264
|
-
}, "Restore default
|
|
3304
|
+
}, "Restore default"), React.createElement(Button$1, {
|
|
3265
3305
|
variant: "contained",
|
|
3266
3306
|
color: "primary",
|
|
3267
3307
|
type: "submit",
|
|
3268
3308
|
onClick: function onClick() {
|
|
3269
3309
|
handleClose();
|
|
3270
3310
|
}
|
|
3271
|
-
}, "Submit")))
|
|
3311
|
+
}, "Submit")));
|
|
3272
3312
|
}
|
|
3273
3313
|
|
|
3274
3314
|
var SetColorDialog$1 = {
|
|
@@ -3297,28 +3337,25 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3297
3337
|
key: "setup",
|
|
3298
3338
|
value: function () {
|
|
3299
3339
|
var _setup = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(opts) {
|
|
3300
|
-
var
|
|
3340
|
+
var _this2 = this;
|
|
3341
|
+
|
|
3342
|
+
var _ref, _ref$statusCallback, statusCallback;
|
|
3301
3343
|
|
|
3302
3344
|
return runtime_1.wrap(function _callee$(_context) {
|
|
3303
3345
|
while (1) {
|
|
3304
3346
|
switch (_context.prev = _context.next) {
|
|
3305
3347
|
case 0:
|
|
3306
3348
|
_ref = opts || {}, _ref$statusCallback = _ref.statusCallback, statusCallback = _ref$statusCallback === void 0 ? function () {} : _ref$statusCallback;
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
case 4:
|
|
3312
|
-
result = _context.sent;
|
|
3313
|
-
statusCallback('');
|
|
3314
|
-
return _context.abrupt("return", result);
|
|
3349
|
+
return _context.abrupt("return", updateStatus('Downloading bigwig header', statusCallback, function () {
|
|
3350
|
+
return _this2.bigwig.getHeader(opts);
|
|
3351
|
+
}));
|
|
3315
3352
|
|
|
3316
|
-
case
|
|
3353
|
+
case 2:
|
|
3317
3354
|
case "end":
|
|
3318
3355
|
return _context.stop();
|
|
3319
3356
|
}
|
|
3320
3357
|
}
|
|
3321
|
-
}, _callee
|
|
3358
|
+
}, _callee);
|
|
3322
3359
|
}));
|
|
3323
3360
|
|
|
3324
3361
|
function setup(_x) {
|
|
@@ -3331,7 +3368,8 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3331
3368
|
key: "getRefNames",
|
|
3332
3369
|
value: function () {
|
|
3333
3370
|
var _getRefNames = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(opts) {
|
|
3334
|
-
var
|
|
3371
|
+
var _yield$this$setup, refsByName;
|
|
3372
|
+
|
|
3335
3373
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
3336
3374
|
while (1) {
|
|
3337
3375
|
switch (_context2.prev = _context2.next) {
|
|
@@ -3340,10 +3378,11 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3340
3378
|
return this.setup(opts);
|
|
3341
3379
|
|
|
3342
3380
|
case 2:
|
|
3343
|
-
|
|
3344
|
-
|
|
3381
|
+
_yield$this$setup = _context2.sent;
|
|
3382
|
+
refsByName = _yield$this$setup.refsByName;
|
|
3383
|
+
return _context2.abrupt("return", Object.keys(refsByName));
|
|
3345
3384
|
|
|
3346
|
-
case
|
|
3385
|
+
case 5:
|
|
3347
3386
|
case "end":
|
|
3348
3387
|
return _context2.stop();
|
|
3349
3388
|
}
|
|
@@ -3361,7 +3400,10 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3361
3400
|
key: "refIdToName",
|
|
3362
3401
|
value: function () {
|
|
3363
3402
|
var _refIdToName = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(refId) {
|
|
3364
|
-
var
|
|
3403
|
+
var _refsByNumber$refId;
|
|
3404
|
+
|
|
3405
|
+
var _yield$this$setup2, refsByNumber;
|
|
3406
|
+
|
|
3365
3407
|
return runtime_1.wrap(function _callee3$(_context3) {
|
|
3366
3408
|
while (1) {
|
|
3367
3409
|
switch (_context3.prev = _context3.next) {
|
|
@@ -3370,12 +3412,11 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3370
3412
|
return this.setup();
|
|
3371
3413
|
|
|
3372
3414
|
case 2:
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
}).name);
|
|
3415
|
+
_yield$this$setup2 = _context3.sent;
|
|
3416
|
+
refsByNumber = _yield$this$setup2.refsByNumber;
|
|
3417
|
+
return _context3.abrupt("return", (_refsByNumber$refId = refsByNumber[refId]) === null || _refsByNumber$refId === void 0 ? void 0 : _refsByNumber$refId.name);
|
|
3377
3418
|
|
|
3378
|
-
case
|
|
3419
|
+
case 5:
|
|
3379
3420
|
case "end":
|
|
3380
3421
|
return _context3.stop();
|
|
3381
3422
|
}
|
|
@@ -3393,7 +3434,8 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3393
3434
|
key: "getGlobalStats",
|
|
3394
3435
|
value: function () {
|
|
3395
3436
|
var _getGlobalStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(opts) {
|
|
3396
|
-
var
|
|
3437
|
+
var _yield$this$setup3, totalSummary;
|
|
3438
|
+
|
|
3397
3439
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
3398
3440
|
while (1) {
|
|
3399
3441
|
switch (_context4.prev = _context4.next) {
|
|
@@ -3402,10 +3444,11 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3402
3444
|
return this.setup(opts);
|
|
3403
3445
|
|
|
3404
3446
|
case 2:
|
|
3405
|
-
|
|
3406
|
-
|
|
3447
|
+
_yield$this$setup3 = _context4.sent;
|
|
3448
|
+
totalSummary = _yield$this$setup3.totalSummary;
|
|
3449
|
+
return _context4.abrupt("return", rectifyStats(totalSummary));
|
|
3407
3450
|
|
|
3408
|
-
case
|
|
3451
|
+
case 5:
|
|
3409
3452
|
case "end":
|
|
3410
3453
|
return _context4.stop();
|
|
3411
3454
|
}
|
|
@@ -3422,7 +3465,7 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3422
3465
|
}, {
|
|
3423
3466
|
key: "getFeatures",
|
|
3424
3467
|
value: function getFeatures(region) {
|
|
3425
|
-
var
|
|
3468
|
+
var _this3 = this;
|
|
3426
3469
|
|
|
3427
3470
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3428
3471
|
var refName = region.refName,
|
|
@@ -3444,7 +3487,7 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3444
3487
|
case 0:
|
|
3445
3488
|
statusCallback('Downloading bigwig data');
|
|
3446
3489
|
_context5.next = 3;
|
|
3447
|
-
return
|
|
3490
|
+
return _this3.bigwig.getFeatureStream(refName, start, end, _objectSpread2(_objectSpread2({}, opts), {}, {
|
|
3448
3491
|
basesPerSpan: bpPerPx / resolution
|
|
3449
3492
|
}));
|
|
3450
3493
|
|
|
@@ -3471,7 +3514,34 @@ var BigWigAdapter = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
3471
3514
|
return _ref2.apply(this, arguments);
|
|
3472
3515
|
};
|
|
3473
3516
|
}(), signal);
|
|
3474
|
-
}
|
|
3517
|
+
} // always render bigwig instead of calculating a feature density for it
|
|
3518
|
+
|
|
3519
|
+
}, {
|
|
3520
|
+
key: "estimateRegionsStats",
|
|
3521
|
+
value: function () {
|
|
3522
|
+
var _estimateRegionsStats = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(_regions) {
|
|
3523
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
3524
|
+
while (1) {
|
|
3525
|
+
switch (_context6.prev = _context6.next) {
|
|
3526
|
+
case 0:
|
|
3527
|
+
return _context6.abrupt("return", {
|
|
3528
|
+
featureDensity: 0
|
|
3529
|
+
});
|
|
3530
|
+
|
|
3531
|
+
case 1:
|
|
3532
|
+
case "end":
|
|
3533
|
+
return _context6.stop();
|
|
3534
|
+
}
|
|
3535
|
+
}
|
|
3536
|
+
}, _callee6);
|
|
3537
|
+
}));
|
|
3538
|
+
|
|
3539
|
+
function estimateRegionsStats(_x6) {
|
|
3540
|
+
return _estimateRegionsStats.apply(this, arguments);
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
return estimateRegionsStats;
|
|
3544
|
+
}()
|
|
3475
3545
|
}, {
|
|
3476
3546
|
key: "freeResources",
|
|
3477
3547
|
value: function freeResources() {}
|