@jbrowse/plugin-wiggle 1.6.7 → 1.7.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.js +288 -0
- package/dist/BigWigAdapter/BigWigAdapter.test.js +157 -0
- package/dist/BigWigAdapter/configSchema.js +22 -0
- package/dist/BigWigAdapter/index.js +15 -0
- package/dist/DensityRenderer/DensityRenderer.test.js +84 -0
- package/dist/DensityRenderer/index.js +137 -0
- package/dist/LinePlotRenderer/LinePlotRenderer.js +171 -0
- package/dist/LinePlotRenderer/configSchema.js +70 -0
- package/dist/LinePlotRenderer/index.js +34 -0
- package/dist/LinearWiggleDisplay/components/SetColorDialog.js +111 -0
- package/dist/LinearWiggleDisplay/components/SetMinMaxDialog.js +112 -0
- package/dist/LinearWiggleDisplay/components/Tooltip.js +167 -0
- package/dist/LinearWiggleDisplay/components/WiggleDisplayComponent.js +52 -0
- package/dist/LinearWiggleDisplay/components/YScaleBar.js +33 -0
- package/dist/LinearWiggleDisplay/index.js +43 -0
- package/dist/LinearWiggleDisplay/models/configSchema.js +71 -0
- package/dist/LinearWiggleDisplay/models/model.js +706 -0
- package/dist/WiggleBaseRenderer.js +131 -0
- package/dist/WiggleRPC/rpcMethods.js +295 -0
- package/dist/WiggleRendering.js +109 -0
- package/dist/WiggleRendering.test.js +52 -0
- package/dist/XYPlotRenderer/XYPlotRenderer.js +199 -0
- package/dist/XYPlotRenderer/XYPlotRenderer.test.js +83 -0
- package/dist/XYPlotRenderer/index.js +34 -0
- package/dist/configSchema.js +75 -0
- package/dist/declare.d.js +1 -0
- package/dist/index.d.ts +25 -25
- package/dist/index.js +251 -6
- package/dist/index.test.js +24 -0
- package/dist/plugin-wiggle.cjs.development.js +1 -1
- 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 +1 -1
- package/dist/plugin-wiggle.esm.js.map +1 -1
- package/dist/util.js +178 -0
- package/dist/util.test.js +66 -0
- package/package.json +3 -6
- package/src/LinearWiggleDisplay/components/Tooltip.tsx +1 -1
- package/src/LinearWiggleDisplay/models/model.tsx +2 -2
- package/src/WiggleBaseRenderer.tsx +1 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
+
|
|
16
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
+
|
|
18
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
+
|
|
20
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
+
|
|
22
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
+
|
|
24
|
+
var _configuration = require("@jbrowse/core/configuration");
|
|
25
|
+
|
|
26
|
+
var _util = require("@jbrowse/core/util");
|
|
27
|
+
|
|
28
|
+
var _color = _interopRequireDefault(require("color"));
|
|
29
|
+
|
|
30
|
+
var _util2 = require("../util");
|
|
31
|
+
|
|
32
|
+
var _WiggleBaseRenderer2 = _interopRequireDefault(require("../WiggleBaseRenderer"));
|
|
33
|
+
|
|
34
|
+
var _model = require("../LinearWiggleDisplay/models/model");
|
|
35
|
+
|
|
36
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
37
|
+
|
|
38
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39
|
+
|
|
40
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
41
|
+
|
|
42
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
|
+
|
|
44
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
45
|
+
|
|
46
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
47
|
+
|
|
48
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
49
|
+
|
|
50
|
+
var XYPlotRenderer = /*#__PURE__*/function (_WiggleBaseRenderer) {
|
|
51
|
+
(0, _inherits2["default"])(XYPlotRenderer, _WiggleBaseRenderer);
|
|
52
|
+
|
|
53
|
+
var _super = _createSuper(XYPlotRenderer);
|
|
54
|
+
|
|
55
|
+
function XYPlotRenderer() {
|
|
56
|
+
(0, _classCallCheck2["default"])(this, XYPlotRenderer);
|
|
57
|
+
return _super.apply(this, arguments);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
(0, _createClass2["default"])(XYPlotRenderer, [{
|
|
61
|
+
key: "draw",
|
|
62
|
+
value: function draw(ctx, props) {
|
|
63
|
+
var features = props.features,
|
|
64
|
+
bpPerPx = props.bpPerPx,
|
|
65
|
+
regions = props.regions,
|
|
66
|
+
scaleOpts = props.scaleOpts,
|
|
67
|
+
unadjustedHeight = props.height,
|
|
68
|
+
config = props.config,
|
|
69
|
+
ticks = props.ticks,
|
|
70
|
+
displayCrossHatches = props.displayCrossHatches;
|
|
71
|
+
|
|
72
|
+
var _regions = (0, _slicedToArray2["default"])(regions, 1),
|
|
73
|
+
region = _regions[0];
|
|
74
|
+
|
|
75
|
+
var width = (region.end - region.start) / bpPerPx; // the adjusted height takes into account YSCALEBAR_LABEL_OFFSET from the
|
|
76
|
+
// wiggle display, and makes the height of the actual drawn area add
|
|
77
|
+
// "padding" to the top and bottom of the display
|
|
78
|
+
|
|
79
|
+
var offset = _model.YSCALEBAR_LABEL_OFFSET;
|
|
80
|
+
var height = unadjustedHeight - offset * 2;
|
|
81
|
+
var pivotValue = (0, _configuration.readConfObject)(config, 'bicolorPivotValue');
|
|
82
|
+
var negColor = (0, _configuration.readConfObject)(config, 'negColor');
|
|
83
|
+
var posColor = (0, _configuration.readConfObject)(config, 'posColor');
|
|
84
|
+
var filled = (0, _configuration.readConfObject)(config, 'filled');
|
|
85
|
+
var clipColor = (0, _configuration.readConfObject)(config, 'clipColor');
|
|
86
|
+
var highlightColor = (0, _configuration.readConfObject)(config, 'highlightColor');
|
|
87
|
+
var summaryScoreMode = (0, _configuration.readConfObject)(config, 'summaryScoreMode');
|
|
88
|
+
var scale = (0, _util2.getScale)(_objectSpread(_objectSpread({}, scaleOpts), {}, {
|
|
89
|
+
range: [0, height]
|
|
90
|
+
}));
|
|
91
|
+
var originY = (0, _util2.getOrigin)(scaleOpts.scaleType);
|
|
92
|
+
|
|
93
|
+
var _scale$domain = scale.domain(),
|
|
94
|
+
_scale$domain2 = (0, _slicedToArray2["default"])(_scale$domain, 2),
|
|
95
|
+
niceMin = _scale$domain2[0],
|
|
96
|
+
niceMax = _scale$domain2[1];
|
|
97
|
+
|
|
98
|
+
var toY = function toY(n) {
|
|
99
|
+
return height - (scale(n) || 0) + offset;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var toHeight = function toHeight(n) {
|
|
103
|
+
return toY(originY) - toY(n);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
var colorCallback = (0, _configuration.readConfObject)(config, 'color') === '#f0f' ? function (_, score) {
|
|
107
|
+
return score < pivotValue ? negColor : posColor;
|
|
108
|
+
} : function (feature, _score) {
|
|
109
|
+
return (0, _configuration.readConfObject)(config, 'color', {
|
|
110
|
+
feature: feature
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
var crossingOrigin = niceMin < pivotValue && niceMax > pivotValue;
|
|
114
|
+
|
|
115
|
+
var _iterator = _createForOfIteratorHelper(features.values()),
|
|
116
|
+
_step;
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
120
|
+
var feature = _step.value;
|
|
121
|
+
|
|
122
|
+
var _featureSpanPx = (0, _util.featureSpanPx)(feature, region, bpPerPx),
|
|
123
|
+
_featureSpanPx2 = (0, _slicedToArray2["default"])(_featureSpanPx, 2),
|
|
124
|
+
leftPx = _featureSpanPx2[0],
|
|
125
|
+
rightPx = _featureSpanPx2[1];
|
|
126
|
+
|
|
127
|
+
var score = feature.get('score');
|
|
128
|
+
var maxr = feature.get('maxScore');
|
|
129
|
+
var minr = feature.get('minScore');
|
|
130
|
+
var lowClipping = score < niceMin;
|
|
131
|
+
var highClipping = score > niceMax;
|
|
132
|
+
var w = rightPx - leftPx + 0.4; // fudge factor for subpixel rendering
|
|
133
|
+
|
|
134
|
+
var summary = feature.get('summary');
|
|
135
|
+
|
|
136
|
+
if (summaryScoreMode === 'max') {
|
|
137
|
+
score = summary ? maxr : score;
|
|
138
|
+
ctx.fillStyle = colorCallback(feature, score);
|
|
139
|
+
ctx.fillRect(leftPx, toY(score), w, filled ? toHeight(score) : 1);
|
|
140
|
+
} else if (summaryScoreMode === 'min') {
|
|
141
|
+
score = summary ? minr : score;
|
|
142
|
+
ctx.fillStyle = colorCallback(feature, score);
|
|
143
|
+
ctx.fillRect(leftPx, toY(score), w, filled ? toHeight(score) : 1);
|
|
144
|
+
} else if (summaryScoreMode === 'whiskers') {
|
|
145
|
+
var c = colorCallback(feature, score);
|
|
146
|
+
|
|
147
|
+
if (summary) {
|
|
148
|
+
ctx.fillStyle = crossingOrigin ? colorCallback(feature, maxr) : (0, _color["default"])(c).lighten(0.6).toString();
|
|
149
|
+
ctx.fillRect(leftPx, toY(maxr), w, filled ? toHeight(maxr) - toHeight(score) : 1);
|
|
150
|
+
} // normal
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
ctx.fillStyle = crossingOrigin && summary ? (0, _color["default"])(colorCallback(feature, maxr)).mix((0, _color["default"])(colorCallback(feature, minr))) : c;
|
|
154
|
+
ctx.fillRect(leftPx, toY(score), w, filled ? toHeight(score) - (summary ? toHeight(minr) : 0) : 1); // min
|
|
155
|
+
|
|
156
|
+
if (summary) {
|
|
157
|
+
ctx.fillStyle = crossingOrigin ? colorCallback(feature, minr) : (0, _color["default"])(c).darken(0.6).toString();
|
|
158
|
+
ctx.fillRect(leftPx, toY(minr), w, filled ? toHeight(minr) : 1);
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
ctx.fillStyle = colorCallback(feature, score);
|
|
162
|
+
ctx.fillRect(leftPx, toY(score), w, filled ? toHeight(score) : 1);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (highClipping) {
|
|
166
|
+
ctx.fillStyle = clipColor;
|
|
167
|
+
ctx.fillRect(leftPx, 0, w, 4);
|
|
168
|
+
} else if (lowClipping && scaleOpts.scaleType !== 'log') {
|
|
169
|
+
ctx.fillStyle = clipColor;
|
|
170
|
+
ctx.fillRect(leftPx, unadjustedHeight - 4, w, 4);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (feature.get('highlighted')) {
|
|
174
|
+
ctx.fillStyle = highlightColor;
|
|
175
|
+
ctx.fillRect(leftPx, 0, w, height);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
} catch (err) {
|
|
179
|
+
_iterator.e(err);
|
|
180
|
+
} finally {
|
|
181
|
+
_iterator.f();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (displayCrossHatches) {
|
|
185
|
+
ctx.lineWidth = 1;
|
|
186
|
+
ctx.strokeStyle = 'rgba(200,200,200,0.8)';
|
|
187
|
+
ticks.values.forEach(function (tick) {
|
|
188
|
+
ctx.beginPath();
|
|
189
|
+
ctx.moveTo(0, Math.round(toY(tick)));
|
|
190
|
+
ctx.lineTo(width, Math.round(toY(tick)));
|
|
191
|
+
ctx.stroke();
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}]);
|
|
196
|
+
return XYPlotRenderer;
|
|
197
|
+
}(_WiggleBaseRenderer2["default"]);
|
|
198
|
+
|
|
199
|
+
exports["default"] = XYPlotRenderer;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
|
|
11
|
+
var _simpleFeature = _interopRequireDefault(require("@jbrowse/core/util/simpleFeature"));
|
|
12
|
+
|
|
13
|
+
var _offscreenCanvasUtils = require("@jbrowse/core/util/offscreenCanvasUtils");
|
|
14
|
+
|
|
15
|
+
var _ = _interopRequireWildcard(require("."));
|
|
16
|
+
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
|
|
21
|
+
test('several features', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
22
|
+
var pluginManager, renderer, renderProps, res;
|
|
23
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
24
|
+
while (1) {
|
|
25
|
+
switch (_context.prev = _context.next) {
|
|
26
|
+
case 0:
|
|
27
|
+
pluginManager = {};
|
|
28
|
+
renderer = new _["default"]({
|
|
29
|
+
name: 'XYPlotRenderer',
|
|
30
|
+
ReactComponent: _.ReactComponent,
|
|
31
|
+
configSchema: _.configSchema,
|
|
32
|
+
pluginManager: pluginManager
|
|
33
|
+
});
|
|
34
|
+
renderProps = {
|
|
35
|
+
features: [new _simpleFeature["default"]({
|
|
36
|
+
id: 't1',
|
|
37
|
+
data: {
|
|
38
|
+
start: 1,
|
|
39
|
+
end: 100,
|
|
40
|
+
score: 1
|
|
41
|
+
}
|
|
42
|
+
}), new _simpleFeature["default"]({
|
|
43
|
+
id: 't2',
|
|
44
|
+
data: {
|
|
45
|
+
start: 101,
|
|
46
|
+
end: 200,
|
|
47
|
+
score: 2
|
|
48
|
+
}
|
|
49
|
+
})],
|
|
50
|
+
regions: [{
|
|
51
|
+
end: 100,
|
|
52
|
+
start: 1
|
|
53
|
+
}],
|
|
54
|
+
scaleOpts: {
|
|
55
|
+
domain: [0, 100],
|
|
56
|
+
scaleType: 'linear'
|
|
57
|
+
},
|
|
58
|
+
config: {},
|
|
59
|
+
bpPerPx: 3,
|
|
60
|
+
highResolutionScaling: 1,
|
|
61
|
+
height: 100,
|
|
62
|
+
ticks: {
|
|
63
|
+
values: [0, 100]
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
_context.next = 5;
|
|
67
|
+
return (0, _offscreenCanvasUtils.renderToAbstractCanvas)(1000, 200, renderProps, function (ctx) {
|
|
68
|
+
return renderer.draw(ctx, renderProps);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
case 5:
|
|
72
|
+
res = _context.sent;
|
|
73
|
+
expect(res).toMatchSnapshot({
|
|
74
|
+
imageData: expect.any(Object)
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
case 7:
|
|
78
|
+
case "end":
|
|
79
|
+
return _context.stop();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}, _callee);
|
|
83
|
+
})));
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "ReactComponent", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _WiggleRendering["default"];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
exports.configSchema = void 0;
|
|
15
|
+
Object.defineProperty(exports, "default", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _XYPlotRenderer["default"];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
var _configuration = require("@jbrowse/core/configuration");
|
|
23
|
+
|
|
24
|
+
var _configSchema = _interopRequireDefault(require("../configSchema"));
|
|
25
|
+
|
|
26
|
+
var _WiggleRendering = _interopRequireDefault(require("../WiggleRendering"));
|
|
27
|
+
|
|
28
|
+
var _XYPlotRenderer = _interopRequireDefault(require("./XYPlotRenderer"));
|
|
29
|
+
|
|
30
|
+
var configSchema = (0, _configuration.ConfigurationSchema)('XYPlotRenderer', {}, {
|
|
31
|
+
baseConfiguration: _configSchema["default"],
|
|
32
|
+
explicitlyTyped: true
|
|
33
|
+
});
|
|
34
|
+
exports.configSchema = configSchema;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _configuration = require("@jbrowse/core/configuration");
|
|
9
|
+
|
|
10
|
+
var _mobxStateTree = require("mobx-state-tree");
|
|
11
|
+
|
|
12
|
+
var _default = (0, _configuration.ConfigurationSchema)('WiggleRenderer', {
|
|
13
|
+
color: {
|
|
14
|
+
type: 'color',
|
|
15
|
+
description: 'the color of track, overrides posColor and negColor',
|
|
16
|
+
defaultValue: '#f0f'
|
|
17
|
+
},
|
|
18
|
+
posColor: {
|
|
19
|
+
type: 'color',
|
|
20
|
+
description: 'the color to use when the score is positive',
|
|
21
|
+
defaultValue: 'blue'
|
|
22
|
+
},
|
|
23
|
+
negColor: {
|
|
24
|
+
type: 'color',
|
|
25
|
+
description: 'the color to use when the score is negative',
|
|
26
|
+
defaultValue: 'red'
|
|
27
|
+
},
|
|
28
|
+
highlightColor: {
|
|
29
|
+
type: 'color',
|
|
30
|
+
description: 'the color of highlights over the wiggle track',
|
|
31
|
+
defaultValue: 'rgba(255,255,0,0.5)'
|
|
32
|
+
},
|
|
33
|
+
clipColor: {
|
|
34
|
+
type: 'color',
|
|
35
|
+
description: 'the color of the clipping marker',
|
|
36
|
+
defaultValue: 'red'
|
|
37
|
+
},
|
|
38
|
+
renderType: {
|
|
39
|
+
type: 'stringEnum',
|
|
40
|
+
model: _mobxStateTree.types.enumeration('Rendering type', ['xyplot', 'density', 'line']),
|
|
41
|
+
description: 'The type of rendering for wiggle data to use',
|
|
42
|
+
defaultValue: 'xyplot'
|
|
43
|
+
},
|
|
44
|
+
filled: {
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
description: 'fill in histogram',
|
|
47
|
+
defaultValue: true
|
|
48
|
+
},
|
|
49
|
+
bicolorPivot: {
|
|
50
|
+
type: 'stringEnum',
|
|
51
|
+
model: _mobxStateTree.types.enumeration('Scale type', ['numeric', 'mean', 'z_score', 'none']),
|
|
52
|
+
description: 'type of bicolor pivot',
|
|
53
|
+
defaultValue: 'numeric'
|
|
54
|
+
},
|
|
55
|
+
bicolorPivotValue: {
|
|
56
|
+
type: 'number',
|
|
57
|
+
defaultValue: 0,
|
|
58
|
+
description: 'value to use for bicolor pivot'
|
|
59
|
+
},
|
|
60
|
+
summaryScoreMode: {
|
|
61
|
+
type: 'stringEnum',
|
|
62
|
+
model: _mobxStateTree.types.enumeration('Score type', ['max', 'min', 'avg', 'whiskers']),
|
|
63
|
+
description: 'choose whether to use max/min/average or whiskers which combines all three into the same rendering',
|
|
64
|
+
defaultValue: 'whiskers'
|
|
65
|
+
},
|
|
66
|
+
displayCrossHatches: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
description: 'choose to draw cross hatches (sideways lines)',
|
|
69
|
+
defaultValue: false
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
explicitlyTyped: true
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
36
36
|
renderInProgress: AbortController | undefined;
|
|
37
37
|
filled: boolean;
|
|
38
38
|
reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | undefined;
|
|
39
|
-
features: Map<string, import("@jbrowse/core/util
|
|
39
|
+
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
40
40
|
layout: any;
|
|
41
41
|
status: string;
|
|
42
42
|
error: unknown;
|
|
@@ -54,7 +54,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
54
54
|
setMessage(messageText: string): void;
|
|
55
55
|
setRendered(props: {
|
|
56
56
|
reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
57
|
-
features: Map<string, import("@jbrowse/core/util
|
|
57
|
+
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
58
58
|
layout: any;
|
|
59
59
|
maxHeightReached: boolean;
|
|
60
60
|
renderProps: any;
|
|
@@ -139,7 +139,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
139
139
|
currBpPerPx: number;
|
|
140
140
|
message: string;
|
|
141
141
|
featureIdUnderMouse: string | undefined;
|
|
142
|
-
contextMenuFeature: import("@jbrowse/core/util
|
|
142
|
+
contextMenuFeature: import("@jbrowse/core/util").Feature | undefined;
|
|
143
143
|
scrollTop: number;
|
|
144
144
|
estimatedRegionStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined;
|
|
145
145
|
estimatedRegionStats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined;
|
|
@@ -152,8 +152,8 @@ export default class WigglePlugin extends Plugin {
|
|
|
152
152
|
readonly selectedFeatureId: string | undefined;
|
|
153
153
|
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
154
154
|
} & {
|
|
155
|
-
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util
|
|
156
|
-
readonly featureUnderMouse: import("@jbrowse/core/util
|
|
155
|
+
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
156
|
+
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
157
157
|
getFeatureOverlapping(blockKey: string, x: number, y: number): any;
|
|
158
158
|
getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
|
|
159
159
|
searchFeatureByID(id: string): [number, number, number, number] | undefined;
|
|
@@ -180,11 +180,11 @@ export default class WigglePlugin extends Plugin {
|
|
|
180
180
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
181
181
|
setCurrBpPerPx(n: number): void;
|
|
182
182
|
deleteBlock(key: string): void;
|
|
183
|
-
selectFeature(feature: import("@jbrowse/core/util
|
|
183
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
184
184
|
clearFeatureSelection(): void;
|
|
185
185
|
setFeatureIdUnderMouse(feature: string | undefined): void;
|
|
186
186
|
reload(): void;
|
|
187
|
-
setContextMenuFeature(feature?: import("@jbrowse/core/util
|
|
187
|
+
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
188
188
|
} & {
|
|
189
189
|
readonly regionTooLarge: boolean;
|
|
190
190
|
readonly regionTooLargeReason: string;
|
|
@@ -222,7 +222,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
222
222
|
setPosColor(color: string): void;
|
|
223
223
|
setNegColor(color: string): void;
|
|
224
224
|
setLoading(aborter: AbortController): void;
|
|
225
|
-
selectFeature(feature: import("@jbrowse/core/util
|
|
225
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
226
226
|
setResolution(res: number): void;
|
|
227
227
|
setFill(fill: boolean): void;
|
|
228
228
|
toggleLogScale(): void;
|
|
@@ -307,7 +307,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
307
307
|
renderInProgress: AbortController | undefined;
|
|
308
308
|
filled: boolean;
|
|
309
309
|
reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | undefined;
|
|
310
|
-
features: Map<string, import("@jbrowse/core/util
|
|
310
|
+
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
311
311
|
layout: any;
|
|
312
312
|
status: string;
|
|
313
313
|
error: unknown;
|
|
@@ -325,7 +325,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
325
325
|
setMessage(messageText: string): void;
|
|
326
326
|
setRendered(props: {
|
|
327
327
|
reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
328
|
-
features: Map<string, import("@jbrowse/core/util
|
|
328
|
+
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
329
329
|
layout: any;
|
|
330
330
|
maxHeightReached: boolean;
|
|
331
331
|
renderProps: any;
|
|
@@ -410,7 +410,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
410
410
|
currBpPerPx: number;
|
|
411
411
|
message: string;
|
|
412
412
|
featureIdUnderMouse: string | undefined;
|
|
413
|
-
contextMenuFeature: import("@jbrowse/core/util
|
|
413
|
+
contextMenuFeature: import("@jbrowse/core/util").Feature | undefined;
|
|
414
414
|
scrollTop: number;
|
|
415
415
|
estimatedRegionStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined;
|
|
416
416
|
estimatedRegionStats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined;
|
|
@@ -423,8 +423,8 @@ export default class WigglePlugin extends Plugin {
|
|
|
423
423
|
readonly selectedFeatureId: string | undefined;
|
|
424
424
|
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
425
425
|
} & {
|
|
426
|
-
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util
|
|
427
|
-
readonly featureUnderMouse: import("@jbrowse/core/util
|
|
426
|
+
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
427
|
+
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
428
428
|
getFeatureOverlapping(blockKey: string, x: number, y: number): any;
|
|
429
429
|
getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
|
|
430
430
|
searchFeatureByID(id: string): [number, number, number, number] | undefined;
|
|
@@ -451,11 +451,11 @@ export default class WigglePlugin extends Plugin {
|
|
|
451
451
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
452
452
|
setCurrBpPerPx(n: number): void;
|
|
453
453
|
deleteBlock(key: string): void;
|
|
454
|
-
selectFeature(feature: import("@jbrowse/core/util
|
|
454
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
455
455
|
clearFeatureSelection(): void;
|
|
456
456
|
setFeatureIdUnderMouse(feature: string | undefined): void;
|
|
457
457
|
reload(): void;
|
|
458
|
-
setContextMenuFeature(feature?: import("@jbrowse/core/util
|
|
458
|
+
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
459
459
|
} & {
|
|
460
460
|
readonly regionTooLarge: boolean;
|
|
461
461
|
readonly regionTooLargeReason: string;
|
|
@@ -493,7 +493,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
493
493
|
setPosColor(color: string): void;
|
|
494
494
|
setNegColor(color: string): void;
|
|
495
495
|
setLoading(aborter: AbortController): void;
|
|
496
|
-
selectFeature(feature: import("@jbrowse/core/util
|
|
496
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
497
497
|
setResolution(res: number): void;
|
|
498
498
|
setFill(fill: boolean): void;
|
|
499
499
|
toggleLogScale(): void;
|
|
@@ -564,7 +564,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
564
564
|
}) => JSX.Element;
|
|
565
565
|
XYPlotRendererReactComponent: (props: {
|
|
566
566
|
regions: import("@jbrowse/core/util/types").Region[];
|
|
567
|
-
features: Map<string, import("@jbrowse/core/util
|
|
567
|
+
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
568
568
|
bpPerPx: number;
|
|
569
569
|
width: number;
|
|
570
570
|
height: number;
|
|
@@ -602,7 +602,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
602
602
|
renderInProgress: AbortController | undefined;
|
|
603
603
|
filled: boolean;
|
|
604
604
|
reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)> | undefined;
|
|
605
|
-
features: Map<string, import("@jbrowse/core/util
|
|
605
|
+
features: Map<string, import("@jbrowse/core/util").Feature> | undefined;
|
|
606
606
|
layout: any;
|
|
607
607
|
status: string;
|
|
608
608
|
error: unknown;
|
|
@@ -620,7 +620,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
620
620
|
setMessage(messageText: string): void;
|
|
621
621
|
setRendered(props: {
|
|
622
622
|
reactElement: import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
623
|
-
features: Map<string, import("@jbrowse/core/util
|
|
623
|
+
features: Map<string, import("@jbrowse/core/util").Feature>;
|
|
624
624
|
layout: any;
|
|
625
625
|
maxHeightReached: boolean;
|
|
626
626
|
renderProps: any;
|
|
@@ -705,7 +705,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
705
705
|
currBpPerPx: number;
|
|
706
706
|
message: string;
|
|
707
707
|
featureIdUnderMouse: string | undefined;
|
|
708
|
-
contextMenuFeature: import("@jbrowse/core/util
|
|
708
|
+
contextMenuFeature: import("@jbrowse/core/util").Feature | undefined;
|
|
709
709
|
scrollTop: number;
|
|
710
710
|
estimatedRegionStatsP: Promise<import("@jbrowse/core/data_adapters/BaseAdapter").Stats> | undefined;
|
|
711
711
|
estimatedRegionStats: import("@jbrowse/core/data_adapters/BaseAdapter").Stats | undefined;
|
|
@@ -718,8 +718,8 @@ export default class WigglePlugin extends Plugin {
|
|
|
718
718
|
readonly selectedFeatureId: string | undefined;
|
|
719
719
|
readonly DisplayMessageComponent: import("react").FC<any> | undefined;
|
|
720
720
|
} & {
|
|
721
|
-
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util
|
|
722
|
-
readonly featureUnderMouse: import("@jbrowse/core/util
|
|
721
|
+
readonly features: import("@jbrowse/core/util/compositeMap").default<string, import("@jbrowse/core/util").Feature>;
|
|
722
|
+
readonly featureUnderMouse: import("@jbrowse/core/util").Feature | undefined;
|
|
723
723
|
getFeatureOverlapping(blockKey: string, x: number, y: number): any;
|
|
724
724
|
getFeatureByID(blockKey: string, id: string): [number, number, number, number] | undefined;
|
|
725
725
|
searchFeatureByID(id: string): [number, number, number, number] | undefined;
|
|
@@ -746,11 +746,11 @@ export default class WigglePlugin extends Plugin {
|
|
|
746
746
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
747
747
|
setCurrBpPerPx(n: number): void;
|
|
748
748
|
deleteBlock(key: string): void;
|
|
749
|
-
selectFeature(feature: import("@jbrowse/core/util
|
|
749
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
750
750
|
clearFeatureSelection(): void;
|
|
751
751
|
setFeatureIdUnderMouse(feature: string | undefined): void;
|
|
752
752
|
reload(): void;
|
|
753
|
-
setContextMenuFeature(feature?: import("@jbrowse/core/util
|
|
753
|
+
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
754
754
|
} & {
|
|
755
755
|
readonly regionTooLarge: boolean;
|
|
756
756
|
readonly regionTooLargeReason: string;
|
|
@@ -788,7 +788,7 @@ export default class WigglePlugin extends Plugin {
|
|
|
788
788
|
setPosColor(color: string): void;
|
|
789
789
|
setNegColor(color: string): void;
|
|
790
790
|
setLoading(aborter: AbortController): void;
|
|
791
|
-
selectFeature(feature: import("@jbrowse/core/util
|
|
791
|
+
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
792
792
|
setResolution(res: number): void;
|
|
793
793
|
setFill(fill: boolean): void;
|
|
794
794
|
toggleLogScale(): void;
|