@jbrowse/plugin-variants 1.7.11 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChordVariantDisplay/index.d.ts +2 -1
- package/dist/ChordVariantDisplay/index.js +19 -31
- package/dist/ChordVariantDisplay/index.js.map +1 -0
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.d.ts +94 -2
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.js +39 -71
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.js.map +1 -0
- package/dist/LinearVariantDisplay/configSchema.js +9 -16
- package/dist/LinearVariantDisplay/configSchema.js.map +1 -0
- package/dist/LinearVariantDisplay/index.js +10 -22
- package/dist/LinearVariantDisplay/index.js.map +1 -0
- package/dist/LinearVariantDisplay/model.d.ts +17 -12
- package/dist/LinearVariantDisplay/model.js +83 -73
- package/dist/LinearVariantDisplay/model.js.map +1 -0
- package/dist/StructuralVariantChordRenderer/ReactComponent.js +193 -214
- package/dist/StructuralVariantChordRenderer/ReactComponent.js.map +1 -0
- package/dist/StructuralVariantChordRenderer/index.js +36 -46
- package/dist/StructuralVariantChordRenderer/index.js.map +1 -0
- package/dist/VariantFeatureWidget/BreakendOptionDialog.d.ts +1 -1
- package/dist/VariantFeatureWidget/BreakendOptionDialog.js +95 -119
- package/dist/VariantFeatureWidget/BreakendOptionDialog.js.map +1 -0
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js +193 -240
- package/dist/VariantFeatureWidget/VariantFeatureWidget.js.map +1 -0
- package/dist/VariantFeatureWidget/index.d.ts +3 -3
- package/dist/VariantFeatureWidget/index.js +14 -22
- package/dist/VariantFeatureWidget/index.js.map +1 -0
- package/dist/VcfAdapter/VcfAdapter.js +232 -372
- package/dist/VcfAdapter/VcfAdapter.js.map +1 -0
- package/dist/VcfAdapter/configSchema.js +9 -21
- package/dist/VcfAdapter/configSchema.js.map +1 -0
- package/dist/VcfAdapter/index.js +8 -14
- package/dist/VcfAdapter/index.js.map +1 -0
- package/dist/VcfTabixAdapter/VcfFeature.js +203 -246
- package/dist/VcfTabixAdapter/VcfFeature.js.map +1 -0
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js +232 -374
- package/dist/VcfTabixAdapter/VcfTabixAdapter.js.map +1 -0
- package/dist/VcfTabixAdapter/configSchema.js +23 -36
- package/dist/VcfTabixAdapter/configSchema.js.map +1 -0
- package/dist/VcfTabixAdapter/index.js +8 -14
- package/dist/VcfTabixAdapter/index.js.map +1 -0
- package/dist/index.js +160 -203
- package/dist/index.js.map +1 -0
- package/esm/ChordVariantDisplay/index.d.ts +4 -0
- package/esm/ChordVariantDisplay/index.js +16 -0
- package/esm/ChordVariantDisplay/index.js.map +1 -0
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.d.ts +97 -0
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.js +40 -0
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.js.map +1 -0
- package/esm/LinearVariantDisplay/configSchema.d.ts +5 -0
- package/esm/LinearVariantDisplay/configSchema.js +7 -0
- package/esm/LinearVariantDisplay/configSchema.js.map +1 -0
- package/esm/LinearVariantDisplay/index.d.ts +2 -0
- package/esm/LinearVariantDisplay/index.js +3 -0
- package/esm/LinearVariantDisplay/index.js.map +1 -0
- package/esm/LinearVariantDisplay/model.d.ts +212 -0
- package/esm/LinearVariantDisplay/model.js +34 -0
- package/esm/LinearVariantDisplay/model.js.map +1 -0
- package/esm/StructuralVariantChordRenderer/ReactComponent.d.ts +24 -0
- package/esm/StructuralVariantChordRenderer/ReactComponent.js +133 -0
- package/esm/StructuralVariantChordRenderer/ReactComponent.js.map +1 -0
- package/esm/StructuralVariantChordRenderer/index.d.ts +3 -0
- package/esm/StructuralVariantChordRenderer/index.js +33 -0
- package/esm/StructuralVariantChordRenderer/index.js.map +1 -0
- package/esm/VariantFeatureWidget/BreakendOptionDialog.d.ts +10 -0
- package/esm/VariantFeatureWidget/BreakendOptionDialog.js +58 -0
- package/esm/VariantFeatureWidget/BreakendOptionDialog.js.map +1 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.d.ts +4 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js +129 -0
- package/esm/VariantFeatureWidget/VariantFeatureWidget.js.map +1 -0
- package/esm/VariantFeatureWidget/index.d.ts +37 -0
- package/esm/VariantFeatureWidget/index.js +12 -0
- package/esm/VariantFeatureWidget/index.js.map +1 -0
- package/esm/VcfAdapter/VcfAdapter.d.ts +24 -0
- package/esm/VcfAdapter/VcfAdapter.js +99 -0
- package/esm/VcfAdapter/VcfAdapter.js.map +1 -0
- package/esm/VcfAdapter/configSchema.d.ts +2 -0
- package/esm/VcfAdapter/configSchema.js +8 -0
- package/esm/VcfAdapter/configSchema.js.map +1 -0
- package/esm/VcfAdapter/index.d.ts +1 -0
- package/esm/VcfAdapter/index.js +2 -0
- package/esm/VcfAdapter/index.js.map +1 -0
- package/esm/VcfTabixAdapter/VcfFeature.d.ts +59 -0
- package/esm/VcfTabixAdapter/VcfFeature.js +184 -0
- package/esm/VcfTabixAdapter/VcfFeature.js.map +1 -0
- package/esm/VcfTabixAdapter/VcfTabixAdapter.d.ts +35 -0
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js +106 -0
- package/esm/VcfTabixAdapter/VcfTabixAdapter.js.map +1 -0
- package/esm/VcfTabixAdapter/configSchema.d.ts +2 -0
- package/esm/VcfTabixAdapter/configSchema.js +23 -0
- package/esm/VcfTabixAdapter/configSchema.js.map +1 -0
- package/esm/VcfTabixAdapter/index.d.ts +1 -0
- package/esm/VcfTabixAdapter/index.js +2 -0
- package/esm/VcfTabixAdapter/index.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +110 -0
- package/esm/index.js.map +1 -0
- package/package.json +25 -16
- package/src/ChordVariantDisplay/index.ts +4 -4
- package/src/ChordVariantDisplay/models/ChordVariantDisplay.js +7 -8
- package/src/VariantFeatureWidget/BreakendOptionDialog.tsx +8 -9
- package/src/VariantFeatureWidget/VariantFeatureWidget.tsx +2 -3
- package/src/VariantFeatureWidget/__snapshots__/VariantFeatureWidget.test.js.snap +52 -57
- package/src/VcfTabixAdapter/VcfFeature.ts +1 -1
- package/src/VcfTabixAdapter/VcfTabixAdapter.ts +1 -7
- package/dist/LinearVariantDisplay/configSchema.test.js +0 -92
- package/dist/VariantFeatureWidget/VariantFeatureWidget.test.js +0 -56
- package/dist/VcfAdapter/VcfAdapter.test.js +0 -55
- package/dist/VcfTabixAdapter/VcfFeature.test.js +0 -106
- package/dist/VcfTabixAdapter/VcfTabixAdapter.test.js +0 -99
- package/dist/index.test.js +0 -37
|
@@ -1,305 +1,199 @@
|
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
function _default() {
|
|
60
|
-
var _this;
|
|
61
|
-
|
|
62
|
-
(0, _classCallCheck2.default)(this, _default);
|
|
63
|
-
|
|
64
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
65
|
-
args[_key] = arguments[_key];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
69
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "configured", void 0);
|
|
70
|
-
return _this;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
(0, _createClass2.default)(_default, [{
|
|
74
|
-
key: "configurePre",
|
|
75
|
-
value: function () {
|
|
76
|
-
var _configurePre = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
77
|
-
var vcfGzLocation, location, indexType, filehandle, isCSI, vcf, header;
|
|
78
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
79
|
-
while (1) {
|
|
80
|
-
switch (_context.prev = _context.next) {
|
|
81
|
-
case 0:
|
|
82
|
-
vcfGzLocation = (0, _configuration.readConfObject)(this.config, 'vcfGzLocation');
|
|
83
|
-
location = (0, _configuration.readConfObject)(this.config, ['index', 'location']);
|
|
84
|
-
indexType = (0, _configuration.readConfObject)(this.config, ['index', 'indexType']);
|
|
85
|
-
filehandle = (0, _io.openLocation)(vcfGzLocation, this.pluginManager);
|
|
86
|
-
isCSI = indexType === 'CSI';
|
|
87
|
-
vcf = new _tabix.TabixIndexedFile({
|
|
88
|
-
filehandle: filehandle,
|
|
89
|
-
csiFilehandle: isCSI ? (0, _io.openLocation)(location, this.pluginManager) : undefined,
|
|
90
|
-
tbiFilehandle: !isCSI ? (0, _io.openLocation)(location, this.pluginManager) : undefined,
|
|
91
|
-
chunkCacheSize: 50 * Math.pow(2, 20),
|
|
92
|
-
chunkSizeLimit: 1000000000
|
|
93
|
-
});
|
|
94
|
-
_context.next = 8;
|
|
95
|
-
return vcf.getHeader();
|
|
96
|
-
|
|
97
|
-
case 8:
|
|
98
|
-
header = _context.sent;
|
|
99
|
-
return _context.abrupt("return", {
|
|
100
|
-
filehandle: filehandle,
|
|
101
|
-
vcf: vcf,
|
|
102
|
-
parser: new _vcf.default({
|
|
103
|
-
header: header
|
|
104
|
-
})
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
case 10:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context.stop();
|
|
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 __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (_) try {
|
|
44
|
+
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;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
110
58
|
}
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
|
+
};
|
|
67
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
|
+
var BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
69
|
+
var io_1 = require("@jbrowse/core/util/io");
|
|
70
|
+
var util_1 = require("@jbrowse/core/util");
|
|
71
|
+
var rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
72
|
+
var tabix_1 = require("@gmod/tabix");
|
|
73
|
+
var vcf_1 = __importDefault(require("@gmod/vcf"));
|
|
74
|
+
var configuration_1 = require("@jbrowse/core/configuration");
|
|
75
|
+
var VcfFeature_1 = __importDefault(require("./VcfFeature"));
|
|
76
|
+
var default_1 = /** @class */ (function (_super) {
|
|
77
|
+
__extends(default_1, _super);
|
|
78
|
+
function default_1() {
|
|
79
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
80
|
+
}
|
|
81
|
+
default_1.prototype.configurePre = function () {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var vcfGzLocation, location, indexType, filehandle, isCSI, vcf, header;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
vcfGzLocation = (0, configuration_1.readConfObject)(this.config, 'vcfGzLocation');
|
|
88
|
+
location = (0, configuration_1.readConfObject)(this.config, ['index', 'location']);
|
|
89
|
+
indexType = (0, configuration_1.readConfObject)(this.config, ['index', 'indexType']);
|
|
90
|
+
filehandle = (0, io_1.openLocation)(vcfGzLocation, this.pluginManager);
|
|
91
|
+
isCSI = indexType === 'CSI';
|
|
92
|
+
vcf = new tabix_1.TabixIndexedFile({
|
|
93
|
+
filehandle: filehandle,
|
|
94
|
+
csiFilehandle: isCSI
|
|
95
|
+
? (0, io_1.openLocation)(location, this.pluginManager)
|
|
96
|
+
: undefined,
|
|
97
|
+
tbiFilehandle: !isCSI
|
|
98
|
+
? (0, io_1.openLocation)(location, this.pluginManager)
|
|
99
|
+
: undefined,
|
|
100
|
+
chunkCacheSize: 50 * Math.pow(2, 20),
|
|
101
|
+
chunkSizeLimit: 1000000000,
|
|
102
|
+
});
|
|
103
|
+
return [4 /*yield*/, vcf.getHeader()];
|
|
104
|
+
case 1:
|
|
105
|
+
header = _a.sent();
|
|
106
|
+
return [2 /*return*/, {
|
|
107
|
+
filehandle: filehandle,
|
|
108
|
+
vcf: vcf,
|
|
109
|
+
parser: new vcf_1.default({ header: header }),
|
|
110
|
+
}];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
default_1.prototype.configure = function () {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
117
|
+
var _this = this;
|
|
118
|
+
return __generator(this, function (_a) {
|
|
131
119
|
if (!this.configured) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
120
|
+
this.configured = this.configurePre().catch(function (e) {
|
|
121
|
+
_this.configured = undefined;
|
|
122
|
+
throw e;
|
|
123
|
+
});
|
|
136
124
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
209
|
-
case "end":
|
|
210
|
-
return _context4.stop();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}, _callee4, this);
|
|
214
|
-
}));
|
|
215
|
-
|
|
216
|
-
function getHeader() {
|
|
217
|
-
return _getHeader.apply(this, arguments);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return getHeader;
|
|
221
|
-
}()
|
|
222
|
-
}, {
|
|
223
|
-
key: "getMetadata",
|
|
224
|
-
value: function () {
|
|
225
|
-
var _getMetadata = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
226
|
-
var _yield$this$configure3, parser;
|
|
227
|
-
|
|
228
|
-
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
229
|
-
while (1) {
|
|
230
|
-
switch (_context5.prev = _context5.next) {
|
|
231
|
-
case 0:
|
|
232
|
-
_context5.next = 2;
|
|
233
|
-
return this.configure();
|
|
234
|
-
|
|
235
|
-
case 2:
|
|
236
|
-
_yield$this$configure3 = _context5.sent;
|
|
237
|
-
parser = _yield$this$configure3.parser;
|
|
238
|
-
return _context5.abrupt("return", parser.getMetadata());
|
|
239
|
-
|
|
240
|
-
case 5:
|
|
241
|
-
case "end":
|
|
242
|
-
return _context5.stop();
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}, _callee5, this);
|
|
246
|
-
}));
|
|
247
|
-
|
|
248
|
-
function getMetadata() {
|
|
249
|
-
return _getMetadata.apply(this, arguments);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return getMetadata;
|
|
253
|
-
}()
|
|
254
|
-
}, {
|
|
255
|
-
key: "getFeatures",
|
|
256
|
-
value: function getFeatures(query) {
|
|
257
|
-
var _this3 = this;
|
|
258
|
-
|
|
259
|
-
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
260
|
-
return (0, _rxjs.ObservableCreate)( /*#__PURE__*/function () {
|
|
261
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(observer) {
|
|
262
|
-
var refName, start, end, _yield$_this3$configu, vcf, parser;
|
|
263
|
-
|
|
264
|
-
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
265
|
-
while (1) {
|
|
266
|
-
switch (_context6.prev = _context6.next) {
|
|
267
|
-
case 0:
|
|
268
|
-
refName = query.refName, start = query.start, end = query.end;
|
|
269
|
-
_context6.next = 3;
|
|
270
|
-
return _this3.configure();
|
|
271
|
-
|
|
272
|
-
case 3:
|
|
273
|
-
_yield$_this3$configu = _context6.sent;
|
|
274
|
-
vcf = _yield$_this3$configu.vcf;
|
|
275
|
-
parser = _yield$_this3$configu.parser;
|
|
276
|
-
_context6.next = 8;
|
|
277
|
-
return vcf.getLines(refName, start, end, _objectSpread({
|
|
278
|
-
lineCallback: function lineCallback(line, fileOffset) {
|
|
279
|
-
observer.next(new _VcfFeature.default({
|
|
280
|
-
variant: parser.parseLine(line),
|
|
281
|
-
parser: parser,
|
|
282
|
-
id: "".concat(_this3.id, "-vcf-").concat(fileOffset)
|
|
283
|
-
}));
|
|
284
|
-
}
|
|
285
|
-
}, opts));
|
|
286
|
-
|
|
287
|
-
case 8:
|
|
288
|
-
observer.complete();
|
|
289
|
-
|
|
290
|
-
case 9:
|
|
291
|
-
case "end":
|
|
292
|
-
return _context6.stop();
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}, _callee6);
|
|
296
|
-
}));
|
|
297
|
-
|
|
298
|
-
return function (_x) {
|
|
299
|
-
return _ref.apply(this, arguments);
|
|
300
|
-
};
|
|
301
|
-
}(), opts.signal);
|
|
302
|
-
}
|
|
125
|
+
return [2 /*return*/, this.configured];
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
default_1.prototype.getRefNames = function (opts) {
|
|
130
|
+
if (opts === void 0) { opts = {}; }
|
|
131
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
132
|
+
var vcf;
|
|
133
|
+
return __generator(this, function (_a) {
|
|
134
|
+
switch (_a.label) {
|
|
135
|
+
case 0: return [4 /*yield*/, this.configure()];
|
|
136
|
+
case 1:
|
|
137
|
+
vcf = (_a.sent()).vcf;
|
|
138
|
+
return [2 /*return*/, vcf.getReferenceSequenceNames(opts)];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
default_1.prototype.getHeader = function () {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
+
var vcf;
|
|
146
|
+
return __generator(this, function (_a) {
|
|
147
|
+
switch (_a.label) {
|
|
148
|
+
case 0: return [4 /*yield*/, this.configure()];
|
|
149
|
+
case 1:
|
|
150
|
+
vcf = (_a.sent()).vcf;
|
|
151
|
+
return [2 /*return*/, vcf.getHeader()];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
default_1.prototype.getMetadata = function () {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158
|
+
var parser;
|
|
159
|
+
return __generator(this, function (_a) {
|
|
160
|
+
switch (_a.label) {
|
|
161
|
+
case 0: return [4 /*yield*/, this.configure()];
|
|
162
|
+
case 1:
|
|
163
|
+
parser = (_a.sent()).parser;
|
|
164
|
+
return [2 /*return*/, parser.getMetadata()];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
default_1.prototype.getFeatures = function (query, opts) {
|
|
170
|
+
var _this = this;
|
|
171
|
+
if (opts === void 0) { opts = {}; }
|
|
172
|
+
return (0, rxjs_1.ObservableCreate)(function (observer) { return __awaiter(_this, void 0, void 0, function () {
|
|
173
|
+
var refName, start, end, _a, vcf, parser;
|
|
174
|
+
var _this = this;
|
|
175
|
+
return __generator(this, function (_b) {
|
|
176
|
+
switch (_b.label) {
|
|
177
|
+
case 0:
|
|
178
|
+
refName = query.refName, start = query.start, end = query.end;
|
|
179
|
+
return [4 /*yield*/, this.configure()];
|
|
180
|
+
case 1:
|
|
181
|
+
_a = _b.sent(), vcf = _a.vcf, parser = _a.parser;
|
|
182
|
+
return [4 /*yield*/, vcf.getLines(refName, start, end, __assign({ lineCallback: function (line, fileOffset) {
|
|
183
|
+
observer.next(new VcfFeature_1.default({
|
|
184
|
+
variant: parser.parseLine(line),
|
|
185
|
+
parser: parser,
|
|
186
|
+
id: "".concat(_this.id, "-vcf-").concat(fileOffset),
|
|
187
|
+
}));
|
|
188
|
+
} }, opts))];
|
|
189
|
+
case 2:
|
|
190
|
+
_b.sent();
|
|
191
|
+
observer.complete();
|
|
192
|
+
return [2 /*return*/];
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}); }, opts.signal);
|
|
196
|
+
};
|
|
303
197
|
/**
|
|
304
198
|
* Checks if the data source has data for the given reference sequence,
|
|
305
199
|
* and then gets the features in the region if it does
|
|
@@ -314,79 +208,43 @@ var _default = /*#__PURE__*/function (_BaseFeatureDataAdapt) {
|
|
|
314
208
|
* @param opts - Feature adapter options
|
|
315
209
|
* @returns Observable of Feature objects in the regions
|
|
316
210
|
*/
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
pct = Math.round(bytes / stat.size * 100);
|
|
358
|
-
|
|
359
|
-
if (pct > 100) {
|
|
360
|
-
// this is just a bad estimate, make 100% if it goes over
|
|
361
|
-
pct = 100;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
if (pct > 60) {
|
|
365
|
-
console.warn("getFeaturesInMultipleRegions fetching ".concat(pct, "% of VCF file, but whole-file streaming not yet implemented"));
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
superGetFeaturesInMultipleRegions.call(_this4, regions, opts).subscribe(observer); // super.getFeaturesInMultipleRegions(regions, opts).subscribe(observer)
|
|
369
|
-
|
|
370
|
-
case 18:
|
|
371
|
-
case "end":
|
|
372
|
-
return _context7.stop();
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}, _callee7);
|
|
376
|
-
}));
|
|
377
|
-
|
|
378
|
-
return function (_x2) {
|
|
379
|
-
return _ref2.apply(this, arguments);
|
|
380
|
-
};
|
|
381
|
-
}());
|
|
382
|
-
}
|
|
383
|
-
}, {
|
|
384
|
-
key: "freeResources",
|
|
385
|
-
value: function
|
|
386
|
-
/* { region } */
|
|
387
|
-
freeResources() {}
|
|
388
|
-
}]);
|
|
389
|
-
return _default;
|
|
390
|
-
}(_BaseAdapter.BaseFeatureDataAdapter);
|
|
391
|
-
|
|
392
|
-
exports.default = _default;
|
|
211
|
+
default_1.prototype.getFeaturesInMultipleRegions = function (regions, opts) {
|
|
212
|
+
var _this = this;
|
|
213
|
+
if (opts === void 0) { opts = {}; }
|
|
214
|
+
return (0, rxjs_1.ObservableCreate)(function (observer) { return __awaiter(_this, void 0, void 0, function () {
|
|
215
|
+
var vcf, bytes, filehandle, stat, pct;
|
|
216
|
+
return __generator(this, function (_a) {
|
|
217
|
+
switch (_a.label) {
|
|
218
|
+
case 0: return [4 /*yield*/, this.configure()
|
|
219
|
+
// @ts-ignore
|
|
220
|
+
];
|
|
221
|
+
case 1:
|
|
222
|
+
vcf = (_a.sent()).vcf;
|
|
223
|
+
return [4 /*yield*/, (0, util_1.bytesForRegions)(regions, vcf.index)];
|
|
224
|
+
case 2:
|
|
225
|
+
bytes = _a.sent();
|
|
226
|
+
return [4 /*yield*/, this.configure()];
|
|
227
|
+
case 3:
|
|
228
|
+
filehandle = (_a.sent()).filehandle;
|
|
229
|
+
return [4 /*yield*/, filehandle.stat()];
|
|
230
|
+
case 4:
|
|
231
|
+
stat = _a.sent();
|
|
232
|
+
pct = Math.round((bytes / stat.size) * 100);
|
|
233
|
+
if (pct > 100) {
|
|
234
|
+
// this is just a bad estimate, make 100% if it goes over
|
|
235
|
+
pct = 100;
|
|
236
|
+
}
|
|
237
|
+
if (pct > 60) {
|
|
238
|
+
console.warn("getFeaturesInMultipleRegions fetching ".concat(pct, "% of VCF file, but whole-file streaming not yet implemented"));
|
|
239
|
+
}
|
|
240
|
+
_super.prototype.getFeaturesInMultipleRegions.call(this, regions, opts).subscribe(observer);
|
|
241
|
+
return [2 /*return*/];
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}); });
|
|
245
|
+
};
|
|
246
|
+
default_1.prototype.freeResources = function ( /* { region } */) { };
|
|
247
|
+
return default_1;
|
|
248
|
+
}(BaseAdapter_1.BaseFeatureDataAdapter));
|
|
249
|
+
exports.default = default_1;
|
|
250
|
+
//# sourceMappingURL=VcfTabixAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VcfTabixAdapter.js","sourceRoot":"","sources":["../../src/VcfTabixAdapter/VcfTabixAdapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAGgD;AAMhD,4CAAoD;AACpD,2CAAoD;AACpD,gDAA0D;AAE1D,qCAA8C;AAC9C,kDAAiC;AAEjC,6DAA4D;AAC5D,4DAAqC;AAGrC;IAA6B,6BAAsB;IAAnD;;IA0HA,CAAC;IAnHe,gCAAY,GAA1B;;;;;;wBACQ,aAAa,GAAG,IAAA,8BAAc,EAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;wBAC5D,QAAQ,GAAG,IAAA,8BAAc,EAAC,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAA;wBAC7D,SAAS,GAAG,IAAA,8BAAc,EAAC,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAA;wBAE/D,UAAU,GAAG,IAAA,iBAAY,EAC7B,aAA6B,EAC7B,IAAI,CAAC,aAAa,CACnB,CAAA;wBACK,KAAK,GAAG,SAAS,KAAK,KAAK,CAAA;wBAC3B,GAAG,GAAG,IAAI,wBAAgB,CAAC;4BAC/B,UAAU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