@jbrowse/core 2.17.0 → 3.0.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 +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +7 -13
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +20 -25
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/BaseCard.js +3 -7
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +5 -8
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/CoreDetails.js +7 -10
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/DataGridDetails.js +25 -55
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.d.ts +3 -4
- package/BaseFeatureWidget/BaseFeatureDetail/FeatureDetails.js +16 -34
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +2 -6
- package/BaseFeatureWidget/BaseFeatureDetail/Position.d.ts +2 -3
- package/BaseFeatureWidget/BaseFeatureDetail/Position.js +2 -5
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/SimpleField.js +3 -5
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +1 -2
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +3 -5
- package/BaseFeatureWidget/BaseFeatureDetail/index.d.ts +4 -5
- package/BaseFeatureWidget/BaseFeatureDetail/index.js +6 -14
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +4 -13
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.d.ts +10 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceContents.js +48 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +33 -41
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeaturePanel.js +30 -29
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceName.js +28 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.d.ts +2 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/SequencePanel.js +11 -85
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.d.ts +1 -2
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/HelpDialog.js +6 -25
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceDialog.js +11 -46
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceFeatureMenu.js +101 -96
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SequenceTypeSelector.js +49 -53
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/dialogs/SettingsDialog.js +20 -55
- 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 +4 -66
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.d.ts +4 -5
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDNASequence.js +6 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/CDSSequence.js +6 -7
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/GenomicSequence.js +5 -9
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.d.ts +3 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/ProteinSequence.js +2 -4
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.d.ts +2 -3
- package/BaseFeatureWidget/SequenceFeatureDetails/seqtypes/SequenceDisplay.js +3 -10
- package/BaseFeatureWidget/SequenceFeatureDetails/types.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/types.js +2 -0
- 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 +19 -12
- 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 +17 -32
- package/PluginManager.js +15 -41
- package/ReExports/DataGrid.js +0 -1
- package/ReExports/list.d.ts +0 -5
- package/ReExports/list.js +3 -5
- package/ReExports/modules.d.ts +26 -22
- package/ReExports/modules.js +45 -44
- package/TextSearch/BaseResults.d.ts +4 -4
- package/TextSearch/TextSearchManager.d.ts +4 -16
- package/TextSearch/TextSearchManager.js +1 -13
- package/assemblyManager/assembly.d.ts +5 -100
- package/assemblyManager/assembly.js +30 -146
- 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 +2 -13
- 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 +2 -6
- 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 +21 -8
- package/data_adapters/dataAdapterCache.d.ts +4 -22
- package/data_adapters/dataAdapterCache.js +2 -28
- package/data_adapters/util.d.ts +1 -0
- package/data_adapters/util.js +10 -0
- package/package.json +8 -11
- 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 +9 -63
- 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 +4 -4
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +3 -8
- 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 +5 -9
- package/pluggableElementTypes/renderers/RendererType.js +3 -7
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +3 -4
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +11 -76
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -3
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +10 -74
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +9 -49
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +10 -60
- 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 +6 -7
- package/stories/examples/WithSequencePanel.js +9 -9
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AppLogo.d.ts +2 -3
- package/ui/AppLogo.js +2 -7
- package/ui/AssemblySelector.d.ts +5 -5
- package/ui/AssemblySelector.js +11 -36
- package/ui/BaseTooltip.d.ts +1 -2
- package/ui/BaseTooltip.js +10 -17
- package/ui/CascadingMenu.d.ts +3 -4
- package/ui/CascadingMenu.js +18 -57
- package/ui/CascadingMenuButton.d.ts +2 -3
- package/ui/CascadingMenuButton.js +18 -42
- package/ui/ColorPicker.d.ts +3 -4
- package/ui/ColorPicker.js +33 -37
- package/ui/Dialog.d.ts +2 -3
- package/ui/Dialog.js +15 -27
- package/ui/DraggableDialog.d.ts +5 -0
- package/ui/DraggableDialog.js +32 -0
- package/ui/DropDownMenu.d.ts +2 -3
- package/ui/DropDownMenu.js +10 -36
- package/ui/EditableTypography.d.ts +2 -3
- package/ui/EditableTypography.js +30 -59
- package/ui/ErrorBoundary.d.ts +3 -2
- package/ui/ErrorBoundary.js +3 -25
- package/ui/ErrorMessage.d.ts +1 -2
- package/ui/ErrorMessage.js +27 -34
- package/ui/ErrorMessageStackTraceDialog.d.ts +1 -2
- package/ui/ErrorMessageStackTraceDialog.js +13 -54
- package/ui/FactoryResetDialog.d.ts +1 -2
- package/ui/FactoryResetDialog.js +8 -13
- package/ui/FatalErrorDialog.d.ts +1 -2
- package/ui/FatalErrorDialog.js +11 -42
- package/ui/FileSelector/FileSelector.d.ts +5 -5
- package/ui/FileSelector/FileSelector.js +41 -80
- package/ui/FileSelector/LocalFileChooser.d.ts +2 -3
- package/ui/FileSelector/LocalFileChooser.js +17 -29
- package/ui/FileSelector/UrlChooser.d.ts +5 -5
- package/ui/FileSelector/UrlChooser.js +6 -7
- package/ui/Icons.d.ts +10 -11
- package/ui/Icons.js +10 -25
- package/ui/LoadingEllipses.d.ts +2 -3
- package/ui/LoadingEllipses.js +4 -7
- package/ui/Logo.d.ts +2 -3
- package/ui/Logo.js +5 -23
- package/ui/Menu.d.ts +3 -4
- package/ui/Menu.js +85 -122
- package/ui/MenuButton.d.ts +2 -3
- package/ui/MenuButton.js +11 -35
- package/ui/PrerenderedCanvas.d.ts +1 -2
- package/ui/PrerenderedCanvas.js +3 -25
- package/ui/RedErrorMessageBox.d.ts +1 -2
- package/ui/RedErrorMessageBox.js +2 -5
- package/ui/ResizeHandle.d.ts +1 -2
- package/ui/ResizeHandle.js +5 -27
- package/ui/ReturnToImportFormDialog.d.ts +1 -2
- package/ui/ReturnToImportFormDialog.js +8 -13
- package/ui/SanitizedHTML.d.ts +2 -3
- package/ui/SanitizedHTML.js +4 -24
- package/ui/Snackbar.d.ts +3 -4
- package/ui/Snackbar.js +41 -21
- package/ui/SnackbarContents.d.ts +5 -0
- package/ui/SnackbarContents.js +16 -0
- package/ui/SnackbarModel.d.ts +1 -26
- package/ui/SnackbarModel.js +22 -39
- package/ui/colors.d.ts +1 -1
- package/ui/colors.js +2 -2
- package/ui/index.d.ts +0 -2
- package/ui/index.js +1 -5
- package/ui/react-colorful.js +17 -10
- package/ui/theme.d.ts +1 -1
- package/ui/theme.js +7 -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 +27 -173
- package/util/index.js +53 -293
- package/util/io/RemoteFileWithRangeCache.d.ts +4 -5
- package/util/io/RemoteFileWithRangeCache.js +12 -14
- package/util/io/index.d.ts +3 -4
- package/util/io/index.js +5 -19
- 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.d.ts +1 -1
- 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.d.ts +2 -3
- package/util/offscreenCanvasUtils.js +22 -21
- 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 +4 -26
- package/util/tracks.js +8 -33
- 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.d.ts +1 -1
- 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
|
@@ -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");
|
|
@@ -10,10 +9,7 @@ class CytobandAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
10
9
|
if (conf.uri === '' || conf.uri === '/path/to/cytoband.txt.gz') {
|
|
11
10
|
return [];
|
|
12
11
|
}
|
|
13
|
-
const
|
|
14
|
-
const buf = await (0, util_1.fetchAndMaybeUnzip)((0, io_1.openLocation)(conf, pm), opts);
|
|
15
|
-
const decoder = new TextDecoder('utf8', { fatal: true });
|
|
16
|
-
const text = decoder.decode(buf);
|
|
12
|
+
const text = await (0, util_1.fetchAndMaybeUnzipText)((0, io_1.openLocation)(conf, this.pluginManager), opts);
|
|
17
13
|
return text
|
|
18
14
|
.split(/\n|\r\n|\r/)
|
|
19
15
|
.filter(f => !!f.trim())
|
|
@@ -30,6 +26,6 @@ class CytobandAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
28
|
}
|
|
33
|
-
freeResources(
|
|
29
|
+
freeResources() { }
|
|
34
30
|
}
|
|
35
31
|
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;
|
|
@@ -15,24 +15,37 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.default = CytobandAdapterF;
|
|
30
|
-
const pluggableElementTypes_1 = require("../../pluggableElementTypes");
|
|
31
40
|
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
41
|
+
const pluggableElementTypes_1 = require("../../pluggableElementTypes");
|
|
32
42
|
function CytobandAdapterF(pluginManager) {
|
|
33
43
|
pluginManager.addAdapterType(() => new pluggableElementTypes_1.AdapterType({
|
|
34
44
|
name: 'CytobandAdapter',
|
|
35
45
|
configSchema: configSchema_1.default,
|
|
46
|
+
adapterMetadata: {
|
|
47
|
+
hiddenFromGUI: true,
|
|
48
|
+
},
|
|
36
49
|
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./CytobandAdapter'))).then(f => f.default),
|
|
37
50
|
}));
|
|
38
51
|
}
|
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type PluginManager from '../PluginManager';
|
|
2
|
+
import type { AnyConfigurationSchemaType } from '../configuration';
|
|
3
|
+
import type { AnyDataAdapter } from './BaseAdapter';
|
|
4
|
+
import type { SnapshotIn } from 'mobx-state-tree';
|
|
5
5
|
type ConfigSnap = SnapshotIn<AnyConfigurationSchemaType>;
|
|
6
|
-
export declare function adapterConfigCacheKey(conf?: Record<string, unknown>): string;
|
|
7
6
|
interface AdapterCacheEntry {
|
|
8
7
|
dataAdapter: AnyDataAdapter;
|
|
9
8
|
sessionIds: Set<string>;
|
|
10
9
|
}
|
|
11
|
-
/**
|
|
12
|
-
* instantiate a data adapter, or return an already-instantiated one if we have
|
|
13
|
-
* one with the same configuration
|
|
14
|
-
*
|
|
15
|
-
* @param pluginManager
|
|
16
|
-
*
|
|
17
|
-
* @param sessionId - session ID of the associated worker session. used for
|
|
18
|
-
* reference counting
|
|
19
|
-
*
|
|
20
|
-
* @param adapterConfigSnapshot - plain-JS configuration snapshot for the
|
|
21
|
-
* adapter
|
|
22
|
-
*/
|
|
23
10
|
export declare function getAdapter(pluginManager: PluginManager, sessionId: string, adapterConfigSnapshot: SnapshotIn<AnyConfigurationSchemaType>): Promise<AdapterCacheEntry>;
|
|
24
|
-
/**
|
|
25
|
-
* this is a callback that is passed to adapters that
|
|
26
|
-
* allows them to get any sub-adapters that they need
|
|
27
|
-
* internally, staying with the same worker session ID
|
|
28
|
-
*/
|
|
29
11
|
export type getSubAdapterType = (adapterConfigSnap: ConfigSnap) => ReturnType<typeof getAdapter>;
|
|
30
12
|
export declare function freeAdapterResources(specification: Record<string, any>): number;
|
|
31
13
|
export declare function clearAdapterCache(): void;
|
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.adapterConfigCacheKey = adapterConfigCacheKey;
|
|
7
3
|
exports.getAdapter = getAdapter;
|
|
8
4
|
exports.freeAdapterResources = freeAdapterResources;
|
|
9
5
|
exports.clearAdapterCache = clearAdapterCache;
|
|
10
|
-
const
|
|
11
|
-
function adapterConfigCacheKey(conf = {}) {
|
|
12
|
-
return `${(0, idMaker_1.default)(conf)}`;
|
|
13
|
-
}
|
|
6
|
+
const util_1 = require("./util");
|
|
14
7
|
let adapterCache = {};
|
|
15
|
-
/**
|
|
16
|
-
* instantiate a data adapter, or return an already-instantiated one if we have
|
|
17
|
-
* one with the same configuration
|
|
18
|
-
*
|
|
19
|
-
* @param pluginManager
|
|
20
|
-
*
|
|
21
|
-
* @param sessionId - session ID of the associated worker session. used for
|
|
22
|
-
* reference counting
|
|
23
|
-
*
|
|
24
|
-
* @param adapterConfigSnapshot - plain-JS configuration snapshot for the
|
|
25
|
-
* adapter
|
|
26
|
-
*/
|
|
27
8
|
async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
28
|
-
|
|
29
|
-
const cacheKey = adapterConfigCacheKey(adapterConfigSnapshot);
|
|
9
|
+
const cacheKey = (0, util_1.adapterConfigCacheKey)(adapterConfigSnapshot);
|
|
30
10
|
if (!adapterCache[cacheKey]) {
|
|
31
11
|
const adapterType = adapterConfigSnapshot === null || adapterConfigSnapshot === void 0 ? void 0 : adapterConfigSnapshot.type;
|
|
32
12
|
if (!adapterType) {
|
|
@@ -36,13 +16,10 @@ async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
|
36
16
|
if (!dataAdapterType) {
|
|
37
17
|
throw new Error(`unknown data adapter type ${adapterType}`);
|
|
38
18
|
}
|
|
39
|
-
// instantiate the data adapter's config schema so it gets its defaults,
|
|
40
|
-
// callbacks, etc
|
|
41
19
|
const adapterConfig = dataAdapterType.configSchema.create(adapterConfigSnapshot, { pluginManager });
|
|
42
20
|
const getSubAdapter = getAdapter.bind(null, pluginManager, sessionId);
|
|
43
21
|
const CLASS = await dataAdapterType.getAdapterClass();
|
|
44
22
|
const dataAdapter = new CLASS(adapterConfig, getSubAdapter, pluginManager);
|
|
45
|
-
// store it in our cache
|
|
46
23
|
adapterCache[cacheKey] = {
|
|
47
24
|
dataAdapter,
|
|
48
25
|
sessionIds: new Set([sessionId]),
|
|
@@ -55,8 +32,6 @@ async function getAdapter(pluginManager, sessionId, adapterConfigSnapshot) {
|
|
|
55
32
|
function freeAdapterResources(specification) {
|
|
56
33
|
let deleteCount = 0;
|
|
57
34
|
const specKeys = Object.keys(specification);
|
|
58
|
-
// if we don't specify a range, delete any adapters that are only associated
|
|
59
|
-
// with that session
|
|
60
35
|
if (specKeys.length === 1 && specKeys[0] === 'sessionId') {
|
|
61
36
|
const { sessionId } = specification;
|
|
62
37
|
Object.entries(adapterCache).forEach(([cacheKey, cacheEntry]) => {
|
|
@@ -68,7 +43,6 @@ function freeAdapterResources(specification) {
|
|
|
68
43
|
});
|
|
69
44
|
}
|
|
70
45
|
else {
|
|
71
|
-
// otherwise call freeResources on all the cached data adapters
|
|
72
46
|
Object.values(adapterCache).forEach(cacheEntry => {
|
|
73
47
|
const regions = specification.regions ||
|
|
74
48
|
(specification.region ? [specification.region] : []);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function adapterConfigCacheKey(conf?: Record<string, unknown>): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.adapterConfigCacheKey = adapterConfigCacheKey;
|
|
7
|
+
const idMaker_1 = __importDefault(require("../util/idMaker"));
|
|
8
|
+
function adapterConfigCacheKey(conf = {}) {
|
|
9
|
+
return `${(0, idMaker_1.default)(conf)}`;
|
|
10
|
+
}
|