@jbrowse/plugin-sequence 1.7.10 → 2.0.1
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 +50 -68
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.js.map +1 -0
- package/dist/BgzipFastaAdapter/configSchema.js +31 -43
- package/dist/BgzipFastaAdapter/configSchema.js.map +1 -0
- package/dist/BgzipFastaAdapter/index.js +8 -14
- package/dist/BgzipFastaAdapter/index.js.map +1 -0
- package/dist/ChromSizesAdapter/ChromSizesAdapter.d.ts +0 -1
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js +129 -166
- package/dist/ChromSizesAdapter/ChromSizesAdapter.js.map +1 -0
- package/dist/ChromSizesAdapter/configSchema.js +12 -21
- package/dist/ChromSizesAdapter/configSchema.js.map +1 -0
- package/dist/ChromSizesAdapter/index.js +8 -14
- package/dist/ChromSizesAdapter/index.js.map +1 -0
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js +130 -229
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.js.map +1 -0
- package/dist/DivSequenceRenderer/configSchema.js +10 -19
- package/dist/DivSequenceRenderer/configSchema.js.map +1 -0
- package/dist/DivSequenceRenderer/index.js +10 -22
- package/dist/DivSequenceRenderer/index.js.map +1 -0
- package/dist/GCContentAdapter/GCContentAdapter.js +181 -248
- package/dist/GCContentAdapter/GCContentAdapter.js.map +1 -0
- package/dist/GCContentAdapter/configSchema.js +7 -16
- package/dist/GCContentAdapter/configSchema.js.map +1 -0
- package/dist/GCContentAdapter/index.js +33 -28
- package/dist/GCContentAdapter/index.js.map +1 -0
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js +177 -266
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.js.map +1 -0
- package/dist/IndexedFastaAdapter/configSchema.js +21 -36
- package/dist/IndexedFastaAdapter/configSchema.js.map +1 -0
- package/dist/IndexedFastaAdapter/index.js +8 -14
- package/dist/IndexedFastaAdapter/index.js.map +1 -0
- package/dist/LinearReferenceSequenceDisplay/configSchema.js +5 -16
- package/dist/LinearReferenceSequenceDisplay/configSchema.js.map +1 -0
- package/dist/LinearReferenceSequenceDisplay/index.js +7 -20
- package/dist/LinearReferenceSequenceDisplay/index.js.map +1 -0
- package/dist/LinearReferenceSequenceDisplay/model.d.ts +18 -16
- package/dist/LinearReferenceSequenceDisplay/model.js +88 -99
- package/dist/LinearReferenceSequenceDisplay/model.js.map +1 -0
- package/dist/TwoBitAdapter/TwoBitAdapter.js +178 -274
- package/dist/TwoBitAdapter/TwoBitAdapter.js.map +1 -0
- package/dist/TwoBitAdapter/configSchema.js +16 -28
- package/dist/TwoBitAdapter/configSchema.js.map +1 -0
- package/dist/TwoBitAdapter/index.js +8 -14
- package/dist/TwoBitAdapter/index.js.map +1 -0
- package/dist/index.js +255 -312
- package/dist/index.js.map +1 -0
- package/dist/referenceSeqTrackConfig.js +71 -86
- package/dist/referenceSeqTrackConfig.js.map +1 -0
- package/esm/BgzipFastaAdapter/BgzipFastaAdapter.d.ts +7 -0
- package/esm/BgzipFastaAdapter/BgzipFastaAdapter.js +28 -0
- package/esm/BgzipFastaAdapter/BgzipFastaAdapter.js.map +1 -0
- package/esm/BgzipFastaAdapter/configSchema.d.ts +2 -0
- package/esm/BgzipFastaAdapter/configSchema.js +30 -0
- package/esm/BgzipFastaAdapter/configSchema.js.map +1 -0
- package/esm/BgzipFastaAdapter/index.d.ts +1 -0
- package/esm/BgzipFastaAdapter/index.js +2 -0
- package/esm/BgzipFastaAdapter/index.js.map +1 -0
- package/esm/ChromSizesAdapter/ChromSizesAdapter.d.ts +18 -0
- package/esm/ChromSizesAdapter/ChromSizesAdapter.js +42 -0
- package/esm/ChromSizesAdapter/ChromSizesAdapter.js.map +1 -0
- package/esm/ChromSizesAdapter/configSchema.d.ts +2 -0
- package/esm/ChromSizesAdapter/configSchema.js +11 -0
- package/esm/ChromSizesAdapter/configSchema.js.map +1 -0
- package/esm/ChromSizesAdapter/index.d.ts +1 -0
- package/esm/ChromSizesAdapter/index.js +2 -0
- package/esm/ChromSizesAdapter/index.js.map +1 -0
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.d.ts +21 -0
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.js +97 -0
- package/esm/DivSequenceRenderer/components/DivSequenceRendering.js.map +1 -0
- package/esm/DivSequenceRenderer/configSchema.d.ts +2 -0
- package/esm/DivSequenceRenderer/configSchema.js +9 -0
- package/esm/DivSequenceRenderer/configSchema.js.map +1 -0
- package/esm/DivSequenceRenderer/index.d.ts +2 -0
- package/esm/DivSequenceRenderer/index.js +3 -0
- package/esm/DivSequenceRenderer/index.js.map +1 -0
- package/esm/GCContentAdapter/GCContentAdapter.d.ts +23 -0
- package/esm/GCContentAdapter/GCContentAdapter.js +97 -0
- package/esm/GCContentAdapter/GCContentAdapter.js.map +1 -0
- package/esm/GCContentAdapter/configSchema.d.ts +3 -0
- package/esm/GCContentAdapter/configSchema.js +7 -0
- package/esm/GCContentAdapter/configSchema.js.map +1 -0
- package/esm/GCContentAdapter/index.d.ts +6 -0
- package/esm/GCContentAdapter/index.js +8 -0
- package/esm/GCContentAdapter/index.js.map +1 -0
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.d.ts +27 -0
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js +90 -0
- package/esm/IndexedFastaAdapter/IndexedFastaAdapter.js.map +1 -0
- package/esm/IndexedFastaAdapter/configSchema.d.ts +2 -0
- package/esm/IndexedFastaAdapter/configSchema.js +20 -0
- package/esm/IndexedFastaAdapter/configSchema.js.map +1 -0
- package/esm/IndexedFastaAdapter/index.d.ts +1 -0
- package/esm/IndexedFastaAdapter/index.js +2 -0
- package/esm/IndexedFastaAdapter/index.js.map +1 -0
- package/esm/LinearReferenceSequenceDisplay/configSchema.d.ts +1 -0
- package/esm/LinearReferenceSequenceDisplay/configSchema.js +4 -0
- package/esm/LinearReferenceSequenceDisplay/configSchema.js.map +1 -0
- package/esm/LinearReferenceSequenceDisplay/index.d.ts +2 -0
- package/esm/LinearReferenceSequenceDisplay/index.js +3 -0
- package/esm/LinearReferenceSequenceDisplay/index.js.map +1 -0
- package/esm/LinearReferenceSequenceDisplay/model.d.ts +210 -0
- package/esm/LinearReferenceSequenceDisplay/model.js +83 -0
- package/esm/LinearReferenceSequenceDisplay/model.js.map +1 -0
- package/esm/TwoBitAdapter/TwoBitAdapter.d.ts +26 -0
- package/esm/TwoBitAdapter/TwoBitAdapter.js +79 -0
- package/esm/TwoBitAdapter/TwoBitAdapter.js.map +1 -0
- package/esm/TwoBitAdapter/configSchema.d.ts +2 -0
- package/esm/TwoBitAdapter/configSchema.js +16 -0
- package/esm/TwoBitAdapter/configSchema.js.map +1 -0
- package/esm/TwoBitAdapter/index.d.ts +1 -0
- package/esm/TwoBitAdapter/index.js +2 -0
- package/esm/TwoBitAdapter/index.js.map +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +197 -0
- package/esm/index.js.map +1 -0
- package/esm/referenceSeqTrackConfig.d.ts +2 -0
- package/esm/referenceSeqTrackConfig.js +63 -0
- package/esm/referenceSeqTrackConfig.js.map +1 -0
- package/package.json +19 -11
- package/src/ChromSizesAdapter/ChromSizesAdapter.ts +0 -4
- package/src/DivSequenceRenderer/components/DivSequenceRendering.test.js +1 -1
- package/src/LinearReferenceSequenceDisplay/model.ts +4 -2
- package/dist/BgzipFastaAdapter/BgzipFastaAdapter.test.js +0 -64
- package/dist/ChromSizesAdapter/ChromSizesAdapter.test.js +0 -46
- package/dist/DivSequenceRenderer/components/DivSequenceRendering.test.js +0 -245
- package/dist/IndexedFastaAdapter/IndexedFastaAdapter.test.js +0 -81
- package/dist/TwoBitAdapter/TwoBitAdapter.test.js +0 -94
- package/dist/declare.d.js +0 -1
- package/dist/index.test.js +0 -29
|
@@ -1,289 +1,193 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
25
|
-
|
|
26
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
27
|
-
|
|
28
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
29
|
-
|
|
30
|
-
var _BaseAdapter = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
31
|
-
|
|
32
|
-
var _io = require("@jbrowse/core/util/io");
|
|
33
|
-
|
|
34
|
-
var _rxjs = require("@jbrowse/core/util/rxjs");
|
|
35
|
-
|
|
36
|
-
var _simpleFeature = _interopRequireDefault(require("@jbrowse/core/util/simpleFeature"));
|
|
37
|
-
|
|
38
|
-
var _twobit = require("@gmod/twobit");
|
|
39
|
-
|
|
40
|
-
var _configuration = require("@jbrowse/core/configuration");
|
|
41
|
-
|
|
42
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
43
|
-
|
|
44
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
-
|
|
46
|
-
var TwoBitAdapter = /*#__PURE__*/function (_BaseSequenceAdapter) {
|
|
47
|
-
(0, _inherits2.default)(TwoBitAdapter, _BaseSequenceAdapter);
|
|
48
|
-
|
|
49
|
-
var _super = _createSuper(TwoBitAdapter);
|
|
50
|
-
|
|
51
|
-
function TwoBitAdapter(config, getSubAdapter, pluginManager) {
|
|
52
|
-
var _this;
|
|
53
|
-
|
|
54
|
-
(0, _classCallCheck2.default)(this, TwoBitAdapter);
|
|
55
|
-
_this = _super.call(this, config, getSubAdapter, pluginManager);
|
|
56
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "twobit", void 0);
|
|
57
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "chromSizesData", void 0);
|
|
58
|
-
_this.chromSizesData = _this.initChromSizes();
|
|
59
|
-
_this.twobit = new _twobit.TwoBitFile({
|
|
60
|
-
filehandle: (0, _io.openLocation)((0, _configuration.readConfObject)(config, 'twoBitLocation'), _this.pluginManager)
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
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());
|
|
61
24
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
file = (0, _io.openLocation)(conf, this.pluginManager);
|
|
86
|
-
_context.next = 5;
|
|
87
|
-
return file.readFile('utf8');
|
|
88
|
-
|
|
89
|
-
case 5:
|
|
90
|
-
data = _context.sent;
|
|
91
|
-
return _context.abrupt("return", Object.fromEntries(data === null || data === void 0 ? void 0 : data.split('\n').filter(function (line) {
|
|
92
|
-
return !!line.trim();
|
|
93
|
-
}).map(function (line) {
|
|
94
|
-
var _line$split = line.split('\t'),
|
|
95
|
-
_line$split2 = (0, _slicedToArray2.default)(_line$split, 2),
|
|
96
|
-
name = _line$split2[0],
|
|
97
|
-
length = _line$split2[1];
|
|
98
|
-
|
|
99
|
-
return [name, +length];
|
|
100
|
-
})));
|
|
101
|
-
|
|
102
|
-
case 7:
|
|
103
|
-
return _context.abrupt("return", undefined);
|
|
104
|
-
|
|
105
|
-
case 8:
|
|
106
|
-
case "end":
|
|
107
|
-
return _context.stop();
|
|
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;
|
|
108
47
|
}
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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);
|
|
59
|
+
}
|
|
60
|
+
catch (error) { e = { error: error }; }
|
|
61
|
+
finally {
|
|
62
|
+
try {
|
|
63
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
64
|
+
}
|
|
65
|
+
finally { if (e) throw e.error; }
|
|
66
|
+
}
|
|
67
|
+
return ar;
|
|
68
|
+
};
|
|
69
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
70
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
71
|
+
};
|
|
72
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
|
+
var BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
74
|
+
var io_1 = require("@jbrowse/core/util/io");
|
|
75
|
+
var rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
76
|
+
var simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
|
|
77
|
+
var twobit_1 = require("@gmod/twobit");
|
|
78
|
+
var configuration_1 = require("@jbrowse/core/configuration");
|
|
79
|
+
var TwoBitAdapter = /** @class */ (function (_super) {
|
|
80
|
+
__extends(TwoBitAdapter, _super);
|
|
81
|
+
function TwoBitAdapter(config, getSubAdapter, pluginManager) {
|
|
82
|
+
var _this = _super.call(this, config, getSubAdapter, pluginManager) || this;
|
|
83
|
+
_this.chromSizesData = _this.initChromSizes();
|
|
84
|
+
_this.twobit = new twobit_1.TwoBitFile({
|
|
85
|
+
filehandle: (0, io_1.openLocation)((0, configuration_1.readConfObject)(config, 'twoBitLocation'), _this.pluginManager),
|
|
86
|
+
});
|
|
87
|
+
return _this;
|
|
88
|
+
}
|
|
89
|
+
TwoBitAdapter.prototype.initChromSizes = function () {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
var conf, file, data;
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
switch (_a.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
conf = (0, configuration_1.readConfObject)(this.config, 'chromSizesLocation');
|
|
96
|
+
if (!(conf.uri !== '/path/to/default.chrom.sizes' && conf.uri !== '')) return [3 /*break*/, 2];
|
|
97
|
+
file = (0, io_1.openLocation)(conf, this.pluginManager);
|
|
98
|
+
return [4 /*yield*/, file.readFile('utf8')];
|
|
99
|
+
case 1:
|
|
100
|
+
data = _a.sent();
|
|
101
|
+
return [2 /*return*/, Object.fromEntries(data === null || data === void 0 ? void 0 : data.split('\n').filter(function (line) { return !!line.trim(); }).map(function (line) {
|
|
102
|
+
var _a = __read(line.split('\t'), 2), name = _a[0], length = _a[1];
|
|
103
|
+
return [name, +length];
|
|
104
|
+
}))];
|
|
105
|
+
case 2: return [2 /*return*/, undefined];
|
|
137
106
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return _getRefNames.apply(this, arguments);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return getRefNames;
|
|
157
|
-
}()
|
|
158
|
-
}, {
|
|
159
|
-
key: "getRegions",
|
|
160
|
-
value: function () {
|
|
161
|
-
var _getRegions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
162
|
-
var chromSizesData, refSizes;
|
|
163
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
164
|
-
while (1) {
|
|
165
|
-
switch (_context3.prev = _context3.next) {
|
|
166
|
-
case 0:
|
|
167
|
-
_context3.next = 2;
|
|
168
|
-
return this.chromSizesData;
|
|
169
|
-
|
|
170
|
-
case 2:
|
|
171
|
-
chromSizesData = _context3.sent;
|
|
172
|
-
|
|
173
|
-
if (!chromSizesData) {
|
|
174
|
-
_context3.next = 5;
|
|
175
|
-
break;
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
TwoBitAdapter.prototype.getRefNames = function () {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
var chromSizesData;
|
|
113
|
+
return __generator(this, function (_a) {
|
|
114
|
+
switch (_a.label) {
|
|
115
|
+
case 0: return [4 /*yield*/, this.chromSizesData];
|
|
116
|
+
case 1:
|
|
117
|
+
chromSizesData = _a.sent();
|
|
118
|
+
if (chromSizesData) {
|
|
119
|
+
return [2 /*return*/, Object.keys(chromSizesData)];
|
|
120
|
+
}
|
|
121
|
+
return [2 /*return*/, this.twobit.getSequenceNames()];
|
|
176
122
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
function getRegions() {
|
|
209
|
-
return _getRegions.apply(this, arguments);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return getRegions;
|
|
213
|
-
}()
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
TwoBitAdapter.prototype.getRegions = function () {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
128
|
+
var chromSizesData, refSizes;
|
|
129
|
+
return __generator(this, function (_a) {
|
|
130
|
+
switch (_a.label) {
|
|
131
|
+
case 0: return [4 /*yield*/, this.chromSizesData];
|
|
132
|
+
case 1:
|
|
133
|
+
chromSizesData = _a.sent();
|
|
134
|
+
if (chromSizesData) {
|
|
135
|
+
return [2 /*return*/, Object.keys(chromSizesData).map(function (refName) { return ({
|
|
136
|
+
refName: refName,
|
|
137
|
+
start: 0,
|
|
138
|
+
end: chromSizesData[refName],
|
|
139
|
+
}); })];
|
|
140
|
+
}
|
|
141
|
+
return [4 /*yield*/, this.twobit.getSequenceSizes()];
|
|
142
|
+
case 2:
|
|
143
|
+
refSizes = _a.sent();
|
|
144
|
+
return [2 /*return*/, Object.keys(refSizes).map(function (refName) { return ({
|
|
145
|
+
refName: refName,
|
|
146
|
+
start: 0,
|
|
147
|
+
end: refSizes[refName],
|
|
148
|
+
}); })];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
};
|
|
214
153
|
/**
|
|
215
154
|
* Fetch features for a certain region
|
|
216
155
|
* @param param -
|
|
217
156
|
* @returns Observable of Feature objects in the region
|
|
218
157
|
*/
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
seq = _context4.sent;
|
|
246
|
-
|
|
247
|
-
if (seq) {
|
|
248
|
-
observer.next(new _simpleFeature.default({
|
|
249
|
-
id: "".concat(refName, " ").concat(start, "-").concat(regionEnd),
|
|
250
|
-
data: {
|
|
251
|
-
refName: refName,
|
|
252
|
-
start: start,
|
|
253
|
-
end: regionEnd,
|
|
254
|
-
seq: seq
|
|
255
|
-
}
|
|
256
|
-
}));
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
observer.complete();
|
|
260
|
-
|
|
261
|
-
case 9:
|
|
262
|
-
case "end":
|
|
263
|
-
return _context4.stop();
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}, _callee4);
|
|
267
|
-
}));
|
|
268
|
-
|
|
269
|
-
return function (_x) {
|
|
270
|
-
return _ref2.apply(this, arguments);
|
|
271
|
-
};
|
|
272
|
-
}());
|
|
273
|
-
}
|
|
158
|
+
TwoBitAdapter.prototype.getFeatures = function (_a) {
|
|
159
|
+
var _this = this;
|
|
160
|
+
var refName = _a.refName, start = _a.start, end = _a.end;
|
|
161
|
+
return (0, rxjs_1.ObservableCreate)(function (observer) { return __awaiter(_this, void 0, void 0, function () {
|
|
162
|
+
var size, regionEnd, seq;
|
|
163
|
+
return __generator(this, function (_a) {
|
|
164
|
+
switch (_a.label) {
|
|
165
|
+
case 0: return [4 /*yield*/, this.twobit.getSequenceSize(refName)];
|
|
166
|
+
case 1:
|
|
167
|
+
size = _a.sent();
|
|
168
|
+
regionEnd = size !== undefined ? Math.min(size, end) : end;
|
|
169
|
+
return [4 /*yield*/, this.twobit.getSequence(refName, start, regionEnd)];
|
|
170
|
+
case 2:
|
|
171
|
+
seq = _a.sent();
|
|
172
|
+
if (seq) {
|
|
173
|
+
observer.next(new simpleFeature_1.default({
|
|
174
|
+
id: "".concat(refName, " ").concat(start, "-").concat(regionEnd),
|
|
175
|
+
data: { refName: refName, start: start, end: regionEnd, seq: seq },
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
observer.complete();
|
|
179
|
+
return [2 /*return*/];
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}); });
|
|
183
|
+
};
|
|
274
184
|
/**
|
|
275
185
|
* called to provide a hint that data tied to a certain region
|
|
276
186
|
* will not be needed for the forseeable future and can be purged
|
|
277
187
|
* from caches, etc
|
|
278
188
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
freeResources() {}
|
|
285
|
-
}]);
|
|
286
|
-
return TwoBitAdapter;
|
|
287
|
-
}(_BaseAdapter.BaseSequenceAdapter);
|
|
288
|
-
|
|
289
|
-
exports.default = TwoBitAdapter;
|
|
189
|
+
TwoBitAdapter.prototype.freeResources = function ( /* { region } */) { };
|
|
190
|
+
return TwoBitAdapter;
|
|
191
|
+
}(BaseAdapter_1.BaseSequenceAdapter));
|
|
192
|
+
exports.default = TwoBitAdapter;
|
|
193
|
+
//# sourceMappingURL=TwoBitAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TwoBitAdapter.js","sourceRoot":"","sources":["../../src/TwoBitAdapter/TwoBitAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAA6E;AAE7E,4CAAoD;AACpD,gDAA0D;AAC1D,mFAAyE;AACzE,uCAAyC;AACzC,6DAA4D;AAK5D;IAA2C,iCAAmB;IA4B5D,uBACE,MAA6B,EAC7B,aAAiC,EACjC,aAA6B;QAH/B,YAKE,kBAAM,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,SAQ5C;QAPC,KAAI,CAAC,cAAc,GAAG,KAAI,CAAC,cAAc,EAAE,CAAA;QAC3C,KAAI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BACpE,IAAI,GAAG,EAAE;4BACP,QAAQ,CAAC,IAAI,CACX,IAAI,uBAAa,CAAC;gCAChB,EAAE,EAAE,UAAG,OAAO,cAAI,KAAK,cAAI,SAAS,CAAE;gCACtC,IAAI,EAAE,EAAE,OAAO,SAAA,EAAE,KAAK,OAAA,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAA,EAAE;6BAC9C,CAAC,CACH,CAAA;yBACF;wBACD,QAAQ,CAAC,QAAQ,EAAE,CAAA;;;;aACpB,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACI,qCAAa,GAApB,WAAqB,gBAAgB,IAAS,CAAC;IACjD,oBAAC;AAAD,CAAC,AAhGD,CAA2C,iCAAmB,GAgG7D"}
|
|
@@ -1,30 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _configuration = require("@jbrowse/core/configuration");
|
|
9
|
-
|
|
10
|
-
var _default = (0, _configuration.ConfigurationSchema)('TwoBitAdapter', {
|
|
11
|
-
twoBitLocation: {
|
|
12
|
-
type: 'fileLocation',
|
|
13
|
-
defaultValue: {
|
|
14
|
-
uri: '/path/to/my.2bit',
|
|
15
|
-
locationType: 'UriLocation'
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
chromSizesLocation: {
|
|
19
|
-
type: 'fileLocation',
|
|
20
|
-
defaultValue: {
|
|
21
|
-
uri: '/path/to/default.chrom.sizes',
|
|
22
|
-
locationType: 'UriLocation'
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var configuration_1 = require("@jbrowse/core/configuration");
|
|
4
|
+
exports.default = (0, configuration_1.ConfigurationSchema)('TwoBitAdapter', {
|
|
5
|
+
twoBitLocation: {
|
|
6
|
+
type: 'fileLocation',
|
|
7
|
+
defaultValue: { uri: '/path/to/my.2bit', locationType: 'UriLocation' },
|
|
23
8
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
chromSizesLocation: {
|
|
10
|
+
type: 'fileLocation',
|
|
11
|
+
defaultValue: {
|
|
12
|
+
uri: '/path/to/default.chrom.sizes',
|
|
13
|
+
locationType: 'UriLocation',
|
|
14
|
+
},
|
|
15
|
+
description: 'An optional chrom.sizes file can be supplied to speed up loading since parsing the twobit file can take time',
|
|
16
|
+
},
|
|
17
|
+
}, { explicitlyTyped: true });
|
|
18
|
+
//# sourceMappingURL=configSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/TwoBitAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA,6DAAiE;AAEjE,kBAAe,IAAA,mCAAmB,EAChC,eAAe,EACf;IACE,cAAc,EAAE;QACd,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE;KACvE;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,8BAA8B;YACnC,YAAY,EAAE,aAAa;SAC5B;QACD,WAAW,EACT,8GAA8G;KACjH;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "configSchema", {
|
|
9
|
-
|
|
10
|
-
get: function get() {
|
|
11
|
-
return _configSchema.default;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
var _configSchema = _interopRequireDefault(require("./configSchema"));
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.configSchema = void 0;
|
|
7
|
+
var configSchema_1 = require("./configSchema");
|
|
8
|
+
Object.defineProperty(exports, "configSchema", { enumerable: true, get: function () { return __importDefault(configSchema_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/TwoBitAdapter/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAwD;AAA/C,6HAAA,OAAO,OAAgB"}
|