@apollo-annotation/jbrowse-plugin-apollo 0.1.19 → 0.1.21
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/dist/index.esm.js +154 -78
- package/dist/index.esm.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.development.js +154 -78
- package/dist/jbrowse-plugin-apollo.cjs.development.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.production.min.js +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.production.min.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.umd.development.js +1060 -682
- package/dist/jbrowse-plugin-apollo.umd.development.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.umd.production.min.js +1 -1
- package/dist/jbrowse-plugin-apollo.umd.production.min.js.map +1 -1
- package/package.json +31 -31
- package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +0 -4
- package/src/LinearApolloDisplay/configSchema.ts +5 -14
- package/src/LinearApolloDisplay/index.ts +1 -1
- package/src/LinearApolloDisplay/stateModel/base.ts +99 -14
- package/src/OntologyManager/OntologyStore/fulltext.ts +0 -1
- package/src/components/AddAssembly.tsx +1 -1
- package/src/components/ManageUsers.tsx +20 -1
- package/src/index.ts +2 -2
- package/src/makeDisplayComponent.tsx +49 -25
- package/src/session/session.ts +11 -3
- package/src/LinearApolloDisplay/stateModel/trackHeightMixin.ts +0 -43
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jbrowse/core/Plugin'), require('@jbrowse/core/util'), require('@jbrowse/core/configuration'), require('@jbrowse/core/pluggableElementTypes'), require('@mui/material/utils'), require('react/jsx-runtime'), require('mobx'), require('mobx-state-tree'), require('@mui/material'), require('@mui/material/InputAdornment'), require('@mui/material/LinearProgress'), require('react'), require('@jbrowse/core/ui'), require('mobx-react'), require('tss-react/mui'), require('@jbrowse/core/util/types/mst'), require('@jbrowse/core/util/io'), require('@mui/material/Checkbox'), require('@mui/material/FormControlLabel'), require('@mui/x-data-grid'), require('@jbrowse/core/pluggableElementTypes/AdapterType'), require('@jbrowse/core/data_adapters/BaseAdapter'), require('@jbrowse/core/util/rxjs'), require('@jbrowse/core/util/tracks')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', '@jbrowse/core/Plugin', '@jbrowse/core/util', '@jbrowse/core/configuration', '@jbrowse/core/pluggableElementTypes', '@mui/material/utils', 'react/jsx-runtime', 'mobx', 'mobx-state-tree', '@mui/material', '@mui/material/InputAdornment', '@mui/material/LinearProgress', 'react', '@jbrowse/core/ui', 'mobx-react', 'tss-react/mui', '@jbrowse/core/util/types/mst', '@jbrowse/core/util/io', '@mui/material/Checkbox', '@mui/material/FormControlLabel', '@mui/x-data-grid', '@jbrowse/core/pluggableElementTypes/AdapterType', '@jbrowse/core/data_adapters/BaseAdapter', '@jbrowse/core/util/rxjs', '@jbrowse/core/util/tracks'], factory) :
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.JBrowsePluginApollo = {}, global.JBrowseExports["@jbrowse/core/Plugin"], global.JBrowseExports["@jbrowse/core/util"], global.JBrowseExports["@jbrowse/core/configuration"], global.JBrowseExports["@jbrowse/core/pluggableElementTypes"], global.JBrowseExports["@mui/material/utils"], global.JBrowseExports["react/jsx-runtime"], global.JBrowseExports.mobx, global.JBrowseExports["mobx-state-tree"], global.JBrowseExports["@mui/material"], global.JBrowseExports["@mui/material/InputAdornment"], global.JBrowseExports["@mui/material/LinearProgress"], global.JBrowseExports.react, global.JBrowseExports["@jbrowse/core/ui"], global.JBrowseExports["mobx-react"], global.JBrowseExports["tss-react/mui"], global.JBrowseExports["@jbrowse/core/util/types/mst"], global.JBrowseExports["@jbrowse/core/util/io"], global.JBrowseExports["@mui/material/Checkbox"], global.JBrowseExports["@mui/material/FormControlLabel"], global.JBrowseExports["@mui/x-data-grid"], global.JBrowseExports["@jbrowse/core/pluggableElementTypes/AdapterType"], global.JBrowseExports["@jbrowse/core/data_adapters/BaseAdapter"], global.JBrowseExports["@jbrowse/core/util/rxjs"], global.JBrowseExports["@jbrowse/core/util/tracks"]));
|
|
5
|
-
})(this, (function (exports, require$$1$
|
|
5
|
+
})(this, (function (exports, require$$1$1, require$$1$2, configuration, pluggableElementTypes, require$$0$2, require$$2$1, mobx, require$$1$3, material, InputAdornment, LinearProgress, React, ui, mobxReact, mui, mst, io, Checkbox, FormControlLabel, xDataGrid, AdapterType, BaseAdapter, rxjs, tracks) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
return n;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1$
|
|
28
|
-
var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$
|
|
29
|
-
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$
|
|
27
|
+
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
|
|
28
|
+
var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$2);
|
|
29
|
+
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
|
|
30
30
|
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2$1);
|
|
31
|
-
var require$$1__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$1$
|
|
31
|
+
var require$$1__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$1$3);
|
|
32
32
|
var InputAdornment__default = /*#__PURE__*/_interopDefaultLegacy(InputAdornment);
|
|
33
33
|
var LinearProgress__default = /*#__PURE__*/_interopDefaultLegacy(LinearProgress);
|
|
34
34
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
@@ -1419,7 +1419,7 @@
|
|
|
1419
1419
|
'default': tslib_es6
|
|
1420
1420
|
};
|
|
1421
1421
|
|
|
1422
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(tslib_es6$1);
|
|
1422
|
+
var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(tslib_es6$1);
|
|
1423
1423
|
|
|
1424
1424
|
var ApolloPlugin$4 = {};
|
|
1425
1425
|
|
|
@@ -1427,8 +1427,8 @@
|
|
|
1427
1427
|
value: true
|
|
1428
1428
|
});
|
|
1429
1429
|
ApolloPlugin$4.ApolloPlugin = void 0;
|
|
1430
|
-
var tslib_1$
|
|
1431
|
-
var Plugin_1$1 = /*#__PURE__*/tslib_1$
|
|
1430
|
+
var tslib_1$7 = require$$0$1;
|
|
1431
|
+
var Plugin_1$1 = /*#__PURE__*/tslib_1$7.__importDefault(require$$1__default["default"]);
|
|
1432
1432
|
var ApolloPlugin$3 = /*#__PURE__*/function (_Plugin_1$default) {
|
|
1433
1433
|
_inherits(ApolloPlugin, _Plugin_1$default);
|
|
1434
1434
|
var _super = /*#__PURE__*/_createSuper(ApolloPlugin);
|
|
@@ -3832,8 +3832,8 @@
|
|
|
3832
3832
|
});
|
|
3833
3833
|
FeatureChange$3.FeatureChange = void 0;
|
|
3834
3834
|
FeatureChange$3.isFeatureChange = isFeatureChange$1;
|
|
3835
|
-
var tslib_1$
|
|
3836
|
-
var bson_objectid_1$
|
|
3835
|
+
var tslib_1$6 = require$$0$1;
|
|
3836
|
+
var bson_objectid_1$3 = /*#__PURE__*/tslib_1$6.__importDefault(objectid);
|
|
3837
3837
|
var AssemblySpecificChange_1$1 = AssemblySpecificChange$3;
|
|
3838
3838
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3839
3839
|
function isFeatureChange$1(thing) {
|
|
@@ -3923,7 +3923,7 @@
|
|
|
3923
3923
|
}, {
|
|
3924
3924
|
key: "generateNewIds",
|
|
3925
3925
|
value: function generateNewIds(feature, featureIds) {
|
|
3926
|
-
var newId = new bson_objectid_1$
|
|
3926
|
+
var newId = new bson_objectid_1$3["default"]().toHexString();
|
|
3927
3927
|
featureIds.push(newId);
|
|
3928
3928
|
var children = {};
|
|
3929
3929
|
if (feature.children) {
|
|
@@ -4106,7 +4106,7 @@
|
|
|
4106
4106
|
Object.defineProperty(exports, "__esModule", {
|
|
4107
4107
|
value: true
|
|
4108
4108
|
});
|
|
4109
|
-
var tslib_1 = require$$0;
|
|
4109
|
+
var tslib_1 = require$$0$1;
|
|
4110
4110
|
tslib_1.__exportStar(ApolloPlugin$4, exports);
|
|
4111
4111
|
tslib_1.__exportStar(AssemblySpecificChange$3, exports);
|
|
4112
4112
|
tslib_1.__exportStar(Change$3, exports);
|
|
@@ -4135,8 +4135,8 @@
|
|
|
4135
4135
|
value: true
|
|
4136
4136
|
});
|
|
4137
4137
|
ApolloPlugin$2.ApolloPlugin = void 0;
|
|
4138
|
-
var tslib_1$
|
|
4139
|
-
var Plugin_1 = /*#__PURE__*/tslib_1$
|
|
4138
|
+
var tslib_1$5 = require$$0$1;
|
|
4139
|
+
var Plugin_1 = /*#__PURE__*/tslib_1$5.__importDefault(require$$1__default["default"]);
|
|
4140
4140
|
var ApolloPlugin$1 = /*#__PURE__*/function (_Plugin_1$default) {
|
|
4141
4141
|
_inherits(ApolloPlugin, _Plugin_1$default);
|
|
4142
4142
|
var _super = /*#__PURE__*/_createSuper(ApolloPlugin);
|
|
@@ -4404,8 +4404,8 @@
|
|
|
4404
4404
|
});
|
|
4405
4405
|
FeatureChange$1.FeatureChange = void 0;
|
|
4406
4406
|
FeatureChange$1.isFeatureChange = isFeatureChange;
|
|
4407
|
-
var tslib_1$
|
|
4408
|
-
var bson_objectid_1$
|
|
4407
|
+
var tslib_1$4 = require$$0$1;
|
|
4408
|
+
var bson_objectid_1$2 = /*#__PURE__*/tslib_1$4.__importDefault(objectid);
|
|
4409
4409
|
var AssemblySpecificChange_1 = AssemblySpecificChange$1;
|
|
4410
4410
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4411
4411
|
function isFeatureChange(thing) {
|
|
@@ -4495,7 +4495,7 @@
|
|
|
4495
4495
|
}, {
|
|
4496
4496
|
key: "generateNewIds",
|
|
4497
4497
|
value: function generateNewIds(feature, featureIds) {
|
|
4498
|
-
var newId = new bson_objectid_1$
|
|
4498
|
+
var newId = new bson_objectid_1$2["default"]().toHexString();
|
|
4499
4499
|
featureIds.push(newId);
|
|
4500
4500
|
var children = {};
|
|
4501
4501
|
if (feature.children) {
|
|
@@ -4678,7 +4678,7 @@
|
|
|
4678
4678
|
Object.defineProperty(exports, "__esModule", {
|
|
4679
4679
|
value: true
|
|
4680
4680
|
});
|
|
4681
|
-
var tslib_1 = require$$0;
|
|
4681
|
+
var tslib_1 = require$$0$1;
|
|
4682
4682
|
tslib_1.__exportStar(ApolloPlugin$2, exports);
|
|
4683
4683
|
tslib_1.__exportStar(AssemblySpecificChange$1, exports);
|
|
4684
4684
|
tslib_1.__exportStar(Change$1, exports);
|
|
@@ -4739,9 +4739,9 @@
|
|
|
4739
4739
|
value: true
|
|
4740
4740
|
});
|
|
4741
4741
|
gff3ToAnnotationFeature$1.gff3ToAnnotationFeature = gff3ToAnnotationFeature;
|
|
4742
|
-
var tslib_1$
|
|
4743
|
-
var util_1$
|
|
4744
|
-
var bson_objectid_1 = /*#__PURE__*/tslib_1$
|
|
4742
|
+
var tslib_1$3 = require$$0$1;
|
|
4743
|
+
var util_1$3 = require$$1__default$1["default"];
|
|
4744
|
+
var bson_objectid_1$1 = /*#__PURE__*/tslib_1$3.__importDefault(objectid);
|
|
4745
4745
|
var gffReservedKeys_1 = gffReservedKeys;
|
|
4746
4746
|
function gff3ToAnnotationFeature(gff3Feature, refSeq, featureIds) {
|
|
4747
4747
|
var _gff3Feature = _slicedToArray(gff3Feature, 1),
|
|
@@ -4770,7 +4770,7 @@
|
|
|
4770
4770
|
var convertedChildren = convertChildren(gff3Feature, refSeq, featureIds);
|
|
4771
4771
|
var convertedAttributes = convertFeatureAttributes(gff3Feature);
|
|
4772
4772
|
var feature = {
|
|
4773
|
-
_id: new bson_objectid_1["default"]().toHexString(),
|
|
4773
|
+
_id: new bson_objectid_1$1["default"]().toHexString(),
|
|
4774
4774
|
refSeq: refSeq !== null && refSeq !== void 0 ? refSeq : refName,
|
|
4775
4775
|
type: type,
|
|
4776
4776
|
min: min,
|
|
@@ -4849,13 +4849,12 @@
|
|
|
4849
4849
|
var _sources = _slicedToArray(sources, 1),
|
|
4850
4850
|
source = _sources[0];
|
|
4851
4851
|
if (sources.length > 1) {
|
|
4852
|
-
var sourceSet =
|
|
4852
|
+
var sourceSet = new Set(sources);
|
|
4853
4853
|
source = _toConsumableArray(sourceSet).join(',');
|
|
4854
4854
|
}
|
|
4855
4855
|
convertedAttributes.gff_source = [source];
|
|
4856
4856
|
}
|
|
4857
4857
|
if (attributesCollections.length > 0) {
|
|
4858
|
-
var newAttributes = {};
|
|
4859
4858
|
var _iterator = _createForOfIteratorHelper(attributesCollections),
|
|
4860
4859
|
_step;
|
|
4861
4860
|
try {
|
|
@@ -4869,9 +4868,9 @@
|
|
|
4869
4868
|
continue;
|
|
4870
4869
|
}
|
|
4871
4870
|
var newKey = (0, gffReservedKeys_1.isGFFReservedAttribute)(key) ? gffReservedKeys_1.gffToInternal[key] : key;
|
|
4872
|
-
var existingVal =
|
|
4871
|
+
var existingVal = convertedAttributes[newKey];
|
|
4873
4872
|
if (existingVal) {
|
|
4874
|
-
var valSet =
|
|
4873
|
+
var valSet = new Set([].concat(_toConsumableArray(existingVal), _toConsumableArray(val)));
|
|
4875
4874
|
convertedAttributes[newKey] = _toConsumableArray(valSet);
|
|
4876
4875
|
} else {
|
|
4877
4876
|
convertedAttributes[newKey] = val;
|
|
@@ -4911,7 +4910,7 @@
|
|
|
4911
4910
|
var childFeature = _step2.value;
|
|
4912
4911
|
var _childFeature = _slicedToArray(childFeature, 1),
|
|
4913
4912
|
firstChildFeatureLocation = _childFeature[0];
|
|
4914
|
-
if (firstChildFeatureLocation.type === 'three_prime_UTR' || firstChildFeatureLocation.type === 'five_prime_UTR') {
|
|
4913
|
+
if (firstChildFeatureLocation.type === 'three_prime_UTR' || firstChildFeatureLocation.type === 'five_prime_UTR' || firstChildFeatureLocation.type === 'intron' || firstChildFeatureLocation.type === 'start_codon' || firstChildFeatureLocation.type === 'stop_codon') {
|
|
4915
4914
|
continue;
|
|
4916
4915
|
}
|
|
4917
4916
|
if (firstChildFeatureLocation.type === 'CDS') {
|
|
@@ -4983,7 +4982,7 @@
|
|
|
4983
4982
|
return false;
|
|
4984
4983
|
}
|
|
4985
4984
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
4986
|
-
return (0, util_1$
|
|
4985
|
+
return (0, util_1$3.doesIntersect2)(loc.start, loc.end, nextLoc.start, nextLoc.end);
|
|
4987
4986
|
});
|
|
4988
4987
|
// If no overlaps, assume it's a single CDS feature
|
|
4989
4988
|
if (!overlapping) {
|
|
@@ -4998,23 +4997,25 @@
|
|
|
4998
4997
|
var _iterator4 = _createForOfIteratorHelper(cdsLocations),
|
|
4999
4998
|
_step4;
|
|
5000
4999
|
try {
|
|
5001
|
-
|
|
5000
|
+
var _loop = function _loop() {
|
|
5002
5001
|
var location = _step4.value;
|
|
5003
5002
|
var lastGroup = groupedLocations.at(-1);
|
|
5004
5003
|
if (!lastGroup) {
|
|
5005
5004
|
groupedLocations.push([location]);
|
|
5006
|
-
continue
|
|
5007
|
-
}
|
|
5008
|
-
var lastGroupLastLocation = lastGroup.at(-1);
|
|
5009
|
-
if (!lastGroupLastLocation) {
|
|
5010
|
-
throw new Error('Got group with no locations');
|
|
5005
|
+
return 1; // continue
|
|
5011
5006
|
}
|
|
5012
|
-
|
|
5013
|
-
|
|
5007
|
+
var overlaps = lastGroup.some(function (lastGroupLoc) {
|
|
5008
|
+
return (0, util_1$3.doesIntersect2)( /* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
5009
|
+
lastGroupLoc.start, lastGroupLoc.end, location.start, location.end);
|
|
5010
|
+
});
|
|
5011
|
+
if (overlaps) {
|
|
5014
5012
|
groupedLocations.push([location]);
|
|
5015
5013
|
} else {
|
|
5016
5014
|
lastGroup.push(location);
|
|
5017
5015
|
}
|
|
5016
|
+
};
|
|
5017
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
5018
|
+
if (_loop()) continue;
|
|
5018
5019
|
}
|
|
5019
5020
|
} catch (err) {
|
|
5020
5021
|
_iterator4.e(err);
|
|
@@ -5031,7 +5032,7 @@
|
|
|
5031
5032
|
Object.defineProperty(exports, "__esModule", {
|
|
5032
5033
|
value: true
|
|
5033
5034
|
});
|
|
5034
|
-
var tslib_1 = require$$0;
|
|
5035
|
+
var tslib_1 = require$$0$1;
|
|
5035
5036
|
tslib_1.__exportStar(gffReservedKeys, exports);
|
|
5036
5037
|
tslib_1.__exportStar(gff3ToAnnotationFeature$1, exports);
|
|
5037
5038
|
})(GFF3);
|
|
@@ -5517,12 +5518,12 @@
|
|
|
5517
5518
|
var _changes = _slicedToArray(changes, 1),
|
|
5518
5519
|
_changes$ = _changes[0],
|
|
5519
5520
|
assemblyName = _changes$.assemblyName,
|
|
5520
|
-
|
|
5521
|
+
fileIds = _changes$.fileIds;
|
|
5521
5522
|
return {
|
|
5522
5523
|
typeName: typeName,
|
|
5523
5524
|
assembly: assembly,
|
|
5524
5525
|
assemblyName: assemblyName,
|
|
5525
|
-
|
|
5526
|
+
fileIds: fileIds
|
|
5526
5527
|
};
|
|
5527
5528
|
}
|
|
5528
5529
|
return {
|
|
@@ -5540,61 +5541,73 @@
|
|
|
5540
5541
|
key: "executeOnServer",
|
|
5541
5542
|
value: function () {
|
|
5542
5543
|
var _executeOnServer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(backend) {
|
|
5543
|
-
var assemblyModel, fileModel, filesService, user, assembly, changes, logger, _iterator2, _step2, _logger$debug, _logger$debug2, _logger$debug3, _logger$debug4, change, assemblyName, fileId, FILE_UPLOAD_FOLDER, fileDoc, assemblyDoc, _yield$assemblyModel$, _yield$assemblyModel$2, newAssemblyDoc, featureStream, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, f, _logger$verbose, gff3Feature;
|
|
5544
|
+
var assemblyModel, checkModel, fileModel, filesService, user, assembly, changes, logger, _iterator2, _step2, _logger$debug, _logger$debug2, _logger$debug3, _logger$debug4, change, assemblyName, fileIds, fileId, FILE_UPLOAD_FOLDER, fileDoc, assemblyDoc, checkDocs, checks, _yield$assemblyModel$, _yield$assemblyModel$2, newAssemblyDoc, featureStream, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, f, _logger$verbose, gff3Feature;
|
|
5544
5545
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
5545
5546
|
while (1) switch (_context.prev = _context.next) {
|
|
5546
5547
|
case 0:
|
|
5547
|
-
assemblyModel = backend.assemblyModel, fileModel = backend.fileModel, filesService = backend.filesService, user = backend.user;
|
|
5548
|
+
assemblyModel = backend.assemblyModel, checkModel = backend.checkModel, fileModel = backend.fileModel, filesService = backend.filesService, user = backend.user;
|
|
5548
5549
|
assembly = this.assembly, changes = this.changes, logger = this.logger;
|
|
5549
5550
|
_iterator2 = _createForOfIteratorHelper(changes);
|
|
5550
5551
|
_context.prev = 3;
|
|
5551
5552
|
_iterator2.s();
|
|
5552
5553
|
case 5:
|
|
5553
5554
|
if ((_step2 = _iterator2.n()).done) {
|
|
5554
|
-
_context.next =
|
|
5555
|
+
_context.next = 71;
|
|
5555
5556
|
break;
|
|
5556
5557
|
}
|
|
5557
5558
|
change = _step2.value;
|
|
5558
|
-
assemblyName = change.assemblyName,
|
|
5559
|
+
assemblyName = change.assemblyName, fileIds = change.fileIds;
|
|
5560
|
+
fileId = fileIds.fa;
|
|
5559
5561
|
FILE_UPLOAD_FOLDER = process.env.FILE_UPLOAD_FOLDER;
|
|
5560
5562
|
if (FILE_UPLOAD_FOLDER) {
|
|
5561
|
-
_context.next =
|
|
5563
|
+
_context.next = 12;
|
|
5562
5564
|
break;
|
|
5563
5565
|
}
|
|
5564
5566
|
throw new Error('No FILE_UPLOAD_FOLDER found in .env file');
|
|
5565
|
-
case
|
|
5566
|
-
_context.next =
|
|
5567
|
+
case 12:
|
|
5568
|
+
_context.next = 14;
|
|
5567
5569
|
return fileModel.findById(fileId).exec();
|
|
5568
|
-
case
|
|
5570
|
+
case 14:
|
|
5569
5571
|
fileDoc = _context.sent;
|
|
5570
5572
|
if (fileDoc) {
|
|
5571
|
-
_context.next =
|
|
5573
|
+
_context.next = 17;
|
|
5572
5574
|
break;
|
|
5573
5575
|
}
|
|
5574
5576
|
throw new Error("File \"".concat(fileId, "\" not found in Mongo"));
|
|
5575
|
-
case
|
|
5577
|
+
case 17:
|
|
5576
5578
|
(_logger$debug = logger.debug) === null || _logger$debug === void 0 || _logger$debug.call(logger, "FileId \"".concat(fileId, "\", checksum \"").concat(fileDoc.checksum, "\""));
|
|
5577
5579
|
// Check and add new assembly
|
|
5578
|
-
_context.next =
|
|
5580
|
+
_context.next = 20;
|
|
5579
5581
|
return assemblyModel.findOne({
|
|
5580
5582
|
name: assemblyName
|
|
5581
5583
|
}).exec();
|
|
5582
|
-
case
|
|
5584
|
+
case 20:
|
|
5583
5585
|
assemblyDoc = _context.sent;
|
|
5584
5586
|
if (!assemblyDoc) {
|
|
5585
|
-
_context.next =
|
|
5587
|
+
_context.next = 23;
|
|
5586
5588
|
break;
|
|
5587
5589
|
}
|
|
5588
5590
|
throw new Error("Assembly \"".concat(assemblyName, "\" already exists"));
|
|
5589
|
-
case
|
|
5590
|
-
_context.next =
|
|
5591
|
+
case 23:
|
|
5592
|
+
_context.next = 25;
|
|
5593
|
+
return checkModel.find({
|
|
5594
|
+
"default": true
|
|
5595
|
+
}).exec();
|
|
5596
|
+
case 25:
|
|
5597
|
+
checkDocs = _context.sent;
|
|
5598
|
+
checks = checkDocs.map(function (checkDoc) {
|
|
5599
|
+
return checkDoc._id.toHexString();
|
|
5600
|
+
}); // Add assembly
|
|
5601
|
+
_context.next = 29;
|
|
5591
5602
|
return assemblyModel.create([{
|
|
5592
5603
|
_id: assembly,
|
|
5593
5604
|
name: assemblyName,
|
|
5594
5605
|
user: user,
|
|
5595
|
-
status: -1
|
|
5606
|
+
status: -1,
|
|
5607
|
+
fileId: fileId,
|
|
5608
|
+
checks: checks
|
|
5596
5609
|
}]);
|
|
5597
|
-
case
|
|
5610
|
+
case 29:
|
|
5598
5611
|
_yield$assemblyModel$ = _context.sent;
|
|
5599
5612
|
_yield$assemblyModel$2 = _slicedToArray(_yield$assemblyModel$, 1);
|
|
5600
5613
|
newAssemblyDoc = _yield$assemblyModel$2[0];
|
|
@@ -5602,81 +5615,81 @@
|
|
|
5602
5615
|
(_logger$debug3 = logger.debug) === null || _logger$debug3 === void 0 || _logger$debug3.call(logger, "File type: \"".concat(fileDoc.type, "\""));
|
|
5603
5616
|
// Add refSeqs
|
|
5604
5617
|
// We cannot use Mongo 'session' / transaction here because Mongo has 16 MB limit for transaction
|
|
5605
|
-
_context.next =
|
|
5618
|
+
_context.next = 36;
|
|
5606
5619
|
return this.addRefSeqIntoDb(fileDoc, newAssemblyDoc._id.toString(), backend);
|
|
5607
|
-
case
|
|
5620
|
+
case 36:
|
|
5608
5621
|
// Loop all features
|
|
5609
5622
|
(_logger$debug4 = logger.debug) === null || _logger$debug4 === void 0 || _logger$debug4.call(logger, "**************** LOOPATAAN KAIKKI FEATURET SEURAAVAKSI File type: \"".concat(fileDoc.type, "\""));
|
|
5610
5623
|
featureStream = filesService.parseGFF3(filesService.getFileStream(fileDoc));
|
|
5611
5624
|
_iteratorAbruptCompletion = false;
|
|
5612
5625
|
_didIteratorError = false;
|
|
5613
|
-
_context.prev =
|
|
5626
|
+
_context.prev = 40;
|
|
5614
5627
|
_iterator = _asyncIterator(featureStream);
|
|
5615
|
-
case
|
|
5616
|
-
_context.next =
|
|
5628
|
+
case 42:
|
|
5629
|
+
_context.next = 44;
|
|
5617
5630
|
return _iterator.next();
|
|
5618
|
-
case
|
|
5631
|
+
case 44:
|
|
5619
5632
|
if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
|
|
5620
|
-
_context.next =
|
|
5633
|
+
_context.next = 53;
|
|
5621
5634
|
break;
|
|
5622
5635
|
}
|
|
5623
5636
|
f = _step.value;
|
|
5624
5637
|
gff3Feature = f;
|
|
5625
5638
|
(_logger$verbose = logger.verbose) === null || _logger$verbose === void 0 || _logger$verbose.call(logger, "ENTRY=".concat(JSON.stringify(gff3Feature)));
|
|
5626
5639
|
// Add new feature into database
|
|
5627
|
-
_context.next =
|
|
5640
|
+
_context.next = 50;
|
|
5628
5641
|
return this.addFeatureIntoDb(gff3Feature, backend);
|
|
5629
|
-
case
|
|
5642
|
+
case 50:
|
|
5630
5643
|
_iteratorAbruptCompletion = false;
|
|
5631
|
-
_context.next =
|
|
5644
|
+
_context.next = 42;
|
|
5632
5645
|
break;
|
|
5633
|
-
case
|
|
5634
|
-
_context.next =
|
|
5646
|
+
case 53:
|
|
5647
|
+
_context.next = 59;
|
|
5635
5648
|
break;
|
|
5636
|
-
case
|
|
5637
|
-
_context.prev =
|
|
5638
|
-
_context.t0 = _context["catch"](
|
|
5649
|
+
case 55:
|
|
5650
|
+
_context.prev = 55;
|
|
5651
|
+
_context.t0 = _context["catch"](40);
|
|
5639
5652
|
_didIteratorError = true;
|
|
5640
5653
|
_iteratorError = _context.t0;
|
|
5641
|
-
case
|
|
5642
|
-
_context.prev =
|
|
5643
|
-
_context.prev =
|
|
5654
|
+
case 59:
|
|
5655
|
+
_context.prev = 59;
|
|
5656
|
+
_context.prev = 60;
|
|
5644
5657
|
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
|
|
5645
|
-
_context.next =
|
|
5658
|
+
_context.next = 64;
|
|
5646
5659
|
break;
|
|
5647
5660
|
}
|
|
5648
|
-
_context.next =
|
|
5661
|
+
_context.next = 64;
|
|
5649
5662
|
return _iterator["return"]();
|
|
5650
|
-
case
|
|
5651
|
-
_context.prev =
|
|
5663
|
+
case 64:
|
|
5664
|
+
_context.prev = 64;
|
|
5652
5665
|
if (!_didIteratorError) {
|
|
5653
|
-
_context.next =
|
|
5666
|
+
_context.next = 67;
|
|
5654
5667
|
break;
|
|
5655
5668
|
}
|
|
5656
5669
|
throw _iteratorError;
|
|
5657
|
-
case
|
|
5670
|
+
case 67:
|
|
5671
|
+
return _context.finish(64);
|
|
5672
|
+
case 68:
|
|
5658
5673
|
return _context.finish(59);
|
|
5659
|
-
case
|
|
5660
|
-
return _context.finish(54);
|
|
5661
|
-
case 64:
|
|
5674
|
+
case 69:
|
|
5662
5675
|
_context.next = 5;
|
|
5663
5676
|
break;
|
|
5664
|
-
case
|
|
5665
|
-
_context.next =
|
|
5677
|
+
case 71:
|
|
5678
|
+
_context.next = 76;
|
|
5666
5679
|
break;
|
|
5667
|
-
case
|
|
5668
|
-
_context.prev =
|
|
5680
|
+
case 73:
|
|
5681
|
+
_context.prev = 73;
|
|
5669
5682
|
_context.t1 = _context["catch"](3);
|
|
5670
5683
|
_iterator2.e(_context.t1);
|
|
5671
|
-
case
|
|
5672
|
-
_context.prev =
|
|
5684
|
+
case 76:
|
|
5685
|
+
_context.prev = 76;
|
|
5673
5686
|
_iterator2.f();
|
|
5674
|
-
return _context.finish(
|
|
5675
|
-
case
|
|
5687
|
+
return _context.finish(76);
|
|
5688
|
+
case 79:
|
|
5676
5689
|
case "end":
|
|
5677
5690
|
return _context.stop();
|
|
5678
5691
|
}
|
|
5679
|
-
}, _callee, this, [[3,
|
|
5692
|
+
}, _callee, this, [[3, 73, 76, 79], [40, 55, 59, 69], [60,, 64, 68]]);
|
|
5680
5693
|
}));
|
|
5681
5694
|
function executeOnServer(_x) {
|
|
5682
5695
|
return _executeOnServer.apply(this, arguments);
|
|
@@ -15164,7 +15177,7 @@
|
|
|
15164
15177
|
BgzipIndexedFasta: BgzipIndexedFasta
|
|
15165
15178
|
};
|
|
15166
15179
|
|
|
15167
|
-
var require$$
|
|
15180
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(esm);
|
|
15168
15181
|
|
|
15169
15182
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(esm$1);
|
|
15170
15183
|
|
|
@@ -15176,7 +15189,7 @@
|
|
|
15176
15189
|
AddAssemblyFromExternalChange$1.AddAssemblyFromExternalChange = void 0;
|
|
15177
15190
|
/* eslint-disable @typescript-eslint/require-await */
|
|
15178
15191
|
var common_1$f = dist$1;
|
|
15179
|
-
var indexedfasta_1 = require$$
|
|
15192
|
+
var indexedfasta_1$1 = require$$0;
|
|
15180
15193
|
var generic_filehandle_1 = require$$2;
|
|
15181
15194
|
var AddAssemblyFromExternalChange = /*#__PURE__*/function (_common_1$AssemblySpe) {
|
|
15182
15195
|
_inherits(AddAssemblyFromExternalChange, _common_1$AssemblySpe);
|
|
@@ -15228,11 +15241,11 @@
|
|
|
15228
15241
|
key: "executeOnServer",
|
|
15229
15242
|
value: function () {
|
|
15230
15243
|
var _executeOnServer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(backend) {
|
|
15231
|
-
var assemblyModel, refSeqModel, user, assembly, changes, logger, CHUNK_SIZE, customChunkSize, _iterator, _step, _logger$debug, change, assemblyName, externalLocation, fa, fai, gzi, sequenceAdapter, allSequenceSizes, assemblyDoc, _yield$assemblyModel$, _yield$assemblyModel$2, newAssemblyDoc, sequenceName, _logger$debug2, _yield$refSeqModel$cr, _yield$refSeqModel$cr2, newRefSeqDoc;
|
|
15244
|
+
var assemblyModel, checkModel, refSeqModel, user, assembly, changes, logger, CHUNK_SIZE, customChunkSize, _iterator, _step, _logger$debug, change, assemblyName, externalLocation, fa, fai, gzi, sequenceAdapter, allSequenceSizes, assemblyDoc, checkDocs, checks, _yield$assemblyModel$, _yield$assemblyModel$2, newAssemblyDoc, sequenceName, _logger$debug2, _yield$refSeqModel$cr, _yield$refSeqModel$cr2, newRefSeqDoc;
|
|
15232
15245
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15233
15246
|
while (1) switch (_context.prev = _context.next) {
|
|
15234
15247
|
case 0:
|
|
15235
|
-
assemblyModel = backend.assemblyModel, refSeqModel = backend.refSeqModel, user = backend.user;
|
|
15248
|
+
assemblyModel = backend.assemblyModel, checkModel = backend.checkModel, refSeqModel = backend.refSeqModel, user = backend.user;
|
|
15236
15249
|
assembly = this.assembly, changes = this.changes, logger = this.logger;
|
|
15237
15250
|
CHUNK_SIZE = process.env.CHUNK_SIZE;
|
|
15238
15251
|
customChunkSize = CHUNK_SIZE && Number(CHUNK_SIZE);
|
|
@@ -15241,13 +15254,13 @@
|
|
|
15241
15254
|
_iterator.s();
|
|
15242
15255
|
case 7:
|
|
15243
15256
|
if ((_step = _iterator.n()).done) {
|
|
15244
|
-
_context.next =
|
|
15257
|
+
_context.next = 45;
|
|
15245
15258
|
break;
|
|
15246
15259
|
}
|
|
15247
15260
|
change = _step.value;
|
|
15248
15261
|
assemblyName = change.assemblyName, externalLocation = change.externalLocation;
|
|
15249
15262
|
fa = externalLocation.fa, fai = externalLocation.fai, gzi = externalLocation.gzi;
|
|
15250
|
-
sequenceAdapter = gzi ? new indexedfasta_1.BgzipIndexedFasta({
|
|
15263
|
+
sequenceAdapter = gzi ? new indexedfasta_1$1.BgzipIndexedFasta({
|
|
15251
15264
|
fasta: new generic_filehandle_1.RemoteFile(fa, {
|
|
15252
15265
|
fetch: fetch
|
|
15253
15266
|
}),
|
|
@@ -15257,7 +15270,7 @@
|
|
|
15257
15270
|
gzi: new generic_filehandle_1.RemoteFile(gzi, {
|
|
15258
15271
|
fetch: fetch
|
|
15259
15272
|
})
|
|
15260
|
-
}) : new indexedfasta_1.IndexedFasta({
|
|
15273
|
+
}) : new indexedfasta_1$1.IndexedFasta({
|
|
15261
15274
|
fasta: new generic_filehandle_1.RemoteFile(fa, {
|
|
15262
15275
|
fetch: fetch
|
|
15263
15276
|
}),
|
|
@@ -15288,26 +15301,36 @@
|
|
|
15288
15301
|
throw new Error("Assembly \"".concat(assemblyName, "\" already exists"));
|
|
15289
15302
|
case 22:
|
|
15290
15303
|
_context.next = 24;
|
|
15304
|
+
return checkModel.find({
|
|
15305
|
+
"default": true
|
|
15306
|
+
}).exec();
|
|
15307
|
+
case 24:
|
|
15308
|
+
checkDocs = _context.sent;
|
|
15309
|
+
checks = checkDocs.map(function (checkDoc) {
|
|
15310
|
+
return checkDoc._id.toHexString();
|
|
15311
|
+
});
|
|
15312
|
+
_context.next = 28;
|
|
15291
15313
|
return assemblyModel.create([{
|
|
15292
15314
|
_id: assembly,
|
|
15293
15315
|
name: assemblyName,
|
|
15294
15316
|
user: user,
|
|
15295
15317
|
status: -1,
|
|
15296
|
-
externalLocation: externalLocation
|
|
15318
|
+
externalLocation: externalLocation,
|
|
15319
|
+
checks: checks
|
|
15297
15320
|
}]);
|
|
15298
|
-
case
|
|
15321
|
+
case 28:
|
|
15299
15322
|
_yield$assemblyModel$ = _context.sent;
|
|
15300
15323
|
_yield$assemblyModel$2 = _slicedToArray(_yield$assemblyModel$, 1);
|
|
15301
15324
|
newAssemblyDoc = _yield$assemblyModel$2[0];
|
|
15302
15325
|
(_logger$debug = logger.debug) === null || _logger$debug === void 0 || _logger$debug.call(logger, "Added new assembly \"".concat(assemblyName, "\", docId \"").concat(newAssemblyDoc._id, "\""));
|
|
15303
15326
|
_context.t0 = _regeneratorRuntime().keys(allSequenceSizes);
|
|
15304
|
-
case
|
|
15327
|
+
case 33:
|
|
15305
15328
|
if ((_context.t1 = _context.t0()).done) {
|
|
15306
|
-
_context.next =
|
|
15329
|
+
_context.next = 43;
|
|
15307
15330
|
break;
|
|
15308
15331
|
}
|
|
15309
15332
|
sequenceName = _context.t1.value;
|
|
15310
|
-
_context.next =
|
|
15333
|
+
_context.next = 37;
|
|
15311
15334
|
return refSeqModel.create([_objectSpread2(_objectSpread2({
|
|
15312
15335
|
name: sequenceName,
|
|
15313
15336
|
assembly: newAssemblyDoc._id,
|
|
@@ -15318,32 +15341,32 @@
|
|
|
15318
15341
|
user: user,
|
|
15319
15342
|
status: -1
|
|
15320
15343
|
})]);
|
|
15321
|
-
case
|
|
15344
|
+
case 37:
|
|
15322
15345
|
_yield$refSeqModel$cr = _context.sent;
|
|
15323
15346
|
_yield$refSeqModel$cr2 = _slicedToArray(_yield$refSeqModel$cr, 1);
|
|
15324
15347
|
newRefSeqDoc = _yield$refSeqModel$cr2[0];
|
|
15325
15348
|
(_logger$debug2 = logger.debug) === null || _logger$debug2 === void 0 || _logger$debug2.call(logger, "Added new refSeq \"".concat(sequenceName, "\", docId \"").concat(newRefSeqDoc._id, "\""));
|
|
15326
|
-
_context.next =
|
|
15349
|
+
_context.next = 33;
|
|
15327
15350
|
break;
|
|
15328
|
-
case
|
|
15351
|
+
case 43:
|
|
15329
15352
|
_context.next = 7;
|
|
15330
15353
|
break;
|
|
15331
|
-
case
|
|
15332
|
-
_context.next =
|
|
15354
|
+
case 45:
|
|
15355
|
+
_context.next = 50;
|
|
15333
15356
|
break;
|
|
15334
|
-
case
|
|
15335
|
-
_context.prev =
|
|
15357
|
+
case 47:
|
|
15358
|
+
_context.prev = 47;
|
|
15336
15359
|
_context.t2 = _context["catch"](5);
|
|
15337
15360
|
_iterator.e(_context.t2);
|
|
15338
|
-
case
|
|
15339
|
-
_context.prev =
|
|
15361
|
+
case 50:
|
|
15362
|
+
_context.prev = 50;
|
|
15340
15363
|
_iterator.f();
|
|
15341
|
-
return _context.finish(
|
|
15342
|
-
case
|
|
15364
|
+
return _context.finish(50);
|
|
15365
|
+
case 53:
|
|
15343
15366
|
case "end":
|
|
15344
15367
|
return _context.stop();
|
|
15345
15368
|
}
|
|
15346
|
-
}, _callee, this, [[5,
|
|
15369
|
+
}, _callee, this, [[5, 47, 50, 53]]);
|
|
15347
15370
|
}));
|
|
15348
15371
|
function executeOnServer(_x) {
|
|
15349
15372
|
return _executeOnServer.apply(this, arguments);
|
|
@@ -15412,6 +15435,7 @@
|
|
|
15412
15435
|
value: true
|
|
15413
15436
|
});
|
|
15414
15437
|
AddAssemblyFromFileChange$1.AddAssemblyFromFileChange = void 0;
|
|
15438
|
+
var indexedfasta_1 = require$$0;
|
|
15415
15439
|
var FromFileBaseChange_1$1 = FromFileBaseChange$1;
|
|
15416
15440
|
var AddAssemblyFromFileChange = /*#__PURE__*/function (_FromFileBaseChange_) {
|
|
15417
15441
|
_inherits(AddAssemblyFromFileChange, _FromFileBaseChange_);
|
|
@@ -15440,12 +15464,12 @@
|
|
|
15440
15464
|
var _changes = _slicedToArray(changes, 1),
|
|
15441
15465
|
_changes$ = _changes[0],
|
|
15442
15466
|
assemblyName = _changes$.assemblyName,
|
|
15443
|
-
|
|
15467
|
+
fileIds = _changes$.fileIds;
|
|
15444
15468
|
return {
|
|
15445
15469
|
typeName: typeName,
|
|
15446
15470
|
assembly: assembly,
|
|
15447
15471
|
assemblyName: assemblyName,
|
|
15448
|
-
|
|
15472
|
+
fileIds: fileIds
|
|
15449
15473
|
};
|
|
15450
15474
|
}
|
|
15451
15475
|
return {
|
|
@@ -15463,110 +15487,271 @@
|
|
|
15463
15487
|
key: "executeOnServer",
|
|
15464
15488
|
value: function () {
|
|
15465
15489
|
var _executeOnServer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(backend) {
|
|
15466
|
-
var
|
|
15490
|
+
var changes, _iterator, _step, change, assemblyName, fileIds;
|
|
15467
15491
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15468
15492
|
while (1) switch (_context.prev = _context.next) {
|
|
15469
15493
|
case 0:
|
|
15470
|
-
|
|
15471
|
-
assembly = this.assembly, changes = this.changes, logger = this.logger;
|
|
15494
|
+
changes = this.changes;
|
|
15472
15495
|
_iterator = _createForOfIteratorHelper(changes);
|
|
15473
|
-
_context.prev =
|
|
15496
|
+
_context.prev = 2;
|
|
15474
15497
|
_iterator.s();
|
|
15475
|
-
case
|
|
15498
|
+
case 4:
|
|
15476
15499
|
if ((_step = _iterator.n()).done) {
|
|
15477
|
-
_context.next =
|
|
15500
|
+
_context.next = 11;
|
|
15478
15501
|
break;
|
|
15479
15502
|
}
|
|
15480
15503
|
change = _step.value;
|
|
15481
|
-
assemblyName = change.assemblyName,
|
|
15504
|
+
assemblyName = change.assemblyName, fileIds = change.fileIds;
|
|
15505
|
+
_context.next = 9;
|
|
15506
|
+
return 'gzi' in fileIds ? this.executeOnServerIndexed(backend, assemblyName, fileIds) : this.executeOnServerFasta(backend, assemblyName, fileIds.fa);
|
|
15507
|
+
case 9:
|
|
15508
|
+
_context.next = 4;
|
|
15509
|
+
break;
|
|
15510
|
+
case 11:
|
|
15511
|
+
_context.next = 16;
|
|
15512
|
+
break;
|
|
15513
|
+
case 13:
|
|
15514
|
+
_context.prev = 13;
|
|
15515
|
+
_context.t0 = _context["catch"](2);
|
|
15516
|
+
_iterator.e(_context.t0);
|
|
15517
|
+
case 16:
|
|
15518
|
+
_context.prev = 16;
|
|
15519
|
+
_iterator.f();
|
|
15520
|
+
return _context.finish(16);
|
|
15521
|
+
case 19:
|
|
15522
|
+
case "end":
|
|
15523
|
+
return _context.stop();
|
|
15524
|
+
}
|
|
15525
|
+
}, _callee, this, [[2, 13, 16, 19]]);
|
|
15526
|
+
}));
|
|
15527
|
+
function executeOnServer(_x) {
|
|
15528
|
+
return _executeOnServer.apply(this, arguments);
|
|
15529
|
+
}
|
|
15530
|
+
return executeOnServer;
|
|
15531
|
+
}()
|
|
15532
|
+
}, {
|
|
15533
|
+
key: "executeOnServerIndexed",
|
|
15534
|
+
value: function () {
|
|
15535
|
+
var _executeOnServerIndexed = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(backend, assemblyName, fileIds) {
|
|
15536
|
+
var _this$logger$debug, _this$logger;
|
|
15537
|
+
var CHUNK_SIZE, customChunkSize, FILE_UPLOAD_FOLDER, fa, fai, gzi, assemblyModel, checkModel, fileModel, filesService, refSeqModel, user, faDoc, faChecksum, faiDoc, faiChecksum, gziDoc, gziChecksum, sequenceAdapter, allSequenceSizes, assemblyDoc, checkDocs, checks, _yield$assemblyModel$, _yield$assemblyModel$2, newAssemblyDoc, sequenceName, _this$logger$debug2, _this$logger2, _yield$refSeqModel$cr, _yield$refSeqModel$cr2, newRefSeqDoc;
|
|
15538
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
15539
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
15540
|
+
case 0:
|
|
15541
|
+
CHUNK_SIZE = process.env.CHUNK_SIZE;
|
|
15542
|
+
customChunkSize = CHUNK_SIZE && Number(CHUNK_SIZE);
|
|
15482
15543
|
FILE_UPLOAD_FOLDER = process.env.FILE_UPLOAD_FOLDER;
|
|
15483
15544
|
if (FILE_UPLOAD_FOLDER) {
|
|
15484
|
-
|
|
15545
|
+
_context2.next = 5;
|
|
15485
15546
|
break;
|
|
15486
15547
|
}
|
|
15487
15548
|
throw new Error('No FILE_UPLOAD_FOLDER found in .env file');
|
|
15488
|
-
case
|
|
15489
|
-
|
|
15490
|
-
|
|
15549
|
+
case 5:
|
|
15550
|
+
fa = fileIds.fa, fai = fileIds.fai, gzi = fileIds.gzi;
|
|
15551
|
+
assemblyModel = backend.assemblyModel, checkModel = backend.checkModel, fileModel = backend.fileModel, filesService = backend.filesService, refSeqModel = backend.refSeqModel, user = backend.user;
|
|
15552
|
+
_context2.next = 9;
|
|
15553
|
+
return fileModel.findById(fa);
|
|
15554
|
+
case 9:
|
|
15555
|
+
faDoc = _context2.sent;
|
|
15556
|
+
faChecksum = faDoc === null || faDoc === void 0 ? void 0 : faDoc.checksum;
|
|
15557
|
+
if (faChecksum) {
|
|
15558
|
+
_context2.next = 13;
|
|
15559
|
+
break;
|
|
15560
|
+
}
|
|
15561
|
+
throw new Error("No checksum for file document ".concat(faDoc));
|
|
15491
15562
|
case 13:
|
|
15492
|
-
|
|
15563
|
+
_context2.next = 15;
|
|
15564
|
+
return fileModel.findById(fai);
|
|
15565
|
+
case 15:
|
|
15566
|
+
faiDoc = _context2.sent;
|
|
15567
|
+
faiChecksum = faiDoc === null || faiDoc === void 0 ? void 0 : faiDoc.checksum;
|
|
15568
|
+
if (faiChecksum) {
|
|
15569
|
+
_context2.next = 19;
|
|
15570
|
+
break;
|
|
15571
|
+
}
|
|
15572
|
+
throw new Error("No checksum for file document ".concat(faiDoc));
|
|
15573
|
+
case 19:
|
|
15574
|
+
_context2.next = 21;
|
|
15575
|
+
return fileModel.findById(gzi);
|
|
15576
|
+
case 21:
|
|
15577
|
+
gziDoc = _context2.sent;
|
|
15578
|
+
gziChecksum = gziDoc === null || gziDoc === void 0 ? void 0 : gziDoc.checksum;
|
|
15579
|
+
if (gziChecksum) {
|
|
15580
|
+
_context2.next = 25;
|
|
15581
|
+
break;
|
|
15582
|
+
}
|
|
15583
|
+
throw new Error("No checksum for file document ".concat(gziDoc));
|
|
15584
|
+
case 25:
|
|
15585
|
+
sequenceAdapter = new indexedfasta_1.BgzipIndexedFasta({
|
|
15586
|
+
fasta: filesService.getFileHandle(faDoc),
|
|
15587
|
+
fai: filesService.getFileHandle(faiDoc),
|
|
15588
|
+
gzi: filesService.getFileHandle(gziDoc)
|
|
15589
|
+
});
|
|
15590
|
+
_context2.next = 28;
|
|
15591
|
+
return sequenceAdapter.getSequenceSizes();
|
|
15592
|
+
case 28:
|
|
15593
|
+
allSequenceSizes = _context2.sent;
|
|
15594
|
+
_context2.next = 31;
|
|
15595
|
+
return assemblyModel.findOne({
|
|
15596
|
+
name: assemblyName
|
|
15597
|
+
}).exec();
|
|
15598
|
+
case 31:
|
|
15599
|
+
assemblyDoc = _context2.sent;
|
|
15600
|
+
if (!assemblyDoc) {
|
|
15601
|
+
_context2.next = 34;
|
|
15602
|
+
break;
|
|
15603
|
+
}
|
|
15604
|
+
throw new Error("Assembly \"".concat(assemblyName, "\" already exists"));
|
|
15605
|
+
case 34:
|
|
15606
|
+
_context2.next = 36;
|
|
15607
|
+
return checkModel.find({
|
|
15608
|
+
"default": true
|
|
15609
|
+
}).exec();
|
|
15610
|
+
case 36:
|
|
15611
|
+
checkDocs = _context2.sent;
|
|
15612
|
+
checks = checkDocs.map(function (checkDoc) {
|
|
15613
|
+
return checkDoc._id.toHexString();
|
|
15614
|
+
});
|
|
15615
|
+
_context2.next = 40;
|
|
15616
|
+
return assemblyModel.create([{
|
|
15617
|
+
_id: this.assembly,
|
|
15618
|
+
name: assemblyName,
|
|
15619
|
+
user: user,
|
|
15620
|
+
status: -1,
|
|
15621
|
+
fileIds: fileIds,
|
|
15622
|
+
checks: checks
|
|
15623
|
+
}]);
|
|
15624
|
+
case 40:
|
|
15625
|
+
_yield$assemblyModel$ = _context2.sent;
|
|
15626
|
+
_yield$assemblyModel$2 = _slicedToArray(_yield$assemblyModel$, 1);
|
|
15627
|
+
newAssemblyDoc = _yield$assemblyModel$2[0];
|
|
15628
|
+
(_this$logger$debug = (_this$logger = this.logger).debug) === null || _this$logger$debug === void 0 || _this$logger$debug.call(_this$logger, "Added new assembly \"".concat(assemblyName, "\", docId \"").concat(newAssemblyDoc._id, "\""));
|
|
15629
|
+
_context2.t0 = _regeneratorRuntime().keys(allSequenceSizes);
|
|
15630
|
+
case 45:
|
|
15631
|
+
if ((_context2.t1 = _context2.t0()).done) {
|
|
15632
|
+
_context2.next = 55;
|
|
15633
|
+
break;
|
|
15634
|
+
}
|
|
15635
|
+
sequenceName = _context2.t1.value;
|
|
15636
|
+
_context2.next = 49;
|
|
15637
|
+
return refSeqModel.create([_objectSpread2(_objectSpread2({
|
|
15638
|
+
name: sequenceName,
|
|
15639
|
+
assembly: newAssemblyDoc._id,
|
|
15640
|
+
length: allSequenceSizes[sequenceName]
|
|
15641
|
+
}, customChunkSize ? {
|
|
15642
|
+
chunkSize: customChunkSize
|
|
15643
|
+
} : null), {}, {
|
|
15644
|
+
user: user,
|
|
15645
|
+
status: -1
|
|
15646
|
+
})]);
|
|
15647
|
+
case 49:
|
|
15648
|
+
_yield$refSeqModel$cr = _context2.sent;
|
|
15649
|
+
_yield$refSeqModel$cr2 = _slicedToArray(_yield$refSeqModel$cr, 1);
|
|
15650
|
+
newRefSeqDoc = _yield$refSeqModel$cr2[0];
|
|
15651
|
+
(_this$logger$debug2 = (_this$logger2 = this.logger).debug) === null || _this$logger$debug2 === void 0 || _this$logger$debug2.call(_this$logger2, "Added new refSeq \"".concat(sequenceName, "\", docId \"").concat(newRefSeqDoc._id, "\""));
|
|
15652
|
+
_context2.next = 45;
|
|
15653
|
+
break;
|
|
15654
|
+
case 55:
|
|
15655
|
+
case "end":
|
|
15656
|
+
return _context2.stop();
|
|
15657
|
+
}
|
|
15658
|
+
}, _callee2, this);
|
|
15659
|
+
}));
|
|
15660
|
+
function executeOnServerIndexed(_x2, _x3, _x4) {
|
|
15661
|
+
return _executeOnServerIndexed.apply(this, arguments);
|
|
15662
|
+
}
|
|
15663
|
+
return executeOnServerIndexed;
|
|
15664
|
+
}()
|
|
15665
|
+
}, {
|
|
15666
|
+
key: "executeOnServerFasta",
|
|
15667
|
+
value: function () {
|
|
15668
|
+
var _executeOnServerFasta = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(backend, assemblyName, fileId) {
|
|
15669
|
+
var _this$logger$debug3, _this$logger3, _this$logger$debug4, _this$logger4, _this$logger$debug5, _this$logger5;
|
|
15670
|
+
var assemblyModel, checkModel, fileModel, user, fileDoc, assemblyDoc, checkDocs, checks, _yield$assemblyModel$3, _yield$assemblyModel$4, newAssemblyDoc;
|
|
15671
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
15672
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
15673
|
+
case 0:
|
|
15674
|
+
assemblyModel = backend.assemblyModel, checkModel = backend.checkModel, fileModel = backend.fileModel, user = backend.user; // Get file checksum
|
|
15675
|
+
_context3.next = 3;
|
|
15676
|
+
return fileModel.findById(fileId).exec();
|
|
15677
|
+
case 3:
|
|
15678
|
+
fileDoc = _context3.sent;
|
|
15493
15679
|
if (fileDoc) {
|
|
15494
|
-
|
|
15680
|
+
_context3.next = 6;
|
|
15495
15681
|
break;
|
|
15496
15682
|
}
|
|
15497
15683
|
throw new Error("File \"".concat(fileId, "\" not found in Mongo"));
|
|
15498
|
-
case
|
|
15499
|
-
(
|
|
15684
|
+
case 6:
|
|
15685
|
+
(_this$logger$debug3 = (_this$logger3 = this.logger).debug) === null || _this$logger$debug3 === void 0 || _this$logger$debug3.call(_this$logger3, "FileId \"".concat(fileId, "\", checksum \"").concat(fileDoc.checksum, "\""));
|
|
15500
15686
|
// Check and add new assembly
|
|
15501
|
-
|
|
15687
|
+
_context3.next = 9;
|
|
15502
15688
|
return assemblyModel.findOne({
|
|
15503
15689
|
name: assemblyName
|
|
15504
15690
|
}).exec();
|
|
15505
|
-
case
|
|
15506
|
-
assemblyDoc =
|
|
15691
|
+
case 9:
|
|
15692
|
+
assemblyDoc = _context3.sent;
|
|
15507
15693
|
if (!assemblyDoc) {
|
|
15508
|
-
|
|
15694
|
+
_context3.next = 12;
|
|
15509
15695
|
break;
|
|
15510
15696
|
}
|
|
15511
15697
|
throw new Error("Assembly \"".concat(assemblyName, "\" already exists"));
|
|
15512
|
-
case
|
|
15513
|
-
|
|
15698
|
+
case 12:
|
|
15699
|
+
_context3.next = 14;
|
|
15700
|
+
return checkModel.find({
|
|
15701
|
+
"default": true
|
|
15702
|
+
}).exec();
|
|
15703
|
+
case 14:
|
|
15704
|
+
checkDocs = _context3.sent;
|
|
15705
|
+
checks = checkDocs.map(function (checkDoc) {
|
|
15706
|
+
return checkDoc._id.toHexString();
|
|
15707
|
+
}); // Add assembly
|
|
15708
|
+
_context3.next = 18;
|
|
15514
15709
|
return assemblyModel.create([{
|
|
15515
|
-
_id: assembly,
|
|
15710
|
+
_id: this.assembly,
|
|
15516
15711
|
name: assemblyName,
|
|
15517
15712
|
user: user,
|
|
15518
|
-
status: -1
|
|
15713
|
+
status: -1,
|
|
15714
|
+
fileIds: {
|
|
15715
|
+
fa: fileId
|
|
15716
|
+
},
|
|
15717
|
+
checks: checks
|
|
15519
15718
|
}]);
|
|
15520
|
-
case
|
|
15521
|
-
_yield$assemblyModel$ =
|
|
15522
|
-
_yield$assemblyModel$
|
|
15523
|
-
newAssemblyDoc = _yield$assemblyModel$
|
|
15524
|
-
(
|
|
15525
|
-
(
|
|
15719
|
+
case 18:
|
|
15720
|
+
_yield$assemblyModel$3 = _context3.sent;
|
|
15721
|
+
_yield$assemblyModel$4 = _slicedToArray(_yield$assemblyModel$3, 1);
|
|
15722
|
+
newAssemblyDoc = _yield$assemblyModel$4[0];
|
|
15723
|
+
(_this$logger$debug4 = (_this$logger4 = this.logger).debug) === null || _this$logger$debug4 === void 0 || _this$logger$debug4.call(_this$logger4, "Added new assembly \"".concat(assemblyName, "\", docId \"").concat(newAssemblyDoc._id, "\""));
|
|
15724
|
+
(_this$logger$debug5 = (_this$logger5 = this.logger).debug) === null || _this$logger$debug5 === void 0 || _this$logger$debug5.call(_this$logger5, "File type: \"".concat(fileDoc.type, "\", assemblyId: \"").concat(newAssemblyDoc._id, "\""));
|
|
15526
15725
|
// Add refSeqs
|
|
15527
15726
|
// We cannot use Mongo 'session' / transaction here because Mongo has 16 MB limit for transaction
|
|
15528
|
-
|
|
15727
|
+
_context3.next = 25;
|
|
15529
15728
|
return this.addRefSeqIntoDb(fileDoc, newAssemblyDoc._id.toString(), backend);
|
|
15530
|
-
case
|
|
15531
|
-
_context.next = 5;
|
|
15532
|
-
break;
|
|
15533
|
-
case 33:
|
|
15534
|
-
_context.next = 38;
|
|
15535
|
-
break;
|
|
15536
|
-
case 35:
|
|
15537
|
-
_context.prev = 35;
|
|
15538
|
-
_context.t0 = _context["catch"](3);
|
|
15539
|
-
_iterator.e(_context.t0);
|
|
15540
|
-
case 38:
|
|
15541
|
-
_context.prev = 38;
|
|
15542
|
-
_iterator.f();
|
|
15543
|
-
return _context.finish(38);
|
|
15544
|
-
case 41:
|
|
15729
|
+
case 25:
|
|
15545
15730
|
case "end":
|
|
15546
|
-
return
|
|
15731
|
+
return _context3.stop();
|
|
15547
15732
|
}
|
|
15548
|
-
},
|
|
15733
|
+
}, _callee3, this);
|
|
15549
15734
|
}));
|
|
15550
|
-
function
|
|
15551
|
-
return
|
|
15735
|
+
function executeOnServerFasta(_x5, _x6, _x7) {
|
|
15736
|
+
return _executeOnServerFasta.apply(this, arguments);
|
|
15552
15737
|
}
|
|
15553
|
-
return
|
|
15738
|
+
return executeOnServerFasta;
|
|
15554
15739
|
}()
|
|
15555
15740
|
}, {
|
|
15556
15741
|
key: "executeOnLocalGFF3",
|
|
15557
15742
|
value: function () {
|
|
15558
|
-
var _executeOnLocalGFF = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15559
|
-
return _regeneratorRuntime().wrap(function
|
|
15560
|
-
while (1) switch (
|
|
15743
|
+
var _executeOnLocalGFF = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_backend) {
|
|
15744
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
15745
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
15561
15746
|
case 0:
|
|
15562
15747
|
throw new Error('executeOnLocalGFF3 not implemented');
|
|
15563
15748
|
case 1:
|
|
15564
15749
|
case "end":
|
|
15565
|
-
return
|
|
15750
|
+
return _context4.stop();
|
|
15566
15751
|
}
|
|
15567
|
-
},
|
|
15752
|
+
}, _callee4);
|
|
15568
15753
|
}));
|
|
15569
|
-
function executeOnLocalGFF3(
|
|
15754
|
+
function executeOnLocalGFF3(_x8) {
|
|
15570
15755
|
return _executeOnLocalGFF.apply(this, arguments);
|
|
15571
15756
|
}
|
|
15572
15757
|
return executeOnLocalGFF3;
|
|
@@ -15574,16 +15759,16 @@
|
|
|
15574
15759
|
}, {
|
|
15575
15760
|
key: "executeOnClient",
|
|
15576
15761
|
value: function () {
|
|
15577
|
-
var _executeOnClient = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15578
|
-
return _regeneratorRuntime().wrap(function
|
|
15579
|
-
while (1) switch (
|
|
15762
|
+
var _executeOnClient = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_dataStore) {
|
|
15763
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
15764
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
15580
15765
|
case 0:
|
|
15581
15766
|
case "end":
|
|
15582
|
-
return
|
|
15767
|
+
return _context5.stop();
|
|
15583
15768
|
}
|
|
15584
|
-
},
|
|
15769
|
+
}, _callee5);
|
|
15585
15770
|
}));
|
|
15586
|
-
function executeOnClient(
|
|
15771
|
+
function executeOnClient(_x9) {
|
|
15587
15772
|
return _executeOnClient.apply(this, arguments);
|
|
15588
15773
|
}
|
|
15589
15774
|
return executeOnClient;
|
|
@@ -16536,7 +16721,7 @@
|
|
|
16536
16721
|
});
|
|
16537
16722
|
AddRefSeqAliasesChange$1.AddRefSeqAliasesChange = void 0;
|
|
16538
16723
|
var common_1$c = dist$1;
|
|
16539
|
-
var util_1$
|
|
16724
|
+
var util_1$2 = require$$1__default$1["default"];
|
|
16540
16725
|
var AddRefSeqAliasesChange = /*#__PURE__*/function (_common_1$AssemblySpe) {
|
|
16541
16726
|
_inherits(AddRefSeqAliasesChange, _common_1$AssemblySpe);
|
|
16542
16727
|
var _super = /*#__PURE__*/_createSuper(AddRefSeqAliasesChange);
|
|
@@ -16552,7 +16737,7 @@
|
|
|
16552
16737
|
_createClass(AddRefSeqAliasesChange, [{
|
|
16553
16738
|
key: "executeOnClient",
|
|
16554
16739
|
value: function executeOnClient(clientDataStore) {
|
|
16555
|
-
var _ref = (0, util_1$
|
|
16740
|
+
var _ref = (0, util_1$2.getSession)(clientDataStore),
|
|
16556
16741
|
assemblyManager = _ref.assemblyManager;
|
|
16557
16742
|
var assembly = assemblyManager.get(this.assembly);
|
|
16558
16743
|
if (!assembly) {
|
|
@@ -16691,7 +16876,7 @@
|
|
|
16691
16876
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
16692
16877
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
16693
16878
|
var common_1$b = dist$1;
|
|
16694
|
-
var util_1 = require$$1__default$1["default"];
|
|
16879
|
+
var util_1$1 = require$$1__default$1["default"];
|
|
16695
16880
|
var DeleteAssemblyChange = /*#__PURE__*/function (_common_1$AssemblySpe) {
|
|
16696
16881
|
_inherits(DeleteAssemblyChange, _common_1$AssemblySpe);
|
|
16697
16882
|
var _super = /*#__PURE__*/_createSuper(DeleteAssemblyChange);
|
|
@@ -16822,7 +17007,7 @@
|
|
|
16822
17007
|
}
|
|
16823
17008
|
throw new Error('No data store');
|
|
16824
17009
|
case 3:
|
|
16825
|
-
session = (0, util_1.getSession)(dataStore); // If assemblyId is not present in client data store
|
|
17010
|
+
session = (0, util_1$1.getSession)(dataStore); // If assemblyId is not present in client data store
|
|
16826
17011
|
if (dataStore.assemblies.has(assembly)) {
|
|
16827
17012
|
dataStore.deleteAssembly(assembly);
|
|
16828
17013
|
}
|
|
@@ -17273,7 +17458,7 @@
|
|
|
17273
17458
|
|
|
17274
17459
|
var ImportJBrowseConfigChange$1 = {};
|
|
17275
17460
|
|
|
17276
|
-
var _excluded = ["assemblies", "internetAccounts", "plugins", "tracks"];
|
|
17461
|
+
var _excluded = ["__v", "_id", "assemblies", "internetAccounts", "plugins", "tracks"];
|
|
17277
17462
|
Object.defineProperty(ImportJBrowseConfigChange$1, "__esModule", {
|
|
17278
17463
|
value: true
|
|
17279
17464
|
});
|
|
@@ -18835,7 +19020,7 @@
|
|
|
18835
19020
|
value: true
|
|
18836
19021
|
});
|
|
18837
19022
|
exports.changes = void 0;
|
|
18838
|
-
var tslib_1 = require$$0;
|
|
19023
|
+
var tslib_1 = require$$0$1;
|
|
18839
19024
|
var AddAssemblyAndFeaturesFromFileChange_1 = AddAssemblyAndFeaturesFromFileChange$1;
|
|
18840
19025
|
var AddAssemblyFromExternalChange_1 = AddAssemblyFromExternalChange$1;
|
|
18841
19026
|
var AddAssemblyFromFileChange_1 = AddAssemblyFromFileChange$1;
|
|
@@ -19038,7 +19223,7 @@
|
|
|
19038
19223
|
value: true
|
|
19039
19224
|
});
|
|
19040
19225
|
exports.operations = void 0;
|
|
19041
|
-
var tslib_1 = require$$0;
|
|
19226
|
+
var tslib_1 = require$$0$1;
|
|
19042
19227
|
var GetAssembliesOperation_1 = GetAssembliesOperation$1;
|
|
19043
19228
|
var GetFeaturesOperation_1 = GetFeaturesOperation$1;
|
|
19044
19229
|
exports.operations = {
|
|
@@ -19514,8 +19699,8 @@
|
|
|
19514
19699
|
});
|
|
19515
19700
|
CoreValidation$1.CoreValidation = void 0;
|
|
19516
19701
|
CoreValidation$1.isTypeChange = isTypeChange;
|
|
19517
|
-
var tslib_1$
|
|
19518
|
-
var soSequenceTypes_1 = /*#__PURE__*/tslib_1$
|
|
19702
|
+
var tslib_1$2 = require$$0$1;
|
|
19703
|
+
var soSequenceTypes_1 = /*#__PURE__*/tslib_1$2.__importDefault(soSequenceTypes$1);
|
|
19519
19704
|
var Validation_1$1 = Validation$1;
|
|
19520
19705
|
function isTypeChange(thing) {
|
|
19521
19706
|
return 'oldType' in thing && 'newType' in thing;
|
|
@@ -19813,7 +19998,7 @@
|
|
|
19813
19998
|
Object.defineProperty(exports, "__esModule", {
|
|
19814
19999
|
value: true
|
|
19815
20000
|
});
|
|
19816
|
-
var tslib_1 = require$$0;
|
|
20001
|
+
var tslib_1 = require$$0$1;
|
|
19817
20002
|
tslib_1.__exportStar(Validation$1, exports);
|
|
19818
20003
|
tslib_1.__exportStar(ValidationSet$1, exports);
|
|
19819
20004
|
tslib_1.__exportStar(CoreValidation$1, exports);
|
|
@@ -19886,8 +20071,8 @@
|
|
|
19886
20071
|
});
|
|
19887
20072
|
jwtPayload.makeUserSessionId = makeUserSessionId;
|
|
19888
20073
|
jwtPayload.getDecodedToken = getDecodedToken;
|
|
19889
|
-
var tslib_1 = require$$0;
|
|
19890
|
-
var jwt_decode_1 = /*#__PURE__*/tslib_1.__importDefault(require$$1);
|
|
20074
|
+
var tslib_1$1 = require$$0$1;
|
|
20075
|
+
var jwt_decode_1 = /*#__PURE__*/tslib_1$1.__importDefault(require$$1);
|
|
19891
20076
|
function makeUserSessionId(userOrToken) {
|
|
19892
20077
|
var user = typeof userOrToken === 'string' ? (0, jwt_decode_1["default"])(userOrToken) : userOrToken;
|
|
19893
20078
|
return "".concat(user.id, "-").concat(user.iat);
|
|
@@ -19901,7 +20086,7 @@
|
|
|
19901
20086
|
Object.defineProperty(exports, "__esModule", {
|
|
19902
20087
|
value: true
|
|
19903
20088
|
});
|
|
19904
|
-
var tslib_1 = require$$0;
|
|
20089
|
+
var tslib_1 = require$$0$1;
|
|
19905
20090
|
tslib_1.__exportStar(jwtPayload, exports);
|
|
19906
20091
|
})(Common);
|
|
19907
20092
|
|
|
@@ -19913,218 +20098,302 @@
|
|
|
19913
20098
|
value: true
|
|
19914
20099
|
});
|
|
19915
20100
|
CDSCheck$1.CDSCheck = void 0;
|
|
20101
|
+
var tslib_1 = require$$0$1;
|
|
19916
20102
|
var common_1 = dist$1;
|
|
19917
|
-
|
|
19918
|
-
|
|
19919
|
-
|
|
19920
|
-
|
|
19921
|
-
|
|
19922
|
-
|
|
19923
|
-
|
|
19924
|
-
|
|
19925
|
-
|
|
19926
|
-
|
|
19927
|
-
|
|
19928
|
-
|
|
19929
|
-
|
|
19930
|
-
|
|
19931
|
-
|
|
19932
|
-
|
|
19933
|
-
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19937
|
-
|
|
19938
|
-
|
|
19939
|
-
|
|
19940
|
-
|
|
19941
|
-
|
|
19942
|
-
|
|
19943
|
-
|
|
19944
|
-
|
|
19945
|
-
|
|
19946
|
-
|
|
19947
|
-
|
|
19948
|
-
|
|
19949
|
-
|
|
19950
|
-
|
|
19951
|
-
|
|
19952
|
-
|
|
19953
|
-
|
|
19954
|
-
|
|
19955
|
-
|
|
19956
|
-
|
|
19957
|
-
|
|
19958
|
-
|
|
19959
|
-
|
|
19960
|
-
|
|
19961
|
-
|
|
19962
|
-
|
|
19963
|
-
|
|
19964
|
-
|
|
19965
|
-
|
|
19966
|
-
|
|
19967
|
-
|
|
19968
|
-
|
|
19969
|
-
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
|
|
19973
|
-
|
|
19974
|
-
|
|
19975
|
-
|
|
19976
|
-
|
|
19977
|
-
|
|
19978
|
-
|
|
19979
|
-
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
|
|
19985
|
-
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
|
|
19989
|
-
|
|
19990
|
-
|
|
19991
|
-
|
|
19992
|
-
|
|
19993
|
-
|
|
19994
|
-
|
|
19995
|
-
|
|
19996
|
-
|
|
19997
|
-
|
|
19998
|
-
|
|
19999
|
-
|
|
20000
|
-
|
|
20001
|
-
|
|
20002
|
-
|
|
20003
|
-
|
|
20004
|
-
|
|
20005
|
-
|
|
20006
|
-
|
|
20007
|
-
|
|
20008
|
-
|
|
20009
|
-
|
|
20010
|
-
|
|
20011
|
-
|
|
20012
|
-
|
|
20013
|
-
|
|
20014
|
-
|
|
20015
|
-
|
|
20016
|
-
|
|
20017
|
-
|
|
20018
|
-
|
|
20019
|
-
|
|
20020
|
-
|
|
20021
|
-
|
|
20022
|
-
|
|
20023
|
-
|
|
20024
|
-
|
|
20025
|
-
|
|
20026
|
-
|
|
20027
|
-
|
|
20028
|
-
|
|
20029
|
-
|
|
20030
|
-
|
|
20031
|
-
|
|
20032
|
-
|
|
20033
|
-
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20065
|
-
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20069
|
-
|
|
20070
|
-
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
|
|
20074
|
-
|
|
20075
|
-
|
|
20076
|
-
|
|
20077
|
-
|
|
20078
|
-
|
|
20079
|
-
|
|
20080
|
-
|
|
20081
|
-
|
|
20082
|
-
|
|
20083
|
-
|
|
20084
|
-
|
|
20085
|
-
|
|
20086
|
-
|
|
20087
|
-
|
|
20088
|
-
|
|
20089
|
-
|
|
20090
|
-
|
|
20091
|
-
|
|
20092
|
-
|
|
20093
|
-
|
|
20094
|
-
|
|
20095
|
-
|
|
20096
|
-
|
|
20097
|
-
|
|
20098
|
-
|
|
20099
|
-
|
|
20100
|
-
|
|
20101
|
-
|
|
20102
|
-
|
|
20103
|
-
|
|
20104
|
-
|
|
20105
|
-
|
|
20106
|
-
|
|
20107
|
-
|
|
20108
|
-
|
|
20109
|
-
|
|
20110
|
-
|
|
20111
|
-
|
|
20112
|
-
|
|
20113
|
-
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
|
|
20120
|
-
|
|
20121
|
-
|
|
20122
|
-
|
|
20123
|
-
|
|
20124
|
-
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20103
|
+
var util_1 = require$$1__default$1["default"];
|
|
20104
|
+
var bson_objectid_1 = /*#__PURE__*/tslib_1.__importDefault(objectid);
|
|
20105
|
+
var STOP_CODONS;
|
|
20106
|
+
(function (STOP_CODONS) {
|
|
20107
|
+
STOP_CODONS[STOP_CODONS["TAG"] = 0] = "TAG";
|
|
20108
|
+
STOP_CODONS[STOP_CODONS["TAA"] = 1] = "TAA";
|
|
20109
|
+
STOP_CODONS[STOP_CODONS["TGA"] = 2] = "TGA";
|
|
20110
|
+
})(STOP_CODONS || (STOP_CODONS = {}));
|
|
20111
|
+
var iupacComplements = {
|
|
20112
|
+
G: 'C',
|
|
20113
|
+
A: 'T',
|
|
20114
|
+
T: 'A',
|
|
20115
|
+
C: 'G',
|
|
20116
|
+
R /* G or A */: 'Y',
|
|
20117
|
+
Y /* T or C */: 'R',
|
|
20118
|
+
M /* A or C */: 'K',
|
|
20119
|
+
K /* G or T */: 'M',
|
|
20120
|
+
S /* G or C */: 'S',
|
|
20121
|
+
W /* A or T */: 'W',
|
|
20122
|
+
H /* A or C or T */: 'D',
|
|
20123
|
+
B /* G or T or C */: 'V',
|
|
20124
|
+
V /* G or C or A */: 'B',
|
|
20125
|
+
D /* G or A or T */: 'H',
|
|
20126
|
+
N /* G or A or T or C */: 'N'
|
|
20127
|
+
};
|
|
20128
|
+
function reverseComplement(dna) {
|
|
20129
|
+
var complement = [];
|
|
20130
|
+
var _iterator = _createForOfIteratorHelper(dna),
|
|
20131
|
+
_step;
|
|
20132
|
+
try {
|
|
20133
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
20134
|
+
var nt = _step.value;
|
|
20135
|
+
var rc = iupacComplements[nt.toUpperCase()];
|
|
20136
|
+
if (rc === undefined) {
|
|
20137
|
+
throw new TypeError("Cannot complement nucleotide: \"".concat(nt, "\""));
|
|
20138
|
+
}
|
|
20139
|
+
if (nt === nt.toLowerCase()) {
|
|
20140
|
+
complement.push(rc.toLowerCase());
|
|
20141
|
+
} else {
|
|
20142
|
+
complement.push(rc);
|
|
20143
|
+
}
|
|
20144
|
+
}
|
|
20145
|
+
} catch (err) {
|
|
20146
|
+
_iterator.e(err);
|
|
20147
|
+
} finally {
|
|
20148
|
+
_iterator.f();
|
|
20149
|
+
}
|
|
20150
|
+
return complement.reverse().join('');
|
|
20151
|
+
}
|
|
20152
|
+
function getCDSSequence(_x, _x2, _x3) {
|
|
20153
|
+
return _getCDSSequence.apply(this, arguments);
|
|
20154
|
+
}
|
|
20155
|
+
function _getCDSSequence() {
|
|
20156
|
+
_getCDSSequence = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(cdsLocation, strand, getSequence) {
|
|
20157
|
+
var sequences;
|
|
20158
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
20159
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
20160
|
+
case 0:
|
|
20161
|
+
_context2.next = 2;
|
|
20162
|
+
return Promise.all(cdsLocation.map(function (_ref5) {
|
|
20163
|
+
var max = _ref5.max,
|
|
20164
|
+
min = _ref5.min;
|
|
20165
|
+
return getSequence(min, max);
|
|
20166
|
+
}));
|
|
20167
|
+
case 2:
|
|
20168
|
+
sequences = _context2.sent;
|
|
20169
|
+
if (!(strand === -1)) {
|
|
20170
|
+
_context2.next = 5;
|
|
20171
|
+
break;
|
|
20172
|
+
}
|
|
20173
|
+
return _context2.abrupt("return", sequences.map(function (seq) {
|
|
20174
|
+
return reverseComplement(seq);
|
|
20175
|
+
}).join(''));
|
|
20176
|
+
case 5:
|
|
20177
|
+
return _context2.abrupt("return", sequences.join(''));
|
|
20178
|
+
case 6:
|
|
20179
|
+
case "end":
|
|
20180
|
+
return _context2.stop();
|
|
20181
|
+
}
|
|
20182
|
+
}, _callee2);
|
|
20183
|
+
}));
|
|
20184
|
+
return _getCDSSequence.apply(this, arguments);
|
|
20185
|
+
}
|
|
20186
|
+
function splitSequenceInCodons(cds) {
|
|
20187
|
+
var codons = [];
|
|
20188
|
+
for (var i = 0; i <= cds.length - 3; i += 3) {
|
|
20189
|
+
codons.push(cds.slice(i, i + 3));
|
|
20190
|
+
}
|
|
20191
|
+
return codons;
|
|
20192
|
+
}
|
|
20193
|
+
function getOriginalCodonLocation(cdsLocation, strand, index) {
|
|
20194
|
+
var lengthToStart = index * 3;
|
|
20195
|
+
var lengthToEnd = lengthToStart + 3;
|
|
20196
|
+
var startLocation = undefined,
|
|
20197
|
+
endLocation = undefined;
|
|
20198
|
+
var _iterator2 = _createForOfIteratorHelper(cdsLocation),
|
|
20199
|
+
_step2;
|
|
20200
|
+
try {
|
|
20201
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
20202
|
+
var loc = _step2.value;
|
|
20203
|
+
var locLength = loc.max - loc.min;
|
|
20204
|
+
if (startLocation === undefined && locLength > lengthToStart) {
|
|
20205
|
+
startLocation = loc.min + lengthToStart;
|
|
20206
|
+
} else {
|
|
20207
|
+
lengthToStart -= locLength;
|
|
20208
|
+
}
|
|
20209
|
+
if (endLocation === undefined && locLength > lengthToEnd) {
|
|
20210
|
+
endLocation = loc.min + lengthToEnd;
|
|
20211
|
+
} else {
|
|
20212
|
+
lengthToEnd -= locLength;
|
|
20213
|
+
}
|
|
20214
|
+
if (startLocation !== undefined && endLocation !== undefined) {
|
|
20215
|
+
return [startLocation, endLocation];
|
|
20216
|
+
}
|
|
20217
|
+
}
|
|
20218
|
+
} catch (err) {
|
|
20219
|
+
_iterator2.e(err);
|
|
20220
|
+
} finally {
|
|
20221
|
+
_iterator2.f();
|
|
20222
|
+
}
|
|
20223
|
+
return;
|
|
20224
|
+
}
|
|
20225
|
+
function checkMRNA(_x4, _x5) {
|
|
20226
|
+
return _checkMRNA.apply(this, arguments);
|
|
20227
|
+
}
|
|
20228
|
+
function _checkMRNA() {
|
|
20229
|
+
_checkMRNA = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(feature, getSequence) {
|
|
20230
|
+
var checkResults, _id, max, min, refSeq, strand, cdsLocations, ids, _iterator4, _step4, cdsLocation, sequence, codons, lastCodon, _iterator5, _step5, _step5$value, idx, codon, location, _location, codonStart, codonEnd;
|
|
20231
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
20232
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
20233
|
+
case 0:
|
|
20234
|
+
checkResults = [];
|
|
20235
|
+
_id = feature._id, max = feature.max, min = feature.min, refSeq = feature.refSeq, strand = feature.strand;
|
|
20236
|
+
cdsLocations = getCDSLocations(feature);
|
|
20237
|
+
if (cdsLocations) {
|
|
20238
|
+
_context3.next = 5;
|
|
20239
|
+
break;
|
|
20240
|
+
}
|
|
20241
|
+
return _context3.abrupt("return", checkResults);
|
|
20242
|
+
case 5:
|
|
20243
|
+
ids = [_id];
|
|
20244
|
+
_iterator4 = _createForOfIteratorHelper(cdsLocations);
|
|
20245
|
+
_context3.prev = 7;
|
|
20246
|
+
_iterator4.s();
|
|
20247
|
+
case 9:
|
|
20248
|
+
if ((_step4 = _iterator4.n()).done) {
|
|
20249
|
+
_context3.next = 20;
|
|
20250
|
+
break;
|
|
20251
|
+
}
|
|
20252
|
+
cdsLocation = _step4.value;
|
|
20253
|
+
_context3.next = 13;
|
|
20254
|
+
return getCDSSequence(cdsLocation, strand, getSequence);
|
|
20255
|
+
case 13:
|
|
20256
|
+
sequence = _context3.sent;
|
|
20257
|
+
codons = splitSequenceInCodons(sequence);
|
|
20258
|
+
if (sequence.length % 3 === 0) {
|
|
20259
|
+
lastCodon = codons.pop(); // Last codon is supposed to be a stop
|
|
20260
|
+
if (lastCodon && !(lastCodon.toUpperCase() in STOP_CODONS)) {
|
|
20261
|
+
checkResults.push({
|
|
20262
|
+
_id: new bson_objectid_1["default"]().toHexString(),
|
|
20263
|
+
name: 'MissingStopCodonCheck',
|
|
20264
|
+
ids: ids,
|
|
20265
|
+
refSeq: refSeq.toString(),
|
|
20266
|
+
start: max,
|
|
20267
|
+
end: max,
|
|
20268
|
+
message: "Feature \"".concat(_id, "\" is missing a stop codon")
|
|
20269
|
+
});
|
|
20270
|
+
}
|
|
20271
|
+
} else {
|
|
20272
|
+
checkResults.push({
|
|
20273
|
+
_id: new bson_objectid_1["default"]().toHexString(),
|
|
20274
|
+
name: 'MultipleOfThreeCheck',
|
|
20275
|
+
ids: ids,
|
|
20276
|
+
refSeq: refSeq.toString(),
|
|
20277
|
+
start: min,
|
|
20278
|
+
end: max,
|
|
20279
|
+
message: "The coding sequence for feature \"".concat(_id, "\" is not a multiple of three")
|
|
20280
|
+
});
|
|
20281
|
+
}
|
|
20282
|
+
_iterator5 = _createForOfIteratorHelper(codons.entries());
|
|
20283
|
+
try {
|
|
20284
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
20285
|
+
_step5$value = _slicedToArray(_step5.value, 2), idx = _step5$value[0], codon = _step5$value[1];
|
|
20286
|
+
location = getOriginalCodonLocation(cdsLocation, strand, idx);
|
|
20287
|
+
if (location && codon.toUpperCase() in STOP_CODONS) {
|
|
20288
|
+
_location = _slicedToArray(location, 2), codonStart = _location[0], codonEnd = _location[1];
|
|
20289
|
+
checkResults.push({
|
|
20290
|
+
_id: new bson_objectid_1["default"]().toHexString(),
|
|
20291
|
+
name: 'InternalStopCodonCheck',
|
|
20292
|
+
ids: ids,
|
|
20293
|
+
refSeq: refSeq.toString(),
|
|
20294
|
+
start: codonStart,
|
|
20295
|
+
end: codonEnd,
|
|
20296
|
+
message: "The coding sequence for feature \"".concat(_id, "\" has an internal stop codon")
|
|
20297
|
+
});
|
|
20298
|
+
}
|
|
20299
|
+
}
|
|
20300
|
+
} catch (err) {
|
|
20301
|
+
_iterator5.e(err);
|
|
20302
|
+
} finally {
|
|
20303
|
+
_iterator5.f();
|
|
20304
|
+
}
|
|
20305
|
+
case 18:
|
|
20306
|
+
_context3.next = 9;
|
|
20307
|
+
break;
|
|
20308
|
+
case 20:
|
|
20309
|
+
_context3.next = 25;
|
|
20310
|
+
break;
|
|
20311
|
+
case 22:
|
|
20312
|
+
_context3.prev = 22;
|
|
20313
|
+
_context3.t0 = _context3["catch"](7);
|
|
20314
|
+
_iterator4.e(_context3.t0);
|
|
20315
|
+
case 25:
|
|
20316
|
+
_context3.prev = 25;
|
|
20317
|
+
_iterator4.f();
|
|
20318
|
+
return _context3.finish(25);
|
|
20319
|
+
case 28:
|
|
20320
|
+
return _context3.abrupt("return", checkResults);
|
|
20321
|
+
case 29:
|
|
20322
|
+
case "end":
|
|
20323
|
+
return _context3.stop();
|
|
20324
|
+
}
|
|
20325
|
+
}, _callee3, null, [[7, 22, 25, 28]]);
|
|
20326
|
+
}));
|
|
20327
|
+
return _checkMRNA.apply(this, arguments);
|
|
20328
|
+
}
|
|
20329
|
+
function getCDSLocations(feature) {
|
|
20330
|
+
if (feature.type !== 'mRNA') {
|
|
20331
|
+
return;
|
|
20332
|
+
}
|
|
20333
|
+
var children = feature.children,
|
|
20334
|
+
strand = feature.strand;
|
|
20335
|
+
if (!children) {
|
|
20336
|
+
return;
|
|
20337
|
+
}
|
|
20338
|
+
var cdsChildren = Object.values(children).filter(function (child) {
|
|
20339
|
+
return child.type === 'CDS';
|
|
20340
|
+
});
|
|
20341
|
+
if (cdsChildren.length === 0) {
|
|
20342
|
+
return;
|
|
20343
|
+
}
|
|
20344
|
+
var cdsLocations = [];
|
|
20345
|
+
var _iterator3 = _createForOfIteratorHelper(cdsChildren),
|
|
20346
|
+
_step3;
|
|
20347
|
+
try {
|
|
20348
|
+
var _loop = function _loop() {
|
|
20349
|
+
var cds = _step3.value;
|
|
20350
|
+
var cdsMax = cds.max,
|
|
20351
|
+
cdsMin = cds.min;
|
|
20352
|
+
var locs = [];
|
|
20353
|
+
for (var _i = 0, _Object$values = Object.values(children); _i < _Object$values.length; _i++) {
|
|
20354
|
+
var child = _Object$values[_i];
|
|
20355
|
+
if (child.type !== 'exon') {
|
|
20356
|
+
continue;
|
|
20357
|
+
}
|
|
20358
|
+
var _ref = (0, util_1.intersection2)(cdsMin, cdsMax, child.min, child.max),
|
|
20359
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
20360
|
+
start = _ref2[0],
|
|
20361
|
+
end = _ref2[1];
|
|
20362
|
+
if (start !== undefined && end !== undefined) {
|
|
20363
|
+
locs.push({
|
|
20364
|
+
min: start,
|
|
20365
|
+
max: end
|
|
20366
|
+
});
|
|
20367
|
+
}
|
|
20368
|
+
}
|
|
20369
|
+
locs.sort(function (_ref3, _ref4) {
|
|
20370
|
+
var a = _ref3.min;
|
|
20371
|
+
var b = _ref4.min;
|
|
20372
|
+
return a - b;
|
|
20373
|
+
});
|
|
20374
|
+
if (strand === -1) {
|
|
20375
|
+
locs.reverse();
|
|
20376
|
+
}
|
|
20377
|
+
var nextPhase = 0;
|
|
20378
|
+
var phasedLocs = locs.map(function (loc) {
|
|
20379
|
+
var phase = nextPhase;
|
|
20380
|
+
nextPhase = (3 - (loc.max - loc.min - phase + 3) % 3) % 3;
|
|
20381
|
+
return _objectSpread2(_objectSpread2({}, loc), {}, {
|
|
20382
|
+
phase: phase
|
|
20383
|
+
});
|
|
20384
|
+
});
|
|
20385
|
+
cdsLocations.push(phasedLocs);
|
|
20386
|
+
};
|
|
20387
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
20388
|
+
_loop();
|
|
20389
|
+
}
|
|
20390
|
+
} catch (err) {
|
|
20391
|
+
_iterator3.e(err);
|
|
20392
|
+
} finally {
|
|
20393
|
+
_iterator3.f();
|
|
20394
|
+
}
|
|
20395
|
+
return cdsLocations;
|
|
20396
|
+
}
|
|
20128
20397
|
var CDSCheck = /*#__PURE__*/function (_common_1$Check) {
|
|
20129
20398
|
_inherits(CDSCheck, _common_1$Check);
|
|
20130
20399
|
var _super = /*#__PURE__*/_createSuper(CDSCheck);
|
|
@@ -20143,21 +20412,53 @@
|
|
|
20143
20412
|
_createClass(CDSCheck, [{
|
|
20144
20413
|
key: "checkFeature",
|
|
20145
20414
|
value: function () {
|
|
20146
|
-
var _checkFeature = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
20415
|
+
var _checkFeature = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(feature, getSequence) {
|
|
20416
|
+
var checkResults, _i2, _Object$values2, child;
|
|
20147
20417
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
20148
20418
|
while (1) switch (_context.prev = _context.next) {
|
|
20149
20419
|
case 0:
|
|
20150
|
-
|
|
20151
|
-
|
|
20420
|
+
if (!(feature.type === 'mRNA')) {
|
|
20421
|
+
_context.next = 2;
|
|
20422
|
+
break;
|
|
20423
|
+
}
|
|
20424
|
+
return _context.abrupt("return", checkMRNA(feature, getSequence));
|
|
20152
20425
|
case 2:
|
|
20426
|
+
if (feature.children) {
|
|
20427
|
+
_context.next = 4;
|
|
20428
|
+
break;
|
|
20429
|
+
}
|
|
20153
20430
|
return _context.abrupt("return", []);
|
|
20154
|
-
case
|
|
20431
|
+
case 4:
|
|
20432
|
+
checkResults = [];
|
|
20433
|
+
_i2 = 0, _Object$values2 = Object.values(feature.children);
|
|
20434
|
+
case 6:
|
|
20435
|
+
if (!(_i2 < _Object$values2.length)) {
|
|
20436
|
+
_context.next = 19;
|
|
20437
|
+
break;
|
|
20438
|
+
}
|
|
20439
|
+
child = _Object$values2[_i2];
|
|
20440
|
+
_context.t0 = checkResults.push;
|
|
20441
|
+
_context.t1 = checkResults;
|
|
20442
|
+
_context.t2 = _toConsumableArray;
|
|
20443
|
+
_context.next = 13;
|
|
20444
|
+
return this.checkFeature(child, getSequence);
|
|
20445
|
+
case 13:
|
|
20446
|
+
_context.t3 = _context.sent;
|
|
20447
|
+
_context.t4 = (0, _context.t2)(_context.t3);
|
|
20448
|
+
_context.t0.apply.call(_context.t0, _context.t1, _context.t4);
|
|
20449
|
+
case 16:
|
|
20450
|
+
_i2++;
|
|
20451
|
+
_context.next = 6;
|
|
20452
|
+
break;
|
|
20453
|
+
case 19:
|
|
20454
|
+
return _context.abrupt("return", checkResults);
|
|
20455
|
+
case 20:
|
|
20155
20456
|
case "end":
|
|
20156
20457
|
return _context.stop();
|
|
20157
20458
|
}
|
|
20158
|
-
}, _callee);
|
|
20459
|
+
}, _callee, this);
|
|
20159
20460
|
}));
|
|
20160
|
-
function checkFeature(
|
|
20461
|
+
function checkFeature(_x6, _x7) {
|
|
20161
20462
|
return _checkFeature.apply(this, arguments);
|
|
20162
20463
|
}
|
|
20163
20464
|
return checkFeature;
|
|
@@ -20172,12 +20473,13 @@
|
|
|
20172
20473
|
Object.defineProperty(exports, "__esModule", {
|
|
20173
20474
|
value: true
|
|
20174
20475
|
});
|
|
20175
|
-
var tslib_1 = require$$0;
|
|
20476
|
+
var tslib_1 = require$$0$1;
|
|
20176
20477
|
tslib_1.__exportStar(CDSCheck$1, exports);
|
|
20177
20478
|
})(Checks);
|
|
20178
20479
|
|
|
20179
20480
|
var util$1 = {};
|
|
20180
20481
|
|
|
20482
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
20181
20483
|
Object.defineProperty(util$1, "__esModule", {
|
|
20182
20484
|
value: true
|
|
20183
20485
|
});
|
|
@@ -20299,7 +20601,7 @@
|
|
|
20299
20601
|
Object.defineProperty(exports, "__esModule", {
|
|
20300
20602
|
value: true
|
|
20301
20603
|
});
|
|
20302
|
-
var tslib_1 = require$$0;
|
|
20604
|
+
var tslib_1 = require$$0$1;
|
|
20303
20605
|
tslib_1.__exportStar(Changes, exports);
|
|
20304
20606
|
tslib_1.__exportStar(Operations, exports);
|
|
20305
20607
|
tslib_1.__exportStar(Validations, exports);
|
|
@@ -20352,7 +20654,7 @@
|
|
|
20352
20654
|
}), 'Add');
|
|
20353
20655
|
default_1$a = Add["default"] = _default$c;
|
|
20354
20656
|
|
|
20355
|
-
var version = "0.1.
|
|
20657
|
+
var version = "0.1.21";
|
|
20356
20658
|
|
|
20357
20659
|
const ApolloConfigSchema = configuration.ConfigurationSchema('ApolloInternetAccount', {
|
|
20358
20660
|
baseURL: {
|
|
@@ -27870,7 +28172,7 @@
|
|
|
27870
28172
|
for (const ref of assembly.refSeqs.values()) {
|
|
27871
28173
|
for (const feature of ref.features.values()) {
|
|
27872
28174
|
for (const check of dist$3.checkRegistry.getChecks().values()) {
|
|
27873
|
-
const result = await check.checkFeature(require$$1$
|
|
28175
|
+
const result = await check.checkFeature(require$$1$3.getSnapshot(feature), (start, stop) => Promise.resolve(ref.getSequence(start, stop)));
|
|
27874
28176
|
checkResults.push(...result);
|
|
27875
28177
|
}
|
|
27876
28178
|
}
|
|
@@ -27891,7 +28193,7 @@
|
|
|
27891
28193
|
}
|
|
27892
28194
|
/** given a session, get our ApolloInternetAccount */
|
|
27893
28195
|
function getApolloInternetAccount(session) {
|
|
27894
|
-
const { internetAccounts } = require$$1$
|
|
28196
|
+
const { internetAccounts } = require$$1$3.getParent(session);
|
|
27895
28197
|
return internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
27896
28198
|
}
|
|
27897
28199
|
|
|
@@ -27954,7 +28256,7 @@
|
|
|
27954
28256
|
FileType["EXTERNAL"] = "text/x-external";
|
|
27955
28257
|
})(FileType || (FileType = {}));
|
|
27956
28258
|
function AddAssembly({ changeManager, handleClose, session, }) {
|
|
27957
|
-
const { internetAccounts } = require$$1$
|
|
28259
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
27958
28260
|
const { notify } = session;
|
|
27959
28261
|
const apolloInternetAccounts = internetAccounts.filter((ia) => ia.type === 'ApolloInternetAccount');
|
|
27960
28262
|
if (apolloInternetAccounts.length === 0) {
|
|
@@ -28089,7 +28391,7 @@
|
|
|
28089
28391
|
const fileUploadChangeBase = {
|
|
28090
28392
|
assembly: new objectid().toHexString(),
|
|
28091
28393
|
assemblyName,
|
|
28092
|
-
fileId,
|
|
28394
|
+
fileIds: { fa: fileId },
|
|
28093
28395
|
};
|
|
28094
28396
|
change =
|
|
28095
28397
|
fileType === FileType.GFF3 && importFeatures
|
|
@@ -34867,7 +35169,7 @@
|
|
|
34867
35169
|
async function textSearch(text, tx, signal) {
|
|
34868
35170
|
const db = await this.db;
|
|
34869
35171
|
const myTx = tx ?? db.transaction(['nodes']);
|
|
34870
|
-
require$$1$
|
|
35172
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34871
35173
|
const queryWords = [...wordsInString(text)];
|
|
34872
35174
|
const queries = [];
|
|
34873
35175
|
/**
|
|
@@ -34877,10 +35179,10 @@
|
|
|
34877
35179
|
const initialMatches = new Map();
|
|
34878
35180
|
// find startsWith and complete matches
|
|
34879
35181
|
queries.push(...queryWords.map(async (queryWord, queryWordIndex) => {
|
|
34880
|
-
require$$1$
|
|
35182
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34881
35183
|
const idx = myTx.objectStore('nodes').index('full-text-words');
|
|
34882
35184
|
for await (const cursor of idx.iterate(IDBKeyRange.bound(queryWord, `${queryWord}\uFFFF`, false, false))) {
|
|
34883
|
-
require$$1$
|
|
35185
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34884
35186
|
const term = cursor.value;
|
|
34885
35187
|
const termMatches = initialMatches.get(term.id) ?? [
|
|
34886
35188
|
term,
|
|
@@ -34891,11 +35193,11 @@
|
|
|
34891
35193
|
}
|
|
34892
35194
|
}));
|
|
34893
35195
|
await Promise.all(queries);
|
|
34894
|
-
require$$1$
|
|
35196
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34895
35197
|
// now rank the term matches and add some detail
|
|
34896
35198
|
const results = [];
|
|
34897
35199
|
for (const [, [term, wordIndexes]] of initialMatches) {
|
|
34898
|
-
require$$1$
|
|
35200
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34899
35201
|
results.push(...elaborateMatch(this.textIndexFields, term, wordIndexes, queryWords, this.prefixes));
|
|
34900
35202
|
}
|
|
34901
35203
|
// sort the terms by score descending
|
|
@@ -35636,7 +35938,7 @@
|
|
|
35636
35938
|
return errors;
|
|
35637
35939
|
}
|
|
35638
35940
|
get sourceType() {
|
|
35639
|
-
if (require$$1$
|
|
35941
|
+
if (require$$1$2.isUriLocation(this.sourceLocation)) {
|
|
35640
35942
|
if (this.sourceLocation.uri.endsWith('.json')) {
|
|
35641
35943
|
return 'obo-graph-json';
|
|
35642
35944
|
}
|
|
@@ -35871,12 +36173,12 @@
|
|
|
35871
36173
|
}
|
|
35872
36174
|
}
|
|
35873
36175
|
|
|
35874
|
-
const OntologyRecordType = require$$1$
|
|
36176
|
+
const OntologyRecordType = require$$1$3.types
|
|
35875
36177
|
.model('OntologyRecord', {
|
|
35876
|
-
name: require$$1$
|
|
36178
|
+
name: require$$1$3.types.string,
|
|
35877
36179
|
version: 'unversioned',
|
|
35878
|
-
source: require$$1$
|
|
35879
|
-
options: require$$1$
|
|
36180
|
+
source: require$$1$3.types.union(mst.LocalPathLocation, mst.UriLocation, mst.BlobLocation),
|
|
36181
|
+
options: require$$1$3.types.frozen(),
|
|
35880
36182
|
})
|
|
35881
36183
|
.volatile((_self) => ({
|
|
35882
36184
|
dataStore: undefined,
|
|
@@ -35887,19 +36189,19 @@
|
|
|
35887
36189
|
return;
|
|
35888
36190
|
},
|
|
35889
36191
|
initDataStore() {
|
|
35890
|
-
self.dataStore = new OntologyStore(self.name, self.version, require$$1$
|
|
36192
|
+
self.dataStore = new OntologyStore(self.name, self.version, require$$1$3.getSnapshot(self.source), self.options);
|
|
35891
36193
|
},
|
|
35892
36194
|
afterCreate() {
|
|
35893
|
-
require$$1$
|
|
36195
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
35894
36196
|
this.initDataStore();
|
|
35895
36197
|
}));
|
|
35896
36198
|
},
|
|
35897
36199
|
}));
|
|
35898
|
-
const OntologyManagerType = require$$1$
|
|
36200
|
+
const OntologyManagerType = require$$1$3.types
|
|
35899
36201
|
.model('OntologyManager', {
|
|
35900
36202
|
// create, update, and delete ontologies
|
|
35901
|
-
ontologies: require$$1$
|
|
35902
|
-
prefixes: require$$1$
|
|
36203
|
+
ontologies: require$$1$3.types.array(OntologyRecordType),
|
|
36204
|
+
prefixes: require$$1$3.types.optional(require$$1$3.types.map(require$$1$3.types.string), {
|
|
35903
36205
|
'GO:': 'http://purl.obolibrary.org/obo/GO_',
|
|
35904
36206
|
'SO:': 'http://purl.obolibrary.org/obo/SO_',
|
|
35905
36207
|
}),
|
|
@@ -36039,7 +36341,7 @@
|
|
|
36039
36341
|
setCurrentOntologyTerm(term);
|
|
36040
36342
|
}
|
|
36041
36343
|
}, (error) => {
|
|
36042
|
-
if (!signal.aborted && !require$$1$
|
|
36344
|
+
if (!signal.aborted && !require$$1$2.isAbortException(error)) {
|
|
36043
36345
|
setCurrentOntologyTermInvalid(String(error));
|
|
36044
36346
|
}
|
|
36045
36347
|
});
|
|
@@ -36058,7 +36360,7 @@
|
|
|
36058
36360
|
setTermChoices(soTerms);
|
|
36059
36361
|
}
|
|
36060
36362
|
}, (error) => {
|
|
36061
|
-
if (!signal.aborted && !require$$1$
|
|
36363
|
+
if (!signal.aborted && !require$$1$2.isAbortException(error)) {
|
|
36062
36364
|
session.notify(error.message, 'error');
|
|
36063
36365
|
}
|
|
36064
36366
|
});
|
|
@@ -36384,7 +36686,7 @@
|
|
|
36384
36686
|
}
|
|
36385
36687
|
const featureIds = [];
|
|
36386
36688
|
// Let's add featureId to each child recursively
|
|
36387
|
-
const newFeatureLine = generateNewIds(require$$1$
|
|
36689
|
+
const newFeatureLine = generateNewIds(require$$1$3.getSnapshot(sourceFeature), featureIds);
|
|
36388
36690
|
// Clear possible parentId -attribute.
|
|
36389
36691
|
const attributeMap = {
|
|
36390
36692
|
...newFeatureLine.attributes,
|
|
@@ -36472,7 +36774,7 @@
|
|
|
36472
36774
|
|
|
36473
36775
|
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
36474
36776
|
function DeleteAssembly({ changeManager, handleClose, session, }) {
|
|
36475
|
-
const { internetAccounts } = require$$1$
|
|
36777
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
36476
36778
|
const [selectedAssembly, setSelectedAssembly] = React.useState();
|
|
36477
36779
|
const [errorMessage, setErrorMessage] = React.useState('');
|
|
36478
36780
|
const [confirmDelete, setconfirmDelete] = React.useState(false);
|
|
@@ -36554,7 +36856,7 @@
|
|
|
36554
36856
|
changedIds: [sourceFeature._id],
|
|
36555
36857
|
typeName: 'DeleteFeatureChange',
|
|
36556
36858
|
assembly: sourceAssemblyId,
|
|
36557
|
-
deletedFeature: require$$1$
|
|
36859
|
+
deletedFeature: require$$1$3.getSnapshot(sourceFeature),
|
|
36558
36860
|
parentFeatureId: sourceFeature.parent?._id,
|
|
36559
36861
|
});
|
|
36560
36862
|
await changeManager.submit(change);
|
|
@@ -36744,7 +37046,7 @@
|
|
|
36744
37046
|
continue;
|
|
36745
37047
|
}
|
|
36746
37048
|
for (const [, feature] of features) {
|
|
36747
|
-
gff3Items.push(dist$2.makeGFF3Feature(require$$1$
|
|
37049
|
+
gff3Items.push(dist$2.makeGFF3Feature(require$$1$3.getSnapshot(feature)));
|
|
36748
37050
|
}
|
|
36749
37051
|
}
|
|
36750
37052
|
for (const sequenceFeature of sequenceFeatures) {
|
|
@@ -36934,7 +37236,7 @@
|
|
|
36934
37236
|
}
|
|
36935
37237
|
|
|
36936
37238
|
function LogOut({ handleClose, session }) {
|
|
36937
|
-
const { internetAccounts } = require$$1$
|
|
37239
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
36938
37240
|
const [errorMessage, setErrorMessage] = React.useState('');
|
|
36939
37241
|
const apolloInternetAccounts = internetAccounts.filter((ia) => ia.type === 'ApolloInternetAccount');
|
|
36940
37242
|
if (apolloInternetAccounts.length === 0) {
|
|
@@ -36969,7 +37271,7 @@
|
|
|
36969
37271
|
}
|
|
36970
37272
|
|
|
36971
37273
|
function ManageChecks({ handleClose, session }) {
|
|
36972
|
-
const { internetAccounts } = require$$1$
|
|
37274
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
36973
37275
|
const [selectedAssembly, setSelectedAssembly] = React.useState();
|
|
36974
37276
|
const [errorMessage, setErrorMessage] = React.useState('');
|
|
36975
37277
|
const [submitted, setSubmitted] = React.useState(false);
|
|
@@ -37130,7 +37432,7 @@
|
|
|
37130
37432
|
|
|
37131
37433
|
/* eslint-disable @typescript-eslint/use-unknown-in-catch-callback-variable */
|
|
37132
37434
|
function ManageUsers({ changeManager, handleClose, session, }) {
|
|
37133
|
-
const { internetAccounts } = require$$1$
|
|
37435
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
37134
37436
|
const apolloInternetAccounts = internetAccounts.filter((ia) => ia.type === 'ApolloInternetAccount' && ia.role?.includes('admin'));
|
|
37135
37437
|
if (apolloInternetAccounts.length === 0) {
|
|
37136
37438
|
throw new Error('No Apollo internet account found');
|
|
@@ -37185,7 +37487,26 @@
|
|
|
37185
37487
|
headerName: 'Role',
|
|
37186
37488
|
width: 140,
|
|
37187
37489
|
type: 'singleSelect',
|
|
37188
|
-
valueOptions: ['', '
|
|
37490
|
+
valueOptions: ['readOnly', 'user', 'admin', 'none'],
|
|
37491
|
+
getOptionLabel(value) {
|
|
37492
|
+
switch (value) {
|
|
37493
|
+
case 'readOnly': {
|
|
37494
|
+
return 'Read-only';
|
|
37495
|
+
}
|
|
37496
|
+
case 'user': {
|
|
37497
|
+
return 'User';
|
|
37498
|
+
}
|
|
37499
|
+
case 'admin': {
|
|
37500
|
+
return 'Admin';
|
|
37501
|
+
}
|
|
37502
|
+
case 'none': {
|
|
37503
|
+
return 'None';
|
|
37504
|
+
}
|
|
37505
|
+
default: {
|
|
37506
|
+
return 'unknown';
|
|
37507
|
+
}
|
|
37508
|
+
}
|
|
37509
|
+
},
|
|
37189
37510
|
editable: true,
|
|
37190
37511
|
},
|
|
37191
37512
|
{
|
|
@@ -37767,7 +38088,7 @@
|
|
|
37767
38088
|
// }
|
|
37768
38089
|
// const hiliteRegex = /(?<=<em class="hilite">)(.*?)(?=<\/em>)/g
|
|
37769
38090
|
function TermTagWithTooltip({ getTagProps, index, ontology, termId, }) {
|
|
37770
|
-
const manager = require$$1$
|
|
38091
|
+
const manager = require$$1$3.getParent(ontology, 2);
|
|
37771
38092
|
const [description, setDescription] = React__namespace.useState('');
|
|
37772
38093
|
const [errorMessage, setErrorMessage] = React__namespace.useState('');
|
|
37773
38094
|
React__namespace.useEffect(() => {
|
|
@@ -37808,7 +38129,7 @@
|
|
|
37808
38129
|
const [options, setOptions] = React__namespace.useState([]);
|
|
37809
38130
|
const [loading, setLoading] = React__namespace.useState(false);
|
|
37810
38131
|
const [errorMessage, setErrorMessage] = React__namespace.useState('');
|
|
37811
|
-
const getOntologyTerms = React__namespace.useMemo(() => require$$0$
|
|
38132
|
+
const getOntologyTerms = React__namespace.useMemo(() => require$$0$2.debounce(async (request, callback) => {
|
|
37812
38133
|
if (!ontology) {
|
|
37813
38134
|
return;
|
|
37814
38135
|
}
|
|
@@ -37838,7 +38159,7 @@
|
|
|
37838
38159
|
callback(options);
|
|
37839
38160
|
}
|
|
37840
38161
|
catch (error) {
|
|
37841
|
-
if (!require$$1$
|
|
38162
|
+
if (!require$$1$2.isAbortException(error)) {
|
|
37842
38163
|
setErrorMessage(String(error));
|
|
37843
38164
|
}
|
|
37844
38165
|
}
|
|
@@ -37968,7 +38289,7 @@
|
|
|
37968
38289
|
}
|
|
37969
38290
|
function ModifyFeatureAttribute({ changeManager, handleClose, session, sourceAssemblyId, sourceFeature, }) {
|
|
37970
38291
|
const { notify } = session;
|
|
37971
|
-
const { internetAccounts } = require$$1$
|
|
38292
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
37972
38293
|
const internetAccount = React.useMemo(() => {
|
|
37973
38294
|
return internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
37974
38295
|
}, [internetAccounts]);
|
|
@@ -37979,12 +38300,12 @@
|
|
|
37979
38300
|
if (key.startsWith('gff_')) {
|
|
37980
38301
|
const newKey = key.slice(4);
|
|
37981
38302
|
const capitalizedKey = newKey.charAt(0).toUpperCase() + newKey.slice(1);
|
|
37982
|
-
return [capitalizedKey, require$$1$
|
|
38303
|
+
return [capitalizedKey, require$$1$3.getSnapshot(value)];
|
|
37983
38304
|
}
|
|
37984
38305
|
if (key === '_id') {
|
|
37985
|
-
return ['ID', require$$1$
|
|
38306
|
+
return ['ID', require$$1$3.getSnapshot(value)];
|
|
37986
38307
|
}
|
|
37987
|
-
return [key, require$$1$
|
|
38308
|
+
return [key, require$$1$3.getSnapshot(value)];
|
|
37988
38309
|
})));
|
|
37989
38310
|
const [showAddNewForm, setShowAddNewForm] = React.useState(false);
|
|
37990
38311
|
const [newAttributeKey, setNewAttributeKey] = React.useState('');
|
|
@@ -38237,7 +38558,7 @@
|
|
|
38237
38558
|
adapter: { type: 'ApolloSequenceAdapter', assemblyId },
|
|
38238
38559
|
metadata: {
|
|
38239
38560
|
apollo: true,
|
|
38240
|
-
...(require$$1$
|
|
38561
|
+
...(require$$1$2.isElectron
|
|
38241
38562
|
? { file: file.path }
|
|
38242
38563
|
: {}),
|
|
38243
38564
|
},
|
|
@@ -38288,7 +38609,7 @@
|
|
|
38288
38609
|
},
|
|
38289
38610
|
}));
|
|
38290
38611
|
function ViewChangeLog({ handleClose, session }) {
|
|
38291
|
-
const { internetAccounts } = require$$1$
|
|
38612
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
38292
38613
|
const apolloInternetAccount = internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
38293
38614
|
if (!apolloInternetAccount) {
|
|
38294
38615
|
throw new Error('No Apollo internet account found');
|
|
@@ -38564,7 +38885,7 @@
|
|
|
38564
38885
|
}
|
|
38565
38886
|
|
|
38566
38887
|
function ViewCheckResults({ handleClose, session, }) {
|
|
38567
|
-
const { internetAccounts } = require$$1$
|
|
38888
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
38568
38889
|
const { collaborationServerDriver } = session.apolloDataStore;
|
|
38569
38890
|
const apolloInternetAccount = internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
38570
38891
|
if (!apolloInternetAccount) {
|
|
@@ -38815,7 +39136,7 @@
|
|
|
38815
39136
|
setLoginTypes(data);
|
|
38816
39137
|
}
|
|
38817
39138
|
getAuthTypes().catch((error) => {
|
|
38818
|
-
require$$1$
|
|
39139
|
+
require$$1$2.isAbortException(error) ? '' : setErrorMessage(String(error));
|
|
38819
39140
|
});
|
|
38820
39141
|
return () => {
|
|
38821
39142
|
controller.abort();
|
|
@@ -38861,7 +39182,7 @@
|
|
|
38861
39182
|
const stateModelFactory$2 = (configSchema) => {
|
|
38862
39183
|
return pluggableElementTypes.InternetAccount.named('ApolloInternetAccount')
|
|
38863
39184
|
.props({
|
|
38864
|
-
type: require$$1$
|
|
39185
|
+
type: require$$1$3.types.literal('ApolloInternetAccount'),
|
|
38865
39186
|
configuration: configuration.ConfigurationReference(configSchema),
|
|
38866
39187
|
})
|
|
38867
39188
|
.views((self) => ({
|
|
@@ -38892,7 +39213,7 @@
|
|
|
38892
39213
|
const dec = dist$2.getDecodedToken(token);
|
|
38893
39214
|
const { role } = dec;
|
|
38894
39215
|
if (!role && !roleNotificationSent) {
|
|
38895
|
-
const { session } = require$$1$
|
|
39216
|
+
const { session } = require$$1$3.getRoot(self);
|
|
38896
39217
|
session.notify('You have registered as a user but have not been given access. Ask your administrator to enable access for your account.', 'warning');
|
|
38897
39218
|
// notify
|
|
38898
39219
|
roleNotificationSent = true;
|
|
@@ -38936,7 +39257,7 @@
|
|
|
38936
39257
|
resolve(token);
|
|
38937
39258
|
},
|
|
38938
39259
|
async openAuthWindow(type, resolve, reject) {
|
|
38939
|
-
const redirectUri = require$$1$
|
|
39260
|
+
const redirectUri = require$$1$2.isElectron
|
|
38940
39261
|
? 'http://localhost/auth'
|
|
38941
39262
|
: window.location.origin + window.location.pathname;
|
|
38942
39263
|
const url = new URL('auth/login', self.baseURL);
|
|
@@ -38946,7 +39267,7 @@
|
|
|
38946
39267
|
});
|
|
38947
39268
|
url.search = params.toString();
|
|
38948
39269
|
const eventName = `JBrowseAuthWindow-${self.internetAccountId}`;
|
|
38949
|
-
if (require$$1$
|
|
39270
|
+
if (require$$1$2.isElectron) {
|
|
38950
39271
|
const { ipcRenderer } = window.require('electron');
|
|
38951
39272
|
const redirectUriFromElectron = await ipcRenderer.invoke('openAuthWindow', {
|
|
38952
39273
|
internetAccountId: self.internetAccountId,
|
|
@@ -38969,7 +39290,7 @@
|
|
|
38969
39290
|
async getTokenFromUser(resolve, reject) {
|
|
38970
39291
|
const { baseURL } = self;
|
|
38971
39292
|
const authType = await new Promise((resolve, reject) => {
|
|
38972
|
-
const { session } = require$$1$
|
|
39293
|
+
const { session } = require$$1$3.getRoot(self);
|
|
38973
39294
|
const { baseURL, name } = self;
|
|
38974
39295
|
session.queueDialog((doneCallback) => [
|
|
38975
39296
|
AuthTypeSelector,
|
|
@@ -39019,7 +39340,7 @@
|
|
|
39019
39340
|
},
|
|
39020
39341
|
}))
|
|
39021
39342
|
.actions((self) => ({
|
|
39022
|
-
updateLastChangeSequenceNumber: require$$1$
|
|
39343
|
+
updateLastChangeSequenceNumber: require$$1$3.flow(function* updateLastChangeSequenceNumber() {
|
|
39023
39344
|
const { baseURL } = self;
|
|
39024
39345
|
const url = new URL('changes', baseURL);
|
|
39025
39346
|
const searchParams = new URLSearchParams({ limit: '1' });
|
|
@@ -39038,8 +39359,8 @@
|
|
|
39038
39359
|
const sequence = changes.length > 0 ? changes[0].sequence : 0;
|
|
39039
39360
|
self.setLastChangeSequenceNumber(sequence);
|
|
39040
39361
|
}),
|
|
39041
|
-
getMissingChanges: require$$1$
|
|
39042
|
-
const { session } = require$$1$
|
|
39362
|
+
getMissingChanges: require$$1$3.flow(function* getMissingChanges() {
|
|
39363
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39043
39364
|
const { changeManager } = session.apolloDataStore;
|
|
39044
39365
|
if (!self.lastChangeSequenceNumber) {
|
|
39045
39366
|
throw new Error('No LastChangeSequence stored in session. Please, refresh you browser to get last updates from server');
|
|
@@ -39074,7 +39395,7 @@
|
|
|
39074
39395
|
})
|
|
39075
39396
|
.actions((self) => ({
|
|
39076
39397
|
addSocketListeners() {
|
|
39077
|
-
const { session } = require$$1$
|
|
39398
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39078
39399
|
const { notify } = session;
|
|
39079
39400
|
const token = self.retrieveToken();
|
|
39080
39401
|
if (!token) {
|
|
@@ -39168,10 +39489,10 @@
|
|
|
39168
39489
|
return { postUserLocation: debouncePostUserLocation(postUserLocation) };
|
|
39169
39490
|
})
|
|
39170
39491
|
.actions((self) => ({
|
|
39171
|
-
initialize: require$$1$
|
|
39492
|
+
initialize: require$$1$3.flow(function* initialize(role) {
|
|
39172
39493
|
if (role === 'admin') {
|
|
39173
|
-
const rootModel = require$$1$
|
|
39174
|
-
if (require$$1$
|
|
39494
|
+
const rootModel = require$$1$3.getRoot(self);
|
|
39495
|
+
if (require$$1$2.isAbstractMenuManager(rootModel)) {
|
|
39175
39496
|
addMenuItems(rootModel);
|
|
39176
39497
|
}
|
|
39177
39498
|
}
|
|
@@ -39197,7 +39518,7 @@
|
|
|
39197
39518
|
}
|
|
39198
39519
|
// fires when app transitions from prerender, user returns to the app / tab.
|
|
39199
39520
|
if (document.visibilityState === 'visible') {
|
|
39200
|
-
const { session } = require$$1$
|
|
39521
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39201
39522
|
session.broadcastLocations();
|
|
39202
39523
|
}
|
|
39203
39524
|
});
|
|
@@ -39210,7 +39531,7 @@
|
|
|
39210
39531
|
if (inWebWorker$1) {
|
|
39211
39532
|
return;
|
|
39212
39533
|
}
|
|
39213
|
-
const { session } = require$$1$
|
|
39534
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39214
39535
|
// This can be undefined if there is no session loaded, e.g. on
|
|
39215
39536
|
// the start screen
|
|
39216
39537
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -39489,7 +39810,7 @@
|
|
|
39489
39810
|
freeResources( /* { region } */) { }
|
|
39490
39811
|
}
|
|
39491
39812
|
|
|
39492
|
-
var configSchema$
|
|
39813
|
+
var configSchema$3 = configuration.ConfigurationSchema('ApolloSequenceAdapter', {
|
|
39493
39814
|
assemblyId: {
|
|
39494
39815
|
type: 'string',
|
|
39495
39816
|
defaultValue: '',
|
|
@@ -39499,7 +39820,7 @@
|
|
|
39499
39820
|
function installApolloSequenceAdapter(pluginManager) {
|
|
39500
39821
|
pluginManager.addAdapterType(() => new AdapterType__default["default"]({
|
|
39501
39822
|
name: 'ApolloSequenceAdapter',
|
|
39502
|
-
configSchema: configSchema$
|
|
39823
|
+
configSchema: configSchema$3,
|
|
39503
39824
|
adapterMetadata: {
|
|
39504
39825
|
category: undefined,
|
|
39505
39826
|
hiddenFromGUI: true,
|
|
@@ -39563,11 +39884,11 @@
|
|
|
39563
39884
|
const featureSnap = [...features.values()].map((a) =>
|
|
39564
39885
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
39565
39886
|
// @ts-expect-error
|
|
39566
|
-
[...a.values()].map((f) => require$$1$
|
|
39887
|
+
[...a.values()].map((f) => require$$1$3.getSnapshot(f)));
|
|
39567
39888
|
const apolloInternetAccount = React.useMemo(() => {
|
|
39568
|
-
const { internetAccounts } = require$$1$
|
|
39889
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
39569
39890
|
const { assemblyName } = region;
|
|
39570
|
-
const { assemblyManager } = require$$1$
|
|
39891
|
+
const { assemblyManager } = require$$1$2.getSession(displayModel);
|
|
39571
39892
|
const assembly = assemblyManager.get(assemblyName);
|
|
39572
39893
|
if (!assembly) {
|
|
39573
39894
|
throw new Error(`No assembly found with name ${assemblyName}`);
|
|
@@ -40190,7 +40511,7 @@
|
|
|
40190
40511
|
freeResources() { }
|
|
40191
40512
|
}
|
|
40192
40513
|
|
|
40193
|
-
var configSchema$
|
|
40514
|
+
var configSchema$2 = configuration.ConfigurationSchema('ApolloTextSearchAdapter', {
|
|
40194
40515
|
assemblyNames: {
|
|
40195
40516
|
type: 'stringArray',
|
|
40196
40517
|
defaultValue: [],
|
|
@@ -40213,14 +40534,14 @@
|
|
|
40213
40534
|
pluginManager.addTextSearchAdapterType(() => new pluggableElementTypes.TextSearchAdapterType({
|
|
40214
40535
|
name: 'ApolloTextSearchAdapter',
|
|
40215
40536
|
displayName: 'Apollo text search adapter',
|
|
40216
|
-
configSchema: configSchema$
|
|
40537
|
+
configSchema: configSchema$2,
|
|
40217
40538
|
AdapterClass: ApolloTextSearchAdapter,
|
|
40218
40539
|
description: 'Apollo Text Search adapter',
|
|
40219
40540
|
}));
|
|
40220
40541
|
}
|
|
40221
40542
|
|
|
40222
40543
|
const ApolloPluginConfigurationSchema = configuration.ConfigurationSchema('ApolloPlugin', {
|
|
40223
|
-
ontologies: require$$1$
|
|
40544
|
+
ontologies: require$$1$3.types.array(OntologyRecordConfiguration),
|
|
40224
40545
|
});
|
|
40225
40546
|
|
|
40226
40547
|
function parseCigar(cigar) {
|
|
@@ -40236,12 +40557,12 @@
|
|
|
40236
40557
|
const newStateModel = stateModel
|
|
40237
40558
|
.views((self) => ({
|
|
40238
40559
|
getFirstRegion() {
|
|
40239
|
-
const lgv = require$$1$
|
|
40560
|
+
const lgv = require$$1$2.getContainingView(self);
|
|
40240
40561
|
return lgv.dynamicBlocks.contentBlocks[0];
|
|
40241
40562
|
},
|
|
40242
40563
|
getAssembly() {
|
|
40243
40564
|
const firstRegion = self.getFirstRegion();
|
|
40244
|
-
const session = require$$1$
|
|
40565
|
+
const session = require$$1$2.getSession(self);
|
|
40245
40566
|
const { assemblyManager } = session;
|
|
40246
40567
|
const { assemblyName } = firstRegion;
|
|
40247
40568
|
const assembly = assemblyManager.get(assemblyName);
|
|
@@ -40369,7 +40690,7 @@
|
|
|
40369
40690
|
assembly: assemblyId,
|
|
40370
40691
|
addedFeature: newFeature,
|
|
40371
40692
|
});
|
|
40372
|
-
const session = require$$1$
|
|
40693
|
+
const session = require$$1$2.getSession(self);
|
|
40373
40694
|
await session.apolloDataStore.changeManager.submit(change);
|
|
40374
40695
|
session.notify('Annotation added successfully', 'success');
|
|
40375
40696
|
},
|
|
@@ -40482,12 +40803,12 @@
|
|
|
40482
40803
|
if (key.startsWith('gff_')) {
|
|
40483
40804
|
const newKey = key.slice(4);
|
|
40484
40805
|
const capitalizedKey = newKey.charAt(0).toUpperCase() + newKey.slice(1);
|
|
40485
|
-
return [capitalizedKey, require$$1$
|
|
40806
|
+
return [capitalizedKey, require$$1$3.getSnapshot(value)];
|
|
40486
40807
|
}
|
|
40487
40808
|
if (key === '_id') {
|
|
40488
|
-
return ['ID', require$$1$
|
|
40809
|
+
return ['ID', require$$1$3.getSnapshot(value)];
|
|
40489
40810
|
}
|
|
40490
|
-
return [key, require$$1$
|
|
40811
|
+
return [key, require$$1$3.getSnapshot(value)];
|
|
40491
40812
|
}));
|
|
40492
40813
|
const { notify } = session;
|
|
40493
40814
|
const { changeManager } = session.apolloDataStore;
|
|
@@ -40830,7 +41151,7 @@
|
|
|
40830
41151
|
const ApolloFeatureDetailsWidget = mobxReact.observer(function ApolloFeatureDetailsWidget(props) {
|
|
40831
41152
|
const { model } = props;
|
|
40832
41153
|
const { assembly, feature, refName } = model;
|
|
40833
|
-
const session = require$$1$
|
|
41154
|
+
const session = require$$1$2.getSession(model);
|
|
40834
41155
|
const currentAssembly = session.apolloDataStore.assemblies.get(assembly);
|
|
40835
41156
|
const { classes } = useStyles$8();
|
|
40836
41157
|
if (!(feature && currentAssembly)) {
|
|
@@ -41371,7 +41692,7 @@
|
|
|
41371
41692
|
Object.defineProperty(exports, "__esModule", {
|
|
41372
41693
|
value: true
|
|
41373
41694
|
});
|
|
41374
|
-
var tslib_1 = require$$0;
|
|
41695
|
+
var tslib_1 = require$$0$1;
|
|
41375
41696
|
tslib_1.__exportStar(AnnotationFeatureModel, exports);
|
|
41376
41697
|
tslib_1.__exportStar(ApolloAssembly, exports);
|
|
41377
41698
|
tslib_1.__exportStar(ApolloRefSeq, exports);
|
|
@@ -41379,18 +41700,18 @@
|
|
|
41379
41700
|
})(dist);
|
|
41380
41701
|
|
|
41381
41702
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
41382
|
-
const ApolloFeatureDetailsWidgetModel = require$$1$
|
|
41703
|
+
const ApolloFeatureDetailsWidgetModel = require$$1$3.types
|
|
41383
41704
|
.model('ApolloFeatureDetailsWidget', {
|
|
41384
41705
|
id: mst.ElementId,
|
|
41385
|
-
type: require$$1$
|
|
41386
|
-
feature: require$$1$
|
|
41706
|
+
type: require$$1$3.types.literal('ApolloFeatureDetailsWidget'),
|
|
41707
|
+
feature: require$$1$3.types.maybe(require$$1$3.types.reference(dist.AnnotationFeatureModel, {
|
|
41387
41708
|
onInvalidated(ev) {
|
|
41388
41709
|
ev.parent.setTryReload(ev.invalidId);
|
|
41389
41710
|
ev.removeRef();
|
|
41390
41711
|
},
|
|
41391
41712
|
})),
|
|
41392
|
-
assembly: require$$1$
|
|
41393
|
-
refName: require$$1$
|
|
41713
|
+
assembly: require$$1$3.types.string,
|
|
41714
|
+
refName: require$$1$3.types.string,
|
|
41394
41715
|
})
|
|
41395
41716
|
.volatile(() => ({
|
|
41396
41717
|
tryReload: undefined,
|
|
@@ -41406,11 +41727,11 @@
|
|
|
41406
41727
|
}))
|
|
41407
41728
|
.actions((self) => ({
|
|
41408
41729
|
afterAttach() {
|
|
41409
|
-
require$$1$
|
|
41730
|
+
require$$1$3.addDisposer(self, mobx.autorun((reaction) => {
|
|
41410
41731
|
if (!self.tryReload) {
|
|
41411
41732
|
return;
|
|
41412
41733
|
}
|
|
41413
|
-
const session = require$$1$
|
|
41734
|
+
const session = require$$1$2.getSession(self);
|
|
41414
41735
|
const { apolloDataStore } = session;
|
|
41415
41736
|
if (!apolloDataStore) {
|
|
41416
41737
|
return;
|
|
@@ -41424,19 +41745,19 @@
|
|
|
41424
41745
|
}));
|
|
41425
41746
|
},
|
|
41426
41747
|
}));
|
|
41427
|
-
const ApolloTranscriptDetailsModel = require$$1$
|
|
41748
|
+
const ApolloTranscriptDetailsModel = require$$1$3.types
|
|
41428
41749
|
.model('ApolloTranscriptDetails', {
|
|
41429
41750
|
id: mst.ElementId,
|
|
41430
|
-
type: require$$1$
|
|
41431
|
-
feature: require$$1$
|
|
41751
|
+
type: require$$1$3.types.literal('ApolloTranscriptDetails'),
|
|
41752
|
+
feature: require$$1$3.types.maybe(require$$1$3.types.reference(dist.AnnotationFeatureModel, {
|
|
41432
41753
|
onInvalidated(ev) {
|
|
41433
41754
|
ev.parent.setTryReload(ev.invalidId);
|
|
41434
41755
|
ev.removeRef();
|
|
41435
41756
|
},
|
|
41436
41757
|
})),
|
|
41437
|
-
assembly: require$$1$
|
|
41438
|
-
refName: require$$1$
|
|
41439
|
-
changeManager: require$$1$
|
|
41758
|
+
assembly: require$$1$3.types.string,
|
|
41759
|
+
refName: require$$1$3.types.string,
|
|
41760
|
+
changeManager: require$$1$3.types.frozen(),
|
|
41440
41761
|
})
|
|
41441
41762
|
.volatile(() => ({
|
|
41442
41763
|
tryReload: undefined,
|
|
@@ -41452,11 +41773,11 @@
|
|
|
41452
41773
|
}))
|
|
41453
41774
|
.actions((self) => ({
|
|
41454
41775
|
afterAttach() {
|
|
41455
|
-
require$$1$
|
|
41776
|
+
require$$1$3.addDisposer(self, mobx.autorun((reaction) => {
|
|
41456
41777
|
if (!self.tryReload) {
|
|
41457
41778
|
return;
|
|
41458
41779
|
}
|
|
41459
|
-
const session = require$$1$
|
|
41780
|
+
const session = require$$1$2.getSession(self);
|
|
41460
41781
|
const { apolloDataStore } = session;
|
|
41461
41782
|
if (!apolloDataStore) {
|
|
41462
41783
|
return;
|
|
@@ -41593,8 +41914,8 @@
|
|
|
41593
41914
|
let startSeq = refData.getSequence(Number(dataPoint.min) - 2, Number(dataPoint.min));
|
|
41594
41915
|
let endSeq = refData.getSequence(Number(dataPoint.max), Number(dataPoint.max) + 2);
|
|
41595
41916
|
if (featureNew.strand === -1 && startSeq && endSeq) {
|
|
41596
|
-
startSeq = require$$1$
|
|
41597
|
-
endSeq = require$$1$
|
|
41917
|
+
startSeq = require$$1$2.revcom(startSeq);
|
|
41918
|
+
endSeq = require$$1$2.revcom(endSeq);
|
|
41598
41919
|
}
|
|
41599
41920
|
const oneCDS = {
|
|
41600
41921
|
id: featureNew._id,
|
|
@@ -41790,8 +42111,8 @@
|
|
|
41790
42111
|
let startSeq = refData.getSequence(Number(currentFeature.min) - 2, Number(currentFeature.min));
|
|
41791
42112
|
let endSeq = refData.getSequence(Number(currentFeature.max), Number(currentFeature.max) + 2);
|
|
41792
42113
|
if (currentFeature.strand === -1 && startSeq && endSeq) {
|
|
41793
|
-
startSeq = require$$1$
|
|
41794
|
-
endSeq = require$$1$
|
|
42114
|
+
startSeq = require$$1$2.revcom(startSeq);
|
|
42115
|
+
endSeq = require$$1$2.revcom(endSeq);
|
|
41795
42116
|
}
|
|
41796
42117
|
const oneCDS = {
|
|
41797
42118
|
id: currentFeature._id,
|
|
@@ -41889,7 +42210,7 @@
|
|
|
41889
42210
|
for (const item of transcriptItems) {
|
|
41890
42211
|
if (item.type === 'CDS') {
|
|
41891
42212
|
const refSeq = refData.getSequence(Number(item.min + 1), Number(item.max));
|
|
41892
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42213
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41893
42214
|
textSegments.push({ text: seqData, color: cdsColor });
|
|
41894
42215
|
}
|
|
41895
42216
|
}
|
|
@@ -41902,7 +42223,7 @@
|
|
|
41902
42223
|
item.type === 'three_prime_UTR' ||
|
|
41903
42224
|
item.type === 'five_prime_UTR') {
|
|
41904
42225
|
const refSeq = refData.getSequence(Number(item.min + 1), Number(item.max));
|
|
41905
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42226
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41906
42227
|
if (item.type === 'CDS') {
|
|
41907
42228
|
textSegments.push({ text: seqData, color: cdsColor });
|
|
41908
42229
|
}
|
|
@@ -41927,14 +42248,14 @@
|
|
|
41927
42248
|
count != transcriptItems.length) {
|
|
41928
42249
|
// Intron etc. between CDS/UTRs. No need to check this on very last item
|
|
41929
42250
|
const refSeq = refData.getSequence(lastEnd + 1, Number(item.min) - 1);
|
|
41930
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42251
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41931
42252
|
textSegments.push({ text: seqData, color: 'black' });
|
|
41932
42253
|
}
|
|
41933
42254
|
if (item.type === 'CDS' ||
|
|
41934
42255
|
item.type === 'three_prime_UTR' ||
|
|
41935
42256
|
item.type === 'five_prime_UTR') {
|
|
41936
42257
|
const refSeq = refData.getSequence(Number(item.min + 1), Number(item.max));
|
|
41937
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42258
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41938
42259
|
switch (item.type) {
|
|
41939
42260
|
case 'CDS': {
|
|
41940
42261
|
textSegments.push({ text: seqData, color: cdsColor });
|
|
@@ -42010,10 +42331,10 @@
|
|
|
42010
42331
|
const { classes } = useStyles$7();
|
|
42011
42332
|
const { model } = props;
|
|
42012
42333
|
const { assembly, feature, refName } = model;
|
|
42013
|
-
const session = require$$1$
|
|
42014
|
-
const apolloSession = require$$1$
|
|
42334
|
+
const session = require$$1$2.getSession(model);
|
|
42335
|
+
const apolloSession = require$$1$2.getSession(model);
|
|
42015
42336
|
const currentAssembly = apolloSession.apolloDataStore.assemblies.get(assembly);
|
|
42016
|
-
const { internetAccounts } = require$$1$
|
|
42337
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
42017
42338
|
const apolloInternetAccount = internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
42018
42339
|
const role = apolloInternetAccount ? apolloInternetAccount.role : 'admin';
|
|
42019
42340
|
const editable = ['admin', 'user'].includes(role ?? '');
|
|
@@ -42039,11 +42360,7 @@
|
|
|
42039
42360
|
React__default["default"].createElement(TranscriptSequence, { feature: feature, session: apolloSession, assembly: currentAssembly._id || '', refName: refName })));
|
|
42040
42361
|
});
|
|
42041
42362
|
|
|
42042
|
-
|
|
42043
|
-
const LGVPlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
|
|
42044
|
-
const { baseLinearDisplayConfigSchema } = LGVPlugin.exports;
|
|
42045
|
-
return configuration.ConfigurationSchema('LinearApolloDisplay', { height: { type: 'number', defaultValue: 500 } }, { baseConfiguration: baseLinearDisplayConfigSchema, explicitlyTyped: true });
|
|
42046
|
-
}
|
|
42363
|
+
const configSchema$1 = configuration.ConfigurationSchema('LinearApolloDisplay', {}, { explicitIdentifier: 'displayId', explicitlyTyped: true });
|
|
42047
42364
|
|
|
42048
42365
|
function handleFeatureTypeChange(changeManager, feature, oldType, newType) {
|
|
42049
42366
|
const featureId = feature._id;
|
|
@@ -42111,12 +42428,12 @@
|
|
|
42111
42428
|
if (key.startsWith('gff_')) {
|
|
42112
42429
|
const newKey = key.slice(4);
|
|
42113
42430
|
const capitalizedKey = newKey.charAt(0).toUpperCase() + newKey.slice(1);
|
|
42114
|
-
return [capitalizedKey, require$$1$
|
|
42431
|
+
return [capitalizedKey, require$$1$3.getSnapshot(value)];
|
|
42115
42432
|
}
|
|
42116
42433
|
if (key === '_id') {
|
|
42117
|
-
return ['ID', require$$1$
|
|
42434
|
+
return ['ID', require$$1$3.getSnapshot(value)];
|
|
42118
42435
|
}
|
|
42119
|
-
return [key, require$$1$
|
|
42436
|
+
return [key, require$$1$3.getSnapshot(value)];
|
|
42120
42437
|
})
|
|
42121
42438
|
.filter(([key]) => key) // Leave empty keys off
|
|
42122
42439
|
.map(([key, values]) => `${key}=${Array.isArray(values) ? values.join(', ') : values}`)
|
|
@@ -42215,7 +42532,7 @@
|
|
|
42215
42532
|
]);
|
|
42216
42533
|
},
|
|
42217
42534
|
});
|
|
42218
|
-
if (feature.type === 'mRNA' && require$$1$
|
|
42535
|
+
if (feature.type === 'mRNA' && require$$1$2.isSessionModelWithWidgets(session)) {
|
|
42219
42536
|
menuItems.push({
|
|
42220
42537
|
label: 'Edit transcript details',
|
|
42221
42538
|
onClick: () => {
|
|
@@ -42287,56 +42604,16 @@
|
|
|
42287
42604
|
} })));
|
|
42288
42605
|
});
|
|
42289
42606
|
|
|
42290
|
-
// TODO: get this added to LGV runtime exports so we don't have to duplicate it
|
|
42291
42607
|
const minDisplayHeight = 20;
|
|
42292
|
-
/**
|
|
42293
|
-
* #stateModel TrackHeightMixin
|
|
42294
|
-
* #category display
|
|
42295
|
-
*/
|
|
42296
|
-
const TrackHeightMixin = require$$1$4.types
|
|
42297
|
-
.model({
|
|
42298
|
-
heightPreConfig: require$$1$4.types.maybe(require$$1$4.types.refinement('displayHeight', require$$1$4.types.number, (n) => n >= minDisplayHeight)),
|
|
42299
|
-
})
|
|
42300
|
-
.volatile(() => ({
|
|
42301
|
-
scrollTop: 0,
|
|
42302
|
-
}))
|
|
42303
|
-
.views((self) => ({
|
|
42304
|
-
get height() {
|
|
42305
|
-
// @ts-expect-error getConf needs self.configuration
|
|
42306
|
-
return self.heightPreConfig ?? configuration.getConf(self, 'height');
|
|
42307
|
-
},
|
|
42308
|
-
}))
|
|
42309
|
-
.actions((self) => ({
|
|
42310
|
-
setScrollTop(scrollTop) {
|
|
42311
|
-
self.scrollTop = scrollTop;
|
|
42312
|
-
},
|
|
42313
|
-
setHeight(displayHeight) {
|
|
42314
|
-
self.heightPreConfig = Math.max(displayHeight, minDisplayHeight);
|
|
42315
|
-
return self.height;
|
|
42316
|
-
},
|
|
42317
|
-
resizeHeight(distance) {
|
|
42318
|
-
const oldHeight = self.height;
|
|
42319
|
-
const newHeight = this.setHeight(self.height + distance);
|
|
42320
|
-
return newHeight - oldHeight;
|
|
42321
|
-
},
|
|
42322
|
-
}));
|
|
42323
|
-
|
|
42324
42608
|
function baseModelFactory(_pluginManager, configSchema) {
|
|
42325
|
-
|
|
42326
|
-
// const LGVPlugin = pluginManager.getPlugin(
|
|
42327
|
-
// 'LinearGenomeViewPlugin',
|
|
42328
|
-
// ) as LinearGenomeViewPlugin
|
|
42329
|
-
// const { TrackHeightMixin } = LGVPlugin.exports
|
|
42330
|
-
return require$$1$4.types
|
|
42331
|
-
.compose(pluggableElementTypes.BaseDisplay, TrackHeightMixin)
|
|
42332
|
-
.named('BaseLinearApolloDisplay')
|
|
42609
|
+
return pluggableElementTypes.BaseDisplay.named('BaseLinearApolloDisplay')
|
|
42333
42610
|
.props({
|
|
42334
|
-
type: require$$1$
|
|
42611
|
+
type: require$$1$3.types.literal('LinearApolloDisplay'),
|
|
42335
42612
|
configuration: configuration.ConfigurationReference(configSchema),
|
|
42613
|
+
graphical: true,
|
|
42614
|
+
table: false,
|
|
42615
|
+
heightPreConfig: require$$1$3.types.maybe(require$$1$3.types.refinement('displayHeight', require$$1$3.types.number, (n) => n >= minDisplayHeight)),
|
|
42336
42616
|
})
|
|
42337
|
-
.volatile((self) => ({
|
|
42338
|
-
lgv: require$$1$3.getContainingView(self),
|
|
42339
|
-
}))
|
|
42340
42617
|
.views((self) => {
|
|
42341
42618
|
const { configuration, renderProps: superRenderProps } = self;
|
|
42342
42619
|
return {
|
|
@@ -42349,12 +42626,32 @@
|
|
|
42349
42626
|
},
|
|
42350
42627
|
};
|
|
42351
42628
|
})
|
|
42629
|
+
.volatile(() => ({
|
|
42630
|
+
scrollTop: 0,
|
|
42631
|
+
}))
|
|
42632
|
+
.views((self) => ({
|
|
42633
|
+
get lgv() {
|
|
42634
|
+
return require$$1$2.getContainingView(self);
|
|
42635
|
+
},
|
|
42636
|
+
get height() {
|
|
42637
|
+
if (self.heightPreConfig) {
|
|
42638
|
+
return self.heightPreConfig;
|
|
42639
|
+
}
|
|
42640
|
+
if (self.graphical && self.table) {
|
|
42641
|
+
return 500;
|
|
42642
|
+
}
|
|
42643
|
+
if (self.graphical) {
|
|
42644
|
+
return 200;
|
|
42645
|
+
}
|
|
42646
|
+
return 300;
|
|
42647
|
+
},
|
|
42648
|
+
}))
|
|
42352
42649
|
.views((self) => ({
|
|
42353
42650
|
get rendererTypeName() {
|
|
42354
42651
|
return self.configuration.renderer.type;
|
|
42355
42652
|
},
|
|
42356
42653
|
get session() {
|
|
42357
|
-
return require$$1$
|
|
42654
|
+
return require$$1$2.getSession(self);
|
|
42358
42655
|
},
|
|
42359
42656
|
get regions() {
|
|
42360
42657
|
const regions = self.lgv.dynamicBlocks.contentBlocks.map(({ assemblyName, end, refName, start }) => ({
|
|
@@ -42375,7 +42672,7 @@
|
|
|
42375
42672
|
.views((self) => ({
|
|
42376
42673
|
get apolloInternetAccount() {
|
|
42377
42674
|
const [region] = self.regions;
|
|
42378
|
-
const { internetAccounts } = require$$1$
|
|
42675
|
+
const { internetAccounts } = require$$1$3.getRoot(self);
|
|
42379
42676
|
const { assemblyName } = region;
|
|
42380
42677
|
const { assemblyManager } = self.session;
|
|
42381
42678
|
const assembly = assemblyManager.get(assemblyName);
|
|
@@ -42405,12 +42702,79 @@
|
|
|
42405
42702
|
.apolloSelectedFeature;
|
|
42406
42703
|
},
|
|
42407
42704
|
}))
|
|
42705
|
+
.actions((self) => ({
|
|
42706
|
+
setScrollTop(scrollTop) {
|
|
42707
|
+
self.scrollTop = scrollTop;
|
|
42708
|
+
},
|
|
42709
|
+
setHeight(displayHeight) {
|
|
42710
|
+
self.heightPreConfig = Math.max(displayHeight, minDisplayHeight);
|
|
42711
|
+
return self.height;
|
|
42712
|
+
},
|
|
42713
|
+
resizeHeight(distance) {
|
|
42714
|
+
const oldHeight = self.height;
|
|
42715
|
+
const newHeight = this.setHeight(self.height + distance);
|
|
42716
|
+
return newHeight - oldHeight;
|
|
42717
|
+
},
|
|
42718
|
+
showGraphicalOnly() {
|
|
42719
|
+
self.graphical = true;
|
|
42720
|
+
self.table = false;
|
|
42721
|
+
},
|
|
42722
|
+
showTableOnly() {
|
|
42723
|
+
self.graphical = false;
|
|
42724
|
+
self.table = true;
|
|
42725
|
+
},
|
|
42726
|
+
showGraphicalAndTable() {
|
|
42727
|
+
self.graphical = true;
|
|
42728
|
+
self.table = true;
|
|
42729
|
+
},
|
|
42730
|
+
}))
|
|
42731
|
+
.views((self) => {
|
|
42732
|
+
const { trackMenuItems: superTrackMenuItems } = self;
|
|
42733
|
+
return {
|
|
42734
|
+
trackMenuItems() {
|
|
42735
|
+
const { graphical, table } = self;
|
|
42736
|
+
return [
|
|
42737
|
+
...superTrackMenuItems(),
|
|
42738
|
+
{
|
|
42739
|
+
type: 'subMenu',
|
|
42740
|
+
label: 'Appearance',
|
|
42741
|
+
subMenu: [
|
|
42742
|
+
{
|
|
42743
|
+
label: 'Show graphical display',
|
|
42744
|
+
type: 'radio',
|
|
42745
|
+
checked: graphical && !table,
|
|
42746
|
+
onClick: () => {
|
|
42747
|
+
self.showGraphicalOnly();
|
|
42748
|
+
},
|
|
42749
|
+
},
|
|
42750
|
+
{
|
|
42751
|
+
label: 'Show table display',
|
|
42752
|
+
type: 'radio',
|
|
42753
|
+
checked: table && !graphical,
|
|
42754
|
+
onClick: () => {
|
|
42755
|
+
self.showTableOnly();
|
|
42756
|
+
},
|
|
42757
|
+
},
|
|
42758
|
+
{
|
|
42759
|
+
label: 'Show both graphical and table display',
|
|
42760
|
+
type: 'radio',
|
|
42761
|
+
checked: table && graphical,
|
|
42762
|
+
onClick: () => {
|
|
42763
|
+
self.showGraphicalAndTable();
|
|
42764
|
+
},
|
|
42765
|
+
},
|
|
42766
|
+
],
|
|
42767
|
+
},
|
|
42768
|
+
];
|
|
42769
|
+
},
|
|
42770
|
+
};
|
|
42771
|
+
})
|
|
42408
42772
|
.actions((self) => ({
|
|
42409
42773
|
setSelectedFeature(feature) {
|
|
42410
42774
|
self.session.apolloSetSelectedFeature(feature);
|
|
42411
42775
|
},
|
|
42412
42776
|
afterAttach() {
|
|
42413
|
-
require$$1$
|
|
42777
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42414
42778
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42415
42779
|
return;
|
|
42416
42780
|
}
|
|
@@ -42441,7 +42805,7 @@
|
|
|
42441
42805
|
const { end, refName, start } = region;
|
|
42442
42806
|
for (const [, feature] of self.seenFeatures) {
|
|
42443
42807
|
if (refName !== assembly?.getCanonicalRefName(feature.refSeq) ||
|
|
42444
|
-
!require$$1$
|
|
42808
|
+
!require$$1$2.doesIntersect2(start, end, feature.min, feature.max) ||
|
|
42445
42809
|
feature.length > self.featuresMinMaxLimit) {
|
|
42446
42810
|
continue;
|
|
42447
42811
|
}
|
|
@@ -42487,12 +42851,12 @@
|
|
|
42487
42851
|
const rows = [];
|
|
42488
42852
|
const { end, refName, start } = region;
|
|
42489
42853
|
for (const [id, feature] of self.seenFeatures.entries()) {
|
|
42490
|
-
if (!require$$1$
|
|
42854
|
+
if (!require$$1$3.isAlive(feature)) {
|
|
42491
42855
|
self.deleteSeenFeature(id);
|
|
42492
42856
|
continue;
|
|
42493
42857
|
}
|
|
42494
42858
|
if (refName !== assembly?.getCanonicalRefName(feature.refSeq) ||
|
|
42495
|
-
!require$$1$
|
|
42859
|
+
!require$$1$2.doesIntersect2(start, end, feature.min, feature.max)) {
|
|
42496
42860
|
continue;
|
|
42497
42861
|
}
|
|
42498
42862
|
const rowCount = getGlyph(feature).getRowCount(feature, self.lgv.bpPerPx);
|
|
@@ -42582,7 +42946,7 @@
|
|
|
42582
42946
|
}))
|
|
42583
42947
|
.actions((self) => ({
|
|
42584
42948
|
afterAttach() {
|
|
42585
|
-
require$$1$
|
|
42949
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42586
42950
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42587
42951
|
return;
|
|
42588
42952
|
}
|
|
@@ -42594,7 +42958,7 @@
|
|
|
42594
42958
|
continue;
|
|
42595
42959
|
}
|
|
42596
42960
|
for (const [, feature] of features) {
|
|
42597
|
-
if (require$$1$
|
|
42961
|
+
if (require$$1$2.doesIntersect2(region.start, region.end, feature.min, feature.max) &&
|
|
42598
42962
|
!self.seenFeatures.has(feature._id)) {
|
|
42599
42963
|
self.addSeenFeature(feature);
|
|
42600
42964
|
}
|
|
@@ -42658,7 +43022,7 @@
|
|
|
42658
43022
|
self.theme = theme;
|
|
42659
43023
|
},
|
|
42660
43024
|
afterAttach() {
|
|
42661
|
-
require$$1$
|
|
43025
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42662
43026
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42663
43027
|
return;
|
|
42664
43028
|
}
|
|
@@ -42713,7 +43077,7 @@
|
|
|
42713
43077
|
}
|
|
42714
43078
|
function reverseCodonSeq(seq) {
|
|
42715
43079
|
return [...seq]
|
|
42716
|
-
.map((c) => require$$1$
|
|
43080
|
+
.map((c) => require$$1$2.revcom(c))
|
|
42717
43081
|
.reverse()
|
|
42718
43082
|
.join('');
|
|
42719
43083
|
}
|
|
@@ -42730,7 +43094,7 @@
|
|
|
42730
43094
|
if (reverse) {
|
|
42731
43095
|
codonSeq = reverseCodonSeq(codonSeq);
|
|
42732
43096
|
}
|
|
42733
|
-
const codonLetter = require$$1$
|
|
43097
|
+
const codonLetter = require$$1$2.defaultCodonTable[codonSeq];
|
|
42734
43098
|
if (!codonLetter) {
|
|
42735
43099
|
return;
|
|
42736
43100
|
}
|
|
@@ -42749,7 +43113,7 @@
|
|
|
42749
43113
|
const LinearApolloDisplayRendering = renderingModelIntermediateFactory(pluginManager, configSchema);
|
|
42750
43114
|
return LinearApolloDisplayRendering.actions((self) => ({
|
|
42751
43115
|
afterAttach() {
|
|
42752
|
-
require$$1$
|
|
43116
|
+
require$$1$3.addDisposer(self, mobx.autorun(async () => {
|
|
42753
43117
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42754
43118
|
return;
|
|
42755
43119
|
}
|
|
@@ -42818,7 +43182,7 @@
|
|
|
42818
43182
|
drawLetter(seqTrackctx, startPx, widthPx, letter, self.sequenceRowHeight * 3);
|
|
42819
43183
|
}
|
|
42820
43184
|
// Draw reverse
|
|
42821
|
-
const revLetter = require$$1$
|
|
43185
|
+
const revLetter = require$$1$2.revcom(letter);
|
|
42822
43186
|
seqTrackctx.beginPath();
|
|
42823
43187
|
seqTrackctx.fillStyle = colorCode(revLetter, self.theme);
|
|
42824
43188
|
seqTrackctx.rect(startPx, self.sequenceRowHeight * 4, widthPx, self.sequenceRowHeight);
|
|
@@ -42845,7 +43209,7 @@
|
|
|
42845
43209
|
const LinearApolloDisplayRendering = sequenceRenderingModelFactory(pluginManager, configSchema);
|
|
42846
43210
|
return LinearApolloDisplayRendering.actions((self) => ({
|
|
42847
43211
|
afterAttach() {
|
|
42848
|
-
require$$1$
|
|
43212
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42849
43213
|
const { canvas, featureLayouts, featuresHeight, lgv } = self;
|
|
42850
43214
|
if (!lgv.initialized || self.regionCannotBeRendered()) {
|
|
42851
43215
|
return;
|
|
@@ -42863,7 +43227,7 @@
|
|
|
42863
43227
|
if (featureRow > 0) {
|
|
42864
43228
|
continue;
|
|
42865
43229
|
}
|
|
42866
|
-
if (!require$$1$
|
|
43230
|
+
if (!require$$1$2.doesIntersect2(displayedRegion.start, displayedRegion.end, feature.min, feature.max)) {
|
|
42867
43231
|
continue;
|
|
42868
43232
|
}
|
|
42869
43233
|
getGlyph(feature).draw(ctx, feature, row, self, idx);
|
|
@@ -42990,7 +43354,7 @@
|
|
|
42990
43354
|
const LinearApolloDisplayRendering = mouseEventsModelIntermediateFactory(pluginManager, configSchema);
|
|
42991
43355
|
return LinearApolloDisplayRendering.actions((self) => ({
|
|
42992
43356
|
afterAttach() {
|
|
42993
|
-
require$$1$
|
|
43357
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42994
43358
|
// This type is wrong in @jbrowse/core
|
|
42995
43359
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
42996
43360
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
@@ -43018,7 +43382,7 @@
|
|
|
43018
43382
|
continue;
|
|
43019
43383
|
}
|
|
43020
43384
|
for (const dl of cdsLocs) {
|
|
43021
|
-
const frame = require$$1$
|
|
43385
|
+
const frame = require$$1$2.getFrame(dl.min, dl.max, feature.strand ?? 1, dl.phase);
|
|
43022
43386
|
const row = getTranslationRow(frame, lgv.bpPerPx);
|
|
43023
43387
|
const offset = (lgv.bpToPx({
|
|
43024
43388
|
refName: region.refName,
|
|
@@ -43162,7 +43526,7 @@
|
|
|
43162
43526
|
}))
|
|
43163
43527
|
.actions((self) => ({
|
|
43164
43528
|
afterAttach() {
|
|
43165
|
-
require$$1$
|
|
43529
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
43166
43530
|
// This type is wrong in @jbrowse/core
|
|
43167
43531
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
43168
43532
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
@@ -43680,7 +44044,7 @@
|
|
|
43680
44044
|
ctx.fillRect(cdsStartPx, cdsTop, cdsWidthPx, cdsHeight);
|
|
43681
44045
|
if (cdsWidthPx > 2) {
|
|
43682
44046
|
ctx.clearRect(cdsStartPx + 1, cdsTop + 1, cdsWidthPx - 2, cdsHeight - 2);
|
|
43683
|
-
const frame = require$$1$
|
|
44047
|
+
const frame = require$$1$2.getFrame(cds.min, cds.max, child.strand ?? 1, cds.phase);
|
|
43684
44048
|
const frameColor = theme?.palette.framesCDS.at(frame)?.main;
|
|
43685
44049
|
const cdsColorCode = frameColor ?? 'rgb(171,71,188)';
|
|
43686
44050
|
ctx.fillStyle =
|
|
@@ -43894,7 +44258,7 @@
|
|
|
43894
44258
|
}
|
|
43895
44259
|
const exonChildren = [...mRNA.children.values()].filter((child) => child.type === 'exon');
|
|
43896
44260
|
const overlappingExon = exonChildren.find((child) => {
|
|
43897
|
-
const [start, end] = require$$1$
|
|
44261
|
+
const [start, end] = require$$1$2.intersection2(bp, bp + 1, child.min, child.max);
|
|
43898
44262
|
return start !== undefined && end !== undefined;
|
|
43899
44263
|
});
|
|
43900
44264
|
if (!overlappingExon) {
|
|
@@ -44378,10 +44742,10 @@
|
|
|
44378
44742
|
React__default["default"].createElement(HybridGrid, { model: displayState })));
|
|
44379
44743
|
});
|
|
44380
44744
|
|
|
44381
|
-
const TabularEditorStateModelType = require$$1$
|
|
44745
|
+
const TabularEditorStateModelType = require$$1$3.types
|
|
44382
44746
|
.model('TabularEditor', {
|
|
44383
44747
|
isShown: true,
|
|
44384
|
-
featureCollapsed: require$$1$
|
|
44748
|
+
featureCollapsed: require$$1$3.types.map(require$$1$3.types.boolean),
|
|
44385
44749
|
filterText: '',
|
|
44386
44750
|
})
|
|
44387
44751
|
.actions((self) => ({
|
|
@@ -44396,7 +44760,7 @@
|
|
|
44396
44760
|
},
|
|
44397
44761
|
collapseAllFeatures() {
|
|
44398
44762
|
// iterate over all seen features and set them to collapsed
|
|
44399
|
-
const display = require$$1$
|
|
44763
|
+
const display = require$$1$3.getParent(self);
|
|
44400
44764
|
for (const [featureId] of display.seenFeatures.entries()) {
|
|
44401
44765
|
self.featureCollapsed.set(featureId, true);
|
|
44402
44766
|
}
|
|
@@ -44419,7 +44783,7 @@
|
|
|
44419
44783
|
// TODO: this needs to be refactored so that the final composition of the
|
|
44420
44784
|
// state model mixins happens here in one central place
|
|
44421
44785
|
return mouseEventsModelFactory(pluginManager, configSchema)
|
|
44422
|
-
.props({ tabularEditor: require$$1$
|
|
44786
|
+
.props({ tabularEditor: require$$1$3.types.optional(TabularEditorStateModelType, {}) })
|
|
44423
44787
|
.named('LinearApolloDisplay');
|
|
44424
44788
|
}
|
|
44425
44789
|
|
|
@@ -44488,9 +44852,9 @@
|
|
|
44488
44852
|
const LinearApolloDisplay = mobxReact.observer(function LinearApolloDisplay(props) {
|
|
44489
44853
|
const theme = material.useTheme();
|
|
44490
44854
|
const { model } = props;
|
|
44491
|
-
const { apolloRowHeight, contextMenuItems: getContextMenuItems, cursor, featuresHeight, isShown, onMouseDown, onMouseLeave, onMouseMove, onMouseUp, regionCannotBeRendered, session, setCanvas, setCollaboratorCanvas, setOverlayCanvas, setSeqTrackCanvas, setSeqTrackOverlayCanvas, setTheme,
|
|
44855
|
+
const { apolloRowHeight, contextMenuItems: getContextMenuItems, cursor, featuresHeight, isShown, onMouseDown, onMouseLeave, onMouseMove, onMouseUp, regionCannotBeRendered, session, setCanvas, setCollaboratorCanvas, setOverlayCanvas, setSeqTrackCanvas, setSeqTrackOverlayCanvas, setTheme, } = model;
|
|
44492
44856
|
const { classes } = useStyles$1();
|
|
44493
|
-
const lgv = require$$1$
|
|
44857
|
+
const lgv = require$$1$2.getContainingView(model);
|
|
44494
44858
|
React.useEffect(() => {
|
|
44495
44859
|
setTheme(theme);
|
|
44496
44860
|
}, [theme, setTheme]);
|
|
@@ -44545,16 +44909,14 @@
|
|
|
44545
44909
|
React__default["default"].createElement("canvas", { ref: async (node) => {
|
|
44546
44910
|
await Promise.resolve();
|
|
44547
44911
|
setOverlayCanvas(node);
|
|
44548
|
-
}, width: lgv.dynamicBlocks.totalWidthPx, height: featuresHeight, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp,
|
|
44549
|
-
tabularEditor.showPane();
|
|
44550
|
-
}, className: classes.canvas, style: { cursor: cursor ?? 'default' }, "data-testid": "overlayCanvas" }),
|
|
44912
|
+
}, width: lgv.dynamicBlocks.totalWidthPx, height: featuresHeight, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, className: classes.canvas, style: { cursor: cursor ?? 'default' }, "data-testid": "overlayCanvas" }),
|
|
44551
44913
|
lgv.displayedRegions.flatMap((region, idx) => {
|
|
44552
44914
|
const assembly = assemblyManager.get(region.assemblyName);
|
|
44553
44915
|
return [...session.apolloDataStore.checkResults.values()]
|
|
44554
44916
|
.filter((checkResult) => assembly?.isValidRefName(checkResult.refSeq) &&
|
|
44555
44917
|
assembly.getCanonicalRefName(checkResult.refSeq) ===
|
|
44556
44918
|
region.refName &&
|
|
44557
|
-
require$$1$
|
|
44919
|
+
require$$1$2.doesIntersect2(region.start, region.end, checkResult.start, checkResult.end))
|
|
44558
44920
|
.map((checkResult) => {
|
|
44559
44921
|
const left = (lgv.bpToPx({
|
|
44560
44922
|
refName: region.refName,
|
|
@@ -44683,25 +45045,33 @@
|
|
|
44683
45045
|
});
|
|
44684
45046
|
const DisplayComponent = mobxReact.observer(function DisplayComponent({ model, ...other }) {
|
|
44685
45047
|
const { classes } = useStyles();
|
|
44686
|
-
const { height: overallHeight, isShown, selectedFeature, tabularEditor, toggleShown, } = model;
|
|
44687
|
-
const detailsHeight = tabularEditor.isShown ? model.detailsHeight : 0;
|
|
44688
|
-
const featureAreaHeight = isShown
|
|
44689
|
-
? overallHeight - detailsHeight - accordionControlHeight * 2
|
|
44690
|
-
: 0;
|
|
44691
|
-
const onDetailsResize = (delta) => {
|
|
44692
|
-
model.setDetailsHeight(model.detailsHeight - delta);
|
|
44693
|
-
};
|
|
45048
|
+
const { detailsHeight, graphical, height: overallHeight, isShown, selectedFeature, table, tabularEditor, toggleShown, } = model;
|
|
44694
45049
|
const canvasScrollContainerRef = React.useRef(null);
|
|
44695
45050
|
React.useEffect(() => {
|
|
44696
45051
|
scrollSelectedFeatureIntoView(model, canvasScrollContainerRef);
|
|
44697
45052
|
}, [model, selectedFeature]);
|
|
45053
|
+
const onDetailsResize = (delta) => {
|
|
45054
|
+
model.setDetailsHeight(detailsHeight - delta);
|
|
45055
|
+
};
|
|
45056
|
+
if (graphical && table) {
|
|
45057
|
+
const tabularHeight = tabularEditor.isShown ? detailsHeight : 0;
|
|
45058
|
+
const featureAreaHeight = isShown
|
|
45059
|
+
? overallHeight - detailsHeight - accordionControlHeight * 2
|
|
45060
|
+
: 0;
|
|
45061
|
+
return (React__default["default"].createElement("div", { style: { height: overallHeight } },
|
|
45062
|
+
React__default["default"].createElement(AccordionControl, { open: isShown, title: "Graphical", onClick: toggleShown }),
|
|
45063
|
+
React__default["default"].createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: featureAreaHeight } },
|
|
45064
|
+
React__default["default"].createElement(LinearApolloDisplay, { model: model, ...other })),
|
|
45065
|
+
React__default["default"].createElement(AccordionControl, { title: "Table", open: tabularEditor.isShown, onClick: tabularEditor.togglePane, onResize: onDetailsResize }),
|
|
45066
|
+
React__default["default"].createElement("div", { className: classes.details, style: { height: tabularHeight } },
|
|
45067
|
+
React__default["default"].createElement(TabularEditorPane, { model: model }))));
|
|
45068
|
+
}
|
|
45069
|
+
if (graphical) {
|
|
45070
|
+
return (React__default["default"].createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: overallHeight } },
|
|
45071
|
+
React__default["default"].createElement(LinearApolloDisplay, { model: model, ...other })));
|
|
45072
|
+
}
|
|
44698
45073
|
return (React__default["default"].createElement("div", { className: classes.details, style: { height: overallHeight } },
|
|
44699
|
-
React__default["default"].createElement(
|
|
44700
|
-
React__default["default"].createElement("div", { className: classes.shading, ref: canvasScrollContainerRef, style: { height: featureAreaHeight } },
|
|
44701
|
-
React__default["default"].createElement(LinearApolloDisplay, { model: model, ...other })),
|
|
44702
|
-
React__default["default"].createElement(AccordionControl, { title: "Table", open: tabularEditor.isShown, onClick: tabularEditor.togglePane, onResize: onDetailsResize }),
|
|
44703
|
-
React__default["default"].createElement("div", { style: { height: detailsHeight } },
|
|
44704
|
-
React__default["default"].createElement(TabularEditorPane, { model: model }))));
|
|
45074
|
+
React__default["default"].createElement(TabularEditorPane, { model: model })));
|
|
44705
45075
|
});
|
|
44706
45076
|
function makeSixFrameDisplayComponent(pluginManager) {
|
|
44707
45077
|
const LGVPlugin = pluginManager.getPlugin('LinearGenomeViewPlugin');
|
|
@@ -44741,15 +45111,15 @@
|
|
|
44741
45111
|
default_1 = Save["default"] = _default;
|
|
44742
45112
|
|
|
44743
45113
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
44744
|
-
const ApolloJobModel = require$$1$
|
|
45114
|
+
const ApolloJobModel = require$$1$3.types
|
|
44745
45115
|
.model('JobsManager', {})
|
|
44746
45116
|
.views((self) => ({
|
|
44747
45117
|
get jobStatusWidget() {
|
|
44748
|
-
const { widgets } = require$$1$
|
|
45118
|
+
const { widgets } = require$$1$2.getSession(self);
|
|
44749
45119
|
let jobStatusWidget = widgets.get('JobsList');
|
|
44750
45120
|
if (!jobStatusWidget) {
|
|
44751
45121
|
// @ts-expect-error: addWidget function not detected on the session
|
|
44752
|
-
jobStatusWidget = require$$1$
|
|
45122
|
+
jobStatusWidget = require$$1$2.getSession(self).addWidget('JobsListWidget', 'JobsList');
|
|
44753
45123
|
}
|
|
44754
45124
|
return jobStatusWidget;
|
|
44755
45125
|
},
|
|
@@ -44773,8 +45143,8 @@
|
|
|
44773
45143
|
* @param msg - a message to communicate to the user about the abort operation
|
|
44774
45144
|
*/
|
|
44775
45145
|
abortJob(jobName, msg) {
|
|
44776
|
-
const session = require$$1$
|
|
44777
|
-
if (require$$1$
|
|
45146
|
+
const session = require$$1$2.getSession(self);
|
|
45147
|
+
if (require$$1$2.isSessionModelWithWidgets(session)) {
|
|
44778
45148
|
session.showWidget(self.jobStatusWidget);
|
|
44779
45149
|
self.jobStatusWidget.updateJobStatusMessage(jobName, msg ?? 'Aborted unexpectedly');
|
|
44780
45150
|
// this is done to avoid issues with reusing nodes from other state trees
|
|
@@ -44792,8 +45162,8 @@
|
|
|
44792
45162
|
* @param job - the job to be run within the JobsManager
|
|
44793
45163
|
*/
|
|
44794
45164
|
runJob(job) {
|
|
44795
|
-
const session = require$$1$
|
|
44796
|
-
if (require$$1$
|
|
45165
|
+
const session = require$$1$2.getSession(self);
|
|
45166
|
+
if (require$$1$2.isSessionModelWithWidgets(session)) {
|
|
44797
45167
|
session.showWidget(self.jobStatusWidget);
|
|
44798
45168
|
self.jobStatusWidget.addJob(job);
|
|
44799
45169
|
}
|
|
@@ -44806,8 +45176,8 @@
|
|
|
44806
45176
|
* @param job - the job to be completed
|
|
44807
45177
|
*/
|
|
44808
45178
|
done(job) {
|
|
44809
|
-
const session = require$$1$
|
|
44810
|
-
if (require$$1$
|
|
45179
|
+
const session = require$$1$2.getSession(self);
|
|
45180
|
+
if (require$$1$2.isSessionModelWithWidgets(session)) {
|
|
44811
45181
|
session.showWidget(self.jobStatusWidget);
|
|
44812
45182
|
// this.setProgressPct(100)
|
|
44813
45183
|
self.jobStatusWidget.removeJob(job.name);
|
|
@@ -44838,9 +45208,9 @@
|
|
|
44838
45208
|
async submit(change, opts = {}) {
|
|
44839
45209
|
const { addToRecents = true, submitToBackend = true, updateJobsManager = false, } = opts;
|
|
44840
45210
|
// pre-validate
|
|
44841
|
-
const session = require$$1$
|
|
45211
|
+
const session = require$$1$2.getSession(this.dataStore);
|
|
44842
45212
|
const controller = new AbortController();
|
|
44843
|
-
const { jobsManager } = require$$1$
|
|
45213
|
+
const { jobsManager } = require$$1$2.getSession(this.dataStore);
|
|
44844
45214
|
const job = {
|
|
44845
45215
|
name: change.typeName,
|
|
44846
45216
|
statusMessage: 'Pre-validating',
|
|
@@ -44932,7 +45302,7 @@
|
|
|
44932
45302
|
async revertLastChange() {
|
|
44933
45303
|
const lastChange = this.recentChanges.pop();
|
|
44934
45304
|
if (!lastChange) {
|
|
44935
|
-
const session = require$$1$
|
|
45305
|
+
const session = require$$1$2.getSession(this.dataStore);
|
|
44936
45306
|
session.notify('No changes to undo!', 'warning');
|
|
44937
45307
|
return;
|
|
44938
45308
|
}
|
|
@@ -44974,7 +45344,7 @@
|
|
|
44974
45344
|
*/
|
|
44975
45345
|
async getFeatures(region) {
|
|
44976
45346
|
const { assemblyName, end, refName, start } = region;
|
|
44977
|
-
const { assemblyManager } = require$$1$
|
|
45347
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
44978
45348
|
const assembly = assemblyManager.get(assemblyName);
|
|
44979
45349
|
if (!assembly) {
|
|
44980
45350
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45033,7 +45403,7 @@
|
|
|
45033
45403
|
const inFlightKey = `${region.refName}:${region.start}-${region.end}`;
|
|
45034
45404
|
const inFlightPromise = this.inFlight.get(inFlightKey);
|
|
45035
45405
|
const { assemblyName, end, refName, start } = region;
|
|
45036
|
-
const { assemblyManager } = require$$1$
|
|
45406
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45037
45407
|
const assembly = assemblyManager.get(assemblyName);
|
|
45038
45408
|
if (!assembly) {
|
|
45039
45409
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45093,7 +45463,7 @@
|
|
|
45093
45463
|
return seq;
|
|
45094
45464
|
}
|
|
45095
45465
|
async getRefNameAliases(assemblyName) {
|
|
45096
|
-
const { assemblyManager } = require$$1$
|
|
45466
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45097
45467
|
const assembly = assemblyManager.get(assemblyName);
|
|
45098
45468
|
if (!assembly) {
|
|
45099
45469
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45125,7 +45495,7 @@
|
|
|
45125
45495
|
});
|
|
45126
45496
|
}
|
|
45127
45497
|
async getRegions(assemblyName) {
|
|
45128
|
-
const { assemblyManager } = require$$1$
|
|
45498
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45129
45499
|
const assembly = assemblyManager.get(assemblyName);
|
|
45130
45500
|
if (!assembly) {
|
|
45131
45501
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45155,7 +45525,7 @@
|
|
|
45155
45525
|
}));
|
|
45156
45526
|
}
|
|
45157
45527
|
getAssemblies(internetAccountId) {
|
|
45158
|
-
const { assemblyManager } = require$$1$
|
|
45528
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45159
45529
|
return assemblyManager.assemblies.filter((assembly) => {
|
|
45160
45530
|
const sequenceMetadata = configuration.getConf(assembly, ['sequence', 'metadata']);
|
|
45161
45531
|
if (sequenceMetadata &&
|
|
@@ -45240,7 +45610,7 @@
|
|
|
45240
45610
|
return regions;
|
|
45241
45611
|
}
|
|
45242
45612
|
getAssemblies() {
|
|
45243
|
-
const { assemblyManager } = require$$1$
|
|
45613
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45244
45614
|
return assemblyManager.assemblies.filter((assembly) => {
|
|
45245
45615
|
const sequenceMetadata = configuration.getConf(assembly, ['sequence', 'metadata']);
|
|
45246
45616
|
return Boolean(sequenceMetadata &&
|
|
@@ -45260,7 +45630,7 @@
|
|
|
45260
45630
|
/* eslint-disable @typescript-eslint/require-await */
|
|
45261
45631
|
class DesktopFileDriver extends BackendDriver {
|
|
45262
45632
|
async loadAssembly(assemblyName) {
|
|
45263
|
-
const { assemblyManager } = require$$1$
|
|
45633
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45264
45634
|
const assembly = assemblyManager.get(assemblyName);
|
|
45265
45635
|
if (!assembly) {
|
|
45266
45636
|
throw new Error(`Assembly ${assemblyName} not found`);
|
|
@@ -45318,7 +45688,7 @@
|
|
|
45318
45688
|
return regions;
|
|
45319
45689
|
}
|
|
45320
45690
|
getAssemblies() {
|
|
45321
|
-
const { assemblyManager } = require$$1$
|
|
45691
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45322
45692
|
return assemblyManager.assemblies.filter((assembly) => {
|
|
45323
45693
|
const sequenceMetadata = configuration.getConf(assembly, ['sequence', 'metadata']);
|
|
45324
45694
|
return Boolean(sequenceMetadata &&
|
|
@@ -45331,7 +45701,7 @@
|
|
|
45331
45701
|
if (!dist$3.isAssemblySpecificChange(change)) {
|
|
45332
45702
|
throw new Error(`Cannot use this type of change with local file: "${change.typeName}"`);
|
|
45333
45703
|
}
|
|
45334
|
-
const { assemblyManager } = require$$1$
|
|
45704
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45335
45705
|
const assembly = assemblyManager.get(change.assembly);
|
|
45336
45706
|
if (!assembly) {
|
|
45337
45707
|
throw new Error(`Could not find assembly with name "${change.assembly}"`);
|
|
@@ -45363,7 +45733,7 @@
|
|
|
45363
45733
|
for (const [, refSeq] of clientAssembly.refSeqs) {
|
|
45364
45734
|
const { features } = refSeq;
|
|
45365
45735
|
for (const [, feature] of features) {
|
|
45366
|
-
gff3Items.push(dist$2.makeGFF3Feature(require$$1$
|
|
45736
|
+
gff3Items.push(dist$2.makeGFF3Feature(require$$1$3.getSnapshot(feature)));
|
|
45367
45737
|
}
|
|
45368
45738
|
}
|
|
45369
45739
|
for (const [, refSeq] of clientAssembly.refSeqs) {
|
|
@@ -45388,22 +45758,22 @@
|
|
|
45388
45758
|
}
|
|
45389
45759
|
|
|
45390
45760
|
function clientDataStoreFactory(AnnotationFeatureExtended) {
|
|
45391
|
-
return require$$1$
|
|
45761
|
+
return require$$1$3.types
|
|
45392
45762
|
.model('ClientDataStore', {
|
|
45393
|
-
typeName: require$$1$
|
|
45394
|
-
assemblies: require$$1$
|
|
45395
|
-
checkResults: require$$1$
|
|
45763
|
+
typeName: require$$1$3.types.optional(require$$1$3.types.literal('Client'), 'Client'),
|
|
45764
|
+
assemblies: require$$1$3.types.map(dist.ApolloAssembly),
|
|
45765
|
+
checkResults: require$$1$3.types.map(dist.CheckResult),
|
|
45396
45766
|
})
|
|
45397
45767
|
.views((self) => ({
|
|
45398
45768
|
get internetAccounts() {
|
|
45399
|
-
return require$$1$
|
|
45769
|
+
return require$$1$3.getRoot(self).internetAccounts;
|
|
45400
45770
|
},
|
|
45401
45771
|
get pluginConfiguration() {
|
|
45402
|
-
return require$$1$
|
|
45772
|
+
return require$$1$3.getRoot(self).jbrowse.configuration
|
|
45403
45773
|
.ApolloPlugin;
|
|
45404
45774
|
},
|
|
45405
45775
|
getFeature(featureId) {
|
|
45406
|
-
return require$$1$
|
|
45776
|
+
return require$$1$3.resolveIdentifier(AnnotationFeatureExtended, self.assemblies, featureId);
|
|
45407
45777
|
},
|
|
45408
45778
|
}))
|
|
45409
45779
|
.actions((self) => ({
|
|
@@ -45438,7 +45808,7 @@
|
|
|
45438
45808
|
parent.deleteChild(featureId);
|
|
45439
45809
|
}
|
|
45440
45810
|
else {
|
|
45441
|
-
const refSeq = require$$1$
|
|
45811
|
+
const refSeq = require$$1$3.getParentOfType(feature, dist.ApolloRefSeq);
|
|
45442
45812
|
refSeq.deleteFeature(_id);
|
|
45443
45813
|
}
|
|
45444
45814
|
},
|
|
@@ -45463,14 +45833,14 @@
|
|
|
45463
45833
|
changeManager: new ChangeManager(self),
|
|
45464
45834
|
collaborationServerDriver: new CollaborationServerDriver(self),
|
|
45465
45835
|
inMemoryFileDriver: new InMemoryFileDriver(self),
|
|
45466
|
-
desktopFileDriver: require$$1$
|
|
45836
|
+
desktopFileDriver: require$$1$2.isElectron
|
|
45467
45837
|
? new DesktopFileDriver(self)
|
|
45468
45838
|
: undefined,
|
|
45469
45839
|
ontologyManager: OntologyManagerType.create(),
|
|
45470
45840
|
}))
|
|
45471
45841
|
.actions((self) => ({
|
|
45472
45842
|
afterCreate() {
|
|
45473
|
-
require$$1$
|
|
45843
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
45474
45844
|
// Merge in the ontologies from our plugin configuration.
|
|
45475
45845
|
// Ontologies of a given name that are already in the session
|
|
45476
45846
|
// take precedence over the ontologies in the configuration.
|
|
@@ -45499,7 +45869,7 @@
|
|
|
45499
45869
|
if (!assemblyId) {
|
|
45500
45870
|
return self.collaborationServerDriver;
|
|
45501
45871
|
}
|
|
45502
|
-
const session = require$$1$
|
|
45872
|
+
const session = require$$1$2.getSession(self);
|
|
45503
45873
|
const { assemblyManager } = session;
|
|
45504
45874
|
const assembly = assemblyManager.get(assemblyId);
|
|
45505
45875
|
if (!assembly) {
|
|
@@ -45509,7 +45879,7 @@
|
|
|
45509
45879
|
'sequence',
|
|
45510
45880
|
'metadata',
|
|
45511
45881
|
]);
|
|
45512
|
-
if (require$$1$
|
|
45882
|
+
if (require$$1$2.isElectron && file) {
|
|
45513
45883
|
return self.desktopFileDriver;
|
|
45514
45884
|
}
|
|
45515
45885
|
if (internetAccountConfigId) {
|
|
@@ -45523,7 +45893,7 @@
|
|
|
45523
45893
|
}
|
|
45524
45894
|
let configId = internetAccountId;
|
|
45525
45895
|
if (assemblyName && !configId) {
|
|
45526
|
-
const { assemblyManager } = require$$1$
|
|
45896
|
+
const { assemblyManager } = require$$1$2.getSession(self);
|
|
45527
45897
|
const assembly = assemblyManager.get(assemblyName);
|
|
45528
45898
|
if (!assembly) {
|
|
45529
45899
|
throw new Error(`No assembly found with name ${assemblyName}`);
|
|
@@ -45542,7 +45912,7 @@
|
|
|
45542
45912
|
},
|
|
45543
45913
|
}))
|
|
45544
45914
|
.actions((self) => ({
|
|
45545
|
-
loadFeatures: require$$1$
|
|
45915
|
+
loadFeatures: require$$1$3.flow(function* loadFeatures(regions) {
|
|
45546
45916
|
for (const region of regions) {
|
|
45547
45917
|
const backendDriver = self.getBackendDriver(region.assemblyName);
|
|
45548
45918
|
if (!backendDriver) {
|
|
@@ -45574,7 +45944,7 @@
|
|
|
45574
45944
|
self.addCheckResults(checkResults);
|
|
45575
45945
|
}
|
|
45576
45946
|
}),
|
|
45577
|
-
loadRefSeq: require$$1$
|
|
45947
|
+
loadRefSeq: require$$1$3.flow(function* loadRefSeq(regions) {
|
|
45578
45948
|
for (const region of regions) {
|
|
45579
45949
|
const backendDriver = self.getBackendDriver(region.assemblyName);
|
|
45580
45950
|
if (!backendDriver) {
|
|
@@ -45607,9 +45977,9 @@
|
|
|
45607
45977
|
const ClientDataStore = clientDataStoreFactory(AnnotationFeatureExtended);
|
|
45608
45978
|
const sm = sessionModel
|
|
45609
45979
|
.props({
|
|
45610
|
-
apolloDataStore: require$$1$
|
|
45611
|
-
apolloSelectedFeature: require$$1$
|
|
45612
|
-
jobsManager: require$$1$
|
|
45980
|
+
apolloDataStore: require$$1$3.types.optional(ClientDataStore, { typeName: 'Client' }),
|
|
45981
|
+
apolloSelectedFeature: require$$1$3.types.safeReference(AnnotationFeatureExtended),
|
|
45982
|
+
jobsManager: require$$1$3.types.optional(ApolloJobModel, {}),
|
|
45613
45983
|
})
|
|
45614
45984
|
.extend(() => {
|
|
45615
45985
|
const collabs = mobx.observable.array([]);
|
|
@@ -45673,7 +46043,7 @@
|
|
|
45673
46043
|
}
|
|
45674
46044
|
},
|
|
45675
46045
|
broadcastLocations() {
|
|
45676
|
-
const { internetAccounts } = require$$1$
|
|
46046
|
+
const { internetAccounts } = require$$1$3.getRoot(self);
|
|
45677
46047
|
const locations = [];
|
|
45678
46048
|
for (const view of self.views) {
|
|
45679
46049
|
if (view.type !== 'LinearGenomeView') {
|
|
@@ -45717,16 +46087,16 @@
|
|
|
45717
46087
|
},
|
|
45718
46088
|
}))
|
|
45719
46089
|
.actions((self) => ({
|
|
45720
|
-
afterCreate: require$$1$
|
|
46090
|
+
afterCreate: require$$1$3.flow(function* afterCreate() {
|
|
45721
46091
|
// When the initial config.json loads, it doesn't include the Apollo
|
|
45722
46092
|
// tracks, which would result in a potentially invalid session snapshot
|
|
45723
46093
|
// if any tracks are open. Here we copy the session snapshot, apply an
|
|
45724
46094
|
// empty session snapshot, and then restore the original session
|
|
45725
46095
|
// snapshot after the updated config.json loads.
|
|
45726
|
-
const sessionSnapshot = require$$1$
|
|
46096
|
+
const sessionSnapshot = require$$1$3.getSnapshot(self);
|
|
45727
46097
|
const { id, name } = sessionSnapshot;
|
|
45728
|
-
require$$1$
|
|
45729
|
-
const { internetAccounts, jbrowse } = require$$1$
|
|
46098
|
+
require$$1$3.applySnapshot(self, { name, id });
|
|
46099
|
+
const { internetAccounts, jbrowse } = require$$1$3.getRoot(self);
|
|
45730
46100
|
mobx.autorun(() => {
|
|
45731
46101
|
// broadcastLocations() // **** This is not working and therefore we need to duplicate broadcastLocations() -method code here because autorun() does not observe changes otherwise
|
|
45732
46102
|
const locations = [];
|
|
@@ -45804,8 +46174,8 @@
|
|
|
45804
46174
|
console.error(error);
|
|
45805
46175
|
continue;
|
|
45806
46176
|
}
|
|
45807
|
-
require$$1$
|
|
45808
|
-
require$$1$
|
|
46177
|
+
require$$1$3.applySnapshot(jbrowse, jbrowseConfig);
|
|
46178
|
+
require$$1$3.applySnapshot(self, sessionSnapshot);
|
|
45809
46179
|
}
|
|
45810
46180
|
}),
|
|
45811
46181
|
beforeDestroy() {
|
|
@@ -45829,16 +46199,16 @@
|
|
|
45829
46199
|
{
|
|
45830
46200
|
label: 'Save track to Apollo',
|
|
45831
46201
|
onClick: async () => {
|
|
45832
|
-
const { internetAccounts, jbrowse } = require$$1$
|
|
45833
|
-
const currentConfig = require$$1$
|
|
46202
|
+
const { internetAccounts, jbrowse } = require$$1$3.getRoot(self);
|
|
46203
|
+
const currentConfig = require$$1$3.getSnapshot(jbrowse);
|
|
45834
46204
|
let filteredConfig;
|
|
45835
46205
|
filteredConfig = dist$2.filterJBrowseConfig(currentConfig);
|
|
45836
46206
|
if (Object.keys(filteredConfig).length === 0) {
|
|
45837
46207
|
filteredConfig = undefined;
|
|
45838
46208
|
}
|
|
45839
|
-
|
|
46209
|
+
const trackConfigSnapshot = require$$1$3.getSnapshot(conf);
|
|
45840
46210
|
const newTrackId = trackId.slice(0, trackId.length - sessionTrackIdentifier.length);
|
|
45841
|
-
|
|
46211
|
+
const newTrackConfigSnapshot = {
|
|
45842
46212
|
...trackConfigSnapshot,
|
|
45843
46213
|
trackId: newTrackId,
|
|
45844
46214
|
};
|
|
@@ -45853,7 +46223,7 @@
|
|
|
45853
46223
|
...filteredConfig,
|
|
45854
46224
|
tracks: filteredConfig?.tracks && [
|
|
45855
46225
|
...filteredConfig.tracks,
|
|
45856
|
-
|
|
46226
|
+
newTrackConfigSnapshot,
|
|
45857
46227
|
],
|
|
45858
46228
|
},
|
|
45859
46229
|
});
|
|
@@ -45864,6 +46234,10 @@
|
|
|
45864
46234
|
const { notify } = self;
|
|
45865
46235
|
notify('Track added', 'success');
|
|
45866
46236
|
}
|
|
46237
|
+
// @ts-expect-error This method is missing in the JB types
|
|
46238
|
+
self.deleteTrackConf(conf);
|
|
46239
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
46240
|
+
jbrowse.addTrackConf(newTrackConfigSnapshot);
|
|
45867
46241
|
},
|
|
45868
46242
|
icon: default_1,
|
|
45869
46243
|
},
|
|
@@ -45873,8 +46247,8 @@
|
|
|
45873
46247
|
{
|
|
45874
46248
|
label: 'Remove track from Apollo',
|
|
45875
46249
|
onClick: async () => {
|
|
45876
|
-
const { internetAccounts, jbrowse } = require$$1$
|
|
45877
|
-
const currentConfig = require$$1$
|
|
46250
|
+
const { internetAccounts, jbrowse } = require$$1$3.getRoot(self);
|
|
46251
|
+
const currentConfig = require$$1$3.getSnapshot(jbrowse);
|
|
45878
46252
|
let filteredConfig;
|
|
45879
46253
|
filteredConfig = dist$2.filterJBrowseConfig(currentConfig);
|
|
45880
46254
|
if (Object.keys(filteredConfig).length === 0) {
|
|
@@ -45900,6 +46274,10 @@
|
|
|
45900
46274
|
const { notify } = self;
|
|
45901
46275
|
notify('Track removed', 'success');
|
|
45902
46276
|
}
|
|
46277
|
+
// @ts-expect-error This method is missing in the JB types
|
|
46278
|
+
self.deleteTrackConf(conf);
|
|
46279
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
46280
|
+
jbrowse.deleteTrackConf(conf);
|
|
45903
46281
|
},
|
|
45904
46282
|
icon: default_1,
|
|
45905
46283
|
},
|
|
@@ -45907,7 +46285,7 @@
|
|
|
45907
46285
|
},
|
|
45908
46286
|
};
|
|
45909
46287
|
});
|
|
45910
|
-
return require$$1$
|
|
46288
|
+
return require$$1$3.types.snapshotProcessor(sm, {
|
|
45911
46289
|
postProcessor(snap) {
|
|
45912
46290
|
snap.apolloSelectedFeature = undefined;
|
|
45913
46291
|
const assemblies = Object.fromEntries(Object.entries(snap.apolloDataStore.assemblies).filter(([, assembly]) => assembly.backendDriverType === 'InMemoryFileDriver'));
|
|
@@ -45937,7 +46315,7 @@
|
|
|
45937
46315
|
const { BaseLinearDisplay } = LGVPlugin.exports;
|
|
45938
46316
|
return BaseLinearDisplay.named('SixFrameFeatureDisplay')
|
|
45939
46317
|
.props({
|
|
45940
|
-
type: require$$1$
|
|
46318
|
+
type: require$$1$3.types.literal('SixFrameFeatureDisplay'),
|
|
45941
46319
|
configuration: configuration.ConfigurationReference(configSchema),
|
|
45942
46320
|
apolloRowHeight: 20,
|
|
45943
46321
|
detailsMinHeight: 200,
|
|
@@ -45980,23 +46358,23 @@
|
|
|
45980
46358
|
return regions;
|
|
45981
46359
|
},
|
|
45982
46360
|
regionCannotBeRendered( /* region */) {
|
|
45983
|
-
const view = require$$1$
|
|
46361
|
+
const view = require$$1$2.getContainingView(self);
|
|
45984
46362
|
if (view && view.bpPerPx >= 200) {
|
|
45985
46363
|
return 'Zoom in to see annotations';
|
|
45986
46364
|
}
|
|
45987
46365
|
return;
|
|
45988
46366
|
},
|
|
45989
46367
|
get session() {
|
|
45990
|
-
return require$$1$
|
|
46368
|
+
return require$$1$2.getSession(self);
|
|
45991
46369
|
},
|
|
45992
46370
|
}))
|
|
45993
46371
|
.actions((self) => {
|
|
45994
46372
|
let previousBlockKeys = [];
|
|
45995
46373
|
return {
|
|
45996
46374
|
afterAttach() {
|
|
45997
|
-
require$$1$
|
|
45998
|
-
const session = require$$1$
|
|
45999
|
-
const view = require$$1$
|
|
46375
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
46376
|
+
const session = require$$1$2.getSession(self);
|
|
46377
|
+
const view = require$$1$2.getContainingView(self);
|
|
46000
46378
|
if (view.initialized) {
|
|
46001
46379
|
if (self.regionCannotBeRendered()) {
|
|
46002
46380
|
return;
|
|
@@ -46032,12 +46410,12 @@
|
|
|
46032
46410
|
return self.configuration.renderer.type;
|
|
46033
46411
|
},
|
|
46034
46412
|
get changeManager() {
|
|
46035
|
-
const session = require$$1$
|
|
46413
|
+
const session = require$$1$2.getSession(self);
|
|
46036
46414
|
return session.apolloDataStore.changeManager;
|
|
46037
46415
|
},
|
|
46038
46416
|
get sequence() {
|
|
46039
46417
|
const { regions } = self;
|
|
46040
|
-
const session = require$$1$
|
|
46418
|
+
const session = require$$1$2.getSession(self);
|
|
46041
46419
|
const seq = new Map();
|
|
46042
46420
|
for (const region of regions) {
|
|
46043
46421
|
const assembly = session.apolloDataStore.assemblies.get(region.assemblyName);
|
|
@@ -46049,7 +46427,7 @@
|
|
|
46049
46427
|
},
|
|
46050
46428
|
get features() {
|
|
46051
46429
|
const { regions } = self;
|
|
46052
|
-
const session = require$$1$
|
|
46430
|
+
const session = require$$1$2.getSession(self);
|
|
46053
46431
|
const features = new Map();
|
|
46054
46432
|
for (const region of regions) {
|
|
46055
46433
|
const assembly = session.apolloDataStore.assemblies.get(region.assemblyName);
|
|
@@ -46122,7 +46500,7 @@
|
|
|
46122
46500
|
if (reversed) {
|
|
46123
46501
|
tilt = (fullSeq.length + fullStart) % 3;
|
|
46124
46502
|
effectiveFrame = (reversePhaseMap[i] + tilt + 3) % 3;
|
|
46125
|
-
seqSliced = require$$1$
|
|
46503
|
+
seqSliced = require$$1$2.reverse(fullSeq).slice(effectiveFrame);
|
|
46126
46504
|
}
|
|
46127
46505
|
else {
|
|
46128
46506
|
tilt = 3 - (fullStart % 3);
|
|
@@ -46131,14 +46509,14 @@
|
|
|
46131
46509
|
}
|
|
46132
46510
|
for (let j = 0; j < seqSliced.length; j += 3) {
|
|
46133
46511
|
const codon = seqSliced.slice(j, j + 3);
|
|
46134
|
-
const normalizedCodon = reversed ? require$$1$
|
|
46512
|
+
const normalizedCodon = reversed ? require$$1$2.reverse(require$$1$2.revcom(codon)) : codon;
|
|
46135
46513
|
const start = reversed
|
|
46136
46514
|
? fullStart + seqSliced.length - (3 + j)
|
|
46137
46515
|
: fullStart + j + effectiveFrame;
|
|
46138
|
-
if (require$$1$
|
|
46516
|
+
if (require$$1$2.defaultStarts.includes(normalizedCodon.toUpperCase())) {
|
|
46139
46517
|
starts.push(start);
|
|
46140
46518
|
}
|
|
46141
|
-
else if (require$$1$
|
|
46519
|
+
else if (require$$1$2.defaultStops.includes(normalizedCodon.toUpperCase())) {
|
|
46142
46520
|
stops.push(start);
|
|
46143
46521
|
}
|
|
46144
46522
|
}
|
|
@@ -46208,7 +46586,7 @@
|
|
|
46208
46586
|
return featureLayout;
|
|
46209
46587
|
},
|
|
46210
46588
|
getAssemblyId(assemblyName) {
|
|
46211
|
-
const { assemblyManager } = require$$1$
|
|
46589
|
+
const { assemblyManager } = require$$1$2.getSession(self);
|
|
46212
46590
|
const assembly = assemblyManager.get(assemblyName);
|
|
46213
46591
|
if (!assembly) {
|
|
46214
46592
|
throw new Error(`Could not find assembly named ${assemblyName}`);
|
|
@@ -46216,17 +46594,17 @@
|
|
|
46216
46594
|
return assembly.name;
|
|
46217
46595
|
},
|
|
46218
46596
|
get selectedFeature() {
|
|
46219
|
-
const session = require$$1$
|
|
46597
|
+
const session = require$$1$2.getSession(self);
|
|
46220
46598
|
return session.apolloSelectedFeature;
|
|
46221
46599
|
},
|
|
46222
46600
|
get setSelectedFeature() {
|
|
46223
|
-
const session = require$$1$
|
|
46601
|
+
const session = require$$1$2.getSession(self);
|
|
46224
46602
|
return session.apolloSetSelectedFeature;
|
|
46225
46603
|
},
|
|
46226
46604
|
}))
|
|
46227
46605
|
.actions((self) => ({
|
|
46228
46606
|
setSelectedFeature(feature) {
|
|
46229
|
-
const session = require$$1$
|
|
46607
|
+
const session = require$$1$2.getSession(self);
|
|
46230
46608
|
session.apolloSetSelectedFeature(feature);
|
|
46231
46609
|
},
|
|
46232
46610
|
setApolloFeatureUnderMouse(feature) {
|
|
@@ -46427,7 +46805,7 @@
|
|
|
46427
46805
|
});
|
|
46428
46806
|
});
|
|
46429
46807
|
pluginManager.addDisplayType(() => {
|
|
46430
|
-
const configSchema =
|
|
46808
|
+
const configSchema = configSchema$1;
|
|
46431
46809
|
return new pluggableElementTypes.DisplayType({
|
|
46432
46810
|
name: 'LinearApolloDisplay',
|
|
46433
46811
|
configSchema,
|
|
@@ -46472,7 +46850,7 @@
|
|
|
46472
46850
|
label: 'Add new feature',
|
|
46473
46851
|
icon: default_1$a,
|
|
46474
46852
|
onClick: () => {
|
|
46475
|
-
const session = require$$1$
|
|
46853
|
+
const session = require$$1$2.getSession(self);
|
|
46476
46854
|
const { leftOffset, rightOffset } = self;
|
|
46477
46855
|
const selectedRegions = self.getSelectedRegions(leftOffset, rightOffset);
|
|
46478
46856
|
session.queueDialog((doneCallback) => [
|
|
@@ -46561,7 +46939,7 @@
|
|
|
46561
46939
|
}
|
|
46562
46940
|
}
|
|
46563
46941
|
configure(pluginManager) {
|
|
46564
|
-
if (require$$1$
|
|
46942
|
+
if (require$$1$2.isAbstractMenuManager(pluginManager.rootModel)) {
|
|
46565
46943
|
pluginManager.rootModel.appendToMenu('Apollo', {
|
|
46566
46944
|
label: 'Download GFF3',
|
|
46567
46945
|
onClick: (session) => {
|