@apollo-annotation/jbrowse-plugin-apollo 0.1.19 → 0.1.20
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 +33 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.development.js +33 -6
- 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 +879 -590
- 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/OntologyManager/OntologyStore/fulltext.ts +0 -1
- package/src/components/AddAssembly.tsx +1 -1
- package/src/components/ManageUsers.tsx +20 -1
- package/src/session/session.ts +11 -3
|
@@ -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,7 +5541,7 @@
|
|
|
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, 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, _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:
|
|
@@ -5551,50 +5552,52 @@
|
|
|
5551
5552
|
_iterator2.s();
|
|
5552
5553
|
case 5:
|
|
5553
5554
|
if ((_step2 = _iterator2.n()).done) {
|
|
5554
|
-
_context.next =
|
|
5555
|
+
_context.next = 67;
|
|
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;
|
|
5591
5593
|
return assemblyModel.create([{
|
|
5592
5594
|
_id: assembly,
|
|
5593
5595
|
name: assemblyName,
|
|
5594
5596
|
user: user,
|
|
5595
|
-
status: -1
|
|
5597
|
+
status: -1,
|
|
5598
|
+
fileId: fileId
|
|
5596
5599
|
}]);
|
|
5597
|
-
case
|
|
5600
|
+
case 25:
|
|
5598
5601
|
_yield$assemblyModel$ = _context.sent;
|
|
5599
5602
|
_yield$assemblyModel$2 = _slicedToArray(_yield$assemblyModel$, 1);
|
|
5600
5603
|
newAssemblyDoc = _yield$assemblyModel$2[0];
|
|
@@ -5602,81 +5605,81 @@
|
|
|
5602
5605
|
(_logger$debug3 = logger.debug) === null || _logger$debug3 === void 0 || _logger$debug3.call(logger, "File type: \"".concat(fileDoc.type, "\""));
|
|
5603
5606
|
// Add refSeqs
|
|
5604
5607
|
// We cannot use Mongo 'session' / transaction here because Mongo has 16 MB limit for transaction
|
|
5605
|
-
_context.next =
|
|
5608
|
+
_context.next = 32;
|
|
5606
5609
|
return this.addRefSeqIntoDb(fileDoc, newAssemblyDoc._id.toString(), backend);
|
|
5607
|
-
case
|
|
5610
|
+
case 32:
|
|
5608
5611
|
// Loop all features
|
|
5609
5612
|
(_logger$debug4 = logger.debug) === null || _logger$debug4 === void 0 || _logger$debug4.call(logger, "**************** LOOPATAAN KAIKKI FEATURET SEURAAVAKSI File type: \"".concat(fileDoc.type, "\""));
|
|
5610
5613
|
featureStream = filesService.parseGFF3(filesService.getFileStream(fileDoc));
|
|
5611
5614
|
_iteratorAbruptCompletion = false;
|
|
5612
5615
|
_didIteratorError = false;
|
|
5613
|
-
_context.prev =
|
|
5616
|
+
_context.prev = 36;
|
|
5614
5617
|
_iterator = _asyncIterator(featureStream);
|
|
5615
|
-
case
|
|
5616
|
-
_context.next =
|
|
5618
|
+
case 38:
|
|
5619
|
+
_context.next = 40;
|
|
5617
5620
|
return _iterator.next();
|
|
5618
|
-
case
|
|
5621
|
+
case 40:
|
|
5619
5622
|
if (!(_iteratorAbruptCompletion = !(_step = _context.sent).done)) {
|
|
5620
|
-
_context.next =
|
|
5623
|
+
_context.next = 49;
|
|
5621
5624
|
break;
|
|
5622
5625
|
}
|
|
5623
5626
|
f = _step.value;
|
|
5624
5627
|
gff3Feature = f;
|
|
5625
5628
|
(_logger$verbose = logger.verbose) === null || _logger$verbose === void 0 || _logger$verbose.call(logger, "ENTRY=".concat(JSON.stringify(gff3Feature)));
|
|
5626
5629
|
// Add new feature into database
|
|
5627
|
-
_context.next =
|
|
5630
|
+
_context.next = 46;
|
|
5628
5631
|
return this.addFeatureIntoDb(gff3Feature, backend);
|
|
5629
|
-
case
|
|
5632
|
+
case 46:
|
|
5630
5633
|
_iteratorAbruptCompletion = false;
|
|
5631
|
-
_context.next =
|
|
5634
|
+
_context.next = 38;
|
|
5632
5635
|
break;
|
|
5633
|
-
case
|
|
5634
|
-
_context.next =
|
|
5636
|
+
case 49:
|
|
5637
|
+
_context.next = 55;
|
|
5635
5638
|
break;
|
|
5636
|
-
case
|
|
5637
|
-
_context.prev =
|
|
5638
|
-
_context.t0 = _context["catch"](
|
|
5639
|
+
case 51:
|
|
5640
|
+
_context.prev = 51;
|
|
5641
|
+
_context.t0 = _context["catch"](36);
|
|
5639
5642
|
_didIteratorError = true;
|
|
5640
5643
|
_iteratorError = _context.t0;
|
|
5641
|
-
case
|
|
5642
|
-
_context.prev = 54;
|
|
5644
|
+
case 55:
|
|
5643
5645
|
_context.prev = 55;
|
|
5646
|
+
_context.prev = 56;
|
|
5644
5647
|
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
|
|
5645
|
-
_context.next =
|
|
5648
|
+
_context.next = 60;
|
|
5646
5649
|
break;
|
|
5647
5650
|
}
|
|
5648
|
-
_context.next =
|
|
5651
|
+
_context.next = 60;
|
|
5649
5652
|
return _iterator["return"]();
|
|
5650
|
-
case
|
|
5651
|
-
_context.prev =
|
|
5653
|
+
case 60:
|
|
5654
|
+
_context.prev = 60;
|
|
5652
5655
|
if (!_didIteratorError) {
|
|
5653
|
-
_context.next =
|
|
5656
|
+
_context.next = 63;
|
|
5654
5657
|
break;
|
|
5655
5658
|
}
|
|
5656
5659
|
throw _iteratorError;
|
|
5657
|
-
case 62:
|
|
5658
|
-
return _context.finish(59);
|
|
5659
5660
|
case 63:
|
|
5660
|
-
return _context.finish(
|
|
5661
|
+
return _context.finish(60);
|
|
5661
5662
|
case 64:
|
|
5663
|
+
return _context.finish(55);
|
|
5664
|
+
case 65:
|
|
5662
5665
|
_context.next = 5;
|
|
5663
5666
|
break;
|
|
5664
|
-
case
|
|
5665
|
-
_context.next =
|
|
5667
|
+
case 67:
|
|
5668
|
+
_context.next = 72;
|
|
5666
5669
|
break;
|
|
5667
|
-
case
|
|
5668
|
-
_context.prev =
|
|
5670
|
+
case 69:
|
|
5671
|
+
_context.prev = 69;
|
|
5669
5672
|
_context.t1 = _context["catch"](3);
|
|
5670
5673
|
_iterator2.e(_context.t1);
|
|
5671
|
-
case
|
|
5672
|
-
_context.prev =
|
|
5674
|
+
case 72:
|
|
5675
|
+
_context.prev = 72;
|
|
5673
5676
|
_iterator2.f();
|
|
5674
|
-
return _context.finish(
|
|
5675
|
-
case
|
|
5677
|
+
return _context.finish(72);
|
|
5678
|
+
case 75:
|
|
5676
5679
|
case "end":
|
|
5677
5680
|
return _context.stop();
|
|
5678
5681
|
}
|
|
5679
|
-
}, _callee, this, [[3,
|
|
5682
|
+
}, _callee, this, [[3, 69, 72, 75], [36, 51, 55, 65], [56,, 60, 64]]);
|
|
5680
5683
|
}));
|
|
5681
5684
|
function executeOnServer(_x) {
|
|
5682
5685
|
return _executeOnServer.apply(this, arguments);
|
|
@@ -15164,7 +15167,7 @@
|
|
|
15164
15167
|
BgzipIndexedFasta: BgzipIndexedFasta
|
|
15165
15168
|
};
|
|
15166
15169
|
|
|
15167
|
-
var require$$
|
|
15170
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(esm);
|
|
15168
15171
|
|
|
15169
15172
|
var require$$2 = /*@__PURE__*/getAugmentedNamespace(esm$1);
|
|
15170
15173
|
|
|
@@ -15176,7 +15179,7 @@
|
|
|
15176
15179
|
AddAssemblyFromExternalChange$1.AddAssemblyFromExternalChange = void 0;
|
|
15177
15180
|
/* eslint-disable @typescript-eslint/require-await */
|
|
15178
15181
|
var common_1$f = dist$1;
|
|
15179
|
-
var indexedfasta_1 = require$$
|
|
15182
|
+
var indexedfasta_1$1 = require$$0;
|
|
15180
15183
|
var generic_filehandle_1 = require$$2;
|
|
15181
15184
|
var AddAssemblyFromExternalChange = /*#__PURE__*/function (_common_1$AssemblySpe) {
|
|
15182
15185
|
_inherits(AddAssemblyFromExternalChange, _common_1$AssemblySpe);
|
|
@@ -15247,7 +15250,7 @@
|
|
|
15247
15250
|
change = _step.value;
|
|
15248
15251
|
assemblyName = change.assemblyName, externalLocation = change.externalLocation;
|
|
15249
15252
|
fa = externalLocation.fa, fai = externalLocation.fai, gzi = externalLocation.gzi;
|
|
15250
|
-
sequenceAdapter = gzi ? new indexedfasta_1.BgzipIndexedFasta({
|
|
15253
|
+
sequenceAdapter = gzi ? new indexedfasta_1$1.BgzipIndexedFasta({
|
|
15251
15254
|
fasta: new generic_filehandle_1.RemoteFile(fa, {
|
|
15252
15255
|
fetch: fetch
|
|
15253
15256
|
}),
|
|
@@ -15257,7 +15260,7 @@
|
|
|
15257
15260
|
gzi: new generic_filehandle_1.RemoteFile(gzi, {
|
|
15258
15261
|
fetch: fetch
|
|
15259
15262
|
})
|
|
15260
|
-
}) : new indexedfasta_1.IndexedFasta({
|
|
15263
|
+
}) : new indexedfasta_1$1.IndexedFasta({
|
|
15261
15264
|
fasta: new generic_filehandle_1.RemoteFile(fa, {
|
|
15262
15265
|
fetch: fetch
|
|
15263
15266
|
}),
|
|
@@ -15412,6 +15415,7 @@
|
|
|
15412
15415
|
value: true
|
|
15413
15416
|
});
|
|
15414
15417
|
AddAssemblyFromFileChange$1.AddAssemblyFromFileChange = void 0;
|
|
15418
|
+
var indexedfasta_1 = require$$0;
|
|
15415
15419
|
var FromFileBaseChange_1$1 = FromFileBaseChange$1;
|
|
15416
15420
|
var AddAssemblyFromFileChange = /*#__PURE__*/function (_FromFileBaseChange_) {
|
|
15417
15421
|
_inherits(AddAssemblyFromFileChange, _FromFileBaseChange_);
|
|
@@ -15440,12 +15444,12 @@
|
|
|
15440
15444
|
var _changes = _slicedToArray(changes, 1),
|
|
15441
15445
|
_changes$ = _changes[0],
|
|
15442
15446
|
assemblyName = _changes$.assemblyName,
|
|
15443
|
-
|
|
15447
|
+
fileIds = _changes$.fileIds;
|
|
15444
15448
|
return {
|
|
15445
15449
|
typeName: typeName,
|
|
15446
15450
|
assembly: assembly,
|
|
15447
15451
|
assemblyName: assemblyName,
|
|
15448
|
-
|
|
15452
|
+
fileIds: fileIds
|
|
15449
15453
|
};
|
|
15450
15454
|
}
|
|
15451
15455
|
return {
|
|
@@ -15463,110 +15467,251 @@
|
|
|
15463
15467
|
key: "executeOnServer",
|
|
15464
15468
|
value: function () {
|
|
15465
15469
|
var _executeOnServer = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(backend) {
|
|
15466
|
-
var
|
|
15470
|
+
var changes, _iterator, _step, change, assemblyName, fileIds;
|
|
15467
15471
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15468
15472
|
while (1) switch (_context.prev = _context.next) {
|
|
15469
15473
|
case 0:
|
|
15470
|
-
|
|
15471
|
-
assembly = this.assembly, changes = this.changes, logger = this.logger;
|
|
15474
|
+
changes = this.changes;
|
|
15472
15475
|
_iterator = _createForOfIteratorHelper(changes);
|
|
15473
|
-
_context.prev =
|
|
15476
|
+
_context.prev = 2;
|
|
15474
15477
|
_iterator.s();
|
|
15475
|
-
case
|
|
15478
|
+
case 4:
|
|
15476
15479
|
if ((_step = _iterator.n()).done) {
|
|
15477
|
-
_context.next =
|
|
15480
|
+
_context.next = 11;
|
|
15478
15481
|
break;
|
|
15479
15482
|
}
|
|
15480
15483
|
change = _step.value;
|
|
15481
|
-
assemblyName = change.assemblyName,
|
|
15484
|
+
assemblyName = change.assemblyName, fileIds = change.fileIds;
|
|
15485
|
+
_context.next = 9;
|
|
15486
|
+
return 'gzi' in fileIds ? this.executeOnServerIndexed(backend, assemblyName, fileIds) : this.executeOnServerFasta(backend, assemblyName, fileIds.fa);
|
|
15487
|
+
case 9:
|
|
15488
|
+
_context.next = 4;
|
|
15489
|
+
break;
|
|
15490
|
+
case 11:
|
|
15491
|
+
_context.next = 16;
|
|
15492
|
+
break;
|
|
15493
|
+
case 13:
|
|
15494
|
+
_context.prev = 13;
|
|
15495
|
+
_context.t0 = _context["catch"](2);
|
|
15496
|
+
_iterator.e(_context.t0);
|
|
15497
|
+
case 16:
|
|
15498
|
+
_context.prev = 16;
|
|
15499
|
+
_iterator.f();
|
|
15500
|
+
return _context.finish(16);
|
|
15501
|
+
case 19:
|
|
15502
|
+
case "end":
|
|
15503
|
+
return _context.stop();
|
|
15504
|
+
}
|
|
15505
|
+
}, _callee, this, [[2, 13, 16, 19]]);
|
|
15506
|
+
}));
|
|
15507
|
+
function executeOnServer(_x) {
|
|
15508
|
+
return _executeOnServer.apply(this, arguments);
|
|
15509
|
+
}
|
|
15510
|
+
return executeOnServer;
|
|
15511
|
+
}()
|
|
15512
|
+
}, {
|
|
15513
|
+
key: "executeOnServerIndexed",
|
|
15514
|
+
value: function () {
|
|
15515
|
+
var _executeOnServerIndexed = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(backend, assemblyName, fileIds) {
|
|
15516
|
+
var _this$logger$debug, _this$logger;
|
|
15517
|
+
var CHUNK_SIZE, customChunkSize, FILE_UPLOAD_FOLDER, fa, fai, gzi, assemblyModel, fileModel, filesService, refSeqModel, user, faDoc, faChecksum, faiDoc, faiChecksum, gziDoc, gziChecksum, sequenceAdapter, allSequenceSizes, assemblyDoc, _yield$assemblyModel$, _yield$assemblyModel$2, newAssemblyDoc, sequenceName, _this$logger$debug2, _this$logger2, _yield$refSeqModel$cr, _yield$refSeqModel$cr2, newRefSeqDoc;
|
|
15518
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
15519
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
15520
|
+
case 0:
|
|
15521
|
+
CHUNK_SIZE = process.env.CHUNK_SIZE;
|
|
15522
|
+
customChunkSize = CHUNK_SIZE && Number(CHUNK_SIZE);
|
|
15482
15523
|
FILE_UPLOAD_FOLDER = process.env.FILE_UPLOAD_FOLDER;
|
|
15483
15524
|
if (FILE_UPLOAD_FOLDER) {
|
|
15484
|
-
|
|
15525
|
+
_context2.next = 5;
|
|
15485
15526
|
break;
|
|
15486
15527
|
}
|
|
15487
15528
|
throw new Error('No FILE_UPLOAD_FOLDER found in .env file');
|
|
15488
|
-
case
|
|
15489
|
-
|
|
15490
|
-
|
|
15529
|
+
case 5:
|
|
15530
|
+
fa = fileIds.fa, fai = fileIds.fai, gzi = fileIds.gzi;
|
|
15531
|
+
assemblyModel = backend.assemblyModel, fileModel = backend.fileModel, filesService = backend.filesService, refSeqModel = backend.refSeqModel, user = backend.user;
|
|
15532
|
+
_context2.next = 9;
|
|
15533
|
+
return fileModel.findById(fa);
|
|
15534
|
+
case 9:
|
|
15535
|
+
faDoc = _context2.sent;
|
|
15536
|
+
faChecksum = faDoc === null || faDoc === void 0 ? void 0 : faDoc.checksum;
|
|
15537
|
+
if (faChecksum) {
|
|
15538
|
+
_context2.next = 13;
|
|
15539
|
+
break;
|
|
15540
|
+
}
|
|
15541
|
+
throw new Error("No checksum for file document ".concat(faDoc));
|
|
15491
15542
|
case 13:
|
|
15492
|
-
|
|
15543
|
+
_context2.next = 15;
|
|
15544
|
+
return fileModel.findById(fai);
|
|
15545
|
+
case 15:
|
|
15546
|
+
faiDoc = _context2.sent;
|
|
15547
|
+
faiChecksum = faiDoc === null || faiDoc === void 0 ? void 0 : faiDoc.checksum;
|
|
15548
|
+
if (faiChecksum) {
|
|
15549
|
+
_context2.next = 19;
|
|
15550
|
+
break;
|
|
15551
|
+
}
|
|
15552
|
+
throw new Error("No checksum for file document ".concat(faiDoc));
|
|
15553
|
+
case 19:
|
|
15554
|
+
_context2.next = 21;
|
|
15555
|
+
return fileModel.findById(gzi);
|
|
15556
|
+
case 21:
|
|
15557
|
+
gziDoc = _context2.sent;
|
|
15558
|
+
gziChecksum = gziDoc === null || gziDoc === void 0 ? void 0 : gziDoc.checksum;
|
|
15559
|
+
if (gziChecksum) {
|
|
15560
|
+
_context2.next = 25;
|
|
15561
|
+
break;
|
|
15562
|
+
}
|
|
15563
|
+
throw new Error("No checksum for file document ".concat(gziDoc));
|
|
15564
|
+
case 25:
|
|
15565
|
+
sequenceAdapter = new indexedfasta_1.BgzipIndexedFasta({
|
|
15566
|
+
fasta: filesService.getFileHandle(faDoc),
|
|
15567
|
+
fai: filesService.getFileHandle(faiDoc),
|
|
15568
|
+
gzi: filesService.getFileHandle(gziDoc)
|
|
15569
|
+
});
|
|
15570
|
+
_context2.next = 28;
|
|
15571
|
+
return sequenceAdapter.getSequenceSizes();
|
|
15572
|
+
case 28:
|
|
15573
|
+
allSequenceSizes = _context2.sent;
|
|
15574
|
+
_context2.next = 31;
|
|
15575
|
+
return assemblyModel.findOne({
|
|
15576
|
+
name: assemblyName
|
|
15577
|
+
}).exec();
|
|
15578
|
+
case 31:
|
|
15579
|
+
assemblyDoc = _context2.sent;
|
|
15580
|
+
if (!assemblyDoc) {
|
|
15581
|
+
_context2.next = 34;
|
|
15582
|
+
break;
|
|
15583
|
+
}
|
|
15584
|
+
throw new Error("Assembly \"".concat(assemblyName, "\" already exists"));
|
|
15585
|
+
case 34:
|
|
15586
|
+
_context2.next = 36;
|
|
15587
|
+
return assemblyModel.create([{
|
|
15588
|
+
_id: this.assembly,
|
|
15589
|
+
name: assemblyName,
|
|
15590
|
+
user: user,
|
|
15591
|
+
status: -1,
|
|
15592
|
+
fileIds: fileIds
|
|
15593
|
+
}]);
|
|
15594
|
+
case 36:
|
|
15595
|
+
_yield$assemblyModel$ = _context2.sent;
|
|
15596
|
+
_yield$assemblyModel$2 = _slicedToArray(_yield$assemblyModel$, 1);
|
|
15597
|
+
newAssemblyDoc = _yield$assemblyModel$2[0];
|
|
15598
|
+
(_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, "\""));
|
|
15599
|
+
_context2.t0 = _regeneratorRuntime().keys(allSequenceSizes);
|
|
15600
|
+
case 41:
|
|
15601
|
+
if ((_context2.t1 = _context2.t0()).done) {
|
|
15602
|
+
_context2.next = 51;
|
|
15603
|
+
break;
|
|
15604
|
+
}
|
|
15605
|
+
sequenceName = _context2.t1.value;
|
|
15606
|
+
_context2.next = 45;
|
|
15607
|
+
return refSeqModel.create([_objectSpread2(_objectSpread2({
|
|
15608
|
+
name: sequenceName,
|
|
15609
|
+
assembly: newAssemblyDoc._id,
|
|
15610
|
+
length: allSequenceSizes[sequenceName]
|
|
15611
|
+
}, customChunkSize ? {
|
|
15612
|
+
chunkSize: customChunkSize
|
|
15613
|
+
} : null), {}, {
|
|
15614
|
+
user: user,
|
|
15615
|
+
status: -1
|
|
15616
|
+
})]);
|
|
15617
|
+
case 45:
|
|
15618
|
+
_yield$refSeqModel$cr = _context2.sent;
|
|
15619
|
+
_yield$refSeqModel$cr2 = _slicedToArray(_yield$refSeqModel$cr, 1);
|
|
15620
|
+
newRefSeqDoc = _yield$refSeqModel$cr2[0];
|
|
15621
|
+
(_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, "\""));
|
|
15622
|
+
_context2.next = 41;
|
|
15623
|
+
break;
|
|
15624
|
+
case 51:
|
|
15625
|
+
case "end":
|
|
15626
|
+
return _context2.stop();
|
|
15627
|
+
}
|
|
15628
|
+
}, _callee2, this);
|
|
15629
|
+
}));
|
|
15630
|
+
function executeOnServerIndexed(_x2, _x3, _x4) {
|
|
15631
|
+
return _executeOnServerIndexed.apply(this, arguments);
|
|
15632
|
+
}
|
|
15633
|
+
return executeOnServerIndexed;
|
|
15634
|
+
}()
|
|
15635
|
+
}, {
|
|
15636
|
+
key: "executeOnServerFasta",
|
|
15637
|
+
value: function () {
|
|
15638
|
+
var _executeOnServerFasta = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(backend, assemblyName, fileId) {
|
|
15639
|
+
var _this$logger$debug3, _this$logger3, _this$logger$debug4, _this$logger4, _this$logger$debug5, _this$logger5;
|
|
15640
|
+
var assemblyModel, fileModel, user, fileDoc, assemblyDoc, _yield$assemblyModel$3, _yield$assemblyModel$4, newAssemblyDoc;
|
|
15641
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
15642
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
15643
|
+
case 0:
|
|
15644
|
+
assemblyModel = backend.assemblyModel, fileModel = backend.fileModel, user = backend.user; // Get file checksum
|
|
15645
|
+
_context3.next = 3;
|
|
15646
|
+
return fileModel.findById(fileId).exec();
|
|
15647
|
+
case 3:
|
|
15648
|
+
fileDoc = _context3.sent;
|
|
15493
15649
|
if (fileDoc) {
|
|
15494
|
-
|
|
15650
|
+
_context3.next = 6;
|
|
15495
15651
|
break;
|
|
15496
15652
|
}
|
|
15497
15653
|
throw new Error("File \"".concat(fileId, "\" not found in Mongo"));
|
|
15498
|
-
case
|
|
15499
|
-
(
|
|
15654
|
+
case 6:
|
|
15655
|
+
(_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
15656
|
// Check and add new assembly
|
|
15501
|
-
|
|
15657
|
+
_context3.next = 9;
|
|
15502
15658
|
return assemblyModel.findOne({
|
|
15503
15659
|
name: assemblyName
|
|
15504
15660
|
}).exec();
|
|
15505
|
-
case
|
|
15506
|
-
assemblyDoc =
|
|
15661
|
+
case 9:
|
|
15662
|
+
assemblyDoc = _context3.sent;
|
|
15507
15663
|
if (!assemblyDoc) {
|
|
15508
|
-
|
|
15664
|
+
_context3.next = 12;
|
|
15509
15665
|
break;
|
|
15510
15666
|
}
|
|
15511
15667
|
throw new Error("Assembly \"".concat(assemblyName, "\" already exists"));
|
|
15512
|
-
case
|
|
15513
|
-
|
|
15668
|
+
case 12:
|
|
15669
|
+
_context3.next = 14;
|
|
15514
15670
|
return assemblyModel.create([{
|
|
15515
|
-
_id: assembly,
|
|
15671
|
+
_id: this.assembly,
|
|
15516
15672
|
name: assemblyName,
|
|
15517
15673
|
user: user,
|
|
15518
|
-
status: -1
|
|
15674
|
+
status: -1,
|
|
15675
|
+
fileIds: {
|
|
15676
|
+
fa: fileId
|
|
15677
|
+
}
|
|
15519
15678
|
}]);
|
|
15520
|
-
case
|
|
15521
|
-
_yield$assemblyModel$ =
|
|
15522
|
-
_yield$assemblyModel$
|
|
15523
|
-
newAssemblyDoc = _yield$assemblyModel$
|
|
15524
|
-
(
|
|
15525
|
-
(
|
|
15679
|
+
case 14:
|
|
15680
|
+
_yield$assemblyModel$3 = _context3.sent;
|
|
15681
|
+
_yield$assemblyModel$4 = _slicedToArray(_yield$assemblyModel$3, 1);
|
|
15682
|
+
newAssemblyDoc = _yield$assemblyModel$4[0];
|
|
15683
|
+
(_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, "\""));
|
|
15684
|
+
(_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
15685
|
// Add refSeqs
|
|
15527
15686
|
// We cannot use Mongo 'session' / transaction here because Mongo has 16 MB limit for transaction
|
|
15528
|
-
|
|
15687
|
+
_context3.next = 21;
|
|
15529
15688
|
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:
|
|
15689
|
+
case 21:
|
|
15545
15690
|
case "end":
|
|
15546
|
-
return
|
|
15691
|
+
return _context3.stop();
|
|
15547
15692
|
}
|
|
15548
|
-
},
|
|
15693
|
+
}, _callee3, this);
|
|
15549
15694
|
}));
|
|
15550
|
-
function
|
|
15551
|
-
return
|
|
15695
|
+
function executeOnServerFasta(_x5, _x6, _x7) {
|
|
15696
|
+
return _executeOnServerFasta.apply(this, arguments);
|
|
15552
15697
|
}
|
|
15553
|
-
return
|
|
15698
|
+
return executeOnServerFasta;
|
|
15554
15699
|
}()
|
|
15555
15700
|
}, {
|
|
15556
15701
|
key: "executeOnLocalGFF3",
|
|
15557
15702
|
value: function () {
|
|
15558
|
-
var _executeOnLocalGFF = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15559
|
-
return _regeneratorRuntime().wrap(function
|
|
15560
|
-
while (1) switch (
|
|
15703
|
+
var _executeOnLocalGFF = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_backend) {
|
|
15704
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
15705
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
15561
15706
|
case 0:
|
|
15562
15707
|
throw new Error('executeOnLocalGFF3 not implemented');
|
|
15563
15708
|
case 1:
|
|
15564
15709
|
case "end":
|
|
15565
|
-
return
|
|
15710
|
+
return _context4.stop();
|
|
15566
15711
|
}
|
|
15567
|
-
},
|
|
15712
|
+
}, _callee4);
|
|
15568
15713
|
}));
|
|
15569
|
-
function executeOnLocalGFF3(
|
|
15714
|
+
function executeOnLocalGFF3(_x8) {
|
|
15570
15715
|
return _executeOnLocalGFF.apply(this, arguments);
|
|
15571
15716
|
}
|
|
15572
15717
|
return executeOnLocalGFF3;
|
|
@@ -15574,16 +15719,16 @@
|
|
|
15574
15719
|
}, {
|
|
15575
15720
|
key: "executeOnClient",
|
|
15576
15721
|
value: function () {
|
|
15577
|
-
var _executeOnClient = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
15578
|
-
return _regeneratorRuntime().wrap(function
|
|
15579
|
-
while (1) switch (
|
|
15722
|
+
var _executeOnClient = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_dataStore) {
|
|
15723
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
15724
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
15580
15725
|
case 0:
|
|
15581
15726
|
case "end":
|
|
15582
|
-
return
|
|
15727
|
+
return _context5.stop();
|
|
15583
15728
|
}
|
|
15584
|
-
},
|
|
15729
|
+
}, _callee5);
|
|
15585
15730
|
}));
|
|
15586
|
-
function executeOnClient(
|
|
15731
|
+
function executeOnClient(_x9) {
|
|
15587
15732
|
return _executeOnClient.apply(this, arguments);
|
|
15588
15733
|
}
|
|
15589
15734
|
return executeOnClient;
|
|
@@ -16536,7 +16681,7 @@
|
|
|
16536
16681
|
});
|
|
16537
16682
|
AddRefSeqAliasesChange$1.AddRefSeqAliasesChange = void 0;
|
|
16538
16683
|
var common_1$c = dist$1;
|
|
16539
|
-
var util_1$
|
|
16684
|
+
var util_1$2 = require$$1__default$1["default"];
|
|
16540
16685
|
var AddRefSeqAliasesChange = /*#__PURE__*/function (_common_1$AssemblySpe) {
|
|
16541
16686
|
_inherits(AddRefSeqAliasesChange, _common_1$AssemblySpe);
|
|
16542
16687
|
var _super = /*#__PURE__*/_createSuper(AddRefSeqAliasesChange);
|
|
@@ -16552,7 +16697,7 @@
|
|
|
16552
16697
|
_createClass(AddRefSeqAliasesChange, [{
|
|
16553
16698
|
key: "executeOnClient",
|
|
16554
16699
|
value: function executeOnClient(clientDataStore) {
|
|
16555
|
-
var _ref = (0, util_1$
|
|
16700
|
+
var _ref = (0, util_1$2.getSession)(clientDataStore),
|
|
16556
16701
|
assemblyManager = _ref.assemblyManager;
|
|
16557
16702
|
var assembly = assemblyManager.get(this.assembly);
|
|
16558
16703
|
if (!assembly) {
|
|
@@ -16691,7 +16836,7 @@
|
|
|
16691
16836
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
16692
16837
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
16693
16838
|
var common_1$b = dist$1;
|
|
16694
|
-
var util_1 = require$$1__default$1["default"];
|
|
16839
|
+
var util_1$1 = require$$1__default$1["default"];
|
|
16695
16840
|
var DeleteAssemblyChange = /*#__PURE__*/function (_common_1$AssemblySpe) {
|
|
16696
16841
|
_inherits(DeleteAssemblyChange, _common_1$AssemblySpe);
|
|
16697
16842
|
var _super = /*#__PURE__*/_createSuper(DeleteAssemblyChange);
|
|
@@ -16822,7 +16967,7 @@
|
|
|
16822
16967
|
}
|
|
16823
16968
|
throw new Error('No data store');
|
|
16824
16969
|
case 3:
|
|
16825
|
-
session = (0, util_1.getSession)(dataStore); // If assemblyId is not present in client data store
|
|
16970
|
+
session = (0, util_1$1.getSession)(dataStore); // If assemblyId is not present in client data store
|
|
16826
16971
|
if (dataStore.assemblies.has(assembly)) {
|
|
16827
16972
|
dataStore.deleteAssembly(assembly);
|
|
16828
16973
|
}
|
|
@@ -18835,7 +18980,7 @@
|
|
|
18835
18980
|
value: true
|
|
18836
18981
|
});
|
|
18837
18982
|
exports.changes = void 0;
|
|
18838
|
-
var tslib_1 = require$$0;
|
|
18983
|
+
var tslib_1 = require$$0$1;
|
|
18839
18984
|
var AddAssemblyAndFeaturesFromFileChange_1 = AddAssemblyAndFeaturesFromFileChange$1;
|
|
18840
18985
|
var AddAssemblyFromExternalChange_1 = AddAssemblyFromExternalChange$1;
|
|
18841
18986
|
var AddAssemblyFromFileChange_1 = AddAssemblyFromFileChange$1;
|
|
@@ -19038,7 +19183,7 @@
|
|
|
19038
19183
|
value: true
|
|
19039
19184
|
});
|
|
19040
19185
|
exports.operations = void 0;
|
|
19041
|
-
var tslib_1 = require$$0;
|
|
19186
|
+
var tslib_1 = require$$0$1;
|
|
19042
19187
|
var GetAssembliesOperation_1 = GetAssembliesOperation$1;
|
|
19043
19188
|
var GetFeaturesOperation_1 = GetFeaturesOperation$1;
|
|
19044
19189
|
exports.operations = {
|
|
@@ -19514,8 +19659,8 @@
|
|
|
19514
19659
|
});
|
|
19515
19660
|
CoreValidation$1.CoreValidation = void 0;
|
|
19516
19661
|
CoreValidation$1.isTypeChange = isTypeChange;
|
|
19517
|
-
var tslib_1$
|
|
19518
|
-
var soSequenceTypes_1 = /*#__PURE__*/tslib_1$
|
|
19662
|
+
var tslib_1$2 = require$$0$1;
|
|
19663
|
+
var soSequenceTypes_1 = /*#__PURE__*/tslib_1$2.__importDefault(soSequenceTypes$1);
|
|
19519
19664
|
var Validation_1$1 = Validation$1;
|
|
19520
19665
|
function isTypeChange(thing) {
|
|
19521
19666
|
return 'oldType' in thing && 'newType' in thing;
|
|
@@ -19813,7 +19958,7 @@
|
|
|
19813
19958
|
Object.defineProperty(exports, "__esModule", {
|
|
19814
19959
|
value: true
|
|
19815
19960
|
});
|
|
19816
|
-
var tslib_1 = require$$0;
|
|
19961
|
+
var tslib_1 = require$$0$1;
|
|
19817
19962
|
tslib_1.__exportStar(Validation$1, exports);
|
|
19818
19963
|
tslib_1.__exportStar(ValidationSet$1, exports);
|
|
19819
19964
|
tslib_1.__exportStar(CoreValidation$1, exports);
|
|
@@ -19886,8 +20031,8 @@
|
|
|
19886
20031
|
});
|
|
19887
20032
|
jwtPayload.makeUserSessionId = makeUserSessionId;
|
|
19888
20033
|
jwtPayload.getDecodedToken = getDecodedToken;
|
|
19889
|
-
var tslib_1 = require$$0;
|
|
19890
|
-
var jwt_decode_1 = /*#__PURE__*/tslib_1.__importDefault(require$$1);
|
|
20034
|
+
var tslib_1$1 = require$$0$1;
|
|
20035
|
+
var jwt_decode_1 = /*#__PURE__*/tslib_1$1.__importDefault(require$$1);
|
|
19891
20036
|
function makeUserSessionId(userOrToken) {
|
|
19892
20037
|
var user = typeof userOrToken === 'string' ? (0, jwt_decode_1["default"])(userOrToken) : userOrToken;
|
|
19893
20038
|
return "".concat(user.id, "-").concat(user.iat);
|
|
@@ -19901,7 +20046,7 @@
|
|
|
19901
20046
|
Object.defineProperty(exports, "__esModule", {
|
|
19902
20047
|
value: true
|
|
19903
20048
|
});
|
|
19904
|
-
var tslib_1 = require$$0;
|
|
20049
|
+
var tslib_1 = require$$0$1;
|
|
19905
20050
|
tslib_1.__exportStar(jwtPayload, exports);
|
|
19906
20051
|
})(Common);
|
|
19907
20052
|
|
|
@@ -19913,218 +20058,302 @@
|
|
|
19913
20058
|
value: true
|
|
19914
20059
|
});
|
|
19915
20060
|
CDSCheck$1.CDSCheck = void 0;
|
|
20061
|
+
var tslib_1 = require$$0$1;
|
|
19916
20062
|
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
|
-
|
|
20063
|
+
var util_1 = require$$1__default$1["default"];
|
|
20064
|
+
var bson_objectid_1 = /*#__PURE__*/tslib_1.__importDefault(objectid);
|
|
20065
|
+
var STOP_CODONS;
|
|
20066
|
+
(function (STOP_CODONS) {
|
|
20067
|
+
STOP_CODONS[STOP_CODONS["TAG"] = 0] = "TAG";
|
|
20068
|
+
STOP_CODONS[STOP_CODONS["TAA"] = 1] = "TAA";
|
|
20069
|
+
STOP_CODONS[STOP_CODONS["TGA"] = 2] = "TGA";
|
|
20070
|
+
})(STOP_CODONS || (STOP_CODONS = {}));
|
|
20071
|
+
var iupacComplements = {
|
|
20072
|
+
G: 'C',
|
|
20073
|
+
A: 'T',
|
|
20074
|
+
T: 'A',
|
|
20075
|
+
C: 'G',
|
|
20076
|
+
R /* G or A */: 'Y',
|
|
20077
|
+
Y /* T or C */: 'R',
|
|
20078
|
+
M /* A or C */: 'K',
|
|
20079
|
+
K /* G or T */: 'M',
|
|
20080
|
+
S /* G or C */: 'S',
|
|
20081
|
+
W /* A or T */: 'W',
|
|
20082
|
+
H /* A or C or T */: 'D',
|
|
20083
|
+
B /* G or T or C */: 'V',
|
|
20084
|
+
V /* G or C or A */: 'B',
|
|
20085
|
+
D /* G or A or T */: 'H',
|
|
20086
|
+
N /* G or A or T or C */: 'N'
|
|
20087
|
+
};
|
|
20088
|
+
function reverseComplement(dna) {
|
|
20089
|
+
var complement = [];
|
|
20090
|
+
var _iterator = _createForOfIteratorHelper(dna),
|
|
20091
|
+
_step;
|
|
20092
|
+
try {
|
|
20093
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
20094
|
+
var nt = _step.value;
|
|
20095
|
+
var rc = iupacComplements[nt.toUpperCase()];
|
|
20096
|
+
if (rc === undefined) {
|
|
20097
|
+
throw new TypeError("Cannot complement nucleotide: \"".concat(nt, "\""));
|
|
20098
|
+
}
|
|
20099
|
+
if (nt === nt.toLowerCase()) {
|
|
20100
|
+
complement.push(rc.toLowerCase());
|
|
20101
|
+
} else {
|
|
20102
|
+
complement.push(rc);
|
|
20103
|
+
}
|
|
20104
|
+
}
|
|
20105
|
+
} catch (err) {
|
|
20106
|
+
_iterator.e(err);
|
|
20107
|
+
} finally {
|
|
20108
|
+
_iterator.f();
|
|
20109
|
+
}
|
|
20110
|
+
return complement.reverse().join('');
|
|
20111
|
+
}
|
|
20112
|
+
function getCDSSequence(_x, _x2, _x3) {
|
|
20113
|
+
return _getCDSSequence.apply(this, arguments);
|
|
20114
|
+
}
|
|
20115
|
+
function _getCDSSequence() {
|
|
20116
|
+
_getCDSSequence = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(cdsLocation, strand, getSequence) {
|
|
20117
|
+
var sequences;
|
|
20118
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
20119
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
20120
|
+
case 0:
|
|
20121
|
+
_context2.next = 2;
|
|
20122
|
+
return Promise.all(cdsLocation.map(function (_ref5) {
|
|
20123
|
+
var max = _ref5.max,
|
|
20124
|
+
min = _ref5.min;
|
|
20125
|
+
return getSequence(min, max);
|
|
20126
|
+
}));
|
|
20127
|
+
case 2:
|
|
20128
|
+
sequences = _context2.sent;
|
|
20129
|
+
if (!(strand === -1)) {
|
|
20130
|
+
_context2.next = 5;
|
|
20131
|
+
break;
|
|
20132
|
+
}
|
|
20133
|
+
return _context2.abrupt("return", sequences.map(function (seq) {
|
|
20134
|
+
return reverseComplement(seq);
|
|
20135
|
+
}).join(''));
|
|
20136
|
+
case 5:
|
|
20137
|
+
return _context2.abrupt("return", sequences.join(''));
|
|
20138
|
+
case 6:
|
|
20139
|
+
case "end":
|
|
20140
|
+
return _context2.stop();
|
|
20141
|
+
}
|
|
20142
|
+
}, _callee2);
|
|
20143
|
+
}));
|
|
20144
|
+
return _getCDSSequence.apply(this, arguments);
|
|
20145
|
+
}
|
|
20146
|
+
function splitSequenceInCodons(cds) {
|
|
20147
|
+
var codons = [];
|
|
20148
|
+
for (var i = 0; i <= cds.length - 3; i += 3) {
|
|
20149
|
+
codons.push(cds.slice(i, i + 3));
|
|
20150
|
+
}
|
|
20151
|
+
return codons;
|
|
20152
|
+
}
|
|
20153
|
+
function getOriginalCodonLocation(cdsLocation, strand, index) {
|
|
20154
|
+
var lengthToStart = index * 3;
|
|
20155
|
+
var lengthToEnd = lengthToStart + 3;
|
|
20156
|
+
var startLocation = undefined,
|
|
20157
|
+
endLocation = undefined;
|
|
20158
|
+
var _iterator2 = _createForOfIteratorHelper(cdsLocation),
|
|
20159
|
+
_step2;
|
|
20160
|
+
try {
|
|
20161
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
20162
|
+
var loc = _step2.value;
|
|
20163
|
+
var locLength = loc.max - loc.min;
|
|
20164
|
+
if (startLocation === undefined && locLength > lengthToStart) {
|
|
20165
|
+
startLocation = loc.min + lengthToStart;
|
|
20166
|
+
} else {
|
|
20167
|
+
lengthToStart -= locLength;
|
|
20168
|
+
}
|
|
20169
|
+
if (endLocation === undefined && locLength > lengthToEnd) {
|
|
20170
|
+
endLocation = loc.min + lengthToEnd;
|
|
20171
|
+
} else {
|
|
20172
|
+
lengthToEnd -= locLength;
|
|
20173
|
+
}
|
|
20174
|
+
if (startLocation !== undefined && endLocation !== undefined) {
|
|
20175
|
+
return [startLocation, endLocation];
|
|
20176
|
+
}
|
|
20177
|
+
}
|
|
20178
|
+
} catch (err) {
|
|
20179
|
+
_iterator2.e(err);
|
|
20180
|
+
} finally {
|
|
20181
|
+
_iterator2.f();
|
|
20182
|
+
}
|
|
20183
|
+
return;
|
|
20184
|
+
}
|
|
20185
|
+
function checkMRNA(_x4, _x5) {
|
|
20186
|
+
return _checkMRNA.apply(this, arguments);
|
|
20187
|
+
}
|
|
20188
|
+
function _checkMRNA() {
|
|
20189
|
+
_checkMRNA = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(feature, getSequence) {
|
|
20190
|
+
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;
|
|
20191
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
20192
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
20193
|
+
case 0:
|
|
20194
|
+
checkResults = [];
|
|
20195
|
+
_id = feature._id, max = feature.max, min = feature.min, refSeq = feature.refSeq, strand = feature.strand;
|
|
20196
|
+
cdsLocations = getCDSLocations(feature);
|
|
20197
|
+
if (cdsLocations) {
|
|
20198
|
+
_context3.next = 5;
|
|
20199
|
+
break;
|
|
20200
|
+
}
|
|
20201
|
+
return _context3.abrupt("return", checkResults);
|
|
20202
|
+
case 5:
|
|
20203
|
+
ids = [_id];
|
|
20204
|
+
_iterator4 = _createForOfIteratorHelper(cdsLocations);
|
|
20205
|
+
_context3.prev = 7;
|
|
20206
|
+
_iterator4.s();
|
|
20207
|
+
case 9:
|
|
20208
|
+
if ((_step4 = _iterator4.n()).done) {
|
|
20209
|
+
_context3.next = 20;
|
|
20210
|
+
break;
|
|
20211
|
+
}
|
|
20212
|
+
cdsLocation = _step4.value;
|
|
20213
|
+
_context3.next = 13;
|
|
20214
|
+
return getCDSSequence(cdsLocation, strand, getSequence);
|
|
20215
|
+
case 13:
|
|
20216
|
+
sequence = _context3.sent;
|
|
20217
|
+
codons = splitSequenceInCodons(sequence);
|
|
20218
|
+
if (sequence.length % 3 === 0) {
|
|
20219
|
+
lastCodon = codons.pop(); // Last codon is supposed to be a stop
|
|
20220
|
+
if (lastCodon && !(lastCodon.toUpperCase() in STOP_CODONS)) {
|
|
20221
|
+
checkResults.push({
|
|
20222
|
+
_id: new bson_objectid_1["default"]().toHexString(),
|
|
20223
|
+
name: 'MissingStopCodonCheck',
|
|
20224
|
+
ids: ids,
|
|
20225
|
+
refSeq: refSeq.toString(),
|
|
20226
|
+
start: max,
|
|
20227
|
+
end: max,
|
|
20228
|
+
message: "Feature \"".concat(_id, "\" is missing a stop codon")
|
|
20229
|
+
});
|
|
20230
|
+
}
|
|
20231
|
+
} else {
|
|
20232
|
+
checkResults.push({
|
|
20233
|
+
_id: new bson_objectid_1["default"]().toHexString(),
|
|
20234
|
+
name: 'MultipleOfThreeCheck',
|
|
20235
|
+
ids: ids,
|
|
20236
|
+
refSeq: refSeq.toString(),
|
|
20237
|
+
start: min,
|
|
20238
|
+
end: max,
|
|
20239
|
+
message: "The coding sequence for feature \"".concat(_id, "\" is not a multiple of three")
|
|
20240
|
+
});
|
|
20241
|
+
}
|
|
20242
|
+
_iterator5 = _createForOfIteratorHelper(codons.entries());
|
|
20243
|
+
try {
|
|
20244
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
20245
|
+
_step5$value = _slicedToArray(_step5.value, 2), idx = _step5$value[0], codon = _step5$value[1];
|
|
20246
|
+
location = getOriginalCodonLocation(cdsLocation, strand, idx);
|
|
20247
|
+
if (location && codon.toUpperCase() in STOP_CODONS) {
|
|
20248
|
+
_location = _slicedToArray(location, 2), codonStart = _location[0], codonEnd = _location[1];
|
|
20249
|
+
checkResults.push({
|
|
20250
|
+
_id: new bson_objectid_1["default"]().toHexString(),
|
|
20251
|
+
name: 'InternalStopCodonCheck',
|
|
20252
|
+
ids: ids,
|
|
20253
|
+
refSeq: refSeq.toString(),
|
|
20254
|
+
start: codonStart,
|
|
20255
|
+
end: codonEnd,
|
|
20256
|
+
message: "The coding sequence for feature \"".concat(_id, "\" has an internal stop codon")
|
|
20257
|
+
});
|
|
20258
|
+
}
|
|
20259
|
+
}
|
|
20260
|
+
} catch (err) {
|
|
20261
|
+
_iterator5.e(err);
|
|
20262
|
+
} finally {
|
|
20263
|
+
_iterator5.f();
|
|
20264
|
+
}
|
|
20265
|
+
case 18:
|
|
20266
|
+
_context3.next = 9;
|
|
20267
|
+
break;
|
|
20268
|
+
case 20:
|
|
20269
|
+
_context3.next = 25;
|
|
20270
|
+
break;
|
|
20271
|
+
case 22:
|
|
20272
|
+
_context3.prev = 22;
|
|
20273
|
+
_context3.t0 = _context3["catch"](7);
|
|
20274
|
+
_iterator4.e(_context3.t0);
|
|
20275
|
+
case 25:
|
|
20276
|
+
_context3.prev = 25;
|
|
20277
|
+
_iterator4.f();
|
|
20278
|
+
return _context3.finish(25);
|
|
20279
|
+
case 28:
|
|
20280
|
+
return _context3.abrupt("return", checkResults);
|
|
20281
|
+
case 29:
|
|
20282
|
+
case "end":
|
|
20283
|
+
return _context3.stop();
|
|
20284
|
+
}
|
|
20285
|
+
}, _callee3, null, [[7, 22, 25, 28]]);
|
|
20286
|
+
}));
|
|
20287
|
+
return _checkMRNA.apply(this, arguments);
|
|
20288
|
+
}
|
|
20289
|
+
function getCDSLocations(feature) {
|
|
20290
|
+
if (feature.type !== 'mRNA') {
|
|
20291
|
+
return;
|
|
20292
|
+
}
|
|
20293
|
+
var children = feature.children,
|
|
20294
|
+
strand = feature.strand;
|
|
20295
|
+
if (!children) {
|
|
20296
|
+
return;
|
|
20297
|
+
}
|
|
20298
|
+
var cdsChildren = Object.values(children).filter(function (child) {
|
|
20299
|
+
return child.type === 'CDS';
|
|
20300
|
+
});
|
|
20301
|
+
if (cdsChildren.length === 0) {
|
|
20302
|
+
return;
|
|
20303
|
+
}
|
|
20304
|
+
var cdsLocations = [];
|
|
20305
|
+
var _iterator3 = _createForOfIteratorHelper(cdsChildren),
|
|
20306
|
+
_step3;
|
|
20307
|
+
try {
|
|
20308
|
+
var _loop = function _loop() {
|
|
20309
|
+
var cds = _step3.value;
|
|
20310
|
+
var cdsMax = cds.max,
|
|
20311
|
+
cdsMin = cds.min;
|
|
20312
|
+
var locs = [];
|
|
20313
|
+
for (var _i = 0, _Object$values = Object.values(children); _i < _Object$values.length; _i++) {
|
|
20314
|
+
var child = _Object$values[_i];
|
|
20315
|
+
if (child.type !== 'exon') {
|
|
20316
|
+
continue;
|
|
20317
|
+
}
|
|
20318
|
+
var _ref = (0, util_1.intersection2)(cdsMin, cdsMax, child.min, child.max),
|
|
20319
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
20320
|
+
start = _ref2[0],
|
|
20321
|
+
end = _ref2[1];
|
|
20322
|
+
if (start !== undefined && end !== undefined) {
|
|
20323
|
+
locs.push({
|
|
20324
|
+
min: start,
|
|
20325
|
+
max: end
|
|
20326
|
+
});
|
|
20327
|
+
}
|
|
20328
|
+
}
|
|
20329
|
+
locs.sort(function (_ref3, _ref4) {
|
|
20330
|
+
var a = _ref3.min;
|
|
20331
|
+
var b = _ref4.min;
|
|
20332
|
+
return a - b;
|
|
20333
|
+
});
|
|
20334
|
+
if (strand === -1) {
|
|
20335
|
+
locs.reverse();
|
|
20336
|
+
}
|
|
20337
|
+
var nextPhase = 0;
|
|
20338
|
+
var phasedLocs = locs.map(function (loc) {
|
|
20339
|
+
var phase = nextPhase;
|
|
20340
|
+
nextPhase = (3 - (loc.max - loc.min - phase + 3) % 3) % 3;
|
|
20341
|
+
return _objectSpread2(_objectSpread2({}, loc), {}, {
|
|
20342
|
+
phase: phase
|
|
20343
|
+
});
|
|
20344
|
+
});
|
|
20345
|
+
cdsLocations.push(phasedLocs);
|
|
20346
|
+
};
|
|
20347
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
20348
|
+
_loop();
|
|
20349
|
+
}
|
|
20350
|
+
} catch (err) {
|
|
20351
|
+
_iterator3.e(err);
|
|
20352
|
+
} finally {
|
|
20353
|
+
_iterator3.f();
|
|
20354
|
+
}
|
|
20355
|
+
return cdsLocations;
|
|
20356
|
+
}
|
|
20128
20357
|
var CDSCheck = /*#__PURE__*/function (_common_1$Check) {
|
|
20129
20358
|
_inherits(CDSCheck, _common_1$Check);
|
|
20130
20359
|
var _super = /*#__PURE__*/_createSuper(CDSCheck);
|
|
@@ -20143,21 +20372,53 @@
|
|
|
20143
20372
|
_createClass(CDSCheck, [{
|
|
20144
20373
|
key: "checkFeature",
|
|
20145
20374
|
value: function () {
|
|
20146
|
-
var _checkFeature = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
20375
|
+
var _checkFeature = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(feature, getSequence) {
|
|
20376
|
+
var checkResults, _i2, _Object$values2, child;
|
|
20147
20377
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
20148
20378
|
while (1) switch (_context.prev = _context.next) {
|
|
20149
20379
|
case 0:
|
|
20150
|
-
|
|
20151
|
-
|
|
20380
|
+
if (!(feature.type === 'mRNA')) {
|
|
20381
|
+
_context.next = 2;
|
|
20382
|
+
break;
|
|
20383
|
+
}
|
|
20384
|
+
return _context.abrupt("return", checkMRNA(feature, getSequence));
|
|
20152
20385
|
case 2:
|
|
20386
|
+
if (feature.children) {
|
|
20387
|
+
_context.next = 4;
|
|
20388
|
+
break;
|
|
20389
|
+
}
|
|
20153
20390
|
return _context.abrupt("return", []);
|
|
20154
|
-
case
|
|
20391
|
+
case 4:
|
|
20392
|
+
checkResults = [];
|
|
20393
|
+
_i2 = 0, _Object$values2 = Object.values(feature.children);
|
|
20394
|
+
case 6:
|
|
20395
|
+
if (!(_i2 < _Object$values2.length)) {
|
|
20396
|
+
_context.next = 19;
|
|
20397
|
+
break;
|
|
20398
|
+
}
|
|
20399
|
+
child = _Object$values2[_i2];
|
|
20400
|
+
_context.t0 = checkResults.push;
|
|
20401
|
+
_context.t1 = checkResults;
|
|
20402
|
+
_context.t2 = _toConsumableArray;
|
|
20403
|
+
_context.next = 13;
|
|
20404
|
+
return this.checkFeature(child, getSequence);
|
|
20405
|
+
case 13:
|
|
20406
|
+
_context.t3 = _context.sent;
|
|
20407
|
+
_context.t4 = (0, _context.t2)(_context.t3);
|
|
20408
|
+
_context.t0.apply.call(_context.t0, _context.t1, _context.t4);
|
|
20409
|
+
case 16:
|
|
20410
|
+
_i2++;
|
|
20411
|
+
_context.next = 6;
|
|
20412
|
+
break;
|
|
20413
|
+
case 19:
|
|
20414
|
+
return _context.abrupt("return", checkResults);
|
|
20415
|
+
case 20:
|
|
20155
20416
|
case "end":
|
|
20156
20417
|
return _context.stop();
|
|
20157
20418
|
}
|
|
20158
|
-
}, _callee);
|
|
20419
|
+
}, _callee, this);
|
|
20159
20420
|
}));
|
|
20160
|
-
function checkFeature(
|
|
20421
|
+
function checkFeature(_x6, _x7) {
|
|
20161
20422
|
return _checkFeature.apply(this, arguments);
|
|
20162
20423
|
}
|
|
20163
20424
|
return checkFeature;
|
|
@@ -20172,12 +20433,13 @@
|
|
|
20172
20433
|
Object.defineProperty(exports, "__esModule", {
|
|
20173
20434
|
value: true
|
|
20174
20435
|
});
|
|
20175
|
-
var tslib_1 = require$$0;
|
|
20436
|
+
var tslib_1 = require$$0$1;
|
|
20176
20437
|
tslib_1.__exportStar(CDSCheck$1, exports);
|
|
20177
20438
|
})(Checks);
|
|
20178
20439
|
|
|
20179
20440
|
var util$1 = {};
|
|
20180
20441
|
|
|
20442
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
20181
20443
|
Object.defineProperty(util$1, "__esModule", {
|
|
20182
20444
|
value: true
|
|
20183
20445
|
});
|
|
@@ -20299,7 +20561,7 @@
|
|
|
20299
20561
|
Object.defineProperty(exports, "__esModule", {
|
|
20300
20562
|
value: true
|
|
20301
20563
|
});
|
|
20302
|
-
var tslib_1 = require$$0;
|
|
20564
|
+
var tslib_1 = require$$0$1;
|
|
20303
20565
|
tslib_1.__exportStar(Changes, exports);
|
|
20304
20566
|
tslib_1.__exportStar(Operations, exports);
|
|
20305
20567
|
tslib_1.__exportStar(Validations, exports);
|
|
@@ -20352,7 +20614,7 @@
|
|
|
20352
20614
|
}), 'Add');
|
|
20353
20615
|
default_1$a = Add["default"] = _default$c;
|
|
20354
20616
|
|
|
20355
|
-
var version = "0.1.
|
|
20617
|
+
var version = "0.1.20";
|
|
20356
20618
|
|
|
20357
20619
|
const ApolloConfigSchema = configuration.ConfigurationSchema('ApolloInternetAccount', {
|
|
20358
20620
|
baseURL: {
|
|
@@ -27870,7 +28132,7 @@
|
|
|
27870
28132
|
for (const ref of assembly.refSeqs.values()) {
|
|
27871
28133
|
for (const feature of ref.features.values()) {
|
|
27872
28134
|
for (const check of dist$3.checkRegistry.getChecks().values()) {
|
|
27873
|
-
const result = await check.checkFeature(require$$1$
|
|
28135
|
+
const result = await check.checkFeature(require$$1$3.getSnapshot(feature), (start, stop) => Promise.resolve(ref.getSequence(start, stop)));
|
|
27874
28136
|
checkResults.push(...result);
|
|
27875
28137
|
}
|
|
27876
28138
|
}
|
|
@@ -27891,7 +28153,7 @@
|
|
|
27891
28153
|
}
|
|
27892
28154
|
/** given a session, get our ApolloInternetAccount */
|
|
27893
28155
|
function getApolloInternetAccount(session) {
|
|
27894
|
-
const { internetAccounts } = require$$1$
|
|
28156
|
+
const { internetAccounts } = require$$1$3.getParent(session);
|
|
27895
28157
|
return internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
27896
28158
|
}
|
|
27897
28159
|
|
|
@@ -27954,7 +28216,7 @@
|
|
|
27954
28216
|
FileType["EXTERNAL"] = "text/x-external";
|
|
27955
28217
|
})(FileType || (FileType = {}));
|
|
27956
28218
|
function AddAssembly({ changeManager, handleClose, session, }) {
|
|
27957
|
-
const { internetAccounts } = require$$1$
|
|
28219
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
27958
28220
|
const { notify } = session;
|
|
27959
28221
|
const apolloInternetAccounts = internetAccounts.filter((ia) => ia.type === 'ApolloInternetAccount');
|
|
27960
28222
|
if (apolloInternetAccounts.length === 0) {
|
|
@@ -28089,7 +28351,7 @@
|
|
|
28089
28351
|
const fileUploadChangeBase = {
|
|
28090
28352
|
assembly: new objectid().toHexString(),
|
|
28091
28353
|
assemblyName,
|
|
28092
|
-
fileId,
|
|
28354
|
+
fileIds: { fa: fileId },
|
|
28093
28355
|
};
|
|
28094
28356
|
change =
|
|
28095
28357
|
fileType === FileType.GFF3 && importFeatures
|
|
@@ -34867,7 +35129,7 @@
|
|
|
34867
35129
|
async function textSearch(text, tx, signal) {
|
|
34868
35130
|
const db = await this.db;
|
|
34869
35131
|
const myTx = tx ?? db.transaction(['nodes']);
|
|
34870
|
-
require$$1$
|
|
35132
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34871
35133
|
const queryWords = [...wordsInString(text)];
|
|
34872
35134
|
const queries = [];
|
|
34873
35135
|
/**
|
|
@@ -34877,10 +35139,10 @@
|
|
|
34877
35139
|
const initialMatches = new Map();
|
|
34878
35140
|
// find startsWith and complete matches
|
|
34879
35141
|
queries.push(...queryWords.map(async (queryWord, queryWordIndex) => {
|
|
34880
|
-
require$$1$
|
|
35142
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34881
35143
|
const idx = myTx.objectStore('nodes').index('full-text-words');
|
|
34882
35144
|
for await (const cursor of idx.iterate(IDBKeyRange.bound(queryWord, `${queryWord}\uFFFF`, false, false))) {
|
|
34883
|
-
require$$1$
|
|
35145
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34884
35146
|
const term = cursor.value;
|
|
34885
35147
|
const termMatches = initialMatches.get(term.id) ?? [
|
|
34886
35148
|
term,
|
|
@@ -34891,11 +35153,11 @@
|
|
|
34891
35153
|
}
|
|
34892
35154
|
}));
|
|
34893
35155
|
await Promise.all(queries);
|
|
34894
|
-
require$$1$
|
|
35156
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34895
35157
|
// now rank the term matches and add some detail
|
|
34896
35158
|
const results = [];
|
|
34897
35159
|
for (const [, [term, wordIndexes]] of initialMatches) {
|
|
34898
|
-
require$$1$
|
|
35160
|
+
require$$1$2.checkAbortSignal(signal);
|
|
34899
35161
|
results.push(...elaborateMatch(this.textIndexFields, term, wordIndexes, queryWords, this.prefixes));
|
|
34900
35162
|
}
|
|
34901
35163
|
// sort the terms by score descending
|
|
@@ -35636,7 +35898,7 @@
|
|
|
35636
35898
|
return errors;
|
|
35637
35899
|
}
|
|
35638
35900
|
get sourceType() {
|
|
35639
|
-
if (require$$1$
|
|
35901
|
+
if (require$$1$2.isUriLocation(this.sourceLocation)) {
|
|
35640
35902
|
if (this.sourceLocation.uri.endsWith('.json')) {
|
|
35641
35903
|
return 'obo-graph-json';
|
|
35642
35904
|
}
|
|
@@ -35871,12 +36133,12 @@
|
|
|
35871
36133
|
}
|
|
35872
36134
|
}
|
|
35873
36135
|
|
|
35874
|
-
const OntologyRecordType = require$$1$
|
|
36136
|
+
const OntologyRecordType = require$$1$3.types
|
|
35875
36137
|
.model('OntologyRecord', {
|
|
35876
|
-
name: require$$1$
|
|
36138
|
+
name: require$$1$3.types.string,
|
|
35877
36139
|
version: 'unversioned',
|
|
35878
|
-
source: require$$1$
|
|
35879
|
-
options: require$$1$
|
|
36140
|
+
source: require$$1$3.types.union(mst.LocalPathLocation, mst.UriLocation, mst.BlobLocation),
|
|
36141
|
+
options: require$$1$3.types.frozen(),
|
|
35880
36142
|
})
|
|
35881
36143
|
.volatile((_self) => ({
|
|
35882
36144
|
dataStore: undefined,
|
|
@@ -35887,19 +36149,19 @@
|
|
|
35887
36149
|
return;
|
|
35888
36150
|
},
|
|
35889
36151
|
initDataStore() {
|
|
35890
|
-
self.dataStore = new OntologyStore(self.name, self.version, require$$1$
|
|
36152
|
+
self.dataStore = new OntologyStore(self.name, self.version, require$$1$3.getSnapshot(self.source), self.options);
|
|
35891
36153
|
},
|
|
35892
36154
|
afterCreate() {
|
|
35893
|
-
require$$1$
|
|
36155
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
35894
36156
|
this.initDataStore();
|
|
35895
36157
|
}));
|
|
35896
36158
|
},
|
|
35897
36159
|
}));
|
|
35898
|
-
const OntologyManagerType = require$$1$
|
|
36160
|
+
const OntologyManagerType = require$$1$3.types
|
|
35899
36161
|
.model('OntologyManager', {
|
|
35900
36162
|
// create, update, and delete ontologies
|
|
35901
|
-
ontologies: require$$1$
|
|
35902
|
-
prefixes: require$$1$
|
|
36163
|
+
ontologies: require$$1$3.types.array(OntologyRecordType),
|
|
36164
|
+
prefixes: require$$1$3.types.optional(require$$1$3.types.map(require$$1$3.types.string), {
|
|
35903
36165
|
'GO:': 'http://purl.obolibrary.org/obo/GO_',
|
|
35904
36166
|
'SO:': 'http://purl.obolibrary.org/obo/SO_',
|
|
35905
36167
|
}),
|
|
@@ -36039,7 +36301,7 @@
|
|
|
36039
36301
|
setCurrentOntologyTerm(term);
|
|
36040
36302
|
}
|
|
36041
36303
|
}, (error) => {
|
|
36042
|
-
if (!signal.aborted && !require$$1$
|
|
36304
|
+
if (!signal.aborted && !require$$1$2.isAbortException(error)) {
|
|
36043
36305
|
setCurrentOntologyTermInvalid(String(error));
|
|
36044
36306
|
}
|
|
36045
36307
|
});
|
|
@@ -36058,7 +36320,7 @@
|
|
|
36058
36320
|
setTermChoices(soTerms);
|
|
36059
36321
|
}
|
|
36060
36322
|
}, (error) => {
|
|
36061
|
-
if (!signal.aborted && !require$$1$
|
|
36323
|
+
if (!signal.aborted && !require$$1$2.isAbortException(error)) {
|
|
36062
36324
|
session.notify(error.message, 'error');
|
|
36063
36325
|
}
|
|
36064
36326
|
});
|
|
@@ -36384,7 +36646,7 @@
|
|
|
36384
36646
|
}
|
|
36385
36647
|
const featureIds = [];
|
|
36386
36648
|
// Let's add featureId to each child recursively
|
|
36387
|
-
const newFeatureLine = generateNewIds(require$$1$
|
|
36649
|
+
const newFeatureLine = generateNewIds(require$$1$3.getSnapshot(sourceFeature), featureIds);
|
|
36388
36650
|
// Clear possible parentId -attribute.
|
|
36389
36651
|
const attributeMap = {
|
|
36390
36652
|
...newFeatureLine.attributes,
|
|
@@ -36472,7 +36734,7 @@
|
|
|
36472
36734
|
|
|
36473
36735
|
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
36474
36736
|
function DeleteAssembly({ changeManager, handleClose, session, }) {
|
|
36475
|
-
const { internetAccounts } = require$$1$
|
|
36737
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
36476
36738
|
const [selectedAssembly, setSelectedAssembly] = React.useState();
|
|
36477
36739
|
const [errorMessage, setErrorMessage] = React.useState('');
|
|
36478
36740
|
const [confirmDelete, setconfirmDelete] = React.useState(false);
|
|
@@ -36554,7 +36816,7 @@
|
|
|
36554
36816
|
changedIds: [sourceFeature._id],
|
|
36555
36817
|
typeName: 'DeleteFeatureChange',
|
|
36556
36818
|
assembly: sourceAssemblyId,
|
|
36557
|
-
deletedFeature: require$$1$
|
|
36819
|
+
deletedFeature: require$$1$3.getSnapshot(sourceFeature),
|
|
36558
36820
|
parentFeatureId: sourceFeature.parent?._id,
|
|
36559
36821
|
});
|
|
36560
36822
|
await changeManager.submit(change);
|
|
@@ -36744,7 +37006,7 @@
|
|
|
36744
37006
|
continue;
|
|
36745
37007
|
}
|
|
36746
37008
|
for (const [, feature] of features) {
|
|
36747
|
-
gff3Items.push(dist$2.makeGFF3Feature(require$$1$
|
|
37009
|
+
gff3Items.push(dist$2.makeGFF3Feature(require$$1$3.getSnapshot(feature)));
|
|
36748
37010
|
}
|
|
36749
37011
|
}
|
|
36750
37012
|
for (const sequenceFeature of sequenceFeatures) {
|
|
@@ -36934,7 +37196,7 @@
|
|
|
36934
37196
|
}
|
|
36935
37197
|
|
|
36936
37198
|
function LogOut({ handleClose, session }) {
|
|
36937
|
-
const { internetAccounts } = require$$1$
|
|
37199
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
36938
37200
|
const [errorMessage, setErrorMessage] = React.useState('');
|
|
36939
37201
|
const apolloInternetAccounts = internetAccounts.filter((ia) => ia.type === 'ApolloInternetAccount');
|
|
36940
37202
|
if (apolloInternetAccounts.length === 0) {
|
|
@@ -36969,7 +37231,7 @@
|
|
|
36969
37231
|
}
|
|
36970
37232
|
|
|
36971
37233
|
function ManageChecks({ handleClose, session }) {
|
|
36972
|
-
const { internetAccounts } = require$$1$
|
|
37234
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
36973
37235
|
const [selectedAssembly, setSelectedAssembly] = React.useState();
|
|
36974
37236
|
const [errorMessage, setErrorMessage] = React.useState('');
|
|
36975
37237
|
const [submitted, setSubmitted] = React.useState(false);
|
|
@@ -37130,7 +37392,7 @@
|
|
|
37130
37392
|
|
|
37131
37393
|
/* eslint-disable @typescript-eslint/use-unknown-in-catch-callback-variable */
|
|
37132
37394
|
function ManageUsers({ changeManager, handleClose, session, }) {
|
|
37133
|
-
const { internetAccounts } = require$$1$
|
|
37395
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
37134
37396
|
const apolloInternetAccounts = internetAccounts.filter((ia) => ia.type === 'ApolloInternetAccount' && ia.role?.includes('admin'));
|
|
37135
37397
|
if (apolloInternetAccounts.length === 0) {
|
|
37136
37398
|
throw new Error('No Apollo internet account found');
|
|
@@ -37185,7 +37447,26 @@
|
|
|
37185
37447
|
headerName: 'Role',
|
|
37186
37448
|
width: 140,
|
|
37187
37449
|
type: 'singleSelect',
|
|
37188
|
-
valueOptions: ['', '
|
|
37450
|
+
valueOptions: ['readOnly', 'user', 'admin', 'none'],
|
|
37451
|
+
getOptionLabel(value) {
|
|
37452
|
+
switch (value) {
|
|
37453
|
+
case 'readOnly': {
|
|
37454
|
+
return 'Read-only';
|
|
37455
|
+
}
|
|
37456
|
+
case 'user': {
|
|
37457
|
+
return 'User';
|
|
37458
|
+
}
|
|
37459
|
+
case 'admin': {
|
|
37460
|
+
return 'Admin';
|
|
37461
|
+
}
|
|
37462
|
+
case 'none': {
|
|
37463
|
+
return 'None';
|
|
37464
|
+
}
|
|
37465
|
+
default: {
|
|
37466
|
+
return 'unknown';
|
|
37467
|
+
}
|
|
37468
|
+
}
|
|
37469
|
+
},
|
|
37189
37470
|
editable: true,
|
|
37190
37471
|
},
|
|
37191
37472
|
{
|
|
@@ -37767,7 +38048,7 @@
|
|
|
37767
38048
|
// }
|
|
37768
38049
|
// const hiliteRegex = /(?<=<em class="hilite">)(.*?)(?=<\/em>)/g
|
|
37769
38050
|
function TermTagWithTooltip({ getTagProps, index, ontology, termId, }) {
|
|
37770
|
-
const manager = require$$1$
|
|
38051
|
+
const manager = require$$1$3.getParent(ontology, 2);
|
|
37771
38052
|
const [description, setDescription] = React__namespace.useState('');
|
|
37772
38053
|
const [errorMessage, setErrorMessage] = React__namespace.useState('');
|
|
37773
38054
|
React__namespace.useEffect(() => {
|
|
@@ -37808,7 +38089,7 @@
|
|
|
37808
38089
|
const [options, setOptions] = React__namespace.useState([]);
|
|
37809
38090
|
const [loading, setLoading] = React__namespace.useState(false);
|
|
37810
38091
|
const [errorMessage, setErrorMessage] = React__namespace.useState('');
|
|
37811
|
-
const getOntologyTerms = React__namespace.useMemo(() => require$$0$
|
|
38092
|
+
const getOntologyTerms = React__namespace.useMemo(() => require$$0$2.debounce(async (request, callback) => {
|
|
37812
38093
|
if (!ontology) {
|
|
37813
38094
|
return;
|
|
37814
38095
|
}
|
|
@@ -37838,7 +38119,7 @@
|
|
|
37838
38119
|
callback(options);
|
|
37839
38120
|
}
|
|
37840
38121
|
catch (error) {
|
|
37841
|
-
if (!require$$1$
|
|
38122
|
+
if (!require$$1$2.isAbortException(error)) {
|
|
37842
38123
|
setErrorMessage(String(error));
|
|
37843
38124
|
}
|
|
37844
38125
|
}
|
|
@@ -37968,7 +38249,7 @@
|
|
|
37968
38249
|
}
|
|
37969
38250
|
function ModifyFeatureAttribute({ changeManager, handleClose, session, sourceAssemblyId, sourceFeature, }) {
|
|
37970
38251
|
const { notify } = session;
|
|
37971
|
-
const { internetAccounts } = require$$1$
|
|
38252
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
37972
38253
|
const internetAccount = React.useMemo(() => {
|
|
37973
38254
|
return internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
37974
38255
|
}, [internetAccounts]);
|
|
@@ -37979,12 +38260,12 @@
|
|
|
37979
38260
|
if (key.startsWith('gff_')) {
|
|
37980
38261
|
const newKey = key.slice(4);
|
|
37981
38262
|
const capitalizedKey = newKey.charAt(0).toUpperCase() + newKey.slice(1);
|
|
37982
|
-
return [capitalizedKey, require$$1$
|
|
38263
|
+
return [capitalizedKey, require$$1$3.getSnapshot(value)];
|
|
37983
38264
|
}
|
|
37984
38265
|
if (key === '_id') {
|
|
37985
|
-
return ['ID', require$$1$
|
|
38266
|
+
return ['ID', require$$1$3.getSnapshot(value)];
|
|
37986
38267
|
}
|
|
37987
|
-
return [key, require$$1$
|
|
38268
|
+
return [key, require$$1$3.getSnapshot(value)];
|
|
37988
38269
|
})));
|
|
37989
38270
|
const [showAddNewForm, setShowAddNewForm] = React.useState(false);
|
|
37990
38271
|
const [newAttributeKey, setNewAttributeKey] = React.useState('');
|
|
@@ -38237,7 +38518,7 @@
|
|
|
38237
38518
|
adapter: { type: 'ApolloSequenceAdapter', assemblyId },
|
|
38238
38519
|
metadata: {
|
|
38239
38520
|
apollo: true,
|
|
38240
|
-
...(require$$1$
|
|
38521
|
+
...(require$$1$2.isElectron
|
|
38241
38522
|
? { file: file.path }
|
|
38242
38523
|
: {}),
|
|
38243
38524
|
},
|
|
@@ -38288,7 +38569,7 @@
|
|
|
38288
38569
|
},
|
|
38289
38570
|
}));
|
|
38290
38571
|
function ViewChangeLog({ handleClose, session }) {
|
|
38291
|
-
const { internetAccounts } = require$$1$
|
|
38572
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
38292
38573
|
const apolloInternetAccount = internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
38293
38574
|
if (!apolloInternetAccount) {
|
|
38294
38575
|
throw new Error('No Apollo internet account found');
|
|
@@ -38564,7 +38845,7 @@
|
|
|
38564
38845
|
}
|
|
38565
38846
|
|
|
38566
38847
|
function ViewCheckResults({ handleClose, session, }) {
|
|
38567
|
-
const { internetAccounts } = require$$1$
|
|
38848
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
38568
38849
|
const { collaborationServerDriver } = session.apolloDataStore;
|
|
38569
38850
|
const apolloInternetAccount = internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
38570
38851
|
if (!apolloInternetAccount) {
|
|
@@ -38815,7 +39096,7 @@
|
|
|
38815
39096
|
setLoginTypes(data);
|
|
38816
39097
|
}
|
|
38817
39098
|
getAuthTypes().catch((error) => {
|
|
38818
|
-
require$$1$
|
|
39099
|
+
require$$1$2.isAbortException(error) ? '' : setErrorMessage(String(error));
|
|
38819
39100
|
});
|
|
38820
39101
|
return () => {
|
|
38821
39102
|
controller.abort();
|
|
@@ -38861,7 +39142,7 @@
|
|
|
38861
39142
|
const stateModelFactory$2 = (configSchema) => {
|
|
38862
39143
|
return pluggableElementTypes.InternetAccount.named('ApolloInternetAccount')
|
|
38863
39144
|
.props({
|
|
38864
|
-
type: require$$1$
|
|
39145
|
+
type: require$$1$3.types.literal('ApolloInternetAccount'),
|
|
38865
39146
|
configuration: configuration.ConfigurationReference(configSchema),
|
|
38866
39147
|
})
|
|
38867
39148
|
.views((self) => ({
|
|
@@ -38892,7 +39173,7 @@
|
|
|
38892
39173
|
const dec = dist$2.getDecodedToken(token);
|
|
38893
39174
|
const { role } = dec;
|
|
38894
39175
|
if (!role && !roleNotificationSent) {
|
|
38895
|
-
const { session } = require$$1$
|
|
39176
|
+
const { session } = require$$1$3.getRoot(self);
|
|
38896
39177
|
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
39178
|
// notify
|
|
38898
39179
|
roleNotificationSent = true;
|
|
@@ -38936,7 +39217,7 @@
|
|
|
38936
39217
|
resolve(token);
|
|
38937
39218
|
},
|
|
38938
39219
|
async openAuthWindow(type, resolve, reject) {
|
|
38939
|
-
const redirectUri = require$$1$
|
|
39220
|
+
const redirectUri = require$$1$2.isElectron
|
|
38940
39221
|
? 'http://localhost/auth'
|
|
38941
39222
|
: window.location.origin + window.location.pathname;
|
|
38942
39223
|
const url = new URL('auth/login', self.baseURL);
|
|
@@ -38946,7 +39227,7 @@
|
|
|
38946
39227
|
});
|
|
38947
39228
|
url.search = params.toString();
|
|
38948
39229
|
const eventName = `JBrowseAuthWindow-${self.internetAccountId}`;
|
|
38949
|
-
if (require$$1$
|
|
39230
|
+
if (require$$1$2.isElectron) {
|
|
38950
39231
|
const { ipcRenderer } = window.require('electron');
|
|
38951
39232
|
const redirectUriFromElectron = await ipcRenderer.invoke('openAuthWindow', {
|
|
38952
39233
|
internetAccountId: self.internetAccountId,
|
|
@@ -38969,7 +39250,7 @@
|
|
|
38969
39250
|
async getTokenFromUser(resolve, reject) {
|
|
38970
39251
|
const { baseURL } = self;
|
|
38971
39252
|
const authType = await new Promise((resolve, reject) => {
|
|
38972
|
-
const { session } = require$$1$
|
|
39253
|
+
const { session } = require$$1$3.getRoot(self);
|
|
38973
39254
|
const { baseURL, name } = self;
|
|
38974
39255
|
session.queueDialog((doneCallback) => [
|
|
38975
39256
|
AuthTypeSelector,
|
|
@@ -39019,7 +39300,7 @@
|
|
|
39019
39300
|
},
|
|
39020
39301
|
}))
|
|
39021
39302
|
.actions((self) => ({
|
|
39022
|
-
updateLastChangeSequenceNumber: require$$1$
|
|
39303
|
+
updateLastChangeSequenceNumber: require$$1$3.flow(function* updateLastChangeSequenceNumber() {
|
|
39023
39304
|
const { baseURL } = self;
|
|
39024
39305
|
const url = new URL('changes', baseURL);
|
|
39025
39306
|
const searchParams = new URLSearchParams({ limit: '1' });
|
|
@@ -39038,8 +39319,8 @@
|
|
|
39038
39319
|
const sequence = changes.length > 0 ? changes[0].sequence : 0;
|
|
39039
39320
|
self.setLastChangeSequenceNumber(sequence);
|
|
39040
39321
|
}),
|
|
39041
|
-
getMissingChanges: require$$1$
|
|
39042
|
-
const { session } = require$$1$
|
|
39322
|
+
getMissingChanges: require$$1$3.flow(function* getMissingChanges() {
|
|
39323
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39043
39324
|
const { changeManager } = session.apolloDataStore;
|
|
39044
39325
|
if (!self.lastChangeSequenceNumber) {
|
|
39045
39326
|
throw new Error('No LastChangeSequence stored in session. Please, refresh you browser to get last updates from server');
|
|
@@ -39074,7 +39355,7 @@
|
|
|
39074
39355
|
})
|
|
39075
39356
|
.actions((self) => ({
|
|
39076
39357
|
addSocketListeners() {
|
|
39077
|
-
const { session } = require$$1$
|
|
39358
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39078
39359
|
const { notify } = session;
|
|
39079
39360
|
const token = self.retrieveToken();
|
|
39080
39361
|
if (!token) {
|
|
@@ -39168,10 +39449,10 @@
|
|
|
39168
39449
|
return { postUserLocation: debouncePostUserLocation(postUserLocation) };
|
|
39169
39450
|
})
|
|
39170
39451
|
.actions((self) => ({
|
|
39171
|
-
initialize: require$$1$
|
|
39452
|
+
initialize: require$$1$3.flow(function* initialize(role) {
|
|
39172
39453
|
if (role === 'admin') {
|
|
39173
|
-
const rootModel = require$$1$
|
|
39174
|
-
if (require$$1$
|
|
39454
|
+
const rootModel = require$$1$3.getRoot(self);
|
|
39455
|
+
if (require$$1$2.isAbstractMenuManager(rootModel)) {
|
|
39175
39456
|
addMenuItems(rootModel);
|
|
39176
39457
|
}
|
|
39177
39458
|
}
|
|
@@ -39197,7 +39478,7 @@
|
|
|
39197
39478
|
}
|
|
39198
39479
|
// fires when app transitions from prerender, user returns to the app / tab.
|
|
39199
39480
|
if (document.visibilityState === 'visible') {
|
|
39200
|
-
const { session } = require$$1$
|
|
39481
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39201
39482
|
session.broadcastLocations();
|
|
39202
39483
|
}
|
|
39203
39484
|
});
|
|
@@ -39210,7 +39491,7 @@
|
|
|
39210
39491
|
if (inWebWorker$1) {
|
|
39211
39492
|
return;
|
|
39212
39493
|
}
|
|
39213
|
-
const { session } = require$$1$
|
|
39494
|
+
const { session } = require$$1$3.getRoot(self);
|
|
39214
39495
|
// This can be undefined if there is no session loaded, e.g. on
|
|
39215
39496
|
// the start screen
|
|
39216
39497
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -39563,11 +39844,11 @@
|
|
|
39563
39844
|
const featureSnap = [...features.values()].map((a) =>
|
|
39564
39845
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
39565
39846
|
// @ts-expect-error
|
|
39566
|
-
[...a.values()].map((f) => require$$1$
|
|
39847
|
+
[...a.values()].map((f) => require$$1$3.getSnapshot(f)));
|
|
39567
39848
|
const apolloInternetAccount = React.useMemo(() => {
|
|
39568
|
-
const { internetAccounts } = require$$1$
|
|
39849
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
39569
39850
|
const { assemblyName } = region;
|
|
39570
|
-
const { assemblyManager } = require$$1$
|
|
39851
|
+
const { assemblyManager } = require$$1$2.getSession(displayModel);
|
|
39571
39852
|
const assembly = assemblyManager.get(assemblyName);
|
|
39572
39853
|
if (!assembly) {
|
|
39573
39854
|
throw new Error(`No assembly found with name ${assemblyName}`);
|
|
@@ -40220,7 +40501,7 @@
|
|
|
40220
40501
|
}
|
|
40221
40502
|
|
|
40222
40503
|
const ApolloPluginConfigurationSchema = configuration.ConfigurationSchema('ApolloPlugin', {
|
|
40223
|
-
ontologies: require$$1$
|
|
40504
|
+
ontologies: require$$1$3.types.array(OntologyRecordConfiguration),
|
|
40224
40505
|
});
|
|
40225
40506
|
|
|
40226
40507
|
function parseCigar(cigar) {
|
|
@@ -40236,12 +40517,12 @@
|
|
|
40236
40517
|
const newStateModel = stateModel
|
|
40237
40518
|
.views((self) => ({
|
|
40238
40519
|
getFirstRegion() {
|
|
40239
|
-
const lgv = require$$1$
|
|
40520
|
+
const lgv = require$$1$2.getContainingView(self);
|
|
40240
40521
|
return lgv.dynamicBlocks.contentBlocks[0];
|
|
40241
40522
|
},
|
|
40242
40523
|
getAssembly() {
|
|
40243
40524
|
const firstRegion = self.getFirstRegion();
|
|
40244
|
-
const session = require$$1$
|
|
40525
|
+
const session = require$$1$2.getSession(self);
|
|
40245
40526
|
const { assemblyManager } = session;
|
|
40246
40527
|
const { assemblyName } = firstRegion;
|
|
40247
40528
|
const assembly = assemblyManager.get(assemblyName);
|
|
@@ -40369,7 +40650,7 @@
|
|
|
40369
40650
|
assembly: assemblyId,
|
|
40370
40651
|
addedFeature: newFeature,
|
|
40371
40652
|
});
|
|
40372
|
-
const session = require$$1$
|
|
40653
|
+
const session = require$$1$2.getSession(self);
|
|
40373
40654
|
await session.apolloDataStore.changeManager.submit(change);
|
|
40374
40655
|
session.notify('Annotation added successfully', 'success');
|
|
40375
40656
|
},
|
|
@@ -40482,12 +40763,12 @@
|
|
|
40482
40763
|
if (key.startsWith('gff_')) {
|
|
40483
40764
|
const newKey = key.slice(4);
|
|
40484
40765
|
const capitalizedKey = newKey.charAt(0).toUpperCase() + newKey.slice(1);
|
|
40485
|
-
return [capitalizedKey, require$$1$
|
|
40766
|
+
return [capitalizedKey, require$$1$3.getSnapshot(value)];
|
|
40486
40767
|
}
|
|
40487
40768
|
if (key === '_id') {
|
|
40488
|
-
return ['ID', require$$1$
|
|
40769
|
+
return ['ID', require$$1$3.getSnapshot(value)];
|
|
40489
40770
|
}
|
|
40490
|
-
return [key, require$$1$
|
|
40771
|
+
return [key, require$$1$3.getSnapshot(value)];
|
|
40491
40772
|
}));
|
|
40492
40773
|
const { notify } = session;
|
|
40493
40774
|
const { changeManager } = session.apolloDataStore;
|
|
@@ -40830,7 +41111,7 @@
|
|
|
40830
41111
|
const ApolloFeatureDetailsWidget = mobxReact.observer(function ApolloFeatureDetailsWidget(props) {
|
|
40831
41112
|
const { model } = props;
|
|
40832
41113
|
const { assembly, feature, refName } = model;
|
|
40833
|
-
const session = require$$1$
|
|
41114
|
+
const session = require$$1$2.getSession(model);
|
|
40834
41115
|
const currentAssembly = session.apolloDataStore.assemblies.get(assembly);
|
|
40835
41116
|
const { classes } = useStyles$8();
|
|
40836
41117
|
if (!(feature && currentAssembly)) {
|
|
@@ -41371,7 +41652,7 @@
|
|
|
41371
41652
|
Object.defineProperty(exports, "__esModule", {
|
|
41372
41653
|
value: true
|
|
41373
41654
|
});
|
|
41374
|
-
var tslib_1 = require$$0;
|
|
41655
|
+
var tslib_1 = require$$0$1;
|
|
41375
41656
|
tslib_1.__exportStar(AnnotationFeatureModel, exports);
|
|
41376
41657
|
tslib_1.__exportStar(ApolloAssembly, exports);
|
|
41377
41658
|
tslib_1.__exportStar(ApolloRefSeq, exports);
|
|
@@ -41379,18 +41660,18 @@
|
|
|
41379
41660
|
})(dist);
|
|
41380
41661
|
|
|
41381
41662
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
41382
|
-
const ApolloFeatureDetailsWidgetModel = require$$1$
|
|
41663
|
+
const ApolloFeatureDetailsWidgetModel = require$$1$3.types
|
|
41383
41664
|
.model('ApolloFeatureDetailsWidget', {
|
|
41384
41665
|
id: mst.ElementId,
|
|
41385
|
-
type: require$$1$
|
|
41386
|
-
feature: require$$1$
|
|
41666
|
+
type: require$$1$3.types.literal('ApolloFeatureDetailsWidget'),
|
|
41667
|
+
feature: require$$1$3.types.maybe(require$$1$3.types.reference(dist.AnnotationFeatureModel, {
|
|
41387
41668
|
onInvalidated(ev) {
|
|
41388
41669
|
ev.parent.setTryReload(ev.invalidId);
|
|
41389
41670
|
ev.removeRef();
|
|
41390
41671
|
},
|
|
41391
41672
|
})),
|
|
41392
|
-
assembly: require$$1$
|
|
41393
|
-
refName: require$$1$
|
|
41673
|
+
assembly: require$$1$3.types.string,
|
|
41674
|
+
refName: require$$1$3.types.string,
|
|
41394
41675
|
})
|
|
41395
41676
|
.volatile(() => ({
|
|
41396
41677
|
tryReload: undefined,
|
|
@@ -41406,11 +41687,11 @@
|
|
|
41406
41687
|
}))
|
|
41407
41688
|
.actions((self) => ({
|
|
41408
41689
|
afterAttach() {
|
|
41409
|
-
require$$1$
|
|
41690
|
+
require$$1$3.addDisposer(self, mobx.autorun((reaction) => {
|
|
41410
41691
|
if (!self.tryReload) {
|
|
41411
41692
|
return;
|
|
41412
41693
|
}
|
|
41413
|
-
const session = require$$1$
|
|
41694
|
+
const session = require$$1$2.getSession(self);
|
|
41414
41695
|
const { apolloDataStore } = session;
|
|
41415
41696
|
if (!apolloDataStore) {
|
|
41416
41697
|
return;
|
|
@@ -41424,19 +41705,19 @@
|
|
|
41424
41705
|
}));
|
|
41425
41706
|
},
|
|
41426
41707
|
}));
|
|
41427
|
-
const ApolloTranscriptDetailsModel = require$$1$
|
|
41708
|
+
const ApolloTranscriptDetailsModel = require$$1$3.types
|
|
41428
41709
|
.model('ApolloTranscriptDetails', {
|
|
41429
41710
|
id: mst.ElementId,
|
|
41430
|
-
type: require$$1$
|
|
41431
|
-
feature: require$$1$
|
|
41711
|
+
type: require$$1$3.types.literal('ApolloTranscriptDetails'),
|
|
41712
|
+
feature: require$$1$3.types.maybe(require$$1$3.types.reference(dist.AnnotationFeatureModel, {
|
|
41432
41713
|
onInvalidated(ev) {
|
|
41433
41714
|
ev.parent.setTryReload(ev.invalidId);
|
|
41434
41715
|
ev.removeRef();
|
|
41435
41716
|
},
|
|
41436
41717
|
})),
|
|
41437
|
-
assembly: require$$1$
|
|
41438
|
-
refName: require$$1$
|
|
41439
|
-
changeManager: require$$1$
|
|
41718
|
+
assembly: require$$1$3.types.string,
|
|
41719
|
+
refName: require$$1$3.types.string,
|
|
41720
|
+
changeManager: require$$1$3.types.frozen(),
|
|
41440
41721
|
})
|
|
41441
41722
|
.volatile(() => ({
|
|
41442
41723
|
tryReload: undefined,
|
|
@@ -41452,11 +41733,11 @@
|
|
|
41452
41733
|
}))
|
|
41453
41734
|
.actions((self) => ({
|
|
41454
41735
|
afterAttach() {
|
|
41455
|
-
require$$1$
|
|
41736
|
+
require$$1$3.addDisposer(self, mobx.autorun((reaction) => {
|
|
41456
41737
|
if (!self.tryReload) {
|
|
41457
41738
|
return;
|
|
41458
41739
|
}
|
|
41459
|
-
const session = require$$1$
|
|
41740
|
+
const session = require$$1$2.getSession(self);
|
|
41460
41741
|
const { apolloDataStore } = session;
|
|
41461
41742
|
if (!apolloDataStore) {
|
|
41462
41743
|
return;
|
|
@@ -41593,8 +41874,8 @@
|
|
|
41593
41874
|
let startSeq = refData.getSequence(Number(dataPoint.min) - 2, Number(dataPoint.min));
|
|
41594
41875
|
let endSeq = refData.getSequence(Number(dataPoint.max), Number(dataPoint.max) + 2);
|
|
41595
41876
|
if (featureNew.strand === -1 && startSeq && endSeq) {
|
|
41596
|
-
startSeq = require$$1$
|
|
41597
|
-
endSeq = require$$1$
|
|
41877
|
+
startSeq = require$$1$2.revcom(startSeq);
|
|
41878
|
+
endSeq = require$$1$2.revcom(endSeq);
|
|
41598
41879
|
}
|
|
41599
41880
|
const oneCDS = {
|
|
41600
41881
|
id: featureNew._id,
|
|
@@ -41790,8 +42071,8 @@
|
|
|
41790
42071
|
let startSeq = refData.getSequence(Number(currentFeature.min) - 2, Number(currentFeature.min));
|
|
41791
42072
|
let endSeq = refData.getSequence(Number(currentFeature.max), Number(currentFeature.max) + 2);
|
|
41792
42073
|
if (currentFeature.strand === -1 && startSeq && endSeq) {
|
|
41793
|
-
startSeq = require$$1$
|
|
41794
|
-
endSeq = require$$1$
|
|
42074
|
+
startSeq = require$$1$2.revcom(startSeq);
|
|
42075
|
+
endSeq = require$$1$2.revcom(endSeq);
|
|
41795
42076
|
}
|
|
41796
42077
|
const oneCDS = {
|
|
41797
42078
|
id: currentFeature._id,
|
|
@@ -41889,7 +42170,7 @@
|
|
|
41889
42170
|
for (const item of transcriptItems) {
|
|
41890
42171
|
if (item.type === 'CDS') {
|
|
41891
42172
|
const refSeq = refData.getSequence(Number(item.min + 1), Number(item.max));
|
|
41892
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42173
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41893
42174
|
textSegments.push({ text: seqData, color: cdsColor });
|
|
41894
42175
|
}
|
|
41895
42176
|
}
|
|
@@ -41902,7 +42183,7 @@
|
|
|
41902
42183
|
item.type === 'three_prime_UTR' ||
|
|
41903
42184
|
item.type === 'five_prime_UTR') {
|
|
41904
42185
|
const refSeq = refData.getSequence(Number(item.min + 1), Number(item.max));
|
|
41905
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42186
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41906
42187
|
if (item.type === 'CDS') {
|
|
41907
42188
|
textSegments.push({ text: seqData, color: cdsColor });
|
|
41908
42189
|
}
|
|
@@ -41927,14 +42208,14 @@
|
|
|
41927
42208
|
count != transcriptItems.length) {
|
|
41928
42209
|
// Intron etc. between CDS/UTRs. No need to check this on very last item
|
|
41929
42210
|
const refSeq = refData.getSequence(lastEnd + 1, Number(item.min) - 1);
|
|
41930
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42211
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41931
42212
|
textSegments.push({ text: seqData, color: 'black' });
|
|
41932
42213
|
}
|
|
41933
42214
|
if (item.type === 'CDS' ||
|
|
41934
42215
|
item.type === 'three_prime_UTR' ||
|
|
41935
42216
|
item.type === 'five_prime_UTR') {
|
|
41936
42217
|
const refSeq = refData.getSequence(Number(item.min + 1), Number(item.max));
|
|
41937
|
-
seqData += item.strand === -1 && refSeq ? require$$1$
|
|
42218
|
+
seqData += item.strand === -1 && refSeq ? require$$1$2.revcom(refSeq) : refSeq;
|
|
41938
42219
|
switch (item.type) {
|
|
41939
42220
|
case 'CDS': {
|
|
41940
42221
|
textSegments.push({ text: seqData, color: cdsColor });
|
|
@@ -42010,10 +42291,10 @@
|
|
|
42010
42291
|
const { classes } = useStyles$7();
|
|
42011
42292
|
const { model } = props;
|
|
42012
42293
|
const { assembly, feature, refName } = model;
|
|
42013
|
-
const session = require$$1$
|
|
42014
|
-
const apolloSession = require$$1$
|
|
42294
|
+
const session = require$$1$2.getSession(model);
|
|
42295
|
+
const apolloSession = require$$1$2.getSession(model);
|
|
42015
42296
|
const currentAssembly = apolloSession.apolloDataStore.assemblies.get(assembly);
|
|
42016
|
-
const { internetAccounts } = require$$1$
|
|
42297
|
+
const { internetAccounts } = require$$1$3.getRoot(session);
|
|
42017
42298
|
const apolloInternetAccount = internetAccounts.find((ia) => ia.type === 'ApolloInternetAccount');
|
|
42018
42299
|
const role = apolloInternetAccount ? apolloInternetAccount.role : 'admin';
|
|
42019
42300
|
const editable = ['admin', 'user'].includes(role ?? '');
|
|
@@ -42111,12 +42392,12 @@
|
|
|
42111
42392
|
if (key.startsWith('gff_')) {
|
|
42112
42393
|
const newKey = key.slice(4);
|
|
42113
42394
|
const capitalizedKey = newKey.charAt(0).toUpperCase() + newKey.slice(1);
|
|
42114
|
-
return [capitalizedKey, require$$1$
|
|
42395
|
+
return [capitalizedKey, require$$1$3.getSnapshot(value)];
|
|
42115
42396
|
}
|
|
42116
42397
|
if (key === '_id') {
|
|
42117
|
-
return ['ID', require$$1$
|
|
42398
|
+
return ['ID', require$$1$3.getSnapshot(value)];
|
|
42118
42399
|
}
|
|
42119
|
-
return [key, require$$1$
|
|
42400
|
+
return [key, require$$1$3.getSnapshot(value)];
|
|
42120
42401
|
})
|
|
42121
42402
|
.filter(([key]) => key) // Leave empty keys off
|
|
42122
42403
|
.map(([key, values]) => `${key}=${Array.isArray(values) ? values.join(', ') : values}`)
|
|
@@ -42215,7 +42496,7 @@
|
|
|
42215
42496
|
]);
|
|
42216
42497
|
},
|
|
42217
42498
|
});
|
|
42218
|
-
if (feature.type === 'mRNA' && require$$1$
|
|
42499
|
+
if (feature.type === 'mRNA' && require$$1$2.isSessionModelWithWidgets(session)) {
|
|
42219
42500
|
menuItems.push({
|
|
42220
42501
|
label: 'Edit transcript details',
|
|
42221
42502
|
onClick: () => {
|
|
@@ -42293,9 +42574,9 @@
|
|
|
42293
42574
|
* #stateModel TrackHeightMixin
|
|
42294
42575
|
* #category display
|
|
42295
42576
|
*/
|
|
42296
|
-
const TrackHeightMixin = require$$1$
|
|
42577
|
+
const TrackHeightMixin = require$$1$3.types
|
|
42297
42578
|
.model({
|
|
42298
|
-
heightPreConfig: require$$1$
|
|
42579
|
+
heightPreConfig: require$$1$3.types.maybe(require$$1$3.types.refinement('displayHeight', require$$1$3.types.number, (n) => n >= minDisplayHeight)),
|
|
42299
42580
|
})
|
|
42300
42581
|
.volatile(() => ({
|
|
42301
42582
|
scrollTop: 0,
|
|
@@ -42327,15 +42608,15 @@
|
|
|
42327
42608
|
// 'LinearGenomeViewPlugin',
|
|
42328
42609
|
// ) as LinearGenomeViewPlugin
|
|
42329
42610
|
// const { TrackHeightMixin } = LGVPlugin.exports
|
|
42330
|
-
return require$$1$
|
|
42611
|
+
return require$$1$3.types
|
|
42331
42612
|
.compose(pluggableElementTypes.BaseDisplay, TrackHeightMixin)
|
|
42332
42613
|
.named('BaseLinearApolloDisplay')
|
|
42333
42614
|
.props({
|
|
42334
|
-
type: require$$1$
|
|
42615
|
+
type: require$$1$3.types.literal('LinearApolloDisplay'),
|
|
42335
42616
|
configuration: configuration.ConfigurationReference(configSchema),
|
|
42336
42617
|
})
|
|
42337
42618
|
.volatile((self) => ({
|
|
42338
|
-
lgv: require$$1$
|
|
42619
|
+
lgv: require$$1$2.getContainingView(self),
|
|
42339
42620
|
}))
|
|
42340
42621
|
.views((self) => {
|
|
42341
42622
|
const { configuration, renderProps: superRenderProps } = self;
|
|
@@ -42354,7 +42635,7 @@
|
|
|
42354
42635
|
return self.configuration.renderer.type;
|
|
42355
42636
|
},
|
|
42356
42637
|
get session() {
|
|
42357
|
-
return require$$1$
|
|
42638
|
+
return require$$1$2.getSession(self);
|
|
42358
42639
|
},
|
|
42359
42640
|
get regions() {
|
|
42360
42641
|
const regions = self.lgv.dynamicBlocks.contentBlocks.map(({ assemblyName, end, refName, start }) => ({
|
|
@@ -42375,7 +42656,7 @@
|
|
|
42375
42656
|
.views((self) => ({
|
|
42376
42657
|
get apolloInternetAccount() {
|
|
42377
42658
|
const [region] = self.regions;
|
|
42378
|
-
const { internetAccounts } = require$$1$
|
|
42659
|
+
const { internetAccounts } = require$$1$3.getRoot(self);
|
|
42379
42660
|
const { assemblyName } = region;
|
|
42380
42661
|
const { assemblyManager } = self.session;
|
|
42381
42662
|
const assembly = assemblyManager.get(assemblyName);
|
|
@@ -42410,7 +42691,7 @@
|
|
|
42410
42691
|
self.session.apolloSetSelectedFeature(feature);
|
|
42411
42692
|
},
|
|
42412
42693
|
afterAttach() {
|
|
42413
|
-
require$$1$
|
|
42694
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42414
42695
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42415
42696
|
return;
|
|
42416
42697
|
}
|
|
@@ -42441,7 +42722,7 @@
|
|
|
42441
42722
|
const { end, refName, start } = region;
|
|
42442
42723
|
for (const [, feature] of self.seenFeatures) {
|
|
42443
42724
|
if (refName !== assembly?.getCanonicalRefName(feature.refSeq) ||
|
|
42444
|
-
!require$$1$
|
|
42725
|
+
!require$$1$2.doesIntersect2(start, end, feature.min, feature.max) ||
|
|
42445
42726
|
feature.length > self.featuresMinMaxLimit) {
|
|
42446
42727
|
continue;
|
|
42447
42728
|
}
|
|
@@ -42487,12 +42768,12 @@
|
|
|
42487
42768
|
const rows = [];
|
|
42488
42769
|
const { end, refName, start } = region;
|
|
42489
42770
|
for (const [id, feature] of self.seenFeatures.entries()) {
|
|
42490
|
-
if (!require$$1$
|
|
42771
|
+
if (!require$$1$3.isAlive(feature)) {
|
|
42491
42772
|
self.deleteSeenFeature(id);
|
|
42492
42773
|
continue;
|
|
42493
42774
|
}
|
|
42494
42775
|
if (refName !== assembly?.getCanonicalRefName(feature.refSeq) ||
|
|
42495
|
-
!require$$1$
|
|
42776
|
+
!require$$1$2.doesIntersect2(start, end, feature.min, feature.max)) {
|
|
42496
42777
|
continue;
|
|
42497
42778
|
}
|
|
42498
42779
|
const rowCount = getGlyph(feature).getRowCount(feature, self.lgv.bpPerPx);
|
|
@@ -42582,7 +42863,7 @@
|
|
|
42582
42863
|
}))
|
|
42583
42864
|
.actions((self) => ({
|
|
42584
42865
|
afterAttach() {
|
|
42585
|
-
require$$1$
|
|
42866
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42586
42867
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42587
42868
|
return;
|
|
42588
42869
|
}
|
|
@@ -42594,7 +42875,7 @@
|
|
|
42594
42875
|
continue;
|
|
42595
42876
|
}
|
|
42596
42877
|
for (const [, feature] of features) {
|
|
42597
|
-
if (require$$1$
|
|
42878
|
+
if (require$$1$2.doesIntersect2(region.start, region.end, feature.min, feature.max) &&
|
|
42598
42879
|
!self.seenFeatures.has(feature._id)) {
|
|
42599
42880
|
self.addSeenFeature(feature);
|
|
42600
42881
|
}
|
|
@@ -42658,7 +42939,7 @@
|
|
|
42658
42939
|
self.theme = theme;
|
|
42659
42940
|
},
|
|
42660
42941
|
afterAttach() {
|
|
42661
|
-
require$$1$
|
|
42942
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42662
42943
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42663
42944
|
return;
|
|
42664
42945
|
}
|
|
@@ -42713,7 +42994,7 @@
|
|
|
42713
42994
|
}
|
|
42714
42995
|
function reverseCodonSeq(seq) {
|
|
42715
42996
|
return [...seq]
|
|
42716
|
-
.map((c) => require$$1$
|
|
42997
|
+
.map((c) => require$$1$2.revcom(c))
|
|
42717
42998
|
.reverse()
|
|
42718
42999
|
.join('');
|
|
42719
43000
|
}
|
|
@@ -42730,7 +43011,7 @@
|
|
|
42730
43011
|
if (reverse) {
|
|
42731
43012
|
codonSeq = reverseCodonSeq(codonSeq);
|
|
42732
43013
|
}
|
|
42733
|
-
const codonLetter = require$$1$
|
|
43014
|
+
const codonLetter = require$$1$2.defaultCodonTable[codonSeq];
|
|
42734
43015
|
if (!codonLetter) {
|
|
42735
43016
|
return;
|
|
42736
43017
|
}
|
|
@@ -42749,7 +43030,7 @@
|
|
|
42749
43030
|
const LinearApolloDisplayRendering = renderingModelIntermediateFactory(pluginManager, configSchema);
|
|
42750
43031
|
return LinearApolloDisplayRendering.actions((self) => ({
|
|
42751
43032
|
afterAttach() {
|
|
42752
|
-
require$$1$
|
|
43033
|
+
require$$1$3.addDisposer(self, mobx.autorun(async () => {
|
|
42753
43034
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
42754
43035
|
return;
|
|
42755
43036
|
}
|
|
@@ -42818,7 +43099,7 @@
|
|
|
42818
43099
|
drawLetter(seqTrackctx, startPx, widthPx, letter, self.sequenceRowHeight * 3);
|
|
42819
43100
|
}
|
|
42820
43101
|
// Draw reverse
|
|
42821
|
-
const revLetter = require$$1$
|
|
43102
|
+
const revLetter = require$$1$2.revcom(letter);
|
|
42822
43103
|
seqTrackctx.beginPath();
|
|
42823
43104
|
seqTrackctx.fillStyle = colorCode(revLetter, self.theme);
|
|
42824
43105
|
seqTrackctx.rect(startPx, self.sequenceRowHeight * 4, widthPx, self.sequenceRowHeight);
|
|
@@ -42845,7 +43126,7 @@
|
|
|
42845
43126
|
const LinearApolloDisplayRendering = sequenceRenderingModelFactory(pluginManager, configSchema);
|
|
42846
43127
|
return LinearApolloDisplayRendering.actions((self) => ({
|
|
42847
43128
|
afterAttach() {
|
|
42848
|
-
require$$1$
|
|
43129
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42849
43130
|
const { canvas, featureLayouts, featuresHeight, lgv } = self;
|
|
42850
43131
|
if (!lgv.initialized || self.regionCannotBeRendered()) {
|
|
42851
43132
|
return;
|
|
@@ -42863,7 +43144,7 @@
|
|
|
42863
43144
|
if (featureRow > 0) {
|
|
42864
43145
|
continue;
|
|
42865
43146
|
}
|
|
42866
|
-
if (!require$$1$
|
|
43147
|
+
if (!require$$1$2.doesIntersect2(displayedRegion.start, displayedRegion.end, feature.min, feature.max)) {
|
|
42867
43148
|
continue;
|
|
42868
43149
|
}
|
|
42869
43150
|
getGlyph(feature).draw(ctx, feature, row, self, idx);
|
|
@@ -42990,7 +43271,7 @@
|
|
|
42990
43271
|
const LinearApolloDisplayRendering = mouseEventsModelIntermediateFactory(pluginManager, configSchema);
|
|
42991
43272
|
return LinearApolloDisplayRendering.actions((self) => ({
|
|
42992
43273
|
afterAttach() {
|
|
42993
|
-
require$$1$
|
|
43274
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
42994
43275
|
// This type is wrong in @jbrowse/core
|
|
42995
43276
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
42996
43277
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
@@ -43018,7 +43299,7 @@
|
|
|
43018
43299
|
continue;
|
|
43019
43300
|
}
|
|
43020
43301
|
for (const dl of cdsLocs) {
|
|
43021
|
-
const frame = require$$1$
|
|
43302
|
+
const frame = require$$1$2.getFrame(dl.min, dl.max, feature.strand ?? 1, dl.phase);
|
|
43022
43303
|
const row = getTranslationRow(frame, lgv.bpPerPx);
|
|
43023
43304
|
const offset = (lgv.bpToPx({
|
|
43024
43305
|
refName: region.refName,
|
|
@@ -43162,7 +43443,7 @@
|
|
|
43162
43443
|
}))
|
|
43163
43444
|
.actions((self) => ({
|
|
43164
43445
|
afterAttach() {
|
|
43165
|
-
require$$1$
|
|
43446
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
43166
43447
|
// This type is wrong in @jbrowse/core
|
|
43167
43448
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
43168
43449
|
if (!self.lgv.initialized || self.regionCannotBeRendered()) {
|
|
@@ -43680,7 +43961,7 @@
|
|
|
43680
43961
|
ctx.fillRect(cdsStartPx, cdsTop, cdsWidthPx, cdsHeight);
|
|
43681
43962
|
if (cdsWidthPx > 2) {
|
|
43682
43963
|
ctx.clearRect(cdsStartPx + 1, cdsTop + 1, cdsWidthPx - 2, cdsHeight - 2);
|
|
43683
|
-
const frame = require$$1$
|
|
43964
|
+
const frame = require$$1$2.getFrame(cds.min, cds.max, child.strand ?? 1, cds.phase);
|
|
43684
43965
|
const frameColor = theme?.palette.framesCDS.at(frame)?.main;
|
|
43685
43966
|
const cdsColorCode = frameColor ?? 'rgb(171,71,188)';
|
|
43686
43967
|
ctx.fillStyle =
|
|
@@ -43894,7 +44175,7 @@
|
|
|
43894
44175
|
}
|
|
43895
44176
|
const exonChildren = [...mRNA.children.values()].filter((child) => child.type === 'exon');
|
|
43896
44177
|
const overlappingExon = exonChildren.find((child) => {
|
|
43897
|
-
const [start, end] = require$$1$
|
|
44178
|
+
const [start, end] = require$$1$2.intersection2(bp, bp + 1, child.min, child.max);
|
|
43898
44179
|
return start !== undefined && end !== undefined;
|
|
43899
44180
|
});
|
|
43900
44181
|
if (!overlappingExon) {
|
|
@@ -44378,10 +44659,10 @@
|
|
|
44378
44659
|
React__default["default"].createElement(HybridGrid, { model: displayState })));
|
|
44379
44660
|
});
|
|
44380
44661
|
|
|
44381
|
-
const TabularEditorStateModelType = require$$1$
|
|
44662
|
+
const TabularEditorStateModelType = require$$1$3.types
|
|
44382
44663
|
.model('TabularEditor', {
|
|
44383
44664
|
isShown: true,
|
|
44384
|
-
featureCollapsed: require$$1$
|
|
44665
|
+
featureCollapsed: require$$1$3.types.map(require$$1$3.types.boolean),
|
|
44385
44666
|
filterText: '',
|
|
44386
44667
|
})
|
|
44387
44668
|
.actions((self) => ({
|
|
@@ -44396,7 +44677,7 @@
|
|
|
44396
44677
|
},
|
|
44397
44678
|
collapseAllFeatures() {
|
|
44398
44679
|
// iterate over all seen features and set them to collapsed
|
|
44399
|
-
const display = require$$1$
|
|
44680
|
+
const display = require$$1$3.getParent(self);
|
|
44400
44681
|
for (const [featureId] of display.seenFeatures.entries()) {
|
|
44401
44682
|
self.featureCollapsed.set(featureId, true);
|
|
44402
44683
|
}
|
|
@@ -44419,7 +44700,7 @@
|
|
|
44419
44700
|
// TODO: this needs to be refactored so that the final composition of the
|
|
44420
44701
|
// state model mixins happens here in one central place
|
|
44421
44702
|
return mouseEventsModelFactory(pluginManager, configSchema)
|
|
44422
|
-
.props({ tabularEditor: require$$1$
|
|
44703
|
+
.props({ tabularEditor: require$$1$3.types.optional(TabularEditorStateModelType, {}) })
|
|
44423
44704
|
.named('LinearApolloDisplay');
|
|
44424
44705
|
}
|
|
44425
44706
|
|
|
@@ -44490,7 +44771,7 @@
|
|
|
44490
44771
|
const { model } = props;
|
|
44491
44772
|
const { apolloRowHeight, contextMenuItems: getContextMenuItems, cursor, featuresHeight, isShown, onMouseDown, onMouseLeave, onMouseMove, onMouseUp, regionCannotBeRendered, session, setCanvas, setCollaboratorCanvas, setOverlayCanvas, setSeqTrackCanvas, setSeqTrackOverlayCanvas, setTheme, tabularEditor, } = model;
|
|
44492
44773
|
const { classes } = useStyles$1();
|
|
44493
|
-
const lgv = require$$1$
|
|
44774
|
+
const lgv = require$$1$2.getContainingView(model);
|
|
44494
44775
|
React.useEffect(() => {
|
|
44495
44776
|
setTheme(theme);
|
|
44496
44777
|
}, [theme, setTheme]);
|
|
@@ -44554,7 +44835,7 @@
|
|
|
44554
44835
|
.filter((checkResult) => assembly?.isValidRefName(checkResult.refSeq) &&
|
|
44555
44836
|
assembly.getCanonicalRefName(checkResult.refSeq) ===
|
|
44556
44837
|
region.refName &&
|
|
44557
|
-
require$$1$
|
|
44838
|
+
require$$1$2.doesIntersect2(region.start, region.end, checkResult.start, checkResult.end))
|
|
44558
44839
|
.map((checkResult) => {
|
|
44559
44840
|
const left = (lgv.bpToPx({
|
|
44560
44841
|
refName: region.refName,
|
|
@@ -44741,15 +45022,15 @@
|
|
|
44741
45022
|
default_1 = Save["default"] = _default;
|
|
44742
45023
|
|
|
44743
45024
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
44744
|
-
const ApolloJobModel = require$$1$
|
|
45025
|
+
const ApolloJobModel = require$$1$3.types
|
|
44745
45026
|
.model('JobsManager', {})
|
|
44746
45027
|
.views((self) => ({
|
|
44747
45028
|
get jobStatusWidget() {
|
|
44748
|
-
const { widgets } = require$$1$
|
|
45029
|
+
const { widgets } = require$$1$2.getSession(self);
|
|
44749
45030
|
let jobStatusWidget = widgets.get('JobsList');
|
|
44750
45031
|
if (!jobStatusWidget) {
|
|
44751
45032
|
// @ts-expect-error: addWidget function not detected on the session
|
|
44752
|
-
jobStatusWidget = require$$1$
|
|
45033
|
+
jobStatusWidget = require$$1$2.getSession(self).addWidget('JobsListWidget', 'JobsList');
|
|
44753
45034
|
}
|
|
44754
45035
|
return jobStatusWidget;
|
|
44755
45036
|
},
|
|
@@ -44773,8 +45054,8 @@
|
|
|
44773
45054
|
* @param msg - a message to communicate to the user about the abort operation
|
|
44774
45055
|
*/
|
|
44775
45056
|
abortJob(jobName, msg) {
|
|
44776
|
-
const session = require$$1$
|
|
44777
|
-
if (require$$1$
|
|
45057
|
+
const session = require$$1$2.getSession(self);
|
|
45058
|
+
if (require$$1$2.isSessionModelWithWidgets(session)) {
|
|
44778
45059
|
session.showWidget(self.jobStatusWidget);
|
|
44779
45060
|
self.jobStatusWidget.updateJobStatusMessage(jobName, msg ?? 'Aborted unexpectedly');
|
|
44780
45061
|
// this is done to avoid issues with reusing nodes from other state trees
|
|
@@ -44792,8 +45073,8 @@
|
|
|
44792
45073
|
* @param job - the job to be run within the JobsManager
|
|
44793
45074
|
*/
|
|
44794
45075
|
runJob(job) {
|
|
44795
|
-
const session = require$$1$
|
|
44796
|
-
if (require$$1$
|
|
45076
|
+
const session = require$$1$2.getSession(self);
|
|
45077
|
+
if (require$$1$2.isSessionModelWithWidgets(session)) {
|
|
44797
45078
|
session.showWidget(self.jobStatusWidget);
|
|
44798
45079
|
self.jobStatusWidget.addJob(job);
|
|
44799
45080
|
}
|
|
@@ -44806,8 +45087,8 @@
|
|
|
44806
45087
|
* @param job - the job to be completed
|
|
44807
45088
|
*/
|
|
44808
45089
|
done(job) {
|
|
44809
|
-
const session = require$$1$
|
|
44810
|
-
if (require$$1$
|
|
45090
|
+
const session = require$$1$2.getSession(self);
|
|
45091
|
+
if (require$$1$2.isSessionModelWithWidgets(session)) {
|
|
44811
45092
|
session.showWidget(self.jobStatusWidget);
|
|
44812
45093
|
// this.setProgressPct(100)
|
|
44813
45094
|
self.jobStatusWidget.removeJob(job.name);
|
|
@@ -44838,9 +45119,9 @@
|
|
|
44838
45119
|
async submit(change, opts = {}) {
|
|
44839
45120
|
const { addToRecents = true, submitToBackend = true, updateJobsManager = false, } = opts;
|
|
44840
45121
|
// pre-validate
|
|
44841
|
-
const session = require$$1$
|
|
45122
|
+
const session = require$$1$2.getSession(this.dataStore);
|
|
44842
45123
|
const controller = new AbortController();
|
|
44843
|
-
const { jobsManager } = require$$1$
|
|
45124
|
+
const { jobsManager } = require$$1$2.getSession(this.dataStore);
|
|
44844
45125
|
const job = {
|
|
44845
45126
|
name: change.typeName,
|
|
44846
45127
|
statusMessage: 'Pre-validating',
|
|
@@ -44932,7 +45213,7 @@
|
|
|
44932
45213
|
async revertLastChange() {
|
|
44933
45214
|
const lastChange = this.recentChanges.pop();
|
|
44934
45215
|
if (!lastChange) {
|
|
44935
|
-
const session = require$$1$
|
|
45216
|
+
const session = require$$1$2.getSession(this.dataStore);
|
|
44936
45217
|
session.notify('No changes to undo!', 'warning');
|
|
44937
45218
|
return;
|
|
44938
45219
|
}
|
|
@@ -44974,7 +45255,7 @@
|
|
|
44974
45255
|
*/
|
|
44975
45256
|
async getFeatures(region) {
|
|
44976
45257
|
const { assemblyName, end, refName, start } = region;
|
|
44977
|
-
const { assemblyManager } = require$$1$
|
|
45258
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
44978
45259
|
const assembly = assemblyManager.get(assemblyName);
|
|
44979
45260
|
if (!assembly) {
|
|
44980
45261
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45033,7 +45314,7 @@
|
|
|
45033
45314
|
const inFlightKey = `${region.refName}:${region.start}-${region.end}`;
|
|
45034
45315
|
const inFlightPromise = this.inFlight.get(inFlightKey);
|
|
45035
45316
|
const { assemblyName, end, refName, start } = region;
|
|
45036
|
-
const { assemblyManager } = require$$1$
|
|
45317
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45037
45318
|
const assembly = assemblyManager.get(assemblyName);
|
|
45038
45319
|
if (!assembly) {
|
|
45039
45320
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45093,7 +45374,7 @@
|
|
|
45093
45374
|
return seq;
|
|
45094
45375
|
}
|
|
45095
45376
|
async getRefNameAliases(assemblyName) {
|
|
45096
|
-
const { assemblyManager } = require$$1$
|
|
45377
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45097
45378
|
const assembly = assemblyManager.get(assemblyName);
|
|
45098
45379
|
if (!assembly) {
|
|
45099
45380
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45125,7 +45406,7 @@
|
|
|
45125
45406
|
});
|
|
45126
45407
|
}
|
|
45127
45408
|
async getRegions(assemblyName) {
|
|
45128
|
-
const { assemblyManager } = require$$1$
|
|
45409
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45129
45410
|
const assembly = assemblyManager.get(assemblyName);
|
|
45130
45411
|
if (!assembly) {
|
|
45131
45412
|
throw new Error(`Could not find assembly with name "${assemblyName}"`);
|
|
@@ -45155,7 +45436,7 @@
|
|
|
45155
45436
|
}));
|
|
45156
45437
|
}
|
|
45157
45438
|
getAssemblies(internetAccountId) {
|
|
45158
|
-
const { assemblyManager } = require$$1$
|
|
45439
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45159
45440
|
return assemblyManager.assemblies.filter((assembly) => {
|
|
45160
45441
|
const sequenceMetadata = configuration.getConf(assembly, ['sequence', 'metadata']);
|
|
45161
45442
|
if (sequenceMetadata &&
|
|
@@ -45240,7 +45521,7 @@
|
|
|
45240
45521
|
return regions;
|
|
45241
45522
|
}
|
|
45242
45523
|
getAssemblies() {
|
|
45243
|
-
const { assemblyManager } = require$$1$
|
|
45524
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45244
45525
|
return assemblyManager.assemblies.filter((assembly) => {
|
|
45245
45526
|
const sequenceMetadata = configuration.getConf(assembly, ['sequence', 'metadata']);
|
|
45246
45527
|
return Boolean(sequenceMetadata &&
|
|
@@ -45260,7 +45541,7 @@
|
|
|
45260
45541
|
/* eslint-disable @typescript-eslint/require-await */
|
|
45261
45542
|
class DesktopFileDriver extends BackendDriver {
|
|
45262
45543
|
async loadAssembly(assemblyName) {
|
|
45263
|
-
const { assemblyManager } = require$$1$
|
|
45544
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45264
45545
|
const assembly = assemblyManager.get(assemblyName);
|
|
45265
45546
|
if (!assembly) {
|
|
45266
45547
|
throw new Error(`Assembly ${assemblyName} not found`);
|
|
@@ -45318,7 +45599,7 @@
|
|
|
45318
45599
|
return regions;
|
|
45319
45600
|
}
|
|
45320
45601
|
getAssemblies() {
|
|
45321
|
-
const { assemblyManager } = require$$1$
|
|
45602
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45322
45603
|
return assemblyManager.assemblies.filter((assembly) => {
|
|
45323
45604
|
const sequenceMetadata = configuration.getConf(assembly, ['sequence', 'metadata']);
|
|
45324
45605
|
return Boolean(sequenceMetadata &&
|
|
@@ -45331,7 +45612,7 @@
|
|
|
45331
45612
|
if (!dist$3.isAssemblySpecificChange(change)) {
|
|
45332
45613
|
throw new Error(`Cannot use this type of change with local file: "${change.typeName}"`);
|
|
45333
45614
|
}
|
|
45334
|
-
const { assemblyManager } = require$$1$
|
|
45615
|
+
const { assemblyManager } = require$$1$2.getSession(this.clientStore);
|
|
45335
45616
|
const assembly = assemblyManager.get(change.assembly);
|
|
45336
45617
|
if (!assembly) {
|
|
45337
45618
|
throw new Error(`Could not find assembly with name "${change.assembly}"`);
|
|
@@ -45363,7 +45644,7 @@
|
|
|
45363
45644
|
for (const [, refSeq] of clientAssembly.refSeqs) {
|
|
45364
45645
|
const { features } = refSeq;
|
|
45365
45646
|
for (const [, feature] of features) {
|
|
45366
|
-
gff3Items.push(dist$2.makeGFF3Feature(require$$1$
|
|
45647
|
+
gff3Items.push(dist$2.makeGFF3Feature(require$$1$3.getSnapshot(feature)));
|
|
45367
45648
|
}
|
|
45368
45649
|
}
|
|
45369
45650
|
for (const [, refSeq] of clientAssembly.refSeqs) {
|
|
@@ -45388,22 +45669,22 @@
|
|
|
45388
45669
|
}
|
|
45389
45670
|
|
|
45390
45671
|
function clientDataStoreFactory(AnnotationFeatureExtended) {
|
|
45391
|
-
return require$$1$
|
|
45672
|
+
return require$$1$3.types
|
|
45392
45673
|
.model('ClientDataStore', {
|
|
45393
|
-
typeName: require$$1$
|
|
45394
|
-
assemblies: require$$1$
|
|
45395
|
-
checkResults: require$$1$
|
|
45674
|
+
typeName: require$$1$3.types.optional(require$$1$3.types.literal('Client'), 'Client'),
|
|
45675
|
+
assemblies: require$$1$3.types.map(dist.ApolloAssembly),
|
|
45676
|
+
checkResults: require$$1$3.types.map(dist.CheckResult),
|
|
45396
45677
|
})
|
|
45397
45678
|
.views((self) => ({
|
|
45398
45679
|
get internetAccounts() {
|
|
45399
|
-
return require$$1$
|
|
45680
|
+
return require$$1$3.getRoot(self).internetAccounts;
|
|
45400
45681
|
},
|
|
45401
45682
|
get pluginConfiguration() {
|
|
45402
|
-
return require$$1$
|
|
45683
|
+
return require$$1$3.getRoot(self).jbrowse.configuration
|
|
45403
45684
|
.ApolloPlugin;
|
|
45404
45685
|
},
|
|
45405
45686
|
getFeature(featureId) {
|
|
45406
|
-
return require$$1$
|
|
45687
|
+
return require$$1$3.resolveIdentifier(AnnotationFeatureExtended, self.assemblies, featureId);
|
|
45407
45688
|
},
|
|
45408
45689
|
}))
|
|
45409
45690
|
.actions((self) => ({
|
|
@@ -45438,7 +45719,7 @@
|
|
|
45438
45719
|
parent.deleteChild(featureId);
|
|
45439
45720
|
}
|
|
45440
45721
|
else {
|
|
45441
|
-
const refSeq = require$$1$
|
|
45722
|
+
const refSeq = require$$1$3.getParentOfType(feature, dist.ApolloRefSeq);
|
|
45442
45723
|
refSeq.deleteFeature(_id);
|
|
45443
45724
|
}
|
|
45444
45725
|
},
|
|
@@ -45463,14 +45744,14 @@
|
|
|
45463
45744
|
changeManager: new ChangeManager(self),
|
|
45464
45745
|
collaborationServerDriver: new CollaborationServerDriver(self),
|
|
45465
45746
|
inMemoryFileDriver: new InMemoryFileDriver(self),
|
|
45466
|
-
desktopFileDriver: require$$1$
|
|
45747
|
+
desktopFileDriver: require$$1$2.isElectron
|
|
45467
45748
|
? new DesktopFileDriver(self)
|
|
45468
45749
|
: undefined,
|
|
45469
45750
|
ontologyManager: OntologyManagerType.create(),
|
|
45470
45751
|
}))
|
|
45471
45752
|
.actions((self) => ({
|
|
45472
45753
|
afterCreate() {
|
|
45473
|
-
require$$1$
|
|
45754
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
45474
45755
|
// Merge in the ontologies from our plugin configuration.
|
|
45475
45756
|
// Ontologies of a given name that are already in the session
|
|
45476
45757
|
// take precedence over the ontologies in the configuration.
|
|
@@ -45499,7 +45780,7 @@
|
|
|
45499
45780
|
if (!assemblyId) {
|
|
45500
45781
|
return self.collaborationServerDriver;
|
|
45501
45782
|
}
|
|
45502
|
-
const session = require$$1$
|
|
45783
|
+
const session = require$$1$2.getSession(self);
|
|
45503
45784
|
const { assemblyManager } = session;
|
|
45504
45785
|
const assembly = assemblyManager.get(assemblyId);
|
|
45505
45786
|
if (!assembly) {
|
|
@@ -45509,7 +45790,7 @@
|
|
|
45509
45790
|
'sequence',
|
|
45510
45791
|
'metadata',
|
|
45511
45792
|
]);
|
|
45512
|
-
if (require$$1$
|
|
45793
|
+
if (require$$1$2.isElectron && file) {
|
|
45513
45794
|
return self.desktopFileDriver;
|
|
45514
45795
|
}
|
|
45515
45796
|
if (internetAccountConfigId) {
|
|
@@ -45523,7 +45804,7 @@
|
|
|
45523
45804
|
}
|
|
45524
45805
|
let configId = internetAccountId;
|
|
45525
45806
|
if (assemblyName && !configId) {
|
|
45526
|
-
const { assemblyManager } = require$$1$
|
|
45807
|
+
const { assemblyManager } = require$$1$2.getSession(self);
|
|
45527
45808
|
const assembly = assemblyManager.get(assemblyName);
|
|
45528
45809
|
if (!assembly) {
|
|
45529
45810
|
throw new Error(`No assembly found with name ${assemblyName}`);
|
|
@@ -45542,7 +45823,7 @@
|
|
|
45542
45823
|
},
|
|
45543
45824
|
}))
|
|
45544
45825
|
.actions((self) => ({
|
|
45545
|
-
loadFeatures: require$$1$
|
|
45826
|
+
loadFeatures: require$$1$3.flow(function* loadFeatures(regions) {
|
|
45546
45827
|
for (const region of regions) {
|
|
45547
45828
|
const backendDriver = self.getBackendDriver(region.assemblyName);
|
|
45548
45829
|
if (!backendDriver) {
|
|
@@ -45574,7 +45855,7 @@
|
|
|
45574
45855
|
self.addCheckResults(checkResults);
|
|
45575
45856
|
}
|
|
45576
45857
|
}),
|
|
45577
|
-
loadRefSeq: require$$1$
|
|
45858
|
+
loadRefSeq: require$$1$3.flow(function* loadRefSeq(regions) {
|
|
45578
45859
|
for (const region of regions) {
|
|
45579
45860
|
const backendDriver = self.getBackendDriver(region.assemblyName);
|
|
45580
45861
|
if (!backendDriver) {
|
|
@@ -45607,9 +45888,9 @@
|
|
|
45607
45888
|
const ClientDataStore = clientDataStoreFactory(AnnotationFeatureExtended);
|
|
45608
45889
|
const sm = sessionModel
|
|
45609
45890
|
.props({
|
|
45610
|
-
apolloDataStore: require$$1$
|
|
45611
|
-
apolloSelectedFeature: require$$1$
|
|
45612
|
-
jobsManager: require$$1$
|
|
45891
|
+
apolloDataStore: require$$1$3.types.optional(ClientDataStore, { typeName: 'Client' }),
|
|
45892
|
+
apolloSelectedFeature: require$$1$3.types.safeReference(AnnotationFeatureExtended),
|
|
45893
|
+
jobsManager: require$$1$3.types.optional(ApolloJobModel, {}),
|
|
45613
45894
|
})
|
|
45614
45895
|
.extend(() => {
|
|
45615
45896
|
const collabs = mobx.observable.array([]);
|
|
@@ -45673,7 +45954,7 @@
|
|
|
45673
45954
|
}
|
|
45674
45955
|
},
|
|
45675
45956
|
broadcastLocations() {
|
|
45676
|
-
const { internetAccounts } = require$$1$
|
|
45957
|
+
const { internetAccounts } = require$$1$3.getRoot(self);
|
|
45677
45958
|
const locations = [];
|
|
45678
45959
|
for (const view of self.views) {
|
|
45679
45960
|
if (view.type !== 'LinearGenomeView') {
|
|
@@ -45717,16 +45998,16 @@
|
|
|
45717
45998
|
},
|
|
45718
45999
|
}))
|
|
45719
46000
|
.actions((self) => ({
|
|
45720
|
-
afterCreate: require$$1$
|
|
46001
|
+
afterCreate: require$$1$3.flow(function* afterCreate() {
|
|
45721
46002
|
// When the initial config.json loads, it doesn't include the Apollo
|
|
45722
46003
|
// tracks, which would result in a potentially invalid session snapshot
|
|
45723
46004
|
// if any tracks are open. Here we copy the session snapshot, apply an
|
|
45724
46005
|
// empty session snapshot, and then restore the original session
|
|
45725
46006
|
// snapshot after the updated config.json loads.
|
|
45726
|
-
const sessionSnapshot = require$$1$
|
|
46007
|
+
const sessionSnapshot = require$$1$3.getSnapshot(self);
|
|
45727
46008
|
const { id, name } = sessionSnapshot;
|
|
45728
|
-
require$$1$
|
|
45729
|
-
const { internetAccounts, jbrowse } = require$$1$
|
|
46009
|
+
require$$1$3.applySnapshot(self, { name, id });
|
|
46010
|
+
const { internetAccounts, jbrowse } = require$$1$3.getRoot(self);
|
|
45730
46011
|
mobx.autorun(() => {
|
|
45731
46012
|
// broadcastLocations() // **** This is not working and therefore we need to duplicate broadcastLocations() -method code here because autorun() does not observe changes otherwise
|
|
45732
46013
|
const locations = [];
|
|
@@ -45804,8 +46085,8 @@
|
|
|
45804
46085
|
console.error(error);
|
|
45805
46086
|
continue;
|
|
45806
46087
|
}
|
|
45807
|
-
require$$1$
|
|
45808
|
-
require$$1$
|
|
46088
|
+
require$$1$3.applySnapshot(jbrowse, jbrowseConfig);
|
|
46089
|
+
require$$1$3.applySnapshot(self, sessionSnapshot);
|
|
45809
46090
|
}
|
|
45810
46091
|
}),
|
|
45811
46092
|
beforeDestroy() {
|
|
@@ -45829,16 +46110,16 @@
|
|
|
45829
46110
|
{
|
|
45830
46111
|
label: 'Save track to Apollo',
|
|
45831
46112
|
onClick: async () => {
|
|
45832
|
-
const { internetAccounts, jbrowse } = require$$1$
|
|
45833
|
-
const currentConfig = require$$1$
|
|
46113
|
+
const { internetAccounts, jbrowse } = require$$1$3.getRoot(self);
|
|
46114
|
+
const currentConfig = require$$1$3.getSnapshot(jbrowse);
|
|
45834
46115
|
let filteredConfig;
|
|
45835
46116
|
filteredConfig = dist$2.filterJBrowseConfig(currentConfig);
|
|
45836
46117
|
if (Object.keys(filteredConfig).length === 0) {
|
|
45837
46118
|
filteredConfig = undefined;
|
|
45838
46119
|
}
|
|
45839
|
-
|
|
46120
|
+
const trackConfigSnapshot = require$$1$3.getSnapshot(conf);
|
|
45840
46121
|
const newTrackId = trackId.slice(0, trackId.length - sessionTrackIdentifier.length);
|
|
45841
|
-
|
|
46122
|
+
const newTrackConfigSnapshot = {
|
|
45842
46123
|
...trackConfigSnapshot,
|
|
45843
46124
|
trackId: newTrackId,
|
|
45844
46125
|
};
|
|
@@ -45853,7 +46134,7 @@
|
|
|
45853
46134
|
...filteredConfig,
|
|
45854
46135
|
tracks: filteredConfig?.tracks && [
|
|
45855
46136
|
...filteredConfig.tracks,
|
|
45856
|
-
|
|
46137
|
+
newTrackConfigSnapshot,
|
|
45857
46138
|
],
|
|
45858
46139
|
},
|
|
45859
46140
|
});
|
|
@@ -45864,6 +46145,10 @@
|
|
|
45864
46145
|
const { notify } = self;
|
|
45865
46146
|
notify('Track added', 'success');
|
|
45866
46147
|
}
|
|
46148
|
+
// @ts-expect-error This method is missing in the JB types
|
|
46149
|
+
self.deleteTrackConf(conf);
|
|
46150
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
46151
|
+
jbrowse.addTrackConf(newTrackConfigSnapshot);
|
|
45867
46152
|
},
|
|
45868
46153
|
icon: default_1,
|
|
45869
46154
|
},
|
|
@@ -45873,8 +46158,8 @@
|
|
|
45873
46158
|
{
|
|
45874
46159
|
label: 'Remove track from Apollo',
|
|
45875
46160
|
onClick: async () => {
|
|
45876
|
-
const { internetAccounts, jbrowse } = require$$1$
|
|
45877
|
-
const currentConfig = require$$1$
|
|
46161
|
+
const { internetAccounts, jbrowse } = require$$1$3.getRoot(self);
|
|
46162
|
+
const currentConfig = require$$1$3.getSnapshot(jbrowse);
|
|
45878
46163
|
let filteredConfig;
|
|
45879
46164
|
filteredConfig = dist$2.filterJBrowseConfig(currentConfig);
|
|
45880
46165
|
if (Object.keys(filteredConfig).length === 0) {
|
|
@@ -45900,6 +46185,10 @@
|
|
|
45900
46185
|
const { notify } = self;
|
|
45901
46186
|
notify('Track removed', 'success');
|
|
45902
46187
|
}
|
|
46188
|
+
// @ts-expect-error This method is missing in the JB types
|
|
46189
|
+
self.deleteTrackConf(conf);
|
|
46190
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
46191
|
+
jbrowse.deleteTrackConf(conf);
|
|
45903
46192
|
},
|
|
45904
46193
|
icon: default_1,
|
|
45905
46194
|
},
|
|
@@ -45907,7 +46196,7 @@
|
|
|
45907
46196
|
},
|
|
45908
46197
|
};
|
|
45909
46198
|
});
|
|
45910
|
-
return require$$1$
|
|
46199
|
+
return require$$1$3.types.snapshotProcessor(sm, {
|
|
45911
46200
|
postProcessor(snap) {
|
|
45912
46201
|
snap.apolloSelectedFeature = undefined;
|
|
45913
46202
|
const assemblies = Object.fromEntries(Object.entries(snap.apolloDataStore.assemblies).filter(([, assembly]) => assembly.backendDriverType === 'InMemoryFileDriver'));
|
|
@@ -45937,7 +46226,7 @@
|
|
|
45937
46226
|
const { BaseLinearDisplay } = LGVPlugin.exports;
|
|
45938
46227
|
return BaseLinearDisplay.named('SixFrameFeatureDisplay')
|
|
45939
46228
|
.props({
|
|
45940
|
-
type: require$$1$
|
|
46229
|
+
type: require$$1$3.types.literal('SixFrameFeatureDisplay'),
|
|
45941
46230
|
configuration: configuration.ConfigurationReference(configSchema),
|
|
45942
46231
|
apolloRowHeight: 20,
|
|
45943
46232
|
detailsMinHeight: 200,
|
|
@@ -45980,23 +46269,23 @@
|
|
|
45980
46269
|
return regions;
|
|
45981
46270
|
},
|
|
45982
46271
|
regionCannotBeRendered( /* region */) {
|
|
45983
|
-
const view = require$$1$
|
|
46272
|
+
const view = require$$1$2.getContainingView(self);
|
|
45984
46273
|
if (view && view.bpPerPx >= 200) {
|
|
45985
46274
|
return 'Zoom in to see annotations';
|
|
45986
46275
|
}
|
|
45987
46276
|
return;
|
|
45988
46277
|
},
|
|
45989
46278
|
get session() {
|
|
45990
|
-
return require$$1$
|
|
46279
|
+
return require$$1$2.getSession(self);
|
|
45991
46280
|
},
|
|
45992
46281
|
}))
|
|
45993
46282
|
.actions((self) => {
|
|
45994
46283
|
let previousBlockKeys = [];
|
|
45995
46284
|
return {
|
|
45996
46285
|
afterAttach() {
|
|
45997
|
-
require$$1$
|
|
45998
|
-
const session = require$$1$
|
|
45999
|
-
const view = require$$1$
|
|
46286
|
+
require$$1$3.addDisposer(self, mobx.autorun(() => {
|
|
46287
|
+
const session = require$$1$2.getSession(self);
|
|
46288
|
+
const view = require$$1$2.getContainingView(self);
|
|
46000
46289
|
if (view.initialized) {
|
|
46001
46290
|
if (self.regionCannotBeRendered()) {
|
|
46002
46291
|
return;
|
|
@@ -46032,12 +46321,12 @@
|
|
|
46032
46321
|
return self.configuration.renderer.type;
|
|
46033
46322
|
},
|
|
46034
46323
|
get changeManager() {
|
|
46035
|
-
const session = require$$1$
|
|
46324
|
+
const session = require$$1$2.getSession(self);
|
|
46036
46325
|
return session.apolloDataStore.changeManager;
|
|
46037
46326
|
},
|
|
46038
46327
|
get sequence() {
|
|
46039
46328
|
const { regions } = self;
|
|
46040
|
-
const session = require$$1$
|
|
46329
|
+
const session = require$$1$2.getSession(self);
|
|
46041
46330
|
const seq = new Map();
|
|
46042
46331
|
for (const region of regions) {
|
|
46043
46332
|
const assembly = session.apolloDataStore.assemblies.get(region.assemblyName);
|
|
@@ -46049,7 +46338,7 @@
|
|
|
46049
46338
|
},
|
|
46050
46339
|
get features() {
|
|
46051
46340
|
const { regions } = self;
|
|
46052
|
-
const session = require$$1$
|
|
46341
|
+
const session = require$$1$2.getSession(self);
|
|
46053
46342
|
const features = new Map();
|
|
46054
46343
|
for (const region of regions) {
|
|
46055
46344
|
const assembly = session.apolloDataStore.assemblies.get(region.assemblyName);
|
|
@@ -46122,7 +46411,7 @@
|
|
|
46122
46411
|
if (reversed) {
|
|
46123
46412
|
tilt = (fullSeq.length + fullStart) % 3;
|
|
46124
46413
|
effectiveFrame = (reversePhaseMap[i] + tilt + 3) % 3;
|
|
46125
|
-
seqSliced = require$$1$
|
|
46414
|
+
seqSliced = require$$1$2.reverse(fullSeq).slice(effectiveFrame);
|
|
46126
46415
|
}
|
|
46127
46416
|
else {
|
|
46128
46417
|
tilt = 3 - (fullStart % 3);
|
|
@@ -46131,14 +46420,14 @@
|
|
|
46131
46420
|
}
|
|
46132
46421
|
for (let j = 0; j < seqSliced.length; j += 3) {
|
|
46133
46422
|
const codon = seqSliced.slice(j, j + 3);
|
|
46134
|
-
const normalizedCodon = reversed ? require$$1$
|
|
46423
|
+
const normalizedCodon = reversed ? require$$1$2.reverse(require$$1$2.revcom(codon)) : codon;
|
|
46135
46424
|
const start = reversed
|
|
46136
46425
|
? fullStart + seqSliced.length - (3 + j)
|
|
46137
46426
|
: fullStart + j + effectiveFrame;
|
|
46138
|
-
if (require$$1$
|
|
46427
|
+
if (require$$1$2.defaultStarts.includes(normalizedCodon.toUpperCase())) {
|
|
46139
46428
|
starts.push(start);
|
|
46140
46429
|
}
|
|
46141
|
-
else if (require$$1$
|
|
46430
|
+
else if (require$$1$2.defaultStops.includes(normalizedCodon.toUpperCase())) {
|
|
46142
46431
|
stops.push(start);
|
|
46143
46432
|
}
|
|
46144
46433
|
}
|
|
@@ -46208,7 +46497,7 @@
|
|
|
46208
46497
|
return featureLayout;
|
|
46209
46498
|
},
|
|
46210
46499
|
getAssemblyId(assemblyName) {
|
|
46211
|
-
const { assemblyManager } = require$$1$
|
|
46500
|
+
const { assemblyManager } = require$$1$2.getSession(self);
|
|
46212
46501
|
const assembly = assemblyManager.get(assemblyName);
|
|
46213
46502
|
if (!assembly) {
|
|
46214
46503
|
throw new Error(`Could not find assembly named ${assemblyName}`);
|
|
@@ -46216,17 +46505,17 @@
|
|
|
46216
46505
|
return assembly.name;
|
|
46217
46506
|
},
|
|
46218
46507
|
get selectedFeature() {
|
|
46219
|
-
const session = require$$1$
|
|
46508
|
+
const session = require$$1$2.getSession(self);
|
|
46220
46509
|
return session.apolloSelectedFeature;
|
|
46221
46510
|
},
|
|
46222
46511
|
get setSelectedFeature() {
|
|
46223
|
-
const session = require$$1$
|
|
46512
|
+
const session = require$$1$2.getSession(self);
|
|
46224
46513
|
return session.apolloSetSelectedFeature;
|
|
46225
46514
|
},
|
|
46226
46515
|
}))
|
|
46227
46516
|
.actions((self) => ({
|
|
46228
46517
|
setSelectedFeature(feature) {
|
|
46229
|
-
const session = require$$1$
|
|
46518
|
+
const session = require$$1$2.getSession(self);
|
|
46230
46519
|
session.apolloSetSelectedFeature(feature);
|
|
46231
46520
|
},
|
|
46232
46521
|
setApolloFeatureUnderMouse(feature) {
|
|
@@ -46472,7 +46761,7 @@
|
|
|
46472
46761
|
label: 'Add new feature',
|
|
46473
46762
|
icon: default_1$a,
|
|
46474
46763
|
onClick: () => {
|
|
46475
|
-
const session = require$$1$
|
|
46764
|
+
const session = require$$1$2.getSession(self);
|
|
46476
46765
|
const { leftOffset, rightOffset } = self;
|
|
46477
46766
|
const selectedRegions = self.getSelectedRegions(leftOffset, rightOffset);
|
|
46478
46767
|
session.queueDialog((doneCallback) => [
|
|
@@ -46561,7 +46850,7 @@
|
|
|
46561
46850
|
}
|
|
46562
46851
|
}
|
|
46563
46852
|
configure(pluginManager) {
|
|
46564
|
-
if (require$$1$
|
|
46853
|
+
if (require$$1$2.isAbstractMenuManager(pluginManager.rootModel)) {
|
|
46565
46854
|
pluginManager.rootModel.appendToMenu('Apollo', {
|
|
46566
46855
|
label: 'Download GFF3',
|
|
46567
46856
|
onClick: (session) => {
|