@jbrowse/plugin-sequence 2.0.0 → 2.1.2
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/BgzipFastaAdapter/BgzipFastaAdapter.js +16 -34
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.js.map +1 -1
- package/dist/BgzipFastaAdapter/configSchema.js +1 -1
- package/dist/BgzipFastaAdapter/configSchema.js.map +1 -1
- package/dist/BgzipFastaAdapter/index.d.ts +3 -1
- package/dist/BgzipFastaAdapter/index.js +38 -3
- package/dist/BgzipFastaAdapter/index.js.map +1 -1
- package/dist/ChromSizesAdapter/ChromSizesAdapter.d.ts +9 -9
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js +34 -128
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js.map +1 -1
- package/dist/ChromSizesAdapter/configSchema.js +1 -1
- package/dist/ChromSizesAdapter/configSchema.js.map +1 -1
- package/dist/ChromSizesAdapter/index.d.ts +3 -1
- package/dist/ChromSizesAdapter/index.js +38 -3
- package/dist/ChromSizesAdapter/index.js.map +1 -1
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +51 -89
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js.map +1 -1
- package/dist/DivSequenceRenderer/configSchema.js +1 -1
- package/dist/DivSequenceRenderer/configSchema.js.map +1 -1
- package/dist/DivSequenceRenderer/index.d.ts +3 -2
- package/dist/DivSequenceRenderer/index.js +25 -5
- package/dist/DivSequenceRenderer/index.js.map +1 -1
- package/dist/GCContentAdapter/GCContentAdapter.d.ts +1 -7
- package/dist/GCContentAdapter/GCContentAdapter.js +75 -180
- package/dist/GCContentAdapter/GCContentAdapter.js.map +1 -1
- package/dist/GCContentAdapter/configSchema.js +3 -3
- package/dist/GCContentAdapter/configSchema.js.map +1 -1
- package/dist/GCContentAdapter/index.d.ts +1 -4
- package/dist/GCContentAdapter/index.js +15 -7
- package/dist/GCContentAdapter/index.js.map +1 -1
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +77 -171
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js.map +1 -1
- package/dist/IndexedFastaAdapter/configSchema.js +1 -1
- package/dist/IndexedFastaAdapter/configSchema.js.map +1 -1
- package/dist/IndexedFastaAdapter/index.d.ts +3 -1
- package/dist/IndexedFastaAdapter/index.js +38 -3
- package/dist/IndexedFastaAdapter/index.js.map +1 -1
- package/dist/LinearReferenceSequenceDisplay/configSchema.js +6 -3
- package/dist/LinearReferenceSequenceDisplay/configSchema.js.map +1 -1
- package/dist/LinearReferenceSequenceDisplay/index.d.ts +3 -2
- package/dist/LinearReferenceSequenceDisplay/index.js +16 -5
- package/dist/LinearReferenceSequenceDisplay/index.js.map +1 -1
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +1 -1
- package/dist/LinearReferenceSequenceDisplay/model.js +29 -33
- package/dist/LinearReferenceSequenceDisplay/model.js.map +1 -1
- package/dist/{referenceSeqTrackConfig.d.ts → ReferenceSequenceTrack/configSchema.d.ts} +0 -0
- package/dist/{referenceSeqTrackConfig.js → ReferenceSequenceTrack/configSchema.js} +19 -30
- package/dist/ReferenceSequenceTrack/configSchema.js.map +1 -0
- package/dist/ReferenceSequenceTrack/index.d.ts +3 -0
- package/dist/ReferenceSequenceTrack/index.js +19 -0
- package/dist/ReferenceSequenceTrack/index.js.map +1 -0
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +8 -0
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.js +84 -0
- package/dist/SequenceSearchAdapter/SequenceSearchAdapter.js.map +1 -0
- package/dist/SequenceSearchAdapter/configSchema.d.ts +2 -0
- package/dist/SequenceSearchAdapter/configSchema.js +28 -0
- package/dist/SequenceSearchAdapter/configSchema.js.map +1 -0
- package/dist/SequenceSearchAdapter/index.d.ts +3 -0
- package/dist/SequenceSearchAdapter/index.js +44 -0
- package/dist/SequenceSearchAdapter/index.js.map +1 -0
- package/dist/TwoBitAdapter/TwoBitAdapter.js +66 -174
- package/dist/TwoBitAdapter/TwoBitAdapter.js.map +1 -1
- package/dist/TwoBitAdapter/configSchema.js +1 -1
- package/dist/TwoBitAdapter/configSchema.js.map +1 -1
- package/dist/TwoBitAdapter/index.d.ts +3 -1
- package/dist/TwoBitAdapter/index.js +38 -3
- package/dist/TwoBitAdapter/index.js.map +1 -1
- package/dist/createExtensionPoints.d.ts +3 -0
- package/dist/createExtensionPoints.js +86 -0
- package/dist/createExtensionPoints.js.map +1 -0
- package/dist/index.js +27 -261
- package/dist/index.js.map +1 -1
- package/esm/BgzipFastaAdapter/index.d.ts +3 -1
- package/esm/BgzipFastaAdapter/index.js +15 -1
- package/esm/BgzipFastaAdapter/index.js.map +1 -1
- package/esm/ChromSizesAdapter/ChromSizesAdapter.d.ts +9 -9
- package/esm/ChromSizesAdapter/ChromSizesAdapter.js +20 -26
- package/esm/ChromSizesAdapter/ChromSizesAdapter.js.map +1 -1
- package/esm/ChromSizesAdapter/index.d.ts +3 -1
- package/esm/ChromSizesAdapter/index.js +15 -1
- package/esm/ChromSizesAdapter/index.js.map +1 -1
- package/esm/DivSequenceRenderer/index.d.ts +3 -2
- package/esm/DivSequenceRenderer/index.js +25 -2
- package/esm/DivSequenceRenderer/index.js.map +1 -1
- package/esm/GCContentAdapter/GCContentAdapter.d.ts +1 -7
- package/esm/GCContentAdapter/GCContentAdapter.js +7 -18
- package/esm/GCContentAdapter/GCContentAdapter.js.map +1 -1
- package/esm/GCContentAdapter/index.d.ts +1 -4
- package/esm/GCContentAdapter/index.js +11 -3
- package/esm/GCContentAdapter/index.js.map +1 -1
- package/esm/IndexedFastaAdapter/index.d.ts +3 -1
- package/esm/IndexedFastaAdapter/index.js +15 -1
- package/esm/IndexedFastaAdapter/index.js.map +1 -1
- package/esm/LinearReferenceSequenceDisplay/configSchema.js +1 -1
- package/esm/LinearReferenceSequenceDisplay/configSchema.js.map +1 -1
- package/esm/LinearReferenceSequenceDisplay/index.d.ts +3 -2
- package/esm/LinearReferenceSequenceDisplay/index.js +16 -2
- package/esm/LinearReferenceSequenceDisplay/index.js.map +1 -1
- package/esm/LinearReferenceSequenceDisplay/model.d.ts +1 -1
- package/esm/{referenceSeqTrackConfig.d.ts → ReferenceSequenceTrack/configSchema.d.ts} +0 -0
- package/esm/{referenceSeqTrackConfig.js → ReferenceSequenceTrack/configSchema.js} +1 -1
- package/esm/ReferenceSequenceTrack/configSchema.js.map +1 -0
- package/esm/ReferenceSequenceTrack/index.d.ts +3 -0
- package/esm/ReferenceSequenceTrack/index.js +14 -0
- package/esm/ReferenceSequenceTrack/index.js.map +1 -0
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.d.ts +8 -0
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.js +81 -0
- package/esm/SequenceSearchAdapter/SequenceSearchAdapter.js.map +1 -0
- package/esm/SequenceSearchAdapter/configSchema.d.ts +2 -0
- package/esm/SequenceSearchAdapter/configSchema.js +26 -0
- package/esm/SequenceSearchAdapter/configSchema.js.map +1 -0
- package/esm/SequenceSearchAdapter/index.d.ts +3 -0
- package/esm/SequenceSearchAdapter/index.js +16 -0
- package/esm/SequenceSearchAdapter/index.js.map +1 -0
- package/esm/TwoBitAdapter/index.d.ts +3 -1
- package/esm/TwoBitAdapter/index.js +15 -1
- package/esm/TwoBitAdapter/index.js.map +1 -1
- package/esm/createExtensionPoints.d.ts +3 -0
- package/esm/createExtensionPoints.js +84 -0
- package/esm/createExtensionPoints.js.map +1 -0
- package/esm/index.js +19 -186
- package/esm/index.js.map +1 -1
- package/package.json +6 -8
- package/src/BgzipFastaAdapter/index.ts +22 -1
- package/src/ChromSizesAdapter/ChromSizesAdapter.ts +22 -42
- package/src/ChromSizesAdapter/index.ts +22 -1
- package/src/DivSequenceRenderer/index.ts +31 -2
- package/src/GCContentAdapter/GCContentAdapter.ts +15 -25
- package/src/GCContentAdapter/index.ts +17 -4
- package/src/IndexedFastaAdapter/index.ts +22 -1
- package/src/LinearReferenceSequenceDisplay/configSchema.ts +1 -1
- package/src/LinearReferenceSequenceDisplay/index.ts +19 -2
- package/src/{referenceSeqTrackConfig.ts → ReferenceSequenceTrack/configSchema.ts} +0 -0
- package/src/ReferenceSequenceTrack/index.ts +21 -0
- package/src/SequenceSearchAdapter/SequenceSearchAdapter.ts +103 -0
- package/src/SequenceSearchAdapter/configSchema.ts +31 -0
- package/src/SequenceSearchAdapter/index.ts +22 -0
- package/src/TwoBitAdapter/index.ts +21 -1
- package/src/createExtensionPoints.ts +122 -0
- package/src/index.ts +20 -268
- package/dist/referenceSeqTrackConfig.js.map +0 -1
- package/esm/referenceSeqTrackConfig.js.map +0 -1
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var gziLocation = (0, configuration_1.readConfObject)(config, 'gziLocation');
|
|
6
|
+
const indexedfasta_1 = require("@gmod/indexedfasta");
|
|
7
|
+
const io_1 = require("@jbrowse/core/util/io");
|
|
8
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
9
|
+
const IndexedFastaAdapter_1 = __importDefault(require("../IndexedFastaAdapter/IndexedFastaAdapter"));
|
|
10
|
+
class default_1 extends IndexedFastaAdapter_1.default {
|
|
11
|
+
constructor(config, getSubAdapter, pluginManager) {
|
|
12
|
+
super(config, getSubAdapter, pluginManager);
|
|
13
|
+
const fastaLocation = (0, configuration_1.readConfObject)(config, 'fastaLocation');
|
|
14
|
+
const faiLocation = (0, configuration_1.readConfObject)(config, 'faiLocation');
|
|
15
|
+
const gziLocation = (0, configuration_1.readConfObject)(config, 'gziLocation');
|
|
32
16
|
if (!fastaLocation) {
|
|
33
17
|
throw new Error('must provide fastaLocation');
|
|
34
18
|
}
|
|
@@ -38,15 +22,13 @@ var default_1 = /** @class */ (function (_super) {
|
|
|
38
22
|
if (!gziLocation) {
|
|
39
23
|
throw new Error('must provide gziLocation');
|
|
40
24
|
}
|
|
41
|
-
|
|
42
|
-
fasta: (0, io_1.openLocation)(fastaLocation,
|
|
43
|
-
fai: (0, io_1.openLocation)(faiLocation,
|
|
44
|
-
gzi: (0, io_1.openLocation)(gziLocation,
|
|
25
|
+
const fastaOpts = {
|
|
26
|
+
fasta: (0, io_1.openLocation)(fastaLocation, this.pluginManager),
|
|
27
|
+
fai: (0, io_1.openLocation)(faiLocation, this.pluginManager),
|
|
28
|
+
gzi: (0, io_1.openLocation)(gziLocation, this.pluginManager),
|
|
45
29
|
};
|
|
46
|
-
|
|
47
|
-
return _this;
|
|
30
|
+
this.fasta = new indexedfasta_1.BgzipIndexedFasta(fastaOpts);
|
|
48
31
|
}
|
|
49
|
-
|
|
50
|
-
}(IndexedFastaAdapter_1.default));
|
|
32
|
+
}
|
|
51
33
|
exports.default = default_1;
|
|
52
34
|
//# sourceMappingURL=BgzipFastaAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BgzipFastaAdapter.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/BgzipFastaAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BgzipFastaAdapter.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/BgzipFastaAdapter.ts"],"names":[],"mappings":";;;;;AAAA,qDAAsD;AAEtD,8CAAoD;AACpD,+DAA4D;AAE5D,qGAAqE;AAIrE,eAAqB,SAAQ,6BAAY;IACvC,YACE,MAA6B,EAC7B,aAAiC,EACjC,aAA6B;QAE7B,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,CAAA;QAC3C,MAAM,aAAa,GAAG,IAAA,8BAAc,EAAC,MAAM,EAAE,eAAe,CAAC,CAAA;QAC7D,MAAM,WAAW,GAAG,IAAA,8BAAc,EAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACzD,MAAM,WAAW,GAAG,IAAA,8BAAc,EAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACzD,IAAI,CAAC,aAAa,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAA;SAC9C;QACD,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;SAC5C;QACD,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;SAC5C;QACD,MAAM,SAAS,GAAG;YAChB,KAAK,EAAE,IAAA,iBAAY,EAAC,aAA6B,EAAE,IAAI,CAAC,aAAa,CAAC;YACtE,GAAG,EAAE,IAAA,iBAAY,EAAC,WAA2B,EAAE,IAAI,CAAC,aAAa,CAAC;YAClE,GAAG,EAAE,IAAA,iBAAY,EAAC,WAA2B,EAAE,IAAI,CAAC,aAAa,CAAC;SACnE,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,gCAAiB,CAAC,SAAS,CAAC,CAAA;IAC/C,CAAC;CACF;AA3BD,4BA2BC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
4
|
exports.default = (0, configuration_1.ConfigurationSchema)('BgzipFastaAdapter', {
|
|
5
5
|
fastaLocation: {
|
|
6
6
|
type: 'fileLocation',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA,+DAAiE;AAEjE,kBAAe,IAAA,mCAAmB,EAChC,mBAAmB,EACnB;IACE,aAAa,EAAE;QACb,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,EAAE,GAAG,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE;KACzE;IACD,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,wBAAwB;YAC7B,YAAY,EAAE,aAAa;SAC5B;KACF;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,wBAAwB;QACrC,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,2BAA2B;YAChC,YAAY,EAAE,aAAa;SAC5B;KACF;IACD,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,wBAAwB;YAC7B,YAAY,EAAE,aAAa;SAC5B;KACF;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
|
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
29
|
+
const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
|
|
30
|
+
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
31
|
+
exports.default = (pluginManager) => {
|
|
32
|
+
pluginManager.addAdapterType(() => new AdapterType_1.default({
|
|
33
|
+
name: 'BgzipFastaAdapter',
|
|
34
|
+
configSchema: configSchema_1.default,
|
|
35
|
+
adapterMetadata: {
|
|
36
|
+
category: null,
|
|
37
|
+
hiddenFromGUI: true,
|
|
38
|
+
displayName: null,
|
|
39
|
+
description: null,
|
|
40
|
+
},
|
|
41
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./BgzipFastaAdapter'))).then(r => r.default),
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
9
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/BgzipFastaAdapter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kGAAyE;AAEzE,kEAAyC;AAEzC,kBAAe,CAAC,aAA4B,EAAE,EAAE;IAC9C,aAAa,CAAC,cAAc,CAC1B,GAAG,EAAE,CACH,IAAI,qBAAW,CAAC;QACd,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAZ,sBAAY;QACZ,eAAe,EAAE;YACf,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;SAClB;QACD,eAAe,EAAE,GAAG,EAAE,CACpB,kDAAO,qBAAqB,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;KACrD,CAAC,CACL,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { RegionsAdapter, BaseAdapter } from '@jbrowse/core/data_adapters/BaseAdapter';
|
|
2
|
-
import { Instance } from 'mobx-state-tree';
|
|
3
|
-
import MyConfigSchema from './configSchema';
|
|
4
|
-
import PluginManager from '@jbrowse/core/PluginManager';
|
|
5
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
|
|
6
2
|
export default class extends BaseAdapter implements RegionsAdapter {
|
|
7
|
-
protected
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
protected setupP?: Promise<{
|
|
4
|
+
[key: string]: number;
|
|
5
|
+
}>;
|
|
6
|
+
setupPre(): Promise<{
|
|
7
|
+
[k: string]: number;
|
|
8
|
+
}>;
|
|
9
|
+
setup(): Promise<{
|
|
10
|
+
[key: string]: number;
|
|
11
|
+
}>;
|
|
11
12
|
getRegions(): Promise<{
|
|
12
13
|
refName: string;
|
|
13
14
|
start: number;
|
|
14
15
|
end: number;
|
|
15
16
|
}[]>;
|
|
16
|
-
getFeatures(): void;
|
|
17
17
|
getHeader(): {};
|
|
18
18
|
freeResources(): void;
|
|
19
19
|
}
|
|
@@ -1,136 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
54
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
55
|
-
if (!m) return o;
|
|
56
|
-
var i = m.call(o), r, ar = [], e;
|
|
57
|
-
try {
|
|
58
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
4
|
+
const io_1 = require("@jbrowse/core/util/io");
|
|
5
|
+
class default_1 extends BaseAdapter_1.BaseAdapter {
|
|
6
|
+
async setupPre() {
|
|
7
|
+
const pm = this.pluginManager;
|
|
8
|
+
const file = (0, io_1.openLocation)(this.getConf('chromSizesLocation'), pm);
|
|
9
|
+
const data = await file.readFile('utf8');
|
|
10
|
+
return Object.fromEntries(data
|
|
11
|
+
.split('\n')
|
|
12
|
+
.map(f => f.trim())
|
|
13
|
+
.filter(f => !!f)
|
|
14
|
+
.map((line) => {
|
|
15
|
+
const [name, length] = line.split('\t');
|
|
16
|
+
return [name, +length];
|
|
17
|
+
}));
|
|
59
18
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
19
|
+
async setup() {
|
|
20
|
+
if (!this.setupP) {
|
|
21
|
+
this.setupP = this.setupPre().catch(e => {
|
|
22
|
+
this.setupP = undefined;
|
|
23
|
+
throw e;
|
|
24
|
+
});
|
|
64
25
|
}
|
|
65
|
-
|
|
26
|
+
return this.setupP;
|
|
66
27
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Object.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
__extends(default_1, _super);
|
|
75
|
-
function default_1(config, getSubAdapter, pluginManager) {
|
|
76
|
-
var _this = _super.call(this, config, getSubAdapter, pluginManager) || this;
|
|
77
|
-
var chromSizesLocation = (0, configuration_1.readConfObject)(config, 'chromSizesLocation');
|
|
78
|
-
if (!chromSizesLocation) {
|
|
79
|
-
throw new Error('must provide chromSizesLocation');
|
|
80
|
-
}
|
|
81
|
-
var file = (0, io_1.openLocation)(chromSizesLocation, _this.pluginManager);
|
|
82
|
-
_this.source = file.toString();
|
|
83
|
-
_this.refSeqs = _this.init(file);
|
|
84
|
-
return _this;
|
|
28
|
+
async getRegions() {
|
|
29
|
+
const refSeqs = await this.setup();
|
|
30
|
+
return Object.keys(refSeqs).map(refName => ({
|
|
31
|
+
refName,
|
|
32
|
+
start: 0,
|
|
33
|
+
end: refSeqs[refName],
|
|
34
|
+
}));
|
|
85
35
|
}
|
|
86
|
-
|
|
87
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
88
|
-
var data, refSeqs;
|
|
89
|
-
return __generator(this, function (_a) {
|
|
90
|
-
switch (_a.label) {
|
|
91
|
-
case 0: return [4 /*yield*/, file.readFile('utf8')];
|
|
92
|
-
case 1:
|
|
93
|
-
data = _a.sent();
|
|
94
|
-
refSeqs = {};
|
|
95
|
-
if (!data.length) {
|
|
96
|
-
throw new Error("Could not read file ".concat(file.toString()));
|
|
97
|
-
}
|
|
98
|
-
data.split('\n').forEach(function (line) {
|
|
99
|
-
if (line.length) {
|
|
100
|
-
var _a = __read(line.split('\t'), 2), name_1 = _a[0], length_1 = _a[1];
|
|
101
|
-
refSeqs[name_1] = +length_1;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return [2 /*return*/, refSeqs];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
};
|
|
109
|
-
default_1.prototype.getRegions = function () {
|
|
110
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
111
|
-
var refSeqs;
|
|
112
|
-
return __generator(this, function (_a) {
|
|
113
|
-
switch (_a.label) {
|
|
114
|
-
case 0: return [4 /*yield*/, this.refSeqs];
|
|
115
|
-
case 1:
|
|
116
|
-
refSeqs = _a.sent();
|
|
117
|
-
return [2 /*return*/, Object.keys(refSeqs).map(function (refName) { return ({
|
|
118
|
-
refName: refName,
|
|
119
|
-
start: 0,
|
|
120
|
-
end: refSeqs[refName],
|
|
121
|
-
}); })];
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
default_1.prototype.getFeatures = function () {
|
|
127
|
-
throw new Error('sequence not available');
|
|
128
|
-
};
|
|
129
|
-
default_1.prototype.getHeader = function () {
|
|
36
|
+
getHeader() {
|
|
130
37
|
return {};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}(BaseAdapter_1.BaseAdapter));
|
|
38
|
+
}
|
|
39
|
+
freeResources( /* { region } */) { }
|
|
40
|
+
}
|
|
135
41
|
exports.default = default_1;
|
|
136
42
|
//# sourceMappingURL=ChromSizesAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChromSizesAdapter.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/ChromSizesAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChromSizesAdapter.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/ChromSizesAdapter.ts"],"names":[],"mappings":";;AAAA,yEAGgD;AAChD,8CAAoD;AAEpD,eAAqB,SAAQ,yBAAW;IAItC,KAAK,CAAC,QAAQ;QACZ,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAA;QAC7B,MAAM,IAAI,GAAG,IAAA,iBAAY,EAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAA;QACjE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QACxC,OAAO,MAAM,CAAC,WAAW,CACvB,IAAI;aACD,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;aAChB,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE;YACpB,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACvC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAA;QACxB,CAAC,CAAC,CACL,CAAA;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACtC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAA;gBACvB,MAAM,CAAC,CAAA;YACT,CAAC,CAAC,CAAA;SACH;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAEM,KAAK,CAAC,UAAU;QACrB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAClC,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAC1C,OAAO;YACP,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC;SACtB,CAAC,CAAC,CAAA;IACL,CAAC;IAEM,SAAS;QACd,OAAO,EAAE,CAAA;IACX,CAAC;IAEM,aAAa,EAAC,gBAAgB,IAAS,CAAC;CAChD;AA5CD,4BA4CC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
4
4
|
exports.default = (0, configuration_1.ConfigurationSchema)('ChromSizesAdapter', {
|
|
5
5
|
chromSizesLocation: {
|
|
6
6
|
type: 'fileLocation',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA,+DAAiE;AAEjE,kBAAe,IAAA,mCAAmB,EAChC,mBAAmB,EACnB;IACE,kBAAkB,EAAE;QAClB,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,8BAA8B;YACnC,YAAY,EAAE,aAAa;SAC5B;KACF;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
|
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
29
|
+
const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
|
|
30
|
+
const configSchema_1 = __importDefault(require("./configSchema"));
|
|
31
|
+
exports.default = (pluginManager) => {
|
|
32
|
+
pluginManager.addAdapterType(() => new AdapterType_1.default({
|
|
33
|
+
name: 'ChromSizesAdapter',
|
|
34
|
+
configSchema: configSchema_1.default,
|
|
35
|
+
adapterMetadata: {
|
|
36
|
+
category: null,
|
|
37
|
+
hiddenFromGUI: true,
|
|
38
|
+
displayName: null,
|
|
39
|
+
description: null,
|
|
40
|
+
},
|
|
41
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./ChromSizesAdapter'))).then(r => r.default),
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
9
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ChromSizesAdapter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kGAAyE;AAEzE,kEAAyC;AAEzC,kBAAe,CAAC,aAA4B,EAAE,EAAE;IAC9C,aAAa,CAAC,cAAc,CAC1B,GAAG,EAAE,CACH,IAAI,qBAAW,CAAC;QACd,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAZ,sBAAY;QACZ,eAAe,EAAE;YACf,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;SAClB;QACD,eAAe,EAAE,GAAG,EAAE,CACpB,kDAAO,qBAAqB,IAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;KACrD,CAAC,CACL,CAAA;AACH,CAAC,CAAA"}
|