@jbrowse/plugin-config 2.1.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/ConfigurationEditorWidget/components/CallbackEditor.js +27 -44
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +11 -38
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +32 -73
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +19 -36
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +87 -142
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +15 -32
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js.map +1 -1
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js +7 -8
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js.map +1 -1
- package/dist/ConfigurationEditorWidget/index.js +8 -9
- package/dist/ConfigurationEditorWidget/index.js.map +1 -1
- package/dist/ConfigurationEditorWidget/model.js +16 -18
- package/dist/ConfigurationEditorWidget/model.js.map +1 -1
- package/dist/FromConfigAdapter/FromConfigAdapter.js +44 -158
- package/dist/FromConfigAdapter/FromConfigAdapter.js.map +1 -1
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.js +37 -144
- package/dist/FromConfigAdapter/FromConfigRegionsAdapter.js.map +1 -1
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js +48 -171
- package/dist/FromConfigAdapter/FromConfigSequenceAdapter.js.map +1 -1
- package/dist/FromConfigAdapter/configSchema.js +1 -1
- package/dist/FromConfigAdapter/configSchema.js.map +1 -1
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +22 -108
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js.map +1 -1
- package/dist/RefNameAliasAdapter/configSchema.js +1 -1
- package/dist/RefNameAliasAdapter/configSchema.js.map +1 -1
- package/dist/index.js +60 -94
- package/dist/index.js.map +1 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +1 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +1 -1
- package/package.json +2 -3
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx +1 -1
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap +73 -73
|
@@ -1,194 +1,71 @@
|
|
|
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
|
-
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;
|
|
58
|
-
}
|
|
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 __values = (this && this.__values) || function(o) {
|
|
65
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
66
|
-
if (m) return m.call(o);
|
|
67
|
-
if (o && typeof o.length === "number") return {
|
|
68
|
-
next: function () {
|
|
69
|
-
if (o && i >= o.length) o = void 0;
|
|
70
|
-
return { value: o && o[i++], done: !o };
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
74
|
-
};
|
|
75
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
76
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
77
|
-
if (!m) return o;
|
|
78
|
-
var i = m.call(o), r, ar = [], e;
|
|
79
|
-
try {
|
|
80
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
81
|
-
}
|
|
82
|
-
catch (error) { e = { error: error }; }
|
|
83
|
-
finally {
|
|
84
|
-
try {
|
|
85
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
86
|
-
}
|
|
87
|
-
finally { if (e) throw e.error; }
|
|
88
|
-
}
|
|
89
|
-
return ar;
|
|
90
|
-
};
|
|
91
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
92
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
93
4
|
};
|
|
94
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
__extends(FromConfigSequenceAdapter, _super);
|
|
101
|
-
function FromConfigSequenceAdapter() {
|
|
102
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
103
|
-
}
|
|
6
|
+
const simpleFeature_1 = __importDefault(require("@jbrowse/core/util/simpleFeature"));
|
|
7
|
+
const rxjs_1 = require("@jbrowse/core/util/rxjs");
|
|
8
|
+
const operators_1 = require("rxjs/operators");
|
|
9
|
+
const FromConfigAdapter_1 = __importDefault(require("./FromConfigAdapter"));
|
|
10
|
+
class FromConfigSequenceAdapter extends FromConfigAdapter_1.default {
|
|
104
11
|
/**
|
|
105
12
|
* Fetch features for a certain region
|
|
106
13
|
* @param region - Region
|
|
107
14
|
* @returns Observable of Feature objects in the region
|
|
108
15
|
*/
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
});
|
|
126
|
-
}); });
|
|
127
|
-
};
|
|
16
|
+
getFeatures(region) {
|
|
17
|
+
return (0, rxjs_1.ObservableCreate)(async (observer) => {
|
|
18
|
+
const feats = await super.getFeatures(region).pipe((0, operators_1.toArray)()).toPromise();
|
|
19
|
+
const feat = feats[0];
|
|
20
|
+
observer.next(new simpleFeature_1.default({
|
|
21
|
+
...feat.toJSON(),
|
|
22
|
+
uniqueId: `${feat.id()}:${region.start}-${region.end}`,
|
|
23
|
+
end: region.end,
|
|
24
|
+
start: region.start,
|
|
25
|
+
seq: feat
|
|
26
|
+
.get('seq')
|
|
27
|
+
.slice(Math.max(region.start - feat.get('start'), 0), Math.max(region.end - feat.get('start'), 0)),
|
|
28
|
+
}));
|
|
29
|
+
observer.complete();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
128
32
|
/**
|
|
129
33
|
* Get refName, start, and end for all features after collapsing any overlaps
|
|
130
34
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
currentRegion = void 0;
|
|
142
|
-
try {
|
|
143
|
-
for (features_1 = (e_2 = void 0, __values(features)), features_1_1 = features_1.next(); !features_1_1.done; features_1_1 = features_1.next()) {
|
|
144
|
-
feature = features_1_1.value;
|
|
145
|
-
if (currentRegion &&
|
|
146
|
-
currentRegion.end >= feature.get('start') &&
|
|
147
|
-
currentRegion.start <= feature.get('end')) {
|
|
148
|
-
currentRegion.end = feature.get('end');
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
if (currentRegion) {
|
|
152
|
-
regions.push(currentRegion);
|
|
153
|
-
}
|
|
154
|
-
currentRegion = {
|
|
155
|
-
refName: refName,
|
|
156
|
-
start: feature.get('start'),
|
|
157
|
-
end: feature.get('end'),
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
163
|
-
finally {
|
|
164
|
-
try {
|
|
165
|
-
if (features_1_1 && !features_1_1.done && (_e = features_1.return)) _e.call(features_1);
|
|
166
|
-
}
|
|
167
|
-
finally { if (e_2) throw e_2.error; }
|
|
168
|
-
}
|
|
169
|
-
if (currentRegion) {
|
|
170
|
-
regions.push(currentRegion);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
35
|
+
async getRegions() {
|
|
36
|
+
const regions = [];
|
|
37
|
+
// recall: features are stored in this object sorted by start coordinate
|
|
38
|
+
for (const [refName, features] of this.features) {
|
|
39
|
+
let currentRegion;
|
|
40
|
+
for (const feature of features) {
|
|
41
|
+
if (currentRegion &&
|
|
42
|
+
currentRegion.end >= feature.get('start') &&
|
|
43
|
+
currentRegion.start <= feature.get('end')) {
|
|
44
|
+
currentRegion.end = feature.get('end');
|
|
173
45
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
|
|
46
|
+
else {
|
|
47
|
+
if (currentRegion) {
|
|
48
|
+
regions.push(currentRegion);
|
|
178
49
|
}
|
|
179
|
-
|
|
50
|
+
currentRegion = {
|
|
51
|
+
refName,
|
|
52
|
+
start: feature.get('start'),
|
|
53
|
+
end: feature.get('end'),
|
|
54
|
+
};
|
|
180
55
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
56
|
+
}
|
|
57
|
+
if (currentRegion) {
|
|
58
|
+
regions.push(currentRegion);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return regions;
|
|
62
|
+
}
|
|
185
63
|
/**
|
|
186
64
|
* called to provide a hint that data tied to a certain region
|
|
187
65
|
* will not be needed for the forseeable future and can be purged
|
|
188
66
|
* from caches, etc
|
|
189
67
|
*/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}(FromConfigAdapter_1.default));
|
|
68
|
+
freeResources( /* { region } */) { }
|
|
69
|
+
}
|
|
193
70
|
exports.default = FromConfigSequenceAdapter;
|
|
194
71
|
//# sourceMappingURL=FromConfigSequenceAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromConfigSequenceAdapter.js","sourceRoot":"","sources":["../../src/FromConfigAdapter/FromConfigSequenceAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FromConfigSequenceAdapter.js","sourceRoot":"","sources":["../../src/FromConfigAdapter/FromConfigSequenceAdapter.ts"],"names":[],"mappings":";;;;;AAAA,qFAAyE;AACzE,kDAA0D;AAE1D,8CAAwC;AACxC,4EAAmD;AAGnD,MAAqB,yBACnB,SAAQ,2BAAiB;IAGzB;;;;OAIG;IACH,WAAW,CAAC,MAAwB;QAClC,OAAO,IAAA,uBAAgB,EAAU,KAAK,EAAC,QAAQ,EAAC,EAAE;YAChD,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAA,mBAAO,GAAE,CAAC,CAAC,SAAS,EAAE,CAAA;YACzE,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;YACrB,QAAQ,CAAC,IAAI,CACX,IAAI,uBAAa,CAAC;gBAChB,GAAG,IAAI,CAAC,MAAM,EAAE;gBAChB,QAAQ,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,EAAE;gBACtD,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,GAAG,EAAE,IAAI;qBACN,GAAG,CAAC,KAAK,CAAC;qBACV,KAAK,CACJ,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAC7C,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAC5C;aACJ,CAAC,CACH,CAAA;YAED,QAAQ,CAAC,QAAQ,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU;QACd,MAAM,OAAO,GAAG,EAAE,CAAA;QAElB,wEAAwE;QACxE,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC/C,IAAI,aAAa,CAAA;YACjB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;gBAC9B,IACE,aAAa;oBACb,aAAa,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;oBACzC,aAAa,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EACzC;oBACA,aAAa,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;iBACvC;qBAAM;oBACL,IAAI,aAAa,EAAE;wBACjB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;qBAC5B;oBACD,aAAa,GAAG;wBACd,OAAO;wBACP,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;wBAC3B,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;qBACxB,CAAA;iBACF;aACF;YACD,IAAI,aAAa,EAAE;gBACjB,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;aAC5B;SACF;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;IAED;;;;OAIG;IACH,aAAa,EAAC,gBAAgB,IAAS,CAAC;CACzC;AAzED,4CAyEC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sequenceConfigSchema = exports.regionsConfigSchema = exports.configSchema = void 0;
|
|
4
|
-
|
|
4
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
5
5
|
exports.configSchema = (0, configuration_1.ConfigurationSchema)('FromConfigAdapter', {
|
|
6
6
|
features: {
|
|
7
7
|
type: 'frozen',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/FromConfigAdapter/configSchema.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/FromConfigAdapter/configSchema.ts"],"names":[],"mappings":";;;AAAA,+DAAiE;AAEpD,QAAA,YAAY,GAAG,IAAA,mCAAmB,EAC7C,mBAAmB,EACnB;IACE,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,EAAE;KACjB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,eAAe;KAC9B;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAC3D,CAAA;AAEY,QAAA,mBAAmB,GAAG,IAAA,mCAAmB,EACpD,0BAA0B,EAC1B;IACE,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,EAAE;KACjB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,eAAe;KAC9B;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAC3D,CAAA;AAEY,QAAA,oBAAoB,GAAG,IAAA,mCAAmB,EACrD,2BAA2B,EAC3B;IACE,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,EAAE;KACjB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,eAAe;KAC9B;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAC3D,CAAA"}
|
|
@@ -1,113 +1,27 @@
|
|
|
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
|
-
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());
|
|
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);
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
case 1:
|
|
90
|
-
results = _a.sent();
|
|
91
|
-
refColumn = (0, configuration_1.readConfObject)(this.config, 'refNameColumn');
|
|
92
|
-
return [2 /*return*/, results
|
|
93
|
-
.trim()
|
|
94
|
-
.split('\n')
|
|
95
|
-
.filter(function (f) { return !!f && !f.startsWith('#'); })
|
|
96
|
-
.map(function (row) {
|
|
97
|
-
var aliases = row.split('\t');
|
|
98
|
-
var _a = __read(aliases.splice(refColumn, 1), 1), refName = _a[0];
|
|
99
|
-
return { refName: refName, aliases: aliases.filter(function (f) { return !!f.trim(); }) };
|
|
100
|
-
})];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
3
|
+
const BaseAdapter_1 = require("@jbrowse/core/data_adapters/BaseAdapter");
|
|
4
|
+
const io_1 = require("@jbrowse/core/util/io");
|
|
5
|
+
const configuration_1 = require("@jbrowse/core/configuration");
|
|
6
|
+
class RefNameAliasAdapter extends BaseAdapter_1.BaseAdapter {
|
|
7
|
+
async getRefNameAliases() {
|
|
8
|
+
const loc = (0, configuration_1.readConfObject)(this.config, 'location');
|
|
9
|
+
if (loc.uri === '' || loc.uri === '/path/to/my/aliases.txt') {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
const results = await (0, io_1.openLocation)(loc).readFile('utf8');
|
|
13
|
+
const refColumn = (0, configuration_1.readConfObject)(this.config, 'refNameColumn');
|
|
14
|
+
return results
|
|
15
|
+
.trim()
|
|
16
|
+
.split('\n')
|
|
17
|
+
.filter(f => !!f && !f.startsWith('#'))
|
|
18
|
+
.map(row => {
|
|
19
|
+
const aliases = row.split('\t');
|
|
20
|
+
const [refName] = aliases.splice(refColumn, 1);
|
|
21
|
+
return { refName, aliases: aliases.filter(f => !!f.trim()) };
|
|
103
22
|
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return [2 /*return*/];
|
|
108
|
-
}); });
|
|
109
|
-
};
|
|
110
|
-
return RefNameAliasAdapter;
|
|
111
|
-
}(BaseAdapter_1.BaseAdapter));
|
|
23
|
+
}
|
|
24
|
+
async freeResources() { }
|
|
25
|
+
}
|
|
112
26
|
exports.default = RefNameAliasAdapter;
|
|
113
27
|
//# sourceMappingURL=RefNameAliasAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefNameAliasAdapter.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/RefNameAliasAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RefNameAliasAdapter.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/RefNameAliasAdapter.ts"],"names":[],"mappings":";;AAAA,yEAGgD;AAChD,8CAAoD;AACpD,+DAA4D;AAE5D,MAAqB,mBACnB,SAAQ,yBAAW;IAGnB,KAAK,CAAC,iBAAiB;QACrB,MAAM,GAAG,GAAG,IAAA,8BAAc,EAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;QACnD,IAAI,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,GAAG,KAAK,yBAAyB,EAAE;YAC3D,OAAO,EAAE,CAAA;SACV;QACD,MAAM,OAAO,GAAG,MAAM,IAAA,iBAAY,EAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QACxD,MAAM,SAAS,GAAG,IAAA,8BAAc,EAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;QAC9D,OAAO,OAAO;aACX,IAAI,EAAE;aACN,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACtC,GAAG,CAAC,GAAG,CAAC,EAAE;YACT,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC/B,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAA;YAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAA;QAC9D,CAAC,CAAC,CAAA;IACN,CAAC;IAED,KAAK,CAAC,aAAa,KAAI,CAAC;CACzB;AAvBD,sCAuBC"}
|
|
@@ -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)('RefNameAliasAdapter', {
|
|
5
5
|
location: {
|
|
6
6
|
type: 'fileLocation',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/RefNameAliasAdapter/configSchema.ts"],"names":[],"mappings":";;AAAA,+DAAiE;AAEjE,kBAAe,IAAA,mCAAmB,EAChC,qBAAqB,EACrB;IACE,QAAQ,EAAE;QACR,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,yBAAyB;YAC9B,YAAY,EAAE,aAAa;SAC5B;KACF;IACD,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,CAAC;KAChB;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -42,84 +27,66 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
42
27
|
};
|
|
43
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
29
|
exports.ConfigurationEditor = exports.JsonEditor = void 0;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
30
|
+
const react_1 = require("react");
|
|
31
|
+
const AdapterType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/AdapterType"));
|
|
32
|
+
const WidgetType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/WidgetType"));
|
|
33
|
+
const Plugin_1 = __importDefault(require("@jbrowse/core/Plugin"));
|
|
34
|
+
const ConfigurationEditorWidget_1 = require("./ConfigurationEditorWidget");
|
|
35
|
+
const FromConfigAdapter_1 = require("./FromConfigAdapter");
|
|
36
|
+
const RefNameAliasAdapter_1 = require("./RefNameAliasAdapter");
|
|
37
|
+
const LazyConfigurationEditorComponent = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./ConfigurationEditorWidget/components/ConfigurationEditor'))));
|
|
53
38
|
exports.ConfigurationEditor = LazyConfigurationEditorComponent;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
_this.name = 'ConfigurationPlugin';
|
|
59
|
-
return _this;
|
|
39
|
+
class default_1 extends Plugin_1.default {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
this.name = 'ConfigurationPlugin';
|
|
60
43
|
}
|
|
61
|
-
|
|
62
|
-
pluginManager.addAdapterType(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
pluginManager.addAdapterType(function () {
|
|
108
|
-
return new AdapterType_1.default({
|
|
109
|
-
name: 'RefNameAliasAdapter',
|
|
110
|
-
configSchema: RefNameAliasAdapter_1.configSchema,
|
|
111
|
-
getAdapterClass: function () {
|
|
112
|
-
return Promise.resolve().then(function () { return __importStar(require('./RefNameAliasAdapter/RefNameAliasAdapter')); }).then(function (r) { return r.default; });
|
|
113
|
-
},
|
|
114
|
-
adapterMetadata: {
|
|
115
|
-
category: null,
|
|
116
|
-
hiddenFromGUI: true,
|
|
117
|
-
displayName: null,
|
|
118
|
-
description: null,
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
pluginManager.addWidgetType(function () {
|
|
44
|
+
install(pluginManager) {
|
|
45
|
+
pluginManager.addAdapterType(() => new AdapterType_1.default({
|
|
46
|
+
name: 'FromConfigAdapter',
|
|
47
|
+
configSchema: FromConfigAdapter_1.configSchema,
|
|
48
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./FromConfigAdapter/FromConfigAdapter'))).then(r => r.default),
|
|
49
|
+
adapterMetadata: {
|
|
50
|
+
category: null,
|
|
51
|
+
hiddenFromGUI: true,
|
|
52
|
+
displayName: null,
|
|
53
|
+
description: null,
|
|
54
|
+
},
|
|
55
|
+
}));
|
|
56
|
+
pluginManager.addAdapterType(() => new AdapterType_1.default({
|
|
57
|
+
name: 'FromConfigRegionsAdapter',
|
|
58
|
+
configSchema: FromConfigAdapter_1.regionsConfigSchema,
|
|
59
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./FromConfigAdapter/FromConfigRegionsAdapter'))).then(r => r.default),
|
|
60
|
+
adapterMetadata: {
|
|
61
|
+
category: null,
|
|
62
|
+
hiddenFromGUI: true,
|
|
63
|
+
displayName: null,
|
|
64
|
+
description: null,
|
|
65
|
+
},
|
|
66
|
+
}));
|
|
67
|
+
pluginManager.addAdapterType(() => new AdapterType_1.default({
|
|
68
|
+
name: 'FromConfigSequenceAdapter',
|
|
69
|
+
configSchema: FromConfigAdapter_1.sequenceConfigSchema,
|
|
70
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./FromConfigAdapter/FromConfigSequenceAdapter'))).then(r => r.default),
|
|
71
|
+
adapterMetadata: {
|
|
72
|
+
category: null,
|
|
73
|
+
hiddenFromGUI: true,
|
|
74
|
+
displayName: null,
|
|
75
|
+
description: null,
|
|
76
|
+
},
|
|
77
|
+
}));
|
|
78
|
+
pluginManager.addAdapterType(() => new AdapterType_1.default({
|
|
79
|
+
name: 'RefNameAliasAdapter',
|
|
80
|
+
configSchema: RefNameAliasAdapter_1.configSchema,
|
|
81
|
+
getAdapterClass: () => Promise.resolve().then(() => __importStar(require('./RefNameAliasAdapter/RefNameAliasAdapter'))).then(r => r.default),
|
|
82
|
+
adapterMetadata: {
|
|
83
|
+
category: null,
|
|
84
|
+
hiddenFromGUI: true,
|
|
85
|
+
displayName: null,
|
|
86
|
+
description: null,
|
|
87
|
+
},
|
|
88
|
+
}));
|
|
89
|
+
pluginManager.addWidgetType(() => {
|
|
123
90
|
return new WidgetType_1.default({
|
|
124
91
|
name: 'ConfigurationEditorWidget',
|
|
125
92
|
HeadingComponent: ConfigurationEditorWidget_1.HeadingComponent,
|
|
@@ -128,9 +95,8 @@ var default_1 = /** @class */ (function (_super) {
|
|
|
128
95
|
ReactComponent: LazyConfigurationEditorComponent,
|
|
129
96
|
});
|
|
130
97
|
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
}(Plugin_1.default));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
134
100
|
exports.default = default_1;
|
|
135
101
|
var JsonEditor_1 = require("./ConfigurationEditorWidget/components/JsonEditor");
|
|
136
102
|
Object.defineProperty(exports, "JsonEditor", { enumerable: true, get: function () { return __importDefault(JsonEditor_1).default; } });
|