@jbrowse/core 2.2.2 → 2.3.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/PluginManager.d.ts +4 -0
- package/PluginManager.js +12 -0
- package/README.md +6 -2
- package/package.json +3 -3
- package/pluggableElementTypes/AdapterType.d.ts +4 -4
- package/pluggableElementTypes/AdapterType.js +0 -1
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +3 -3
- package/pluggableElementTypes/ConnectionType.d.ts +0 -1
- package/pluggableElementTypes/ConnectionType.js +0 -1
- package/pluggableElementTypes/DisplayType.d.ts +9 -0
- package/pluggableElementTypes/DisplayType.js +1 -0
- package/pluggableElementTypes/PluggableElementBase.d.ts +3 -0
- package/pluggableElementTypes/PluggableElementBase.js +4 -0
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +1 -0
- package/pluggableElementTypes/TrackType.d.ts +2 -1
- package/pluggableElementTypes/ViewType.d.ts +4 -3
- package/pluggableElementTypes/WidgetType.d.ts +10 -9
- package/pluggableElementTypes/models/BaseDisplayModel.js +1 -0
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +19 -8
- package/pluggableElementTypes/models/BaseTrackModel.js +32 -26
- package/pluggableElementTypes/renderers/BoxRendererType.js +1 -14
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +9 -0
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +23 -0
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +4 -1
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +4 -4
- package/pluggableElementTypes/renderers/FeatureRendererType.js +11 -13
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -0
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +8 -0
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +60 -0
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -2
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +6 -6
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +4 -4
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +13 -12
- package/rpc/BaseRpcDriver.d.ts +1 -1
- package/rpc/BaseRpcDriver.js +7 -17
- package/rpc/coreRpcMethods.d.ts +11 -99
- package/rpc/coreRpcMethods.js +17 -241
- package/rpc/methods/CoreEstimateRegionStats.d.ts +18 -0
- package/rpc/methods/CoreEstimateRegionStats.js +37 -0
- package/rpc/methods/CoreFreeResources.d.ts +12 -0
- package/rpc/methods/CoreFreeResources.js +35 -0
- package/rpc/methods/CoreGetFeatureDetails.d.ts +16 -0
- package/rpc/methods/CoreGetFeatureDetails.js +44 -0
- package/rpc/methods/CoreGetFeatures.d.ts +17 -0
- package/rpc/methods/CoreGetFeatures.js +44 -0
- package/rpc/methods/CoreGetFileInfo.d.ts +10 -0
- package/rpc/methods/CoreGetFileInfo.js +24 -0
- package/rpc/methods/CoreGetMetadata.d.ts +10 -0
- package/rpc/methods/CoreGetMetadata.js +24 -0
- package/rpc/methods/CoreGetRefNames.d.ts +10 -0
- package/rpc/methods/CoreGetRefNames.js +25 -0
- package/rpc/methods/CoreRender.d.ts +14 -0
- package/rpc/methods/CoreRender.js +57 -0
- package/rpc/methods/util.d.ts +14 -0
- package/rpc/methods/util.js +21 -0
- package/rpc/remoteAbortSignals.d.ts +3 -1
- package/rpc/remoteAbortSignals.js +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/App.js +9 -77
- package/ui/AppLogo.d.ts +8 -0
- package/ui/AppLogo.js +22 -0
- package/ui/AppToolbar.d.ts +19 -0
- package/ui/AppToolbar.js +56 -0
- package/ui/AssemblySelector.d.ts +5 -3
- package/ui/AssemblySelector.js +4 -4
- package/ui/PrerenderedCanvas.d.ts +3 -20
- package/ui/PrerenderedCanvas.js +1 -19
- package/ui/Snackbar.js +7 -53
- package/ui/ViewLauncher.d.ts +18 -0
- package/ui/ViewLauncher.js +50 -0
- package/ui/index.d.ts +9 -9
- package/ui/index.js +19 -19
- package/util/Base1DUtils.js +1 -1
- package/util/dedupe.d.ts +3 -0
- package/util/dedupe.js +18 -0
- package/util/index.d.ts +1 -1
- package/util/index.js +2 -5
- package/util/offscreenCanvasUtils.js +1 -1
- package/util/stats.d.ts +7 -3
- package/util/stats.js +33 -24
package/util/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './types';
|
|
|
9
9
|
export * from './aborting';
|
|
10
10
|
export * from './when';
|
|
11
11
|
export * from './range';
|
|
12
|
+
export * from './dedupe';
|
|
12
13
|
export { SimpleFeature, isFeature };
|
|
13
14
|
export * from './offscreenCanvasPonyfill';
|
|
14
15
|
export * from './offscreenCanvasUtils';
|
|
@@ -340,4 +341,3 @@ export declare function measureGridWidth(elements: string[]): number;
|
|
|
340
341
|
export declare function getEnv(obj: any): {
|
|
341
342
|
pluginManager: PluginManager;
|
|
342
343
|
};
|
|
343
|
-
export declare function dedupe<T, U>(results: T[] | undefined, cb: (result: T) => U): T[];
|
package/util/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
30
|
};
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.bytesForRegions = exports.objectHash = exports.hashCode = exports.updateStatus = exports.generateCodonTable = exports.defaultCodonTable = exports.defaultStops = exports.defaultStarts = exports.measureText = exports.rIC = exports.blobToDataURL = exports.complement = exports.reverse = exports.revcom = exports.isElectron = exports.stringify = exports.shorten = exports.minmax = exports.renameRegionsIfNeeded = exports.renameRegionIfNeeded = exports.makeAbortableReaction = exports.findLastIndex = exports.iterMap = exports.bpSpanPx = exports.featureSpanPx = exports.cartesianToPolar = exports.polarToCartesian = exports.degToRad = exports.radToDeg = exports.bpToPx = exports.clamp = exports.compareLocStrings = exports.compareLocs = exports.parseLocString = exports.parseLocStringOneBased = exports.assembleLocStringFast = exports.assembleLocString = exports.getContainingDisplay = exports.getContainingTrack = exports.getContainingView = exports.getSession = exports.findParentThatIs = exports.springAnimate = exports.findParentThat = exports.useDebouncedCallback = exports.useDebounce = exports.inProduction = exports.inDevelopment = exports.isFeature = exports.SimpleFeature = void 0;
|
|
33
|
-
exports.
|
|
33
|
+
exports.getEnv = exports.measureGridWidth = exports.getStr = exports.getUriLink = exports.useLocalStorage = exports.getLayoutId = exports.getViewParams = exports.getTickDisplayStr = exports.toLocale = exports.getBpDisplayStr = exports.supportedIndexingAdapters = void 0;
|
|
34
34
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
35
35
|
const react_1 = require("react");
|
|
36
36
|
const is_object_1 = __importDefault(require("is-object"));
|
|
@@ -46,6 +46,7 @@ __exportStar(require("./types"), exports);
|
|
|
46
46
|
__exportStar(require("./aborting"), exports);
|
|
47
47
|
__exportStar(require("./when"), exports);
|
|
48
48
|
__exportStar(require("./range"), exports);
|
|
49
|
+
__exportStar(require("./dedupe"), exports);
|
|
49
50
|
__exportStar(require("./offscreenCanvasPonyfill"), exports);
|
|
50
51
|
__exportStar(require("./offscreenCanvasUtils"), exports);
|
|
51
52
|
exports.inDevelopment = typeof process === 'object' &&
|
|
@@ -1010,7 +1011,3 @@ function getEnv(obj) {
|
|
|
1010
1011
|
return (0, mobx_state_tree_1.getEnv)(obj);
|
|
1011
1012
|
}
|
|
1012
1013
|
exports.getEnv = getEnv;
|
|
1013
|
-
function dedupe(results = [], cb) {
|
|
1014
|
-
return results.filter((elt, idx, self) => idx === self.findIndex(t => cb(t) === cb(elt)));
|
|
1015
|
-
}
|
|
1016
|
-
exports.dedupe = dedupe;
|
package/util/stats.d.ts
CHANGED
|
@@ -26,12 +26,15 @@ export interface FeatureStats extends UnrectifiedFeatureStats {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare function calcStdFromSums(sum: number, sumSquares: number, n: number, population?: boolean): number;
|
|
28
28
|
/**
|
|
29
|
-
* @param stats - a summary stats object with scoreSum, featureCount,
|
|
30
|
-
*
|
|
29
|
+
* @param stats - a summary stats object with scoreSum, featureCount,
|
|
30
|
+
* scoreSumSquares, and basesCovered
|
|
31
|
+
* @returns - a summary stats object with
|
|
32
|
+
* scoreMean, scoreStdDev, and featureDensity added
|
|
31
33
|
*/
|
|
32
34
|
export declare function rectifyStats(s: UnrectifiedFeatureStats): FeatureStats;
|
|
33
35
|
/**
|
|
34
36
|
* calculates per-base scores for variable width features over a region
|
|
37
|
+
*
|
|
35
38
|
* @param region - object contains start, end
|
|
36
39
|
* @param features - list of features with start, end, score
|
|
37
40
|
* @returns array of numeric scores
|
|
@@ -39,9 +42,10 @@ export declare function rectifyStats(s: UnrectifiedFeatureStats): FeatureStats;
|
|
|
39
42
|
export declare function calcPerBaseStats(region: NoAssemblyRegion, features: Feature[]): number[];
|
|
40
43
|
/**
|
|
41
44
|
* transform a list of scores to summary statistics
|
|
45
|
+
*
|
|
42
46
|
* @param region - object with start, end
|
|
43
47
|
* @param features - array of features which are possibly summary features
|
|
44
48
|
* @returns - object with scoreMax, scoreMin, scoreSum, scoreSumSquares, etc
|
|
45
49
|
*/
|
|
46
|
-
export declare function scoresToStats(region: NoAssemblyRegion,
|
|
50
|
+
export declare function scoresToStats(region: NoAssemblyRegion, feats: Observable<Feature>): Promise<FeatureStats>;
|
|
47
51
|
export declare function blankStats(): FeatureStats;
|
package/util/stats.js
CHANGED
|
@@ -31,8 +31,10 @@ function calcStdFromSums(sum, sumSquares, n, population = false) {
|
|
|
31
31
|
}
|
|
32
32
|
exports.calcStdFromSums = calcStdFromSums;
|
|
33
33
|
/**
|
|
34
|
-
* @param stats - a summary stats object with scoreSum, featureCount,
|
|
35
|
-
*
|
|
34
|
+
* @param stats - a summary stats object with scoreSum, featureCount,
|
|
35
|
+
* scoreSumSquares, and basesCovered
|
|
36
|
+
* @returns - a summary stats object with
|
|
37
|
+
* scoreMean, scoreStdDev, and featureDensity added
|
|
36
38
|
*/
|
|
37
39
|
function rectifyStats(s) {
|
|
38
40
|
return {
|
|
@@ -45,6 +47,7 @@ function rectifyStats(s) {
|
|
|
45
47
|
exports.rectifyStats = rectifyStats;
|
|
46
48
|
/**
|
|
47
49
|
* calculates per-base scores for variable width features over a region
|
|
50
|
+
*
|
|
48
51
|
* @param region - object contains start, end
|
|
49
52
|
* @param features - list of features with start, end, score
|
|
50
53
|
* @returns array of numeric scores
|
|
@@ -78,39 +81,45 @@ function calcPerBaseStats(region, features) {
|
|
|
78
81
|
exports.calcPerBaseStats = calcPerBaseStats;
|
|
79
82
|
/**
|
|
80
83
|
* transform a list of scores to summary statistics
|
|
84
|
+
*
|
|
81
85
|
* @param region - object with start, end
|
|
82
86
|
* @param features - array of features which are possibly summary features
|
|
83
87
|
* @returns - object with scoreMax, scoreMin, scoreSum, scoreSumSquares, etc
|
|
84
88
|
*/
|
|
85
|
-
async function scoresToStats(region,
|
|
89
|
+
async function scoresToStats(region, feats) {
|
|
86
90
|
const { start, end } = region;
|
|
87
|
-
const
|
|
88
|
-
.pipe((0, operators_1.reduce)((seed, f) => {
|
|
89
|
-
const s = f.get('score');
|
|
90
|
-
const summary = f.get('summary');
|
|
91
|
-
const { scoreMax, scoreMin } = seed;
|
|
92
|
-
seed.scoreMax = Math.max(scoreMax, summary ? f.get('maxScore') : s);
|
|
93
|
-
seed.scoreMin = Math.min(scoreMin, summary ? f.get('minScore') : s);
|
|
94
|
-
seed.scoreSum += s;
|
|
95
|
-
seed.scoreSumSquares += s * s;
|
|
96
|
-
seed.featureCount += 1;
|
|
97
|
-
return seed;
|
|
98
|
-
}, {
|
|
91
|
+
const seed = {
|
|
99
92
|
scoreMin: Number.MAX_VALUE,
|
|
100
93
|
scoreMax: Number.MIN_VALUE,
|
|
101
94
|
scoreSum: 0,
|
|
102
95
|
scoreSumSquares: 0,
|
|
103
96
|
featureCount: 0,
|
|
104
|
-
}
|
|
97
|
+
};
|
|
98
|
+
let found = false;
|
|
99
|
+
const { scoreMin, scoreMax, scoreSum, scoreSumSquares, featureCount } = await feats
|
|
100
|
+
.pipe((0, operators_1.reduce)((acc, f) => {
|
|
101
|
+
const s = f.get('score');
|
|
102
|
+
const summary = f.get('summary');
|
|
103
|
+
const { scoreMax, scoreMin } = acc;
|
|
104
|
+
acc.scoreMax = Math.max(scoreMax, summary ? f.get('maxScore') : s);
|
|
105
|
+
acc.scoreMin = Math.min(scoreMin, summary ? f.get('minScore') : s);
|
|
106
|
+
acc.scoreSum += s;
|
|
107
|
+
acc.scoreSumSquares += s * s;
|
|
108
|
+
acc.featureCount += 1;
|
|
109
|
+
found = true;
|
|
110
|
+
return acc;
|
|
111
|
+
}, seed))
|
|
105
112
|
.toPromise();
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
return found
|
|
114
|
+
? rectifyStats({
|
|
115
|
+
scoreMax,
|
|
116
|
+
scoreMin,
|
|
117
|
+
scoreSum,
|
|
118
|
+
scoreSumSquares,
|
|
119
|
+
featureCount,
|
|
120
|
+
basesCovered: end - start + 1,
|
|
121
|
+
})
|
|
122
|
+
: blankStats();
|
|
114
123
|
}
|
|
115
124
|
exports.scoresToStats = scoresToStats;
|
|
116
125
|
function blankStats() {
|