jbrowse-plugin-msaview 1.0.17 → 1.0.18
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/CHANGELOG.md +4 -0
- package/dist/jbrowse-plugin-msaview.cjs.development.js +1 -1
- package/dist/jbrowse-plugin-msaview.cjs.production.min.js +1 -1
- package/dist/jbrowse-plugin-msaview.esm.js +1 -1
- package/dist/jbrowse-plugin-msaview.umd.development.js +61 -43
- package/dist/jbrowse-plugin-msaview.umd.development.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@jbrowse/core/Plugin")),n=require("@jbrowse/core/util"),r=require("react-msaview"),o=e(require("@jbrowse/core/pluggableElementTypes/ViewType")),i=e(require("@material-ui/icons/GridOn"));function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}exports.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,t);var c,f=l(s);function s(){var e;return u(this,s),(e=f.apply(this,arguments)).name="MsaViewPlugin",e.version="1.0.
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@jbrowse/core/Plugin")),n=require("@jbrowse/core/util"),r=require("react-msaview"),o=e(require("@jbrowse/core/pluggableElementTypes/ViewType")),i=e(require("@material-ui/icons/GridOn"));function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}exports.default=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,t);var c,f=l(s);function s(){var e;return u(this,s),(e=f.apply(this,arguments)).name="MsaViewPlugin",e.version="1.0.18",e}return(c=[{key:"install",value:function(e){console.log({MSA:r}),e.addViewType((function(){return new o({name:"MsaView",stateModel:r.MSAModel,ReactComponent:r.MSAView})}))}},{key:"configure",value:function(e){n.isAbstractMenuManager(e.rootModel)&&e.rootModel.appendToSubMenu(["Add"],{label:"Multiple sequence alignment view",icon:i,onClick:function(e){e.addView("MsaView",{})}})}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,c),s}();
|
|
2
2
|
//# sourceMappingURL=jbrowse-plugin-msaview.cjs.production.min.js.map
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
var version = "1.0.
|
|
118
|
+
var version = "1.0.18";
|
|
119
119
|
|
|
120
120
|
var smallMSA = "CLUSTAL O(1.2.3) multiple sequence alignment\nUniProt/Swiss-Prot|P26898|IL2RA_SHEEP MEPSLLMWRFFVFIVVPGCVTEACHDDPPSLRNA----------MFKVLRYE----VGTM\nUniProt/Swiss-Prot|P01590|IL2RA_MOUSE MEPRLLMLGFLSLTIVPSCRAELCLYDPPEVPNA----------TFKALSYK----NGTI\nUniProt/Swiss-Prot|P41690|IL2RA_FELCA MEPSLLLWGILTFVVVHGHVTELCDENPPDIQHA----------TFKALTYK----TGTM\nUniProt/Swiss-Prot|P01589|IL2RA_HUMAN MDSYLLMWGLLTFIMVPGCQAELCDDDPPEIPHA----------TFKAMAYK----EGTM\nUniProt/Swiss-Prot|Q5MNY4|IL2RA_MACMU MDPYLLMWGLLTFITVPGCQAELCDDDPPKITHA----------TFKAVAYK----EGTM\nUniProt/Swiss-Prot|Q95118|IL2RG_BOVIN -----------------------------------LLMWGLLT-----------------\nUniProt/Swiss-Prot|P40321|IL2RG_CANFA MLKPPLPLRSLLFLQLSLLGVGLNSTVPMPNGNEDIT------PDFFLTATPSETLSVSS\nUniProt/Swiss-Prot|P26896|IL2RB_RAT MATVDLSWRLPLYILLLLLATT--------------------------------WVSAAV\nUniProt/Swiss-Prot|Q8BZM1|GLMN_MOUSE PLPLRSLLFLQLPLLGVGLNP------------------PLPLRSLLFLQLPLLGVGLNP\nUniProt/Swiss-Prot|P36835|IL2_CAPHI -----------LLGVGLNPKFLTP------------------------------------\nUniProt/Swiss-Prot|Q7JFM4|IL2_AOTVO MLKPPLPLRSLLFLQLPLLGVGLNPKFLTPSGNEDIGGKPGTGGDFFLTSTPAGTLDVST\nUniProt/Swiss-Prot|Q29416|IL2_CANFA --------------LFLQLSLLG-------------------------------------\n";
|
|
121
121
|
var smallMSAOnly = "CLUSTAL O(1.2.4) multiple sequence alignment\n\n\nsp|P69905|HBA_HUMAN MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSHGSAQVKGHG\t60\nsp|P01942|HBA_MOUSE MVLSGEDKSNIKAAWGKIGGHGAEYGAEALERMFASFPTTKTYFPHFDVSHGSAQVKGHG\t60\nsp|P13786|HBAZ_CAPHI MSLTRTERTIILSLWSKISTQADVIGTETLERLFSCYPQAKTYFPHFDLHSGSAQLRAHG\t60\n * *: ::: : : *.*:. :. *:*:***:* .:* :********: ****::.**\n\nsp|P69905|HBA_HUMAN KKVADALTNAVAHVDDMPNALSALSDLHAHKLRVDPVNFKLLSHCLLVTLAAHLPAEFTP\t120\nsp|P01942|HBA_MOUSE KKVADALASAAGHLDDLPGALSALSDLHAHKLRVDPVNFKLLSHCLLVTLASHHPADFTP\t120\nsp|P13786|HBAZ_CAPHI SKVVAAVGDAVKSIDNVTSALSKLSELHAYVLRVDPVNFKFLSHCLLVTLASHFPADFTA\t120\n .**. *: .*. :*:: .*** **:***: *********:**********:* **:**\n\nsp|P69905|HBA_HUMAN AVHASLDKFLASVSTVLTSKYR\t142\nsp|P01942|HBA_MOUSE AVHASLDKFLASVSTVLTSKYR\t142\nsp|P13786|HBAZ_CAPHI DAHAAWDKFLSIVSGVLTEKYR\t142\n .**: ****: ** ***.***";
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
React__default.createElement("div", { style: { width: '50%' } },
|
|
141
141
|
error ? (React__default.createElement("div", { style: { padding: 20 } },
|
|
142
142
|
React__default.createElement(core.Typography, { color: "error" },
|
|
143
|
-
"Error: ", ""
|
|
143
|
+
"Error: ", "".concat(error)))) : null,
|
|
144
144
|
React__default.createElement(core.Typography, null, "Open an MSA file (stockholm or clustal format) and/or a tree file (newick format)."),
|
|
145
145
|
React__default.createElement(core.Typography, { color: "error" }, "Note: you can open up just an MSA or just a tree, both are not required. Some MSA files e.g. stockholm format have an embedded tree also and this is fine, and opening a separate tree file is not required.")),
|
|
146
146
|
React__default.createElement(core.Grid, { container: true, spacing: 10, justifyContent: "center", alignItems: "center" },
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
React__default.createElement(ListItem, { model: model, onClick: function () {
|
|
166
166
|
model.setTreeFilehandle({
|
|
167
167
|
uri: 'https://jbrowse.org/genomes/newick_trees/sarscov2phylo.pub.ft.nh',
|
|
168
|
+
locationType: 'UriLocation',
|
|
168
169
|
});
|
|
169
170
|
} }, "230k COVID-19 samples (tree only)"),
|
|
170
171
|
React__default.createElement(ListItem, { model: model, onClick: function () {
|
|
@@ -176,30 +177,36 @@
|
|
|
176
177
|
React__default.createElement(ListItem, { model: model, onClick: function () {
|
|
177
178
|
model.setMSAFilehandle({
|
|
178
179
|
uri: 'https://ihh.github.io/abrowse/build/pfam-cov2.stock',
|
|
180
|
+
locationType: 'UriLocation',
|
|
179
181
|
});
|
|
180
182
|
} }, "PFAM SARS-CoV2 multi-stockholm"),
|
|
181
183
|
React__default.createElement(ListItem, { model: model, onClick: function () {
|
|
182
184
|
model.setMSAFilehandle({
|
|
183
185
|
uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/Lysine.stock',
|
|
186
|
+
locationType: 'UriLocation',
|
|
184
187
|
});
|
|
185
188
|
} }, "Lysine stockholm file"),
|
|
186
189
|
React__default.createElement(ListItem, { model: model, onClick: function () {
|
|
187
190
|
model.setMSAFilehandle({
|
|
188
191
|
uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/PF01601_full.txt',
|
|
192
|
+
locationType: 'UriLocation',
|
|
189
193
|
});
|
|
190
194
|
} }, "PF01601 stockholm file (SARS-CoV2 spike protein)"),
|
|
191
195
|
React__default.createElement(ListItem, { model: model, onClick: function () {
|
|
192
196
|
model.setMSAFilehandle({
|
|
193
197
|
uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/europe_covid.fa',
|
|
198
|
+
locationType: 'UriLocation',
|
|
194
199
|
});
|
|
195
200
|
} }, "Europe COVID full genomes (LR883044.1 and 199 other sequences)"),
|
|
196
201
|
React__default.createElement(ListItem, { model: model, onClick: function () {
|
|
197
202
|
mobx.transaction(function () {
|
|
198
203
|
model.setMSAFilehandle({
|
|
199
204
|
uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/rhv_test-only.aligned_with_mafft_auto.fa',
|
|
205
|
+
locationType: 'UriLocation',
|
|
200
206
|
});
|
|
201
207
|
model.setTreeFilehandle({
|
|
202
208
|
uri: 'https://jbrowse.org/genomes/multiple_sequence_alignments/rhv_test-only.aligned_with_mafft_auto.nh',
|
|
209
|
+
locationType: 'UriLocation',
|
|
203
210
|
});
|
|
204
211
|
});
|
|
205
212
|
} }, "MAFFT+VeryFastTree(17.9k samples)"))))));
|
|
@@ -396,7 +403,7 @@
|
|
|
396
403
|
var treeAreaWidth = model.treeAreaWidth;
|
|
397
404
|
var classes = useStyles();
|
|
398
405
|
return (React__default.createElement(React__default.Fragment, null,
|
|
399
|
-
React__default.createElement(core.Tooltip, { open: true, placement: "top", title: ""
|
|
406
|
+
React__default.createElement(core.Tooltip, { open: true, placement: "top", title: "".concat(model.pxToBp(coordX) + 1), arrow: true },
|
|
400
407
|
React__default.createElement("div", { style: {
|
|
401
408
|
left: coordX + treeAreaWidth,
|
|
402
409
|
position: 'absolute',
|
|
@@ -1757,7 +1764,7 @@
|
|
|
1757
1764
|
ctx.clearRect(0, 0, treeWidth + padding, blockSize);
|
|
1758
1765
|
ctx.translate(margin.left, -offsetY);
|
|
1759
1766
|
var font = ctx.font;
|
|
1760
|
-
ctx.font = font.replace(/\d+px/, Math.max(8, rowHeight - 8)
|
|
1767
|
+
ctx.font = font.replace(/\d+px/, "".concat(Math.max(8, rowHeight - 8), "px"));
|
|
1761
1768
|
if (!noTree && drawTree) {
|
|
1762
1769
|
hierarchy.links().forEach(function (_a) {
|
|
1763
1770
|
var source = _a.source, target = _a.target;
|
|
@@ -1896,6 +1903,7 @@
|
|
|
1896
1903
|
labelsAlignRight,
|
|
1897
1904
|
treeAreaWidth,
|
|
1898
1905
|
structures,
|
|
1906
|
+
highResScaleFactor,
|
|
1899
1907
|
]);
|
|
1900
1908
|
React.useEffect(function () {
|
|
1901
1909
|
var canvas = mouseoverRef.current;
|
|
@@ -2272,12 +2280,13 @@
|
|
|
2272
2280
|
/* MIT license */
|
|
2273
2281
|
|
|
2274
2282
|
|
|
2283
|
+
var hasOwnProperty = Object.hasOwnProperty;
|
|
2275
2284
|
|
|
2276
2285
|
var reverseNames = {};
|
|
2277
2286
|
|
|
2278
2287
|
// create a list of reverse color names
|
|
2279
2288
|
for (var name in colorName) {
|
|
2280
|
-
if (
|
|
2289
|
+
if (hasOwnProperty.call(colorName, name)) {
|
|
2281
2290
|
reverseNames[colorName[name]] = name;
|
|
2282
2291
|
}
|
|
2283
2292
|
}
|
|
@@ -2320,9 +2329,9 @@
|
|
|
2320
2329
|
|
|
2321
2330
|
var abbr = /^#([a-f0-9]{3,4})$/i;
|
|
2322
2331
|
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
|
|
2323
|
-
var rgba = /^rgba?\(\s*([+-]?\d+)\s
|
|
2324
|
-
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s
|
|
2325
|
-
var keyword =
|
|
2332
|
+
var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
2333
|
+
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
2334
|
+
var keyword = /^(\w+)$/;
|
|
2326
2335
|
|
|
2327
2336
|
var rgb = [0, 0, 0, 1];
|
|
2328
2337
|
var match;
|
|
@@ -2359,7 +2368,11 @@
|
|
|
2359
2368
|
}
|
|
2360
2369
|
|
|
2361
2370
|
if (match[4]) {
|
|
2362
|
-
|
|
2371
|
+
if (match[5]) {
|
|
2372
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
2373
|
+
} else {
|
|
2374
|
+
rgb[3] = parseFloat(match[4]);
|
|
2375
|
+
}
|
|
2363
2376
|
}
|
|
2364
2377
|
} else if (match = string.match(per)) {
|
|
2365
2378
|
for (i = 0; i < 3; i++) {
|
|
@@ -2367,19 +2380,22 @@
|
|
|
2367
2380
|
}
|
|
2368
2381
|
|
|
2369
2382
|
if (match[4]) {
|
|
2370
|
-
|
|
2383
|
+
if (match[5]) {
|
|
2384
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
2385
|
+
} else {
|
|
2386
|
+
rgb[3] = parseFloat(match[4]);
|
|
2387
|
+
}
|
|
2371
2388
|
}
|
|
2372
2389
|
} else if (match = string.match(keyword)) {
|
|
2373
2390
|
if (match[1] === 'transparent') {
|
|
2374
2391
|
return [0, 0, 0, 0];
|
|
2375
2392
|
}
|
|
2376
2393
|
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
if (!rgb) {
|
|
2394
|
+
if (!hasOwnProperty.call(colorName, match[1])) {
|
|
2380
2395
|
return null;
|
|
2381
2396
|
}
|
|
2382
2397
|
|
|
2398
|
+
rgb = colorName[match[1]];
|
|
2383
2399
|
rgb[3] = 1;
|
|
2384
2400
|
|
|
2385
2401
|
return rgb;
|
|
@@ -2400,12 +2416,12 @@
|
|
|
2400
2416
|
return null;
|
|
2401
2417
|
}
|
|
2402
2418
|
|
|
2403
|
-
var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s
|
|
2419
|
+
var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
2404
2420
|
var match = string.match(hsl);
|
|
2405
2421
|
|
|
2406
2422
|
if (match) {
|
|
2407
2423
|
var alpha = parseFloat(match[4]);
|
|
2408
|
-
var h = (parseFloat(match[1]) + 360) % 360;
|
|
2424
|
+
var h = ((parseFloat(match[1]) % 360) + 360) % 360;
|
|
2409
2425
|
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
2410
2426
|
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
2411
2427
|
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
@@ -2421,7 +2437,7 @@
|
|
|
2421
2437
|
return null;
|
|
2422
2438
|
}
|
|
2423
2439
|
|
|
2424
|
-
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d
|
|
2440
|
+
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
2425
2441
|
var match = string.match(hwb);
|
|
2426
2442
|
|
|
2427
2443
|
if (match) {
|
|
@@ -2500,7 +2516,7 @@
|
|
|
2500
2516
|
}
|
|
2501
2517
|
|
|
2502
2518
|
function hexDouble(num) {
|
|
2503
|
-
var str = num.toString(16).toUpperCase();
|
|
2519
|
+
var str = Math.round(num).toString(16).toUpperCase();
|
|
2504
2520
|
return (str.length < 2) ? '0' + str : str;
|
|
2505
2521
|
}
|
|
2506
2522
|
});
|
|
@@ -4194,9 +4210,9 @@
|
|
|
4194
4210
|
var _a;
|
|
4195
4211
|
if (parent === void 0) { parent = 'node'; }
|
|
4196
4212
|
if (depth === void 0) { depth = 0; }
|
|
4197
|
-
var id = parent
|
|
4213
|
+
var id = "".concat(parent, "-").concat(depth);
|
|
4198
4214
|
return __assign$1(__assign$1({}, tree), { id: id, branchset: ((_a = tree.branchset) === null || _a === void 0 ? void 0 : _a.map(function (b, i) {
|
|
4199
|
-
return generateNodeIds(b, id
|
|
4215
|
+
return generateNodeIds(b, "".concat(id, "-").concat(i), depth + 1);
|
|
4200
4216
|
})) || [] });
|
|
4201
4217
|
}
|
|
4202
4218
|
function colorContrast(colorScheme, theme) {
|
|
@@ -4655,7 +4671,7 @@
|
|
|
4655
4671
|
}
|
|
4656
4672
|
}
|
|
4657
4673
|
var proportion = ent / total;
|
|
4658
|
-
var thresh = "hsl(240, 30%, "
|
|
4674
|
+
var thresh = "hsl(240, 30%, ".concat(100 * Math.max(1 - ent / total / 3, 0.3), "%)");
|
|
4659
4675
|
if (proportion > 0.4) {
|
|
4660
4676
|
if (l === letter) {
|
|
4661
4677
|
return thresh;
|
|
@@ -4682,7 +4698,7 @@
|
|
|
4682
4698
|
ctx.clearRect(0, 0, blockSize, blockSize);
|
|
4683
4699
|
ctx.translate(-offsetX, rowHeight / 2 - offsetY);
|
|
4684
4700
|
ctx.textAlign = 'center';
|
|
4685
|
-
ctx.font = ctx.font.replace(/\d+px/, Math.max(8, rowHeight - 8)
|
|
4701
|
+
ctx.font = ctx.font.replace(/\d+px/, "".concat(Math.max(8, rowHeight - 8), "px"));
|
|
4686
4702
|
var leaves = hierarchy.leaves();
|
|
4687
4703
|
var b = blockSize;
|
|
4688
4704
|
// slice vertical rows, e.g. tree leaves, avoid negative slice
|
|
@@ -4863,7 +4879,7 @@
|
|
|
4863
4879
|
React__default.createElement(core.CircularProgress, null),
|
|
4864
4880
|
React__default.createElement(core.Typography, null, "Loading..."))) : (blocks2d.map(function (_a) {
|
|
4865
4881
|
var bx = _a[0], by = _a[1];
|
|
4866
|
-
return (React__default.createElement(MSABlock, { key: bx
|
|
4882
|
+
return (React__default.createElement(MSABlock, { key: "".concat(bx, "_").concat(by), model: model, offsetX: bx, offsetY: by }));
|
|
4867
4883
|
}))));
|
|
4868
4884
|
});
|
|
4869
4885
|
|
|
@@ -4934,7 +4950,7 @@
|
|
|
4934
4950
|
if (num < 999) {
|
|
4935
4951
|
return String(num);
|
|
4936
4952
|
}
|
|
4937
|
-
return mathPower(~~(num / 1000))
|
|
4953
|
+
return "".concat(mathPower(~~(num / 1000)), ",").concat("00".concat(~~(num % 1000)).substr(-3, 3));
|
|
4938
4954
|
}
|
|
4939
4955
|
var useStyles$1 = core.makeStyles(function ( /* theme */) { return ({
|
|
4940
4956
|
majorTickLabel: {
|
|
@@ -4960,7 +4976,7 @@
|
|
|
4960
4976
|
.filter(function (tick) { return tick.type === 'major'; })
|
|
4961
4977
|
.map(function (tick) {
|
|
4962
4978
|
var x = (reversed ? end - tick.base : tick.base - start) / bpPerPx;
|
|
4963
|
-
return (React__default.createElement("text", { x: x, y: 10, key: "label-"
|
|
4979
|
+
return (React__default.createElement("text", { x: x, y: 10, key: "label-".concat(tick.base), textAnchor: "middle", style: { fontSize: '11px' }, className: classes.majorTickLabel }, mathPower(tick.base + 1)));
|
|
4964
4980
|
})));
|
|
4965
4981
|
}
|
|
4966
4982
|
var Ruler = mobxReact.observer(function (_a) {
|
|
@@ -4994,9 +5010,9 @@
|
|
|
4994
5010
|
var SettingsDialog = mobxReact.observer(function (_a) {
|
|
4995
5011
|
var model = _a.model, onClose = _a.onClose, open = _a.open;
|
|
4996
5012
|
var rowHeightInit = model.rowHeight, colWidthInit = model.colWidth, treeWidthInit = model.treeWidth, colorSchemeName = model.colorSchemeName, noTree = model.noTree;
|
|
4997
|
-
var _b = React.useState(""
|
|
4998
|
-
var _c = React.useState(""
|
|
4999
|
-
var _d = React.useState(""
|
|
5013
|
+
var _b = React.useState("".concat(rowHeightInit)), rowHeight = _b[0], setRowHeight = _b[1];
|
|
5014
|
+
var _c = React.useState("".concat(colWidthInit)), colWidth = _c[0], setColWidth = _c[1];
|
|
5015
|
+
var _d = React.useState("".concat(treeWidthInit)), treeWidth = _d[0], setTreeWidth = _d[1];
|
|
5000
5016
|
function error(n) {
|
|
5001
5017
|
return Number.isNaN(+n) || +n < 0;
|
|
5002
5018
|
}
|
|
@@ -5028,7 +5044,7 @@
|
|
|
5028
5044
|
}, variant: "contained", color: "primary" }, "Submit")))));
|
|
5029
5045
|
});
|
|
5030
5046
|
|
|
5031
|
-
var version$1 = "1.
|
|
5047
|
+
var version$1 = "1.3.1";
|
|
5032
5048
|
|
|
5033
5049
|
function LicenseDialog(_a) {
|
|
5034
5050
|
var onClose = _a.onClose, open = _a.open;
|
|
@@ -5046,7 +5062,7 @@
|
|
|
5046
5062
|
React__default.createElement(core.DialogTitle, null, "About this plugin"),
|
|
5047
5063
|
React__default.createElement(core.DialogContent, null,
|
|
5048
5064
|
React__default.createElement(core.Typography, null,
|
|
5049
|
-
"
|
|
5065
|
+
"MSAView ",
|
|
5050
5066
|
version$1,
|
|
5051
5067
|
" (",
|
|
5052
5068
|
React__default.createElement(core.Link, { href: "https://github.com/gmod/jbrowse-plugin-msaview" }, "Github"),
|
|
@@ -5242,7 +5258,7 @@
|
|
|
5242
5258
|
model.setCurrentAlignment(+event.target.value);
|
|
5243
5259
|
model.setScrollX(0);
|
|
5244
5260
|
model.setScrollY(0);
|
|
5245
|
-
} }, alignmentNames.map(function (option, index) { return (React__default.createElement("option", { key: option
|
|
5261
|
+
} }, alignmentNames.map(function (option, index) { return (React__default.createElement("option", { key: "".concat(option, "-").concat(index), value: index }, option)); }))) : null,
|
|
5246
5262
|
React__default.createElement(InfoArea, { model: model }),
|
|
5247
5263
|
React__default.createElement("div", { style: { flex: 1 } }),
|
|
5248
5264
|
React__default.createElement(core.IconButton, { onClick: function () { return setAboutDialogVisible(true); } },
|
|
@@ -5596,7 +5612,7 @@
|
|
|
5596
5612
|
r,
|
|
5597
5613
|
' ',
|
|
5598
5614
|
blanks.length
|
|
5599
|
-
? " (gapped "
|
|
5615
|
+
? " (gapped ".concat(model.getPos(l), "..").concat(model.getPos(r))
|
|
5600
5616
|
: ''),
|
|
5601
5617
|
rows.map(function (_a, index) {
|
|
5602
5618
|
var key = _a[0], val = _a[1];
|
|
@@ -7229,7 +7245,7 @@
|
|
|
7229
7245
|
};
|
|
7230
7246
|
Object.defineProperty(StockholmMSA.prototype, "alignmentNames", {
|
|
7231
7247
|
get: function () {
|
|
7232
|
-
return this.data.map(function (aln, index) { var _a; return ((_a = aln.gf.DE) === null || _a === void 0 ? void 0 : _a[0]) || "Alignment "
|
|
7248
|
+
return this.data.map(function (aln, index) { var _a; return ((_a = aln.gf.DE) === null || _a === void 0 ? void 0 : _a[0]) || "Alignment ".concat(index + 1); });
|
|
7233
7249
|
},
|
|
7234
7250
|
enumerable: false,
|
|
7235
7251
|
configurable: true
|
|
@@ -7437,7 +7453,7 @@
|
|
|
7437
7453
|
ctx.clearRect(0, 0, blockSize, rowHeight);
|
|
7438
7454
|
ctx.translate(-offsetX, 0);
|
|
7439
7455
|
ctx.textAlign = 'center';
|
|
7440
|
-
ctx.font = ctx.font.replace(/\d+px/, Math.max(8, rowHeight - 8)
|
|
7456
|
+
ctx.font = ctx.font.replace(/\d+px/, "".concat(Math.max(8, rowHeight - 8), "px"));
|
|
7441
7457
|
var xStart = Math.max(0, Math.floor(offsetX / colWidth));
|
|
7442
7458
|
var xEnd = Math.max(0, Math.ceil((offsetX + blockSize) / colWidth));
|
|
7443
7459
|
var str = data === null || data === void 0 ? void 0 : data.slice(xStart, xEnd);
|
|
@@ -7549,12 +7565,12 @@
|
|
|
7549
7565
|
if (associatedRowName) {
|
|
7550
7566
|
var s = model.rowSpecificBpToPx(associatedRowName, start - 1);
|
|
7551
7567
|
var e = model.rowSpecificBpToPx(associatedRowName, end);
|
|
7552
|
-
temp.addRect(""
|
|
7568
|
+
temp.addRect("".concat(index), s, e, rowHeight, feature);
|
|
7553
7569
|
}
|
|
7554
7570
|
else {
|
|
7555
7571
|
var s = model.globalBpToPx(start - 1);
|
|
7556
7572
|
var e = model.globalBpToPx(end);
|
|
7557
|
-
temp.addRect(""
|
|
7573
|
+
temp.addRect("".concat(index), s, e, rowHeight, feature);
|
|
7558
7574
|
}
|
|
7559
7575
|
});
|
|
7560
7576
|
return temp;
|
|
@@ -7575,7 +7591,7 @@
|
|
|
7575
7591
|
ctx.clearRect(0, 0, blockSize, height);
|
|
7576
7592
|
ctx.translate(-offsetX, 0);
|
|
7577
7593
|
ctx.textAlign = 'center';
|
|
7578
|
-
ctx.font = ctx.font.replace(/\d+px/, Math.max(8, rowHeight - 8)
|
|
7594
|
+
ctx.font = ctx.font.replace(/\d+px/, "".concat(Math.max(8, rowHeight - 8), "px"));
|
|
7579
7595
|
var xStart = Math.max(0, Math.floor(offsetX / colWidth));
|
|
7580
7596
|
ctx.fillStyle = 'goldenrod';
|
|
7581
7597
|
layout.rectangles.forEach(function (value) {
|
|
@@ -7613,7 +7629,7 @@
|
|
|
7613
7629
|
ctx.clearRect(0, 0, blockSize, height);
|
|
7614
7630
|
ctx.translate(-offsetX, 0);
|
|
7615
7631
|
ctx.textAlign = 'center';
|
|
7616
|
-
ctx.font = ctx.font.replace(/\d+px/, Math.max(8, rowHeight - 8)
|
|
7632
|
+
ctx.font = ctx.font.replace(/\d+px/, "".concat(Math.max(8, rowHeight - 8), "px"));
|
|
7617
7633
|
ctx.fillStyle = 'black';
|
|
7618
7634
|
ctx.textAlign = 'left';
|
|
7619
7635
|
layout.rectangles.forEach(function (value) {
|
|
@@ -7819,12 +7835,12 @@
|
|
|
7819
7835
|
case 0:
|
|
7820
7836
|
_a.trys.push([0, 3, , 4]);
|
|
7821
7837
|
accession = self.accession;
|
|
7822
|
-
url = "https://www.uniprot.org/uniprot/"
|
|
7838
|
+
url = "https://www.uniprot.org/uniprot/".concat(accession, ".gff");
|
|
7823
7839
|
return [4 /*yield*/, fetch(url)];
|
|
7824
7840
|
case 1:
|
|
7825
7841
|
response = _a.sent();
|
|
7826
7842
|
if (!response.ok) {
|
|
7827
|
-
throw new Error("HTTP "
|
|
7843
|
+
throw new Error("HTTP ".concat(response.status, " ").concat(response.statusText, " fetching ").concat(url));
|
|
7828
7844
|
}
|
|
7829
7845
|
return [4 /*yield*/, response.text()];
|
|
7830
7846
|
case 2:
|
|
@@ -7955,7 +7971,9 @@
|
|
|
7955
7971
|
self.selectedStructures = [];
|
|
7956
7972
|
},
|
|
7957
7973
|
setError: function (error) {
|
|
7958
|
-
|
|
7974
|
+
if (error) {
|
|
7975
|
+
console.error(error);
|
|
7976
|
+
}
|
|
7959
7977
|
self.error = error;
|
|
7960
7978
|
},
|
|
7961
7979
|
setMousePos: function (col, row) {
|
|
@@ -8161,9 +8179,9 @@
|
|
|
8161
8179
|
return ((_a = this.MSA) === null || _a === void 0 ? void 0 : _a.getDetails()) || {};
|
|
8162
8180
|
},
|
|
8163
8181
|
getRowDetails: function (name) {
|
|
8164
|
-
var _a;
|
|
8182
|
+
var _a, _b;
|
|
8165
8183
|
//@ts-ignore
|
|
8166
|
-
var details = (_a = this.MSA) === null || _a === void 0 ? void 0 : _a.getRowDetails(name);
|
|
8184
|
+
var details = (_b = (_a = this.MSA) === null || _a === void 0 ? void 0 : _a.getRowDetails) === null || _b === void 0 ? void 0 : _b.call(_a, name);
|
|
8167
8185
|
var matches = name.match(/\S+\/(\d+)-(\d+)/);
|
|
8168
8186
|
return __assign$3(__assign$3({}, details), (matches && { range: { start: +matches[1], end: +matches[2] } }));
|
|
8169
8187
|
},
|
|
@@ -8432,7 +8450,7 @@
|
|
|
8432
8450
|
? Object.entries(region.attributes)
|
|
8433
8451
|
.map(function (_a) {
|
|
8434
8452
|
var k = _a[0], v = _a[1];
|
|
8435
|
-
return k
|
|
8453
|
+
return "".concat(k, "=").concat(v.join(','));
|
|
8436
8454
|
})
|
|
8437
8455
|
.join(';')
|
|
8438
8456
|
: '.';
|