@jbrowse/core 2.11.2 → 2.12.1
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/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +17 -22
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +4 -6
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +24 -85
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +55 -24
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +9 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +69 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +9 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +126 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +68 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +19 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +47 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +84 -11
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +3 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +76 -19
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +5 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +12 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +7 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +51 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +5 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +12 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +11 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +30 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +11 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +42 -0
- package/BaseFeatureWidget/stateModelFactory.d.ts +26 -0
- package/BaseFeatureWidget/stateModelFactory.js +1 -2
- package/BaseFeatureWidget/util.d.ts +5 -5
- package/BaseFeatureWidget/util.js +6 -7
- package/PluginLoader.js +4 -5
- package/PluginManager.d.ts +7 -17
- package/ReExports/modules.d.ts +7 -16
- package/TextSearch/TextSearchManager.d.ts +6 -2
- package/assemblyManager/assembly.js +1 -1
- package/assemblyManager/assemblyManager.d.ts +9 -82
- package/configuration/configurationSchema.d.ts +7 -1
- package/configuration/configurationSchema.js +2 -3
- package/configuration/configurationSlot.js +1 -1
- package/configuration/util.d.ts +1 -1
- package/configuration/util.js +7 -8
- package/data_adapters/BaseAdapter/util.js +5 -6
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +0 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -2
- package/data_adapters/CytobandAdapter/index.js +1 -1
- package/data_adapters/dataAdapterCache.js +4 -5
- package/package.json +4 -2
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +1 -3
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -3
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +6 -2
- package/pluggableElementTypes/models/BaseTrackModel.js +2 -3
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +13 -13
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -2
- package/rpc/BaseRpcDriver.js +1 -2
- package/rpc/methods/util.js +1 -2
- package/rpc/remoteAbortSignals.js +5 -6
- package/stories/JBrowseCore.stories.d.ts +5 -0
- package/stories/JBrowseCore.stories.js +10 -0
- package/stories/examples/WithSequencePanel.d.ts +7 -0
- package/stories/examples/WithSequencePanel.js +42 -0
- package/stories/examples/index.d.ts +1 -0
- package/stories/examples/index.js +17 -0
- package/stories/examples/util.d.ts +33 -0
- package/stories/examples/util.js +235 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/ColorPicker.js +3 -3
- package/ui/Dialog.js +2 -1
- package/ui/ErrorMessageStackTraceDialog.js +1 -1
- package/ui/FactoryResetDialog.js +1 -1
- package/ui/FatalErrorDialog.js +1 -1
- package/ui/Icons.js +9 -10
- package/ui/LoadingEllipses.js +1 -1
- package/ui/Logo.js +2 -3
- package/ui/Menu.js +1 -2
- package/ui/RedErrorMessageBox.js +1 -1
- package/ui/SanitizedHTML.js +1 -1
- package/ui/SnackbarModel.js +1 -1
- package/ui/theme.js +3 -3
- package/util/Base1DUtils.d.ts +1 -1
- package/util/Base1DUtils.js +7 -12
- package/util/Base1DViewModel.d.ts +6 -17
- package/util/Base1DViewModel.js +6 -12
- package/util/aborting.js +5 -6
- package/util/analytics.js +3 -4
- package/util/blobToDataURL.js +1 -2
- package/util/calculateDynamicBlocks.js +1 -1
- package/util/calculateStaticBlocks.js +1 -1
- package/util/color/cssColorsLevel4.js +2 -3
- package/util/color/index.js +4 -4
- package/util/dedupe.js +1 -2
- package/util/formatFastaStrings.js +2 -3
- package/util/idMaker.js +1 -1
- package/util/index.d.ts +3 -3
- package/util/index.js +70 -71
- package/util/io/RemoteFileWithRangeCache.d.ts +0 -1
- package/util/io/RemoteFileWithRangeCache.js +2 -2
- package/util/io/index.js +4 -4
- package/util/jexl.js +1 -1
- package/util/jexlStrings.js +1 -2
- package/util/map-obj.js +1 -1
- package/util/mst-reflection.js +6 -7
- package/util/offscreenCanvasPonyfill.js +2 -2
- package/util/offscreenCanvasUtils.js +3 -4
- package/util/range.js +3 -4
- package/util/rxjs.js +1 -2
- package/util/simpleFeature.js +1 -2
- package/util/stats.js +5 -6
- package/util/tracks.d.ts +3 -2
- package/util/tracks.js +24 -20
- package/util/types/index.d.ts +4 -1
- package/util/types/index.js +23 -23
- package/util/types/mst.d.ts +0 -1
- package/util/useMeasure.d.ts +2 -3
- package/util/useMeasure.js +1 -1
- package/util/when.js +2 -3
- package/ui/useResizeBar.d.ts +0 -5
- package/ui/useResizeBar.js +0 -22
|
@@ -4,11 +4,57 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const mobx_react_1 = require("mobx-react");
|
|
8
|
+
// locals
|
|
7
9
|
const util_1 = require("../util");
|
|
8
|
-
|
|
10
|
+
const SequenceDisplay_1 = __importDefault(require("./SequenceDisplay"));
|
|
11
|
+
const GenomicSequence = (0, mobx_react_1.observer)(function ({ sequence, upstream, feature, downstream, model, }) {
|
|
12
|
+
const { charactersPerRow, showCoordinatesSetting, showCoordinates } = model;
|
|
13
|
+
let currStart = 0;
|
|
14
|
+
let upstreamChunk = null;
|
|
15
|
+
let currRemainder = 0;
|
|
16
|
+
const strand = feature.strand === -1 ? -1 : 1;
|
|
17
|
+
const fullGenomicCoordinates = showCoordinatesSetting === 'genomic';
|
|
18
|
+
const mult = fullGenomicCoordinates ? strand : 1;
|
|
19
|
+
let coordStart = fullGenomicCoordinates
|
|
20
|
+
? strand > 0
|
|
21
|
+
? feature.start + 1 - ((upstream === null || upstream === void 0 ? void 0 : upstream.length) || 0)
|
|
22
|
+
: feature.end + ((upstream === null || upstream === void 0 ? void 0 : upstream.length) || 0)
|
|
23
|
+
: 0;
|
|
24
|
+
if (upstream) {
|
|
25
|
+
const { segments, remainder } = (0, util_1.splitString)({
|
|
26
|
+
str: upstream,
|
|
27
|
+
charactersPerRow,
|
|
28
|
+
showCoordinates,
|
|
29
|
+
});
|
|
30
|
+
upstreamChunk = (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_1.updownstreamColor, start: currStart, coordStart: coordStart, chunks: segments }));
|
|
31
|
+
currRemainder = remainder;
|
|
32
|
+
currStart = currStart + upstream.length * mult;
|
|
33
|
+
coordStart = coordStart + upstream.length * mult;
|
|
34
|
+
}
|
|
35
|
+
const { segments, remainder } = (0, util_1.splitString)({
|
|
36
|
+
str: sequence,
|
|
37
|
+
charactersPerRow,
|
|
38
|
+
showCoordinates,
|
|
39
|
+
currRemainder,
|
|
40
|
+
});
|
|
41
|
+
const middleChunk = (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_1.genomeColor, start: currStart, coordStart: coordStart, chunks: segments }));
|
|
42
|
+
currRemainder = remainder;
|
|
43
|
+
currStart += sequence.length * mult;
|
|
44
|
+
coordStart = coordStart + sequence.length * mult;
|
|
45
|
+
let downstreamChunk = null;
|
|
46
|
+
if (downstream) {
|
|
47
|
+
const { segments } = (0, util_1.splitString)({
|
|
48
|
+
str: downstream,
|
|
49
|
+
charactersPerRow,
|
|
50
|
+
currRemainder,
|
|
51
|
+
showCoordinates,
|
|
52
|
+
});
|
|
53
|
+
downstreamChunk = (react_1.default.createElement(SequenceDisplay_1.default, { start: currStart, model: model, chunks: segments, coordStart: coordStart, color: util_1.updownstreamColor }));
|
|
54
|
+
}
|
|
9
55
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
56
|
+
upstreamChunk,
|
|
57
|
+
middleChunk,
|
|
58
|
+
downstreamChunk));
|
|
59
|
+
});
|
|
14
60
|
exports.default = GenomicSequence;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Feat } from '../../util';
|
|
3
|
-
|
|
3
|
+
import { SequenceFeatureDetailsModel } from '../model';
|
|
4
|
+
declare const ProteinSequence: ({ cds, sequence, codonTable, model, }: {
|
|
4
5
|
cds: Feat[];
|
|
5
6
|
sequence: string;
|
|
6
7
|
codonTable: Record<string, string>;
|
|
7
|
-
|
|
8
|
+
model: SequenceFeatureDetailsModel;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export default ProteinSequence;
|
|
@@ -4,15 +4,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const mobx_react_1 = require("mobx-react");
|
|
8
|
+
// locals
|
|
7
9
|
const util_1 = require("../../util");
|
|
8
10
|
const util_2 = require("../util");
|
|
9
|
-
|
|
11
|
+
const SequenceDisplay_1 = __importDefault(require("./SequenceDisplay"));
|
|
12
|
+
const ProteinSequence = (0, mobx_react_1.observer)(function ({ cds, sequence, codonTable, model, }) {
|
|
13
|
+
const { charactersPerRow, showCoordinates } = model;
|
|
10
14
|
const str = (0, util_1.stitch)(cds, sequence);
|
|
11
15
|
let protein = '';
|
|
12
16
|
for (let i = 0; i < str.length; i += 3) {
|
|
13
17
|
// use & symbol for undefined codon, or partial slice
|
|
14
18
|
protein += codonTable[str.slice(i, i + 3)] || '&';
|
|
15
19
|
}
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
const { segments } = (0, util_2.splitString)({
|
|
21
|
+
str: protein,
|
|
22
|
+
charactersPerRow,
|
|
23
|
+
showCoordinates,
|
|
24
|
+
});
|
|
25
|
+
return (react_1.default.createElement(SequenceDisplay_1.default, { model: model, color: util_2.proteinColor, chunks: segments, start: 0 }));
|
|
26
|
+
});
|
|
18
27
|
exports.default = ProteinSequence;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SequenceFeatureDetailsModel } from '../model';
|
|
3
|
+
declare const SequenceDisplay: ({ chunks, start, color, strand, coordStart, model, }: {
|
|
4
|
+
chunks: string[];
|
|
5
|
+
start: number;
|
|
6
|
+
coordStart?: number;
|
|
7
|
+
strand?: number;
|
|
8
|
+
color?: string;
|
|
9
|
+
model: SequenceFeatureDetailsModel;
|
|
10
|
+
}) => React.JSX.Element[];
|
|
11
|
+
export default SequenceDisplay;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const mobx_react_1 = require("mobx-react");
|
|
8
|
+
const SequenceDisplay = (0, mobx_react_1.observer)(function ({ chunks, start, color, strand = 1, coordStart = start, model, }) {
|
|
9
|
+
const { charactersPerRow, showCoordinates } = model;
|
|
10
|
+
return chunks.map((chunk, idx) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const f = coordStart - (start % charactersPerRow);
|
|
13
|
+
const prefix = (idx == 0 && start % charactersPerRow == 0) || idx > 0
|
|
14
|
+
? `${f + idx * strand * charactersPerRow}`.padStart(4) + ' '
|
|
15
|
+
: '';
|
|
16
|
+
const postfix = idx === chunks.length - 1 &&
|
|
17
|
+
(((_a = chunks.at(-1)) === null || _a === void 0 ? void 0 : _a.replaceAll(' ', '').length) || 0) +
|
|
18
|
+
(idx === 0 ? start % charactersPerRow : 0) !==
|
|
19
|
+
charactersPerRow
|
|
20
|
+
? null
|
|
21
|
+
: showCoordinates
|
|
22
|
+
? ' \n'
|
|
23
|
+
: '';
|
|
24
|
+
return (react_1.default.createElement(react_1.default.Fragment, { key: `${chunk}-${idx}` },
|
|
25
|
+
showCoordinates ? prefix : null,
|
|
26
|
+
react_1.default.createElement("span", { style: { background: color } }, chunk),
|
|
27
|
+
postfix));
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
exports.default = SequenceDisplay;
|
|
@@ -4,3 +4,14 @@ export declare const proteinColor = "rgb(220,160,220)";
|
|
|
4
4
|
export declare const cdsColor = "rgb(220,220,180)";
|
|
5
5
|
export declare const updownstreamColor = "rgba(250,200,200)";
|
|
6
6
|
export declare const genomeColor = "rgb(200,280,200)";
|
|
7
|
+
export declare function splitString({ str, charactersPerRow, showCoordinates, currRemainder, splitSize, }: {
|
|
8
|
+
str: string;
|
|
9
|
+
charactersPerRow: number;
|
|
10
|
+
showCoordinates: boolean;
|
|
11
|
+
currRemainder?: number;
|
|
12
|
+
splitStart?: number;
|
|
13
|
+
splitSize?: number;
|
|
14
|
+
}): {
|
|
15
|
+
segments: any[];
|
|
16
|
+
remainder: number;
|
|
17
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.genomeColor = exports.updownstreamColor = exports.cdsColor = exports.proteinColor = exports.utrColor = exports.intronColor = void 0;
|
|
4
|
+
exports.splitString = splitString;
|
|
4
5
|
// note that these are currently put into the style section instead of being
|
|
5
6
|
// defined in classes to aid copy and paste to an external document e.g. word
|
|
6
7
|
exports.intronColor = undefined;
|
|
@@ -9,3 +10,44 @@ exports.proteinColor = 'rgb(220,160,220)';
|
|
|
9
10
|
exports.cdsColor = 'rgb(220,220,180)';
|
|
10
11
|
exports.updownstreamColor = 'rgba(250,200,200)';
|
|
11
12
|
exports.genomeColor = 'rgb(200,280,200)';
|
|
13
|
+
function splitString({ str, charactersPerRow, showCoordinates, currRemainder = 0, splitSize = 10, }) {
|
|
14
|
+
var _a;
|
|
15
|
+
const numChunks = Math.ceil(str.length / charactersPerRow);
|
|
16
|
+
const chunks = new Array(numChunks);
|
|
17
|
+
let splitStart = currRemainder % 10;
|
|
18
|
+
let iter = 0;
|
|
19
|
+
let offset = 0;
|
|
20
|
+
for (; iter < numChunks + 1; ++iter) {
|
|
21
|
+
const inc = iter === 0 ? charactersPerRow - currRemainder : charactersPerRow;
|
|
22
|
+
const r = str.slice(offset, offset + inc);
|
|
23
|
+
if (!r) {
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
if (showCoordinates) {
|
|
27
|
+
let res = '';
|
|
28
|
+
for (let i = 0, j = splitStart; i < r.length; i++, j++) {
|
|
29
|
+
// note: this adds a space at the start but it causes trouble to try to
|
|
30
|
+
// say e.g. j%splitSize==0 && j to try to only add non-zero spaces
|
|
31
|
+
if (j % splitSize === 0) {
|
|
32
|
+
res += ' ';
|
|
33
|
+
j = 0;
|
|
34
|
+
}
|
|
35
|
+
res += r[i];
|
|
36
|
+
}
|
|
37
|
+
if (res) {
|
|
38
|
+
chunks[iter] = res;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
chunks[iter] = r;
|
|
43
|
+
}
|
|
44
|
+
splitStart = 0; // after newline, reset
|
|
45
|
+
offset += inc;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
segments: chunks,
|
|
49
|
+
remainder: ((((_a = chunks.at(-1)) === null || _a === void 0 ? void 0 : _a.replaceAll(' ', '').length) || 0) +
|
|
50
|
+
(iter < 2 ? currRemainder : 0)) %
|
|
51
|
+
charactersPerRow,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -52,13 +52,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
52
52
|
* #property
|
|
53
53
|
*/
|
|
54
54
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
55
|
+
showCoordinatesSetting: string;
|
|
55
56
|
intronBp: number;
|
|
56
57
|
upDownBp: number;
|
|
57
58
|
upperCaseCDS: boolean;
|
|
59
|
+
charactersPerRow: number;
|
|
60
|
+
feature: import("../util").SimpleFeatureSerialized | undefined;
|
|
61
|
+
mode: string;
|
|
58
62
|
} & {
|
|
63
|
+
setFeature(f: import("../util").SimpleFeatureSerialized): void;
|
|
59
64
|
setUpDownBp(f: number): void;
|
|
60
65
|
setIntronBp(f: number): void;
|
|
61
66
|
setUpperCaseCDS(f: boolean): void;
|
|
67
|
+
setShowCoordinates(f: "none" | "relative" | "genomic"): void;
|
|
68
|
+
setMode(mode: string): void;
|
|
69
|
+
} & {
|
|
70
|
+
readonly showCoordinates: boolean;
|
|
71
|
+
readonly showGenomicCoordsOption: boolean;
|
|
72
|
+
readonly hasCDS: boolean | undefined;
|
|
73
|
+
readonly hasExon: boolean | undefined;
|
|
74
|
+
readonly hasExonOrCDS: boolean | undefined;
|
|
62
75
|
} & {
|
|
63
76
|
afterAttach(): void;
|
|
64
77
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
@@ -132,13 +145,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
132
145
|
* #property
|
|
133
146
|
*/
|
|
134
147
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
148
|
+
showCoordinatesSetting: string;
|
|
135
149
|
intronBp: number;
|
|
136
150
|
upDownBp: number;
|
|
137
151
|
upperCaseCDS: boolean;
|
|
152
|
+
charactersPerRow: number;
|
|
153
|
+
feature: import("../util").SimpleFeatureSerialized | undefined;
|
|
154
|
+
mode: string;
|
|
138
155
|
} & {
|
|
156
|
+
setFeature(f: import("../util").SimpleFeatureSerialized): void;
|
|
139
157
|
setUpDownBp(f: number): void;
|
|
140
158
|
setIntronBp(f: number): void;
|
|
141
159
|
setUpperCaseCDS(f: boolean): void;
|
|
160
|
+
setShowCoordinates(f: "none" | "relative" | "genomic"): void;
|
|
161
|
+
setMode(mode: string): void;
|
|
162
|
+
} & {
|
|
163
|
+
readonly showCoordinates: boolean;
|
|
164
|
+
readonly showGenomicCoordsOption: boolean;
|
|
165
|
+
readonly hasCDS: boolean | undefined;
|
|
166
|
+
readonly hasExon: boolean | undefined;
|
|
167
|
+
readonly hasExonOrCDS: boolean | undefined;
|
|
142
168
|
} & {
|
|
143
169
|
afterAttach(): void;
|
|
144
170
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.stateModelFactory =
|
|
6
|
+
exports.stateModelFactory = stateModelFactory;
|
|
7
7
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
8
|
const mobx_1 = require("mobx");
|
|
9
9
|
const clone_1 = __importDefault(require("clone"));
|
|
@@ -170,4 +170,3 @@ function stateModelFactory(pluginManager) {
|
|
|
170
170
|
};
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
exports.stateModelFactory = stateModelFactory;
|
|
@@ -25,16 +25,16 @@ export declare function dedupe(list: Feat[]): Feat[];
|
|
|
25
25
|
export declare function revlist(list: Feat[], seqlen: number): {
|
|
26
26
|
start: number;
|
|
27
27
|
end: number;
|
|
28
|
-
type?: string
|
|
29
|
-
name?: string
|
|
30
|
-
id?: string
|
|
28
|
+
type?: string;
|
|
29
|
+
name?: string;
|
|
30
|
+
id?: string;
|
|
31
31
|
}[];
|
|
32
32
|
export declare function calculateUTRs(cds: Feat[], exons: Feat[]): {
|
|
33
33
|
type: string;
|
|
34
34
|
start: number;
|
|
35
35
|
end: number;
|
|
36
|
-
name?: string
|
|
37
|
-
id?: string
|
|
36
|
+
name?: string;
|
|
37
|
+
id?: string;
|
|
38
38
|
}[];
|
|
39
39
|
export declare function calculateUTRs2(cds: Feat[], parentFeat: Feat): {
|
|
40
40
|
type: string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.stitch = stitch;
|
|
4
|
+
exports.dedupe = dedupe;
|
|
5
|
+
exports.revlist = revlist;
|
|
6
|
+
exports.calculateUTRs = calculateUTRs;
|
|
7
|
+
exports.calculateUTRs2 = calculateUTRs2;
|
|
8
|
+
exports.ellipses = ellipses;
|
|
4
9
|
function stitch(subfeats, sequence) {
|
|
5
10
|
return subfeats.map(sub => sequence.slice(sub.start, sub.end)).join('');
|
|
6
11
|
}
|
|
7
|
-
exports.stitch = stitch;
|
|
8
12
|
// filter items if they have the same "ID" or location
|
|
9
13
|
function getItemId(feat) {
|
|
10
14
|
return `${feat.start}-${feat.end}`;
|
|
@@ -13,7 +17,6 @@ function getItemId(feat) {
|
|
|
13
17
|
function dedupe(list) {
|
|
14
18
|
return list.filter((item, pos, ary) => !pos || getItemId(item) !== getItemId(ary[pos - 1]));
|
|
15
19
|
}
|
|
16
|
-
exports.dedupe = dedupe;
|
|
17
20
|
function revlist(list, seqlen) {
|
|
18
21
|
return list
|
|
19
22
|
.map(sub => ({
|
|
@@ -23,7 +26,6 @@ function revlist(list, seqlen) {
|
|
|
23
26
|
}))
|
|
24
27
|
.sort((a, b) => a.start - b.start);
|
|
25
28
|
}
|
|
26
|
-
exports.revlist = revlist;
|
|
27
29
|
function calculateUTRs(cds, exons) {
|
|
28
30
|
// checking length ensures the .at below are valid
|
|
29
31
|
if (!cds.length) {
|
|
@@ -45,7 +47,6 @@ function calculateUTRs(cds, exons) {
|
|
|
45
47
|
].map(elt => ({ ...elt, type: 'three_prime_UTR' }));
|
|
46
48
|
return [...fiveUTRs, ...threeUTRs];
|
|
47
49
|
}
|
|
48
|
-
exports.calculateUTRs = calculateUTRs;
|
|
49
50
|
// calculates UTRs using impliedUTRs logic, but there are no exon subfeatures
|
|
50
51
|
function calculateUTRs2(cds, parentFeat) {
|
|
51
52
|
if (!cds.length) {
|
|
@@ -60,8 +61,6 @@ function calculateUTRs2(cds, parentFeat) {
|
|
|
60
61
|
}));
|
|
61
62
|
return [...fiveUTRs, ...threeUTRs];
|
|
62
63
|
}
|
|
63
|
-
exports.calculateUTRs2 = calculateUTRs2;
|
|
64
64
|
function ellipses(slug) {
|
|
65
65
|
return slug.length > 20 ? `${slug.slice(0, 20)}...` : slug;
|
|
66
66
|
}
|
|
67
|
-
exports.ellipses = ellipses;
|
package/PluginLoader.js
CHANGED
|
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.isUMDPluginDefinition = isUMDPluginDefinition;
|
|
7
|
+
exports.isESMPluginDefinition = isESMPluginDefinition;
|
|
8
|
+
exports.isCJSPluginDefinition = isCJSPluginDefinition;
|
|
9
|
+
exports.pluginDescriptionString = pluginDescriptionString;
|
|
7
10
|
const load_script_1 = __importDefault(require("load-script"));
|
|
8
11
|
// locals
|
|
9
12
|
const Plugin_1 = __importDefault(require("./Plugin"));
|
|
@@ -15,12 +18,10 @@ function isUMDPluginDefinition(def) {
|
|
|
15
18
|
def.umdLoc !== undefined) &&
|
|
16
19
|
def.name !== undefined);
|
|
17
20
|
}
|
|
18
|
-
exports.isUMDPluginDefinition = isUMDPluginDefinition;
|
|
19
21
|
function isESMPluginDefinition(def) {
|
|
20
22
|
return (def.esmUrl !== undefined ||
|
|
21
23
|
def.esmLoc !== undefined);
|
|
22
24
|
}
|
|
23
|
-
exports.isESMPluginDefinition = isESMPluginDefinition;
|
|
24
25
|
function promisifiedLoadScript(src) {
|
|
25
26
|
return new Promise((resolve, reject) => {
|
|
26
27
|
(0, load_script_1.default)(src, (err, script) => {
|
|
@@ -48,7 +49,6 @@ async function loadScript(scriptUrl) {
|
|
|
48
49
|
function isCJSPluginDefinition(def) {
|
|
49
50
|
return def.cjsUrl !== undefined;
|
|
50
51
|
}
|
|
51
|
-
exports.isCJSPluginDefinition = isCJSPluginDefinition;
|
|
52
52
|
function pluginDescriptionString(pluginDefinition) {
|
|
53
53
|
var _a;
|
|
54
54
|
if (isUMDPluginDefinition(pluginDefinition)) {
|
|
@@ -63,7 +63,6 @@ function pluginDescriptionString(pluginDefinition) {
|
|
|
63
63
|
}
|
|
64
64
|
return 'unknown plugin';
|
|
65
65
|
}
|
|
66
|
-
exports.pluginDescriptionString = pluginDescriptionString;
|
|
67
66
|
function isInWebWorker() {
|
|
68
67
|
return Boolean('WorkerGlobalScope' in globalThis);
|
|
69
68
|
}
|
package/PluginManager.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { IAnyType, IAnyModelType } from 'mobx-state-tree';
|
|
3
2
|
import PluggableElementBase from './pluggableElementTypes/PluggableElementBase';
|
|
4
3
|
import RendererType from './pluggableElementTypes/renderers/RendererType';
|
|
@@ -71,8 +70,8 @@ export default class PluginManager {
|
|
|
71
70
|
[key: string]: (value: any, ...args: any[]) => any;
|
|
72
71
|
}) => void;
|
|
73
72
|
getFunction: (name: string) => (value: any, ...args: any[]) => any;
|
|
74
|
-
eval: (expression: string, context?: import("jexl/Expression").Context
|
|
75
|
-
evalSync: (expression: string, context?: import("jexl/Expression").Context
|
|
73
|
+
eval: (expression: string, context?: import("jexl/Expression").Context) => Promise<any>;
|
|
74
|
+
evalSync: (expression: string, context?: import("jexl/Expression").Context) => any;
|
|
76
75
|
compile: (expression: string) => import("jexl/Expression").default;
|
|
77
76
|
createExpression: (expression: string) => import("jexl/Expression").default;
|
|
78
77
|
removeOp: (operator: string) => void;
|
|
@@ -151,22 +150,13 @@ export default class PluginManager {
|
|
|
151
150
|
'@jbrowse/core/util/tracks': typeof import("./util/tracks");
|
|
152
151
|
'@jbrowse/core/util/Base1DViewModel': import("mobx-state-tree").IModelType<{
|
|
153
152
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
154
|
-
displayedRegions: import("mobx-state-tree").
|
|
155
|
-
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
156
|
-
start: import("mobx-state-tree").ISimpleType<number>;
|
|
157
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
158
|
-
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
159
|
-
} & {
|
|
160
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
161
|
-
}, {
|
|
162
|
-
setRefName(newRefName: string): void;
|
|
163
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
153
|
+
displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("./util").Region[], import("./util").Region[], import("./util").Region[]>, [undefined]>;
|
|
164
154
|
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
165
155
|
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
166
156
|
interRegionPaddingWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
167
157
|
minimumBlockWidth: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
168
158
|
}, {
|
|
169
|
-
features: import("./util").Feature[]
|
|
159
|
+
features: undefined | import("./util").Feature[];
|
|
170
160
|
volatileWidth: number;
|
|
171
161
|
} & {
|
|
172
162
|
setDisplayedRegions(regions: import("./util").Region[]): void;
|
|
@@ -193,12 +183,12 @@ export default class PluginManager {
|
|
|
193
183
|
offset: number;
|
|
194
184
|
start: number;
|
|
195
185
|
end: number;
|
|
196
|
-
reversed
|
|
186
|
+
reversed?: boolean;
|
|
197
187
|
};
|
|
198
188
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
199
189
|
refName: string;
|
|
200
190
|
coord: number;
|
|
201
|
-
regionNumber?: number
|
|
191
|
+
regionNumber?: number;
|
|
202
192
|
}): number | undefined;
|
|
203
193
|
} & {
|
|
204
194
|
setFeatures(features: import("./util").Feature[]): void;
|
|
@@ -210,7 +200,7 @@ export default class PluginManager {
|
|
|
210
200
|
centerAt(coord: number, refName: string | undefined, regionNumber: number): void;
|
|
211
201
|
scroll(distance: number): number;
|
|
212
202
|
} & {
|
|
213
|
-
moveTo(start?: import("./util/Base1DUtils").BpOffset
|
|
203
|
+
moveTo(start?: import("./util/Base1DUtils").BpOffset, end?: import("./util/Base1DUtils").BpOffset): void;
|
|
214
204
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
215
205
|
'@jbrowse/core/util/io': typeof import("./util/io");
|
|
216
206
|
'@jbrowse/core/util/mst-reflection': typeof import("./util/mst-reflection");
|
package/ReExports/modules.d.ts
CHANGED
|
@@ -59,22 +59,13 @@ declare const libs: {
|
|
|
59
59
|
'@jbrowse/core/util/tracks': typeof trackUtils;
|
|
60
60
|
'@jbrowse/core/util/Base1DViewModel': mst.IModelType<{
|
|
61
61
|
id: mst.IOptionalIType<mst.ISimpleType<string>, [undefined]>;
|
|
62
|
-
displayedRegions: mst.
|
|
63
|
-
refName: mst.ISimpleType<string>;
|
|
64
|
-
start: mst.ISimpleType<number>;
|
|
65
|
-
end: mst.ISimpleType<number>;
|
|
66
|
-
reversed: mst.IOptionalIType<mst.ISimpleType<boolean>, [undefined]>;
|
|
67
|
-
} & {
|
|
68
|
-
assemblyName: mst.ISimpleType<string>;
|
|
69
|
-
}, {
|
|
70
|
-
setRefName(newRefName: string): void;
|
|
71
|
-
}, mst._NotCustomized, mst._NotCustomized>>;
|
|
62
|
+
displayedRegions: mst.IOptionalIType<mst.IType<coreUtil.Region[], coreUtil.Region[], coreUtil.Region[]>, [undefined]>;
|
|
72
63
|
bpPerPx: mst.IType<number | undefined, number, number>;
|
|
73
64
|
offsetPx: mst.IType<number | undefined, number, number>;
|
|
74
65
|
interRegionPaddingWidth: mst.IOptionalIType<mst.ISimpleType<number>, [undefined]>;
|
|
75
66
|
minimumBlockWidth: mst.IOptionalIType<mst.ISimpleType<number>, [undefined]>;
|
|
76
67
|
}, {
|
|
77
|
-
features: coreUtil.Feature[]
|
|
68
|
+
features: undefined | coreUtil.Feature[];
|
|
78
69
|
volatileWidth: number;
|
|
79
70
|
} & {
|
|
80
71
|
setDisplayedRegions(regions: coreUtil.Region[]): void;
|
|
@@ -101,12 +92,12 @@ declare const libs: {
|
|
|
101
92
|
offset: number;
|
|
102
93
|
start: number;
|
|
103
94
|
end: number;
|
|
104
|
-
reversed
|
|
95
|
+
reversed?: boolean;
|
|
105
96
|
};
|
|
106
97
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
107
98
|
refName: string;
|
|
108
99
|
coord: number;
|
|
109
|
-
regionNumber?: number
|
|
100
|
+
regionNumber?: number;
|
|
110
101
|
}): number | undefined;
|
|
111
102
|
} & {
|
|
112
103
|
setFeatures(features: coreUtil.Feature[]): void;
|
|
@@ -118,7 +109,7 @@ declare const libs: {
|
|
|
118
109
|
centerAt(coord: number, refName: string | undefined, regionNumber: number): void;
|
|
119
110
|
scroll(distance: number): number;
|
|
120
111
|
} & {
|
|
121
|
-
moveTo(start?: import("../util/Base1DUtils").BpOffset
|
|
112
|
+
moveTo(start?: import("../util/Base1DUtils").BpOffset, end?: import("../util/Base1DUtils").BpOffset): void;
|
|
122
113
|
}, mst._NotCustomized, mst._NotCustomized>;
|
|
123
114
|
'@jbrowse/core/util/io': typeof coreIo;
|
|
124
115
|
'@jbrowse/core/util/mst-reflection': typeof coreMstReflection;
|
|
@@ -146,12 +137,12 @@ declare const libs: {
|
|
|
146
137
|
makeStyles: <Params = void, RuleNameSubsetReferencableInNestedSelectors extends string = never>(params?: {
|
|
147
138
|
name?: string | Record<string, unknown> | undefined;
|
|
148
139
|
uniqId?: string | undefined;
|
|
149
|
-
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme:
|
|
140
|
+
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: import("@mui/material/styles").Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, muiStyleOverridesParams?: {
|
|
150
141
|
props: Record<string, unknown>;
|
|
151
142
|
ownerState?: Record<string, unknown> | undefined;
|
|
152
143
|
} | undefined) => {
|
|
153
144
|
classes: Record<RuleName, string>;
|
|
154
|
-
theme:
|
|
145
|
+
theme: import("@mui/material/styles").Theme;
|
|
155
146
|
css: import("tss-react").Css;
|
|
156
147
|
cx: import("tss-react").Cx;
|
|
157
148
|
};
|
|
@@ -16,13 +16,17 @@ export default class TextSearchManager {
|
|
|
16
16
|
relevantAdapters(searchScope: SearchScope): ({
|
|
17
17
|
[x: string]: any;
|
|
18
18
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
19
|
-
setSubschema(slotName: string, data: unknown):
|
|
19
|
+
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>);
|
|
20
22
|
} & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>)[];
|
|
21
23
|
getAdaptersWithAssembly(assemblyName: string, confs: AnyConfigurationModel[]): AnyConfigurationModel[];
|
|
22
24
|
getTrackAdaptersWithAssembly(assemblyName: string, confs: AnyConfigurationModel[]): ({
|
|
23
25
|
[x: string]: any;
|
|
24
26
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
25
|
-
setSubschema(slotName: string, data: unknown):
|
|
27
|
+
setSubschema(slotName: string, data: Record<string, unknown>): Record<string, unknown> | ({
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & any & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>);
|
|
26
30
|
} & import("mobx-state-tree").IStateTreeNode<import("../configuration").AnyConfigurationSchemaType>)[];
|
|
27
31
|
/**
|
|
28
32
|
* Returns list of relevant results given a search query and options
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = assemblyFactory;
|
|
6
7
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
7
8
|
const abortable_promise_cache_1 = __importDefault(require("abortable-promise-cache"));
|
|
8
9
|
// locals
|
|
@@ -375,7 +376,6 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
375
376
|
},
|
|
376
377
|
}));
|
|
377
378
|
}
|
|
378
|
-
exports.default = assemblyFactory;
|
|
379
379
|
async function getRefNameAliases(config, pm, signal) {
|
|
380
380
|
const type = pm.getAdapterType(config.type);
|
|
381
381
|
const CLASS = await type.getAdapterClass();
|