@jbrowse/core 2.3.1 → 2.3.3
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/PluginManager.js +1 -1
- package/data_adapters/BaseAdapter.d.ts +1 -0
- package/data_adapters/BaseAdapter.js +9 -9
- package/package.json +4 -3
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +3 -3
- package/pluggableElementTypes/renderers/FeatureRendererType.js +3 -1
- package/rpc/methods/CoreGetFeatures.js +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/FatalErrorDialog.js +0 -1
- package/ui/SnackbarModel.d.ts +18 -0
- package/ui/SnackbarModel.js +18 -0
- package/ui/Tooltip.d.ts +1 -1
- package/util/Base1DUtils.d.ts +6 -0
- package/util/Base1DUtils.js +57 -24
- package/util/Base1DViewModel.d.ts +3 -1
- package/util/index.d.ts +5 -0
- package/util/index.js +37 -3
- package/util/stats.js +3 -4
- package/util/types/index.js +4 -1
package/PluginManager.js
CHANGED
|
@@ -258,7 +258,7 @@ class PluginManager {
|
|
|
258
258
|
.filter(t => (0, mobx_state_tree_1.isType)(t) && (0, mobx_state_tree_1.isModelType)(t));
|
|
259
259
|
// try to smooth over the case when no types are registered, mostly
|
|
260
260
|
// encountered in tests
|
|
261
|
-
if (pluggableTypes.length === 0) {
|
|
261
|
+
if (pluggableTypes.length === 0 && typeof jest === 'undefined') {
|
|
262
262
|
console.warn(`No pluggable types found matching ('${groupName}','${fieldName}')`);
|
|
263
263
|
return fallback;
|
|
264
264
|
}
|
|
@@ -96,6 +96,7 @@ export declare abstract class BaseFeatureDataAdapter extends BaseAdapter {
|
|
|
96
96
|
* Currently this just calls getFeatureInRegion for each region. Adapters that
|
|
97
97
|
* are frequently called on multiple regions simultaneously may want to
|
|
98
98
|
* implement a more efficient custom version of this method.
|
|
99
|
+
*
|
|
99
100
|
* @param regions - Regions
|
|
100
101
|
* @param opts - Feature adapter options
|
|
101
102
|
* @returns Observable of Feature objects in the regions
|
|
@@ -7,6 +7,7 @@ exports.isTextSearchAdapter = exports.isRefNameAliasAdapter = exports.isFeatureA
|
|
|
7
7
|
const rxjs_1 = require("rxjs");
|
|
8
8
|
const operators_1 = require("rxjs/operators");
|
|
9
9
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
10
|
+
// locals
|
|
10
11
|
const rxjs_2 = require("../util/rxjs");
|
|
11
12
|
const util_1 = require("../util");
|
|
12
13
|
const configuration_1 = require("../configuration");
|
|
@@ -95,6 +96,7 @@ class BaseFeatureDataAdapter extends BaseAdapter {
|
|
|
95
96
|
* Currently this just calls getFeatureInRegion for each region. Adapters that
|
|
96
97
|
* are frequently called on multiple regions simultaneously may want to
|
|
97
98
|
* implement a more efficient custom version of this method.
|
|
99
|
+
*
|
|
98
100
|
* @param regions - Regions
|
|
99
101
|
* @param opts - Feature adapter options
|
|
100
102
|
* @returns Observable of Feature objects in the regions
|
|
@@ -122,12 +124,12 @@ class BaseFeatureDataAdapter extends BaseAdapter {
|
|
|
122
124
|
return (0, stats_1.blankStats)();
|
|
123
125
|
}
|
|
124
126
|
const feats = await Promise.all(regions.map(region => this.getRegionStats(region, opts)));
|
|
125
|
-
const scoreMax = feats.map(a => a.scoreMax)
|
|
126
|
-
const scoreMin = feats.map(a => a.scoreMin)
|
|
127
|
-
const scoreSum = feats.
|
|
128
|
-
const scoreSumSquares = feats.
|
|
129
|
-
const featureCount = feats.
|
|
130
|
-
const basesCovered = feats.
|
|
127
|
+
const scoreMax = (0, util_1.max)(feats.map(a => a.scoreMax));
|
|
128
|
+
const scoreMin = (0, util_1.min)(feats.map(a => a.scoreMin));
|
|
129
|
+
const scoreSum = (0, util_1.sum)(feats.map(a => a.scoreSum));
|
|
130
|
+
const scoreSumSquares = (0, util_1.sum)(feats.map(a => a.scoreSumSquares));
|
|
131
|
+
const featureCount = (0, util_1.sum)(feats.map(a => a.featureCount));
|
|
132
|
+
const basesCovered = (0, util_1.sum)(feats.map(a => a.basesCovered));
|
|
131
133
|
return (0, stats_1.rectifyStats)({
|
|
132
134
|
scoreMin,
|
|
133
135
|
scoreMax,
|
|
@@ -151,9 +153,7 @@ class BaseFeatureDataAdapter extends BaseAdapter {
|
|
|
151
153
|
start: Math.max(0, Math.round(sampleCenter - length / 2)),
|
|
152
154
|
end: Math.min(Math.round(sampleCenter + length / 2), end),
|
|
153
155
|
};
|
|
154
|
-
const features = await this.getFeatures(query, opts)
|
|
155
|
-
.pipe((0, operators_1.toArray)())
|
|
156
|
-
.toPromise();
|
|
156
|
+
const features = await (0, rxjs_1.firstValueFrom)(this.getFeatures(query, opts).pipe((0, operators_1.toArray)()));
|
|
157
157
|
return maybeRecordStats(length, { featureDensity: features.length / length }, features.length, expansionTime);
|
|
158
158
|
};
|
|
159
159
|
const maybeRecordStats = async (interval, stats, statsSampleFeatures, expansionTime) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.17.9",
|
|
32
32
|
"@mui/icons-material": "^5.0.1",
|
|
33
|
+
"@types/clone": "^2.0.0",
|
|
33
34
|
"abortable-promise-cache": "^1.5.0",
|
|
34
35
|
"canvas-sequencer": "^3.1.0",
|
|
35
36
|
"canvas2svg": "^1.0.16",
|
|
@@ -66,12 +67,12 @@
|
|
|
66
67
|
"prop-types": "^15.0.0",
|
|
67
68
|
"react": ">=16.8.0",
|
|
68
69
|
"react-dom": ">=16.8.0",
|
|
69
|
-
"rxjs": "^
|
|
70
|
+
"rxjs": "^7.0.0",
|
|
70
71
|
"tss-react": "^4.0.0"
|
|
71
72
|
},
|
|
72
73
|
"publishConfig": {
|
|
73
74
|
"access": "public",
|
|
74
75
|
"directory": "dist"
|
|
75
76
|
},
|
|
76
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "283e0387ccd5acc9f092cf00804d1fcac212e68d"
|
|
77
78
|
}
|
|
@@ -8,6 +8,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
8
8
|
const ServerSideRendererType_1 = __importDefault(require("./ServerSideRendererType"));
|
|
9
9
|
const dataAdapterCache_1 = require("../../data_adapters/dataAdapterCache");
|
|
10
10
|
const util_1 = require("../../util");
|
|
11
|
+
const rxjs_1 = require("rxjs");
|
|
11
12
|
class ComparativeServerSideRenderer extends ServerSideRendererType_1.default {
|
|
12
13
|
/**
|
|
13
14
|
* directly modifies the render arguments to prepare
|
|
@@ -78,10 +79,9 @@ class ComparativeServerSideRenderer extends ServerSideRendererType_1.default {
|
|
|
78
79
|
return requestRegion;
|
|
79
80
|
});
|
|
80
81
|
// note that getFeaturesInMultipleRegions does not do glyph expansion
|
|
81
|
-
const res = await dataAdapter
|
|
82
|
+
const res = await (0, rxjs_1.firstValueFrom)(dataAdapter
|
|
82
83
|
.getFeaturesInMultipleRegions(requestRegions, renderArgs)
|
|
83
|
-
.pipe((0, operators_1.filter)(f => this.featurePassesFilters(renderArgs, f)), (0, operators_1.toArray)())
|
|
84
|
-
.toPromise();
|
|
84
|
+
.pipe((0, operators_1.filter)(f => this.featurePassesFilters(renderArgs, f)), (0, operators_1.toArray)()));
|
|
85
85
|
// dedupe needed xref https://github.com/GMOD/jbrowse-components/pull/3404/
|
|
86
86
|
return (0, util_1.dedupe)(res, f => f.id());
|
|
87
87
|
}
|
|
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const operators_1 = require("rxjs/operators");
|
|
7
7
|
const clone_1 = __importDefault(require("clone"));
|
|
8
|
+
const rxjs_1 = require("rxjs");
|
|
9
|
+
// locals
|
|
8
10
|
const util_1 = require("../../util");
|
|
9
11
|
const simpleFeature_1 = __importDefault(require("../../util/simpleFeature"));
|
|
10
12
|
const dataAdapterCache_1 = require("../../data_adapters/dataAdapterCache");
|
|
@@ -106,7 +108,7 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
106
108
|
const featureObservable = requestRegions.length === 1
|
|
107
109
|
? dataAdapter.getFeatures(this.getExpandedRegion(region, renderArgs), renderArgs)
|
|
108
110
|
: dataAdapter.getFeaturesInMultipleRegions(requestRegions, renderArgs);
|
|
109
|
-
const feats = await featureObservable.pipe((0, operators_1.toArray)())
|
|
111
|
+
const feats = await (0, rxjs_1.firstValueFrom)(featureObservable.pipe((0, operators_1.toArray)()));
|
|
110
112
|
(0, util_1.checkAbortSignal)(signal);
|
|
111
113
|
return new Map(feats
|
|
112
114
|
.filter(feat => this.featurePassesFilters(renderArgs, feat))
|
|
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
7
7
|
const operators_1 = require("rxjs/operators");
|
|
8
|
+
const rxjs_1 = require("rxjs");
|
|
9
|
+
// locals
|
|
8
10
|
const dataAdapterCache_1 = require("../../data_adapters/dataAdapterCache");
|
|
9
11
|
const RpcMethodType_1 = __importDefault(require("../../pluggableElementTypes/RpcMethodType"));
|
|
10
12
|
const BaseAdapter_1 = require("../../data_adapters/BaseAdapter");
|
|
@@ -37,7 +39,7 @@ class CoreGetFeatures extends RpcMethodType_1.default {
|
|
|
37
39
|
...opts,
|
|
38
40
|
signal,
|
|
39
41
|
});
|
|
40
|
-
const r = await ret.pipe((0, operators_1.toArray)())
|
|
42
|
+
const r = await (0, rxjs_1.firstValueFrom)(ret.pipe((0, operators_1.toArray)()));
|
|
41
43
|
return r.map(f => f.toJSON());
|
|
42
44
|
}
|
|
43
45
|
}
|