@jbrowse/core 2.1.6 → 2.2.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/BaseFeatureWidget/BaseFeatureDetail.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails.js +2 -1
- package/PluginManager.d.ts +3 -3
- package/ReExports/modules.d.ts +3 -3
- package/assemblyManager/assembly.d.ts +20 -14
- package/assemblyManager/assembly.js +74 -75
- package/assemblyManager/assemblyConfigSchema.d.ts +6 -2
- package/assemblyManager/assemblyConfigSchema.js +39 -2
- package/assemblyManager/assemblyManager.d.ts +76 -214
- package/assemblyManager/assemblyManager.js +17 -39
- package/data_adapters/CytobandAdapter.js +7 -0
- package/package.json +2 -2
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +60 -1
- package/pluggableElementTypes/models/BaseDisplayModel.js +138 -92
- package/pluggableElementTypes/models/baseConnectionConfig.js +17 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +27 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +3 -0
- package/pluggableElementTypes/models/baseTrackConfig.js +43 -1
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/BoxRendererType.js +2 -0
- package/rpc/MainThreadRpcDriver.d.ts +1 -1
- package/rpc/MainThreadRpcDriver.js +2 -2
- package/rpc/WebWorkerRpcDriver.d.ts +5 -4
- package/rpc/WebWorkerRpcDriver.js +2 -2
- package/rpc/baseRpcConfig.d.ts +2 -0
- package/rpc/baseRpcConfig.js +18 -0
- package/rpc/configSchema.js +16 -10
- package/rpc/coreRpcMethods.d.ts +14 -14
- package/rpc/coreRpcMethods.js +60 -63
- package/rpc/mainThreadRpcConfig.d.ts +2 -0
- package/rpc/mainThreadRpcConfig.js +19 -0
- package/rpc/webWorkerRpcConfig.d.ts +2 -0
- package/rpc/webWorkerRpcConfig.js +19 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.js +2 -1
- package/ui/App.js +8 -5
- package/ui/AssemblySelector.js +1 -1
- package/ui/DrawerWidget.js +2 -1
- package/ui/LoadingEllipses.d.ts +7 -0
- package/ui/LoadingEllipses.js +38 -0
- package/ui/index.d.ts +1 -0
- package/ui/index.js +3 -1
- package/util/Base1DUtils.js +9 -3
- package/util/calculateDynamicBlocks.js +1 -1
- package/util/calculateStaticBlocks.js +1 -1
- package/util/index.d.ts +1 -0
- package/util/index.js +13 -9
- package/util/io/RemoteFileWithRangeCache.d.ts +1 -2
- package/util/layouts/GranularRectLayout.d.ts +7 -2
- package/util/layouts/GranularRectLayout.js +29 -45
- package/util/layouts/MultiLayout.d.ts +2 -2
- package/util/layouts/MultiLayout.js +4 -6
- package/util/simpleFeature.d.ts +3 -0
- package/util/stats.d.ts +26 -0
- package/util/stats.js +9 -9
|
@@ -10,8 +10,8 @@ export declare const useStyles: (params: void, styleOverrides?: {
|
|
|
10
10
|
} | undefined) => {
|
|
11
11
|
classes: Record<"expansionPanelDetails" | "expandIcon" | "field" | "fieldDescription" | "fieldName" | "fieldValue" | "fieldSubvalue", string>;
|
|
12
12
|
theme: import("@mui/material").Theme;
|
|
13
|
-
css: import("tss-react
|
|
14
|
-
cx: import("tss-react
|
|
13
|
+
css: import("tss-react").Css;
|
|
14
|
+
cx: import("tss-react").Cx;
|
|
15
15
|
};
|
|
16
16
|
export declare function BaseCard({ children, title, defaultExpanded, }: BaseCardProps): JSX.Element;
|
|
17
17
|
export declare const FieldName: ({ description, name, width, prefix, }: {
|
|
@@ -36,6 +36,7 @@ const SequenceHelpDialog_1 = __importDefault(require("./SequenceHelpDialog"));
|
|
|
36
36
|
const SequencePanel_1 = __importDefault(require("./SequencePanel"));
|
|
37
37
|
const util_1 = require("../util");
|
|
38
38
|
const configuration_1 = require("../configuration");
|
|
39
|
+
const ui_1 = require("../ui");
|
|
39
40
|
// icons
|
|
40
41
|
const Settings_1 = __importDefault(require("@mui/icons-material/Settings"));
|
|
41
42
|
const Help_1 = __importDefault(require("@mui/icons-material/Help"));
|
|
@@ -201,7 +202,7 @@ function SequenceFeatureDetails({ model, feature }) {
|
|
|
201
202
|
react_1.default.createElement(material_1.IconButton, { onClick: () => setSettingsDlgOpen(true) },
|
|
202
203
|
react_1.default.createElement(Settings_1.default, null))),
|
|
203
204
|
react_1.default.createElement("br", null),
|
|
204
|
-
react_1.default.createElement(react_1.default.Fragment, null, error ? (react_1.default.createElement(material_1.Typography, { color: "error" }, `${error}`)) : loading ? (react_1.default.createElement(
|
|
205
|
+
react_1.default.createElement(react_1.default.Fragment, null, error ? (react_1.default.createElement(material_1.Typography, { color: "error" }, `${error}`)) : loading ? (react_1.default.createElement(ui_1.LoadingEllipses, null)) : sequence ? ('error' in sequence ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
205
206
|
react_1.default.createElement(material_1.Typography, { color: "error" }, sequence.error),
|
|
206
207
|
react_1.default.createElement(material_1.Button, { variant: "contained", color: "inherit", onClick: () => setForceLoad({ ...forceLoad, force: true }) }, "Force load"))) : (react_1.default.createElement(SequencePanel_1.default, { ref: seqPanelRef, feature: parentFeature, mode: mode, sequence: sequence, intronBp: intronBp }))) : (react_1.default.createElement(material_1.Typography, null, "No sequence found"))))) : null,
|
|
207
208
|
settingsDlgOpen ? (react_1.default.createElement(SequenceFeatureSettingsDialog_1.default, { handleClose: arg => {
|
package/PluginManager.d.ts
CHANGED
|
@@ -223,7 +223,7 @@ export default class PluginManager {
|
|
|
223
223
|
makeStyles: <Params = void, RuleNameSubsetReferencableInNestedSelectors extends string = never>(params?: {
|
|
224
224
|
name?: string | Record<string, unknown> | undefined;
|
|
225
225
|
uniqId?: string | undefined;
|
|
226
|
-
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react
|
|
226
|
+
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: import("@mui/material").Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, styleOverrides?: {
|
|
227
227
|
props: {
|
|
228
228
|
classes?: Record<string, string> | undefined;
|
|
229
229
|
} & Record<string, unknown>;
|
|
@@ -231,8 +231,8 @@ export default class PluginManager {
|
|
|
231
231
|
} | undefined) => {
|
|
232
232
|
classes: Record<RuleName, string>;
|
|
233
233
|
theme: import("@mui/material").Theme;
|
|
234
|
-
css: import("tss-react
|
|
235
|
-
cx: import("tss-react
|
|
234
|
+
css: import("tss-react").Css;
|
|
235
|
+
cx: import("tss-react").Cx;
|
|
236
236
|
};
|
|
237
237
|
};
|
|
238
238
|
'@material-ui/core': {
|
package/ReExports/modules.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ declare const libs: {
|
|
|
144
144
|
makeStyles: <Params = void, RuleNameSubsetReferencableInNestedSelectors extends string = never>(params?: {
|
|
145
145
|
name?: string | Record<string, unknown> | undefined;
|
|
146
146
|
uniqId?: string | undefined;
|
|
147
|
-
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react
|
|
147
|
+
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: MUIStyles.Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, styleOverrides?: {
|
|
148
148
|
props: {
|
|
149
149
|
classes?: Record<string, string> | undefined;
|
|
150
150
|
} & Record<string, unknown>;
|
|
@@ -152,8 +152,8 @@ declare const libs: {
|
|
|
152
152
|
} | undefined) => {
|
|
153
153
|
classes: Record<RuleName, string>;
|
|
154
154
|
theme: MUIStyles.Theme;
|
|
155
|
-
css: import("tss-react
|
|
156
|
-
cx: import("tss-react
|
|
155
|
+
css: import("tss-react").Css;
|
|
156
|
+
cx: import("tss-react").Cx;
|
|
157
157
|
};
|
|
158
158
|
};
|
|
159
159
|
'@material-ui/core': {
|
|
@@ -17,44 +17,50 @@ export interface BasicRegion {
|
|
|
17
17
|
refName: string;
|
|
18
18
|
assemblyName: string;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export interface Loading {
|
|
21
|
+
adapterRegionsWithAssembly: Region[];
|
|
22
|
+
refNameAliases: RefNameAliases;
|
|
23
|
+
lowerCaseRefNameAliases: RefNameAliases;
|
|
24
|
+
cytobands: Feature[];
|
|
25
|
+
}
|
|
26
|
+
export default function assemblyFactory(assemblyConfigType: IAnyType, pm: PluginManager): import("mobx-state-tree").IModelType<{
|
|
21
27
|
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<IAnyType>>;
|
|
22
28
|
}, {
|
|
23
|
-
error:
|
|
24
|
-
|
|
29
|
+
error: unknown;
|
|
30
|
+
loaded: boolean;
|
|
31
|
+
loadingP: Promise<void> | undefined;
|
|
32
|
+
volatileRegions: BasicRegion[] | undefined;
|
|
25
33
|
refNameAliases: RefNameAliases | undefined;
|
|
26
34
|
lowerCaseRefNameAliases: RefNameAliases | undefined;
|
|
27
35
|
cytobands: Feature[] | undefined;
|
|
28
36
|
} & {
|
|
29
37
|
readonly initialized: boolean;
|
|
30
38
|
readonly name: string;
|
|
39
|
+
readonly regions: BasicRegion[] | undefined;
|
|
31
40
|
readonly aliases: string[];
|
|
32
41
|
readonly displayName: string | undefined;
|
|
33
42
|
hasName(name: string): boolean;
|
|
34
43
|
readonly allAliases: string[];
|
|
35
|
-
readonly refNames: string[] | undefined;
|
|
36
44
|
readonly allRefNames: string[] | undefined;
|
|
37
45
|
readonly lowerCaseRefNames: string[] | undefined;
|
|
38
46
|
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
39
47
|
readonly rpcManager: any;
|
|
40
48
|
readonly refNameColors: string[];
|
|
49
|
+
} & {
|
|
50
|
+
readonly refNames: string[] | undefined;
|
|
41
51
|
} & {
|
|
42
52
|
getCanonicalRefName(refName: string): string;
|
|
43
53
|
getRefNameColor(refName: string): string | undefined;
|
|
44
54
|
isValidRefName(refName: string): boolean;
|
|
45
55
|
} & {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
adapterRegionsWithAssembly: Region[];
|
|
49
|
-
refNameAliases: RefNameAliases;
|
|
50
|
-
lowerCaseRefNameAliases: RefNameAliases;
|
|
51
|
-
cytobands: Feature[];
|
|
52
|
-
}): void;
|
|
53
|
-
setError(e: Error): void;
|
|
56
|
+
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: Loading): void;
|
|
57
|
+
setError(e: unknown): void;
|
|
54
58
|
setRegions(regions: Region[]): void;
|
|
55
|
-
setRefNameAliases(aliases: RefNameAliases,
|
|
59
|
+
setRefNameAliases(aliases: RefNameAliases, lcAliases: RefNameAliases): void;
|
|
56
60
|
setCytobands(cytobands: Feature[]): void;
|
|
57
|
-
|
|
61
|
+
setLoadingP(p?: Promise<void>): void;
|
|
62
|
+
load(): Promise<void>;
|
|
63
|
+
loadPre(): Promise<void>;
|
|
58
64
|
} & {
|
|
59
65
|
getAdapterMapEntry(adapterConf: unknown, options: BaseOptions): Promise<RefNameMap>;
|
|
60
66
|
/**
|
|
@@ -3,8 +3,8 @@ 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
|
-
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
7
6
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
7
|
+
const json_stable_stringify_1 = __importDefault(require("json-stable-stringify"));
|
|
8
8
|
const abortable_promise_cache_1 = __importDefault(require("abortable-promise-cache"));
|
|
9
9
|
// locals
|
|
10
10
|
const configuration_1 = require("../configuration");
|
|
@@ -81,7 +81,7 @@ function checkRefName(refName) {
|
|
|
81
81
|
function getAdapterId(adapterConf) {
|
|
82
82
|
return (0, json_stable_stringify_1.default)(adapterConf);
|
|
83
83
|
}
|
|
84
|
-
function assemblyFactory(assemblyConfigType,
|
|
84
|
+
function assemblyFactory(assemblyConfigType, pm) {
|
|
85
85
|
const adapterLoads = new abortable_promise_cache_1.default({
|
|
86
86
|
cache: new QuickLRU_1.default({ maxSize: 1000 }),
|
|
87
87
|
async fill(args, signal, statusCallback) {
|
|
@@ -95,18 +95,27 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
95
95
|
})
|
|
96
96
|
.volatile(() => ({
|
|
97
97
|
error: undefined,
|
|
98
|
-
|
|
98
|
+
loaded: false,
|
|
99
|
+
loadingP: undefined,
|
|
100
|
+
volatileRegions: undefined,
|
|
99
101
|
refNameAliases: undefined,
|
|
100
102
|
lowerCaseRefNameAliases: undefined,
|
|
101
103
|
cytobands: undefined,
|
|
102
104
|
}))
|
|
103
105
|
.views(self => ({
|
|
104
106
|
get initialized() {
|
|
107
|
+
// @ts-ignore
|
|
108
|
+
self.load();
|
|
105
109
|
return !!self.refNameAliases;
|
|
106
110
|
},
|
|
107
111
|
get name() {
|
|
108
112
|
return (0, configuration_1.getConf)(self, 'name');
|
|
109
113
|
},
|
|
114
|
+
get regions() {
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
self.load();
|
|
117
|
+
return self.volatileRegions;
|
|
118
|
+
},
|
|
110
119
|
get aliases() {
|
|
111
120
|
return (0, configuration_1.getConf)(self, 'aliases');
|
|
112
121
|
},
|
|
@@ -119,10 +128,6 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
119
128
|
get allAliases() {
|
|
120
129
|
return [this.name, ...this.aliases];
|
|
121
130
|
},
|
|
122
|
-
get refNames() {
|
|
123
|
-
var _a;
|
|
124
|
-
return (_a = self.regions) === null || _a === void 0 ? void 0 : _a.map(region => region.refName);
|
|
125
|
-
},
|
|
126
131
|
// note: lowerCaseRefNameAliases not included here: this allows the list
|
|
127
132
|
// of refnames to be just the "normal casing", but things like
|
|
128
133
|
// getCanonicalRefName can resolve a lower-case name if needed
|
|
@@ -149,6 +154,12 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
149
154
|
const colors = (0, configuration_1.getConf)(self, 'refNameColors');
|
|
150
155
|
return colors.length === 0 ? refNameColors : colors;
|
|
151
156
|
},
|
|
157
|
+
}))
|
|
158
|
+
.views(self => ({
|
|
159
|
+
get refNames() {
|
|
160
|
+
var _a;
|
|
161
|
+
return (_a = self.regions) === null || _a === void 0 ? void 0 : _a.map(region => region.refName);
|
|
162
|
+
},
|
|
152
163
|
}))
|
|
153
164
|
.views(self => ({
|
|
154
165
|
getCanonicalRefName(refName) {
|
|
@@ -158,9 +169,11 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
158
169
|
return (self.refNameAliases[refName] || self.lowerCaseRefNameAliases[refName]);
|
|
159
170
|
},
|
|
160
171
|
getRefNameColor(refName) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
172
|
+
if (!self.refNames) {
|
|
173
|
+
return undefined;
|
|
174
|
+
}
|
|
175
|
+
const idx = self.refNames.findIndex(r => r === refName);
|
|
176
|
+
if (idx === -1) {
|
|
164
177
|
return undefined;
|
|
165
178
|
}
|
|
166
179
|
return self.refNameColors[idx % self.refNameColors.length];
|
|
@@ -173,8 +186,8 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
173
186
|
},
|
|
174
187
|
}))
|
|
175
188
|
.actions(self => ({
|
|
176
|
-
setLoading() { },
|
|
177
189
|
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }) {
|
|
190
|
+
self.loaded = true;
|
|
178
191
|
this.setRegions(adapterRegionsWithAssembly);
|
|
179
192
|
this.setRefNameAliases(refNameAliases, lowerCaseRefNameAliases);
|
|
180
193
|
this.setCytobands(cytobands);
|
|
@@ -184,21 +197,62 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
184
197
|
self.error = e;
|
|
185
198
|
},
|
|
186
199
|
setRegions(regions) {
|
|
187
|
-
self.
|
|
200
|
+
self.volatileRegions = regions;
|
|
188
201
|
},
|
|
189
|
-
setRefNameAliases(aliases,
|
|
202
|
+
setRefNameAliases(aliases, lcAliases) {
|
|
190
203
|
self.refNameAliases = aliases;
|
|
191
|
-
self.lowerCaseRefNameAliases =
|
|
204
|
+
self.lowerCaseRefNameAliases = lcAliases;
|
|
192
205
|
},
|
|
193
206
|
setCytobands(cytobands) {
|
|
194
207
|
self.cytobands = cytobands;
|
|
195
208
|
},
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
209
|
+
setLoadingP(p) {
|
|
210
|
+
self.loadingP = p;
|
|
211
|
+
},
|
|
212
|
+
load() {
|
|
213
|
+
if (!self.loadingP) {
|
|
214
|
+
self.loadingP = this.loadPre().catch(e => {
|
|
215
|
+
this.setLoadingP(undefined);
|
|
216
|
+
this.setError(e);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
return self.loadingP;
|
|
220
|
+
},
|
|
221
|
+
async loadPre() {
|
|
222
|
+
var _a, _b;
|
|
223
|
+
const conf = self.configuration;
|
|
224
|
+
const refNameAliasesAdapterConf = (_a = conf.refNameAliases) === null || _a === void 0 ? void 0 : _a.adapter;
|
|
225
|
+
const cytobandAdapterConf = (_b = conf.cytobands) === null || _b === void 0 ? void 0 : _b.adapter;
|
|
226
|
+
const sequenceAdapterConf = conf.sequence.adapter;
|
|
227
|
+
const assemblyName = self.name;
|
|
228
|
+
const regions = await getAssemblyRegions(sequenceAdapterConf, pm);
|
|
229
|
+
const adapterRegionsWithAssembly = regions.map(r => {
|
|
230
|
+
checkRefName(r.refName);
|
|
231
|
+
return { ...r, assemblyName };
|
|
232
|
+
});
|
|
233
|
+
const refNameAliases = {};
|
|
234
|
+
const ret = await getRefNameAliases(refNameAliasesAdapterConf, pm);
|
|
235
|
+
const cytobands = await getCytobands(cytobandAdapterConf, pm);
|
|
236
|
+
ret.forEach(({ refName, aliases }) => {
|
|
237
|
+
aliases.forEach(a => {
|
|
238
|
+
checkRefName(a);
|
|
239
|
+
refNameAliases[a] = refName;
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
// add identity to the refNameAliases list
|
|
243
|
+
adapterRegionsWithAssembly.forEach(region => {
|
|
244
|
+
refNameAliases[region.refName] = region.refName;
|
|
245
|
+
});
|
|
246
|
+
const lowerCaseRefNameAliases = Object.fromEntries(Object.entries(refNameAliases).map(([key, val]) => [
|
|
247
|
+
key.toLowerCase(),
|
|
248
|
+
val,
|
|
249
|
+
]));
|
|
250
|
+
this.setLoaded({
|
|
251
|
+
adapterRegionsWithAssembly,
|
|
252
|
+
refNameAliases,
|
|
253
|
+
lowerCaseRefNameAliases,
|
|
254
|
+
cytobands,
|
|
255
|
+
});
|
|
202
256
|
},
|
|
203
257
|
}))
|
|
204
258
|
.views(self => ({
|
|
@@ -237,61 +291,6 @@ function assemblyFactory(assemblyConfigType, pluginManager) {
|
|
|
237
291
|
}));
|
|
238
292
|
}
|
|
239
293
|
exports.default = assemblyFactory;
|
|
240
|
-
function makeLoadAssemblyData(pluginManager) {
|
|
241
|
-
return (self) => {
|
|
242
|
-
if (self.configuration) {
|
|
243
|
-
// use full configuration instead of snapshot of the config, the
|
|
244
|
-
// rpcManager normally receives a snapshot but we bypass rpcManager here
|
|
245
|
-
// to avoid spinning up a webworker
|
|
246
|
-
const { sequence, refNameAliases, cytobands } = self.configuration;
|
|
247
|
-
const sequenceAdapterConfig = sequence.adapter;
|
|
248
|
-
const refNameAliasesAdapterConfig = refNameAliases === null || refNameAliases === void 0 ? void 0 : refNameAliases.adapter;
|
|
249
|
-
const cytobandAdapterConfig = cytobands === null || cytobands === void 0 ? void 0 : cytobands.adapter;
|
|
250
|
-
return {
|
|
251
|
-
sequenceAdapterConfig,
|
|
252
|
-
assemblyName: self.name,
|
|
253
|
-
refNameAliasesAdapterConfig,
|
|
254
|
-
cytobandAdapterConfig,
|
|
255
|
-
pluginManager,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
return undefined;
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
async function loadAssemblyReaction(props, signal) {
|
|
262
|
-
if (!props) {
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
const { sequenceAdapterConfig, assemblyName, refNameAliasesAdapterConfig, cytobandAdapterConfig, pluginManager, } = props;
|
|
266
|
-
const adapterRegions = await getAssemblyRegions(sequenceAdapterConfig, pluginManager, signal);
|
|
267
|
-
const adapterRegionsWithAssembly = adapterRegions.map(adapterRegion => {
|
|
268
|
-
checkRefName(adapterRegion.refName);
|
|
269
|
-
return { ...adapterRegion, assemblyName };
|
|
270
|
-
});
|
|
271
|
-
const refNameAliases = {};
|
|
272
|
-
const aliases = await getRefNameAliases(refNameAliasesAdapterConfig, pluginManager, signal);
|
|
273
|
-
const cytobands = await getCytobands(cytobandAdapterConfig, pluginManager);
|
|
274
|
-
aliases.forEach(({ refName, aliases }) => {
|
|
275
|
-
aliases.forEach(alias => {
|
|
276
|
-
checkRefName(alias);
|
|
277
|
-
refNameAliases[alias] = refName;
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
// add identity to the refNameAliases list
|
|
281
|
-
adapterRegionsWithAssembly.forEach(region => {
|
|
282
|
-
refNameAliases[region.refName] = region.refName;
|
|
283
|
-
});
|
|
284
|
-
const lowerCaseRefNameAliases = Object.fromEntries(Object.entries(refNameAliases).map(([key, val]) => [
|
|
285
|
-
key.toLowerCase(),
|
|
286
|
-
val,
|
|
287
|
-
]));
|
|
288
|
-
return {
|
|
289
|
-
adapterRegionsWithAssembly,
|
|
290
|
-
refNameAliases,
|
|
291
|
-
lowerCaseRefNameAliases,
|
|
292
|
-
cytobands,
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
294
|
async function getRefNameAliases(config, pm, signal) {
|
|
296
295
|
const type = pm.getAdapterType(config.type);
|
|
297
296
|
const CLASS = await type.getAdapterClass();
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import PluginManager from '../PluginManager';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* #config BaseAssembly
|
|
4
|
+
* This corresponds to the assemblies section of the config
|
|
5
|
+
*/
|
|
6
|
+
declare function assemblyConfigSchema(pluginManager: PluginManager): import("../configuration").AnyConfigurationSchemaType;
|
|
7
|
+
export default assemblyConfigSchema;
|
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("../configuration");
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* #config BaseAssembly
|
|
6
|
+
* This corresponds to the assemblies section of the config
|
|
7
|
+
*/
|
|
8
|
+
function assemblyConfigSchema(pluginManager) {
|
|
5
9
|
return (0, configuration_1.ConfigurationSchema)('BaseAssembly', {
|
|
10
|
+
/**
|
|
11
|
+
* #slot
|
|
12
|
+
* aliases are "reference name aliases" e.g. aliases for hg38 might be "GRCh38"
|
|
13
|
+
*/
|
|
6
14
|
aliases: {
|
|
7
15
|
type: 'stringArray',
|
|
8
16
|
defaultValue: [],
|
|
9
17
|
description: 'Other possible names for the assembly',
|
|
10
18
|
},
|
|
19
|
+
/**
|
|
20
|
+
* #slot
|
|
21
|
+
* sequence refers to a reference sequence track that has an adapter containing,
|
|
22
|
+
* importantly, a sequence adapter such as IndexedFastaAdapter
|
|
23
|
+
*/
|
|
11
24
|
sequence: pluginManager.getTrackType('ReferenceSequenceTrack')
|
|
12
25
|
.configSchema,
|
|
26
|
+
/**
|
|
27
|
+
* #slot
|
|
28
|
+
*/
|
|
13
29
|
refNameColors: {
|
|
14
30
|
type: 'stringArray',
|
|
15
31
|
defaultValue: [],
|
|
16
32
|
description: 'Define custom colors for each reference sequence. Will cycle through this list if there are not enough colors for every sequence.',
|
|
17
33
|
},
|
|
18
34
|
refNameAliases: (0, configuration_1.ConfigurationSchema)('RefNameAliases', {
|
|
35
|
+
/**
|
|
36
|
+
* #slot refNameAliases.adapter
|
|
37
|
+
* refNameAliases help resolve e.g. chr1 and 1 as the same entity
|
|
38
|
+
* the data for refNameAliases are fetched from an adapter, that is
|
|
39
|
+
* commonly a tsv like chromAliases.txt from UCSC or similar
|
|
40
|
+
*/
|
|
19
41
|
adapter: pluginManager.pluggableConfigSchemaType('adapter'),
|
|
20
42
|
}, {
|
|
21
43
|
preProcessSnapshot: snap => {
|
|
@@ -28,6 +50,11 @@ exports.default = (pluginManager) => {
|
|
|
28
50
|
},
|
|
29
51
|
}),
|
|
30
52
|
cytobands: (0, configuration_1.ConfigurationSchema)('Cytoband', {
|
|
53
|
+
/**
|
|
54
|
+
* #slot cytobands.adapter
|
|
55
|
+
* cytoband data is fetched from an adapter, and can be displayed by a
|
|
56
|
+
* view type as ideograms
|
|
57
|
+
*/
|
|
31
58
|
adapter: pluginManager.pluggableConfigSchemaType('adapter'),
|
|
32
59
|
}, {
|
|
33
60
|
preProcessSnapshot: snap => {
|
|
@@ -39,12 +66,22 @@ exports.default = (pluginManager) => {
|
|
|
39
66
|
return snap;
|
|
40
67
|
},
|
|
41
68
|
}),
|
|
69
|
+
/**
|
|
70
|
+
* #slot
|
|
71
|
+
*/
|
|
42
72
|
displayName: {
|
|
43
73
|
type: 'string',
|
|
44
74
|
defaultValue: '',
|
|
45
75
|
description: 'A human readable display name for the assembly e.g. "Homo sapiens (hg38)" while the assembly name may just be "hg38"',
|
|
46
76
|
},
|
|
47
77
|
}, {
|
|
78
|
+
/**
|
|
79
|
+
* #identifier name
|
|
80
|
+
* the name acts as a unique identifier in the config, so it cannot be duplicated.
|
|
81
|
+
* it usually a short human readable "id" like hg38, but you can also optionally
|
|
82
|
+
* customize the assembly "displayName" config slot
|
|
83
|
+
*/
|
|
48
84
|
explicitIdentifier: 'name',
|
|
49
85
|
});
|
|
50
|
-
}
|
|
86
|
+
}
|
|
87
|
+
exports.default = assemblyConfigSchema;
|