@jbrowse/core 2.4.2 → 2.6.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/ArrayValue.d.ts +16 -0
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +45 -0
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +15 -0
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +52 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +13 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +27 -0
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +15 -0
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +98 -0
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +16 -0
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +32 -0
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +17 -0
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +23 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +18 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +31 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.d.ts +7 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.js +13 -0
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +33 -0
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +170 -0
- package/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +5 -0
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +46 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.d.ts +13 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.js +25 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.js +12 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.js +14 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.d.ts +9 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.js +18 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +143 -0
- package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.d.ts → SequenceFeatureDetails/SequenceFeatureSettingsDialog.d.ts} +2 -2
- package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.js → SequenceFeatureDetails/SequenceFeatureSettingsDialog.js} +1 -1
- package/BaseFeatureWidget/{SequenceHelpDialog.d.ts → SequenceFeatureDetails/SequenceHelpDialog.d.ts} +2 -2
- package/BaseFeatureWidget/{SequenceHelpDialog.js → SequenceFeatureDetails/SequenceHelpDialog.js} +6 -9
- package/BaseFeatureWidget/{SequencePanel.d.ts → SequenceFeatureDetails/SequencePanel.d.ts} +1 -1
- package/BaseFeatureWidget/{SequencePanel.js → SequenceFeatureDetails/SequencePanel.js} +10 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +10 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +73 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +3 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/index.js +68 -0
- package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.d.ts +17 -17
- package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.d.ts +16 -16
- package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +11 -0
- package/BaseFeatureWidget/index.d.ts +4 -1
- package/BaseFeatureWidget/index.js +29 -17
- package/BaseFeatureWidget/types.d.ts +2 -2
- package/BaseFeatureWidget/util.js +15 -5
- package/Plugin.d.ts +1 -1
- package/PluginLoader.js +17 -0
- package/PluginManager.d.ts +8 -5
- package/PluginManager.js +3 -0
- package/README.md +0 -2
- package/ReExports/list.js +1 -0
- package/ReExports/modules.d.ts +8 -5
- package/ReExports/modules.js +7 -7
- package/TextSearch/TextSearchManager.d.ts +2 -9
- package/assemblyManager/assembly.d.ts +91 -8
- package/assemblyManager/assembly.js +92 -8
- package/assemblyManager/assemblyConfigSchema.d.ts +52 -1
- package/assemblyManager/assemblyConfigSchema.js +1 -0
- package/assemblyManager/assemblyManager.d.ts +227 -58
- package/assemblyManager/assemblyManager.js +72 -13
- package/assemblyManager/index.d.ts +1 -0
- package/configuration/configurationSchema.d.ts +14 -16
- package/configuration/configurationSchema.js +4 -2
- package/configuration/index.d.ts +1 -1
- package/configuration/types.d.ts +15 -0
- package/configuration/types.js +2 -0
- package/configuration/util.d.ts +5 -3
- package/configuration/util.js +18 -18
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +23 -0
- package/data_adapters/BaseAdapter/BaseAdapter.js +37 -0
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +128 -0
- package/data_adapters/{BaseAdapter.js → BaseAdapter/BaseFeatureDataAdapter.js} +58 -88
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +16 -0
- package/data_adapters/BaseAdapter/BaseOptions.js +2 -0
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +9 -0
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +2 -0
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +13 -0
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.js +10 -0
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +6 -0
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +2 -0
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +6 -0
- package/data_adapters/BaseAdapter/RegionsAdapter.js +2 -0
- package/data_adapters/BaseAdapter/index.d.ts +15 -0
- package/data_adapters/BaseAdapter/index.js +25 -0
- package/data_adapters/BaseAdapter/types.d.ts +21 -0
- package/data_adapters/BaseAdapter/types.js +2 -0
- package/data_adapters/BaseAdapter/util.d.ts +12 -0
- package/data_adapters/BaseAdapter/util.js +23 -0
- package/data_adapters/CytobandAdapter/configSchema.d.ts +11 -1
- package/package.json +4 -4
- package/pluggableElementTypes/AdapterType.d.ts +1 -1
- package/pluggableElementTypes/ConnectionType.d.ts +1 -1
- package/pluggableElementTypes/DisplayType.d.ts +1 -1
- package/pluggableElementTypes/InternetAccountType.d.ts +1 -1
- package/pluggableElementTypes/RpcMethodType.d.ts +9 -7
- package/pluggableElementTypes/RpcMethodType.js +9 -7
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +1 -1
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +18 -0
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +9 -0
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +10 -1
- package/pluggableElementTypes/models/BaseDisplayModel.js +9 -1
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +2 -1
- package/pluggableElementTypes/models/BaseTrackModel.js +4 -2
- package/pluggableElementTypes/models/BaseViewModel.d.ts +46 -2
- package/pluggableElementTypes/models/BaseViewModel.js +6 -0
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +36 -2
- package/pluggableElementTypes/models/InternetAccountModel.js +33 -21
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +22 -2
- package/pluggableElementTypes/models/baseConnectionConfig.js +2 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +42 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +120 -3
- package/pluggableElementTypes/models/baseTrackConfig.js +7 -5
- package/pluggableElementTypes/models/index.d.ts +1 -1
- package/pluggableElementTypes/renderers/BoxRendererType.js +1 -2
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +2 -2
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +4 -2
- package/pluggableElementTypes/renderers/FeatureRendererType.js +4 -6
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -2
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
- package/rpc/BaseRpcDriver.js +1 -7
- package/rpc/RpcManager.d.ts +8 -1
- package/rpc/RpcManager.js +1 -1
- package/rpc/baseRpcConfig.d.ts +10 -1
- package/rpc/configSchema.d.ts +14 -1
- package/rpc/coreRpcMethods.d.ts +1 -1
- package/rpc/coreRpcMethods.js +3 -3
- package/rpc/mainThreadRpcConfig.d.ts +7 -1
- package/rpc/methods/{CoreEstimateRegionStats.d.ts → CoreGetFeatureDensityStats.d.ts} +2 -2
- package/rpc/methods/{CoreEstimateRegionStats.js → CoreGetFeatureDensityStats.js} +4 -4
- package/rpc/methods/CoreGetFeatureDetails.js +5 -5
- package/rpc/webWorkerRpcConfig.d.ts +7 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +2 -2
- package/ui/AssemblySelector.d.ts +2 -2
- package/ui/AssemblySelector.js +1 -1
- package/ui/CascadingMenu.d.ts +2 -2
- package/ui/CascadingMenuButton.d.ts +8 -0
- package/ui/CascadingMenuButton.js +20 -0
- package/ui/ColorPicker.d.ts +4 -4
- package/ui/Dialog.d.ts +5 -5
- package/ui/Dialog.js +19 -7
- package/ui/DropDownMenu.d.ts +2 -2
- package/ui/EditableTypography.js +1 -1
- package/ui/ErrorMessage.d.ts +2 -2
- package/ui/ErrorMessage.js +6 -2
- package/ui/FactoryResetDialog.d.ts +2 -2
- package/ui/FatalErrorDialog.d.ts +6 -7
- package/ui/FatalErrorDialog.js +7 -7
- package/ui/FileSelector/FileSelector.d.ts +2 -2
- package/ui/FileSelector/FileSelector.js +3 -2
- package/ui/FileSelector/LocalFileChooser.d.ts +2 -2
- package/ui/FileSelector/UrlChooser.d.ts +3 -4
- package/ui/FileSelector/UrlChooser.js +8 -10
- package/ui/Icons.d.ts +10 -10
- package/ui/LoadingEllipses.d.ts +2 -2
- package/ui/Logo.d.ts +3 -3
- package/ui/Menu.d.ts +2 -2
- package/ui/PrerenderedCanvas.d.ts +2 -2
- package/ui/ResizeBar.d.ts +1 -1
- package/ui/ResizeBar.js +1 -1
- package/ui/ResizeHandle.d.ts +2 -2
- package/ui/ReturnToImportFormDialog.d.ts +2 -2
- package/ui/SanitizedHTML.d.ts +2 -2
- package/ui/SanitizedHTML.js +6 -0
- package/ui/Snackbar.d.ts +7 -9
- package/ui/Snackbar.js +12 -17
- package/ui/SnackbarModel.d.ts +9 -3
- package/ui/SnackbarModel.js +3 -3
- package/ui/Tooltip.d.ts +2 -2
- package/ui/index.d.ts +0 -1
- package/ui/index.js +1 -3
- package/ui/react-colorful.d.ts +1 -1
- package/ui/theme.js +3 -18
- package/util/Base1DUtils.js +2 -1
- package/util/QuickLRU.d.ts +1 -1
- package/util/blockTypes.js +1 -1
- package/util/formatFastaStrings.js +1 -1
- package/util/index.d.ts +18 -2
- package/util/index.js +77 -11
- package/util/io/index.js +1 -1
- package/util/layouts/PrecomputedMultiLayout.d.ts +1 -1
- package/util/mst-reflection.js +1 -2
- package/util/offscreenCanvasUtils.d.ts +2 -2
- package/util/stats.d.ts +5 -5
- package/util/types/index.d.ts +9 -3
- package/util/types/index.js +6 -2
- package/util/types/mst.d.ts +12 -9
- package/util/types/util.d.ts +0 -3
- package/BaseFeatureWidget/BaseFeatureDetail.d.ts +0 -62
- package/BaseFeatureWidget/BaseFeatureDetail.js +0 -378
- package/BaseFeatureWidget/SequenceBox.d.ts +0 -29
- package/BaseFeatureWidget/SequenceBox.js +0 -63
- package/BaseFeatureWidget/SequenceFeatureDetails.d.ts +0 -3
- package/BaseFeatureWidget/SequenceFeatureDetails.js +0 -230
- package/data_adapters/BaseAdapter.d.ts +0 -138
- package/ui/AboutDialog.d.ts +0 -12
- package/ui/AboutDialog.js +0 -125
- package/ui/App.d.ts +0 -18
- package/ui/App.js +0 -114
- package/ui/AppToolbar.d.ts +0 -19
- package/ui/AppToolbar.js +0 -56
- package/ui/Drawer.d.ts +0 -8
- package/ui/Drawer.js +0 -34
- package/ui/DrawerWidget.d.ts +0 -6
- package/ui/DrawerWidget.js +0 -130
- package/ui/ViewContainer.d.ts +0 -9
- package/ui/ViewContainer.js +0 -76
- package/ui/ViewContainerTitle.d.ts +0 -6
- package/ui/ViewContainerTitle.js +0 -42
- package/ui/ViewLauncher.d.ts +0 -18
- package/ui/ViewLauncher.js +0 -50
- package/ui/ViewMenu.d.ts +0 -9
- package/ui/ViewMenu.js +0 -69
- package/ui/ViewPanel.d.ts +0 -19
- package/ui/ViewPanel.js +0 -49
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.js +0 -0
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.js +0 -0
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Instance, IAnyType } from 'mobx-state-tree';
|
|
2
|
+
import { BaseOptions } from '../data_adapters/BaseAdapter';
|
|
2
3
|
import PluginManager from '../PluginManager';
|
|
3
4
|
import { Region, Feature } from '../util';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
signal?: AbortSignal;
|
|
7
|
-
sessionId: string;
|
|
8
|
-
statusCallback?: Function;
|
|
9
|
-
}
|
|
5
|
+
import RpcManager from '../rpc/RpcManager';
|
|
6
|
+
type RefNameAliases = Record<string, string | undefined>;
|
|
10
7
|
export interface RefNameMap {
|
|
11
8
|
forwardMap: RefNameAliases;
|
|
12
9
|
reverseMap: RefNameAliases;
|
|
@@ -23,7 +20,13 @@ export interface Loading {
|
|
|
23
20
|
lowerCaseRefNameAliases: RefNameAliases;
|
|
24
21
|
cytobands: Feature[];
|
|
25
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* #stateModel Assembly
|
|
25
|
+
*/
|
|
26
26
|
export default function assemblyFactory(assemblyConfigType: IAnyType, pm: PluginManager): import("mobx-state-tree").IModelType<{
|
|
27
|
+
/**
|
|
28
|
+
* #property
|
|
29
|
+
*/
|
|
27
30
|
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<IAnyType>>;
|
|
28
31
|
}, {
|
|
29
32
|
error: unknown;
|
|
@@ -34,40 +37,120 @@ export default function assemblyFactory(assemblyConfigType: IAnyType, pm: Plugin
|
|
|
34
37
|
lowerCaseRefNameAliases: RefNameAliases | undefined;
|
|
35
38
|
cytobands: Feature[] | undefined;
|
|
36
39
|
} & {
|
|
40
|
+
/**
|
|
41
|
+
* #getter
|
|
42
|
+
*/
|
|
37
43
|
readonly initialized: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* #getter
|
|
46
|
+
*/
|
|
38
47
|
readonly name: string;
|
|
48
|
+
/**
|
|
49
|
+
* #getter
|
|
50
|
+
*/
|
|
39
51
|
readonly regions: BasicRegion[] | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* #getter
|
|
54
|
+
*/
|
|
40
55
|
readonly aliases: string[];
|
|
56
|
+
/**
|
|
57
|
+
* #getter
|
|
58
|
+
*/
|
|
41
59
|
readonly displayName: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* #getter
|
|
62
|
+
*/
|
|
42
63
|
hasName(name: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* #getter
|
|
66
|
+
*/
|
|
43
67
|
readonly allAliases: string[];
|
|
68
|
+
/**
|
|
69
|
+
* #getter
|
|
70
|
+
* note: lowerCaseRefNameAliases not included here: this allows the list
|
|
71
|
+
* of refnames to be just the "normal casing", but things like
|
|
72
|
+
* getCanonicalRefName can resolve a lower-case name if needed
|
|
73
|
+
*/
|
|
44
74
|
readonly allRefNames: string[] | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* #getter
|
|
77
|
+
*/
|
|
45
78
|
readonly lowerCaseRefNames: string[] | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* #getter
|
|
81
|
+
*/
|
|
46
82
|
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
47
|
-
|
|
83
|
+
/**
|
|
84
|
+
* #getter
|
|
85
|
+
*/
|
|
86
|
+
readonly rpcManager: RpcManager;
|
|
87
|
+
/**
|
|
88
|
+
* #getter
|
|
89
|
+
*/
|
|
48
90
|
readonly refNameColors: string[];
|
|
49
91
|
} & {
|
|
92
|
+
/**
|
|
93
|
+
* #getter
|
|
94
|
+
*/
|
|
50
95
|
readonly refNames: string[] | undefined;
|
|
51
96
|
} & {
|
|
52
|
-
|
|
97
|
+
/**
|
|
98
|
+
* #method
|
|
99
|
+
*/
|
|
100
|
+
getCanonicalRefName(refName: string): string | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* #method
|
|
103
|
+
*/
|
|
53
104
|
getRefNameColor(refName: string): string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* #method
|
|
107
|
+
*/
|
|
54
108
|
isValidRefName(refName: string): boolean;
|
|
55
109
|
} & {
|
|
110
|
+
/**
|
|
111
|
+
* #action
|
|
112
|
+
*/
|
|
56
113
|
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: Loading): void;
|
|
114
|
+
/**
|
|
115
|
+
* #action
|
|
116
|
+
*/
|
|
57
117
|
setError(e: unknown): void;
|
|
118
|
+
/**
|
|
119
|
+
* #action
|
|
120
|
+
*/
|
|
58
121
|
setRegions(regions: Region[]): void;
|
|
122
|
+
/**
|
|
123
|
+
* #action
|
|
124
|
+
*/
|
|
59
125
|
setRefNameAliases(aliases: RefNameAliases, lcAliases: RefNameAliases): void;
|
|
126
|
+
/**
|
|
127
|
+
* #action
|
|
128
|
+
*/
|
|
60
129
|
setCytobands(cytobands: Feature[]): void;
|
|
130
|
+
/**
|
|
131
|
+
* #action
|
|
132
|
+
*/
|
|
61
133
|
setLoadingP(p?: Promise<void>): void;
|
|
134
|
+
/**
|
|
135
|
+
* #action
|
|
136
|
+
*/
|
|
62
137
|
load(): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* #action
|
|
140
|
+
*/
|
|
63
141
|
loadPre(): Promise<void>;
|
|
64
142
|
} & {
|
|
143
|
+
/**
|
|
144
|
+
* #method
|
|
145
|
+
*/
|
|
65
146
|
getAdapterMapEntry(adapterConf: unknown, options: BaseOptions): Promise<RefNameMap>;
|
|
66
147
|
/**
|
|
148
|
+
* #method
|
|
67
149
|
* get Map of `canonical-name -> adapter-specific-name`
|
|
68
150
|
*/
|
|
69
151
|
getRefNameMapForAdapter(adapterConf: unknown, opts: BaseOptions): Promise<RefNameAliases>;
|
|
70
152
|
/**
|
|
153
|
+
* #method
|
|
71
154
|
* get Map of `adapter-specific-name -> canonical-name`
|
|
72
155
|
*/
|
|
73
156
|
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: BaseOptions): Promise<RefNameAliases>;
|
|
@@ -49,7 +49,7 @@ async function loadRefNameMap(assembly, adapterConfig, options, signal) {
|
|
|
49
49
|
signal,
|
|
50
50
|
name: 'when assembly ready',
|
|
51
51
|
});
|
|
52
|
-
const refNames = (await assembly.rpcManager.call(sessionId, 'CoreGetRefNames', {
|
|
52
|
+
const refNames = (await assembly.rpcManager.call(sessionId || 'assemblyRpc', 'CoreGetRefNames', {
|
|
53
53
|
adapterConfig,
|
|
54
54
|
signal,
|
|
55
55
|
...options,
|
|
@@ -81,9 +81,13 @@ function checkRefName(refName) {
|
|
|
81
81
|
function getAdapterId(adapterConf) {
|
|
82
82
|
return (0, json_stable_stringify_1.default)(adapterConf);
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* #stateModel Assembly
|
|
86
|
+
*/
|
|
84
87
|
function assemblyFactory(assemblyConfigType, pm) {
|
|
85
88
|
const adapterLoads = new abortable_promise_cache_1.default({
|
|
86
89
|
cache: new QuickLRU_1.default({ maxSize: 1000 }),
|
|
90
|
+
// @ts-expect-error
|
|
87
91
|
async fill(args, signal, statusCallback) {
|
|
88
92
|
const { adapterConf, self, options } = args;
|
|
89
93
|
return loadRefNameMap(self, adapterConf, { ...options, statusCallback }, signal);
|
|
@@ -91,6 +95,9 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
91
95
|
});
|
|
92
96
|
return mobx_state_tree_1.types
|
|
93
97
|
.model({
|
|
98
|
+
/**
|
|
99
|
+
* #property
|
|
100
|
+
*/
|
|
94
101
|
configuration: mobx_state_tree_1.types.safeReference(assemblyConfigType),
|
|
95
102
|
})
|
|
96
103
|
.volatile(() => ({
|
|
@@ -103,71 +110,116 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
103
110
|
cytobands: undefined,
|
|
104
111
|
}))
|
|
105
112
|
.views(self => ({
|
|
113
|
+
/**
|
|
114
|
+
* #getter
|
|
115
|
+
*/
|
|
106
116
|
get initialized() {
|
|
107
117
|
// @ts-expect-error
|
|
108
118
|
self.load();
|
|
109
119
|
return !!self.refNameAliases;
|
|
110
120
|
},
|
|
121
|
+
/**
|
|
122
|
+
* #getter
|
|
123
|
+
*/
|
|
111
124
|
get name() {
|
|
112
125
|
return (0, configuration_1.getConf)(self, 'name');
|
|
113
126
|
},
|
|
127
|
+
/**
|
|
128
|
+
* #getter
|
|
129
|
+
*/
|
|
114
130
|
get regions() {
|
|
115
131
|
// @ts-expect-error
|
|
116
132
|
self.load();
|
|
117
133
|
return self.volatileRegions;
|
|
118
134
|
},
|
|
135
|
+
/**
|
|
136
|
+
* #getter
|
|
137
|
+
*/
|
|
119
138
|
get aliases() {
|
|
120
139
|
return (0, configuration_1.getConf)(self, 'aliases');
|
|
121
140
|
},
|
|
141
|
+
/**
|
|
142
|
+
* #getter
|
|
143
|
+
*/
|
|
122
144
|
get displayName() {
|
|
123
145
|
return (0, configuration_1.getConf)(self, 'displayName');
|
|
124
146
|
},
|
|
147
|
+
/**
|
|
148
|
+
* #getter
|
|
149
|
+
*/
|
|
125
150
|
hasName(name) {
|
|
126
151
|
return this.allAliases.includes(name);
|
|
127
152
|
},
|
|
153
|
+
/**
|
|
154
|
+
* #getter
|
|
155
|
+
*/
|
|
128
156
|
get allAliases() {
|
|
129
157
|
return [this.name, ...this.aliases];
|
|
130
158
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
159
|
+
/**
|
|
160
|
+
* #getter
|
|
161
|
+
* note: lowerCaseRefNameAliases not included here: this allows the list
|
|
162
|
+
* of refnames to be just the "normal casing", but things like
|
|
163
|
+
* getCanonicalRefName can resolve a lower-case name if needed
|
|
164
|
+
*/
|
|
134
165
|
get allRefNames() {
|
|
135
166
|
return !self.refNameAliases
|
|
136
167
|
? undefined
|
|
137
168
|
: Object.keys(self.refNameAliases);
|
|
138
169
|
},
|
|
170
|
+
/**
|
|
171
|
+
* #getter
|
|
172
|
+
*/
|
|
139
173
|
get lowerCaseRefNames() {
|
|
140
174
|
return !self.lowerCaseRefNameAliases
|
|
141
175
|
? undefined
|
|
142
176
|
: Object.keys(self.lowerCaseRefNameAliases || {});
|
|
143
177
|
},
|
|
178
|
+
/**
|
|
179
|
+
* #getter
|
|
180
|
+
*/
|
|
144
181
|
get allRefNamesWithLowerCase() {
|
|
145
182
|
return this.allRefNames && this.lowerCaseRefNames
|
|
146
183
|
? [...new Set([...this.allRefNames, ...this.lowerCaseRefNames])]
|
|
147
184
|
: undefined;
|
|
148
185
|
},
|
|
186
|
+
/**
|
|
187
|
+
* #getter
|
|
188
|
+
*/
|
|
149
189
|
get rpcManager() {
|
|
150
190
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
191
|
return (0, mobx_state_tree_1.getParent)(self, 2).rpcManager;
|
|
152
192
|
},
|
|
193
|
+
/**
|
|
194
|
+
* #getter
|
|
195
|
+
*/
|
|
153
196
|
get refNameColors() {
|
|
154
197
|
const colors = (0, configuration_1.getConf)(self, 'refNameColors');
|
|
155
198
|
return colors.length === 0 ? refNameColors : colors;
|
|
156
199
|
},
|
|
157
200
|
}))
|
|
158
201
|
.views(self => ({
|
|
202
|
+
/**
|
|
203
|
+
* #getter
|
|
204
|
+
*/
|
|
159
205
|
get refNames() {
|
|
160
206
|
var _a;
|
|
161
207
|
return (_a = self.regions) === null || _a === void 0 ? void 0 : _a.map(region => region.refName);
|
|
162
208
|
},
|
|
163
209
|
}))
|
|
164
210
|
.views(self => ({
|
|
211
|
+
/**
|
|
212
|
+
* #method
|
|
213
|
+
*/
|
|
165
214
|
getCanonicalRefName(refName) {
|
|
166
215
|
if (!self.refNameAliases || !self.lowerCaseRefNameAliases) {
|
|
167
216
|
throw new Error('aliases not loaded, we expect them to be loaded before getCanonicalRefName can be called');
|
|
168
217
|
}
|
|
169
218
|
return (self.refNameAliases[refName] || self.lowerCaseRefNameAliases[refName]);
|
|
170
219
|
},
|
|
220
|
+
/**
|
|
221
|
+
* #method
|
|
222
|
+
*/
|
|
171
223
|
getRefNameColor(refName) {
|
|
172
224
|
if (!self.refNames) {
|
|
173
225
|
return undefined;
|
|
@@ -178,6 +230,9 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
178
230
|
}
|
|
179
231
|
return self.refNameColors[idx % self.refNameColors.length];
|
|
180
232
|
},
|
|
233
|
+
/**
|
|
234
|
+
* #method
|
|
235
|
+
*/
|
|
181
236
|
isValidRefName(refName) {
|
|
182
237
|
if (!self.refNameAliases) {
|
|
183
238
|
throw new Error('isValidRefName cannot be called yet, the assembly has not finished loading');
|
|
@@ -186,29 +241,50 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
186
241
|
},
|
|
187
242
|
}))
|
|
188
243
|
.actions(self => ({
|
|
244
|
+
/**
|
|
245
|
+
* #action
|
|
246
|
+
*/
|
|
189
247
|
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }) {
|
|
190
248
|
self.loaded = true;
|
|
191
249
|
this.setRegions(adapterRegionsWithAssembly);
|
|
192
250
|
this.setRefNameAliases(refNameAliases, lowerCaseRefNameAliases);
|
|
193
251
|
this.setCytobands(cytobands);
|
|
194
252
|
},
|
|
253
|
+
/**
|
|
254
|
+
* #action
|
|
255
|
+
*/
|
|
195
256
|
setError(e) {
|
|
196
257
|
console.error(e);
|
|
197
258
|
self.error = e;
|
|
198
259
|
},
|
|
260
|
+
/**
|
|
261
|
+
* #action
|
|
262
|
+
*/
|
|
199
263
|
setRegions(regions) {
|
|
200
264
|
self.volatileRegions = regions;
|
|
201
265
|
},
|
|
266
|
+
/**
|
|
267
|
+
* #action
|
|
268
|
+
*/
|
|
202
269
|
setRefNameAliases(aliases, lcAliases) {
|
|
203
270
|
self.refNameAliases = aliases;
|
|
204
271
|
self.lowerCaseRefNameAliases = lcAliases;
|
|
205
272
|
},
|
|
273
|
+
/**
|
|
274
|
+
* #action
|
|
275
|
+
*/
|
|
206
276
|
setCytobands(cytobands) {
|
|
207
277
|
self.cytobands = cytobands;
|
|
208
278
|
},
|
|
279
|
+
/**
|
|
280
|
+
* #action
|
|
281
|
+
*/
|
|
209
282
|
setLoadingP(p) {
|
|
210
283
|
self.loadingP = p;
|
|
211
284
|
},
|
|
285
|
+
/**
|
|
286
|
+
* #action
|
|
287
|
+
*/
|
|
212
288
|
load() {
|
|
213
289
|
if (!self.loadingP) {
|
|
214
290
|
self.loadingP = this.loadPre().catch(e => {
|
|
@@ -218,12 +294,15 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
218
294
|
}
|
|
219
295
|
return self.loadingP;
|
|
220
296
|
},
|
|
297
|
+
/**
|
|
298
|
+
* #action
|
|
299
|
+
*/
|
|
221
300
|
async loadPre() {
|
|
222
301
|
var _a, _b;
|
|
223
302
|
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;
|
|
303
|
+
const refNameAliasesAdapterConf = (_a = conf === null || conf === void 0 ? void 0 : conf.refNameAliases) === null || _a === void 0 ? void 0 : _a.adapter;
|
|
304
|
+
const cytobandAdapterConf = (_b = conf === null || conf === void 0 ? void 0 : conf.cytobands) === null || _b === void 0 ? void 0 : _b.adapter;
|
|
305
|
+
const sequenceAdapterConf = conf === null || conf === void 0 ? void 0 : conf.sequence.adapter;
|
|
227
306
|
const assemblyName = self.name;
|
|
228
307
|
const regions = await getAssemblyRegions(sequenceAdapterConf, pm);
|
|
229
308
|
const adapterRegionsWithAssembly = regions.map(r => {
|
|
@@ -256,6 +335,9 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
256
335
|
},
|
|
257
336
|
}))
|
|
258
337
|
.views(self => ({
|
|
338
|
+
/**
|
|
339
|
+
* #method
|
|
340
|
+
*/
|
|
259
341
|
getAdapterMapEntry(adapterConf, options) {
|
|
260
342
|
const { signal, statusCallback, ...rest } = options;
|
|
261
343
|
if (!options.sessionId) {
|
|
@@ -272,16 +354,18 @@ function assemblyFactory(assemblyConfigType, pm) {
|
|
|
272
354
|
undefined, statusCallback);
|
|
273
355
|
},
|
|
274
356
|
/**
|
|
357
|
+
* #method
|
|
275
358
|
* get Map of `canonical-name -> adapter-specific-name`
|
|
276
359
|
*/
|
|
277
360
|
async getRefNameMapForAdapter(adapterConf, opts) {
|
|
278
|
-
if (!opts ||
|
|
361
|
+
if (!(opts === null || opts === void 0 ? void 0 : opts.sessionId)) {
|
|
279
362
|
throw new Error('sessionId is required');
|
|
280
363
|
}
|
|
281
364
|
const map = await this.getAdapterMapEntry(adapterConf, opts);
|
|
282
365
|
return map.forwardMap;
|
|
283
366
|
},
|
|
284
367
|
/**
|
|
368
|
+
* #method
|
|
285
369
|
* get Map of `adapter-specific-name -> canonical-name`
|
|
286
370
|
*/
|
|
287
371
|
async getReverseRefNameMapForAdapter(adapterConf, opts) {
|
|
@@ -1,7 +1,58 @@
|
|
|
1
1
|
import PluginManager from '../PluginManager';
|
|
2
2
|
/**
|
|
3
3
|
* #config BaseAssembly
|
|
4
|
+
* #category assemblyManagement
|
|
4
5
|
* This corresponds to the assemblies section of the config
|
|
5
6
|
*/
|
|
6
|
-
declare function assemblyConfigSchema(pluginManager: PluginManager): import("../configuration").
|
|
7
|
+
declare function assemblyConfigSchema(pluginManager: PluginManager): import("../configuration/configurationSchema").ConfigurationSchemaType<{
|
|
8
|
+
/**
|
|
9
|
+
* #slot
|
|
10
|
+
* aliases are "reference name aliases" e.g. aliases for hg38 might be "GRCh38"
|
|
11
|
+
*/
|
|
12
|
+
aliases: {
|
|
13
|
+
type: string;
|
|
14
|
+
defaultValue: never[];
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* #slot
|
|
19
|
+
* sequence refers to a reference sequence track that has an adapter containing,
|
|
20
|
+
* importantly, a sequence adapter such as IndexedFastaAdapter
|
|
21
|
+
*/
|
|
22
|
+
sequence: import("../configuration").AnyConfigurationSchemaType;
|
|
23
|
+
/**
|
|
24
|
+
* #slot
|
|
25
|
+
*/
|
|
26
|
+
refNameColors: {
|
|
27
|
+
type: string;
|
|
28
|
+
defaultValue: never[];
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
refNameAliases: import("../configuration/configurationSchema").ConfigurationSchemaType<{
|
|
32
|
+
/**
|
|
33
|
+
* #slot refNameAliases.adapter
|
|
34
|
+
* refNameAliases help resolve e.g. chr1 and 1 as the same entity
|
|
35
|
+
* the data for refNameAliases are fetched from an adapter, that is
|
|
36
|
+
* commonly a tsv like chromAliases.txt from UCSC or similar
|
|
37
|
+
*/
|
|
38
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
39
|
+
}, import("../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
40
|
+
cytobands: import("../configuration/configurationSchema").ConfigurationSchemaType<{
|
|
41
|
+
/**
|
|
42
|
+
* #slot cytobands.adapter
|
|
43
|
+
* cytoband data is fetched from an adapter, and can be displayed by a
|
|
44
|
+
* view type as ideograms
|
|
45
|
+
*/
|
|
46
|
+
adapter: import("mobx-state-tree").IAnyModelType;
|
|
47
|
+
}, import("../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, undefined>>;
|
|
48
|
+
/**
|
|
49
|
+
* #slot
|
|
50
|
+
*/
|
|
51
|
+
displayName: {
|
|
52
|
+
type: string;
|
|
53
|
+
defaultValue: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
}, import("../configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "name">>;
|
|
7
57
|
export default assemblyConfigSchema;
|
|
58
|
+
export type BaseAssemblyConfigSchema = ReturnType<typeof assemblyConfigSchema>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const configuration_1 = require("../configuration");
|
|
4
4
|
/**
|
|
5
5
|
* #config BaseAssembly
|
|
6
|
+
* #category assemblyManagement
|
|
6
7
|
* This corresponds to the assemblies section of the config
|
|
7
8
|
*/
|
|
8
9
|
function assemblyConfigSchema(pluginManager) {
|