@jbrowse/core 2.17.0 → 2.18.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.js +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +4 -8
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +22 -25
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +2 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +6 -8
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +1 -1
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +1 -7
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +0 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +0 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +1 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +3 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +24 -33
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +3 -6
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/model.d.ts +2 -56
- package/BaseFeatureWidget/SequenceFeatureDetails/model.js +1 -56
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +3 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +5 -6
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +0 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +0 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +1 -1
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +1 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +1 -5
- package/BaseFeatureWidget/stateModelFactory.d.ts +2 -93
- package/BaseFeatureWidget/stateModelFactory.js +3 -73
- package/BaseFeatureWidget/types.d.ts +3 -3
- package/BaseFeatureWidget/util.js +0 -4
- package/CorePlugin.d.ts +1 -1
- package/CorePlugin.js +2 -5
- package/Plugin.d.ts +2 -5
- package/Plugin.js +0 -3
- package/PluginLoader.d.ts +1 -1
- package/PluginLoader.js +2 -19
- package/PluginManager.d.ts +15 -31
- package/PluginManager.js +11 -39
- package/ReExports/DataGrid.js +0 -1
- package/ReExports/list.d.ts +0 -5
- package/ReExports/list.js +0 -5
- package/ReExports/modules.d.ts +22 -20
- package/ReExports/modules.js +16 -25
- package/TextSearch/BaseResults.d.ts +3 -3
- package/TextSearch/TextSearchManager.d.ts +4 -16
- package/TextSearch/TextSearchManager.js +1 -13
- package/assemblyManager/assembly.d.ts +5 -100
- package/assemblyManager/assembly.js +27 -143
- package/assemblyManager/assemblyConfigSchema.d.ts +1 -34
- package/assemblyManager/assemblyConfigSchema.js +12 -46
- package/assemblyManager/assemblyManager.d.ts +7 -57
- package/assemblyManager/assemblyManager.js +2 -57
- package/configuration/configurationSchema.d.ts +4 -4
- package/configuration/configurationSchema.js +2 -14
- package/configuration/configurationSlot.d.ts +1 -12
- package/configuration/configurationSlot.js +2 -32
- package/configuration/index.d.ts +2 -2
- package/configuration/index.js +2 -2
- package/configuration/types.d.ts +2 -3
- package/configuration/util.d.ts +1 -25
- package/configuration/util.js +19 -56
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +4 -14
- package/data_adapters/BaseAdapter/BaseAdapter.js +1 -10
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +5 -114
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.js +3 -79
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +2 -2
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +3 -6
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +3 -3
- package/data_adapters/BaseAdapter/index.d.ts +4 -4
- package/data_adapters/BaseAdapter/types.d.ts +2 -2
- package/data_adapters/BaseAdapter/util.d.ts +6 -6
- package/data_adapters/CytobandAdapter/CytobandAdapter.d.ts +1 -1
- package/data_adapters/CytobandAdapter/CytobandAdapter.js +1 -2
- package/data_adapters/CytobandAdapter/configSchema.d.ts +0 -3
- package/data_adapters/CytobandAdapter/configSchema.js +1 -7
- package/data_adapters/CytobandAdapter/index.d.ts +1 -1
- package/data_adapters/CytobandAdapter/index.js +1 -1
- package/data_adapters/dataAdapterCache.d.ts +4 -21
- package/data_adapters/dataAdapterCache.js +0 -19
- package/package.json +3 -4
- package/pluggableElementTypes/AdapterType.d.ts +2 -2
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
- package/pluggableElementTypes/ConnectionType.d.ts +3 -3
- package/pluggableElementTypes/DisplayType.d.ts +3 -9
- package/pluggableElementTypes/InternetAccountType.d.ts +2 -2
- package/pluggableElementTypes/PluggableElementBase.d.ts +1 -1
- package/pluggableElementTypes/PluggableElementBase.js +2 -2
- package/pluggableElementTypes/RpcMethodType.d.ts +5 -11
- package/pluggableElementTypes/RpcMethodType.js +7 -19
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.d.ts +9 -0
- package/pluggableElementTypes/RpcMethodTypeWithFiltersAndRenameRegions.js +35 -0
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +2 -2
- package/pluggableElementTypes/TrackType.d.ts +3 -3
- package/pluggableElementTypes/ViewType.d.ts +3 -3
- package/pluggableElementTypes/WidgetType.d.ts +4 -3
- package/pluggableElementTypes/index.d.ts +11 -11
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +2 -29
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +1 -28
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +3 -83
- package/pluggableElementTypes/models/BaseDisplayModel.js +2 -69
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +4 -46
- package/pluggableElementTypes/models/BaseTrackModel.js +0 -58
- package/pluggableElementTypes/models/BaseViewModel.d.ts +2 -42
- package/pluggableElementTypes/models/BaseViewModel.js +2 -38
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +3 -119
- package/pluggableElementTypes/models/InternetAccountModel.js +3 -123
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +0 -6
- package/pluggableElementTypes/models/baseConnectionConfig.js +1 -13
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +0 -15
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +1 -23
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -53
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -58
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +7 -15
- package/pluggableElementTypes/renderers/BoxRendererType.js +3 -14
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +3 -2
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +1 -6
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +6 -21
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +2 -25
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +5 -47
- package/pluggableElementTypes/renderers/FeatureRendererType.js +15 -68
- package/pluggableElementTypes/renderers/RendererType.d.ts +4 -8
- package/pluggableElementTypes/renderers/RendererType.js +1 -5
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +2 -2
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +3 -12
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +6 -14
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +7 -57
- package/pluggableElementTypes/renderers/index.d.ts +1 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.js +1 -3
- package/rpc/BaseRpcDriver.d.ts +3 -4
- package/rpc/BaseRpcDriver.js +20 -80
- package/rpc/MainThreadRpcDriver.d.ts +3 -7
- package/rpc/MainThreadRpcDriver.js +0 -5
- package/rpc/RpcManager.d.ts +3 -3
- package/rpc/RpcManager.js +2 -4
- package/rpc/WebWorkerRpcDriver.d.ts +3 -2
- package/rpc/WebWorkerRpcDriver.js +2 -13
- package/rpc/baseRpcConfig.d.ts +0 -3
- package/rpc/baseRpcConfig.js +1 -7
- package/rpc/configSchema.d.ts +0 -6
- package/rpc/configSchema.js +2 -11
- package/rpc/mainThreadRpcConfig.js +1 -7
- package/rpc/methods/CoreFreeResources.d.ts +0 -6
- package/rpc/methods/CoreFreeResources.js +2 -9
- package/rpc/methods/CoreGetFeatureDensityStats.d.ts +4 -5
- package/rpc/methods/CoreGetFeatureDensityStats.js +1 -1
- package/rpc/methods/CoreGetFeatureDetails.d.ts +2 -7
- package/rpc/methods/CoreGetFeatureDetails.js +0 -5
- package/rpc/methods/CoreGetFeatures.d.ts +5 -5
- package/rpc/methods/CoreGetFeatures.js +4 -5
- package/rpc/methods/CoreGetFileInfo.d.ts +1 -2
- package/rpc/methods/CoreGetFileInfo.js +1 -1
- package/rpc/methods/CoreGetMetadata.d.ts +1 -2
- package/rpc/methods/CoreGetMetadata.js +1 -1
- package/rpc/methods/CoreGetRefNames.d.ts +1 -2
- package/rpc/methods/CoreGetRefNames.js +1 -1
- package/rpc/methods/CoreRender.d.ts +2 -6
- package/rpc/methods/CoreRender.js +5 -7
- package/rpc/methods/util.d.ts +3 -3
- package/rpc/methods/util.js +0 -1
- package/rpc/webWorkerRpcConfig.js +1 -7
- package/stories/JBrowseCore.stories.d.ts +1 -1
- package/stories/JBrowseCore.stories.js +3 -3
- package/stories/examples/WithSequencePanel.d.ts +1 -1
- package/stories/examples/WithSequencePanel.js +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +1 -1
- package/ui/AppLogo.js +0 -2
- package/ui/AssemblySelector.d.ts +2 -2
- package/ui/AssemblySelector.js +0 -3
- package/ui/BaseTooltip.js +2 -6
- package/ui/CascadingMenu.d.ts +2 -2
- package/ui/CascadingMenu.js +3 -4
- package/ui/CascadingMenuButton.d.ts +1 -1
- package/ui/CascadingMenuButton.js +1 -1
- package/ui/ColorPicker.js +1 -7
- package/ui/Dialog.d.ts +1 -1
- package/ui/Dialog.js +2 -6
- package/ui/DropDownMenu.d.ts +1 -1
- package/ui/DropDownMenu.js +2 -2
- package/ui/EditableTypography.d.ts +1 -1
- package/ui/EditableTypography.js +1 -5
- package/ui/ErrorBoundary.d.ts +2 -1
- package/ui/ErrorMessage.js +2 -9
- package/ui/ErrorMessageStackTraceDialog.js +2 -10
- package/ui/FactoryResetDialog.js +1 -1
- package/ui/FatalErrorDialog.js +1 -1
- package/ui/FileSelector/FileSelector.d.ts +4 -3
- package/ui/FileSelector/FileSelector.js +40 -40
- package/ui/FileSelector/LocalFileChooser.d.ts +1 -1
- package/ui/FileSelector/LocalFileChooser.js +0 -1
- package/ui/FileSelector/UrlChooser.d.ts +4 -3
- package/ui/FileSelector/UrlChooser.js +5 -3
- package/ui/Icons.d.ts +1 -1
- package/ui/Icons.js +1 -7
- package/ui/LoadingEllipses.d.ts +1 -1
- package/ui/LoadingEllipses.js +3 -3
- package/ui/Menu.d.ts +1 -1
- package/ui/Menu.js +3 -10
- package/ui/MenuButton.d.ts +1 -1
- package/ui/ResizeHandle.js +2 -2
- package/ui/ReturnToImportFormDialog.js +1 -1
- package/ui/SanitizedHTML.js +1 -21
- package/ui/Snackbar.d.ts +2 -2
- package/ui/Snackbar.js +1 -2
- package/ui/SnackbarModel.d.ts +1 -26
- package/ui/SnackbarModel.js +2 -30
- package/ui/colors.d.ts +1 -1
- package/ui/colors.js +1 -1
- package/ui/react-colorful.js +0 -3
- package/ui/theme.d.ts +1 -1
- package/ui/theme.js +0 -40
- package/util/Base1DUtils.d.ts +1 -1
- package/util/Base1DUtils.js +0 -12
- package/util/Base1DViewModel.d.ts +4 -81
- package/util/Base1DViewModel.js +4 -108
- package/util/QuickLRU.js +0 -9
- package/util/TimeTraveller.js +0 -4
- package/util/aborting.d.ts +0 -20
- package/util/aborting.js +0 -31
- package/util/analytics.js +1 -12
- package/util/blockTypes.d.ts +0 -11
- package/util/blockTypes.js +0 -13
- package/util/calculateDynamicBlocks.d.ts +1 -20
- package/util/calculateDynamicBlocks.js +1 -22
- package/util/calculateStaticBlocks.d.ts +2 -2
- package/util/calculateStaticBlocks.js +0 -2
- package/util/color/cssColorsLevel4.js +0 -1
- package/util/color/index.d.ts +0 -19
- package/util/color/index.js +0 -30
- package/util/compositeMap.js +0 -2
- package/util/dedupe.js +0 -1
- package/util/formatFastaStrings.d.ts +0 -13
- package/util/formatFastaStrings.js +0 -13
- package/util/idMaker.d.ts +1 -1
- package/util/idMaker.js +16 -12
- package/util/index.d.ts +16 -164
- package/util/index.js +22 -282
- package/util/io/RemoteFileWithRangeCache.d.ts +3 -2
- package/util/io/RemoteFileWithRangeCache.js +6 -10
- package/util/io/index.d.ts +3 -4
- package/util/io/index.js +3 -17
- package/util/jexl.js +3 -13
- package/util/jexlStrings.d.ts +0 -6
- package/util/jexlStrings.js +0 -8
- package/util/layouts/BaseLayout.d.ts +1 -1
- package/util/layouts/GranularRectLayout.d.ts +1 -17
- package/util/layouts/GranularRectLayout.js +4 -81
- package/util/layouts/MultiLayout.d.ts +1 -6
- package/util/layouts/MultiLayout.js +0 -6
- package/util/layouts/PrecomputedLayout.d.ts +1 -4
- package/util/layouts/PrecomputedLayout.js +0 -5
- package/util/layouts/PrecomputedMultiLayout.js +0 -2
- package/util/layouts/SceneGraph.d.ts +0 -12
- package/util/layouts/SceneGraph.js +0 -13
- package/util/makeAbortableReaction.d.ts +2 -0
- package/util/makeAbortableReaction.js +50 -0
- package/util/map-obj.js +0 -4
- package/util/mst-reflection.d.ts +1 -14
- package/util/mst-reflection.js +1 -28
- package/util/nanoid.js +0 -31
- package/util/nextTick.d.ts +1 -0
- package/util/nextTick.js +6 -0
- package/util/offscreenCanvasPonyfill.d.ts +0 -1
- package/util/offscreenCanvasPonyfill.js +1 -9
- package/util/offscreenCanvasUtils.js +1 -8
- package/util/range.d.ts +0 -25
- package/util/range.js +0 -34
- package/util/rxjs.d.ts +3 -7
- package/util/rxjs.js +2 -9
- package/util/simpleFeature.d.ts +0 -50
- package/util/simpleFeature.js +0 -35
- package/util/stats.d.ts +3 -26
- package/util/stats.js +0 -25
- package/util/stopToken.d.ts +3 -0
- package/util/stopToken.js +29 -0
- package/util/tracks.d.ts +3 -25
- package/util/tracks.js +0 -30
- package/util/types/index.d.ts +14 -30
- package/util/types/index.js +5 -14
- package/util/types/mst.js +0 -9
- package/util/types/util.d.ts +2 -9
- package/util/useMeasure.js +0 -1
- package/util/when.d.ts +1 -15
- package/util/when.js +3 -70
- package/rpc/remoteAbortSignals.d.ts +0 -36
- package/rpc/remoteAbortSignals.js +0 -79
package/configuration/util.js
CHANGED
|
@@ -9,22 +9,12 @@ exports.isConfigurationModel = isConfigurationModel;
|
|
|
9
9
|
exports.isConfigurationSlotType = isConfigurationSlotType;
|
|
10
10
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
11
11
|
const mst_reflection_1 = require("../util/mst-reflection");
|
|
12
|
-
/**
|
|
13
|
-
* given a configuration model (an instance of a ConfigurationSchema),
|
|
14
|
-
* read the configuration variable at the given path
|
|
15
|
-
*
|
|
16
|
-
* @param model - instance of ConfigurationSchema
|
|
17
|
-
* @param slotPaths - array of paths to read
|
|
18
|
-
* @param args - extra arguments e.g. for a feature callback,
|
|
19
|
-
* will be sent to each of the slotNames
|
|
20
|
-
*/
|
|
21
12
|
function readConfObject(confObject, slotPath, args = {}) {
|
|
22
13
|
if (!slotPath) {
|
|
23
|
-
return
|
|
14
|
+
return structuredClone((0, mobx_state_tree_1.getSnapshot)(confObject));
|
|
24
15
|
}
|
|
25
|
-
if (typeof slotPath === 'string') {
|
|
16
|
+
else if (typeof slotPath === 'string') {
|
|
26
17
|
let slot = confObject[slotPath];
|
|
27
|
-
// check for the subconf being a map if we don't find it immediately
|
|
28
18
|
if (!slot &&
|
|
29
19
|
(0, mobx_state_tree_1.isStateTreeNode)(confObject) &&
|
|
30
20
|
(0, mobx_state_tree_1.isMapType)((0, mobx_state_tree_1.getType)(confObject))) {
|
|
@@ -32,28 +22,19 @@ function readConfObject(confObject, slotPath, args = {}) {
|
|
|
32
22
|
}
|
|
33
23
|
if (!slot) {
|
|
34
24
|
return undefined;
|
|
35
|
-
// if we want to be very strict about config slots, we could uncomment the below
|
|
36
|
-
// instead of returning undefined
|
|
37
|
-
//
|
|
38
|
-
// const modelType = getType(model)
|
|
39
|
-
// const schemaType = model.configuration && getType(model.configuration)
|
|
40
|
-
// throw new Error(
|
|
41
|
-
// `no slot "${slotName}" found in ${modelType.name} configuration (${
|
|
42
|
-
// schemaType.name
|
|
43
|
-
// })`,
|
|
44
|
-
// )
|
|
45
25
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
26
|
+
else {
|
|
27
|
+
const val = slot.expr ? slot.expr.evalSync(args) : slot;
|
|
28
|
+
return (0, mobx_state_tree_1.isStateTreeNode)(val)
|
|
29
|
+
? JSON.parse(JSON.stringify((0, mobx_state_tree_1.getSnapshot)(val)))
|
|
30
|
+
: val;
|
|
31
|
+
}
|
|
50
32
|
}
|
|
51
|
-
if (Array.isArray(slotPath)) {
|
|
33
|
+
else if (Array.isArray(slotPath)) {
|
|
52
34
|
const slotName = slotPath[0];
|
|
53
35
|
if (slotPath.length > 1) {
|
|
54
36
|
const newPath = slotPath.slice(1);
|
|
55
37
|
let subConf = confObject[slotName];
|
|
56
|
-
// check for the subconf being a map if we don't find it immediately
|
|
57
38
|
if (!subConf &&
|
|
58
39
|
(0, mobx_state_tree_1.isStateTreeNode)(confObject) &&
|
|
59
40
|
(0, mobx_state_tree_1.isMapType)((0, mobx_state_tree_1.getType)(confObject))) {
|
|
@@ -65,14 +46,6 @@ function readConfObject(confObject, slotPath, args = {}) {
|
|
|
65
46
|
}
|
|
66
47
|
throw new TypeError('slotPath must be a string or array');
|
|
67
48
|
}
|
|
68
|
-
/**
|
|
69
|
-
* helper method for readConfObject, reads the config from a mst model
|
|
70
|
-
*
|
|
71
|
-
* @param model - object containing a 'configuration' member
|
|
72
|
-
* @param slotPaths - array of paths to read
|
|
73
|
-
* @param args - extra arguments e.g. for a feature callback,
|
|
74
|
-
* will be sent to each of the slotNames
|
|
75
|
-
*/
|
|
76
49
|
function getConf(model, slotPath, args) {
|
|
77
50
|
const { configuration } = model;
|
|
78
51
|
if (isConfigurationModel(configuration)) {
|
|
@@ -80,17 +53,9 @@ function getConf(model, slotPath, args) {
|
|
|
80
53
|
}
|
|
81
54
|
throw new TypeError('cannot getConf on this model, it has no configuration');
|
|
82
55
|
}
|
|
83
|
-
/**
|
|
84
|
-
* given a union of explicitly typed configuration schema types,
|
|
85
|
-
* extract an array of the type names contained in the union
|
|
86
|
-
*
|
|
87
|
-
* @param unionType -
|
|
88
|
-
* @returns Array of type names contained in the union
|
|
89
|
-
*/
|
|
90
56
|
function getTypeNamesFromExplicitlyTypedUnion(maybeUnionType) {
|
|
91
57
|
if ((0, mobx_state_tree_1.isType)(maybeUnionType)) {
|
|
92
58
|
maybeUnionType = (0, mst_reflection_1.resolveLateType)(maybeUnionType);
|
|
93
|
-
// @ts-expect-error
|
|
94
59
|
if ((0, mobx_state_tree_1.isUnionType)(maybeUnionType)) {
|
|
95
60
|
const typeNames = [];
|
|
96
61
|
(0, mst_reflection_1.getUnionSubTypes)(maybeUnionType).forEach(type => {
|
|
@@ -101,7 +66,6 @@ function getTypeNamesFromExplicitlyTypedUnion(maybeUnionType) {
|
|
|
101
66
|
typeName = [def.type];
|
|
102
67
|
}
|
|
103
68
|
if (!typeName[0]) {
|
|
104
|
-
// debugger
|
|
105
69
|
throw new Error(`invalid config schema type ${type}`);
|
|
106
70
|
}
|
|
107
71
|
typeNames.push(...typeName);
|
|
@@ -118,7 +82,6 @@ function isBareConfigurationSchemaType(thing) {
|
|
|
118
82
|
thing.name.includes('ConfigurationSchema'))) {
|
|
119
83
|
return true;
|
|
120
84
|
}
|
|
121
|
-
// if it's a late type, assume its a config schema
|
|
122
85
|
if ((0, mobx_state_tree_1.isLateType)(thing)) {
|
|
123
86
|
return true;
|
|
124
87
|
}
|
|
@@ -129,26 +92,26 @@ function isConfigurationSchemaType(thing) {
|
|
|
129
92
|
if (!(0, mobx_state_tree_1.isType)(thing)) {
|
|
130
93
|
return false;
|
|
131
94
|
}
|
|
132
|
-
|
|
133
|
-
// because this construction gives much better debugging backtraces.
|
|
134
|
-
// also, note that the order of these statements matters, because
|
|
135
|
-
// for example some union types are also optional types
|
|
136
|
-
if (isBareConfigurationSchemaType(thing)) {
|
|
95
|
+
else if (isBareConfigurationSchemaType(thing)) {
|
|
137
96
|
return true;
|
|
138
97
|
}
|
|
139
|
-
if ((0, mobx_state_tree_1.isUnionType)(thing)) {
|
|
98
|
+
else if ((0, mobx_state_tree_1.isUnionType)(thing)) {
|
|
140
99
|
return (0, mst_reflection_1.getUnionSubTypes)(thing).every(t => isConfigurationSchemaType(t) || t.name === 'undefined');
|
|
141
100
|
}
|
|
142
|
-
if ((0, mobx_state_tree_1.isOptionalType)(thing) &&
|
|
101
|
+
else if ((0, mobx_state_tree_1.isOptionalType)(thing) &&
|
|
102
|
+
isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
|
|
143
103
|
return true;
|
|
144
104
|
}
|
|
145
|
-
if ((0, mobx_state_tree_1.isArrayType)(thing) &&
|
|
105
|
+
else if ((0, mobx_state_tree_1.isArrayType)(thing) &&
|
|
106
|
+
isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
|
|
146
107
|
return true;
|
|
147
108
|
}
|
|
148
|
-
if ((0, mobx_state_tree_1.isMapType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
|
|
109
|
+
else if ((0, mobx_state_tree_1.isMapType)(thing) && isConfigurationSchemaType((0, mst_reflection_1.getSubType)(thing))) {
|
|
149
110
|
return true;
|
|
150
111
|
}
|
|
151
|
-
|
|
112
|
+
else {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
152
115
|
}
|
|
153
116
|
function isConfigurationModel(thing) {
|
|
154
117
|
return (0, mobx_state_tree_1.isStateTreeNode)(thing) && isConfigurationSchemaType((0, mobx_state_tree_1.getType)(thing));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { AugmentedRegion as Region } from '../../util/types';
|
|
4
|
-
import
|
|
1
|
+
import type PluginManager from '../../PluginManager';
|
|
2
|
+
import type { AnyConfigurationModel } from '../../configuration';
|
|
3
|
+
import type { AugmentedRegion as Region } from '../../util/types';
|
|
4
|
+
import type { getSubAdapterType } from '../dataAdapterCache';
|
|
5
5
|
export declare abstract class BaseAdapter {
|
|
6
6
|
config: AnyConfigurationModel;
|
|
7
7
|
getSubAdapter?: getSubAdapterType | undefined;
|
|
@@ -9,16 +9,6 @@ export declare abstract class BaseAdapter {
|
|
|
9
9
|
id: string;
|
|
10
10
|
static capabilities: string[];
|
|
11
11
|
constructor(config?: AnyConfigurationModel, getSubAdapter?: getSubAdapterType | undefined, pluginManager?: PluginManager | undefined);
|
|
12
|
-
/**
|
|
13
|
-
* Same as `readConfObject(this.config, arg)`.
|
|
14
|
-
* Note: Does not offer the same TS type checking as `readConfObject`,
|
|
15
|
-
* consider using that instead.
|
|
16
|
-
*/
|
|
17
12
|
getConf(arg: string | string[]): any;
|
|
18
|
-
/**
|
|
19
|
-
* Called to provide a hint that data tied to a certain region will not be
|
|
20
|
-
* needed for the foreseeable future and can be purged from caches, etc
|
|
21
|
-
* @param region - Region
|
|
22
|
-
*/
|
|
23
13
|
abstract freeResources(region: Region): void;
|
|
24
14
|
}
|
|
@@ -5,18 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BaseAdapter = void 0;
|
|
7
7
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
8
|
-
// locals
|
|
9
8
|
const configuration_1 = require("../../configuration");
|
|
10
9
|
const idMaker_1 = __importDefault(require("../../util/idMaker"));
|
|
11
|
-
const
|
|
12
|
-
const EmptyConfig = (0, configuration_2.ConfigurationSchema)('empty', {});
|
|
10
|
+
const EmptyConfig = (0, configuration_1.ConfigurationSchema)('empty', {});
|
|
13
11
|
class BaseAdapter {
|
|
14
12
|
constructor(config = EmptyConfig.create(), getSubAdapter, pluginManager) {
|
|
15
13
|
this.config = config;
|
|
16
14
|
this.getSubAdapter = getSubAdapter;
|
|
17
15
|
this.pluginManager = pluginManager;
|
|
18
|
-
// note: we use switch on jest here for more simple feature IDs
|
|
19
|
-
// in test environment
|
|
20
16
|
if (typeof jest === 'undefined') {
|
|
21
17
|
const data = (0, mobx_state_tree_1.isStateTreeNode)(config) ? (0, mobx_state_tree_1.getSnapshot)(config) : config;
|
|
22
18
|
this.id = `${(0, idMaker_1.default)(data)}`;
|
|
@@ -25,11 +21,6 @@ class BaseAdapter {
|
|
|
25
21
|
this.id = 'test';
|
|
26
22
|
}
|
|
27
23
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Same as `readConfObject(this.config, arg)`.
|
|
30
|
-
* Note: Does not offer the same TS type checking as `readConfObject`,
|
|
31
|
-
* consider using that instead.
|
|
32
|
-
*/
|
|
33
24
|
getConf(arg) {
|
|
34
25
|
return (0, configuration_1.readConfObject)(this.config, arg);
|
|
35
26
|
}
|
|
@@ -1,129 +1,20 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
1
|
import { BaseAdapter } from './BaseAdapter';
|
|
3
|
-
import { BaseOptions } from './BaseOptions';
|
|
4
|
-
import { FeatureDensityStats } from './types';
|
|
5
|
-
import { Feature } from '../../util/simpleFeature';
|
|
6
|
-
import { AugmentedRegion as Region } from '../../util/types';
|
|
7
|
-
|
|
8
|
-
* Base class for feature adapters to extend. Defines some methods that
|
|
9
|
-
* subclasses must implement.
|
|
10
|
-
*/
|
|
2
|
+
import type { BaseOptions } from './BaseOptions';
|
|
3
|
+
import type { FeatureDensityStats } from './types';
|
|
4
|
+
import type { Feature } from '../../util/simpleFeature';
|
|
5
|
+
import type { AugmentedRegion as Region } from '../../util/types';
|
|
6
|
+
import type { Observable } from 'rxjs';
|
|
11
7
|
export declare abstract class BaseFeatureDataAdapter extends BaseAdapter {
|
|
12
|
-
/**
|
|
13
|
-
* Get all reference sequence names used in the data source
|
|
14
|
-
* Example:
|
|
15
|
-
* public async getRefNames(opts?: BaseOptions): Promise\<string[]\> \}
|
|
16
|
-
* await this.setup()
|
|
17
|
-
* const \{ refNames \} = this.metadata
|
|
18
|
-
* return refNames
|
|
19
|
-
* \}
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* NOTE: If an adapter is unable to determine the reference sequence names,
|
|
23
|
-
* the array will be empty
|
|
24
|
-
* @param opts - Feature adapter options
|
|
25
|
-
*/
|
|
26
8
|
abstract getRefNames(opts?: BaseOptions): Promise<string[]>;
|
|
27
|
-
/**
|
|
28
|
-
* Get features from the data source that overlap a region
|
|
29
|
-
* Example:
|
|
30
|
-
* public getFeatures(
|
|
31
|
-
* region: Region,
|
|
32
|
-
* opts: BaseOptions,
|
|
33
|
-
* ): Observable<Feature> \{
|
|
34
|
-
* return ObservableCreate(observer =\> \{
|
|
35
|
-
* const records = getRecords(assembly, refName, start, end)
|
|
36
|
-
* records.forEach(record =\> \{
|
|
37
|
-
* observer.next(this.recordToFeature(record))
|
|
38
|
-
* \})
|
|
39
|
-
* observer.complete()
|
|
40
|
-
* \})
|
|
41
|
-
* \}
|
|
42
|
-
* @param region - Region
|
|
43
|
-
* @param opts - Feature adapter options
|
|
44
|
-
* @returns Observable of Feature objects in the region
|
|
45
|
-
*/
|
|
46
9
|
abstract getFeatures(region: Region, opts?: BaseOptions): Observable<Feature>;
|
|
47
|
-
/**
|
|
48
|
-
* Return "header info" that is fetched from the data file, or other info
|
|
49
|
-
* that would not simply be in the config of the file. The return value can
|
|
50
|
-
* be `{tag:string, data: any}[]` e.g. list of tags with their values which
|
|
51
|
-
* is how VCF,BAM,CRAM return values for getInfo or it can be a nested JSON
|
|
52
|
-
* object
|
|
53
|
-
*/
|
|
54
10
|
getHeader(_opts?: BaseOptions): Promise<unknown>;
|
|
55
|
-
/**
|
|
56
|
-
* Return info that is primarily used for interpreting the data that is there,
|
|
57
|
-
* primarily in reference to being used for augmenting feature details panels
|
|
58
|
-
*/
|
|
59
11
|
getMetadata(_opts?: BaseOptions): Promise<unknown>;
|
|
60
|
-
/**
|
|
61
|
-
* Checks if the store has data for the given assembly and reference
|
|
62
|
-
* sequence, and then gets the features in the region if it does.
|
|
63
|
-
*/
|
|
64
12
|
getFeaturesInRegion(region: Region, opts?: BaseOptions): Observable<Feature>;
|
|
65
|
-
/**
|
|
66
|
-
* Checks if the store has data for the given assembly and reference
|
|
67
|
-
* sequence, and then gets the features in the region if it does.
|
|
68
|
-
*
|
|
69
|
-
* Currently this just calls getFeatureInRegion for each region. Adapters that
|
|
70
|
-
* are frequently called on multiple regions simultaneously may want to
|
|
71
|
-
* implement a more efficient custom version of this method.
|
|
72
|
-
*
|
|
73
|
-
* Currently this just calls getFeatureInRegion for each region. Adapters that
|
|
74
|
-
* are frequently called on multiple regions simultaneously may want to
|
|
75
|
-
* implement a more efficient custom version of this method.
|
|
76
|
-
*
|
|
77
|
-
* @param regions - Regions
|
|
78
|
-
* @param opts - Feature adapter options
|
|
79
|
-
* @returns Observable of Feature objects in the regions
|
|
80
|
-
*/
|
|
81
13
|
getFeaturesInMultipleRegions(regions: Region[], opts?: BaseOptions): Observable<Feature>;
|
|
82
|
-
/**
|
|
83
|
-
* Check if the store has data for the given reference name.
|
|
84
|
-
* @param refName - Name of the reference sequence
|
|
85
|
-
* @returns Whether data source has data for the given reference name
|
|
86
|
-
*/
|
|
87
14
|
hasDataForRefName(refName: string, opts?: BaseOptions): Promise<boolean>;
|
|
88
|
-
/**
|
|
89
|
-
* Calculates the minimum score, maximum score, and other statistics from
|
|
90
|
-
* features over a region, primarily used for quantitative tracks
|
|
91
|
-
*/
|
|
92
15
|
getRegionQuantitativeStats(region: Region, opts?: BaseOptions): Promise<import("../../util/stats").QuantitativeStats>;
|
|
93
|
-
/**
|
|
94
|
-
* Calculates the minimum score, maximum score, and other statistics from
|
|
95
|
-
* features over multiple regions, primarily used for quantitative tracks
|
|
96
|
-
*/
|
|
97
16
|
getMultiRegionQuantitativeStats(regions?: Region[], opts?: BaseOptions): Promise<import("../../util/stats").QuantitativeStats>;
|
|
98
|
-
/**
|
|
99
|
-
* Calculates the "feature density" of a region. The primary purpose of this
|
|
100
|
-
* API is to alert the user if they are going to be downloading too much
|
|
101
|
-
* information, and give them a hint to zoom in to see more. The default
|
|
102
|
-
* implementation samples from the regions, downloads feature data with
|
|
103
|
-
* getFeatures, and returns an object with the form \{featureDensity:number\}
|
|
104
|
-
*
|
|
105
|
-
* Derived classes can override this to return alternative calculations for
|
|
106
|
-
* featureDensity, or they can also return an object containing a byte size
|
|
107
|
-
* calculation with the format \{bytes:number, fetchSizeLimit:number\} where
|
|
108
|
-
* fetchSizeLimit is the adapter-defined limit for what it thinks is 'too
|
|
109
|
-
* much data' (e.g. CRAM and BAM may vary on what they think too much data
|
|
110
|
-
* is)
|
|
111
|
-
*/
|
|
112
17
|
getRegionFeatureDensityStats(region: Region, opts?: BaseOptions): Promise<FeatureDensityStats>;
|
|
113
|
-
/**
|
|
114
|
-
* Calculates the "feature density" of a set of regions. The primary purpose
|
|
115
|
-
* of this API is to alert the user if they are going to be downloading too
|
|
116
|
-
* much information, and give them a hint to zoom in to see more. The default
|
|
117
|
-
* implementation samples from the regions, downloads feature data with
|
|
118
|
-
* getFeatures, and returns an object with the form \{featureDensity:number\}
|
|
119
|
-
*
|
|
120
|
-
* Derived classes can override this to return alternative calculations for
|
|
121
|
-
* featureDensity, or they can also return an object containing a byte size
|
|
122
|
-
* calculation with the format \{bytes:number, fetchSizeLimit:number\} where
|
|
123
|
-
* fetchSizeLimit is the adapter-defined limit for what it thinks is 'too
|
|
124
|
-
* much data' (e.g. CRAM and BAM may vary on what they think too much data
|
|
125
|
-
* is)
|
|
126
|
-
*/
|
|
127
18
|
getMultiRegionFeatureDensityStats(regions: Region[], opts?: BaseOptions): Promise<FeatureDensityStats>;
|
|
128
19
|
getSources(regions: Region[]): Promise<{
|
|
129
20
|
name: string;
|
|
@@ -3,41 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseFeatureDataAdapter = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
|
-
// locals
|
|
7
6
|
const BaseAdapter_1 = require("./BaseAdapter");
|
|
8
|
-
const rxjs_2 = require("../../util/rxjs");
|
|
9
7
|
const util_1 = require("../../util");
|
|
8
|
+
const rxjs_2 = require("../../util/rxjs");
|
|
10
9
|
const stats_1 = require("../../util/stats");
|
|
11
|
-
|
|
12
|
-
* Base class for feature adapters to extend. Defines some methods that
|
|
13
|
-
* subclasses must implement.
|
|
14
|
-
*/
|
|
10
|
+
const stopToken_1 = require("../../util/stopToken");
|
|
15
11
|
class BaseFeatureDataAdapter extends BaseAdapter_1.BaseAdapter {
|
|
16
|
-
/**
|
|
17
|
-
* Return "header info" that is fetched from the data file, or other info
|
|
18
|
-
* that would not simply be in the config of the file. The return value can
|
|
19
|
-
* be `{tag:string, data: any}[]` e.g. list of tags with their values which
|
|
20
|
-
* is how VCF,BAM,CRAM return values for getInfo or it can be a nested JSON
|
|
21
|
-
* object
|
|
22
|
-
*/
|
|
23
12
|
async getHeader(_opts) {
|
|
24
13
|
return null;
|
|
25
14
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Return info that is primarily used for interpreting the data that is there,
|
|
28
|
-
* primarily in reference to being used for augmenting feature details panels
|
|
29
|
-
*/
|
|
30
15
|
async getMetadata(_opts) {
|
|
31
16
|
return null;
|
|
32
17
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Checks if the store has data for the given assembly and reference
|
|
35
|
-
* sequence, and then gets the features in the region if it does.
|
|
36
|
-
*/
|
|
37
18
|
getFeaturesInRegion(region, opts = {}) {
|
|
38
19
|
return (0, rxjs_2.ObservableCreate)(async (observer) => {
|
|
39
20
|
const hasData = await this.hasDataForRefName(region.refName, opts);
|
|
40
|
-
(0,
|
|
21
|
+
(0, stopToken_1.checkStopToken)(opts.stopToken);
|
|
41
22
|
if (!hasData) {
|
|
42
23
|
observer.complete();
|
|
43
24
|
}
|
|
@@ -46,46 +27,17 @@ class BaseFeatureDataAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
46
27
|
}
|
|
47
28
|
});
|
|
48
29
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Checks if the store has data for the given assembly and reference
|
|
51
|
-
* sequence, and then gets the features in the region if it does.
|
|
52
|
-
*
|
|
53
|
-
* Currently this just calls getFeatureInRegion for each region. Adapters that
|
|
54
|
-
* are frequently called on multiple regions simultaneously may want to
|
|
55
|
-
* implement a more efficient custom version of this method.
|
|
56
|
-
*
|
|
57
|
-
* Currently this just calls getFeatureInRegion for each region. Adapters that
|
|
58
|
-
* are frequently called on multiple regions simultaneously may want to
|
|
59
|
-
* implement a more efficient custom version of this method.
|
|
60
|
-
*
|
|
61
|
-
* @param regions - Regions
|
|
62
|
-
* @param opts - Feature adapter options
|
|
63
|
-
* @returns Observable of Feature objects in the regions
|
|
64
|
-
*/
|
|
65
30
|
getFeaturesInMultipleRegions(regions, opts = {}) {
|
|
66
31
|
return (0, rxjs_1.merge)(...regions.map(region => this.getFeaturesInRegion(region, opts)));
|
|
67
32
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Check if the store has data for the given reference name.
|
|
70
|
-
* @param refName - Name of the reference sequence
|
|
71
|
-
* @returns Whether data source has data for the given reference name
|
|
72
|
-
*/
|
|
73
33
|
async hasDataForRefName(refName, opts = {}) {
|
|
74
34
|
const refNames = await this.getRefNames(opts);
|
|
75
35
|
return refNames.includes(refName);
|
|
76
36
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Calculates the minimum score, maximum score, and other statistics from
|
|
79
|
-
* features over a region, primarily used for quantitative tracks
|
|
80
|
-
*/
|
|
81
37
|
async getRegionQuantitativeStats(region, opts) {
|
|
82
38
|
const feats = this.getFeatures(region, opts);
|
|
83
39
|
return (0, stats_1.scoresToStats)(region, feats);
|
|
84
40
|
}
|
|
85
|
-
/**
|
|
86
|
-
* Calculates the minimum score, maximum score, and other statistics from
|
|
87
|
-
* features over multiple regions, primarily used for quantitative tracks
|
|
88
|
-
*/
|
|
89
41
|
async getMultiRegionQuantitativeStats(regions = [], opts) {
|
|
90
42
|
if (!regions.length) {
|
|
91
43
|
return (0, stats_1.blankStats)();
|
|
@@ -106,20 +58,6 @@ class BaseFeatureDataAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
106
58
|
scoreSum,
|
|
107
59
|
});
|
|
108
60
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Calculates the "feature density" of a region. The primary purpose of this
|
|
111
|
-
* API is to alert the user if they are going to be downloading too much
|
|
112
|
-
* information, and give them a hint to zoom in to see more. The default
|
|
113
|
-
* implementation samples from the regions, downloads feature data with
|
|
114
|
-
* getFeatures, and returns an object with the form \{featureDensity:number\}
|
|
115
|
-
*
|
|
116
|
-
* Derived classes can override this to return alternative calculations for
|
|
117
|
-
* featureDensity, or they can also return an object containing a byte size
|
|
118
|
-
* calculation with the format \{bytes:number, fetchSizeLimit:number\} where
|
|
119
|
-
* fetchSizeLimit is the adapter-defined limit for what it thinks is 'too
|
|
120
|
-
* much data' (e.g. CRAM and BAM may vary on what they think too much data
|
|
121
|
-
* is)
|
|
122
|
-
*/
|
|
123
61
|
getRegionFeatureDensityStats(region, opts) {
|
|
124
62
|
let lastTime = +Date.now();
|
|
125
63
|
const statsFromInterval = async (length, expansionTime) => {
|
|
@@ -150,20 +88,6 @@ class BaseFeatureDataAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
150
88
|
};
|
|
151
89
|
return statsFromInterval(1000, 0);
|
|
152
90
|
}
|
|
153
|
-
/**
|
|
154
|
-
* Calculates the "feature density" of a set of regions. The primary purpose
|
|
155
|
-
* of this API is to alert the user if they are going to be downloading too
|
|
156
|
-
* much information, and give them a hint to zoom in to see more. The default
|
|
157
|
-
* implementation samples from the regions, downloads feature data with
|
|
158
|
-
* getFeatures, and returns an object with the form \{featureDensity:number\}
|
|
159
|
-
*
|
|
160
|
-
* Derived classes can override this to return alternative calculations for
|
|
161
|
-
* featureDensity, or they can also return an object containing a byte size
|
|
162
|
-
* calculation with the format \{bytes:number, fetchSizeLimit:number\} where
|
|
163
|
-
* fetchSizeLimit is the adapter-defined limit for what it thinks is 'too
|
|
164
|
-
* much data' (e.g. CRAM and BAM may vary on what they think too much data
|
|
165
|
-
* is)
|
|
166
|
-
*/
|
|
167
91
|
async getMultiRegionFeatureDensityStats(regions, opts) {
|
|
168
92
|
if (!regions.length) {
|
|
169
93
|
throw new Error('No regions supplied');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface BaseOptions {
|
|
2
|
-
|
|
2
|
+
stopToken?: string;
|
|
3
3
|
bpPerPx?: number;
|
|
4
4
|
sessionId?: string;
|
|
5
5
|
statusCallback?: (message: string) => void;
|
|
@@ -10,7 +10,7 @@ export type SearchType = 'full' | 'prefix' | 'exact';
|
|
|
10
10
|
export interface BaseTextSearchArgs {
|
|
11
11
|
queryString: string;
|
|
12
12
|
searchType?: SearchType;
|
|
13
|
-
|
|
13
|
+
stopToken?: string;
|
|
14
14
|
limit?: number;
|
|
15
15
|
pageNumber?: number;
|
|
16
16
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { NoAssemblyRegion } from '../../util';
|
|
2
|
-
import { BaseOptions } from './types';
|
|
3
|
-
import { RegionsAdapter } from '../BaseAdapter';
|
|
4
1
|
import { BaseFeatureDataAdapter } from './BaseFeatureDataAdapter';
|
|
2
|
+
import type { BaseOptions } from './types';
|
|
3
|
+
import type { NoAssemblyRegion } from '../../util';
|
|
4
|
+
import type { RegionsAdapter } from '../BaseAdapter';
|
|
5
5
|
export declare abstract class BaseSequenceAdapter extends BaseFeatureDataAdapter implements RegionsAdapter {
|
|
6
6
|
getMultiRegionFeatureDensityStats(): Promise<{
|
|
7
7
|
featureDensity: number;
|
|
8
8
|
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Fetches a list of 'regions' with refName, start, and extends
|
|
11
|
-
*/
|
|
12
9
|
abstract getRegions(opts: BaseOptions): Promise<NoAssemblyRegion[]>;
|
|
13
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BaseTextSearchArgs } from './types';
|
|
3
|
-
import
|
|
1
|
+
import type { BaseAdapter } from './BaseAdapter';
|
|
2
|
+
import type { BaseTextSearchArgs } from './types';
|
|
3
|
+
import type BaseResult from '../../TextSearch/BaseResults';
|
|
4
4
|
export interface BaseTextSearchAdapter extends BaseAdapter {
|
|
5
5
|
searchIndex(args: BaseTextSearchArgs): Promise<BaseResult[]>;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { BaseAdapter } from './BaseAdapter';
|
|
2
|
+
import type { BaseOptions } from './types';
|
|
3
|
+
import type { NoAssemblyRegion } from '../../util';
|
|
4
4
|
export interface RegionsAdapter extends BaseAdapter {
|
|
5
5
|
getRegions(opts: BaseOptions): Promise<NoAssemblyRegion[]>;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { getSubAdapterType } from '../dataAdapterCache';
|
|
4
|
-
import { AnyDataAdapter } from './util';
|
|
1
|
+
import type PluginManager from '../../PluginManager';
|
|
2
|
+
import type { AnyConfigurationModel } from '../../configuration';
|
|
3
|
+
import type { getSubAdapterType } from '../dataAdapterCache';
|
|
4
|
+
import type { AnyDataAdapter } from './util';
|
|
5
5
|
export * from './util';
|
|
6
6
|
export * from './types';
|
|
7
7
|
export { BaseAdapter } from './BaseAdapter';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface BaseOptions {
|
|
2
|
-
|
|
2
|
+
stopToken?: string;
|
|
3
3
|
bpPerPx?: number;
|
|
4
4
|
sessionId?: string;
|
|
5
5
|
statusCallback?: (message: string) => void;
|
|
@@ -10,7 +10,7 @@ export type SearchType = 'full' | 'prefix' | 'exact';
|
|
|
10
10
|
export interface BaseTextSearchArgs {
|
|
11
11
|
queryString: string;
|
|
12
12
|
searchType?: SearchType;
|
|
13
|
-
|
|
13
|
+
stopToken?: string;
|
|
14
14
|
limit?: number;
|
|
15
15
|
pageNumber?: number;
|
|
16
16
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseAdapter } from './BaseAdapter';
|
|
2
|
-
import { BaseFeatureDataAdapter } from './BaseFeatureDataAdapter';
|
|
3
|
-
import { BaseRefNameAliasAdapter } from './BaseRefNameAliasAdapter';
|
|
4
|
-
import { BaseSequenceAdapter } from './BaseSequenceAdapter';
|
|
5
|
-
import { BaseTextSearchAdapter } from './BaseTextSearchAdapter';
|
|
6
|
-
import { RegionsAdapter } from './RegionsAdapter';
|
|
1
|
+
import type { BaseAdapter } from './BaseAdapter';
|
|
2
|
+
import type { BaseFeatureDataAdapter } from './BaseFeatureDataAdapter';
|
|
3
|
+
import type { BaseRefNameAliasAdapter } from './BaseRefNameAliasAdapter';
|
|
4
|
+
import type { BaseSequenceAdapter } from './BaseSequenceAdapter';
|
|
5
|
+
import type { BaseTextSearchAdapter } from './BaseTextSearchAdapter';
|
|
6
|
+
import type { RegionsAdapter } from './RegionsAdapter';
|
|
7
7
|
export type AnyDataAdapter = BaseAdapter | BaseFeatureDataAdapter | BaseRefNameAliasAdapter | BaseTextSearchAdapter | RegionsAdapter | BaseSequenceAdapter;
|
|
8
8
|
export declare function isSequenceAdapter(t: AnyDataAdapter): t is BaseSequenceAdapter;
|
|
9
9
|
export declare function isRegionsAdapter(t: AnyDataAdapter): t is RegionsAdapter;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SimpleFeature } from '../../util';
|
|
2
2
|
import { BaseAdapter } from '../BaseAdapter';
|
|
3
|
-
import { BaseOptions } from '../BaseAdapter/BaseOptions';
|
|
3
|
+
import type { BaseOptions } from '../BaseAdapter/BaseOptions';
|
|
4
4
|
export default class CytobandAdapter extends BaseAdapter {
|
|
5
5
|
getData(opts?: BaseOptions): Promise<SimpleFeature[]>;
|
|
6
6
|
freeResources(): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// locals
|
|
4
3
|
const util_1 = require("../../util");
|
|
5
4
|
const io_1 = require("../../util/io");
|
|
6
5
|
const BaseAdapter_1 = require("../BaseAdapter");
|
|
@@ -30,6 +29,6 @@ class CytobandAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
30
29
|
});
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
|
-
freeResources(
|
|
32
|
+
freeResources() { }
|
|
34
33
|
}
|
|
35
34
|
exports.default = CytobandAdapter;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("../../configuration");
|
|
4
|
-
|
|
5
|
-
* #config CytobandAdapter
|
|
6
|
-
*/
|
|
7
|
-
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
|
+
function x() { }
|
|
8
5
|
const configSchema = (0, configuration_1.ConfigurationSchema)('CytobandAdapter', {
|
|
9
|
-
/**
|
|
10
|
-
* #slot
|
|
11
|
-
*/
|
|
12
6
|
cytobandLocation: {
|
|
13
7
|
type: 'fileLocation',
|
|
14
8
|
defaultValue: { uri: '/path/to/cytoband.txt.gz' },
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PluginManager from '../../PluginManager';
|
|
1
|
+
import type PluginManager from '../../PluginManager';
|
|
2
2
|
export default function CytobandAdapterF(pluginManager: PluginManager): void;
|
|
@@ -27,8 +27,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.default = CytobandAdapterF;
|
|
30
|
-
const pluggableElementTypes_1 = require("../../pluggableElementTypes");
|
|
31
30
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
31
|
+
const pluggableElementTypes_1 = require("../../pluggableElementTypes");
|
|
32
32
|
function CytobandAdapterF(pluginManager) {
|
|
33
33
|
pluginManager.addAdapterType(() => new pluggableElementTypes_1.AdapterType({
|
|
34
34
|
name: 'CytobandAdapter',
|