@jbrowse/core 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.d.ts +16 -0
- package/BaseFeatureWidget/BaseFeatureDetail/ArrayValue.js +46 -0
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.d.ts +15 -0
- package/BaseFeatureWidget/BaseFeatureDetail/Attributes.js +69 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicField.d.ts +17 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicField.js +23 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.d.ts +12 -0
- package/BaseFeatureWidget/BaseFeatureDetail/BasicValue.js +26 -0
- package/BaseFeatureWidget/BaseFeatureDetail/DataGrid.d.ts +14 -0
- package/BaseFeatureWidget/BaseFeatureDetail/DataGrid.js +98 -0
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.d.ts +16 -0
- package/BaseFeatureWidget/BaseFeatureDetail/FieldName.js +32 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.d.ts +17 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriField.js +31 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.d.ts +6 -0
- package/BaseFeatureWidget/BaseFeatureDetail/UriLink.js +13 -0
- package/BaseFeatureWidget/{BaseFeatureDetail.d.ts → BaseFeatureDetail/index.d.ts} +5 -7
- package/BaseFeatureWidget/{BaseFeatureDetail.js → BaseFeatureDetail/index.js} +12 -9
- package/BaseFeatureWidget/BaseFeatureDetail/util.d.ts +4 -0
- package/BaseFeatureWidget/BaseFeatureDetail/util.js +23 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.d.ts +12 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDNASequence.js +25 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.d.ts +5 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/CDSSequence.js +12 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.d.ts +5 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/GenomicSequence.js +14 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.d.ts +8 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/ProteinSequence.js +18 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.d.ts +2 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/SequenceFeatureDetails.js +146 -0
- package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.d.ts → SequenceFeatureDetails/SequenceFeatureSettingsDialog.d.ts} +0 -1
- package/BaseFeatureWidget/{SequenceFeatureSettingsDialog.js → SequenceFeatureDetails/SequenceFeatureSettingsDialog.js} +1 -1
- package/BaseFeatureWidget/{SequenceHelpDialog.d.ts → SequenceFeatureDetails/SequenceHelpDialog.d.ts} +0 -1
- package/BaseFeatureWidget/{SequenceHelpDialog.js → SequenceFeatureDetails/SequenceHelpDialog.js} +6 -9
- package/BaseFeatureWidget/{SequencePanel.d.ts → SequenceFeatureDetails/SequencePanel.d.ts} +1 -1
- package/BaseFeatureWidget/{SequencePanel.js → SequenceFeatureDetails/SequencePanel.js} +10 -8
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.d.ts +10 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/hooks.js +73 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/index.d.ts +2 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/index.js +68 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.d.ts +6 -0
- package/BaseFeatureWidget/SequenceFeatureDetails/util.js +11 -0
- package/BaseFeatureWidget/index.d.ts +5 -2
- package/BaseFeatureWidget/index.js +29 -20
- package/BaseFeatureWidget/types.d.ts +2 -2
- package/Plugin.d.ts +1 -1
- package/PluginLoader.js +17 -0
- package/PluginManager.d.ts +6 -5
- package/PluginManager.js +3 -0
- package/ReExports/list.js +1 -0
- package/ReExports/modules.d.ts +6 -5
- package/ReExports/modules.js +7 -4
- package/TextSearch/TextSearchManager.d.ts +2 -9
- package/assemblyManager/assembly.d.ts +91 -8
- package/assemblyManager/assembly.js +92 -8
- package/assemblyManager/assemblyConfigSchema.d.ts +50 -1
- package/assemblyManager/assemblyManager.d.ts +115 -58
- package/assemblyManager/assemblyManager.js +60 -12
- package/configuration/configurationSchema.d.ts +13 -13
- package/configuration/configurationSchema.js +4 -2
- package/configuration/configurationSlot.d.ts +1 -0
- package/configuration/index.d.ts +1 -1
- package/configuration/types.d.ts +13 -0
- package/configuration/types.js +2 -0
- package/configuration/util.d.ts +5 -3
- package/configuration/util.js +18 -18
- package/data_adapters/BaseAdapter/BaseAdapter.d.ts +23 -0
- package/data_adapters/BaseAdapter/BaseAdapter.js +37 -0
- package/data_adapters/BaseAdapter/BaseFeatureDataAdapter.d.ts +128 -0
- package/data_adapters/{BaseAdapter.js → BaseAdapter/BaseFeatureDataAdapter.js} +58 -88
- package/data_adapters/BaseAdapter/BaseOptions.d.ts +16 -0
- package/data_adapters/BaseAdapter/BaseOptions.js +2 -0
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.d.ts +9 -0
- package/data_adapters/BaseAdapter/BaseRefNameAliasAdapter.js +2 -0
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.d.ts +13 -0
- package/data_adapters/BaseAdapter/BaseSequenceAdapter.js +10 -0
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.d.ts +6 -0
- package/data_adapters/BaseAdapter/BaseTextSearchAdapter.js +2 -0
- package/data_adapters/BaseAdapter/RegionsAdapter.d.ts +6 -0
- package/data_adapters/BaseAdapter/RegionsAdapter.js +2 -0
- package/data_adapters/BaseAdapter/index.d.ts +15 -0
- package/data_adapters/BaseAdapter/index.js +25 -0
- package/data_adapters/BaseAdapter/types.d.ts +21 -0
- package/data_adapters/BaseAdapter/types.js +2 -0
- package/data_adapters/BaseAdapter/util.d.ts +12 -0
- package/data_adapters/BaseAdapter/util.js +23 -0
- package/data_adapters/CytobandAdapter/configSchema.d.ts +11 -1
- package/package.json +4 -5
- package/pluggableElementTypes/AdapterType.d.ts +1 -1
- package/pluggableElementTypes/ConnectionType.d.ts +1 -1
- package/pluggableElementTypes/DisplayType.d.ts +1 -1
- package/pluggableElementTypes/InternetAccountType.d.ts +1 -1
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +1 -1
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +1 -1
- package/pluggableElementTypes/models/BaseTrackModel.js +3 -2
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +30 -0
- package/pluggableElementTypes/models/InternetAccountModel.js +6 -1
- package/pluggableElementTypes/models/baseConnectionConfig.d.ts +18 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +42 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +118 -1
- package/pluggableElementTypes/models/baseTrackConfig.js +1 -1
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +0 -1
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +0 -1
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
- package/rpc/RpcManager.d.ts +8 -1
- package/rpc/RpcManager.js +1 -1
- package/rpc/baseRpcConfig.d.ts +10 -1
- package/rpc/configSchema.d.ts +14 -1
- package/rpc/coreRpcMethods.d.ts +1 -1
- package/rpc/coreRpcMethods.js +3 -3
- package/rpc/mainThreadRpcConfig.d.ts +7 -1
- package/rpc/methods/{CoreEstimateRegionStats.d.ts → CoreGetFeatureDensityStats.d.ts} +2 -2
- package/rpc/methods/{CoreEstimateRegionStats.js → CoreGetFeatureDensityStats.js} +4 -4
- package/rpc/methods/CoreGetFeatureDetails.js +5 -5
- package/rpc/webWorkerRpcConfig.d.ts +7 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.d.ts +0 -1
- package/ui/AppLogo.d.ts +0 -1
- package/ui/AssemblySelector.d.ts +0 -1
- package/ui/CascadingMenu.d.ts +0 -1
- package/ui/ColorPicker.d.ts +0 -1
- package/ui/Dialog.d.ts +0 -1
- package/ui/Dialog.js +14 -1
- package/ui/DrawerWidget.d.ts +1 -2
- package/ui/DrawerWidget.js +5 -3
- package/ui/DropDownMenu.d.ts +0 -1
- package/ui/ErrorMessage.d.ts +0 -1
- package/ui/FactoryResetDialog.d.ts +0 -1
- package/ui/FatalErrorDialog.d.ts +0 -1
- package/ui/FileSelector/FileSelector.d.ts +0 -1
- package/ui/FileSelector/LocalFileChooser.d.ts +0 -1
- package/ui/FileSelector/UrlChooser.d.ts +0 -1
- package/ui/Icons.d.ts +0 -1
- package/ui/LoadingEllipses.d.ts +0 -1
- package/ui/Logo.d.ts +0 -1
- package/ui/PrerenderedCanvas.d.ts +0 -1
- package/ui/ResizeBar.js +1 -1
- package/ui/ResizeHandle.d.ts +0 -1
- package/ui/ReturnToImportFormDialog.d.ts +0 -1
- package/ui/SanitizedHTML.d.ts +0 -1
- package/ui/SanitizedHTML.js +6 -0
- package/ui/Snackbar.d.ts +0 -1
- package/ui/Tooltip.d.ts +0 -1
- package/ui/ViewContainer.d.ts +2 -3
- package/ui/ViewContainer.js +7 -39
- package/ui/ViewContainerTitle.d.ts +5 -0
- package/ui/ViewContainerTitle.js +42 -0
- package/ui/ViewLauncher.d.ts +0 -1
- package/ui/ViewMenu.d.ts +1 -2
- package/ui/ViewPanel.d.ts +0 -1
- package/ui/react-colorful.d.ts +1 -1
- package/ui/theme.js +3 -18
- package/util/index.d.ts +9 -4
- package/util/index.js +30 -6
- package/util/io/index.d.ts +3 -1
- package/util/io/index.js +9 -4
- package/util/layouts/PrecomputedMultiLayout.d.ts +1 -1
- package/util/mst-reflection.d.ts +12 -17
- package/util/mst-reflection.js +13 -12
- package/util/stats.d.ts +5 -5
- package/util/types/index.d.ts +4 -1
- package/util/types/mst.d.ts +12 -9
- package/util/useMeasure.d.ts +5 -0
- package/util/useMeasure.js +34 -0
- package/BaseFeatureWidget/SequenceBox.d.ts +0 -29
- package/BaseFeatureWidget/SequenceBox.js +0 -63
- package/BaseFeatureWidget/SequenceFeatureDetails.d.ts +0 -3
- package/BaseFeatureWidget/SequenceFeatureDetails.js +0 -237
- package/data_adapters/BaseAdapter.d.ts +0 -138
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.d.ts +0 -0
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/DLGAP3.js +0 -0
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.d.ts +0 -0
- /package/BaseFeatureWidget/{test_data → SequenceFeatureDetails/test_data}/NCDN.js +0 -0
package/util/io/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RemoteFileWithRangeCache = exports.getFetcher = exports.openLocation = void 0;
|
|
6
|
+
exports.RemoteFileWithRangeCache = exports.getFetcher = exports.openLocation = exports.resolveUriLocation = void 0;
|
|
7
7
|
const generic_filehandle_1 = require("generic-filehandle");
|
|
8
8
|
const detect_node_1 = __importDefault(require("detect-node"));
|
|
9
9
|
// locals
|
|
@@ -17,6 +17,13 @@ function isLocalPathLocation(location) {
|
|
|
17
17
|
function isBlobLocation(location) {
|
|
18
18
|
return 'blobId' in location;
|
|
19
19
|
}
|
|
20
|
+
/** if a UriLocation has a baseUri, resolves its uri with respect to that base */
|
|
21
|
+
function resolveUriLocation(location) {
|
|
22
|
+
return location.baseUri
|
|
23
|
+
? { ...location, uri: new URL(location.uri, location.baseUri).href }
|
|
24
|
+
: location;
|
|
25
|
+
}
|
|
26
|
+
exports.resolveUriLocation = resolveUriLocation;
|
|
20
27
|
function openLocation(location, pluginManager) {
|
|
21
28
|
if (!location) {
|
|
22
29
|
throw new Error('must provide a location to openLocation');
|
|
@@ -46,9 +53,7 @@ function openLocation(location, pluginManager) {
|
|
|
46
53
|
throw new Error('No URI provided');
|
|
47
54
|
}
|
|
48
55
|
// Resolve any relative URLs to absolute URLs
|
|
49
|
-
const absoluteLocation = location
|
|
50
|
-
? { ...location, uri: new URL(location.uri, location.baseUri).href }
|
|
51
|
-
: location;
|
|
56
|
+
const absoluteLocation = resolveUriLocation(location);
|
|
52
57
|
// If there is a plugin manager, we can try internet accounts
|
|
53
58
|
if (pluginManager) {
|
|
54
59
|
const internetAccount = getInternetAccount(location, pluginManager);
|
package/util/mst-reflection.d.ts
CHANGED
|
@@ -1,29 +1,24 @@
|
|
|
1
|
+
import { IAnyType, IModelReflectionPropertiesData, IAnyComplexType, ISimpleType, UnionStringArray } from 'mobx-state-tree';
|
|
2
|
+
export interface ILiteralType<T> extends ISimpleType<T> {
|
|
3
|
+
value: T;
|
|
4
|
+
}
|
|
1
5
|
/**
|
|
2
6
|
* get the inner type of an MST optional, array, or late type object
|
|
3
|
-
*
|
|
4
|
-
* @param {IModelType} type
|
|
5
|
-
* @returns {IModelType}
|
|
6
7
|
*/
|
|
7
|
-
export function getSubType(type:
|
|
8
|
+
export declare function getSubType(type: IAnyType): IAnyType;
|
|
8
9
|
/**
|
|
9
|
-
* get the array of
|
|
10
|
-
* @param {MST Union Type obj} unionType
|
|
11
|
-
* @returns {Array<IModelType>}
|
|
10
|
+
* get the array of the subtypes in a union
|
|
12
11
|
*/
|
|
13
|
-
export function getUnionSubTypes(unionType:
|
|
12
|
+
export declare function getUnionSubTypes(unionType: IAnyType): IAnyType[];
|
|
14
13
|
/**
|
|
15
14
|
* get the type of one of the properties of the given MST model type
|
|
16
|
-
*
|
|
17
|
-
* @param {IModelType} type
|
|
18
|
-
* @param {string} propertyName
|
|
19
|
-
* @returns {IModelType}
|
|
20
15
|
*/
|
|
21
|
-
export function getPropertyType(type:
|
|
16
|
+
export declare function getPropertyType(type: IModelReflectionPropertiesData, propertyName: string): IAnyType;
|
|
22
17
|
/**
|
|
23
18
|
* get the base type from inside an MST optional type
|
|
24
|
-
* @param {*} type
|
|
25
19
|
*/
|
|
26
|
-
export function getDefaultValue(type:
|
|
20
|
+
export declare function getDefaultValue(type: IAnyType): any;
|
|
21
|
+
export type IEnumerationType<T extends string> = ISimpleType<UnionStringArray<T[]>>;
|
|
27
22
|
/** get the string values of an MST enumeration type */
|
|
28
|
-
export function getEnumerationValues(type:
|
|
29
|
-
export function resolveLateType(maybeLate:
|
|
23
|
+
export declare function getEnumerationValues(type: IAnyComplexType): string[];
|
|
24
|
+
export declare function resolveLateType(maybeLate: IAnyType): any;
|
package/util/mst-reflection.js
CHANGED
|
@@ -5,19 +5,20 @@ exports.resolveLateType = exports.getEnumerationValues = exports.getDefaultValue
|
|
|
5
5
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
6
|
/**
|
|
7
7
|
* get the inner type of an MST optional, array, or late type object
|
|
8
|
-
*
|
|
9
|
-
* @param {IModelType} type
|
|
10
|
-
* @returns {IModelType}
|
|
11
8
|
*/
|
|
12
9
|
function getSubType(type) {
|
|
13
10
|
let t;
|
|
14
11
|
if ((0, mobx_state_tree_1.isOptionalType)(type)) {
|
|
12
|
+
// @ts-expect-error
|
|
15
13
|
t = type._subtype || type.type;
|
|
16
14
|
}
|
|
17
15
|
else if ((0, mobx_state_tree_1.isArrayType)(type) || (0, mobx_state_tree_1.isMapType)(type)) {
|
|
16
|
+
// @ts-expect-error
|
|
18
17
|
t = type._subtype || type._subType || type.subType;
|
|
18
|
+
// @ts-expect-error
|
|
19
19
|
}
|
|
20
20
|
else if (typeof type.getSubType === 'function') {
|
|
21
|
+
// @ts-expect-error
|
|
21
22
|
return type.getSubType();
|
|
22
23
|
}
|
|
23
24
|
else {
|
|
@@ -31,17 +32,20 @@ function getSubType(type) {
|
|
|
31
32
|
}
|
|
32
33
|
exports.getSubType = getSubType;
|
|
33
34
|
/**
|
|
34
|
-
* get the array of
|
|
35
|
-
* @param {MST Union Type obj} unionType
|
|
36
|
-
* @returns {Array<IModelType>}
|
|
35
|
+
* get the array of the subtypes in a union
|
|
37
36
|
*/
|
|
38
37
|
function getUnionSubTypes(unionType) {
|
|
39
38
|
if (!(0, mobx_state_tree_1.isUnionType)(unionType)) {
|
|
40
39
|
throw new TypeError('not an MST union type');
|
|
41
40
|
}
|
|
42
|
-
const t =
|
|
41
|
+
const t =
|
|
42
|
+
// @ts-expect-error
|
|
43
|
+
unionType._types ||
|
|
44
|
+
// @ts-expect-error
|
|
43
45
|
unionType.types ||
|
|
46
|
+
// @ts-expect-error
|
|
44
47
|
getSubType(unionType)._types ||
|
|
48
|
+
// @ts-expect-error
|
|
45
49
|
getSubType(unionType).types;
|
|
46
50
|
if (!t) {
|
|
47
51
|
// debugger
|
|
@@ -52,10 +56,6 @@ function getUnionSubTypes(unionType) {
|
|
|
52
56
|
exports.getUnionSubTypes = getUnionSubTypes;
|
|
53
57
|
/**
|
|
54
58
|
* get the type of one of the properties of the given MST model type
|
|
55
|
-
*
|
|
56
|
-
* @param {IModelType} type
|
|
57
|
-
* @param {string} propertyName
|
|
58
|
-
* @returns {IModelType}
|
|
59
59
|
*/
|
|
60
60
|
function getPropertyType(type, propertyName) {
|
|
61
61
|
const propertyType = type.properties[propertyName];
|
|
@@ -64,12 +64,12 @@ function getPropertyType(type, propertyName) {
|
|
|
64
64
|
exports.getPropertyType = getPropertyType;
|
|
65
65
|
/**
|
|
66
66
|
* get the base type from inside an MST optional type
|
|
67
|
-
* @param {*} type
|
|
68
67
|
*/
|
|
69
68
|
function getDefaultValue(type) {
|
|
70
69
|
if (!(0, mobx_state_tree_1.isOptionalType)(type)) {
|
|
71
70
|
throw new TypeError('type must be an optional type');
|
|
72
71
|
}
|
|
72
|
+
// @ts-expect-error
|
|
73
73
|
return type._defaultValue || type.defaultValue;
|
|
74
74
|
}
|
|
75
75
|
exports.getDefaultValue = getDefaultValue;
|
|
@@ -84,6 +84,7 @@ function resolveLateType(maybeLate) {
|
|
|
84
84
|
if (!(0, mobx_state_tree_1.isUnionType)(maybeLate) &&
|
|
85
85
|
!(0, mobx_state_tree_1.isArrayType)(maybeLate) &&
|
|
86
86
|
(0, mobx_state_tree_1.isLateType)(maybeLate)) {
|
|
87
|
+
// @ts-expect-error
|
|
87
88
|
return maybeLate.getSubType();
|
|
88
89
|
}
|
|
89
90
|
return maybeLate;
|
package/util/stats.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { NoAssemblyRegion } from './types';
|
|
3
3
|
import { Feature } from './simpleFeature';
|
|
4
|
-
export interface
|
|
4
|
+
export interface UnrectifiedQuantitativeStats {
|
|
5
5
|
scoreMin: number;
|
|
6
6
|
scoreMax: number;
|
|
7
7
|
scoreSum: number;
|
|
@@ -9,7 +9,7 @@ export interface UnrectifiedFeatureStats {
|
|
|
9
9
|
featureCount: number;
|
|
10
10
|
basesCovered: number;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface QuantitativeStats extends UnrectifiedQuantitativeStats {
|
|
13
13
|
featureDensity: number;
|
|
14
14
|
scoreMean: number;
|
|
15
15
|
scoreStdDev: number;
|
|
@@ -31,7 +31,7 @@ export declare function calcStdFromSums(sum: number, sumSquares: number, n: numb
|
|
|
31
31
|
* @returns - a summary stats object with
|
|
32
32
|
* scoreMean, scoreStdDev, and featureDensity added
|
|
33
33
|
*/
|
|
34
|
-
export declare function rectifyStats(s:
|
|
34
|
+
export declare function rectifyStats(s: UnrectifiedQuantitativeStats): QuantitativeStats;
|
|
35
35
|
/**
|
|
36
36
|
* calculates per-base scores for variable width features over a region
|
|
37
37
|
*
|
|
@@ -47,5 +47,5 @@ export declare function calcPerBaseStats(region: NoAssemblyRegion, features: Fea
|
|
|
47
47
|
* @param features - array of features which are possibly summary features
|
|
48
48
|
* @returns - object with scoreMax, scoreMin, scoreSum, scoreSumSquares, etc
|
|
49
49
|
*/
|
|
50
|
-
export declare function scoresToStats(region: NoAssemblyRegion, feats: Observable<Feature>): Promise<
|
|
51
|
-
export declare function blankStats():
|
|
50
|
+
export declare function scoresToStats(region: NoAssemblyRegion, feats: Observable<Feature>): Promise<QuantitativeStats>;
|
|
51
|
+
export declare function blankStats(): QuantitativeStats;
|
package/util/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Instance, SnapshotIn, IAnyStateTreeNode, IStateTreeNode, IType } from 'mobx-state-tree';
|
|
3
|
-
import { AnyConfigurationModel } from '../../configuration
|
|
3
|
+
import { AnyConfigurationModel } from '../../configuration';
|
|
4
4
|
import assemblyManager from '../../assemblyManager';
|
|
5
5
|
import TextSearchManager from '../../TextSearch/TextSearchManager';
|
|
6
6
|
import { MenuItem } from '../../ui';
|
|
@@ -65,6 +65,7 @@ export interface AbstractSessionModel extends AbstractViewContainer {
|
|
|
65
65
|
name: string;
|
|
66
66
|
connectionId: string;
|
|
67
67
|
tracks: AnyConfigurationModel[];
|
|
68
|
+
configuration: AnyConfigurationModel;
|
|
68
69
|
}[];
|
|
69
70
|
makeConnection?: Function;
|
|
70
71
|
adminMode?: boolean;
|
|
@@ -144,6 +145,7 @@ export interface AbstractViewModel {
|
|
|
144
145
|
export declare function isViewModel(thing: unknown): thing is AbstractViewModel;
|
|
145
146
|
export interface AbstractTrackModel {
|
|
146
147
|
displays: AbstractDisplayModel[];
|
|
148
|
+
configuration: AnyConfigurationModel;
|
|
147
149
|
}
|
|
148
150
|
export declare function isTrackModel(thing: unknown): thing is AbstractTrackModel;
|
|
149
151
|
export interface AbstractDisplayModel {
|
|
@@ -194,6 +196,7 @@ export interface AbstractMenuManager {
|
|
|
194
196
|
export declare function isAbstractMenuManager(thing: unknown): thing is AbstractMenuManager;
|
|
195
197
|
export interface NoAssemblyRegion extends SnapshotIn<typeof MUNoAssemblyRegion> {
|
|
196
198
|
}
|
|
199
|
+
/** a description of a specific genomic region. assemblyName, refName, start, end, and reversed */
|
|
197
200
|
export interface Region extends SnapshotIn<typeof MUIRegion> {
|
|
198
201
|
}
|
|
199
202
|
export interface AugmentedRegion extends Region {
|
package/util/types/mst.d.ts
CHANGED
|
@@ -99,7 +99,17 @@ export declare const FileLocation: import("mobx-state-tree").ISnapshotProcessor<
|
|
|
99
99
|
}> | import("mobx-state-tree").ModelSnapshotType<{
|
|
100
100
|
locationType: import("mobx-state-tree").ISimpleType<"LocalPathLocation">;
|
|
101
101
|
localPath: import("mobx-state-tree").ISimpleType<string>;
|
|
102
|
-
}>, import("mobx-state-tree").
|
|
102
|
+
}>, import("mobx-state-tree").ModelInstanceType<{
|
|
103
|
+
locationType: import("mobx-state-tree").ISimpleType<"BlobLocation">;
|
|
104
|
+
name: import("mobx-state-tree").ISimpleType<string>;
|
|
105
|
+
blobId: import("mobx-state-tree").ISimpleType<string>;
|
|
106
|
+
}, {}> | import("mobx-state-tree").ModelInstanceType<{
|
|
107
|
+
locationType: import("mobx-state-tree").ISimpleType<"LocalPathLocation">;
|
|
108
|
+
localPath: import("mobx-state-tree").ISimpleType<string>;
|
|
109
|
+
}, {}> | ({
|
|
110
|
+
locationType: "UriLocation";
|
|
111
|
+
uri: string;
|
|
112
|
+
} & Partial<import("mobx-state-tree/dist/internal").ExtractCFromProps<{
|
|
103
113
|
locationType: import("mobx-state-tree").ISimpleType<"UriLocation">;
|
|
104
114
|
uri: import("mobx-state-tree").ISimpleType<string>;
|
|
105
115
|
baseUri: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
@@ -108,11 +118,4 @@ export declare const FileLocation: import("mobx-state-tree").ISnapshotProcessor<
|
|
|
108
118
|
internetAccountType: import("mobx-state-tree").ISimpleType<string>;
|
|
109
119
|
authInfo: import("mobx-state-tree").IType<any, any, any>;
|
|
110
120
|
}, {}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
111
|
-
}>>
|
|
112
|
-
locationType: import("mobx-state-tree").ISimpleType<"BlobLocation">;
|
|
113
|
-
name: import("mobx-state-tree").ISimpleType<string>;
|
|
114
|
-
blobId: import("mobx-state-tree").ISimpleType<string>;
|
|
115
|
-
}, {}> | import("mobx-state-tree").ModelInstanceType<{
|
|
116
|
-
locationType: import("mobx-state-tree").ISimpleType<"LocalPathLocation">;
|
|
117
|
-
localPath: import("mobx-state-tree").ISimpleType<string>;
|
|
118
|
-
}, {}>>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
121
|
+
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject)>, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
function useMeasure() {
|
|
5
|
+
const ref = (0, react_1.useRef)(null);
|
|
6
|
+
const [dims, setDims] = (0, react_1.useState)({
|
|
7
|
+
width: undefined,
|
|
8
|
+
height: undefined,
|
|
9
|
+
});
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
if (!ref.current) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const RS = typeof window !== 'undefined' && 'ResizeObserver' in window
|
|
15
|
+
? window.ResizeObserver
|
|
16
|
+
: undefined;
|
|
17
|
+
if (!RS) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const observer = new RS(entries => {
|
|
21
|
+
setDims({
|
|
22
|
+
width: entries[0].contentRect.width,
|
|
23
|
+
height: entries[0].contentRect.height,
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
observer.observe(ref.current);
|
|
27
|
+
// Callback fired when component is unmounted
|
|
28
|
+
return () => {
|
|
29
|
+
observer.disconnect();
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
return [ref, dims];
|
|
33
|
+
}
|
|
34
|
+
exports.default = useMeasure;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Feat } from './util';
|
|
3
|
-
export declare function GeneCDS({ cds, sequence }: {
|
|
4
|
-
cds: Feat[];
|
|
5
|
-
sequence: string;
|
|
6
|
-
}): JSX.Element;
|
|
7
|
-
export declare function GeneProtein({ cds, sequence, codonTable, }: {
|
|
8
|
-
cds: Feat[];
|
|
9
|
-
sequence: string;
|
|
10
|
-
codonTable: {
|
|
11
|
-
[key: string]: string;
|
|
12
|
-
};
|
|
13
|
-
}): JSX.Element;
|
|
14
|
-
export declare function GenecDNA({ utr, cds, exons, sequence, upstream, downstream, includeIntrons, collapseIntron, intronBp, }: {
|
|
15
|
-
utr: Feat[];
|
|
16
|
-
cds: Feat[];
|
|
17
|
-
exons: Feat[];
|
|
18
|
-
sequence: string;
|
|
19
|
-
upstream?: string;
|
|
20
|
-
downstream?: string;
|
|
21
|
-
includeIntrons?: boolean;
|
|
22
|
-
collapseIntron?: boolean;
|
|
23
|
-
intronBp: number;
|
|
24
|
-
}): JSX.Element;
|
|
25
|
-
export declare function Genomic({ sequence, upstream, downstream, }: {
|
|
26
|
-
sequence: string;
|
|
27
|
-
upstream?: string;
|
|
28
|
-
downstream?: string;
|
|
29
|
-
}): JSX.Element;
|
|
@@ -1,63 +0,0 @@
|
|
|
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.Genomic = exports.GenecDNA = exports.GeneProtein = exports.GeneCDS = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const util_1 = require("./util");
|
|
9
|
-
// note that these are currently put into the style section instead of being
|
|
10
|
-
// defined in classes to aid copy and paste to an external document e.g. word
|
|
11
|
-
const proteinColor = 'rgb(220,160,220)';
|
|
12
|
-
const intronColor = undefined;
|
|
13
|
-
const cdsColor = 'rgb(220,220,180)';
|
|
14
|
-
const updownstreamColor = 'rgba(250,200,200)';
|
|
15
|
-
const utrColor = 'rgb(200,240,240)';
|
|
16
|
-
const genomeColor = 'rgb(200,280,200)';
|
|
17
|
-
function GeneCDS({ cds, sequence }) {
|
|
18
|
-
return react_1.default.createElement("span", { style: { background: cdsColor } }, (0, util_1.stitch)(cds, sequence));
|
|
19
|
-
}
|
|
20
|
-
exports.GeneCDS = GeneCDS;
|
|
21
|
-
function GeneProtein({ cds, sequence, codonTable, }) {
|
|
22
|
-
const str = (0, util_1.stitch)(cds, sequence);
|
|
23
|
-
let protein = '';
|
|
24
|
-
for (let i = 0; i < str.length; i += 3) {
|
|
25
|
-
// use & symbol for undefined codon, or partial slice
|
|
26
|
-
protein += codonTable[str.slice(i, i + 3)] || '&';
|
|
27
|
-
}
|
|
28
|
-
return react_1.default.createElement("span", { style: { background: proteinColor } }, protein);
|
|
29
|
-
}
|
|
30
|
-
exports.GeneProtein = GeneProtein;
|
|
31
|
-
function GenecDNA({ utr, cds, exons, sequence, upstream, downstream, includeIntrons, collapseIntron, intronBp, }) {
|
|
32
|
-
const chunks = (cds.length ? [...cds, ...utr].sort((a, b) => a.start - b.start) : exons).filter(f => f.start !== f.end);
|
|
33
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
34
|
-
upstream ? (react_1.default.createElement("span", { style: {
|
|
35
|
-
background: updownstreamColor,
|
|
36
|
-
} }, upstream)) : null,
|
|
37
|
-
chunks.map((chunk, idx) => {
|
|
38
|
-
var _a;
|
|
39
|
-
const intron = sequence.slice(chunk.end, (_a = chunks[idx + 1]) === null || _a === void 0 ? void 0 : _a.start);
|
|
40
|
-
return (react_1.default.createElement(react_1.default.Fragment, { key: JSON.stringify(chunk) },
|
|
41
|
-
react_1.default.createElement("span", { style: {
|
|
42
|
-
background: chunk.type === 'CDS' ? cdsColor : utrColor,
|
|
43
|
-
} }, sequence.slice(chunk.start, chunk.end)),
|
|
44
|
-
includeIntrons && idx < chunks.length - 1 ? (react_1.default.createElement("span", { style: { background: intronColor } }, collapseIntron && intron.length > intronBp * 2
|
|
45
|
-
? `${intron.slice(0, intronBp)}...${intron.slice(-intronBp)}`
|
|
46
|
-
: intron)) : null));
|
|
47
|
-
}),
|
|
48
|
-
downstream ? (react_1.default.createElement("span", { style: { background: updownstreamColor } }, downstream)) : null));
|
|
49
|
-
}
|
|
50
|
-
exports.GenecDNA = GenecDNA;
|
|
51
|
-
function Genomic({ sequence, upstream, downstream, }) {
|
|
52
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
53
|
-
upstream ? (react_1.default.createElement("span", { style: {
|
|
54
|
-
background: updownstreamColor,
|
|
55
|
-
} }, upstream)) : null,
|
|
56
|
-
react_1.default.createElement("span", { style: {
|
|
57
|
-
background: genomeColor,
|
|
58
|
-
} }, sequence),
|
|
59
|
-
downstream ? (react_1.default.createElement("span", { style: {
|
|
60
|
-
background: updownstreamColor,
|
|
61
|
-
} }, downstream)) : null));
|
|
62
|
-
}
|
|
63
|
-
exports.Genomic = Genomic;
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const react_1 = __importStar(require("react"));
|
|
30
|
-
const material_1 = require("@mui/material");
|
|
31
|
-
const mui_1 = require("tss-react/mui");
|
|
32
|
-
const copy_to_clipboard_1 = __importDefault(require("copy-to-clipboard"));
|
|
33
|
-
// locals
|
|
34
|
-
const util_1 = require("../util");
|
|
35
|
-
const configuration_1 = require("../configuration");
|
|
36
|
-
const ui_1 = require("../ui");
|
|
37
|
-
// icons
|
|
38
|
-
const Settings_1 = __importDefault(require("@mui/icons-material/Settings"));
|
|
39
|
-
const Help_1 = __importDefault(require("@mui/icons-material/Help"));
|
|
40
|
-
// lazies
|
|
41
|
-
const SettingsDlg = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SequenceFeatureSettingsDialog'))));
|
|
42
|
-
const HelpDlg = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SequenceHelpDialog'))));
|
|
43
|
-
const SequencePanel = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./SequencePanel'))));
|
|
44
|
-
const useStyles = (0, mui_1.makeStyles)()(theme => ({
|
|
45
|
-
button: {
|
|
46
|
-
margin: theme.spacing(1),
|
|
47
|
-
},
|
|
48
|
-
formControl: {
|
|
49
|
-
margin: 0,
|
|
50
|
-
},
|
|
51
|
-
container: {
|
|
52
|
-
margin: theme.spacing(1),
|
|
53
|
-
},
|
|
54
|
-
container2: {
|
|
55
|
-
marginTop: theme.spacing(1),
|
|
56
|
-
},
|
|
57
|
-
}));
|
|
58
|
-
const BPLIMIT = 500000;
|
|
59
|
-
// display the stitched-together sequence of a gene's CDS, cDNA, or protein
|
|
60
|
-
// sequence. this is a best effort and weird genomic phenomena could lead these
|
|
61
|
-
// to not be 100% accurate
|
|
62
|
-
function SequenceFeatureDetails({ model, feature }) {
|
|
63
|
-
var _a;
|
|
64
|
-
const { classes } = useStyles();
|
|
65
|
-
const parentFeature = feature;
|
|
66
|
-
const hasCDS = !!((_a = parentFeature.subfeatures) === null || _a === void 0 ? void 0 : _a.find(sub => sub.type === 'CDS'));
|
|
67
|
-
const isGene = feature.type === 'gene';
|
|
68
|
-
const [shown, setShown] = (0, react_1.useState)(false);
|
|
69
|
-
const [helpShown, setHelpShown] = (0, react_1.useState)(false);
|
|
70
|
-
return (isGene && !hasCDS) || !model ? null : (react_1.default.createElement("div", { className: classes.container2 },
|
|
71
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", onClick: () => setShown(!shown) }, shown ? 'Hide feature sequence' : 'Show feature sequence'),
|
|
72
|
-
react_1.default.createElement(material_1.FormControl, { className: classes.formControl },
|
|
73
|
-
react_1.default.createElement(material_1.IconButton, { onClick: () => setHelpShown(true) },
|
|
74
|
-
react_1.default.createElement(Help_1.default, null))),
|
|
75
|
-
react_1.default.createElement("br", null),
|
|
76
|
-
shown ? react_1.default.createElement(FeatureSequence, { model: model, feature: feature }) : null,
|
|
77
|
-
helpShown ? (react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement("div", null) },
|
|
78
|
-
react_1.default.createElement(HelpDlg, { handleClose: () => setHelpShown(false) }))) : null));
|
|
79
|
-
}
|
|
80
|
-
exports.default = SequenceFeatureDetails;
|
|
81
|
-
function FeatureSequence({ model, feature }) {
|
|
82
|
-
var _a;
|
|
83
|
-
const { classes } = useStyles();
|
|
84
|
-
const parentFeature = feature;
|
|
85
|
-
const hasCDS = !!((_a = parentFeature.subfeatures) === null || _a === void 0 ? void 0 : _a.find(sub => sub.type === 'CDS'));
|
|
86
|
-
const seqPanelRef = (0, react_1.useRef)(null);
|
|
87
|
-
const [settingsDlgOpen, setSettingsDlgOpen] = (0, react_1.useState)(false);
|
|
88
|
-
const [intronBp, setIntronBp] = (0, util_1.useLocalStorage)('intronBp', 10);
|
|
89
|
-
const [upDownBp, setUpDownBp] = (0, util_1.useLocalStorage)('upDownBp', 500);
|
|
90
|
-
const [sequence, setSequence] = (0, react_1.useState)();
|
|
91
|
-
const [error, setError] = (0, react_1.useState)();
|
|
92
|
-
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
93
|
-
const [copiedHtml, setCopiedHtml] = (0, react_1.useState)(false);
|
|
94
|
-
const [forceLoad, setForceLoad] = (0, react_1.useState)({
|
|
95
|
-
id: feature.uniqueId,
|
|
96
|
-
force: false,
|
|
97
|
-
});
|
|
98
|
-
(0, react_1.useEffect)(() => {
|
|
99
|
-
setForceLoad({
|
|
100
|
-
id: feature.uniqueId,
|
|
101
|
-
force: false,
|
|
102
|
-
});
|
|
103
|
-
}, [feature]);
|
|
104
|
-
(0, react_1.useEffect)(() => {
|
|
105
|
-
var _a;
|
|
106
|
-
let finished = false;
|
|
107
|
-
if (!model) {
|
|
108
|
-
return () => { };
|
|
109
|
-
}
|
|
110
|
-
const { assemblyManager, rpcManager } = (0, util_1.getSession)(model);
|
|
111
|
-
const [assemblyName] = ((_a = model.view) === null || _a === void 0 ? void 0 : _a.assemblyNames) || [];
|
|
112
|
-
async function fetchSeq(start, end, refName) {
|
|
113
|
-
const assembly = await assemblyManager.waitForAssembly(assemblyName);
|
|
114
|
-
if (!assembly) {
|
|
115
|
-
throw new Error('assembly not found');
|
|
116
|
-
}
|
|
117
|
-
const sessionId = 'getSequence';
|
|
118
|
-
const feats = await rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
119
|
-
adapterConfig: (0, configuration_1.getConf)(assembly, ['sequence', 'adapter']),
|
|
120
|
-
sessionId,
|
|
121
|
-
regions: [
|
|
122
|
-
{
|
|
123
|
-
start,
|
|
124
|
-
end,
|
|
125
|
-
refName: assembly.getCanonicalRefName(refName),
|
|
126
|
-
assemblyName,
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
});
|
|
130
|
-
const [feat] = feats;
|
|
131
|
-
return (feat === null || feat === void 0 ? void 0 : feat.get('seq')) || '';
|
|
132
|
-
}
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
134
|
-
;
|
|
135
|
-
(async () => {
|
|
136
|
-
try {
|
|
137
|
-
setError(undefined);
|
|
138
|
-
const { start, end, refName } = feature;
|
|
139
|
-
if (!forceLoad.force && end - start > BPLIMIT) {
|
|
140
|
-
setSequence({
|
|
141
|
-
error: `Genomic sequence larger than ${BPLIMIT}bp, use "force load" button to display`,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
const seq = await fetchSeq(start, end, refName);
|
|
146
|
-
const up = await fetchSeq(Math.max(0, start - upDownBp), start, refName);
|
|
147
|
-
const down = await fetchSeq(end, end + upDownBp, refName);
|
|
148
|
-
if (!finished) {
|
|
149
|
-
setSequence({ seq, upstream: up, downstream: down });
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
catch (e) {
|
|
154
|
-
console.error(e);
|
|
155
|
-
setError(e);
|
|
156
|
-
}
|
|
157
|
-
})();
|
|
158
|
-
return () => {
|
|
159
|
-
finished = true;
|
|
160
|
-
};
|
|
161
|
-
}, [feature, model, upDownBp, forceLoad]);
|
|
162
|
-
const loading = !sequence;
|
|
163
|
-
const session = (0, util_1.getSession)(model);
|
|
164
|
-
const defaultSeqTypes = ['mRNA', 'transcript', 'gene'];
|
|
165
|
-
const sequenceTypes = (0, configuration_1.getConf)(session, ['featureDetails', 'sequenceTypes']) || defaultSeqTypes;
|
|
166
|
-
// only attempt fetching gene type sequence on a bare CDS if it has no parent
|
|
167
|
-
const attemptGeneType = feature.type === 'CDS'
|
|
168
|
-
? sequenceTypes.includes('CDS') && !feature.parentId
|
|
169
|
-
: sequenceTypes.includes(feature.type);
|
|
170
|
-
const val = attemptGeneType ? (hasCDS ? 'cds' : 'cdna') : 'genomic';
|
|
171
|
-
// this useEffect is needed to reset the mode/setMode useState because the
|
|
172
|
-
// contents of the select box can completely change depending on whether we
|
|
173
|
-
// click on a gene feature or non-gene feature, so the current value in the
|
|
174
|
-
// select box must change accordingly
|
|
175
|
-
(0, react_1.useEffect)(() => {
|
|
176
|
-
setMode(val);
|
|
177
|
-
}, [attemptGeneType, val]);
|
|
178
|
-
const [mode, setMode] = (0, react_1.useState)(attemptGeneType ? (hasCDS ? 'cds' : 'cdna') : 'genomic');
|
|
179
|
-
const rest = {
|
|
180
|
-
gene: 'Gene w/ introns',
|
|
181
|
-
gene_collapsed_intron: `Gene w/ ${intronBp}bp of intron`,
|
|
182
|
-
gene_updownstream: `Gene w/ ${upDownBp}bp up+down stream`,
|
|
183
|
-
gene_updownstream_collapsed_intron: `Gene w/ ${upDownBp}bp up+down stream w/ ${intronBp}bp intron`,
|
|
184
|
-
cdna: 'cDNA',
|
|
185
|
-
};
|
|
186
|
-
const arg = attemptGeneType
|
|
187
|
-
? hasCDS
|
|
188
|
-
? {
|
|
189
|
-
cds: 'CDS',
|
|
190
|
-
protein: 'Protein',
|
|
191
|
-
...rest,
|
|
192
|
-
}
|
|
193
|
-
: rest
|
|
194
|
-
: {
|
|
195
|
-
genomic: 'Genomic seq',
|
|
196
|
-
genomic_sequence_updown: `Genomic seq w/ ${upDownBp}bp up+down stream`,
|
|
197
|
-
};
|
|
198
|
-
return (react_1.default.createElement("div", { className: classes.container2 },
|
|
199
|
-
react_1.default.createElement(material_1.FormControl, { className: classes.formControl },
|
|
200
|
-
react_1.default.createElement(material_1.Select, { value: mode, onChange: event => setMode(event.target.value) }, Object.entries(arg).map(([key, val]) => (react_1.default.createElement(material_1.MenuItem, { key: key, value: key }, val))))),
|
|
201
|
-
react_1.default.createElement(material_1.FormControl, { className: classes.formControl },
|
|
202
|
-
react_1.default.createElement(material_1.Button, { className: classes.button, variant: "contained", onClick: () => {
|
|
203
|
-
const ref = seqPanelRef.current;
|
|
204
|
-
if (ref) {
|
|
205
|
-
(0, copy_to_clipboard_1.default)(ref.textContent || '', { format: 'text/plain' });
|
|
206
|
-
setCopied(true);
|
|
207
|
-
setTimeout(() => setCopied(false), 1000);
|
|
208
|
-
}
|
|
209
|
-
} }, copied ? 'Copied to clipboard!' : 'Copy plaintext')),
|
|
210
|
-
react_1.default.createElement(material_1.FormControl, { className: classes.formControl },
|
|
211
|
-
react_1.default.createElement(material_1.Tooltip, { title: "The 'Copy HTML' function retains the colors from the sequence panel but cannot be pasted into some programs like notepad that only expect plain text" },
|
|
212
|
-
react_1.default.createElement(material_1.Button, { className: classes.button, variant: "contained", onClick: () => {
|
|
213
|
-
const ref = seqPanelRef.current;
|
|
214
|
-
if (ref) {
|
|
215
|
-
(0, copy_to_clipboard_1.default)(ref.innerHTML, { format: 'text/html' });
|
|
216
|
-
setCopiedHtml(true);
|
|
217
|
-
setTimeout(() => setCopiedHtml(false), 1000);
|
|
218
|
-
}
|
|
219
|
-
} }, copiedHtml ? 'Copied to clipboard!' : 'Copy HTML'))),
|
|
220
|
-
react_1.default.createElement(material_1.FormControl, { className: classes.formControl },
|
|
221
|
-
react_1.default.createElement(material_1.IconButton, { onClick: () => setSettingsDlgOpen(true) },
|
|
222
|
-
react_1.default.createElement(Settings_1.default, null))),
|
|
223
|
-
react_1.default.createElement("br", null),
|
|
224
|
-
error ? (react_1.default.createElement(material_1.Typography, { color: "error" }, `${error}`)) : loading ? (react_1.default.createElement(ui_1.LoadingEllipses, null)) : sequence ? ('error' in sequence ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
225
|
-
react_1.default.createElement(material_1.Typography, { color: "error" }, sequence.error),
|
|
226
|
-
react_1.default.createElement(material_1.Button, { variant: "contained", color: "inherit", onClick: () => setForceLoad({ ...forceLoad, force: true }) }, "Force load"))) : (react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement("div", null, "Loading") },
|
|
227
|
-
react_1.default.createElement(SequencePanel, { ref: seqPanelRef, feature: parentFeature, mode: mode, sequence: sequence, intronBp: intronBp })))) : (react_1.default.createElement(material_1.Typography, null, "No sequence found")),
|
|
228
|
-
settingsDlgOpen ? (react_1.default.createElement(react_1.Suspense, { fallback: react_1.default.createElement("div", null) },
|
|
229
|
-
react_1.default.createElement(SettingsDlg, { handleClose: arg => {
|
|
230
|
-
if (arg) {
|
|
231
|
-
const { upDownBp, intronBp } = arg;
|
|
232
|
-
setIntronBp(intronBp);
|
|
233
|
-
setUpDownBp(upDownBp);
|
|
234
|
-
}
|
|
235
|
-
setSettingsDlgOpen(false);
|
|
236
|
-
}, upDownBp: upDownBp, intronBp: intronBp }))) : null));
|
|
237
|
-
}
|