vendor: 4,946 bytes, line 1
1(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-common"],{"01b3":function(t,e,n){},"01d3":function(t,e,n){},"01db":function(t,e,n){"use strict";n("d14c")},"0241":function(t,e,n){"use strict";n("28fb")},"02b9":function(t,e,n){},"03ce":function(t,e,n){},"0542":function(t,e,n){"use strict";n("57ae")},"0571":function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"g",(function(){return p})),n.d(e,"f",(function(){return f})),n.d(e,"e",(function(){return _})),n.d(e,"b",(function(){return m})),n.d(e,"c",(function(){return b}));var r=n("53ca"),a=n("1da1"),i=n("5530"),o=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("3ca3"),n("5319"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("e60d")),s=n("ae39");function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Prom
1ise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var c="https://cvdi.hugeampkpnbi.org";function u(t){return Object(o["c"])(t,!1,c)}function d(t,e){return Object(o["g"])(t,e,c)}function h(t,e){return Object(o["h"])(t,e,c)}function p(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(o["f"])(t,e,Object(i["a"])(Object(i["a"])({},n),{},{host:c}))}function f(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(o["e"])(t,e,Object(i["a"])(Object(i["a"])({},n),{},{host:c}))}function _(){return g.apply(this,arguments)}function g(){return g=Object(a["a"])(l().mark((function t(){var e,n,r,a,i;return l().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e="https://hugeampkpncms.org/sites/default/files/phenotypes_with_labels.csv",n="https://hugeampkpncms.org/servedata/dataset?dataset=".concat(e),t.next=4,fetch(n).then((function(t){return t.text()}));case 4:return r=t.sent,r=r.replace(/\\u0022/g,'"').replace(/\\\//g,"/").replace(/\\n
vendor: 4,456 bytes, line 1
1/g,"\n").replace(/\\r/g,"\r"),r=r.substring(1,r.length-1),a=s["a"].csv2Json(r),i={},a.forEach((function(t){var e="phecode_".concat(t.phenotype);t.phenotype=e,t.phenotype_name=t.description,i[e]=t})),t.abrupt("return",i);case 11:case"end":return t.stop()}}),t)}))),g.apply(this,arguments)}var m="mouse_msigdb",v=2,y="small",b="jurgens_exomes",x={jurgens_exomes:"Jurgens Exomes",jurgens_exomes___portal:"Jurgens Exomes - Portal",jurgens_exomes___gcat_trait:"Jurgens Exomes - GCAT"};e["d"]={query:p,match:f,apiUrl:u,request:h,rawUrl:d,getPhecodeMap:_,BIO_INDEX_HOST:c,DEFAULT_MODEL:m,DEFAULT_SIGMA:v,DEFAULT_GENESET_SIZE:y,DEFAULT_TRAIT_GROUP:b,TRAIT_GROUPS:x}},"0619":function(t,e,n){"use strict";n("3929")},"06a9":function(t,e,n){"use strict";n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return m})),n.d(e,"c",(function(){return v}));n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("4ae1"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0");var r=n("53ca"),a=n("1da1"),i=n("d4ec"),o=n("bee2"),s=n("99de"),l=n("d967"),c=n("7e84"),u=n("262e"),d=(n("a15b"),n("d3b7"),n("a8a4")),h=n("e60d"),p=(n("98ab"),n("b44a"));function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=h(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function _(t,e,n){return e=Object(c["a"])(e),Object(s["a"])(t,Object(l["a"])()?Reflect.construct(e,n||[],Object(c["a"])(t).constructor):e.apply(t,n))}var g={height:240,min_height:240},m=function(t){function e(t){return Object(i["a"])(this,e),_(this,e,[t])}return Object(u["a"])(e,t),Object(o["a"])(e,[{key:"parseInit",value:function(t){var e=t.index,n=t.queryStringMaker,r=t.translator,a=t.onLoad,i=t.onResolve,o=t.onError;this.params=t,this.queryStringMaker=n,this.index=e,this.translator=r,this.onLoad=a,this.onResolve=i,this.onError=o}},{key:"getCacheKey",value:function(t){return[t.chr,t.start,t.end].join("_")}},{key:"fetchRequest",value:function(t,e,n){var r=this;return new Promise((function(e,n){r.initialData?(e(r.translator(r.initialData)),r.initialData=null):Object(h["f"])(r.index,r.queryStringMaker(t.chr,t.start,t.end),{}).then(function(){var t=Object(a["a"])(f().mark((function t(n){return f().wrap((function(t){while(1)switch(t.prev=t.next){case 0:r.onLoad&&r.onLoad(n),e(r.translator(n));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}))}}])}(d["BaseAdapter"]),v=new p["a"]},"06b0":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container"},[n("div",{staticClass:"center"},[n("b-table-simple",{attrs:{borderless:"",fixed:"",small:""}}
1,[n("b-tbody",[n("b-tr",[n("b-th",{staticStyle:{width:"150px"}}),n("b-td",{staticClass:"text-center",staticStyle:{width:"75px","background-color":"#D3DBED"}},[t._v(t._s(t.commonBF))]),n("b-td",{staticClass:"text-left",staticStyle:{width:"200px",color:"gray"}},[t._v("<--Common Variation BF")])],1),n("b-tr",{staticStyle:{border:"3px solid white !important"}},[n("b-th",{staticClass:"text-right",staticStyle:{width:"150px"},attrs:{rowspan:"1"}},[t._v("X")]),n("b-td",{staticClass:"text-center",staticStyle:{width:"75px","background-color":"#fef8dc"}},[t._v(t._s(t.rareBF))]),n("b-td",{staticClass:"text-left",staticStyle:{width:"200px",color:"gray"}},[0==this.exomeSignificant?n("span",{staticStyle:{"white-space":"nowrap"}},[t._v(" <--Rare Variation BF "),n("a",{attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.$bvModal.show("exampleModal")}}},[t._v("(Reset Prior Allelic variance)")])]):n("span",[t._v("<--Rare Variation BF")]),n("reset-prior-widget",{attrs:{beta:3,rareBF:this.rareBF}})],1)],1)],1),n("b-tfoot",[n("b-tr",[n("b-th",{staticClass:"text-right",staticStyle:{width:"150px","white-space":"nowrap"},attrs:{rowspan:"1"}},[t._v("HuGE Score:")]),n("b-td",{staticClass:"text-center",staticStyle:{width:"100px","border-top":"0.25px solid","border-color":"#D0D0D0","border-width":"thin","background-color":"#c4edc8"},attrs:{colspan:"1"}},[n("b",[t._v(t._s(t.hugeScore))])])],1)],1)],1)],1)])},a=[],i=(n("14d9"),n("b0c0"),n("a9e3"),n("2b0e")),o=n("5f5b"),s=n("b1e0"),l=n("d726"),c=n("bb0b"),u=(n("be00"),n("f9e3"),n("2dd8"),n("e60d"),n("529c")),d=(n("1157"),n("a282"));i["default"].use(o["a"]),i["default"].use(s["b"]),i["default"].component("vue-typeahead-bootstrap",l["a"]),i["default"].component("autocomplete",c["a"]);var h=i["default"].component("hugescore-table",{props:{commonBF:{type:Number,required:!0,default:1},rareBF:{type:Number,required:!0,default:1},hugeScore:{type:Number,required:!0,default:1},exomeSignificant:{type:Boolean,required:!0,default:!1}},modules:{uiUtils:d["a"],Formatters:u["a"]},data:function(){return{modalShow:!1}},computed:{hugescore:function(){return this.hugeScore}},methods:{handleOk:function(t){t.preventDefault(),this.handleSubmit()},handleSubmit:function(){var t=this;this.checkFormValidity()&&(this.submittedNames.push(this.name),this.$nextTick((function(){t.$bvModal.hide("modal-prevent-closing")})))}}}),p=h,f=(n("547b"),n("2877")),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},"06df":function(t,e,n){"use strict";var r=n("2909"),a=(n("99af"),n("4de4"),n("caad"),n("d81d"),n("13d5"),n("fb6a"),n("4fad"),n("b64b"),n("d3b7"),n("4d63"),n("c607"),n("ac1f"),n("2c3e"),n("25f0"),n("2532"),n("a1f0"),n("5319"),n("498a"),n("0643"),n("2382"),n("a573"),n("9d4a"),n("7c5c")),i=n("c0c4"),o=n.n(i);function s(t){var e=/{{([A-Za-z]+)}}/g;return t?Object(r["a"])(t.matchAll(e)).map((function(t){return t[0]?t[0].slice(2,-2):"?"})):[]}function l(t,e){var n=Object.entries(t||{});return e&&(n=n.filter((function(t){return e.includes(t[0])}))),n.map((function(t){return{regex:new RegExp("{{".concat(t[0],"}}"),"g"),replace:String(t[1])}}))}function c(t){var e={h1:"doc large-header",h2:"doc medium-header",h3:"doc small-header",h4:"doc x-small-header",p:"doc content",ul:"doc list",li:"doc item",em:"doc italic",strong:"doc bold",a:"doc link"},n=String(t||""),r=Object.keys(e).map((function(t){return{regex:new RegExp("<".concat(t,"(\\s[^>]*)?>"),"g"),replace:function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=a.trim(),o=i?" ".concat(i):"";return"<".concat(t,' id="').concat(n,'" class="').concat(e[t],'"').concat(o,">")}}}));return r}function u(t,e){return e.reduce((function(t,e){return t.replace(e.regex,e.replace)}),t)}function d(t,e,n){var r=s(t),i=l(e,r),d=c(n);return{makeHtml:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=u(String(t),i),n=a["marked"].parse(e,{gfm:!0,breaks:!1}),r=u(String(n),d);return o.a.sanitize(r)}}}e["a"]={makeExtensions:l,findTemplateTagsFromContent:s,makeConverter:d}},"06eb":function(t,e,n){},"06f4":function(t,e,n){},"08f0":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"volcano-plot-content"},[n("div",{staticClass:"clicked-dot-value hidden",attrs:{id:"clicked_dot_value"+t.sectionId}}),t.renderConfig?n("canvas",{staticClass:"volcano-plot",style:"width:"+(t.renderConfig.width+120)+"px;height:"+(t.renderConfig.height+120)+"px;",attrs:{id:"volcanoPlot"+t.sectionId,width:2*t.renderConfig.width+240,height:2*t.renderConfig.height+240},on:{mouseleave:t.hidePanel,mousemove:t.checkPosition,click:t.filterTable}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_volcanoPlot","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("volcanoPlot"+t.sectionId,t.sectionId+"_volcanoPlot","png")}}},[t._v("Download PNG")])])])]),t.renderData?n("research-volcano-plot-vector",{ref:t.sectionId+"_volcanoPlot",attrs:{renderData:t.renderData,renderConfig:t.renderConfig,margin:t.adjPlotMargin,sectionId:t.sectionId,utils:t.utils}}):t._e(),t.renderConfig.label?n("div",{staticClass:"volcano-plot-label",domProps:{innerHTML:t._s(t.renderConfig.label)}}):t._e()],1)},a=[],i=n("f31a"),o=i["a"],s=(n("7413"),n("2877")),l=Object(s["a"])(o,r,a,!1,null,null,null);e["a"]=l.exports},"0d06":function(t,e,n){"use strict";n("99af"),n("ac1f"),n("466d"),n("498a");
1var r=/^(?:chr)?(1\d?|2[0-2]?|[3-9]|x|y|xy|mt?)[:_\-](\d+)[:_\-]([agct]+)[:_/\-]([agct]+)$/i,a=/^rs\d+$/;function i(t){var e=t.trim().match(a),n=t.trim().match(r);if(e)return t;if(n){var i=n[1].toUpperCase(),o=parseInt(n[2]),s=n[3].toUpperCase(),l=n[4].toUpperCase(),c="".concat(i,":").concat(o,":").concat(s,":").concat(l);return c}}function o(t){var e=t.split(":");return"".concat(e[0],":").concat(e[1],"_").concat(e[2],"/").concat(e[3])}e["a"]={parseVariant:i,gaitVariant:o}},"0d6a":function(t,e,n){"use strict";n("5778")},"0e28":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"research-data-table-features-wrapper"},t._l(t.featuresFormat["features"],(function(e,r){return n("div",{key:r,staticClass:"research-data-table-features",attrs:{"v-if":!!t.featuresData&&!!t.featuresFormat["features"]}},[n("table",{staticClass:"table table-sm feature-table"},[n("tr",[n("th",{staticClass:"byor-tooltip",class:"feature-title-th feature-th-"+r,attrs:{rowspan:t.featuresData[e].length+1}},[n("span",{staticClass:"feature-title"},[t._v(t._s(e))])]),t._l(t.featuresFormat[e],(function(e,a){return n("th",{key:a,staticClass:"byor-tooltip",class:"feature-th-"+r},[n("span",{domProps:{innerHTML:t._s(e)}}),t.featuresFormat["tool tips"]&&t.featuresFormat["tool tips"][e]?n("span",{staticClass:"tooltiptext",domProps:{innerHTML:t._s(t.featuresFormat["tool tips"][e])}}):t._e()])}))],2),t._l(t.featuresData[e],(function(r,a){return n("tr",{key:a},[t._l(t.featuresFormat[e],(function(i){return[t.summarySection&&a<t.featureRowsNumber&&t.featuresFormat[e].includes(i)?n("td",{key:i,domProps:{innerHTML:t._s(t.formatValue(r[i],i))}}):t._e(),!t.summarySection&&t.featuresFormat[e].includes(i)?n("td",{key:i,domProps:{innerHTML:t._s(t.formatValue(r[i],i))}}):t._e()]})),t.summarySection&&a==t.featureRowsNumber?n("td",{staticStyle:{color:"red","text-align":"center"},attrs:{colspan:"100"}},[t._v(" There are "+t._s(r.featureRows-t.featureRowsNumber)+" more rows of evidence data. Click to 'Set summary table' button to set the number of visible evidence data rows.")]):t._e()],2)}))],2)])})),0)},a=[],i=(n("caad"),n("d81d"),n("2532"),n("a573"),n("2b0e")),o=i["default"].component("research-data-table-features",{props:["featureRowsNumber","featuresData","featuresFormat","phenotypeMap","utils","summarySection"],data:function(){return{}},modules:{},components:{},created:function(){},beforeMount:function(){},mounted:function(){},updated:function(){},computed:{dataScores:function(){var t=this;if(this.featuresData&&this.featuresFormat&&void 0!=this.featuresFormat["column formatting"]){var e={},n=this.featuresFormat["column formatting"];for(var r in n)(n[r].type.includes("render background percent")||n[r].type.includes("render background percent negative"))&&(e[r]={high:null,low:null});return this.featuresFormat["features"].map((function(r){t.featuresData[r].map((function(t){for(var r in e){var a="number"!=typeof t[r]?n[r]["percent if empty"]:t[r];e[r].high=null==e[r].high||e[r].high<a?a:e[r].high,e[r].low=null==e[r].low||e[r].low>a?a:e[r].low}}))})),e}}},watch:{},methods:{getAllEvidence:function(){},formatValue:function(t,e){var n;if(this.featuresFormat&&this.featuresFormat["column formatting"]&&this.featuresFormat["column formatting"][e]){var r=this.featuresFormat["column formatting"][e].type;n=r.includes("render background percent")||r.includes("render background percent negative")?this.utils.Formatters.BYORColumnFormatter(t,e,this.featuresFormat,null,this.dataScores):r.includes("kp phenotype link")?this.utils.Formatters.BYORColumnFormatter(t,e,this.featuresFormat,this.phenotypeMap,null):this.utils.Formatters.BYORColumnFormatter(t,e,this.featuresFormat,null,null)}else n=t;return n}}}),s=o,l=(n("f278"),n("2877")),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},"0e37":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"chart-wrapper"},[t.summaryPlot["title"]?n("div",[n("h4",[t._v(t._s(t.summaryPlot["title"]))])]):t._e(),"multi"==t.summaryPlot.type?n("research-multi-plot",{attrs:{summaryPlot:t.summaryPlot,rawData:t.rawData}}):n("div",{staticClass:"all-charts"})],1)},a=[],i=n("5530"),o=(n("99af"),n("4de4"),n("d81d"),n("14d9"),n("13d5"),n("6b93"),n("a9e3"),n("d3b7"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("9d4a"),n("159b"),n("ddb0"),n("2b0e")),s=n("5698"),l=(n("1157"),n("a282")),c=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"chart-wrapper"},[n("div",{attrs:{id:"multi-chart"}},[t.selectableGenes.length>0?n("h4",[t._v("Make a selection to view the violin plot.")]):n("h4",[t._v("Pending!")])]),t.selectableGenes.length>0?n("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedGene,expression:"selectedGene"}],attrs:{id:"select-gene"},on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,
1(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.selectedGene=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:""}},[t._v("Select gene")]),t._l(t.selectableGenes,(function(e){return n("option",{domProps:{value:e}},[t._v(t._s(e))])}))],2):t._e()])},u=[],d=(n("fb6a"),n("b64b"),n("bc8f")),h=o["default"].component("research-multi-plot",{props:["rawData","summaryPlot"],data:function(){return{selectableGenes:[],selectedGene:"",chart:null,chartWidth:null}},mounted:function(){var t=this;this.chart=document.getElementById("multi-chart"),this.chartWidth=this.chart.clientWidth,this.$props.summaryPlot.type,this.$props.summaryPlot["selectable genes"]&&(this.selectableGenes=this.$props.summaryPlot["selectable genes"]),this.displayResults(),addEventListener("resize",(function(e){t.chartWidth=t.chart.clientWidth,t.displayResults()}))},computed:{},watch:{rawData:function(){this.displayResults()},selectedGene:function(){this.displayResults()}},methods:Object(i["a"])(Object(i["a"])({},l["a"]),{},{displayResults:function(){""!=this.selectedGene?this.displayResultsForGene(this.selectedGene):0==this.selectableGenes.length&&this.displayResultsNoSelectable()},displayResultsForGene:function(t){if(""!=t){var e=this.$props.summaryPlot,n=this.$props.rawData;if(e["extra header rows"]){var r=e["extra header rows"];r>0&&(n=n.slice(r))}var a=e["render by"],i={top:10,right:30,bottom:this.getBottomMargin(n,a),left:40},o=this.chartWidth-i.left-i.right,l=e.height-i.top-i.bottom;this.chart.innerHTML="";var c=s["select"]("#multi-chart").append("svg").attr("width",o+i.left+i.right).attr("height",l+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")"),u=s["scaleBand"]().range([0,o]).domain(n.map((function(t){return t[a]}))).padding(.05);c.append("g").attr("transform","translate(0,".concat(l,")")).call(s["axisBottom"](u)).selectAll("text").style("text-anchor","start").attr("transform","rotate(45)");var h=n.map((function(e){return e[t]})).reduce((function(t,e){return t>e?t:e})),p=s["scaleLinear"]().domain([0,h]).range([l,0]);c.append("g").call(s["axisLeft"](p));var f=s["histogram"]().domain(p.domain()).thresholds(p.ticks(e["buckets"])).value((function(t){return t})),_=s["nest"]().key((function(t){return t[a]})).rollup((function(e){var n=e.map((function(e){return e[t]})),r=f(n);return r})).entries(n),g=0;for(var m in _){var v=_[m].value,y=v.map((function(t){return t.length})),b=s["max"](y);b>g&&(g=b)}var x=s["scaleLinear"]().range([0,u.bandwidth()]).domain([-g,g]),w=0;c.selectAll("myViolin").data(_).enter().append("g").attr("transform",(function(t){return"translate(".concat(u(t.key),",0)")})).append("path").datum((function(t){return t.value})).style("stroke","none").style("fill",(function(t){var e=d["a"][w];return w++,w>=d["a"].length&&(w=0),e})).attr("d",s["area"]().x0((function(t){return x(-t.length)})).x1((function(t){return x(t.length)})).y((function(t){return p(t.x0)})).curve(s["curveCatmullRom"]))}},displayResultsNoSelectable:function(){var t=this.$props.summaryPlot,e=this.$props.rawData;if(t["extra header rows"]){var n=t["extra header rows"];n>0&&(e=e.slice(n))}var r=t["render by"],a="expression";"vertical"==t["orientation"]&&(e=this.collateVertical(e,r,a));var i=t["stat fields"]?t["stat fields"]:null,o={top:10,right:30,bottom:this.getBottomMargin(e,r),left:40},l=this.chartWidth-o.left-o.right,c=t.height-o.top-o.bottom;this.chart.innerHTML="";var u=s["select"]("#multi-chart").append("svg").attr("width",l+o.left+o.right).attr("height",c+o.top+o.bottom).append("g").attr("transform","translate("+o.left+","+o.top+")"),d=s["scaleBand"]().range([0,l]).domain(e.map((function(t){return t[r]}))).paddingInner(1).paddingOuter(.5);u.append("g").attr("transform","translate(0,".concat(c,")")).call(s["axisBottom"](d)).selectAll("text").style("text-anchor","start").attr("transform","rotate(45)");var h,p=e.map((function(t){return t.max_TPM})).reduce((function(t,e){return t>e?t:e})),f=s["scaleLinear"]().domain([0,p]).range([c,0]);u.append("g").call(s["axisLeft"](f));var _=0;if(null!=i)h=s["nest"]().key((function(t){return t[r]})).rollup((function(t){var e=t.map((function(t){return t[i.q1]})),n=t.map((function(t){return t[i.median]})),r=t.map((function(t){return t[i.q3]})),a=r-e,o=t.map((function(t){return t[i.min]})),s=t.map((function(t){return t[i.max]})),l=t.map((function(t){return t[i.mean]}));return _++,{q1:e,median:n,q3:r,interQuantileRange:a,min:o,max:s,mean:l}}
1)).entries(e);else{var g=s["histogram"]().domain(f.domain()).thresholds(f.ticks(t["buckets"])).value((function(t){return t}));h=s["nest"]().key((function(t){return t[r]})).rollup((function(t){var e=t.map((function(t){return t[a]})),n=g(e);return n})).entries(e)}u.selectAll("vertLines").data(h).enter().append("line").attr("x1",(function(t){return d(t.key)})).attr("x2",(function(t){return d(t.key)})).attr("y1",(function(t){return f(t.value.min)})).attr("y2",(function(t){return f(t.value.max)})).attr("stroke","black").style("width",40);var m=l/_*.75;u.selectAll("boxes").data(h).enter().append("rect").attr("x",(function(t){return d(t.key)-m/2})).attr("y",(function(t){return f(t.value.q3)})).attr("height",(function(t){return f(t.value.q1)-f(t.value.q3)})).attr("width",m).attr("stroke","black").style("fill","#69b3a2"),u.selectAll("medianLines").data(h).enter().append("line").attr("x1",(function(t){return d(t.key)-m/2})).attr("x2",(function(t){return d(t.key)+m/2})).attr("y1",(function(t){return f(t.value.median)})).attr("y2",(function(t){return f(t.value.median)})).attr("stroke","black").style("width",80),u.selectAll("meanLines").data(h).enter().append("line").attr("x1",(function(t){return d(t.key)-m/2})).attr("x2",(function(t){return d(t.key)+m/2})).attr("y1",(function(t){return f(t.value.mean)})).attr("y2",(function(t){return f(t.value.mean)})).attr("stroke","white").style("width",80)},collateVertical:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"expression",r=Object.keys(t[0]).filter((function(t){return t!=e})),a=[];return r.forEach((function(r){t.forEach((function(t){var i={};i[e]=r,i[n]=t[r],a.push(i)}))})),a},getBottomMargin:function(t,e){var n=t.map((function(t){return t[e].length})).reduce((function(t,e){return t>e?t:e})),r=n<10?65:65*n/10;return r}})}),p=h,f=(n("d1ca"),n("2877")),_=Object(f["a"])(p,c,u,!1,null,null,null),g=(_.exports,o["default"].component("research-summary-plot",{props:["rawData","summaryPlot","isPlotByRow"],data:function(){return{}},mounted:function(){this.displayResults(this.$props.summaryPlot)},computed:{},watch:{rawData:function(){this.displayResults(this.$props.summaryPlot)}},methods:Object(i["a"])(Object(i["a"])({},l["a"]),{},{displayResults:function(t){var e=this;if("multi"!=t.type){var n=document.getElementsByClassName("all-charts")[0];n.innerHTML="",t.fields.forEach((function(t){var e=document.createElement("div");e.classList.add("chart"),e.classList.add("".concat(t,"-chart")),n.append(e)})),t.fields.forEach((function(n){e.renderChart(n,t)}))}},renderChart:function(t,e){var n=this.$props.rawData.map((function(e){return Number(e[t])})),r=e.buckets<n.length?e.buckets:n.length,a=t;e["data convert"]&&"-log10"==e["data convert"][t]&&(n=n.map((function(t){return-1*Math.log10(t)})),a="".concat(t," (-log10)"));var i=n.reduce((function(t,e){return t>e?t:e})),o=n.reduce((function(t,e){return t<e?t:e})),l=".".concat(t,"-chart"),c={top:25,right:10,bottom:35,left:29},u=e.width-c.left-c.right,d=e.height-c.top-c.bottom,h=s["select"](l).append("svg").attr("width",u+c.left+c.right).attr("height",d+c.top+c.bottom).append("g").attr("transform","translate("+c.left+","+c.top+")");if("violin"==e.type){var p=s["scaleLinear"]().domain([o,i]).range([d,0]);h.append("g").call(s["axisLeft"](p));var f=s["scaleBand"]().range([0,u]).domain([t]).padding(.05);h.append("g").attr("transform","translate(0,".concat(d,")")).call(s["axisBottom"](f));var _=s["histogram"]().domain(p.domain()).thresholds(p.ticks(r)).value((function(t){return t})),g=s["nest"]().key((function(t){return a})).rollup((function(t){return _(t)}
1)).entries(n),m=0;for(var v in g){var y=g[v].value,b=y.map((function(t){return t.length})),x=s["max"](b);x>m&&(m=x)}var w=s["scaleLinear"]().range([0,f.bandwidth()]).domain([-m,m]);h.selectAll("myViolin").data(g).enter().append("g").attr("transform",(function(t){return"translate (".concat(f(t.key),", 0)")})).append("path").datum((function(t){return t.value})).style("stroke","none").style("fill","orange").attr("d",s["area"]().x0((function(t){return w(-t.length)})).x1((function(t){return w(t.length)})).y((function(t){return p(t.x0)})).curve(s["curveCatmullRom"]))}else{for(var C=s["scaleLinear"]().domain([o,i]).range([0,u]),P=s["histogram"]().value((function(t){return t})).domain(C.domain()).thresholds(C.ticks(r)),k=P(n),M=s["max"](k,(function(t){return t.length})),E=(i-o)/r,D=[],O=function(t){var e=n.filter((function(e){return e>=t&&e<t+E})).length;D.push({bucketStart:t,bucketCount:e})},L=o;L<i;L+=E)O(L);var j=D.filter((function(t){return t==i})).length;D[D.length-1].bucketCount+=j;var S=D.map((function(t){return t.bucketCount})).reduce((function(t,e){return t>e?t:e})),A="histogram"==e.type?M:S,I=s["scaleLinear"]().domain([0,A]).range([d,0]);if(h.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")").call(s["axisBottom"](C).ticks(3)).selectAll("text").style("text-anchor","end"),h.append("g").attr("class","y axis").call(s["axisLeft"](I).ticks(3)).selectAll("text").style("text-anchor","end"),h.append("text").attr("text-anchor","start").attr("y",I(-.2*A)).attr("x",.5).text(a).style("font-weight","bold"),"histogram"==e.type)h.selectAll("rect").data(k).enter().append("rect").attr("x",1).attr("transform",(function(t){return"translate(".concat(C(t.x0),",").concat(I(t.length),")")})).attr("width",(function(t){return C(t.x1)-C(t.x0)})).attr("height",(function(t){return d-I(t.length)})).style("fill","orange");else if("line"==e.type){var T=s["line"]().x((function(t){return C(t.bucketStart)})).y((function(t){return I(t.bucketCount)})).curve(s["curveMonotoneX"]);h.append("path").datum(D).attr("class","chart-line").attr("d",T).attr("fill","none").attr("stroke","orange")}else"scatterplot"==e.type&&h.append("g").selectAll("dot").data(D.filter((function(t){return t.bucketCount>0}))).enter().append("circle").attr("cx",(function(t){return C(t.bucketStart)})).attr("cy",(function(t){return I(t.bucketCount)})).attr("r",1.5).style("fill","orange")}if(this.$props.isPlotByRow){var B=Math.floor(Math.random()*n.length),R=n[B];h.append("line").attr("x1",C(R)).attr("x2",C(R)).attr("y1",I(0)).attr("y2",I(n.length)).attr("stroke","grey").attr("stroke-dasharray","4");var F=R<o+i/2?"start":"end",G=this.$props.rawData[B];h.append("text").attr("text-anchor",F).attr("x",C(R)).attr("y",I(.75*yScaleTopEnd)).text(G.varId).style("font-size","smaller").style("color","grey")}}})})),m=g,v=(n("fcf8"),Object(f["a"])(m,r,a,!1,null,null,null));e["a"]=v.exports},"0fd5":function(t,e,n){"use strict";n("b57e")},"0fe9":function(t,e,n){},1203:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12 phewas-plot-wrapper"},[n("div",{staticClass:"col-md-12",staticStyle:{display:"inline-block"},attrs:{id:t.canvasId+"pheWasPlotWrapper"}},[n("div",{staticClass:"phe-was-info-box hidden",attrs:{id:t.canvasId+"pheWasInfoBox"}},[n("div",{staticClass:"fixed-info-box-close",attrs:{id:t.canvasId+"info_box_close"},on:{click:function(e){return t.utils.uiUtils.removeOnMouseOut(t.canvasId+"pheWasInfoBox",100)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("span",{attrs:{id:t.canvasId+"pheWasInfoBoxContent"}}),t._l(t.hoverItems,(function(e,r){return n("span",{key:r},[t.linkPhenotypes?n("strong",[n("a",{attrs:{href:t.phenotypeLink(r)}},[t._v(" "+t._s(t.phenotypeMap[r]&&t.phenotypeMap[r].description||r)+" ")])]):n("strong",[t._v(" "+t._s(t.phenotypeMap[r]&&t.phenotypeMap[r].description||r)+" ")]),n("br"),t._l(e.data,(function(e,r){return n("span",{key:r},[n("span",[t._v(t._s(r+": "))]),n("span",[t._v(t._s(e))]),t._v(" "),n("br")])})),null!=t.options&&1==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"pheWasInfoBox")?[t.options.includes("add phenotype")?n("button",{staticClass:"option-button",on:{click:function(n){return t.addPhenotype(e.id)}}},[t._v(" Add this phenotype below ")]):t._e(),t.options.includes("open phenotype page")?n("button",{staticClass:"option-button",on:{click:function(n){return t.openPage("phenotype.html",{phenotype:e.id})}}},[t._v(" Go to phenotype page ")]):t._e()]:t._e(),null!=t.options&&0==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"pheWasInfoBox")?n("span",[t._v("Click for options")]):t._e(),n("br")],2)}))],2),n("canvas",{attrs:{hidden:!t.showCanvas,id:t.canvasId+"pheWasPlot",width:"",height:""},on:{mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){!t.utils.uiUtils.isIdFixed("#"+t.canvasId+"pheWasInfoBox")&&t.utils.uiUtils.removeOnMouseOut(t.canvasId+"pheWasInfoBox",1e3)}}}),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.canvasId,t.canvasId+"_pheWasPlot","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage(t.canvasId+"pheWasPlot",t.canvasId+"_pheWasPlot","png")}}},[t._v("Download PNG")])])])]),t.renderData?n("research-phewas-plot-vector",{ref:t.canvasId+"_pheWasPlot",attrs:{renderData:t.groupData(t.renderData),renderConfig:t.renderConfig,phenotypeMap:t.phenotypeMap,colors:t.colors,margin:t.adjPlotMargin,sectionId:t.canvasId,utils:t.utils}}):t._e()],1)])])},a=[],i=n("f124"),o=i["a"],s=(n("25f9"),n("2877")),l=Object(s["a"])(o,r,a,!1,null,null,null);e["a"]=l.exports},1343:function(t,e,n){},1396:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12 genes-plot-wrapper"},[n("div",{},[n("div",{class:"region plot"==t.plotType?"col-md-9":"col-md-12",attrs:{id:"genesTrackWrapper"+t.sectionId}},[n("canvas",{attrs:{id:"genesTrack"+t.sectionId,width:"",height:""},on:{resize:t.onResize}})]),n("div",{class:"region plot"==t.plotType?"col-md-3":"",attrs:{id:"genesPEGWrapper"}})])])])},a=[],i=n("53ca"),o=n("1da1"),s=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("d81d"),n("14d9"),n("fb6a"),n("b0c0"),n("a9e3"),n("0c47"),n("23dc"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),l=n("1157"),c=n.n(l),u=n("b1e0");function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
1function E(t,e){function n(a,o,s,l){var c=p(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}s["default"].use(u["a"]);var h=s["default"].component("research-genes-track",{props:["region","genesData","plotConfig","plotType","plotMargin","regionZoom","regionViewArea","utils","sectionId","starItems"],data:function(){return{plotRendered:0,localGenesData:null}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize),this.genesData?this.renderTrack(this.genesData):this.getGenesInRegion(this.region)},created:function(){},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{adjPlotMargin:function(){var t=this.plotConfig["plot margin"]?this.plotConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},searchingRegion:function(){var t={},e=this.region.split(":")[1].split("-");return t["start"]=e[0],t["end"]=e[1],t},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},codingGenes:function(){var t=this.genesData;return t}},watch:{codingGenes:function(t){this.renderTrack(this.genesData)},viewingRegion:{handler:function(t,e){this.genesData?this.renderTrack(this.genesData):this.getGenesInRegion(t.chr+":"+t.start+"-"+t.end)},deep:!0,immediate:!0},starItems:function(t){this.genesData?this.renderTrack(this.genesData):this.renderTrack(this.localGenesData)}},methods:{onResize:function(t){this.genesData?this.renderTrack(this.genesData):this.renderTrack(this.localGenesData)},renderTrack:function(t){var e=this;if(document.getElementById("genesTrackWrapper"+this.sectionId)){var n,r,a=t,i=60;n=this.plotConfig.width?2*this.plotConfig.width+this.adjPlotMargin.left+this.adjPlotMargin.right:2*document.getElementById("genesTrackWrapper"+this.sectionId).clientWidth-60;var o="region plot"==this.plotType?n-2*this.adjPlotMargin.left:n-(this.adjPlotMargin.left+this.adjPlotMargin.right),s=Number(this.viewingRegion.start),l=Number(this.viewingRegion.end),c=this.adjPlotMargin.left,u=(this.adjPlotMargin.top,o/(l-s)),d=[],h=0;a.map((function(t){if(t.start<=l&&t.end>=s){var e=t.start>s?c+(t.start-s)*u:c,n=t.end<l?c+(t.end-s)*u:c+(l-s)*u,r=!1;d.map((function(t){(e>=t.start&&e<=t.end||n>=t.start&&n<=t.end)&&(r=!0)})),0!=d.length&&1==r&&(d=[],h++),d.push({start:e-100,end:n+100})}})),r=this.adjPlotMargin.top+i*(h+1);this.adjPlotMargin.bump;var p=document.getElementById("genesTrack"+this.sectionId);p.setAttribute("width",n),p.setAttribute("height",r),p.setAttribute("style","width:"+n/2+"px;
1height:"+r/2+"px;");var f=p.getContext("2d");if(f.clearRect(0,0,n,r),f.beginPath(),f.lineWidth=1,f.strokeStyle="#000000",f.setLineDash([]),f.font="italic bold 24px Arial",f.textAlign="center",f.fillStyle="#000000",d=[],h=0,a.map((function(t){if(t.start<=l&&t.end>=s){var n=t.start>s?c+(t.start-s)*u:c,r=t.end<l?c+(t.end-s)*u:c+(l-s)*u,a=!1;d.map((function(t){(n>=t.start&&n<=t.end||r>=t.start&&r<=t.end)&&(a=!0)})),0!=d.length&&1==a&&(d=[],h++),d.push({start:n-100,end:r+100});var o=e.adjPlotMargin.top+h*i,p="â",_="â",g="+"==t.strand?t.gene_name+" "+_:p+" "+t.gene_name;f.fillText(g,n+(r-n)/2,o),f.beginPath(),f.lineWidth=1,f.strokeStyle="#000000",f.setLineDash([]),f.moveTo(n,o+20),f.lineTo(r,o+20),f.stroke(),t.exons.map((function(t){if(t.start<l&&t.end>s){var e=t.start>s?c+(t.start-s)*u:c,n=t.end<l?c+(t.end-s)*u:c+(l-s)*u,r=n-e<=1?1:n-e;f.fillRect(e,o+10,r,20)}}))}})),this.starItems){var _=this.adjPlotMargin.top-3*this.adjPlotMargin.bump,g=this.adjPlotMargin.top+t.length*i;this.starItems.map((function(t){var n=c+(t.columns[e.plotConfig["x axis field"]]-s)*u;e.utils.plotUtils.renderDashedLine(f,n,_,n,g,3,"#FFAA0055",[6,2])}))}}},getGenesInRegion:function(t){var e=this;return Object(o["a"])(d().mark((function n(){var r,a,i,o;return d().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="https://bioindex.hugeamp.org/api/bio/query/genes?q="+t,n.next=3,fetch(r).then((function(t){return t.text(r)}));case 3:a=n.sent,null==a.error&&(i=JSON.parse(a),o="",i["data"]&&i["data"].length>1&&(i["data"].map((function(t){(t.type="protein_coding")&&(o+="'"+t.name+"',")})),o=o.slice(0,-1),o.length>1&&e.getGenesData(o)));case 5:case"end":return n.stop()}}),n)})))()},getGenesData:function(t){var e=this;return Object(o["a"])(d().mark((function n(){var r,a;return d().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.plotConfig["genome reference"]&&"GRCh38"==e.plotConfig["genome reference"]?r="https://portaldev.sph.umich.edu/api/v1/annotation/genes/?filter=source in 1 and gene_name in "+t:e.plotConfig["genome reference"]&&(!e.plotConfig["genome reference"]||"GRCh37"!=e.plotConfig["genome reference"]&&"hg19"!=e.plotConfig["genome reference"])||(r="https://portaldev.sph.umich.edu/api/v1/annotation/genes/?filter=source in 3 and gene_name in "+t),n.next=3,fetch(r).then((function(t){return t.text(r)}));case 3:a=n.sent,null==a.error&&(e.localGenesData=JSON.parse(a).data,e.renderTrack(e.localGenesData));case 5:case"end":return n.stop()}}),n)})))()}}});c()((function(){}));var p=h,f=(n("4ea0"),n("2877")),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},1411:function(t,e,n){"use strict";n("6972")},"145e2":function(t,e,n){"use strict";n("d1be")},"155a":function(t,e,n){},1734:function(t,e,n){"use strict";n("61cc")},1812:function(t,e,n){"use strict";var r=n("2909"),a=n("3835"),i=(n("99af"),n("cb29"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("a9e3"),n("4fad"),n("b64b"),n("d3b7"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("0643"),n("2382"),n("a573"),n("ddb0"),n("529c")),o=["#007bff75","#04884575","#8490C875","#BF61A575","#EE312475","#FCD70075","#5555FF75","#7aaa1c75","#9F78AC75","#F8808475","#F5A4C775","#CEE6C175","#cccc0075","#6FC7B675","#D5A76875","#d4d4d475"],s=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=o;return t||(e=e.map((function(t){return t.slice(0,-2)}))),e},l=function(t,e,n,r,a){t.fillStyle=r,t.lineWidth=0,t.beginPath();var i=a||8;t.arc(e,n,i,0,2*Math.PI),t.fill()},c=function(t,e,n,r,a,i){t.beginPath(),t.lineWidth=2,t.strokeStyle=i,t.moveTo(e,n),t.lineTo(r,a),t.stroke()},u=function(t,e,n,r,a,i,o,s){t.beginPath(),t.lineWidth=i||2,t.strokeStyle=o||"#FFAA00";var l=s||[20,10];t.setLineDash(l),t.moveTo(e,n),t.lineTo(r,a),t.stroke(),t.setLineDash([])},d=function(t,e,n,r,i,s,u,d,h,p){t.beginPath(),t.lineWidth=1,t.font="24px Arial",t.setLineDash([]);for(var f={},_=0,g=Object.entries(u);_<g.length;_++){var m=Object(a["a"])(g[_],2),v=m[0],y=m[1];f[v]=[];for(var b=0,x=Object.entries(y);b<x.length;b++){var w=Object(a["a"])(x[b],2),C=w[0];w[1];f[v].push(C)}}for(var P=null,k=0,M=Object.entries(f);k<M.length;k++){var E=Object(a["a"])(M[k],2),D=(E[0],E[1]);P=null==P||D>P?D.length:P}var O=Math.ceil(h),L=Math.floor(d);switch(i){case"x":for(var j=(e-r.left-r.right)/P,S=(n-r.top-r.bottom)/(O-L),A=n-r.bottom,I=0,T=0,B=Object.entries(u);T<B.length;T++){var R=Object(a["a"])(B[T],2),F=R[0],G=R[1],W=0;t.strokeStyle=o[I],t.fillStyle=o[I];for(var U=null,q=null,N=0,K=Object.entries(G);N<K.length;N++){var V=Object(a["a"])(K[N],2),z=(V[0],V[1]),$=r.left+W*j,H=r.left+(W+1)*j,Y=$+(H-$)/2,Z=A-(z-L)*S;if(l(t,Y,Z,o[I]),null!=U&&null!=q&&c(t,Y,Z,U,q,o[I]),0==W){var X=void 0,J=void 0;p?(t.font="28px Arial",X=j+r.left,J=20*I+r.top+28,l(t,X,J,o[I]),X+=20,J+=10):(t.font="24px Arial",X=Y,J=Z-14),t.fillStyle="#000000",t.textAlign="start",t.fillText(F,X,J)}U=Y,q=Z,W++}I++}break;case"y":break}},h=function(t,e,n,r,i){for(var s=-Math.PI/2,l=0,c=Object.keys(e),u=n/2,d=r/2,h=0,p=Object.entries(e);h<p.length;h++){var f=Object(a["a"])(p[h],2),_=(f[0],f[1]);l+=_}for(var g=0;g<c.length;g++){t.fillStyle="single"==i?o[0]:o[g%o.length],t.strokeStyle="white",t.lineWidth=1,t.beginPath(),t.moveTo(u,d),t.arc(u,d,d,s,s+2*Math.PI*(e[c[g]]/l),!1),t.lineTo(u,d),t.fill(),t.stroke(),t.fillStyle="#000000",t.textAlign="center",t.textBaseline="middle";var m=e[c[g]]/l*2*Math.PI,v=s+m/2,y=u+Math.cos(v)*(d/1.5),b=d+Math.sin(v)*(d/1.5);t.font="24px Arial",t.fillText(c[g],y,b-14),t.font="28px Arial",t.fillText(e[c[g]],y,b+14),s+=2*Math.PI*(e[c[g]]/l)}},p=function(t,e,n,r,a,i,s,l,c,u,d){t.beginPath(),t.lineWidth=.5,t.strokeStyle="#000000",t.font="24px Arial",t.fillStyle="#000000",t.setLineDash([]);var h=Object.keys(s),p=h.length,f=(e-r.left-r.right-u*(p+1))/p,_=(e-r.left-r.right)/p-2;f=f<=4?_:f;var g=Math.ceil(c),m=Math.floor(l);switch(a){case"x":for(var v=(e-r.left-r.right-2*u)/p,y=0;y<p;y++){var b=r.left+u+y*v,x=r.left+u+(y+1)*v,w=b+(x-b)/2,C=Math.floor(w)+.5;t.fillStyle="single"==d?o[0]:o[y%o.length];var P=(s[h[y]]-m)/(g-m)*(n-r.top-r.bottom);t.fillRect(C-f/2,n-r.bottom-P,f,P),t.font="28px Arial",t.fillStyle="#000000",t.fillText(s[h[y]],C,n-r.bottom-P-r.bump)}break;case"y":break}},f=function(t,e,n,r,a,i,o,s){switch(t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="24px Arial",t.fillStyle="#000000",t.setLineDash([]),a){case"x":for(var l=(e-r.left-r.right-2*o)/i.length,c=0;c<i.length;c++){var u=r.left+o+c*l,d=r.left+o+(c+1)*l,h=u+(d-u)/2,p=Math.floor(h);t.moveTo(p,n-r.bottom),t.lineTo(p,n-r.bottom+r.bump),t.stroke(),t.textAlign="center";var f=i[c];null==s?t.fillText(f,p,n-r.bottom+4*r.bump):(t.save(),t.translate(p,n-r.bottom+4*r.bump-12),t.rotate(s*-Math.PI/180),t.textAlign="end",t.fillText(f,0,0),t.restore(
1))}break;case"y":for(var _=(n-r.top-r.bottom-2*o)/i.length,g=0;g<i.length;g++){var m=r.top+o+g*_,v=r.top+o+(g+1)*_,y=m+(v-m)/2,b=Math.floor(y);t.moveTo(r.left,b),t.lineTo(r.left-r.bump,b),t.stroke(),t.textAlign="right";var x=i[g];t.fillText(x,r.left-2*r.bump,b+6)}break}},_=function(t,e,n,r,a,o,s,l){var c=l,u=s,d=c-u,h=d<=1?2:d<=10?1:0;switch(t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="24px Arial",t.fillStyle="#000000",t.setLineDash([]),a){case"x":if(t.moveTo(r.left,n-r.bottom),t.lineTo(e-r.right,n-r.bottom),t.stroke(),null!=o)for(var p=(c-u)/o,f=(e-r.left-r.right)/o,_=0;_<=o;_++){var g=r.left+_*f,m=Math.floor(g);t.moveTo(m,n-r.bottom),t.lineTo(m,n-r.bottom+r.bump),t.stroke(),t.textAlign="center";var v=_<o?i["a"].decimalFormatter(u+_*p,h):i["a"].decimalFormatter(c,h);t.fillText(v,m,n-r.bottom+4*r.bump)}break;case"y":if(t.moveTo(r.left,r.top),t.lineTo(r.left,n-r.bottom),t.stroke(),null!=o)for(var y=(c-u)/o,b=(n-r.top-r.bottom)/o,x=0;x<=o;x++){var w=r.top+x*b,C=Math.floor(w);t.moveTo(r.left,C),t.lineTo(r.left-r.bump,C),t.stroke(),t.textAlign="right";var P=x==o?i["a"].decimalFormatter(u,h):i["a"].decimalFormatter(c-x*y,h);t.fillText(P,r.left-2*r.bump,C+6)}break}},g=function(t,e,n,r,a,o,s,l,c){var u=l,d=s,h=u-d,p=h<=n/100?2:h<=n/10?1:0;switch(t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="24px Arial",t.fillStyle="#000000",t.setLineDash([]),a){case"x":if(t.moveTo(r.left-r.bump,n+r.bump-r.bottom),t.lineTo(e+r.bump-r.right,n+r.bump-r.bottom),t.stroke(),null!=o)for(var f=(u-d)/o,_=(e-r.left-r.right)/o,g=0;g<=o;g++){var m=r.left+g*_,v=Math.floor(m);t.moveTo(v,n-r.bottom+r.bump),t.lineTo(v,n-r.bottom+2*r.bump),t.stroke(),t.textAlign="center";var y=g<o?i["a"].decimalFormatter(d+g*f,p):i["a"].decimalFormatter(u,p);t.fillText(y,v,n-r.bottom+5*r.bump)}if(null!=c){var b=e/2,x=n-2*r.bump;t.font="24px Arial",t.fillStyle="#000000",t.save(),t.textAlign="center",t.fillText(c,b,x),t.restore()}break;case"y":if(t.moveTo(r.left-r.bump,r.top-r.bump),t.lineTo(r.left-r.bump,n+r.bump-r.bottom),t.stroke(),null!=o)for(var w=(u-d)/o,C=(n-r.top-r.bottom)/o,P=0;P<=o;P++){var k=r.top+P*C,M=Math.floor(k);t.moveTo(r.left-r.bump,M),t.lineTo(r.left-2*r.bump,M),t.stroke(),t.textAlign="right";var E=P==o?i["a"].decimalFormatter(d,p):i["a"].decimalFormatter(u-P*w,p);t.fillText(E,r.left-3*r.bump,M+6)}if(null!=c){var D=30,O=r.top+(n-r.top-r.bottom)/2;t.font="24px Arial",t.fillStyle="#000000",t.save(),t.translate(D,O),t.rotate(90*-Math.PI/180),t.textAlign="center",t.fillText(c,0,0),t.restore()}break}},m=function(t,e,n,r,a,i,o,s){switch(t.beginPath(),t.lineWidth=1,t.setLineDash([]),a){case"x":if(null!=i)for(var l=(e-r.left-r.right)/i,c=0;c<=i;c++){var u=r.left+c*l,d=Math.floor(u);t.moveTo(d,r.top),t.lineTo(d,n-r.bottom),t.strokeStyle="#cccccc",t.stroke()}break;case"y":if(null!=i)for(var h=(n-r.top-r.bottom)/i,p=0;p<=i;p++){var f=r.top+p*h,_=Math.floor(f);t.moveTo(r.left,_),t.lineTo(e-r.right,_),t.strokeStyle="#cccccc",t.stroke()}break}},v=function(t,e,n,r,a,i,o,s){var l=Math.PI/2*3,c=e,u=n,d=Math.PI/r;t.beginPath(),t.moveTo(e,n-a);for(var h=0;h<r;h++)c=e+Math.cos(l)*a,u=n+Math.sin(l)*a,t.lineTo(c,u),l+=d,c=e+Math.cos(l)*i,u=n+Math.sin(l)*i,t.lineTo(c,u),l+=d;t.lineTo(e,n-a),t.closePath(),t.lineWidth=1,t.strokeStyle=o,t.stroke(),t.fillStyle=s,t.fill()},y=function(t,e,n,a,i,o,s,c,u,d,h,p){var f=e-a.left-a.right,_=n-a.top-a.bottom,g=f/(o-i),m=_/(c-s),y=h?Object(r["a"])(new Set(h.filter((function(t){return t.type==p})).map((function(t){return t.id})))):[];d.map((function(e){var n=e.xValue?e.xValue:e.x,r=e.yValue?e.yValue:e.y,o=a.left+g*(n-i),c=a.top+(_-(r-s)*m);y.includes(e.key)?v(t,o,c,5,10,6,u,u):l(t,o,c,u)}))},b=function(t,e,n,r,a,i,o,s,l,c){for(var u=[0,0,0,0],d=c.length,h=0;h<d;h++)u[0]+=c[h].xValue,u[1]+=c[h].yValue,u[2]+=c[h].xValue*c[h].xValue,u[3]+=c[h].xValue*c[h].yValue;var p=u[0]/d,f=u[1]/d,_=(u[3]-u[0]*f)/(u[2]-u[0]*p),g=f-_*p,m=a,v=_*m+g,y=i,b=_*y+g,x=e-r.left-r.right,w=n-r.top-r.bottom,C=x/(i-a),P=w/(s-o),k=r.left+C*(m-a),M=r.top+(w-(v-o)*P),E=r.left+C*(y-a),D=r.top+(w-(b-o)*P),O=l.length>7&&Number(l.slice(-2))<20,L=E-k,j=D-M,S=Math.sqrt(L*L+j*j),A=L/S,I=j/S,T=8,B=k+A*T,R=M+I*T;t.strokeStyle=O?"#00000005":"#000000",t.lineWidth=2,t.beginPath(),t.moveTo(B,R),t.lineTo(E,D),t.stroke(),t.beginPath(),t.arc(k,M,10,0,2*Math.PI),t.fillStyle=l,t.fill(),t.stroke()},x=function(t,e,n,r,a,i,o,s){var l={}
1,c=t-n.left-n.right,u=e-n.top-n.bottom,d=c/(a-r),h=u/(o-i);return s.map((function(t){var e=t.xValue,a=t.yValue,o=n.left+d*(e-r),s=n.top+(u-(a-i)*h);l[Math.round(s/2)]||(l[Math.round(s/2)]={}),l[Math.round(s/2)][Math.round(o/2)]||(l[Math.round(s/2)][Math.round(o/2)]=[]),l[Math.round(s/2)][Math.round(o/2)].push({key:t.key,hover:t.hover})})),l},w=function(t,e,n){for(var r=[],a=-5;a<=5;a++)for(var i=-5;i<=5;i++)void 0!=n[e+a]&&void 0!=n[e+a][t+i]&&(r=r.concat(n[e+a][t+i]));return r};e["a"]={renderAxis:_,renderAxisWBump:g,renderTicksByKeys:f,renderBars:p,renderPie:h,renderGuideLine:m,renderLine:d,renderDashedLine:u,renderStar:v,renderDot:l,renderDots:y,renderBestFitLine:b,getDotsPosData:x,getDotsInPos:w,plotColors:s}},"18c9":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"c2ct"}},[t.rows>0?n("div",[n("div",[n("div",{staticClass:"table-total-rows",domProps:{innerHTML:t._s("Total rows: "+t.rows)}}),n("div",{staticClass:"text-right mb-2"},[n("data-download",{attrs:{data:t.c2ctData,filename:"c2ct_"+t.phenotype}})],1)]),n("b-table",{attrs:{hover:"",small:"",responsive:"",items:t.tableData,fields:t.fields,"per-page":t.perPage,"current-page":t.currentPage},scopedSlots:t._u([{key:"head(posteriorProbability)",fn:function(e){return[n("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{title:"Higher means greater overlap."}},[t._v(t._s(e.label)+" ")])]}},{key:"head(Q)",fn:function(e){return[n("span",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{title:"This metric combines specificity and overlap probability. Higher means more confidence that the SNP overlaps a specific cell type."}},[t._v(t._s(e.label)+" ")])]}},{key:"head(variantSifter)",fn:function(){return[t._v(" Open Variant Sifter (region: lead SNP ± 200kb) ")]},proxy:!0},{key:"cell(tissue)",fn:function(e){return[n("a",{attrs:{href:"/tissue.html?tissue="+e.item.tissue}},[t._v(" "+t._s(t.tissueFormatter(e.item.tissue))+" ")])]}},{key:"cell(chromosome)",fn:function(e){return[t._v(" "+t._s(e.item.chromosome+":"+e.item.clumpStart+"-"+e.item.clumpEnd)+" ")]}},{key:"cell(overlapLeadSNP)",fn:function(e){return[n("a",{attrs:{href:"/variant.html?variant="+e.item.overlapLeadSNP}},[t._v(" "+t._s(e.item.overlapLeadSNP)+" ")])]}},{key:"cell(variantSifter)",fn:function(e){return[n("a",{attrs:{href:t.exploreVariantSifter(e.item)}},[n("button",{staticClass:"btn btn-primary btn-sm",attrs:{type:"button"}},[t._v(" Open ")])])]}}],null,!1,386489694)}),n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.rows,"per-page":t.perPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1):n("div",[n("b-alert",{staticClass:"text-center",attrs:{show:"",variant:"warning"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" No data available for this query. ")],1)],1)])},a=[],i=(n("4de4"),n("d3b7"),n("0643"),n("2382"),n("2b0e")),o=n("529c"),s=n("f529"),l=i["default"].component("c2ct-table",{components:{DataDownload:s["a"]},props:["c2ctData","filter","phenotype","isTissuePage"],data:function(){return{perPage:10,currentPage:1,sortByCorrelation:!1,fields:[{key:"tissue",label:"Tissue",formatter:o["a"].tissueFormatter,sortable:!0},{key:"biosample",label:"Biosample",sortable:!0},{key:"source",label:"Source",sortable:!0,formatter:o["a"].tissueFormatter},{key:"chromosome",label:"Clump start - end"},{key:"varTotal",label:"Variants",sortable:!0},{key:"overlapLeadSNP",label:"Overlap Lead SNP"},{key:"posteriorProbability",label:"Overlap probability",formatter:o["a"].tpmFormatter,sortable:!0},{key:"totalEntropy",label:"Genericity",formatter:o["a"].tpmFormatter,sortable:!0},{key:"Q",label:"Combined score",formatter:o["a"].tpmFormatter,sortable:!0},{key:"variantSifter",label:"variantSifter",sortable:!1,tdClass:"text-center"}]}},computed:{rows:function(){return this.tableData.length},tableData:function(){var t=this.c2ctData,e=this.filter;return e&&(t=t.filter((function(t){return e(t)}))),t}},methods:{pValueFormatter:o["a"].pValueFormatter,effectFormatter:o["a"].effectFormatter,intFormatter:o["a"].intFormatter,annotationFormatter:o["a"].annotationFormatter,tissueFormatter:o["a"].tissueFormatter,tpmFormatter:o["a"].tpmFormatter,exploreVariantSifter:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e5,n=1e4,r=t.overlapLeadSNP.split(":"),a=r[0],i=parseInt(r[1]),o=i-e;o=o<n?n:o;var s=i+e;return"/research.html?pageid=kp_variant_sifter&phenotype="+t.phenotype+"®ion="+a+":"+o+"-"+s}}}),c=l,u=(n("6772"),n("2877")),d=Object(u["a"])(c,r,a,!1,null,"139049c5",null);e["a"]=d.exports},1996:function(t,e,n){"use strict";n("06f4")},"1ab4":function(t,e,n){"use strict";var r=n("53ca"),a=n("5530"),i=n("1da1"),o=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("e9c4"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("72bf")),s=n.n(o);function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;
vendor: 5,344 bytes, line 1
1return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}
1var c="Application Error",u=function(){var t=Object(i["a"])(l().mark((function t(e,n,r){var i;return l().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=s.a.stringify(Object(a["a"])({action:n,category:e},r),{skipNull:!0}),t.next=3,fetch("/eventLog?".concat(i)).then((function(t){if(t)return t.data;throw new Error("Unknown outcome of Google Analytics Events Logging?")})).catch((function(t){}));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),d=function(){var t=Object(i["a"])(l().mark((function t(e,n,r){var a;return l().wrap((function(t){while(1)switch(t.prev=t.next){case 0:a={page:r,label:n},u(c,e,a);case 2:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),h=function(){var t=Object(i["a"])(l().mark((function t(e,n){return l().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return s.a.stringify({currentPage:e,previousPage:n},{skipNull:!0}),t.next=3,fetch("/pageview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPage:e,previousPage:n})}).then((function(t){if(t)return t.data;throw new Error("Unknown outcome of Google Analytics Pageview Logging?")})).catch((function(t){}));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();e["a"]={logAnalyticsEvent:u,logErrorEvent:d,logPageView:h}},"1acf1":function(t,e,n){"use strict";n("f6af")},"1c86":function(t,e,n){"use strict";n("2675")},"1f3b":function(t,e,n){"use strict";var r=function(t){var e=document.createElement("div");e.classList.add("alert-pop-up"),e.setAttribute("id","alert_pop_up"),e.textContent=t,document.body.appendChild(e);var n=document.getElementById("alert_pop_up");setTimeout((function(){n.remove()}),3e3)},a=function(t){var e=document.createElement("div");e.classList.add("modal-pop-up"),e.setAttribute("id","modal_pop_up");var n=document.createElement("div");n.classList.add("modal-pop-up-content"),n.innerHTML=t,e.appendChild(n),document.body.appendChild(e);document.getElementById("modal_pop_up")},i=function(t,e){for(var n=document.querySelectorAll(".section-alert-pop-up"),r=15,a=0;a<n.length;++a)r+=n[a].offsetHeight+15;var i="alert_pop_up_"+e,o="section_"+e,s=document.createElement("div");s.classList.add("section-alert-pop-up"),s.setAttribute("id",i),s.style.bottom=r+"px",s.textContent=t,document.getElementById(o).appendChild(s);var l=document.getElementById(i);setTimeout((function(){l.remove()}),5e3)};e["a"]={popAlert:r,popSectionAlert:i,popModal:a}},"1fb1":function(t,e,n){"use strict";n("03ce")},"20ed":function(t,e,n){"use strict";n("6119")},2100:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:t.elementid}},[n("div",{staticClass:"color-bar-plot-wrapper"},[n("div",{staticClass:"container"},[n("span",{staticClass:"center",staticStyle:{"font-weight":"bold","white-space":"nowrap"}},[t._v("HuGE score "+t._s(this.score)+" falls in "+t._s(this.category)+" evidence range")])]),n("span",{staticStyle:{"font-size":"12px",padding:"40px 145px 40px 145px","white-space":"nowrap"}},[t._v("Compelling: HuGE Score >= 350 | Extreme: >=100 | Very Strong: >=30 | Strong: >=10 | Moderate: >=3 | Anecdotal: >1 | No Evidence: <=1")]),t._m(0),n("div",{staticClass:"row"},[n("div",{staticClass:"each-bar-section"},["Compelling"==this.category?n("div",{staticClass:"arrow-up causalclass"}):t._e()]),n("div",{staticClass:"each-bar-section"},["Extreme"==this.category?n("div",{staticClass:"arrow-up strongclass"}):t._e()]),n("div",{staticClass:"each-bar-section"},["Very Strong"==this.category?n("div",{staticClass:"arrow-up moderateclass"}):t._e()]),n("div",{staticClass:"each-bar-section"},["Strong"==this.category?n("div",{staticClass:"arrow-up possibleclass"}):t._e()]),n("div",{staticClass:"each-bar-section"},["Moderate"==this.category?n("div",{staticClass:"arrow-up potentialclass"}):t._e()]),n("div",{staticClass:"each-bar-section"},["Anecdotal"==this.category?n("div",{staticClass:"arrow-up weakclass"}):t._e()]),n("div",{staticClass:"each-bar-section"},["No"==this.category?n("div",{staticClass:"arrow-up noEvidenceclass"}):t._e()])])])])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"row color-bars-wrapper"},[n("div",{staticClass:"each-bar-section variationStrong"},[t._v("Compelling")]),n("div",{staticClass:"each-bar-section variationModerate"},[t._v("Extreme")]),n("div",{staticClass:"each-bar-section variationPossible"},[t._v("Very Strong")]),n("div",{staticClass:"each-bar-section variationPotential"},[t._v("Strong")]),n("div",{staticClass:"each-bar-section variationWeak"},[t._v("Moderate")]),n("div",{staticClass:"each-bar-section variationEquivocal"},[t._v("Anecdotal")]),n("div",{staticClass:"each-bar-section variationNoEvidence"},[t._v("No Evidence")])])}],i=(n("a9e3"),n("2b0e")),o=i["default"].component("color-bar-plot",{props:{elementid:{type:String},category:{type:String,required:!0,default:"NO"},score:{type:Number,required:!1,default:1}},data:function(){return{}},components:{},mounted:function(){},methods:{},computed:{},watch:{}}),s=o,l=n("2877"),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},2225:function(t,e,n){},2243:function(t,e,n){},"228b":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",["front"!=t.page?n("div",{staticClass:"disease-systems-sub-pages"},[n("div",{staticClass:"select-disease-wrapper"},[t.diseaseInSession&&""!=t.diseaseInSession?n("label",[t._v(t._s(t.diseaseInSession))]):t._e(),t.diseaseInSession&&""!=t.diseaseInSession?t._e():n("label",[t._v("Set focus")]),n("div",{staticClass:"select-disease"},[n("span",{staticClass:"menu-arrow"},[t._v(">")]),n("div",{staticClass:"options-wrapper"},[n("div",{staticClass:"option",on:{click:function(e){return t.openPhenotypesBuilder("system")}}},[t._v(" By organ system ")]),n("div",{staticClass:"option",on:{click:function(e){return t.openPhenotypesBuilder("disease")}}},[t._v(" By disease ")]),n("div",{staticClass:"option",on:{click:function(e){return t.openPhenotypesBuilder("group")}}},[t._v(" By Phenotype groups ")]),n("div",{staticClass:"option",on:{click:function(e){return t.openPhenotypesBuilder("correlation")}}},[t._v(" By Phenotype correlation ")]),n("div",{staticClass:"option reset",on:{click:function(e){return t.resetCustomPhenotypes()}}},[t._v(" Remove focus ")])])])])]):t._e(),"front"==t.page?n("div",{staticClass:"row disease-systems-front"},[n("div",{staticClass:"disease-systems-tree col-md-12"},[t._l(t.diseaseSystems,(function(e){return[n("div",{key:e,staticClass:"disease-system col-md-2"},[n("img",{staticClass:"disease-systems-icon",attrs:{src:"https://kp4cd.org/sites/default/files/images/disease_systems/"+e.toLowerCase().split(" ")[0]+".svg"}}),n("div",[t._v(t._s(e))]),n("div",{staticClass:"disease-system-options",attrs:{id:e.split(" ")[0]+"_options"}},[n("h6",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.openPhenotypesBuilder("system",{system:e})}}},[t._v(t._s("Select "+e.toLowerCase()+" system"))])]),n("h6",[t._v("Or select by disease")]),t._l(t.diseaseOptions(e),(function(r){return n("div",{key:r,staticClass:"disease-name"},[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.openPhenotypesBuilder("disease",{system:e,disease:r})}}},[t._v(t._s(r))])])})),n("p"),t.kpDiseasePair(e).length>0?n("h6",[t._v(" Or visit a community portal ")]):t._e(),t._l(t.kpDiseasePair(e),(function(e){return n("div",{key:e.name,staticClass:"community-portal"},[n("a",{attrs:{href:t.communityPortalLink(e.name)}},[n("img",{attrs:{src:"https://kp4cd.org/sites/default/files/images/disease_systems/"+e.name+"kp.svg"}})])])}))],2)])]})),n("div",{staticClass:"disease-system col-md-2"},[n("img",{staticClass:"disease-systems-icon",attrs:{src:"https://kp4cd.org/sites/default/files/images/disease_systems/correlation.svg"}}),n("div",{staticClass:"disease-system-options"},[n("h6",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.openPhenotypesBuilder("group")}}},[t._v("By Phenotype group ")])]),n("h6",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.openPhenotypesBuilder("correlation")}}},[t._v("By Phenotype Correlation ")])])]),n("span",[t._v("By Phenotype")])]),n("button",{class:this.$store.state.diseaseInSession?"btn btn-sm btn-warning reset-button":"hidden",attrs:{type:"button"},on:{click:function(e){return t.resetCustomPhenotypes()}}},[t._v(" Remove focus ")])],2)]):t._e(),n("div",{staticClass:"custom-phenotypes-l
1ist-builder hidden",attrs:{id:"pheno_list_builder"}},["system"==t.focusBy?n("div",{staticClass:"ph-builder-filters-wrapper filtering-ui-wrapper"},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col filter-col-md"},[n("div",{staticClass:"label"},[t._v("Select disease system")]),n("select",{staticClass:"select-disease form-control form-control-sm",on:{change:function(e){return t.openPhenotypesBuilder("system",null,e)}}},[t.diseaseSystems.includes(t.selectedDisease)?t._e():n("option",{staticClass:"disease-name",attrs:{value:""}},[t._v(" Select one ")]),t._l(t.diseaseSystems,(function(e){return[n("option",{staticClass:"disease-name",domProps:{value:e,selected:e==t.selectedDisease}},[t._v(" "+t._s(e)+" ")])]}))],2)])])]):t._e(),"disease"==t.focusBy?n("div",{staticClass:"ph-builder-filters-wrapper filtering-ui-wrapper"},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col filter-col-md"},[n("div",{staticClass:"label"},[t._v("Select disease system")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.PBuilderDSystem,expression:"PBuilderDSystem"}],staticClass:"select-disease form-control form-control-sm",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.PBuilderDSystem=e.target.multiple?n:n[0]}}},[n("option",{staticClass:"disease-name",attrs:{value:""}},[t._v(" Select one ")]),t._l(t.diseaseSystems,(function(e){return[n("option",{staticClass:"disease-name",domProps:{value:e}},[t._v(" "+t._s(e)+" ")])]}))],2)]),n("div",{staticClass:"col filter-col-md"},[n("div",{staticClass:"label"},[t._v("Select disease")]),n("select",{staticClass:"select-disease form-control form-control-sm",on:{change:function(e){return t.openPhenotypesBuilder("disease",null,e)}}},[n("option",{staticClass:"disease-name",attrs:{value:""}},[t._v(" Select one ")]),t._l(t.diseaseOptions(t.PBuilderDSystem),(function(e){return n("option",{key:e,staticClass:"disease-name",domProps:{value:e,selected:e==t.selectedDisease}},[t._v(" "+t._s(e)+" ")])}))],2)])])]):t._e(),"group"==t.focusBy?n("div",{staticClass:"ph-builder-filters-wrapper filtering-ui-wrapper"},[t._m(0),t._l(t.phenotypGroups,(function(e){return n("div",{key:e,staticClass:"ph-group-option"},[n("input",{attrs:{type:"checkbox"},domProps:{value:e,checked:!!t.selectedGroups.includes(e)},on:{click:function(n){return t.addRemovePhenotypeGroup(e)}}}),t._v(" "+t._s(e)+" ")])}))],2):t._e(),"system"==t.focusBy||"disease"==t.focusBy||"group"==t.focusBy?[n("strong",{staticClass:"number-of-phenotypes"},[t._v("Number of phenotypes: "+t._s(t.getPhenotypes().length))]),n("div",{staticClass:"table-wrapper",class:t.focusBy},[n("table",{staticClass:"table table-striped table-sm"},[t._m(1),n("tbody",t._l(t.getPhenotypes(),(function(e){return n("tr",[n("td",[n("input",{staticClass:"phenotype-chkbox",attrs:{type:"checkbox",checked:""},domProps:{value:e.name}})]),n("td",{staticClass:"phenotype-name"},[t._v(" "+t._s(e.description)+" ")]),n("td",{staticClass:"phenotype-group"},[t._v(" "+t._s(e.group)+" ")]),n("td",{staticClass:"phenotype-dichotomous"},[t._v(" "+t._s(e.dichotomous)+" ")])])})),0)])]),n("div",{staticClass:"session-info"},[n("button",{staticClass:"btn btn-primary btn-sm",attrs:{type:"button"},on:{click:function(e){return t.saveCustomPhenotypes(t.focusBy,"set")}}},[t._v(" Set focus ")]),n("button",{staticClass:"btn btn-warning btn-sm",attrs:{type:"button"},on:{click:function(e){return t.closePhenotypesBuilder()}}},[t._v(" Cancel ")])])]:t._e(),"correlation"==t.focusBy?n("div",{staticClass:"ph-builder-filters-wrapper filtering-ui-wrapper"},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col filter-col-md"},[n("div",{staticClass:"label"},[t._v("Select phenotype")]),t.phenotypes?n("phenotype-selectpicker",{attrs:{phenotypes:t.phenotypes,clearOnSelected:!0,useInLocal:!0,localPlace:"diseaseSystems"}}):t._e()],1),n("div",{staticClass:"col filter-col-sm"},[n("div",{staticClass:"label"},[t._v("P-Value(<=)")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.pCorPValue,expression:"pCorPValue"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.pCorPValue},on:{input:function(e){e.target.composing||(t.pCorPValue=e.target.value)}}})]),n("div",{staticClass:"col filter-col-sm"},[n("div",{staticClass:"label"},[t._v("Correlation(>=)")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.pCorCorrelation,expression:"pCorCorrelation"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:t.pCorCorrelation},on:{input:function(e){e.target.composing||(t.pCorCorrelation=e.target.value)}}})]),n("div",{staticClass:"col filter-col-sm"},[n("div",{staticClass:"label"},[t._v("Sort by")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.pCorDirection,expression:"pCorDirection"}],staticClass:"form-control",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,
1(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.pCorDirection=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"pValue"}},[t._v("P-Value")]),n("option",{attrs:{value:"rg"}},[t._v("Correlation")])])])])]):t._e(),"correlation"==t.focusBy&&t.correlatedPhenotypes?n("strong",{staticClass:"number-of-phenotypes"},[t._v("Number of phenotypes: "+t._s(t.correlatedPhenotypes.length))]):t._e(),"correlation"==t.focusBy&&t.correlatedPhenotypes?n("div",{staticClass:"table-wrapper"},[n("table",{staticClass:"table table-striped table-sm"},[t._m(2),n("tbody",t._l(t.correlatedPhenotypes,(function(e){return n("tr",[t.phenotypeNames[e.other_phenotype]?[n("td",[n("input",{staticClass:"phenotype-chkbox",attrs:{type:"checkbox",checked:""},domProps:{value:e.other_phenotype}})]),n("td",{staticClass:"phenotype-name"},[t._v(" "+t._s(t.phenotypeNames[e.other_phenotype])+" ")]),n("td",{staticClass:"phenotype-name"},[t._v(" "+t._s(t.formatValue("pValueFormatter",e.pValue))+" ")]),n("td",{staticClass:"phenotype-name"},[t._v(" "+t._s(t.formatValue("pValueFormatter",e.rg))+" ")]),n("td",{staticClass:"phenotype-name"},[t._v(" "+t._s(t.formatValue("pValueFormatter",e.stdErr))+" ")])]:t._e()],2)})),0)])]):t._e(),"correlation"==t.focusBy?n("div",{staticClass:"session-info"},[t.correlatedPhenotypes?n("button",{staticClass:"btn btn-primary btn-sm",attrs:{type:"button"},on:{click:function(e){return t.saveCustomPhenotypes("correlation","set")}}},[t._v(" Set focus ")]):t._e(),n("button",{staticClass:"btn btn-warning btn-sm",attrs:{type:"button"},on:{click:function(e){return t.closePhenotypesBuilder()}}},[t._v(" Cancel ")])]):t._e()],2)])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("strong",[t._v("Select phenotype groups")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("thead",[n("tr",[n("th"),n("th",[t._v("Phenotype")]),n("th",[t._v("Group")]),n("th",[t._v("Dichotomous")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("thead",[n("tr",[n("th"),n("th",[t._v("Phenotype")]),n("th",[t._v("P-Value")]),n("th",[t._v("Correlation")]),n("th",[t._v("Standard error")
1])])])}],i=n("5530"),o=n("2909"),s=(n("a4d3"),n("e01a"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("a434"),n("b0c0"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("5319"),n("5b81"),n("498a"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),l=n("a282"),c=n("fd66"),u=n("62d0"),d=n("cce6"),h=n("a708"),p=n("529c"),f=n("a5ad"),_=s["default"].component("disease-systems",{props:["page","phenotypes","phenotypeCorrelation","diseases","diseaseGroups","diseaseInSession"],data:function(){return{diseaseSystems:[],selectedSystem:null,selectedDisease:null,selectedGroups:[],focusBy:null,pCorPValue:.05,pCorCorrelation:null,pCorDirection:"pValue",PBuilderDSystem:null}},components:{PhenotypeSelectPicker:f["a"]},mounted:function(){this.setDiseaseSystems(),this.getCustomPhenotypes()},computed:{phenotypGroups:function(){if(this.phenotypes){var t=Object(o["a"])(new Set(this.phenotypes.map((function(t){return t.group})).sort()));return t}return null},phenotypeNames:function(){if(this.phenotypes){var t={};return this.phenotypes.map((function(e){t[e.name]=e.description})),t}return null},correlatedPhenotypes:function(){var t=this;if(this.phenotypeCorrelation){var e=this.pCorPValue&&""!=this.pCorPValue?this.phenotypeCorrelation.data.filter((function(e){return e.pValue<=t.pCorPValue})):this.phenotypeCorrelation.data;return this.pCorCorrelation&&""!=this.pCorCorrelation&&(e=e.filter((function(e){return e.rg>=t.pCorCorrelation}))),"rg"==this.pCorDirection&&(e=h["a"].sort(e,"rg",!0,null)),e}return null}},methods:Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])({},d["a"]),l["a"]),h["a"]),u["a"]),p["a"]),c["a"]),{},{currentFocus:function(){var t=u["a"].getPhenotypes();if(t){var e={system:null,disease:null,groups:null,phenotypes:[]},n=t.id.split(": ");switch(n[0]){case"Disease system":e.system=n[1];break;case"Disease":e.system=this.diseases.filter((function(t){return t.disease==n[1]}))[0]["system"],e.disease=n[1];break;case"Phenotype groups":e.groups=n[1].slice(0,-1).split(",");break;case"Phenotype correlation":break}return e.phenotypes=t.list,e}return null},formatValue:function(t,e){return p["a"][t](e)},addRemovePhenotypeGroup:function(t){var e=this.selectedGroups.indexOf(t);e>-1?this.selectedGroups.splice(e,1):this.selectedGroups.push(t)},getCustomPhenotypes:function(){var t=u["a"].getPhenotypes(),e=t?t.id:null,n=t?t.list:null;if(e&&e.includes("Phenotype group")){var r=e.split(":"),a=r[1].split(",");e=a.length>2?"Phenotype groups:"+a[0]+"+"+(a.length-2):"Phenotype group:"+a[0]}this.selectedDisease=e,this.$store.dispatch("diseaseInSession",e),this.$store.dispatch("phenotypesInSession",n)},resetCustomPhenotypes:function(){u["a"].clearPhenotypes(),this.getCustomPhenotypes(),l["a"].hideElement("pheno_list_builder")},saveCustomPhenotypes:function(t,e){switch(t){case"system":this.selectedDisease="Disease system: "+this.selectedDisease;break;case"disease":this.selectedDisease="Disease: "+this.selectedDisease;break;case"group":var n="";this.selectedGroups.map((function(t){n+=t+","})),this.selectedDisease="Phenotype groups: "+n;break;case"correlation":this.selectedDisease="Phenotype correlation: "+this.phenotypeNames[this.correlatedPhenotypes[0].phenotype];break}var r=this.selectedDisease,a=[],i=document.querySelectorAll(".phenotype-chkbox");i.forEach((function(t){t.checked&&a.push(t.value)}));var o=[];this.phenotypes.map((function(t){a.map((function(e){t.name==e&&o.push(t)}))}));var s={id:r,list:o};if(u["a"].savePhenotypes(s),r.includes("Phenotype group")){var d=r.split(":"),h=d[1].split(",");r=h.length>2?"Phenotype groups:"+h[0]+"+"+(h.length-2):"Phenotype group:"+h[0]}this.$store.dispatch("phenotypesInSession",o),this.$store.dispatch("diseaseInSession",r),this.selectedDisease=null,l["a"].hideElement("pheno_list_builder");var p=l["a"].getUrl();if(p.pathname.includes("region.html")){var f=p.pathname+"?chr="+c["a"].chr+"&start="+c["a"].start+"&end="+c["a"].end;location.href=f}},closePhenotypesBuilder:function(){l["a"].hideElement("pheno_list_builder")},openPhenotypesBuilder:function(t,e,n){var r=this;this.focusBy=t;var a=e||this.currentFocus();switch(t){case"system":(a&&a.system||n)&&(this.selectedDisease=n?n.target.value:a.system.replaceAll(" system",""));break;case"disease":(a&&a.system&&a.disease||n)&&(this.selectedDisease=n?n.target.value:a.disease,this.PBuilderDSystem=n?this.diseases.filter((function(t){return t.disease==n.target.value}))[0]["system"].replaceAll(" system",""):a.system.replaceAll(" system",""));break;case"group":a&&a.groups&&a.groups.map((function(t){""!=t&&r.selectedGroups.push(t.trim())}));break;case"correlation":break}l["a"].showElement("pheno_list_builder")},getPhenotypes:function(){var t,e=this;"system"==this.focusBy&&(t=Object(o["a"])(new Set(this.$store.state.bioPortal.diseaseSystems.filter((function(t){return!!t.system.includes(e.selectedDisease)})).map((function(t){return t.phenotype}))))),"disease"==this.focusBy&&(t=Object(o["a"])(new Set(this.$store.state.bioPortal.diseaseSystems.filter((function(t){return t.disease==e.selectedDisease})).map((function(t){return t.phenotype})))));var n=this.phenotypes,r=[];return"system"!=this.focusBy&&"disease"!=this.focusBy||t.map((function(t){n.map((function(e){e.name.toLowerCase()==t.toLowerCase()&&r.push(e)}))})),"group"==this.focusBy&&this.selectedGroups.map((function(t){n.map((function(e){e.group.toLowerCase()==t.toLowerCase()&&r.push(e)}))})),h["a"].sort(r,"description",!1,!0),h["a"].sort(r,"group",!1,!0),r},setDiseaseSystems:function(){var t=this;this.diseaseSystems=[];var e=Object(o["a"])(new Set(this.diseases.map((function(t){return t.system})))).sort();e.map((function(e){var n=e.replaceAll(" system","");t.diseaseSystems.push(n)}))},communityPortalLink:function(t){var e=window.location.host.split(".");return e=window.location.host.includes("localhost")?2==e.length?e[1]:e[0]:3==e.length?e[1]+"."+e[2]:e[0]+"."+e[1],"https://"+t+"."+e},diseaseOptions:function(t){var e=Object(o["a"])(new Set(this.diseases.filter((function(e){return e.system==t+" system"})).map((function(t){return t.disease}))));return e},kpDiseasePair:function(t,e){var n=this,r="";this.diseases.map((function(e){e.system.replaceAll(" system","")==t&&(r=e.portals)}));var a=[];return""!=r&&r&&r.split(",").map((function(t){var e=n.diseaseGroups.filter((function(e){return e.name==t}));a.push(e[0])})),a}})}),g=_,m=(n("aae0"),n("2877")),v=Object(m["a"])(g,r,a,!1,null,"5e560aef",null);e["a"]=v.exports},"22ee":function(t,e,n){"use strict";n("29e0")},2521:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[null!=t.searchingRegion?n("div",{staticClass:"col-md-12 annotations-plot-wrapper"},[n("div",{staticClass:"col-md-9 anno-plot-wrapper"},[n("div",{attrs:{id:"annotationsUIWrapper"}},[n("div",{staticClass:"filtering-ui-wrapper add-content",staticStyle:{width:"100%",padding:"0 10px","text-align":"left"}},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col",staticStyle:{padding:"2px"}},[n("div",{staticClass:"label",staticStyle:{display:"inline-block","margin-right":"10px"}},[t._v(" Select Annotation ")]),n("select",{staticClass:"custom-select",on:{change:function(e){return t.addAnnoTrack(e)}}},[n("option",{attrs:{value:""}},[t._v(" "+t._s("Select annotation")+" ")]),t._l(t.annoData,(function(e,r){return n("option",{key:r,domProps:{value:r,innerHTML:t._s(r)}})}))],2)])]),t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0&&!t.renderConfig["no search key bubbles"]?n("div",{staticStyle:{position:"absolute",right:"10px",top:"7px"}},[t._l(t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})),(function(e){return[n("span",{key:e.id,class:"btn search-bubble ",style:"background-color:"+t.getColorIndex(e.id),domProps:{innerHTML:t._s(e.id+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeAnnoTrack(e.id)}}})]}))],2):t._e()])]),t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0?n("div",[n("div",{staticStyle:{padding:"5px","text-align":"left"}},[n("strong",[t._v("Select Tissues")]),t.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).length>0&&!t.renderConfig["no search key bubbles"]?n("div",{staticStyle:{float:"right"}},[t._l(t.pkgDataSelected.filter((function(t){return"Tissue"==t.type})),(function(e){return[n("span",{key:e.id,class:"btn search-bubble ",style:"background-color:#999999",domProps:{innerHTML:t._s(e.id+" <span class='remove'>X</span>")},on:{click:function(n){return t.addRemoveTissueTrack(null,e.id)}}})]}))],2):t._e()]),n("div",{staticClass:"annotations-table-wrapper"},[n("span",{domProps:{innerHTML:t._s(t.renderConfig["ui table legend"]?t.renderConfig["ui table legend"]:"Table is sort by fold (SNPs/expectedSNPs) across annotations. Tissue columns show P-Value / Fold.")}}),n("table",{staticClass:"table table-sm ge-data-table",attrs:{cellpadding:"0",cellspacing:"0"}},[n("thead",[n("tr",t._l(t.GEData,(function(e,r,a){return n("th",{key:r,domProps:{innerHTML:t._s(r)}})})),0)]),n("tbody",[n("tr",t._l(t.GEData,(function(e,r,a){return n("td",{key:r,staticClass:"phenotype-tissue-td",staticStyle:{padding:"0",border:"none !important"}},[n("table",{staticClass:"table table-sm ge-data-table",attrs:{cellpadding:"0",cellspacing:"0"}},[n("thead",[n("tr",[n("th"),n("th",[t._v("Tissues")]),t._l(t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})),(function(e){return n("th",{key:e.id,class:e.id,style:"background-color:"+t.getColorIndex(e.id),domProps:{innerHTML:t._s(e.id)}})}))],2)]),n("tbody",t._l(t.getSortByAnno(t.pkgData.GEByTissueData[r]),(function(e,a){return n("tr",{key:a+r},[n("td",[n("input",{class:a.replace(/ /g,"_"),attrs:{type:"checkbox"},domProps:{value:a,checked:t.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id})).includes(a)},on:{click:function(e){return t.addRemoveTissueTrack(e,null)}}})]),n("td",{domProps:{innerHTML:t._s(a)}}),t._l(t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})),(function(r){return n("td",{key:r.id,class:r.id},[t.annoData[r.id][a]?n("span",{domProps:{innerHTML:t._s(e[r.id]?e[r.id].pValue+" / "+e[r.id].fold:"")}}):t._e()])}))],2)})),0)])])})),0)])])])]):t._e(),n("div",{attrs:{id:"annotationsPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"tissueInfoBox"}}),n("canvas",{attrs:{id:"annotationsPlot",width:"",height:""},on:{resize:t.onResize,mousemove:function(e){return t.checkPosition(e)},mouseout:function(e){return t.onMouseOut("tissueInfoBox")}}}),n("div",{class:t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>
10?"hidden":"",attrs:{id:"annoInitialMessage"},domProps:{innerHTML:t._s("Please select annotation.")}})])]),n("div",{staticClass:"col-md-3 anno-plot-ui-wrapper reference-area"},[t._m(0),n("div",t._l(t.annoData,(function(e,r,a){return n("div",{key:r,staticClass:"anno-bubble-wrapper"},[n("span",{staticClass:"anno-bubble",style:"background-color:"+t.compareGroupColors[a]+";",domProps:{innerHTML:t._s(" ")}}),n("span",{domProps:{innerHTML:t._s(r)}})])})),0),null!=t.searchingPhenotype?n("div",{attrs:{id:"GEPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"GEInfoBox"}}),n("canvas",{staticStyle:{"background-color":"#ffffff"},attrs:{id:"GEPlot",width:"",height:""},on:{mousemove:function(e){return t.checkGEPosition(e)},mouseout:function(e){return t.onMouseOut("GEInfoBox")}}})]):t._e()])]):t._e()])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Global Enrichment")])])}],i=n("53ca"),o=n("1da1"),s=n("3835"),l=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("cb29"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("b0c0"),n("6b93"),n("0c47"),n("23dc"),n("a9e3"),n("4fad"),n("c1f9"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("2532"),n("3ca3"),n("5319"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),c=n("1157"),u=n.n(c),d=n("b1e0");function h(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,o,s,l){var c=p(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);
vendor: 4,268 bytes, line 1
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}l["default"].use(d["a"]);var p=l["default"].component("research-annotations-plot",{props:["region","phenotype","renderConfig","plotMargin","compareGroupColors","dataComparison","plotData","pkgData","pkgDataSelected","regionZoom","regionViewArea","utils"],data:function(){return{annoData:{},GEData:{},GEPosData:{},tissuesData:{},tissuesPosData:{},selectedAnnos:[],selectedTissues:[],annoPosData:{},spaceBy:14}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize),this.getAnnotations(this.searchingRegion)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{searchingParameters:function(){if(null!=this.searchingRegion&&null!=this.searchingPhenotype)return this.searchingRegion+","+this.searchingPhenotype},searchingRegion:function(){var t={},e=this.region.split(":");
1return t["chr"]=e[0],t["start"]=e[1].split("-")[0],t["end"]=e[1].split("-")[1],this.utils.uiUtils.showElement("annotationsPlotWrapper"),t},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},searchingPhenotype:function(){if(null!=this.phenotype){this.utils.uiUtils.showElement("annotationsPlotWrapper");var t=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][this.phenotype]:this.phenotype;return t}if(null==this.phenotype){if(this.utils.keyParams[this.renderConfig["phenotype parameter"]]){this.utils.uiUtils.showElement("annotationsPlotWrapper");var e=this.utils.keyParams[this.renderConfig["phenotype parameter"]],n=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][e]:e;return n}return null}}},watch:{searchingParameters:function(t){this.getAnnotations(this.searchingRegion)},pkgDataSelected:{handler:function(t){0==t.length?this.resetAll():this.renderByAnnotations()},deep:!0,immediate:!0},viewingRegion:{handler:function(t,e){this.renderByAnnotations()},deep:!0,immediate:!0}},methods:{resetAll:function(){this.annoData={},this.GEData={},this.GEPosData={},this.tissuesData={},this.tissuesPosData={},this.selectedAnnos=[],this.selectedTissues=[],this.annoPosData={},this.getAnnotations(this.searchingRegion),this.renderByAnnotations()},getOverlappingRegion:function(){var t=this;if(this.renderConfig["overlapping regions"]&&"false"!=this.renderConfig["overlapping regions"]){var e={};if(this.pkgDataSelected.length>0&&this.pkgDataSelected.map((function(t){e[t.type]||(e[t.type]=[]),e[t.type].push(t.id)})),e["Tissue"]&&e["Tissue"].length>0&&e["Annotation"]&&e["Annotation"].length>0){var n={and:null,or:null};e["Annotation"].map((function(r){e["Tissue"].map((function(e){if(t.pkgData.annoData[r]&&t.pkgData.annoData[r][e])for(var a=function(){var a=Object(s["a"])(o[i],2),l=a[0],c=a[1],u=[];t.pkgData.annoData[r][e].region.map((function(t){for(var e=t.start;e<=t.end;e++)u.push(e)})),n[l]=null==c?u:"and"==l?t.getArraysIntersection(n[l],u):n[l].concat(u)},i=0,o=Object.entries(n);i<o.length;i++)a()}))}));for(var r=0,a=Object.entries(n);r<a.length;r++){var i=Object(s["a"])(a[r],2),o=i[0];i[1];n[o].sort((function(t,e){return t-e}))}for(var c={and:[],or:[]},u=0,d=Object.entries(c);u<d.length;u++)for(var h=Object(s["a"])(d[u],2),p=h[0],f=(h[1],0);f<n[p].length;f++)if(0==f||f==n[p].length-1)c[p].push(n[p][f]);else{var _=n[p][f-1]+1,g=n[p][f];g>_&&(c[p].push(n[p][f-1]),c[p].push(n[p][f]))}for(var m={and:[],or:[]},v=0,y=Object.entries(c);v<y.length;v++)for(var b=Object(s["a"])(y[v],2),x=b[0],w=(b[1],0);w<c[x].length-1;w+=2){var C={};C["start"]=c[x][w],C["end"]=c[x][w+1],m[x].push(C)}l["default"].set(this.pkgData,"overlappingRegions",m)}}},getArraysIntersection:function(t,e){return t.filter((function(t){return-1!==e.indexOf(t)}))},onMouseOut:function(t){this.utils.uiUtils.removeOnMouseOut(t,1e3)},onResize:function(t){this.utils.uiUtils.showElement("annotationsPlotWrapper"),this.renderByAnnotations(),this.renderGE()},showHideAnnoPlots:function(){this.utils.uiUtils.showHideElement("annotationsPlotWrapper")},getGEContent:function(t,e){var n=this,r="";return this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(a){if(n.pkgData.GEByTissueData[t][e]&&n.pkgData.GEByTissueData[t][e][a.id]){var i=n.pkgData.GEByTissueData[t][e][a.id];r+="<strong>"+a.id+"</strong> ("+n.utils.Formatters.pValueFormatter(i.pValue)+" / "+n.utils.Formatters.pValueFormatter(i.fold)+")<br />"}})),r},getSortByAnno:function(t){for(var e={},n=[],r=0,a=Object.entries(t);r<a.length;r++)for(var i=Object(s["a"])(a[r],2),o=i[0],l=i[1],c=0,u=Object.entries(l);c<u.length;c++){var d=Object(s["a"])(u[c],2),h=d[0],p=d[1];if(1==this.pkgDataSelected.map((function(t){return t.id})).includes(h)&&this.annoData[h][o]){var f={tissue:o,fold:null,render:null};
1f.render=!0,null==f.fold?f.fold=p.fold:f.fold=p.fold>f.fold?p.fold:f.fold,n.push(f)}}return n=n.sort((function(t,e){return t.fold<e.fold?1:-1})),n.map((function(n){1==n.render&&(e[n.tissue]=t[n.tissue])})),e},addAnnoTrack:function(t){if(""!=t.target.value){var e=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id}));e.indexOf(t.target.value)<0&&(e.push(t.target.value),null!=this.pkgData&&(this.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t.target.value,action:"add"}),l["default"].set(this.pkgData,"selectedAnnos",e)))}},addRemoveTissueTrack:function(t,e){var n=null!=e?e:t.target.value,r=n.replace(/ /g,"_"),a=document.querySelectorAll("input."+r),i=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id}));if(null!=t)if(1==t.target.checked)a.forEach((function(t){t.checked=!0})),i.push(n),null!=this.pkgData&&(this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:n,action:"add"}),l["default"].set(this.pkgData,"selectedTissues",i));else{a.forEach((function(t){t.checked=!1}));var o=i.indexOf(n);o>-1&&null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:n,action:"remove"})}else if(null==t){a.forEach((function(t){t.checked=!1}));var s=i.indexOf(n);s>-1&&null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:n,action:"remove"})}},addTissueTrack:function(t){var e=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id}));""!=t.target.value&&(e.push(t.target.value),null!=this.pkgData&&(this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:t.target.value,action:"add"}),l["default"].set(this.pkgData,"selectedTissues",e)))},renderTissuesTracks:function(){var t=this,e=document.querySelector("#tissuesPlot"),n=document.querySelector("#tissuesPlotWrapper");if(e&&n){var r,a,i=2*this.spaceBy,o=3*this.spaceBy,l=this.spaceBy,c=this.spaceBy,u=(this.spaceBy,this.plotMargin.bump),d=this.viewingRegion.start,h=this.viewingRegion.end,p=2*n.clientWidth,f=this.plotMargin.topMargin,_=p-2*this.plotMargin.leftMargin,g=_/(h-d),m=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id})),v=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id}));v.map((function(e){for(var n=0,r=0,a=Object.entries(t.tissuesData[e]);r<a.length;r++){var u=Object(s["a"])(a[r],2),d=u[0];u[1];1==m.includes(d)&&n++}f+=i+o+c+l*n})),e.setAttribute("width",p),e.setAttribute("height",f),e.setAttribute("style","width:"+p/2+"px;height:"+f/2+"px;"),r=e,a=r.getContext("2d"),a.clearRect(0,0,p,f);var y=this.plotMargin.topMargin;v.map((function(e,n){for(var r=0,c=0,p=Object.entries(t.tissuesData[e]);c<p.length;c++){var f=Object(s["a"])(p[c],2),b=f[0];f[1];1==m.includes(b)&&r++}a.font="28px Arial",a.textAlign="left",a.fillStyle="#000000",a.fillText(e,u,y+t.spaceBy),a.beginPath(),a.fillStyle="#666666",a.lineWidth=0,a.arc(t.plotMargin.leftMargin+_+3*u,y+2*u,14,0,2*Math.PI),a.fill(),a.font="24px Arial",a.textAlign="center",a.fillStyle="#ffffff",a.fillText("â",t.plotMargin.leftMargin+_+3*u,y+2*u+7);var x=Math.ceil((y+2*u)/t.spaceBy),w=t.plotMargin.leftMargin+_+3*u,C=w-7,P=w+7,k=C+"_"+P;if(t.tissuesPosData[x]={tissue:e,annotation:"close",regions:{}},t.tissuesPosData[x].regions[k]="Remove track",y+=i,a.beginPath(),a.strokeStyle="#999999",a.moveTo(t.plotMargin.leftMargin-u,y),a.lineTo(t.plotMargin.leftMargin-u,y+u+l*r),a.stroke(),a.moveTo(t.plotMargin.leftMargin+_+u,y),a.lineTo(t.plotMargin.leftMargin+_+u,y+u+l*r),a.stroke(),a.moveTo(t.plotMargin.leftMargin-u,y+u+l*r),a.lineTo(t.plotMargin.leftMargin+_+u,y+u+l*r),a.stroke(),n+1==v.length)for(var M=(h-d)/5,E=_/5,D=0;D<6;D++){var O=t.plotMargin.leftMargin+D*E,L=Math.floor(O);a.moveTo(L,y+u+l*r),a.lineTo(L,y+2*u+l*r),a.stroke(),a.textAlign="center",a.font="24px Arial",a.fillStyle="#999999";var j=D<5?Number(d)+D*M:Number(h);a.fillText(Math.floor(j),L,y+4*u+l*r)}for(var S=0,A=function(){var n=Object(s["a"])(T[I],2),r=n[0],i=n[1];if(1==m.includes(r)){var o=i.region;S%2==0&&(a.fillStyle="#eeeeee",a.fillRect(t.plotMargin.leftMargin,y,_,l)),S++,a.fillStyle=t.getColorIndex(r);var c=Math.ceil(y/t.spaceBy);
1t.tissuesPosData[c]={tissue:e,annotation:r,regions:{}},o.map((function(e){if(e.start<=h&&e.end>=d){var n=(e.start-d)*g+t.plotMargin.leftMargin;n=n<=t.plotMargin.leftMargin?t.plotMargin.leftMargin:n;var r=(e.end-d)*g+t.plotMargin.leftMargin;r=r>t.plotMargin.leftMargin+_?t.plotMargin.leftMargin+_:r;var i=r-n<1?1:r-n;a.fillRect(n,y,i,l-1);var o=n+"_"+(n+i);t.tissuesPosData[c].regions[o]={start:e.start,end:e.end}}})),y+=l}},I=0,T=Object.entries(t.tissuesData[e]);I<T.length;I++)A();y+=o}))}},removeTissueTrack:function(t){var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=(e.clientX,n.left,Math.ceil(Math.floor(e.clientY-n.top)/this.spaceBy)),i=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id}));if(r>n.width-this.plotMargin.leftMargin&&this.tissuesPosData[a])for(var o=0,l=Object.entries(this.tissuesPosData[a].regions);o<l.length;o++){var c=Object(s["a"])(l[o],2),u=c[0],d=(c[1],u.split("_")),h=d[0],p=d[1];if(r>=h&&r<=p){var f=this.tissuesPosData[a].tissue,_=i.indexOf(f);_>-1&&null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:f,action:"remove"})}}},checkTissuesPosition:function(t){var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=e.clientX-n.left,i=Math.ceil(Math.floor(e.clientY-n.top)/this.spaceBy),o=e.clientY-n.top,l=document.querySelector("#selectedTissueInfoBox"),c="";if(r>=this.plotMargin.leftMargin&&r<=n.width-this.plotMargin.leftMargin){if(this.tissuesPosData[i]){c="close"==this.tissuesPosData[i].annotation?"":this.tissuesPosData[i].annotation;for(var u=0,d=Object.entries(this.tissuesPosData[i].regions);u<d.length;u++){var h=Object(s["a"])(d[u],2),p=h[0],f=h[1],_=p.split("_"),g=_[0],m=_[1];r>=g&&r<=m&&(c+="<br />"+f.start+"-"+f.end)}}}else if(this.tissuesPosData[i])for(var v=0,y=Object.entries(this.tissuesPosData[i].regions);v<y.length;v++){var b=Object(s["a"])(y[v],2),x=b[0],w=b[1],C=x.split("_"),P=C[0],k=C[1];r>=P&&r<=k&&(c+=w)}""!=c?(l.innerHTML=c,l.setAttribute("class",""),l.style.left=a+15+"px",l.style.top=o+this.spaceBy+"px"):(l.innerHTML="",l.setAttribute("class","hidden"))},checkGEPosition:function(t){for(var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=Math.floor(e.clientY-n.top),i=document.querySelector("#GEInfoBox"),o="",l=-5;l<=5;l++)for(var c=-5;c<=5;c++)if(void 0!=this.GEPosData[a+l]&&void 0!=this.GEPosData[a+l][r+c])for(var u=0,d=Object.entries(this.GEPosData[a+l][r+c]);u<d.length;u++){var h=Object(s["a"])(d[u],2),p=h[0],f=h[1];o+="<span style='color:"+this.compareGroupColors[f.annotationIndex]+"'>"+p+"</span><br />"}""!=o?(i.innerHTML=o,i.setAttribute("class",""),r<.75*n.width?(i.style.width="auto",i.style.left=r+15+"px",i.style.top=a+this.spaceBy+"px"):(i.style.width="200px",i.style.left=r-215+"px",i.style.top=a+this.spaceBy+"px")):i.setAttribute("class","hidden")},removeAnnoTrack:function(t){var e=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id})),n=e.indexOf(t);n>-1&&null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t,action:"remove"})},checkPosition:function(t,e){var n=t,r=n.target.getBoundingClientRect(),a=Math.floor(n.clientX-r.left),i=n.clientX-r.left,o=n.clientY-r.top,l=Math.ceil(Math.floor(n.clientY-r.top)/(this.spaceBy/2))-1,c=document.querySelector("#tissueInfoBox"),u="";if(a>=this.plotMargin.leftMargin/2&&a<=r.width-this.plotMargin.leftMargin/2){if(this.annoPosData[l]){u+=this.annoPosData[l].tissue;for(var d=0,h=Object.entries(this.annoPosData[l].regions);d<h.length;d++){var p=Object(s["a"])(h[d],2),f=p[0],_=p[1],g=f.split("_"),m=g[0],v=g[1];a>=m&&a<=v&&(u+="<br />"+_.start+"-"+_.end)}}}else if(a>=r.width-this.plotMargin.leftMargin/2&&a<=r.width)for(var y=Math.floor(o),b=y-4,x=y+4,w=b;w<=x;w++)if(this.annoPosData[w]&&this.annoPosData[w].annotation)for(var C=0,P=Object.entries(this.annoPosData[w].regions);C<P.length;C++){var k=Object(s["a"])(P[C],2),M=k[0],E=k[1],D=M.split("_"),O=D[0],L=D[1];a>=O&&a<=L&&(u+=E)}""==u?(c.innerHTML="",c.setAttribute("class","hidden")):(c.innerHTML=u,c.setAttribute("class",""),c.style.left=i+15+"px",c.style.top=o+this.spaceBy/2+"px")},getColorIndex:function(t){var e=Object.keys(this.annoData),n=e.indexOf(t);return this.compareGroupColors[n]},getGlobalEnrichment:function(){var t=this;return Object(o["a"])(h().mark((function e(){var n,r,a,i,o,c,u,d,p,f;return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n="KP BioIndex"==t.renderConfig["annotations server"]?t.utils.uiUtils.biDomain()+"/api/bio":t.renderConfig["annotations server"],r=t.searchingPhenotype,a=t.renderConfig["global enrichment index"]?t.renderConfig["global enrichment index"]:"global-enrichment",i=n+"/query/"+a+"?q="+r,e.next=6,fetch(i).then((function(t){return t.json()}));case 6:if(o=e.sent,null==o.error){for("newSearch"==t.dataComparison&&(t.GEData={}),t.GEData[t.searchingPhenotype]=o.data,c=0,u=Object.entries(t.GEData);c<u.length;c++)d=Object(s["a"])(u[c],2),d[0],p=d[1],p.map((function(e){var n=e.ancestry,r=e.annotation,a=e.pValue,i=e.phenotype,o=e.tissue;t.annoData[r]&&t.annoData[r][o]&&(t.annoData[r][o].ancestries[n]||(t.annoData[r][o].ancestries[n]={}),t.annoData[r][o].ancestries[n][i]=a),t.tissuesData[o]&&t.tissuesData[o][r]&&(t.tissuesData[o][r].ancestries[n]||(t.tissuesData[o][r].ancestries[n]={}),t.tissuesData[o][r].ancestries[n][i]=a)}));t.tissuesData=Object.fromEntries(Object.entries(t.tissuesData).sort()),f=t.getGEByTissue(),null!=t.pkgData&&(l["default"].set(t.pkgData,"GEByTissueData",f),l["default"].set(t.pkgData,"GEData",t.GEData),l["default"].set(t.pkgData,"annoData",t.annoData),l["default"].set(t.pkgData,"tissuesData",t.tissuesData)),t.renderByAnnotations(),t.renderGE()}t.$forceUpdate();case 9:case"end":return e.stop()}}),e)})))()},getGEByTissue:function(){for(var t=this,e={},n=function(){var n=Object(s["a"])(a[r],2),i=n[0],o=n[1];e[i]={},o.map((function(n){if(e[i][n.tissue]||(e[i][n.tissue]={}),e[i][n.tissue][n.annotation]||(e[i][n.tissue][n.annotation]={pValue:null,fold:null,gregor:null}),t.renderConfig.ancestry&&n.ancestry==t.renderConfig.ancestry){var r=e[i][n.tissue][n.annotation].pValue;(null==r||n.pValue<r)&&(e[i][n.tissue][n.annotation].pValue=t.utils.Formatters.pValueFormatter(n.pValue),e[i][n.tissue][n.annotation].fold=t.utils.Formatters.pValueFormatter(n.SNPs/n.expectedSNPs))}else{var a=e[i][n.tissue][n.annotation].pValue;(null==a||n.pValue<a)&&(e[i][n.tissue][n.annotation].pValue=t.utils.Formatters.pValueFormatter(n.pValue),e[i][n.tissue][n.annotation].fold=t.utils.Formatters.pValueFormatter(n.SNPs/n.expectedSNPs))}}))},r=0,a=Object.entries(this.GEData);r<a.length;r++)n();return e},getAnnotations:function(t){var e=this;return Object(o["a"])(h().mark((function n(){var r,a,i,o;return h().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!(t&&t.chr&&t.start&&t.end)){n.next=8;break}return r="KP BioIndex"==e.renderConfig["annotations server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["annotations server"],a=e.renderConfig["annotations index"]?e.renderConfig["annotations index"]:"regions",i=r+"/query/"+a+"?q="+t.chr+":"+t.start+"-"+t.end,n.next=6,fetch(i).then((function(t){return t.json()}));case 6:o=n.sent,null==o.error&&(null==o.continuation?e.runAfterAnnoDataLoad(o):e.loadContinue(o));case 8:case"end":return n.stop()}}),n)})))()},loadContinue:function(t){var e=this;return Object(o["a"])(h().mark((function n(){var r,a,i,o,s;return h().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="KP BioIndex"==e.renderConfig["annotations server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["annotations server"],a=r+"/cont?token="+t.continuation,n.next=4,fetch(a).then((function(t){return t.json()}));case 4:i=n.sent,null==i.error&&(o=t.data,s=o.concat(i.data),i.data=s,null==i.continuation?e.runAfterAnnoDataLoad(i):e.loadContinue(i));case 6:case"end":return n.stop()}}),n)})))()},runAfterAnnoDataLoad:function(t){var e=this;this.annoData={},this.tissuesData={},t.data.map((function(t){e.annoData[t.annotation]||(e.annoData[t.annotation]={}),e.annoData[t.annotation][t.tissue]||(e.annoData[t.annotation][t.tissue]={region:[],ancestries:{}}),e.annoData[t.annotation][t.tissue].region.push(t),e.tissuesData[t.tissue]||(e.tissuesData[t.tissue]={}),e.tissuesData[t.tissue][t.annotation]||(e.tissuesData[t.tissue][t.annotation]={region:[],ancestries:{}}),e.tissuesData[t.tissue][t.annotation].region.push(t)})),null!=this.pkgData&&(l["default"].set(this.pkgData,"annoData",this.annoData),l["default"].set(this.pkgData,"tissuesData",this.tissuesData)),this.getGlobalEnrichment()},renderGE:function(){var t=this;this.GEPosData={};for(var e={},n=function(){var n=Object(s["a"])(a[r],2),i=n[0],o=n[1];e[i]={xMax:null,xMin:null,yMax:null,yMin:null},o.map((function(n){if(t.annoData[n.annotation][n.tissue])if(e[i][n.annotation]||(e[i][n.annotation]={}),t.renderConfig.ancestry){if(n.ancestry==t.renderConfig.ancestry){var r=-Math.log10(n.pValue),a=n.SNPs/n.expectedSNPs;e[i].yMax=null==e[i].yMax||a>e[i].yMax?a:e[i].yMax,e[i].yMin=null==e[i].yMin||a<e[i].yMin?a:e[i].yMin,e[i].xMax=null==e[i].xMax||r>e[i].xMax?r:e[i].xMax,e[i].xMin=null==e[i].xMin||r<e[i].xMin?r:e[i].xMin,e[i][n.annotation][n.tissue]=e[i][n.annotation][n.tissue]?e[i][n.annotation][n.tissue]:{pValue:null,fold:null};var o=e[i][n.annotation][n.tissue].pValue,s=e[i][n.annotation][n.tissue].fold;e[i][n.annotation][n.tissue].pValue=null==o||r>o?r:o,e[i][n.annotation][n.tissue].fold=null==s||a>s?a:s}}else{var l=-Math.log10(n.pValue),c=n.SNPs/n.expectedSNPs;e[i].yMax=null==e[i].yMax||c>e[i].yMax?c:e[i].yMax,e[i].yMin=null==e[i].yMin||c<e[i].yMin?c:e[i].yMin,e[i].xMax=null==e[i].xMax||l>e[i].xMax?l:e[i].xMax,e[i].xMin=null==e[i].xMin||l<e[i].xMin?l:e[i].xMin,e[i][n.annotation][n.tissue]=e[i][n.annotation][n.tissue]?e[i][n.annotation][n.tissue]:{pValue:null,fold:null};var u=e[i][n.annotation][n.tissue].pValue,d=e[i][n.annotation][n.tissue].fold;e[i][n.annotation][n.tissue].pValue=null==u||l>u?l:u,e[i][n.annotation][n.tissue].fold=null==d||c>d?c:d}}))},r=0,a=Object.entries(this.GEData);r<a.length;r++)n();var i,o,l=2*document.querySelector("#GEPlotWrapper").clientWidth,c=Object.keys(e).length,u=2
160,d=2*this.spaceBy,h=(this.plotMargin.topMargin+this.plotMargin.bottomMargin+u+d)*c,p=l-this.plotMargin.leftMargin-this.plotMargin.rightMargin,f=11;i=document.querySelector("#GEPlot"),i.setAttribute("width",l),i.setAttribute("height",h),i.setAttribute("style","width:"+l/2+"px;height:"+h/2+"px;"),o=i.getContext("2d");for(var _=0,g=function(){var e=Object(s["a"])(v[m],2),n=e[0],r=e[1],a=d+(t.plotMargin.topMargin+t.plotMargin.bottomMargin+u+d)*_;o.font="28px Arial",o.textAlign="left",o.fillStyle="#000000",o.fillText(n,f,a),t.renderGEAxis(o,p,u,r.xMax,r.xMin,r.yMax,r.yMin,a,f);var i=Object.keys(t.annoData),c=[],h=[];i.map((function(t){for(var e=0,n=Object.entries(r[t]);e<n.length;e++){var a=Object(s["a"])(n[e],2),i=(a[0],a[1]);h.push(i.pValue),c.push(i.fold)}})),c.sort((function(t,e){return e-t})),h.sort((function(t,e){return e-t}));var g=p/(r.xMax-r.xMin),y=u/(r.yMax-r.yMin);i.map((function(e,n){for(var i=t.compareGroupColors[n],d=0,p=Object.entries(r[e]);d<p.length;d++){var f=Object(s["a"])(p[d],2),_=f[0],m=f[1],v=t.plotMargin.leftMargin+(m.pValue-r.xMin)*g,b=a+t.plotMargin.topMargin+u-(m.fold-r.yMin)*y;o.fillStyle=i,o.lineWidth=0,o.beginPath(),o.arc(v,b,8,0,2*Math.PI),o.fill(),(m.fold>=c[2]||m.pValue>=h[2])&&(o.font="24px Arial",o.fillStyle="#000000",v>.75*l?(o.textAlign="right",o.fillText(_,v-14,b+6)):(o.textAlign="left",o.fillText(_,v+14,b+6)));var x=Math.round(b/2),w=Math.round(v/2);t.GEPosData[x]||(t.GEPosData[x]={}),t.GEPosData[x][w]||(t.GEPosData[x][w]={}),t.GEPosData[x][w][_]={pValue:null,fold:null},t.GEPosData[x][w][_]["pValue"]=m.pValue,t.GEPosData[x][w][_]["fold"]=m.fold,t.GEPosData[x][w][_]["annotationIndex"]=n}})),_++},m=0,v=Object.entries(e);m<v.length;m++)g()},renderGEAxis:function(t,e,n,r,a,i,o,s,l){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]),t.moveTo(this.plotMargin.leftMargin-l,s+this.plotMargin.topMargin),t.lineTo(this.plotMargin.leftMargin-l,s+this.plotMargin.topMargin+n+l);for(var c=(i-o)/5,u=n/5,d=0;d<6;d++){var h=s+this.plotMargin.topMargin+d*u,p=Math.floor(h);t.moveTo(this.plotMargin.leftMargin-2*l,p),t.lineTo(this.plotMargin.leftMargin-l,p),t.stroke(),t.textAlign="right",t.font="24px Arial";var f=i-o,_=f<=1?2:f<=50?1:0,g=this.utils.Formatters.decimalFormatter(o+d*c,_);g=g>=1e5?Math.round(.001*g)+"k":g,t.fillText(g,this.plotMargin.leftMargin-3*l,s+this.plotMargin.topMargin+n+l-d*u)}var m=this.renderConfig["global enrichment y axis label"]?this.renderConfig["global enrichment y axis label"]:"Fold(SNPs/expectedSNPs)";t.textAlign="center",t.rotate(-2*Math.PI/4),t.fillText(m,-(this.plotMargin.topMargin+n/2)-s,l+24),t.rotate(-2*Math.PI/4*3),t.moveTo(this.plotMargin.leftMargin-l,s+this.plotMargin.topMargin+n+l),t.lineTo(this.plotMargin.leftMargin+e,s+this.plotMargin.topMargin+n+l),t.stroke();for(var v=(r-a)/5,y=e/5,b=0;b<6;b++){var x=this.plotMargin.leftMargin+b*y,w=Math.floor(x);t.moveTo(w,s+n+this.plotMargin.topMargin+l),t.lineTo(w,s+n+this.plotMargin.topMargin+2*l),t.stroke(),t.textAlign="center",t.font="24px Arial";var C=r-a,P=C<=1?2:C<=50?1:0,k=this.utils.Formatters.decimalFormatter(a+b*v,P);k=k>=1e5?Math.round(.001*k)+"k":k,t.fillText(k,w,s+n+this.plotMargin.topMargin+4*l)}var M=this.renderConfig["global enrichment x axis label"]?this.renderConfig["global enrichment x axis label"]:"-Log10(p-value)";t.textAlign="center",t.fillText(M,this.plotMargin.leftMargin+e/2,s+n+6*l+this.plotMargin.topMargin+24)},array2Object:function(t,e){var n={};return e.map((function(e){var r=e[t];n[r]=e})),n},object2Array:function(){},renderByAnnotations:function(){var t=this,e=[];if(this.renderConfig["star key"]){var n=Array.isArray(this.plotData)?this.array2Object(this.renderConfig["star key"]["key"],this.plotData):this.plotData,r=this.renderConfig["star key"]["key"],a=this.renderConfig["star key"]["position"];this.pkgDataSelected.filter((function(t){return t.type==r})).map((function(t){return t.id})).map((function(t){e.push(n[t][a])}))}for(var i=0,o=2*this.spaceBy,l=7*this.spaceBy,c=this.spaceBy,u=2*this.spaceBy,d=2*this.spaceBy,h=this.viewingRegion.start,p=this.viewingRegion.end,f=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id})),_=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id})),g=0,m=Object.entries(this.annoData);g<m.length;g++){var v=Object(s["a"])(m[g],2),y=v[0],b=v[1];f.includes(y)&&(i+=o,i+=Object.keys(b).length*c,i+=l)}var x=document.querySelector("#annotationsPlotWrapper"),w=document.querySelector("#annotationsPlot");if(w&&x){var C,P,k=2*document.querySelector("#annotationsPlotWrapper").clientWidth,M=i+u+d,E=k-2*this.plotMargin.leftMargin,D=11,O=E/(p-h);C=document.querySelector("#annotationsPlot"),C.setAttribute("width",k),C.setAttribute("height",M),C.setAttribute("style","width:"+k/2+"px;
1height:"+M/2+"px;"),P=C.getContext("2d"),P.clearRect(0,0,k,M);for(var L=o,j=function(){var n=Object(s["a"])(A[S],2),r=n[0],a=n[1];if(f.includes(r)){P.font="28px Arial",P.textAlign="left",P.fillStyle="#000000",P.fillText(r,D,L);var i=Object.keys(a).length*c;L+=o,t.renderAnnoAxis(P,E,i,Number(p),Number(h),L,D),t.renderConfig["star key"]&&e.length>0&&t.renderStaredPositions(P,E,i,e,O,Number(p),Number(h),L,D);for(var u=0,d=function(){var e=Object(s["a"])(m[g],2),n=e[0],a=e[1],i=Math.ceil(L/t.spaceBy);t.annoPosData[i]?t.annoPosData[i]["tissue"]=n:t.annoPosData[i]={tissue:n,regions:{}},u%2==0&&(P.fillStyle="#00000010",P.fillRect(t.plotMargin.leftMargin,L,E,c)),u++,a.region.map((function(e){if(e.start<=p&&e.end>=h){var a=(e.start-h)*O+t.plotMargin.leftMargin;a=a<=t.plotMargin.leftMargin?t.plotMargin.leftMargin:a;var o=(e.end-h)*O+t.plotMargin.leftMargin;o=o>t.plotMargin.leftMargin+E?t.plotMargin.leftMargin+E:o;var s=o-a<2?2:o-a;_.indexOf(n)>-1?P.fillStyle="#FF0000":P.fillStyle=t.getColorIndex(r),P.fillRect(a,L,s,c-1);var l=Math.round(a/2)+"_"+Math.round((a+s)/2);t.annoPosData[i].regions[l]={start:e.start,end:e.end}}})),L+=c,_.indexOf(n)>-1&&(P.fillStyle="#000000",P.textAlign="start",P.textBaseline="middle",P.font="24px Arial",P.fillText(n,5,L-4))},g=0,m=Object.entries(a);g<m.length;g++)d();L+=l}},S=0,A=Object.entries(this.annoData);S<A.length;S++)j()}this.getOverlappingRegion()},renderAnnoAxis:function(t,e,n,r,a,i,o){t.beginPath(),t.lineWidth=1,t.strokeStyle="#999999",t.setLineDash([]),t.moveTo(this.plotMargin.leftMargin-o,i),t.lineTo(this.plotMargin.leftMargin-o,i+n+o),t.stroke();var s=Math.round(this.plotMargin.leftMargin+e+o);t.moveTo(s,i),t.lineTo(s,i+n+o),t.stroke(),t.strokeStyle="#999999",t.moveTo(this.plotMargin.leftMargin-o,i+n+o),t.lineTo(s,i+n+o),t.stroke();for(var l=Math.ceil((r-a)/5),c=e/5,u=0;u<6;u++){var d=this.plotMargin.leftMargin+u*c,h=Math.floor(d);t.moveTo(h,i+n+o),t.lineTo(h,i+n+2*o),t.stroke(),t.textAlign="center";var p=a+u*l;p=p>=1e5?Math.round(.001*p)+"k":p,t.font="24px Arial",t.fillStyle="#000000",t.fillText(p,h,i+n+4*o)}},renderStaredPositions:function(t,e,n,r,a,i,o,s,l){var c=this;t.beginPath(),t.lineWidth=1,t.strokeStyle="#FFAA00",t.setLineDash([3,3]),r.map((function(e){var r=(e-o)*a+c.plotMargin.leftMargin;t.moveTo(r,s-l),t.lineTo(r,s+n+l),t.stroke()}))}}});u()((function(){}));var f=p,_=(n("b4bc4"),n("2877")),g=Object(_["a"])(f,r,a,!1,null,null,null);e["a"]=g.exports},"25ae":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.plotData&&t.renderConfig?n("div",{staticClass:"egl-m-plot-content",style:"height:"+t.renderConfig["height"]+"px;"},[n("div",{staticClass:"bunch-by-locus"},[n("div",{staticClass:"bunch-ui"},[n("input",{staticClass:"form-control",attrs:{type:"checkbox",id:t.plotId+"_groupByLocusCheck"},on:{click:function(e){return t.renderPlot(t.plotId)}}}),t._v(" Render by region ")]),n("div",{staticClass:"bunch-ui"},[t._v(" Count region by: "),n("select",{staticClass:"form-control",attrs:{id:t.plotId+"_mergeByNumber"},on:{change:function(e){return t.renderPlot(t.plotId)}}},[n("option",{attrs:{value:"1"}},[t._v("1")]),n("option",{attrs:{value:"1000"}},[t._v("1K")]),n("option",{attrs:{value:"10000"}},[t._v("10K")]),n("option",{attrs:{value:"100000"}},[t._v("100K")]),n("option",{attrs:{value:"1000000"}},[t._v("1M")]),n("option",{attrs:{value:"10000000"}},[t._v("10M")])]),t._v(" bp ")])]),n("div",{staticClass:"y-axis-label"},[t._v(t._s(t.renderConfig["y axis label"]))]),n("div",{staticClass:"egl_m_plot_y",attrs:{id:t.plotId+"_egl_m_plot_y_axis"}}),n("div",{staticClass:"egl-m-plot",attrs:{id:t.plotId+"_egl_m_plot"}}),n("div",{staticClass:"x-axis-label"},[t._v(t._s(t.renderConfig["x axis label"]))])]):t._e()},a=[],i=(n("caad"),n("d81d"),n("14d9"),n("4e82"),n("a9e3"),n("b680"),n("2532"),n("498a"),n("a573"),n("2b0e")),o=n("1157"),s=n.n(o),l=n("b1e0");i["default"].use(l["a"]);var c=i["default"].component("research-m-plot",{props:["plotData","renderConfig","utils"],data:function(){return{plotId:Math.floor(1e10*Math.random())}},mounted:function(){this.renderPlot(this.plotId)},computed:{},watch:{plotData:function(){this.renderPlot(this.plotId)}},methods:{renderPlot:function(t){if(this.plotData&&this.renderConfig){var e=document.getElementById("".concat(t,"_groupByLocusCheck")).checked;document.getElementById("".concat(t,"_egl_m_plot")).innerHTML="";var n={1:248956422,2:242193529,3:198295559,4:190214555,5:181538259,6:170805979,7:159345973,8:145138636,9:138394717,10:133797422,11:135086622,12:133275309,13:114364328,14:107043718,15:101991189,16:90338345,17:83257441,18:80373285,19:58617616,20:64444167,21:46709983,22:50818468,X:156040895,Y:57227415},r=["#08306b","#41ab5d","#000000","#f16913","#3f007d","#cb181d"],a=0;for(var i in n)a+=n[i];var o=document.getElementById("".concat(t,"_egl_m_plot"));for(var s in n){var l=n[s]/a*100,c='<div id="'+t+"_chr_wrapper_"+s+'" class="chr_wrapper" style="width:'+l+'%"> <div id="'+t+"_chr_dots_"+s+'" class="chr_dots_wrapper"></div> <div class="chr_number" onclick="expandChr(\''+s+"', '"+t+"');\">"+s+"</div> </div>";o.innerHTML+=c}var u=this.renderConfig["x axis field"],d=this.renderConfig["y axis field"],h=this.renderConfig["render by"],p=this.renderConfig["link to"],f=[];this.plotData.map((function(t){f.push(Number(t[d]))}
1)),f.sort((function(t,e){return e-t}));var _=f[0],g=f[f.length-1],m=this.renderConfig["hover content"],v="",y=_%1!=0?null===_||void 0===_?void 0:_.toFixed(3):_;v+="<div class='tick'><span class='tick-num'>"+y+"</span></div>";for(var b=1;b<5;b++){var x=(_-g)/4,w=_-x*b,C=w%1!=0?w.toFixed(3):w;v+="<div class='tick'><span class='tick-num'>"+C+"</span></div>"}if(document.getElementById("".concat(t,"_egl_m_plot_y_axis")).innerHTML=v,0==e)this.plotData.map((function(e){var a=1==e[u].includes("-")?"region":"snp";if(""!=e[u]){var i,o,s,l=e[u].split(":")[0].trim();if("region"==a){var c=e[u].split(":")[1].split("-");i=(Number(c[0])+Number(c[1]))/2,o=Number(c[0]),s=Number(c[1])}else i=Number(e[u].split(":")[1]),o=i-5e4,s=i+5e4;var f=i/n[l]*100,v=100-(Number(e[d])-g)/(_-g)*100,y='<div class="dot-content"><strong>'+e[h]+"</strong>";null!=m&&m.map((function(t){if(1==t.includes("features")){var n=e.features[t.split(":")[1]][0];for(var r in n)y+="<div><strong class='property-key'>"+r+"</strong>: "+n[r]+"</div>"}else y+="<div><strong class='property-key'>"+t+"</strong>: "+e[t]+"</div>"})),y+="</div>";var b=r[l%r.length],x="75";document.getElementById(t+"_chr_dots_"+l).innerHTML+=void 0!=p?'<a href="'+p+"?chr="+l+"&end="+s+"&start="+o+'" class="dot" target="_blank" style="left:calc('+f+"% - 6px);top:calc("+v+"% - 6px); background-color:"+b+x+'">'+y+"</a>":'<a href="javascript:;" class="dot" style="left:calc('+f+"% - 6px);top:calc("+v+"% - 6px); background-color:"+b+x+'">'+y+"</a>"}}));else if(1==e){var P={},k=document.getElementById("".concat(t,"_mergeByNumber")).value;for(var M in n)P[M]={};for(var E in P["NA"]={},this.plotData.map((function(t){var e,n=t[u].split(":"),r=null==n[0]||""==n[0]||void 0==n[0]?"NA":n[0].trim();e=n[1]?1==n[1].includes("-")?Math.round((Number(n[1].split("-")[0].trim())+Number(n[1].split("-")[1].trim()))/2/k):Math.round(Number(n[1])/k):0,P[r][e]||(P[r][e]=[]),P[r][e].push(t)})),P){var D=P[E];if("NA"!=E){var O=function(){var e=L*k-Math.round(k/2),a=L*k+Math.round(k/2),i=L*k/n[E]*100,o=[];D[L].map((function(t){o.push(t[d])})),o.sort((function(t,e){return e-t}));var s=100-(Number(o[0])-g)/(_-g)*100,l=100-(Number(o[o.length-1])-g)/(_-g)*100-s,c=l<5?"10px !important":"calc("+l+"% + 10px) !important",u=r[E%r.length],p="75",f='<div class="dot-content">';D[L].map((function(t){f+="<strong>"+t[h]+"</strong>",null!=m&&m.map((function(e){if(1==e.includes("features")){var n=t.features[e.split(":")[1]][0];for(var r in n)f+="<div><strong class='property-key'>"+r+"</strong>: "+n[r]+"</div>"}else f+="<div><strong class='property-key'>"+e+"</strong>: "+t[e]+"</div>"}))})),f+="</div>";var v=D[L].length;document.getElementById(t+"_chr_dots_"+E).innerHTML+='<a href="/region.html?chr='+E+"&end="+a+"&start="+e+'" target="_blank" class="dot" style="left:calc('+i+"% - 6px);top:calc("+s+"% - 6px); height:"+c+"; background-color:"+u+p+"\"><span class='num-of-genes'>"+v+"</span>"+f+"</a>"};for(var L in D)O()}}}}}}});s()((function(){var t=document.createElement("script");t.text="let expandChr = function(CHR, PLOTID) { let wrapper = PLOTID+'_chr_wrapper_'+CHR; let element = document.getElementById(wrapper); if (element.classList.contains('expanded-chr') == false) { let elements = document.getElementsByClassName('chr_wrapper'); let x = elements.length; for (let i = 0; i < x; i++) { if (elements[i].classList.contains('collapsed-chr') == false) { elements[i].classList.add('collapsed-chr'); } if (elements[i].classList.contains('expanded-chr') == true) { elements[i].classList.remove('expanded-chr'); } } element.classList.add('expanded-chr'); } else if(element.classList.contains('expanded-chr') == true) { element.classList.remove('expanded-chr'); let elements = document.getElementsByClassName('chr_wrapper'); let x = elements.length; for (let i = 0; i < x; i++) { if (elements[i].classList.contains('collapsed-chr') == true) { elements[i].classList.remove('collapsed-chr'); } } } }",document.getElementsByTagName("head")[0].appendChild(t)}));var u=c,d=n("2877"),h=Object(d["a"])(u,r,a,!1,null,null,null);e["a"]=h.exports},"25f9":function(t,e,n){"use strict";n("b1f0")},2623:function(t,e,n){},2675:function(t,e,n){},"27d5":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"col",staticStyle:{padding:"5px 7px 5px 7px"}},[t._t("default",(function(){return[t._v(" "+t._s(t.field)+" ")]})),t.options&&Array.isArray(t.options)?n("autocomplete",{attrs:{matches:t.options,labelFormatter:t.labelFormatter,disabled:t.disabled,placeholder:t.placeholder},on:{"item-select":function(e){return t.updateFilter(e)},"input-change":function(e){return t.$parent.$emit("input-change",e)}}}):n("b-form-input",{attrs:{disabled:t.disabled,placeholder:t.placeholder},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.updateFilter(t.filterThreshold)}},model:{value:t.filterThreshold,callback:function(e){t.filterThreshold=e},expression:"filterThreshold"}})],2)},a=[],i=n("5530"),o=n("53ca"),s=(n("99af"),n("d3b7"),n("498a"),n("0643"),n("4e3e"),n("159b"),n("2b0e")),l=n("bb0b"),c=n("5f5b"),u=n("b1e0");n("f9e3"),n("2dd8");s["default"].use(c["a"]),s["default"].use(u["b"]);var d=s["default"].component("filter-control-template",{props:{value:Object,field:String,placeholder:String,predicate:Function,options:Array,multiple:Boolean,inclusive:Boolean,color:{type:String},pillFormatter:{type:Function,default:function(t){return"".concat(t.field," = ").concat(t.threshold)}},labelFormatter:{type:Function,default:function(t){return t}},splitBy:{type:String,default:""},type:{type:String},clear:{type:Boolean,default:!0},disabled:Boolean,computedField:Function},components:{Autocomplete:l["a"]},data:function(){return{filterDefinition:{field:this.field,placeholder:this.placeholder,label:this.pillFormatter,pillFormatter:this.pillFormatter,labelFormatter:this.labelFormatter,color:this.color,predicate:this.predicate,multiple:!(!this.multiple&&!this.splitBy),inclusive:!(!this.inclusive&&!this.splitBy),computedField:this.computedField},filterThreshold:this.default}},created:function(){this.filterThreshold&&this.updateFilter(this.filterThreshold)},mounted:function(){this.$parent.$parent.$emit("filter-mounted",this.filterDefinition)}
1,methods:{validateInput:function(t){if(this.type){if("number"===this.type)return!isNaN(t);if(Object(o["a"])(t)!==this.type)return!1}return!0},updateFilter:function(t){var e=this;if(null!==t){var n=this.validateInput(t);n&&(this.splitBy?t.split(",").forEach((function(t){return e.$parent.$parent.$emit("change",t.trim(),Object(i["a"])({},e.filterDefinition))})):this.$parent.$parent.$emit("change",t,Object(i["a"])({},this.filterDefinition)))}this.clear&&(this.filterThreshold=null)}}}),h=d,p=n("2877"),f=Object(p["a"])(h,r,a,!1,null,null,null);e["a"]=f.exports},"28fb":function(t,e,n){},"29e0":function(t,e,n){},"2cc8":function(t,e,n){"use strict";var r=n("53ca"),a=n("3835"),i=n("1da1"),o=(n("d9e2"),n("7db0"),n("d81d"),n("14d9"),n("fb6a"),n("b0c0"),n("e9c4"),n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("fffc"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("98ab"),n("2443"));function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,l,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,l)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[l];
1if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,l,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}e["a"]={namespaced:!0,state:function(){return{phenotypes:[],variants:[],masks:[],covariances:[],runTestsError:""}},mutations:{setPhenotypes:function(t,e){t.phenotypes=e},setCovariances:function(t,e){t.covariances=e},setError:function(t,e){t.runTestsError=e}},actions:{getPhenotypes:function(t){return Object(i["a"])(s().mark((function e(){var n,r;return s().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.state,n=t.commit,e.next=3,fetch("https://ld.hugeamp.org/aggregation/metadata").then((function(t){return t.json()}));case 3:r=e.sent,n("setPhenotypes",r.data[0].phenotypeDatasets[0].phenotypes);case 5:case"end":return e.stop()}}),e)})))()},getCovariances:function(t,e){return Object(i["a"])(s().mark((function n(){var r,i,l,c,u,d,h,p,f,_,g;return s().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.variants,i=e.phenotype,l=e.dataset,c=e.tests,u=e.build,d=void 0===u?"GRCh37":u,h={},p={},f=t.rootGetters.region,"55k"==l?p={chrom:f.chromosome,start:f.start,stop:f.end,genotypeDataset:1,phenotypeDataset:1,variantFormat:"COLONS",phenotype:i,samples:"ALL",genomeBuild:d,maskDefinitions:[{id:1,name:"Fetch Data",description:"Default",genome_build:d,group_type:"GENE",identifier_type:"ENSEMBL",groups:{VARIANTS:r}}]}:(_=[{phenotype:"FG",id:6},{phenotype:"T2D",id:7},{phenotype:"FI",id:8}],p={chrom:f.chromosome,start:f.start,stop:f.end,summaryStatisticDataset:_.find((function(t){return t.phenotype===i})).id,variantFormat:"COLONS",samples:"ALL",genomeBuild:d,maskDefinitions:[{id:1,name:"Fetch Data",description:"Default",genome_build:d,group_type:"GENE",identifier_type:"ENSEMBL",groups:{VARIANTS:r}}]}),n.next=7,fetch("https://ld.hugeamp.org/aggregation/covariance",{method:"POST",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify(p)}).then((function(t){if(t.ok)return t.json();throw new Error("Request to LD server failed")})).then((function(t){h=t.data.nSamples;var e=o["helpers"].parsePortalJSON(t),n=Object(a["a"])(e,2),r=n[0],i=n[1],s=new o["helpers"].PortalTestRunner(r,i,c);return s.run()}));case 7:return g=n.sent,n.abrupt("return",{phenotype:i,samples:h,data:g});case 9:case"end":return n.stop()}}),n)})))()},runTests:function(t,e){return Object(i["a"])(s().mark((function n(){var r,a,i,o,l,c;return s().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.variants,a=e.phenotypes,i=e.dataset,o=e.tests,l=a.map((function(e){return t.dispatch("getCovariances",{variants:r,phenotype:e,dataset:i,tests:o})})),n.prev=2,n.next=5,Promise.all(l);case 5:c=n.sent,t.commit("setError",""),t.commit("setCovariances",c),n.next=13;break;case 10:n.prev=10,n.t0=n["catch"](2),t.commit("setError",n.t0);case 13:case"end":return n.stop()}}),n,null,[[2,10]])})))()}}}},"2d5b":function(t,e,n){"use strict";n("eabe")},"2d85":function(t,e,n){"use strict";n.d(e,"b",(function(){return d}));var r=function(){var t=this,e=this,n=e.$createElement,r=e._self._c||n;return r("lz-panel",{ref:"panel",attrs:{panelClass:e.panelClass},on:{updated:function(e){return t.panelId=e.panelId}}})},a=[],i=n("3835"),o=(n("99af"),n("d81d"),n("6b93"),n("a573"),n("2b0e")),s=n("bacd"),l=n("06a9"),c=n("67a3"),u=o["default"].component("lz-catalog-annotations-panel",{components:{LzPanel:s["a"]},props:{phenotype:String,title:String},data:function(){return{panelId:null,panelClass:null}},created:function(){var t=this;this.panelClass=d(this.phenotype,this.title,(function(e){return t.$emit("input",e)}),(function(e){return t.$emit("resolve",e)}),(function(e){return t.$emit("error",e)})),this.addPanels=this.$parent.addPanels,this.plot=this.$parent.plot},watch:{phenotype:function(t,e){this.panelId&&this.$parent.plot.removePanel(this.panelId),this.updatePanel()}}});function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=function(t){return'$..data_layers[?(@.tag === "'.concat(t,'")]')},u=s("gwascatalog"),d=new c["b"]("annotation_catalog",{title:{text:e?"".concat(e," Variant Catalog"):"Variant Catalog",style:{"font-size":"18px"},x:-.5},y_index:0}).addFields(u,"assoc",["pValue","position","consequence","nearest","beta"]);d.addProperty("".concat(u),"match",{send:"catalog:pos",receive:"catalog:pos"}).addProperty("".concat(u),"x_axis",{field:"assoc:position"}).addRule("".concat(u),"filter",{field:"catalog:pos",operator:">",value:0}).addRule("".concat(u,".color"),{field:"lz_highlight_match",scale_function:"if",parameters:{field_value:!0,then:"red"}},!0).addRule("".concat(u,".color"),"#0000CC",!0);var h=function(t){function e(t){var e=t.split(":"),n=Object(i["a"])(e,4),r=n[0],a=n[1],o=n[2],s=n[3];return"".concat(r,":").concat(a,"_").concat(o,"/").concat(s)}return t.map((function(t){return{chromosome:t.chromosome,id:e(t.varId),position:t.position,pValue:t.pValue,log_pvalue:-1*Math.log10(t.pValue),variant:e(t.varId),ref_allele:t.reference,consequence:t.consequence,beta:t.beta,nearest:t.nearest}}))},p=new c["a"](l["b"]).withParams(Object(c["d"])("associations",t,h,void 0,n,a,r,o)),f=new c["c"](d,p).initialize("assoc");return f.unwrap}var h=u,p=n("2877"),f=Object(p["a"])(h,r,a,!1,null,null,null);e["a"]=f.exports},"2f76":function(t,e,n){"use strict";n("3d54")},3473:function(t,e,n){"use strict";n.d(e,"b",(function(){return u}));var r=function(){var t=this,e=this,n=e.$createElement,r=e._self._c||n;return r("lz-panel",{ref:"panel",attrs:{panelClass:e.panelClass},on:{updated:function(e){return t.panelId=e.panelId}}})},a=[],i=(n("a4d3"),n("e01a"),n("99af"),n("4de4"),n("d81d"),n("b0c0"),n("6b93"),n("d3b7"),n("0643"),n("2382"),n("a573"),n("2b0e")),o=n("bacd"),s=n("06a9"),l=n("67a3"),c=i["default"].component("lz-phewas-panel",{components:{LzPanel:o["a"]},props:{id:{type:String,required:!0},type:{type:String,required:!0},phenotypeMap:{type:Object,required:!0}},created:function(){var t=this;this.panelClass=u(this.id,this.type,this.phenotypeMap,(function(e){return t.$emit("input",e)}),(function(e){return t.$emit("resolve",e)}),(function(e){return t.$emit("error",e)})),this.addPanels=this.$parent.addPanels,this.plot=this.$parent.plot},watch:{id:function(t){this.panelId&&this.$parent.plot.removePanel(this.panelId),this.$refs.panel.updatePanel()},type:function(){this.panelId&&this.$parent.plot.removePanel(this.panelId),this.$refs.panel.updatePanel()}}});function u(t,e,n,r,a,i,o){var c={gene:"gene-associations",variant:"phewas-associations"}[e],u='$..data_layers[?(@.id === "phewaspvalues")]',d=new l["b"]("phewas",{axes:{y1:{label:"-log10(p)"}}}).addFields(u,"phewas",["pValue","phenotype"].concat("phewas-associations"===c?"beta":[]));d.setProperty("".concat(u,".tooltip"),{widgets:[{type:"toggleloglog",color:"gray",position:"right"}]});var h=function(t){var e=t.filter((function(t){return!!n[t.phenotype]})),r=e.map((function(t){var e=n[t.phenotype];return{id:e.name,log_pvalue:-Math.log10(t.pValue),trait_group:e.group,trait_label:e.description,pValue:t.pValue,phenotype:e.name,beta:t.beta}}));return r},p=new l["a"](s["b"]).withParams(Object(l["d"])(c,t,h,void 0,r,i,a,o)),f=new l["c"](d,p).initialize("phewas");return f.unwrap}var d=c,h=n("2877"),p=Object(h["a"])(d,r,a,!1,null,null,null);e["a"]=p.exports},"34aa":function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("2909"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("caad"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("14d9"),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("13d5"),core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("6062"),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("1e70"),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("79a4"),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("c1a1"),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("8b00"),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("a4e7"),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("1e5a"),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_13__),
1core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("72c3"),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("5b81"),core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("0643"),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("a573"),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_esnext_iterator_reduce_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("9d4a"),core_js_modules_esnext_iterator_reduce_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_esnext_iterator_reduce_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_21__),vue__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("2b0e"),jquery__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("1157"),jquery__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_23__),d3__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("5698"),lodash__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("2ef0"),lodash__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_25__),bootstrap_vue__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("b1e0");vue__WEBPACK_IMPORTED_MODULE_22__["default"].use(bootstrap_vue__WEBPACK_IMPORTED_MODULE_26__["a"]),__webpack_exports__["a"]=vue__WEBPACK_IMPORTED_MODULE_22__["default"].component("research-volcano-plot-vector",{props:["renderData","renderConfig","margin","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{canvasId:function(t){}},methods:{renderPlot:function renderPlot(){var _this=this,renderConfig=this.renderConfig,calculateCondition=function calculateCondition(EXP,LENGTH){var calcString="";EXP.map((function(t){var e=["+","-","*","/","(",")"].includes(t)||"number"===typeof t?t:"string"===typeof t?"data length"==t?LENGTH:t:null;calcString+=e}));var threshold=eval(calcString);return threshold},conditions=[["x condition","lower than"],["x condition","greater than"],["y condition","lower than"],["y condition","greater than"]];conditions.map((function(t){if(renderConfig[t[0]][t[1]]&&"calculate"==renderConfig[t[0]][t[1]]){var e=renderConfig[t[0]]["condition calculate"][t[1]];renderConfig[t[0]][t[1]]=calculateCondition(e,_this.renderData.length)}}));var wrapperClass=".vector-wrapper-".concat(this.canvasId),wrapperId="vector_wrapper_".concat(this.sectionId),margin=this.margin,width=this.renderConfig["width"],height=this.renderConfig["height"],svg=d3__WEBPACK_IMPORTED_MODULE_24__["select"](wrapperClass).append("svg").attr("id","vector_volcano_plot_"+this.sectionId).attr("width",width+margin.left+margin.r
1ight).attr("height",height+margin.top+margin.bottom),yAxisField=this.renderConfig["y axis field"],xAxisField=this.renderConfig["x axis field"],renderField=this.renderConfig["render by"],sumstat=[];this.renderData.map((function(t){var e={key:t[renderField],value:{}};e.value["x"]=t[xAxisField],e.value["y"]=t[yAxisField],sumstat.push(e)})),svg.append("g").attr("id","axisLabelsGroup").attr("transform","translate(0,0)"),svg.select("#axisLabelsGroup").style("font-family","Arial").style("font-size",12).style("text-anchor","middle"),svg.select("#axisLabelsGroup").append("text").attr("x",margin.left+width/2).attr("y",height+margin.top+margin.bottom-20).text(this.renderConfig["x axis label"]),svg.select("#axisLabelsGroup").append("text").attr("transform",(function(t){return"translate("+(margin.bump+20)+","+(margin.top+height/2)+")rotate(-90)"})).attr("x",0).attr("y",0).text(this.renderConfig["y axis label"]);var xVals=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["a"])(new Set(sumstat.map((function(t){return t.value.x})))),yVals=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__["a"])(new Set(sumstat.map((function(t){return t.value.y})))),xMaxVal=xVals.reduce((function(t,e){return t>e?t:e})),xMinVal=xVals.reduce((function(t,e){return t<e?t:e})),yMaxVal=yVals.reduce((function(t,e){return t>e?t:e})),yMinVal=yVals.reduce((function(t,e){return t<e?t:e})),vals=[xMaxVal,xMinVal,yMaxVal,yMinVal];vals.map((function(t){t=Math.round(100*t)/100}));var x=d3__WEBPACK_IMPORTED_MODULE_24__["scaleLinear"]().domain([xMinVal-.05*xMaxVal,xMaxVal+.05*xMaxVal]).range([margin.left,width+margin.left]),y=d3__WEBPACK_IMPORTED_MODULE_24__["scaleLinear"]().domain([yMinVal-.05*yMaxVal,yMaxVal+.05*yMaxVal]).range([height+margin.top,margin.top]);svg.attr("transform","translate(0,0)").append("g").attr("id","axisGroup"),svg.select("#axisGroup").append("g").attr("transform",(function(t){return"translate("+(margin.left-margin.bump)+",0)"})).call(d3__WEBPACK_IMPORTED_MODULE_24__["axisLeft"](y)),svg.select("#axisGroup").append("g").attr("transform",(function(t){return"translate(0,"+(height+margin.top+margin.bump)+")"})).call(d3__WEBPACK_IMPORTED_MODULE_24__["axisBottom"](x)),renderConfig["x condition"]&&(renderConfig["x condition"]["greater than"]&&svg.select("#axisGroup").append("line").attr("style","stroke-dasharray: 3,3").attr("x1",x(renderConfig["x condition"]["greater than"])).attr("y1",margin.top).attr("x2",x(renderConfig["x condition"]["greater than"])).attr("y2",margin.top+height).attr("stroke","#cccccc").style("stroke-width",1),renderConfig["x condition"]["lower than"]&&svg.select("#axisGroup").append("line").attr("style","stroke-dasharray: 3,3").attr("x1",x(renderConfig["x condition"]["lower than"])).attr("y1",margin.top).attr("x2",x(renderConfig["x condition"]["lower than"])).attr("y2",margin.top+height).attr("stroke","#cccccc").style("stroke-width",1)),renderConfig["y condition"]&&(renderConfig["y condition"]["greater than"]&&svg.select("#axisGroup").append("line").attr("style","stroke-dasharray: 3,3").attr("x1",margin.left).attr("y1",y(renderConfig["y condition"]["greater than"])).attr("x2",margin.left+width).attr("y2",y(renderConfig["y condition"]["greater than"])).attr("stroke","#cccccc").style("stroke-width",1),renderConfig["y condition"]["lower than"]&&svg.select("#axisGroup").append("line").attr("style","stroke-dasharray: 3,3").attr("x1",margin.left).attr("y1",y(renderConfig["y condition"]["lower than"])).attr("x2",margin.left+width).attr("y2",y(renderConfig["y condition"]["lower than"])).attr("stroke","#cccccc").style("stroke-width",1)),sumstat.map((function(t){var e,n=0;if(renderConfig["x condition"]){var r=renderConfig["x condition"].combination,a=t.value.x;"greater than"==r&&a>renderConfig["x condition"]["greater than"]&&n++,"lower than"==r&&a<renderConfig["x condition"]["lower than"]&&n++,"and"==r&&a>renderConfig["x condition"]["greater than"]&&a<renderConfig["x condition"]["lower than"]&&n++,("or"==r&&a>renderConfig["x condition"]["greater than"]||a<renderConfig["x condition"]["lower than"])&&n++}if(renderConfig["y condition"]){var i=renderConfig["y condition"].combination,o=t.value.y;"greater than"==i&&o>renderConfig["y condition"]["greater than"]&&n++,"lower than"==i&&o<renderConfig["y condition"]["lower than"]&&n++,"and"==i&&o>renderConfig["y condition"]["greater than"]&&o<renderConfig["y condition"]["lower than"]&&n++,("or"==i&&o>renderConfig["y condition"]["greater than"]||o<renderConfig["y condition"]["lower than"])&&n++}switch(n){case 0:e="#00000050";break;case 1:e="#09910980";break;case 2:e="#ff003780";break}n>=2&&svg.select("#axisGroup").append("text").attr("x",x(t.value.x)).attr("y",y(t.value.y)-2*margin.bump).style("text-anchor","middle").style("font-family","Arial").style("font-size",11).style("fill","#000000").text(t.key),svg.select("#axisGroup").append("circle").attr("cx",x(t.value.x)).attr("cy",y(t.value.y)).attr("r",4).style("fill",e)}
1))}}}),jquery__WEBPACK_IMPORTED_MODULE_23___default()((function(){}))},"34e5":function(t,e,n){"use strict";n("f521")},3547:function(t,e,n){},"36ad":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.bioindex_dev?n("img",{staticClass:"dev-flag",attrs:{src:"/images/dev_flag.svg"}}):t._e(),n("google-analytics"),n("alert"),t.diseaseGroup?n("div",{staticClass:"container-fluid"},[t.diseaseGroup.default?n("div",{staticClass:"row amp-banner-2021"},[n("a",{attrs:{href:"https://fnih.org/our-programs/accelerating-medicines-partnership-amp/amp-common-metabolic-disorders/",target:"_blank",rel:"noopener noreferrer"}},[n("img",{staticStyle:{width:"500px","margin-left":"15px","margin-top":"15px"},attrs:{src:"//kp4cd.org/sites/default/files/vueportal/amp_text.svg"}})])]):t._e(),t.diseaseGroup.portalGroup&&t.diseaseGroup.portalGroup!=t.diseaseGroup.name?n("div",{staticClass:"row amp-banner-2021",staticStyle:{height:"50px",display:"block"}},[n("a",{attrs:{href:t.url2Md}},[n("div",{staticStyle:{padding:"5px","text-align":"center",height:"50px"}},[n("img",{class:"portals-2-mdkp-logo",attrs:{src:"//kp4cd.org/sites/default/files/vueportal/portals2mdkp_banner.svg"}})])])]):t._e(),n("div",{class:"row "+t.diseaseGroup.name+"kp-header"},[n("div",{class:t.diseaseGroup.name+"kp-logo-wrapper col-md-4"},[n("a",{attrs:{href:"/"}},[t.frontContents.field_banner_logo?n("img",{class:t.diseaseGroup.name+"kp-logo",attrs:{src:"//kp4cd.org/sites/default/files/vueportal/"+t.frontContents.field_banner_logo}}):n("img",{staticClass:"mdkp-logo",attrs:{src:"//kp4cd.org/sites/default/files/vueportal/mdkp_header_logo.svg"}})]),"a2f"==t.diseaseGroup.name?["front"==t.page?n("span",{staticClass:"disease-in-session"},[t._v(t._s(t.$store.state.diseaseInSession))]):t._e(),"front"!=t.page&&t.$store.state.bioPortal.diseaseSystems.length>0?n("disease-systems",{attrs:{page:t.page,diseases:t.$store.state.bioPortal.diseaseSystems,"disease-groups":t.$store.state.bioPortal.diseaseGroups,phenotypes:t.rawPhenotypes,"disease-in-session":t.$store.state.diseaseInSession,"phenotype-correlation":t.$store.state.phenotypeCorrelation}}):t._e()]:t._e()],2),n("div",{class:"kp-menu-wrapper col-md-8"},[t.diseaseGroup.name?n("menu-item",{attrs:{group:t.diseaseGroup.name,name:"header.menu","content-map":t.$store.state.bioPortal.documentations}}):t._e(),n("div",{staticClass:"login-menu-wrapper"},[n("ul",[t.user?n("li",[n("a",{class:t.diseaseGroup.name+"kp-login",attrs:{href:"/logout",title:t.user}},[t._v("Logout")])]):n("li",[n("a",{class:t.diseaseGroup.name+"kp-login",attrs:{href:"/login"},on:{click:function(e){return e.preventDefault(),t.loginUser.apply(null,arguments)}}},[t._v("Login")])])])])],1)])]):t._e()],1)},a=[],i=(n("a15b"),n("b0c0"),n("2b0e")),o=n("2b27"),s=n.n(o),l=n("de86"),c=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"analytics"}})},u=[],d=n("a584");i["default"].use(d["a"],{config:{id:"G-B7R7YKFCZL",params:{send_page_view:!0}},appName:"HuGeAMP",pageTrackerScreenviewEnabled:!0});var h={name:"GoogleAnalytics"},p=h,f=n("2877"),_=Object(f["a"])(p,c,u,!1,null,null,null),g=_.exports,m=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"portal-menu-wrapper",domProps:{innerHTML:t._s(t.menuContent)}})},v=[],y=n("06df"),b=i["default"].component("menu-item",{props:["name","contentFill","contentMap"],data:function(t){return{}},computed:{menuContent:function(){if(this.contentMap&&this.contentMap[this.name]){var t=this.contentMap[this.name].content,e=this.contentFill||{},n=y["a"].makeConverter(t,e,this.name);return n.makeHtml(t)}return""}},watch:{},methods:{}}),x=b,w=(n("a378"),Object(f["a"])(x,m,v,!1,null,"a8219914",null)),C=w.exports,P=n("228b"),k=n("e60d"),M=n("8d29");i["default"].use(s.a);var E=i["default"].component("PageHeader",{components:{GoogleAnalytics:g,MenuItem:C,DiseaseSystems:P["a"]},mixins:[M["a"]],props:{diseaseGroup:{type:Object,default:null},frontContents:{type:Object,default:function(){return{}}},rawPhenotypes:{type:Array,default:function(){return[]}},page:{type:String,default:""}},data:function(){return{bioindex_dev:!1}},computed:{currentPage:function(){return window.location.pathname},url2Md:function(){return this.diseaseGroup&&this.diseaseGroup.portalGroup?l["a"].urlWithSubdomain(this.diseaseGroup.portalGroup).href:l["a"].urlWithSubdomain().href}},watch:{diseaseGroup:function(t){if(t&&t.title){var e=document.title.split(" | ");e[e.length-1]=t.title,document.title=e.join(" | ");for(var n=document.getElementsByTagName("link"),r=0;r<n.length;r++)"shortcut icon"==n[r].rel&&(n[r].href="/images/favicons/".concat(t.name,"/ico.png")),"icon"==n[r].rel&&(n[r].href="/images/favicons/".concat(t.name,"/ico.svg"))}}},created:function(){i["default"].$cookies.isKey("session")&&this.$store.dispatch("bioPortal/getUser",i["default"].$cookies.get("session")),-1!=k["a"].indexOf("dev")&&(this.bi
1oindex_dev=!0),this.$store.dispatch("bioPortal/getDocumentations")}}),D=E,O=(n("9958"),Object(f["a"])(D,r,a,!1,null,"a462a87a",null));e["a"]=O.exports},"37aa":function(t,e,n){"use strict";n("9e27")},"38b2":function(t,e,n){},3929:function(t,e,n){},"3bb9":function(t,e,n){},"3bd8":function(t,e,n){"use strict";n("9171")},"3cd7":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[null!=t.searchingRegion?n("div",{staticClass:"col-md-12 annotations-plot-wrapper"},[n("div",{staticClass:"col-md-12 anno-plot-wrapper"},[n("div",{attrs:{id:"annotationsUIWrapper"}},[t._m(0),n("div",{staticClass:"filtering-ui-wrapper add-content",staticStyle:{width:"100%",padding:"0 10px","text-align":"left"}},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col",staticStyle:{padding:"2px"}},[n("div",{staticClass:"label",staticStyle:{display:"inline-block","margin-right":"10px"}},[t._v(" Select Annotation ")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.annotationOnFocus,expression:"annotationOnFocus"}],staticClass:"custom-select",on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.annotationOnFocus=e.target.multiple?n:n[0]},function(e){return t.addAnnoTrack(e)}]}},[n("option",{attrs:{value:"null"}},[t._v(" "+t._s("Show all")+" ")]),t._l(t.annoData,(function(e,r){return n("option",{key:r,domProps:{value:r,innerHTML:t._s(r)}})}))],2)])]),t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0&&!t.renderConfig["no search key bubbles"]?n("div",{staticStyle:{position:"absolute",right:"10px",top:"7px"}},[t._l(t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})),(function(e){return[n("span",{key:e.id,class:"btn search-bubble ",style:"background-color:"+t.getColorIndex(e.id),domProps:{innerHTML:t._s(e.id+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeAnnoTrack(e.id)}}})]}))],2):t._e()])]),n("div",{staticClass:"col-md-12 anno-plot-ui-wrapper",staticStyle:{"padding-top":"15px"}},[t._m(1),n("div",t._l(t.annoData,(function(e,r,a){return n("div",{key:r,staticClass:"anno-bubble-wrapper"},[n("span",{staticClass:"anno-bubble",style:"background-color:"+t.compareGroupColors[a]+";",domProps:{innerHTML:t._s(" ")}}),n("span",{domProps:{innerHTML:t._s(r)}})])})),0),null!=t.searchingPhenotype?n("div",{attrs:{id:"GEPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"GEInfoBox"}}),n("canvas",{staticStyle:{"background-color":"#ffffff"},attrs:{id:"GEPlot",width:"",height:""},on:{mousemove:function(e){return t.checkGEPosition(e)},mouseout:function(e){return t.onMouseOut("GEInfoBox")}}})]):t._e()]),n("div",{class:0==t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length?"height-1px":"height-auto",attrs:{id:"annotationsPlotWrapper"}},[t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0?n("strong",[t._v(" Click on a tissue track to see annotations in specific cell types.")]):t._e(),n("div",{staticClass:"hidden",attrs:{id:"tissueInfoBox"}}),n("canvas",{attrs:{id:"annotationsPlot",width:"",height:""},on:{resize:t.onResize,mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){return t.onMouseOut("tissueInfoBox")}}})])])]):t._e()])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",[n("strong",[t._v("Filter associated variants by location within regulatory regions annotated in broad tissue categories.")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Global Enrichment")])])}],i=n("53ca"),o=n("1da1"),s=n("3835"),l=n("2909"),c=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("cb29"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("a434"),n("b0c0"),n("4ec9"),n("6b93"),n("a9e3"),n("b680"),n("0c47"),n("23dc"),n("4fad"),n("c1f9"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("841c"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),u=n("1157"),d=n.n(u),h=n("b1e0");function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 5,702 bytes, line 1
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}c["default"].use(h["a"]);var f=c["default"].component("research-annotations-plot-v2",{props:["region","phenotype","ancestry","renderConfig","plotMargin","compareGroupColors","dataComparison","plotData","pkgData","pkgDataSelected","regionZoom","regionViewArea","
1searchParameters","searchParametersArr","utils"],data:function(){return{annoData:{},GEData:{},GEPosData:{},tissuesData:{},tissuesPosData:{},selectedAnnos:[],selectedTissues:[],annoPosData:{},spaceBy:24,annotationOnFocus:"null",tissueOnFocus:"null"}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize),this.getAnnotations(this.searchingRegion)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{searchingParameters:function(){var t="";if(null!=this.searchingRegion&&null!=this.searchingPhenotype){var e=this.searchingRegion.chr+":"+this.searchingRegion.start+"-"+this.searchingRegion.end;t=e+","+this.searchingPhenotype}return t+=this.renderConfig["ancestry parameter"]?","+document.querySelector("#search_param_"+this.renderConfig["ancestry parameter"]).value:"",t},searchingRegion:function(){var t={},e=this.region.split(":");return t["chr"]=e[0],t["start"]=e[1].split("-")[0],t["end"]=e[1].split("-")[1],this.utils.uiUtils.showElement("annotationsPlotWrapper"),t},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},searchingPhenotype:function(){if(null!=this.phenotype){this.utils.uiUtils.showElement("annotationsPlotWrapper");var t=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][this.phenotype]:this.phenotype;return t}if(null==this.phenotype){if(this.utils.keyParams[this.renderConfig["phenotype parameter"]]){this.utils.uiUtils.showElement("annotationsPlotWrapper");var e=this.utils.keyParams[this.renderConfig["phenotype parameter"]],n=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][e]:e;return n}return null}}},watch:{searchParametersArr:function(t){this.renderGE(),this.renderByAnnotations()},searchingParameters:function(t){this.getAnnotations(this.searchingRegion)},pkgDataSelected:{handler:function(t){var e=Object(l["a"])(new Set(this.pkgDataSelected.filter((function(t){return"Annotation"==t.type}))));0==t.length||0==e.length?this.resetAll():this.renderByAnnotations()},deep:!0,immediate:!0},viewingRegion:{handler:function(t){this.renderByAnnotations()},deep:!0,immediate:!0}},methods:{resetAll:function(t){var e=this;t&&"all"==t&&(this.GEData={},this.GEPosData={}),this.annoData={},this.tissuesData={},this.tissuesPosData={},this.selectedAnnos=[],this.selectedTissues=[],this.annoPosData={},this.annotationOnFocus="null",this.tissueOnFocus="null",this.pkgDataSelected.map((function(t){"Tissue"==t.type&&e.$store.dispatch("pkgDataSelected",{type:t.type,id:t.id,action:"remove"})})),this.getAnnotations(this.searchingRegion),this.renderByAnnotations()},getOverlappingRegion:function(){var t=this;if(this.renderConfig["overlapping regions"]&&"false"!=this.renderConfig["overlapping regions"]){var e={};if(this.pkgDataSelected.length>0&&this.pkgDataSelected.map((function(t){e[t.type]||(e[t.type]=[]),e[t.type].push(t.id)})),e["Tissue"]&&e["Tissue"].length>0&&e["Annotation"]&&e["Annotation"].length>0){var n={and:null,or:null};e["Annotation"].map((function(r){e["Tissue"].map((function(e){if(t.pkgData.annoData[r]&&t.pkgData.annoData[r][e])for(var a=function(){var a=Object(s["a"])(o[i],2),l=a[0],c=a[1],u=[];t.pkgData.annoData[r][e].region.map((function(t){for(var e=t.start;e<=t.end;e++)u.push(e)})),n[l]=null==c?u:"and"==l?t.getArraysIntersection(n[l],u):n[l].concat(u)},i=0,o=Object.entries(n);i<o.length;i++)a()}))}));for(var r=0,a=Object.entries(n);r<a.length;r++){var i=Object(s["a"])(a[r],2),o=i[0];i[1];n[o].sort((function(t,e){return t-e}))}for(var l={and:[],or:[]},u=0,d=Object.entries(l);u<d.length;u++)for(var h=Object(s["a"])(d[u],2),p=h[0],f=(h[1],0);f<n[p].length;f++)if(0==f||f==n[p].length-1)l[p].push(n[p][f]);else{var _=n[p][f-1]+1,g=n[p][f];g>_&&(l[p].push(n[p][f-1]),l[p].push(n[p][f]))}for(var m={and:[],or:[]},v=0,y=Object.entries(l);v<y.length;v++)for(var b=Object(s["a"])(y[v],2),x=b[0],w=(b[1],0);w<l[x].length-1;w+=2){var C={};C["start"]=l[x][w],C["end"]=l[x][w+1],m[x].push(C)}c["default"].set(this.pkgData,"overlappingRegions",m)}else delete this.pkgData["overlappingRegions"]}},getArraysIntersection:function(t,e){return t.filter((function(t){return-1!==e.indexOf(t)}))},onMouseOut:function(t){this.utils.uiUtils.removeOnMouseOut(t,1e3)},onResize:function(t){this.utils.uiUtils.showElement("annotationsPlotWrapper"),this.renderByAnnotations(),this.renderGE()},addAnnoTrack:function(t){if("null"!=t.target.value){var e=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id}));e.indexOf(t.target.value)<0&&(e.push(t.target.value),null!=this.pkgData&&(this.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t.target.value,action:"add"}),c["default"].set(this.pkgData,"selectedAnnos",e)))}this.renderGE()},removeAnnoTrack:function(t){var e=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id})),n=e.indexOf(t);n>-1&&(e.splice(n,1),null!=this.pkgData&&(this.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t,action:"remove"}),c["default"].set(this.pkgData,"selectedAnnos",e)),this.renderGE())},addRemoveTissueTrack:function(t){var e=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id})),n=e.indexOf(t);n>-1?null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:t,action:"remove"}):null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:t,action:"add"})},removeTissueTrack:function(t){var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=(e.clientX,n.left,Math.ceil(Math.floor(e.clientY-n.top)/this.spaceBy)),i=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id}));if(r>
1n.width-this.plotMargin.leftMargin&&this.tissuesPosData[a])for(var o=0,l=Object.entries(this.tissuesPosData[a].regions);o<l.length;o++){var c=Object(s["a"])(l[o],2),u=c[0],d=(c[1],u.split("_")),h=d[0],p=d[1];if(r>=h&&r<=p){var f=this.tissuesPosData[a].tissue,_=i.indexOf(f);_>-1&&null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:f,action:"remove"})}}},checkGEPosition:function(t){for(var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=Math.floor(e.clientY-n.top),i=document.querySelector("#GEInfoBox"),o="",l=-5;l<=5;l++)for(var c=-5;c<=5;c++)if(void 0!=this.GEPosData[a+l]&&void 0!=this.GEPosData[a+l][r+c])for(var u=0,d=Object.entries(this.GEPosData[a+l][r+c]);u<d.length;u++){var h=Object(s["a"])(d[u],2),p=h[0],f=h[1];o+="<span style='color:"+this.compareGroupColors[f.annotationIndex]+"'>"+p+"</span><br />"}""!=o?(i.innerHTML=o,i.setAttribute("class",""),r<.75*n.width?(i.style.width="auto",i.style.left=r+15+"px",i.style.top=a+this.spaceBy+"px"):(i.style.width="200px",i.style.left=r-215+"px",i.style.top=a+this.spaceBy+"px")):i.setAttribute("class","hidden")},checkPosition:function(t,e){var n=t,r=n.target.getBoundingClientRect(),a=Math.floor(n.clientX-r.left),i=n.clientX-r.left,o=n.clientY-r.top,l=Math.round(this.spaceBy/2),c=Math.ceil(Math.floor(n.clientY-r.top)/l)-1,u=document.querySelector("#tissueInfoBox"),d="";if("hover"==e)if(a>=this.plotMargin.leftMargin/2&&a<=r.width){if(this.annoPosData[c]){d+=this.annoPosData[c].tissue;for(var h=0,p=Object.entries(this.annoPosData[c].regions);h<p.length;h++){var f=Object(s["a"])(p[h],2),_=f[0],g=f[1],m=_.split("_"),v=m[0],y=m[1];a>=v&&a<=y&&(d+="<br />"+g.start+"-"+g.end+"<br />State: "+g.state)}}}else if(a>=r.width-this.plotMargin.leftMargin&&a<=r.width)for(var b=Math.floor(o),x=b-4,w=b+4,C=x;C<=w;C++)if(this.annoPosData[C]&&this.annoPosData[C].annotation)for(var P=0,k=Object.entries(this.annoPosData[C].regions);P<k.length;P++){var M=Object(s["a"])(k[P],2),E=M[0],D=M[1],O=E.split("_"),L=O[0],j=O[1];a>=L&&a<=j&&(d+=D)}"click"==e&&a>=this.plotMargin.leftMargin/2&&a<=r.width&&this.annoPosData[c]&&(d+=this.annoPosData[c].tissue),"hover"==e&&(""==d?(u.innerHTML="",u.setAttribute("class","hidden")):(u.innerHTML=d,u.setAttribute("class",""),u.style.left=i+15+"px",u.style.top=o+l+"px")),"click"==e&&""!=d&&this.addRemoveTissueTrack(d)},getColorIndex:function(t){var e=Object.keys(this.annoData),n=e.indexOf(t);return this.compareGroupColors[n]},getGlobalEnrichment:function(){var t=this;return Object(o["a"])(p().mark((function e(){var n,r,a,i,o,l,u,d,h,f;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n="KP BioIndex"==t.renderConfig["annotations server"]?t.utils.uiUtils.biDomain()+"/api/bio":t.renderConfig["annotations server"],r=t.searchingPhenotype,a=t.renderConfig["global enrichment index"]?t.renderConfig["global enrichment index"]:"global-enrichment",i=n+"/query/"+a+"?q="+r,e.next=6,fetch(i).then((function(t){return t.json()}));case 6:if(o=e.sent,null==o.error){for("newSearch"==t.dataComparison&&(t.GEData={}),t.GEData[t.searchingPhenotype]=o.data,l=0,u=Object.entries(t.GEData);l<u.length;l++)d=Object(s["a"])(u[l],2),d[0],h=d[1],h.map((function(e){var n=e.ancestry,r=e.annotation,a=e.pValue,i=e.phenotype,o=e.tissue;t.annoData[r]&&t.annoData[r][o]&&(t.annoData[r][o].ancestries[n]||(t.annoData[r][o].ancestries[n]={}),t.annoData[r][o].ancestries[n][i]=a),t.tissuesData[o]&&t.tissuesData[o][r]&&(t.tissuesData[o][r].ancestries[n]||(t.tissuesData[o][r].ancestries[n]={}),t.tissuesData[o][r].ancestries[n][i]=a)}));t.tissuesData=Object.fromEntries(Object.entries(t.tissuesData).sort()),f=t.getGEByTissue(),null!=t.pkgData&&(c["default"].set(t.pkgData,"GEByTissueData",f),c["default"].set(t.pkgData,"GEData",t.GEData),c["default"].set(t.pkgData,"annoData",t.annoData),c["default"].set(t.pkgData,"tissuesData",t.tissuesData)),t.renderByAnnotations(),t.renderGE()}t.$forceUpdate();case 9:case"end":return e.stop()}}),e)})))()},getGEByTissue:function(){var t=this,e={};Object.keys(this.GEData).map((function(n){e[n]={},Object.keys(t.annoData).map((function(t){e[n][t]={}}))}
1));for(var n={},r=function(){var r=Object(s["a"])(i[a],2),o=r[0],l=r[1];n[o]={},l&&l.map((function(r){n[o][r.tissue]||(n[o][r.tissue]={}),n[o][r.tissue][r.annotation]||(n[o][r.tissue][r.annotation]={pValue:null,fold:null,gregor:null,rank:null,ancestries:{}});var a=n[o][r.tissue][r.annotation];a.ancestries[r.ancestry]||(a.ancestries[r.ancestry]={fold:null,pValue:null,rank:null}),a.ancestries[r.ancestry].pValue=t.utils.Formatters.pValueFormatter(r.pValue),a.ancestries[r.ancestry].fold=t.utils.Formatters.pValueFormatter(r.SNPs/r.expectedSNPs);var i=n[o][r.tissue][r.annotation].pValue;(null==i||r.pValue<i)&&(n[o][r.tissue][r.annotation].pValue=t.utils.Formatters.pValueFormatter(r.pValue),n[o][r.tissue][r.annotation].fold=t.utils.Formatters.pValueFormatter(r.SNPs/r.expectedSNPs)),e[o]&&e[o][r.annotation]&&!e[o][r.annotation][r.ancestry]&&(e[o][r.annotation][r.ancestry]=[]),e[o]&&e[o][r.annotation]&&e[o][r.annotation][r.ancestry].push({tissue:r.tissue,fold:a.ancestries[r.ancestry].fold})}))},a=0,i=Object.entries(this.GEData);a<i.length;a++)r();return Object.keys(e).map((function(r){Object.keys(e[r]).map((function(a){Object.keys(e[r][a]).map((function(i){e[r][a][i]=Object(l["a"])(new Map(e[r][a][i].map((function(t){return[t["tissue"],t]}))).values()),e[r][a][i].sort((function(t,e){return e.fold-t.fold}));var o=0;e[r][a][i].map((function(e){t.tissuesData[e.tissue]&&t.tissuesData[e.tissue][a]&&(n[r][e.tissue][a].ancestries[i].rank=o,o++)}))}))}))})),n},getAnnotations:function(t){var e=this;return Object(o["a"])(p().mark((function n(){var r,a,i,o;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!(t&&t.chr&&t.start&&t.end)){n.next=8;break}return r="KP BioIndex"==e.renderConfig["annotations server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["annotations server"],a=e.renderConfig["annotations index"]?e.renderConfig["annotations index"]:"regions",i=r+"/query/"+a+"?q="+t.chr+":"+t.start+"-"+t.end,n.next=6,fetch(i).then((function(t){return t.json()}));case 6:o=n.sent,null==o.error&&(null==o.continuation?e.runAfterAnnoDataLoad(o):e.loadContinue(o));case 8:case"end":return n.stop()}}),n)})))()},loadContinue:function(t){var e=this;return Object(o["a"])(p().mark((function n(){var r,a,i,o,s;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="KP BioIndex"==e.renderConfig["annotations server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["annotations server"],a=r+"/cont?token="+t.continuation,n.next=4,fetch(a).then((function(t){return t.json()}));case 4:i=n.sent,null==i.error&&(o=t.data,s=o.concat(i.data),i.data=s,null==i.continuation?e.runAfterAnnoDataLoad(i):e.loadContinue(i));case 6:case"end":return n.stop()}}),n)})))()},runAfterAnnoDataLoad:function(t){var e=this;this.annoData={},this.tissuesData={},t.data.map((function(t){e.annoData[t.annotation]||(e.annoData[t.annotation]={}),e.annoData[t.annotation][t.tissue]||(e.annoData[t.annotation][t.tissue]={region:[],ancestries:{}}),e.annoData[t.annotation][t.tissue].region.push(t),e.tissuesData[t.tissue]||(e.tissuesData[t.tissue]={}),e.tissuesData[t.tissue][t.annotation]||(e.tissuesData[t.tissue][t.annotation]={region:[],ancestries:{}}),e.tissuesData[t.tissue][t.annotation].region.push(t)})),null!=this.pkgData&&(c["default"].set(this.pkgData,"annoData",this.annoData),c["default"].set(this.pkgData,"tissuesData",this.tissuesData)),this.getGlobalEnrichment()},renderGE:function(){var t=this;this.GEPosData={};var e={},n=[],r=this.renderConfig["phenotype parameter"],a=this.renderConfig["ancestry parameter"],i=0;this.searchParameters[r].search.map((function(e){n[i]={},n[i]["phenotype"]=e,n[i]["ancestry"]=a?t.searchParameters[a].search[i]:"Mixed",i++})),n.map((function(n){var r=t.renderConfig["phenotype match"]?t.renderConfig["phenotype match"][n.phenotype]:n.phenotype,a=n.ancestry,i=t.GEData[r];e[r]||(e[r]={}),e[r][a]={xMax:null,xMin:null,yMax:null,yMin:null},i&&i.map((function(n){if(n.ancestry==a){var i=null;if((a&&t.annoData[n.annotation][n.tissue]&&t.annoData[n.annotation][n.tissue]["ancestries"][a]||!a&&t.annoData[n.annotation][n.tissue]&&t.annoData[n.annotation][n.tissue])&&(i=!0),i){e[r][a][n.annotation]||(e[r][a][n.annotation]={});var o=a?t.annoData[n.annotation][n.tissue]["ancestries"][a][r]:n.pValue;o=0==o?324:-Math.log10(o);var s=n.SNPs/n.expectedSNPs;e[r][a].yMax=null==e[r][a].yMax||s>e[r][a].yMax?s:e[r][a].yMax,e[r][a].yMin=null==e[r][a].yMin||s<e[r][a].yMin?s:e[r][a].yMin,e[r][a].xMax=null==e[r][a].xMax||o>e[r][a].xMax?o:e[r][a].xMax,e[r][a].xMin=null==e[r][a].xMin||o<e[r][a].xMin?o:e[r][a].xMin,e[r][a][n.annotation][n.tissue]=e[r][a][n.annotation][n.tissue]?e[r][a][n.annotation][n.tissue]:{pValue:null,fold:null};var l=e[r][a][n.annotation][n.tissue].pValue,c=e[r][a][n.annotation][n.tissue].fold;e[r][a][n.annotation][n.tissue].pValue=null==l||o>l?o:l,e[r][a][n.annotation][n.tissue].fold=null==c||s>c?s:c}}}))}));var o=0;Object.keys(e).map((function(t){o+=Object.keys(e[t]).length}));var l,c,u=2*document.querySelector("#GEPlotWrapper").clientWidth*.25,d=u*o,h=260,p=2*this.spaceBy,f=this.plotMargin.topMargin+this.plotMargin.bottomMargin+h+p,_=u-this.plotMargin.leftMargin-this.plotMargin.rightMargin,g=11;l=document.querySelector("#GEPlot"),l.setAttribute("width",d),l.setAttribute("height",f),l.setAttribute("style","width:"+d/2+"px;
1height:"+f/2+"px;"),c=l.getContext("2d");var m=0;n.map((function(n){var r=t.renderConfig["phenotype match"]?t.renderConfig["phenotype match"][n.phenotype]:n.phenotype,a=n.ancestry,i=e[r][a],o=p,l=g+u*m,d=r+"("+a+")";c.font="28px Arial",c.textAlign="left",c.fillStyle="#000000",c.fillText(d,l,o),t.renderGEAxis(c,_,h,i.xMax,i.xMin,i.yMax,i.yMin,l,o,g);var f=Object.keys(t.annoData),v=[],y=[];f.map((function(t){if(i[t])for(var e=0,n=Object.entries(i[t]);e<n.length;e++){var r=Object(s["a"])(n[e],2),a=(r[0],r[1]);y.push(a.pValue),v.push(a.fold)}})),v.sort((function(t,e){return e-t})),y.sort((function(t,e){return e-t}));var b=_/(i.xMax-i.xMin),x=h/(i.yMax-i.yMin);f.map((function(e,n){var r="null"==t.annotationOnFocus||e==t.annotationOnFocus?t.compareGroupColors[n]:"#00000030";if(i[e])for(var a=0,d=Object.entries(i[e]);a<d.length;a++){var p=Object(s["a"])(d[a],2),f=p[0],_=p[1],g=l+t.plotMargin.leftMargin+(_.pValue-i.xMin)*b,m=o+t.plotMargin.topMargin+h-(_.fold-i.yMin)*x;c.fillStyle=r,c.lineWidth=0,c.beginPath(),c.arc(g,m,8,0,2*Math.PI),c.fill(),(_.fold>=v[2]||_.pValue>=y[2])&&(c.font="24px Arial",c.fillStyle=t.pkgData.selectedAnnos&&0!=t.pkgData.selectedAnnos.length?t.pkgData.selectedAnnos&&t.pkgData.selectedAnnos.includes(e)?"#000000":"#00000050":"#000000",g>.75*u?(c.textAlign="right",c.fillText(f,g-14,m+6)):(c.textAlign="left",c.fillText(f,g+14,m+6))),t.GEPosData[Math.round(m/2)]||(t.GEPosData[Math.round(m/2)]={}),t.GEPosData[Math.round(m/2)][Math.round(g/2)]||(t.GEPosData[Math.round(m/2)][Math.round(g/2)]={}),t.GEPosData[Math.round(m/2)][Math.round(g/2)][f]={pValue:null,fold:null},t.GEPosData[Math.round(m/2)][Math.round(g/2)][f]["pValue"]=_.pValue,t.GEPosData[Math.round(m/2)][Math.round(g/2)][f]["fold"]=_.fold,t.GEPosData[Math.round(m/2)][Math.round(g/2)][f]["annotationIndex"]=n}})),m++}))},renderGEAxis:function(t,e,n,r,a,i,o,s,l,c){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]);var u=Math.round(s+this.plotMargin.leftMargin-c);t.moveTo(u,l+this.plotMargin.topMargin),t.lineTo(u,l+this.plotMargin.topMargin+n+c);for(var d=(i-o)/5,h=n/5,p=0;p<6;p++){var f=l+this.plotMargin.topMargin+p*h,_=Math.floor(f);t.moveTo(s+this.plotMargin.leftMargin-2*c,_),t.lineTo(s+this.plotMargin.leftMargin-c,_),t.stroke(),t.textAlign="right",t.font="24px Arial";var g=i-o,m=g<=1?2:g<=50?1:0,v=this.utils.Formatters.decimalFormatter(o+p*d,m);v=v>=1e5?Math.round(.001*v)+"k":v,t.fillText(v,s+this.plotMargin.leftMargin-3*c,l+this.plotMargin.topMargin+n+c-p*h)}var y=this.renderConfig["global enrichment y axis label"]?this.renderConfig["global enrichment y axis label"]:"Fold(SNPs/expectedSNPs)";t.textAlign="center",t.rotate(-2*Math.PI/4),t.fillText(y,-(this.plotMargin.topMargin+n/2)-l,s+c+24),t.rotate(-2*Math.PI/4*3),t.moveTo(s+this.plotMargin.leftMargin-c,l+this.plotMargin.topMargin+n+c),t.lineTo(s+this.plotMargin.leftMargin+e,l+this.plotMargin.topMargin+n+c),t.stroke();for(var b=(r-a)/5,x=e/5,w=0;w<6;w++){var C=s+this.plotMargin.leftMargin+w*x,P=Math.floor(C);t.moveTo(P,l+n+this.plotMargin.topMargin+c),t.lineTo(P,l+n+this.plotMargin.topMargin+2*c),t.stroke(),t.textAlign="center",t.font="24px Arial";var k=r-a,M=k<=1?2:k<=50?1:0,E=this.utils.Formatters.decimalFormatter(a+w*b,M);E=E>=1e5?Math.round(.001*E)+"k":E,t.fillText(E,P,l+n+this.plotMargin.topMargin+4*c)}var D=this.renderConfig["global enrichment x axis label"]?this.renderConfig["global enrichment x axis label"]:"-Log10(p-value)";t.textAlign="center",t.fillText(D,s+this.plotMargin.leftMargin+e/2,l+n+6*c+this.plotMargin.topMargin+24)},array2Object:function(t,e){var n={};return e.map((function(e){var r=e[t];n[r]=e})),n},renderByAnnotations:function(){var t=this;if(this.pkgData.GEByTissueData){var e=this.getGEByTissue(),n=[],r=this.renderConfig["phenotype parameter"],a=this.renderConfig["ancestry parameter"],i=0;this.searchParameters[r].search.map((function(e){n[i]={},n[i]["phenotype"]=e,n[i]["ancestry"]=a?t.searchParameters[a].search[i]:"Mixed",i++}));var o=[];if(this.annoPosData={},this.renderConfig["star key"]){var l=Array.isArray(this.plotData)?this.array2Object(this.renderConfig["star key"]["key"],this.plotData):this.plotData,c=this.renderConfig["star key"]["key"],u=this.renderConfig["star key"]["position"];this.pkgDataSelected.filter((function(t){return t.type==c})).map((function(t){return t.id})).map((function(t){o.push(l[t][u])}))}for(var d=0,h=2*this.spaceBy,p=7*this.spaceBy,f=this.spaceBy,_=2*this.spaceBy,g=2*this.spaceBy,m=this.viewingRegion.start,v=this.viewingRegion.end,y=240,b=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id})),x=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id})),w=0,C=Object.entries(this.annoData);w<C.length;w++){var P=Object(s["a"])(C[w],2),k=P[0],M=P[1];b.includes(k)&&(d+=h,d+=Object.keys(M).length*f,d+=p)}var E=document.querySelector("#annotationsPlotWrapper"),D=document.querySelector("#annotationsPlot");if(D&&E){var O,L,j=2*document.querySelector("#annotationsPlotWrapper").clientWidth*.75,S=j+n.length*y,A=d+_+g,I=j-2*this.plotMargin.leftMargin,T=11,B=I/(v-m);O=document.querySelector("#annotationsPlot"),O.setAttribute("width",S),O.setAttribute("height",A),O.setAttribute("style","width:"+S/2+"px;
1height:"+A/2+"px;"),L=O.getContext("2d"),L.clearRect(0,0,j,A);for(var R=h,F=function(){var r=Object(s["a"])(W[G],2),a=r[0],i=r[1];if(b.includes(a)){L.font="28px Arial",L.textAlign="left",L.fillStyle="#000000",L.fillText(a,T,R),n.map((function(t,e){L.fillStyle="#000000",L.textAlign="start",L.textBaseline="middle",L.font="28px Arial";var n=t.phenotype+" ("+t.ancestry+")";L.fillText(n,j+y*e,R)}));var l=Object.keys(i).length*f;R+=h,t.renderAnnoAxis(L,I,l,Number(v),Number(m),R,T),t.renderConfig["star key"]&&o.length>0&&t.renderStaredPositions(L,I,l,o,B,Number(v),Number(m),R,T);var c=0,u=Object.keys(i).sort();u.map((function(r){var o=i[r],s=Math.ceil(R/t.spaceBy);t.annoPosData[s]?t.annoPosData[s]["tissue"]=r:t.annoPosData[s]={annotation:a,tissue:r,regions:{}},c%2==0&&(L.fillStyle="#00000010",L.fillRect(t.plotMargin.leftMargin,R,I,f)),c++,o.region.map((function(e){if(e.start<=v&&e.end>=m){var n=(e.start-m)*B+t.plotMargin.leftMargin;n=n<=t.plotMargin.leftMargin?t.plotMargin.leftMargin:n;var i=(e.end-m)*B+t.plotMargin.leftMargin;i=i>t.plotMargin.leftMargin+I?t.plotMargin.leftMargin+I:i;var o=i-n<2?2:i-n;x.indexOf(r)>-1?L.fillStyle="#FF0000":L.fillStyle=t.getColorIndex(a),L.fillRect(n,R,o,f-1);var l=Math.round(n/2)+"_"+Math.round((n+o)/2);t.annoPosData[s].regions[l]={start:e.start,end:e.end,state:e.state}}})),R+=f,L.fillStyle="#000000",L.textAlign="start",L.textBaseline="middle",L.font="24px Arial",L.fillText(r,10,R-8),n.map((function(n,i){var o=t.renderConfig["phenotype match"]?t.renderConfig["phenotype match"][n.phenotype]:n.phenotype,s=n.ancestry;if(e[o][r]&&e[o][r][a]){var l=e[o][r][a].ancestries[s]["pValue"]+" / "+Number(e[o][r][a].ancestries[s]["fold"]).toFixed(3);e[o][r][a].ancestries[s]["rank"]<5&&(L.fillStyle=t.getColorIndex(a),L.lineWidth=0,L.beginPath(),L.arc(j+y*i-10,R-8,6,0,2*Math.PI),L.fill()),e[o][r][a].ancestries[s]["pValue"]<.05&&(L.fillStyle="#FF9999",L.lineWidth=0,L.beginPath(),L.arc(j+y*i-20,R-8,6,0,2*Math.PI),L.fill()),L.fillStyle="#000000",L.textAlign="start",L.textBaseline="middle",L.font="22px Arial",L.fillText(l,j+y*i,R-8)}}))})),R+=p}},G=0,W=Object.entries(this.annoData);G<W.length;G++)F()}this.getOverlappingRegion()}},renderAnnoAxis:function(t,e,n,r,a,i,o){t.lineWidth=1,t.setLineDash([]),t.beginPath(),t.strokeStyle="#999999",t.moveTo(this.plotMargin.leftMargin-o,i),t.lineTo(this.plotMargin.leftMargin-o,i+n+o),t.stroke();var s=Math.round(this.plotMargin.leftMargin+e+o);t.moveTo(s,i),t.lineTo(s,i+n+o),t.stroke(),t.closePath(),t.beginPath(),t.strokeStyle="#000000",t.moveTo(this.plotMargin.leftMargin-o,i+n+o),t.lineTo(s,i+n+o),t.stroke();for(var l=Math.ceil((r-a)/5),c=e/5,u=0;u<6;u++){var d=this.plotMargin.leftMargin+u*c,h=Math.floor(d);t.moveTo(h,i+n+o),t.lineTo(h,i+n+2*o),t.stroke(),t.textAlign="center",t.font="24px Arial",t.fillStyle="#000000";var p=r-a,f=p<=1?2:p<=50?1:0,_=this.utils.Formatters.decimalFormatter(a+u*l,f);_=_>=1e5?Math.round(.001*_)+"k":_,t.fillText(_,h,i+n+4*o)}t.closePath()},renderStaredPositions:function(t,e,n,r,a,i,o,s,l){var c=this;t.beginPath(),t.lineWidth=2,t.strokeStyle="#FFAA00",t.setLineDash([6,6]),r.map((function(e){var r=(e-o)*a+c.plotMargin.leftMargin;t.moveTo(r,s-l),t.lineTo(r,s+n+l),t.stroke()}))}}});d()((function(){}));var _=f,g=(n("2f76"),n("2877")),m=Object(g["a"])(_,r,a,!1,null,null,null);e["a"]=m.exports},"3d54":function(t,e,n){},"3ec8":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("select",{directives:[{name:"model",rawName:"v-model",value:t.$store.state.selectedAncestry,expression:"$store.state.selectedAncestry"}],ref:"ancestrySelect",staticClass:"form-control",on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.$store.state,"selectedAncestry",e.target.multiple?n:n[0])},function(e){return t.onAncestrySelected()}]}},[n("option",{attrs:{value:"",selected:""}},[t._v(" "+t._s(t.defaultMixed?"Mixed (meta-analysis)":"All ancestries")+" ")]),t._l(t.ancestryOptions,(function(e){return n("option",{domProps:{value:e}},[t._v(t._s(t.ancestryFormatter(e)))])}))],2)},a=[],i=n("b85c"),o=(n("caad"),n("14d9"),n("4e82"),n("2b0e")),s=n("5f5b"),l=n("b1e0"),c=n("d726"),u=(n("f9e3"),n("2dd8"),n("529c"));o["default"].use(s["a"]),o["default"].use(l["b"]),o["default"].component("vue-typeahead-bootstrap",c["a"]);var d=o["default"].component("ancestry-selectpicker",{props:["ancestries","defaultMixed","pageLevel"],data:function(){return{userText:"",ancestryList:null}},computed:{ancestryOptions:function(){if(!this.ancestries)return[];var t,e=[],n=Object(i["a"])(this.ancestries);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.includes(r)||"Mixed"==r||e.push(r)}}catch(a){n.e(a)}finally{n.f()}return e.sort()}},methods:{ancestryFormatter:u["a"].ancestryFormatter,onAncestrySelected:function(){this.pageLevel&&this.$store.dispatch("onAncestryChange")},setFocus:function(){var t=this;this.$nextTick((function(){t.$refs.ancestrySelect.$refs.input.focus()}))}}}),h=d,p=n("2877"),f=Object(p["a"])(h,r,a,!1,null,null,null);e["a"]=f.exports},"3feb":function(t,e,n){"use strict";var r=n("53ca"),a=n("1da1"),i=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("3ca3"),n("466d"),n("5319"),n("498a"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("e60d"));function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,l,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,l)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;
vendor: 5,759 bytes, line 1
1return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,l,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var s=/^(?:chr)?(1\d?|2[0-2]?|[3-9]|x|y|xy|mt?)[:_](\d+)(?:([+/-])(\d+))?$/i;function l(t){return c.apply(this,arguments)}function c(){return c=Object(a["a"])(o().mark((function t(e){var n,r,a,l,c,u,d,h,p,f=arguments;return o().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=!(f.length>1&&void 0!==f[1])||f[1],r=f.length>2&&void 0!==f[2]?f[2]:0,a=e.trim().replace(/,/g,"").match(s),!a){t.next=21;break}
1if(l=a[1],c=parseInt(a[2]),u=c+1,!a[3]){t.next=19;break}d=parseInt(a[4]),t.t0=a[3],t.next="-"===t.t0?12:"+"===t.t0?14:"/"===t.t0?16:19;break;case 12:return u=Math.max(d,c),t.abrupt("break",19);case 14:return u=c+d,t.abrupt("break",19);case 16:return u=c+d,c-=d,t.abrupt("break",19);case 19:return u-c<r&&(h=r-(u-c),c-=Math.floor(h/2),u+=Math.ceil(h/2)),t.abrupt("return",{chr:l,start:c,end:u});case 21:if(!n){t.next=26;break}return t.next=24,fetch("".concat(i["a"],"/api/bio/query/gene?q=").concat(e)).then((function(t){return t.json()})).then((function(t){return 0==t.count?null:{chr:t.data[0].chromosome,start:Math.max(t.data[0].start-r,0),end:t.data[0].end+r,gene:e}}));case 24:return p=t.sent,t.abrupt("return",p);case 26:return t.abrupt("return",null);case 27:case"end":return t.stop()}}),t)}))),c.apply(this,arguments)}function u(t){return d.apply(this,arguments)}function d(){return d=Object(a["a"])(o().mark((function t(e){var n;return o().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,fetch("".concat(i["a"],"/api/bio/query/gene?q=").concat(e)).then((function(t){return t.json()})).then((function(t){return 0==t.count?null:t.data[0].symbol}));case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t)}))),d.apply(this,arguments)}e["a"]={parseRegion:l,geneSymbol:u}},4133:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("filter-control-template",{staticClass:"filter-col-md",attrs:{field:t.field,placeholder:t.placeholder,predicate:t.predicate,pillFormatter:t.pillFormatter,options:t.options,color:t.color,multiple:!1,inclusive:t.inclusive,splitBy:t.splitBy,computedField:t.computedField},on:{"input-change":function(e){return t.$emit("input-change",e)}}},[t._t("default")],2)},a=[],i=(n("99af"),n("2b0e")),o=n("27d5"),s=i["default"].component("filter-basic-control",{props:{field:String,placeholder:String,options:{type:Array,required:!1},color:String,splitBy:String,inclusive:{type:Boolean,default:!0},predicate:{type:Function,default:function(t,e){return t===e}},pillFormatter:{type:Function,default:function(t){return"".concat(t.field," = ").concat(t.threshold)}},computedField:Function},components:{FilterControlTemplate:o["a"]}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},"435f":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.tableData.length>0?n("div",[n("b-row",{staticClass:"mb-2"},[n("b-col",{staticClass:"d-flex align-items-center"},[n("strong",{staticClass:"mr-2"},[t._v("Total Rows:")]),t._v(" "+t._s(t.tableData.length))]),n("b-col",{staticClass:"text-right"},[n("data-download",{attrs:{data:t.sortedAssociations,filename:"associations"}})],1)],1),n("b-table",{class:t.showBottomLine?"assoc-table-bottom-line":"",attrs:{hover:"",small:"",responsive:"",items:t.groupedAssociations,fields:t.fields,"per-page":t.perPage,"current-page":t.currentPage,"sort-null-last":!0,sortable:!0},scopedSlots:t._u([{key:"thead-top",fn:function(e){return[t.showBottomLine?n("b-th",{staticClass:"bl-bar",attrs:{colspan:1}}):t._e(),n("b-th",{attrs:{colspan:t.showChiSquared?6:5}},[n("span",{staticClass:"sr-only"},[t._v("Variant")])]),t._l(t.phenotypes,(function(e,r){return n("b-th",{key:e.name,staticClass:"reference",class:"color-"+(r+1),attrs:{colspan:"2"}},[n("span",{staticStyle:{color:"white"}},[t._v(t._s(e.description))])])}))]}},{key:"cell(position)",fn:function(e){return[n("a",{attrs:{href:"/region.html?phenotype="+t.phenotypes[0].name+"&chr="+e.item.chromosome+"&start="+(e.item.position-5e4)+"&end="+(e.item.position+5e4)}},[t._v(t._s(t.locusFormatter(e.item)))])]}},{key:"cell(allele)",fn:function(e){return[n("a",{attrs:{href:"/variant.html?variant="+e.item.varId}},[t._v(" "+t._s(t.alleleFormatter(e.item))+" ")])]}},{key:"cell(dbSNP)",fn:function(e){return[n("a",{attrs:{href:"/variant.html?variant="+e.item.dbSNP}},[t._v(" "+t._s(t.dbSNPFormatter(e.item))+" ")])]}},{key:"cell(consequence)",fn:function(e){return[t._v(" "+t._s(t.consequenceFormatter(e.item.consequence))+" ")]}},{key:"cell(genes)",fn:function(e){return t._l(e.item.nearest,(function(e){return n("a",{key:e,staticClass:"item",attrs:{href:"/gene.html?gene="+e}},[t._v(t._s(e))])}))}},{key:"cell(maf)",fn:function(e){return[t._v(" "+t._s(t.mafFormatter(e.item.maf))+" ")]}},t._l(t.phenotypes,(function(e){return{key:t.phenotypeBetaColumn(e),fn:function(r){return[n("span",{key:e.name,class:"effect "+(r.item[e.name+":beta"]<0?"negative":"positive")},[t._v(" "+t._s(r.item[e.name+":beta"]?r.item[e.name+":beta"]<0?"â¼":"â²":"")+" ")]),n("span",[t._v(" "+t._s(t.effectFormatter(e.dichotomous?Math.exp(r.item[e.name+":beta"]):r.item[e.name+":beta"]))+" ")])]}}})),t._l(t.phenotypes,(function(e){return{key:t.phenotypePValueColumn(e),fn:function(n){return[t._v(t._s(t.pValueFormatter(n.item[e.name+":pValue"])))]}}}))],null,!0)}),n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.groupedAssociations.length,"per-page":t.perPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1):n("div",[t.associations.length>0?n("h4",[t._v(" No overlapping associations across phenotypes ")]):n("h4",[t._v("No associations")])])])},a=[],i=(n("99af"),n("4de4"),n("14d9"),n("4e82"),n("a434"),n("b0c0"),n("d3b7"),n("0643"),n("76d6"),n("2382"),n("4e3e"),n("159b"),n("2b0e")),o=(n("1157"),n("5f5b")),s=n("b1e0"),l=n("529c"),c=n("2ef0"),u=(n("f9e3"),n("2dd8"),n("f529")),d=n("999d"),h=n.n(d);i["default"].use(o["a"]),i["default"].use(s["b"]);var p=i["default"].component("AssociationsTable",{components:{DataDownload:u["a"]},props:["associations","phenotypes","filter","exclusive","showBottomLine"],data:function(){return{perPage:10,currentPage:1,baseFields:[{key:"position",label:"Position(CHR:POS)"},{key:"allele",label:"Allele(REF:ALT)"},{key:"dbSNP",label:"dbSNP"},{key:"consequence",label:"Consequence"},{key:"genes",label:"Closest Genes"}]}},computed:{showChiSquared:function(){return this.phenotypes.length>1},fields:function(){var t={key:"inMetaTypes",label:"",formatter:function(t){return""},tdClass:function(t){return"bottom-line"===t?"bottom-line-only":"bottom-line;min_p"===t?"bottom-line-min-p":"bottom-line;min_p;largest"===t?"all-meta-types":""}},e=this.showBottomLine?[t]:[],n=e.concat(this.baseFields);if(this.phenotypes.length>1)n.push({key:"chiSquared",label:"P-Value(Χ²)",sortable:!0,numeric:!0,formatter:this.pValueFormatter});else if(this.phenotypes.length<=1)for(var r=0;r<n.length;r++)"chiSquared"===n[r].key&&n.splice(r,1);for(var a in this.phenotypes){var i=this.phenotypes[a];n=n.concat([{key:"".concat(i.name,":pValue"),label:"P-Value",sortable:!0,numeric:!0,tdClass:function(t){return t&&t<1e-5?"variant-table-cell high":""}}
1,{key:"".concat(i.name,":beta"),label:i.dichotomous?"Odds Ratio":"Beta"}])}return n},groupedAssociations:function(){var t=this,e=[],n={},r=this.tableData;for(var a in r){var i=r[a],o=n[i.varId];i.varId in n||(o=e.length,n[i.varId]=o,e.push({phenotype:i.phenotype,varId:i.varId,chromosome:i.chromosome,position:i.position,reference:i.reference,dbSNP:i.dbSNP,consequence:i.consequence,nearest:i.nearest,alt:i.alt,maf:i.maf,inMetaTypes:i.inMetaTypes})),e[o]["".concat(i.phenotype,":pValue")]=i.pValue,e[o]["".concat(i.phenotype,":beta")]=i.beta,e[o]["".concat(i.phenotype,":stdErr")]=i.stdErr,e[o]["".concat(i.phenotype,":zScore")]=i.zScore,e[o]["".concat(i.phenotype,":n")]=i.n}if(this.exclusive){var s=this.phenotypes;e=e.filter((function(t){return s.every((function(e){return!!t["".concat(e.name,":pValue")]}))}))}return e.forEach((function(e){return e.chiSquared=t.chiSquared(e)})),e},sortedAssociations:function(){return this.tableData.sort((function(t,e){return t.pValue-e.pValue}))},tableData:function(){var t=this.associations;return this.filter&&(t=this.associations.filter(this.filter)),t}},watch:{phenotypes:{handler:function(t,e){Object(c["isEqual"])(t,e)||(this.currentPage=1)},deep:!0}},methods:{phenotypeBetaColumn:function(t){return"cell(".concat(t.name,":beta)")},phenotypePValueColumn:function(t){return"cell(".concat(t.name,":pValue)")},phenotypeMafColumn:function(t){return"cell(".concat(t.name,":maf)")},alleleFormatter:function(t){var e=t.reference,n=t.alt;return l["a"].alleleFormatter(e,n)},chiFormatter:function(t){return l["a"].floatFormatter(t)},locusFormatter:function(t){var e=t.chromosome,n=t.position;return l["a"].locusFormatter(e,n)},dbSNPFormatter:function(t){var e=t.dbSNP;return l["a"].dbSNPFormatter(e)},effectFormatter:function(t){return l["a"].effectFormatter(t)},pValueFormatter:function(t){return l["a"].pValueFormatter(t)},mafFormatter:function(t){return l["a"].floatFormatter(t)},consequenceFormatter:function(t){return l["a"].consequenceFormatter(t)},chiSquared:function(t){var e=0,n=0;for(var r in this.phenotypes){var a=t["".concat(this.phenotypes[r].name,":pValue")];a&&(e+=-2*Math.log(a),n++)}var i=h.a.pdf(e,2*n);return 2*i},backgroundColor:function(t){return"bottom-line"===t?"bottom-line-only":"bottom-line;min_p"===t?"bottom-line-min-p":"bottom-line;min_p;largest"===t?"all-meta-types":""}}}),f=p,_=(n("9dd5"),n("2877")),g=Object(_["a"])(f,r,a,!1,null,"b49da892",null);e["a"]=g.exports},"45ab":function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("3835"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("2909"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("a4d3"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("e01a"),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("cb29"),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("caad"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("14d9"),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("4e82"),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("6b93"),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("4fad"),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_13__),
1core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("6062"),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("1e70"),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("79a4"),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("c1a1"),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("8b00"),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("a4e7"),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_21__),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("1e5a"),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_22__),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("72c3"),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_23__),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("2532"),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_24___default=__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_24__),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_25__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("0643"),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_26__),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__("2382"),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_27___default=__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_27__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__("a573"),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_28__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29__),vue__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__("2b0e"),jquery__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__("1157"),jquery__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_31__),lodash__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__("2ef0"),lodash__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_32__),bootstrap_vue__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__("b1e0"),_components_researchPortal_vectorPlots_ResearchBarPlotVector_vue__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__("b300");vue__WEBPACK_IMPORTED_MODULE_30__["default"].use(bootstrap_vue__WEBPACK_IMPORTED_MODULE_33__["a"]),__webpack_exports__["a"]=vue__WEBPACK_IMPORTED_MODULE_30__["default"].component("research-bar-plot",{props:["canvasId","phenotypeMap","phenotypesData","renderConfig","pkgData","pkgDataSelected","colors","plotMargin","filter","options","sectionId","utils"],data:function(){return{barData:null,barPosData:{},spaceBy:7,trigger:0,hoverItems:{},showCanvas:!0}},modules:{},components:{barPlotVector:_components_researchPortal_vectorPlots_ResearchBarPlotVector_vue__WEBPACK_IMPORTED_MODULE_34__["a"]},created:function(){this.renderBarPlot()},mounted:function(){window.addEventListener("resize",this.onResize),this.renderBarPlot()},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},phenotypeMapConfig:function(){return"null"==this.renderConfig["phenotype map"]?null:"kp phenotype map"==this.renderConfig["phenotype map"]?"kpPhenotypeMap":void 0},renderData:function(){var t=this;this.showCanvas=!0;var e={data:[]};if(this.phenotypesData){var n=Object(lodash__WEBPACK_IMPORTED_MODULE_32__["cloneDeep"])(this.phenotypesData);n.map((function(n){var r="string"==typeof n[t.renderConfig["y axis field"]]?Number(n[t.renderConfig["y axis field"]]):n[t.renderConfig["y axis field"]];n["rawPValue"]=r,"true"==t.renderConfig["convert y -log10"]&&(n[t.renderConfig["y axis field"]+"-log10"]=-Math.log10(r)),("kpPhenotypeMap"==t.phenotypeMapConfig&&t.phenotypeMap[n[t.renderConfig["render by"]]]||null==t.phenotypeMapConfig)&&e["data"].push(n)}))}return this.filter&&(e.data=e.data.filter(this.filter)),e.data&&e.data.length>0?e:(this.showCanvas=!1,null)}},watch:{renderData:function(t){this.renderBarPlot()}},methods:{downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.canvasId+"_barPlot"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_bar_plot_"+this.canvasId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},openPage:function(t,e){this.utils.uiUtils.openPage(t,e)},addPhenotype:function(t){this.$parent.$parent.pushCriterionPhenotype(t),window.location.href="#associations-table"},groupData:function(t){var e=this,n=[],r={};if(null==this.phenotypeMapConfig)n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(t.data.map((function(t){return t[e.renderConfig["group by"]]})))).sort();else{for(var a=0,i=Object.entries(this.phenotypeMap);a<i.length;a++){var o=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(i[a],2),s=(o[0],o[1]);n.push(s)}n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(n.map((function(t){return t.group})))).sort()}return n.map((function(t){r[t]=[]})),t.data.map((function(t){var n="kpPhenotypeMap"==e.phenotypeMapConfig&&e.phenotypeMap[t[e.renderConfig["render by"]]]?e.phenotypeMap[t[e.renderConfig["render by"]]].group:t[e.renderConfig["group by"]];r[n].push(t)})),r},onResize:function(){this.renderBarPlot()},checkPosition:function(t,e){var n=this,r=t,a=r.target.getBoundingClientRect(),i=r.clientX-a.left,o=r.clientY-a.top,s=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,l=s?{left:s.left,right:s.right,top:s.top,bottom:s.bottom,bump:10}:{left:this.plotMargin.leftMargin/2,right:this.plotMargin.leftMargin/2*1.5,top:this.plotMargin.bottomMargin/2*3.5,bottom:this.plotMargin.bottomMargin/2*2.5,bump:10},c=Math.ceil(r.clientY-a.top),u=Math.ceil(r.clientX-a.left),d=document.querySelector("#"+this.canvasId+"barInfoBox"),h=(document.querySelector("#"+this.canvasId+"barInfoBoxContent"),document.querySelector("#"+this.canvasId+"info_box_close"));if(0==d.getAttribute("class").includes("fixed")){var p="";if(this.hoverItems={},u>=l.left/2&&u<=a.width-l.right/2)for(var f=0,_=Object.entries(this.barPosData);f<_.length;f++){var g=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_[f],2),m=g[0],v=g[1],y=m.split("-");c>=y[0]&&c<=y[1]&&v.map((function(t){u>
1=t.start&&u<=t.end&&(n.hoverItems[t.name]=t,p+="<strong>"+t.name+"</strong><br />",n.renderConfig["hover content"].map((function(e){p+=e+":"+t.data[e]+"<br />"})))}))}"hover"==e&&(""==p?0==d.getAttribute("class").includes("fixed")&&(d.setAttribute("class","hidden"),h.setAttribute("class","hidden")):0==d.getAttribute("class").includes("fixed")&&(d.setAttribute("class","barplot-info-box"),h.setAttribute("class","hidden"),u<a.width-300?(d.style.left=i+25+"px",d.style.top=o+this.spaceBy+"px"):(d.style.left=i-325+"px",d.style.width="300px !important",d.style.top=o+this.spaceBy+"px"))),"click"==e&&(h.setAttribute("class","fixed-info-box-close"),""==p?d.setAttribute("class","hidden"):(d.setAttribute("class","barplot-info-box fixed"),u<a.width-300?(d.style.left=i+25+"px",d.style.top=o+this.spaceBy+"px"):(d.style.left=i-325+"px",d.style.width="300px !important",d.style.top=o+this.spaceBy+"px")))}},renderBarPlot:function renderBarPlot(){var _this4=this;if(this.renderConfig["thresholds"]&&"calculate"==this.renderConfig["thresholds"]){var threshholds=[];this.renderConfig["thresholds calculate"].map((function(expression){var calcString="";expression.map((function(t){var e=["+","-","*","/","(",")"].includes(t)||"number"===typeof t?t:"string"===typeof t&&"data length"==t?_this4.renderData.data.length:null;calcString+=e}));var threshold=eval(calcString);threshholds.push(threshold)})),this.renderConfig["thresholds"]=threshholds}var wrapper=document.querySelector("#"+this.canvasId+"barPlotWrapper"),canvas=document.querySelector("#"+this.canvasId+"barPlot");if(canvas&&wrapper){var canvasWidth=2*wrapper.clientWidth,canvasHeight=2*Number(this.renderConfig["height"]),c,ctx;c=document.querySelector("#"+this.canvasId+"barPlot"),c.setAttribute("width",canvasWidth),c.setAttribute("height",canvasHeight),c.setAttribute("style","width:"+canvasWidth/2+"px;height:"+canvasHeight/2+"px;"),ctx=c.getContext("2d"),ctx.clearRect(0,0,canvasWidth,canvasHeight),this.barPosData={};for(var renderData=this.groupData(this.renderData),groups={},totalNum=0,minY=null,maxY=null,_i3=0,_Object$entries3=Object.entries(renderData);_i3<_Object$entries3.length;_i3++){var _Object$entries3$_i=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries3[_i3],2),key=_Object$entries3$_i[0],value=_Object$entries3$_i[1];groups[key]=value.length,totalNum+=value.length,value.map((function(t){var e="true"==_this4.renderConfig["convert y -log10"]?t[_this4.renderConfig["y axis field"]+"-log10"]:Number(t[_this4.renderConfig["y axis field"]]);minY=null==minY||e<minY?e:minY,maxY=null==maxY||e>maxY?e:maxY}))}minY=minY>0?0:Math.floor(minY),maxY=maxY<0?0:Math.ceil(maxY),ctx.stroke();var customPlotMargin=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,plotMargin=customPlotMargin?{left:customPlotMargin.left,right:customPlotMargin.right,top:customPlotMargin.top,bottom:customPlotMargin.bottom,bump:10}:{left:this.plotMargin.leftMargin/2,right:this.plotMargin.leftMargin/2*1.5,top:this.plotMargin.bottomMargin/2*3.5,bottom:this.plotMargin.bottomMargin/2*2.5,bump:10};this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"y",5,minY,maxY,this.renderConfig["y axis label"]),this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"x",null,null,null,this.renderConfig["x axis label"]),this.renderTicksByGroup(ctx,canvasWidth,canvasHeight,plotMargin,"x",groups);var xStep=(canvasWidth-plotMargin.left-plotMargin.right)/totalNum,yMax=maxY,yMin=minY,yStep=(canvasHeight-(plotMargin.top+plotMargin.bottom))/(yMax-yMin);this.renderConfig["thresholds"].map((function(t){ctx.beginPath();var e="true"==_this4.renderConfig["convert y -log10"]?-Math.log10(Number(t)):Number(t),n=-minY+e,r=canvasHeight-plotMargin.bottom-n*yStep;ctx.setLineDash([20,10]),ctx.moveTo(plotMargin.left-plotMargin.bump,r),ctx.lineTo(canvasWidth+plotMargin.bump-plotMargin.right,r),ctx.strokeStyle="#FFAA00",ctx.lineWidth=2,ctx.stroke(),ctx.closePath()})),ctx.setLineDash([]);var groupsArr=Object.keys(groups).sort(),dotIndex=0,barWidth=(canvasWidth-(plotMargin.left+plotMargin.right))/totalNum-10;if(barWidth=barWidth<=4?4:barWidth>=80?80:barWidth,totalNum>0)for(var _loop=function(){var t=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries4[_i4],2),e=t[0],n=t[1],r=groupsArr.indexOf(e)%_this4.colors.length,a=_this4.colors[r],i="#00000075",o=0,s=0,l=plotMargin.left+xStep*dotIndex+xStep*n.length-24,c=canvasHeight-plotMargin.bottom- -minY*yStep;
1n.map((function(t){if(null==_this4.phenotypeMapConfig||"kpPhenotypeMap"==_this4.phenotypeMapConfig&&_this4.phenotypeMap[t[_this4.renderConfig["render by"]]]){var e=plotMargin.left+xStep*(dotIndex+.5),n="true"==_this4.renderConfig["convert y -log10"]?t[_this4.renderConfig["y axis field"]+"-log10"]:t[_this4.renderConfig["y axis field"]],r=-minY+n,u=canvasHeight-plotMargin.bottom-r*yStep,d=null==_this4.phenotypeMapConfig?t[_this4.renderConfig["render by"]]:_this4.phenotypeMap[t[_this4.renderConfig["render by"]]]["description"];ctx.fillStyle=a,ctx.lineWidth=1,ctx.strokeStyle=i,ctx.fillRect(e,u,barWidth,c-u);var h=u>=c?Math.round(c)/2:Math.round(u)/2,p=u>=c?Math.round(u)/2:Math.round(c)/2,f=h+"-"+p,_={};_this4.renderConfig["hover content"].map((function(e){_[e]=t[e]}));var g={start:Math.round(e)/2,end:Math.round(e+barWidth)/2,data:_,name:d,id:t[_this4.renderConfig["render by"]]};_this4.barPosData[f]||(_this4.barPosData[f]=[]),_this4.barPosData[f].push(g),0==o&&(s=e);var m=s+24*o;if(m=e>m?e:m,0==o||m<l){ctx.font="22px Arial",ctx.fillStyle="#000000";var v=u<c?u:c;ctx.save(),ctx.translate(m+barWidth/2+10,v-24),ctx.rotate(90*-Math.PI/180),ctx.textAlign="start",ctx.fillText(d,0,0),ctx.restore(),ctx.lineWidth=1,ctx.moveTo(e+barWidth/2,v-5),ctx.lineTo(m+barWidth/2,v-20),ctx.strokeStyle="#00000080",ctx.stroke()}o++,dotIndex++}})),r++},_i4=0,_Object$entries4=Object.entries(renderData);_i4<_Object$entries4.length;_i4++)_loop()}},renderDot:function(t,e,n,r,a){t.beginPath(),t.arc(e,n,10,0,2*Math.PI),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTriangle:function(t,e,n,r,a,i){t.beginPath(),1==i&&(t.moveTo(e-10,n+10),t.lineTo(e+10,n+10),t.lineTo(e,n-10)),-1==i&&(t.moveTo(e-10,n-10),t.lineTo(e,n+10),t.lineTo(e+10,n-10)),t.closePath(),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTicksByGroup:function(t,e,n,r,a,i){for(var o=Object.keys(i).sort(),s=0,l=0,c=Object.entries(i);l<c.length;l++){var u=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(c[l],2),d=(u[0],u[1]);s+=d}switch(t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="22px Arial",t.fillStyle="#000000",t.setLineDash([]),a){case"x":for(var h=(e-r.left-r.right)/s,p=0,f=0,_=Object.entries(i);f<_.length;f++){var g=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_[f],2),m=g[0],v=g[1];if(v>0){var y=r.left+p*h,b=Math.floor(y);t.moveTo(b,n-r.bottom+r.bump),t.lineTo(b,n-r.bottom+2*r.bump),t.stroke();var x=o.indexOf(m)%this.colors.length;t.fillStyle=this.colors[x],t.save(),t.translate(b,n-r.bottom+2*r.bump),t.rotate(45*Math.PI/180),t.textAlign="start",t.fillText(m,0,15),t.restore(),p+=v}}break;case"y":break}},checkStared:function(t){var e=this,n=this.pkgDataSelected.filter((function(t){return t.type==e.renderConfig["star key"]})).map((function(t){return t.id}));return!!n.includes(t)},addStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"add"})},removeStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"remove"})}}}),jquery__WEBPACK_IMPORTED_MODULE_31___default()((function(){}))},4995:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-dropdown",{staticClass:"download-chart",attrs:{variant:"secondary",right:"",size:"sm",text:"Download chart"}},[n("b-dropdown-text",[t._v("Save chart as")]),n("b-dropdown-divider"),n("b-dropdown-item",{on:{click:function(e){return t.downloadSvg()}}},[t._v("SVG")]),n("b-dropdown-item",{on:{click:function(e){return t.downloadPng()}}},[t._v("PNG")])],1)},a=[],i=(n("99af"),n("d3b7"),n("3ca3"),n("ddb0"),n("2b3d"),n("bf19"),n("9861"),n("88a7"),n("271a"),n("5494"),n("2b0e")),o=n("a282"),s=n("5698"),l=i["default"].component("DownloadChart",{props:{chartId:{type:String,required:!0},filename:{type:String,default:"chart"},transparentPng:{type:Boolean,default:!0}},data:function(){return{}},computed:{isCanvas:function(){return null!==document.querySelector("canvas#".concat(this.chartId))}},methods:{svgUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t||(t=this.chartId);var e=(new XMLSerializer).serializeToString(s["select"]("svg#".concat(t)).node()),n=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)},downloadSvg:function(){this.isCanvas?this.downloadCanvasToSvg():o["a"].downloadChart(this.svgUrl(),"".concat(this.filename,".svg"))},downloadPng:function(){if(this.isCanvas)this.downloadCanvasToPng();else{var t=new Image;t.src=this.svgUrl();var e="".concat(this.filename,".png"),n=this.transparentPng;t.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height;var r=t.getContext("2d");n||(r.fillStyle="white",r.fillRect(0,0,t.width,t.height)),r.drawImage(this,0,0);var a=t.toDataURL("image/png");o["a"].downloadChart(a,e)}}},downloadCanvasToPng:function(){var t=document.querySelector("canvas#".concat(this.chartId)),e=t.toDataURL("image/png");o["a"].downloadChart(e,"".concat(this.filename,".png"))},downloadCanvasToSvg:function(){var t=document.querySelector("canvas#".concat(this.chartId)),e=t.toDataURL("image/png"),n=t.height,r=t.width,a='<image height="'.concat(n,'" width="').concat(r,'" y="0" x="0" xlink:href="').concat(e,'" id="importedCanvas_0"/>'),i='<svg xmlns:xlink="http://www.w3.org/1999/xlink" height="'.concat(n,'" width="').concat(r,'" xmlns="http://www.w3.org/2000/svg" id="new-svg">').concat(a,"</svg>"),s=document.createElement("div");s.innerHTML=i,s.hidden=!0,document.body.appendChild(s),o["a"].downloadChart(this.svgUrl("new-svg"),"".concat(this.filename,".svg")),document.body.removeChild(s)}}}),c=l,u=(n("d602"),n("2877")),d=Object(u["a"])(c,r,a,!1,null,null,null);d.exports},"4a13":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{domProps:{innerHTML:t._s(t.documentationContent)}})},a=[],i=(n("b0c0"),n("498a"),n("2b0e")),o=n("06df"),s=i["default"].component("documentation",{props:["name","contentFill","contentMap","defaultContent"],data:function(t){return{}},computed:{documentationContent:function(){var t=null;if(this.contentMap&&this.contentMap[this.name]&&(t=this.contentMap[this.name].content),"string"===typeof t&&(t=t.trim()),!t&&this.defaultContent&&(t=this.defaultContent),!t)return"";var e=this.contentFill||{},n=o["a"].makeConverter(t,e,this.name);return n.makeHtml(t)}
vendor: 4,137 bytes, line 1
1}}),l=s,c=(n("a896"),n("2877")),u=Object(c["a"])(l,r,a,!1,null,"32fe2f59",null);e["a"]=u.exports},"4cdc":function(t,e,n){},"4d09":function(t,e,n){},"4ea0":function(t,e,n){"use strict";n("38b2")},"51e1":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("autocomplete",{ref:"geneSelect",attrs:{placeholder:t.$store.state.geneToQuery?t.$store.state.geneToQuery:"Search gene",matches:t.matchingGenes},on:{"input-change":function(e){return t.lookupGenes(e)},"item-select":function(e){return t.selectGene(e)}}})},a=[],i=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("53ca")),o=n("1da1"),s=n("2b0e"),l=n("5f5b"),c=n("b1e0"),u=n("d726"),d=n("bb0b"),h=(n("f9e3"),n("2dd8"),n("e60d")),p=n("3feb");function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}s["default"].use(l["a"]),s["default"].use(c["b"]),s["default"].component("vue-typeahead-bootstrap",u["a"]),s["default"].component("autocomplete",d["a"]);var _=s["default"].component("gene-selectpicker",{props:[],data:function(){return{matchingGenes:[]}},computed:{},methods:{setFocus:function(){var t=this;this.$nextTick((function(){t.$refs.geneSelect.$refs.input.focus()}))},lookupGenes:function(t){var e=this;return Object(o["a"])(f().mark((function n(){var r;return f().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!t){n.next=5;break}return n.next=3,Object(h["e"])("gene",t,{limit:10});case 3:r=n.sent,e.matchingGenes=r;case 5:case"end":return n.stop()}}),n)})))()},selectGene:function(t){var e=this;return Object(o["a"])(f().mark((function n(){var r;return f().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,p["a"].geneSymbol(t);case 2:r=n.sent,r&&(e.$store.state.geneToQuery=r,e.$emit("onGeneChange",r));case 4:case"end":return n.stop()}}),n)})))()}}}),g=_,m=n("2877"),v=Object(m["a"])(g,r,a,!1,null,null,null);e["a"]=v.exports},"529c":function(t,e,n){"use strict";var r=n("b85c"),a=n("3835"),i=n("53ca");n("a4d3"),n("e01a"),n("99af"),n("caad"),n("a15b"),n("d81d"),n("14d9"),n("6b93"),n("a9e3"),n("9129"),n("c35a"),n("25eb"),n("a3a2"),n("b680"),n("4fad"),n("b64b"),n("d3b7"),n("ac1f"),n("25f0"),n("2532"),n("3ca3"),n("5319"),n("5b81"),n("498a"),n("9911"),n("0643"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b3d"),n("bf19"),n("9861"),n("88a7"),n("271a"),n("5494");function o(t,e){return t.length>3&&(t=t.substr(0,3)+"..."),e.length>3&&(e=e.substr(0,3)+"..."),"".concat(t,"/").concat(e)}function s(t){var e={GWAS:"GWAS",ExChip:"Exome chip",ExSeq:"Exome sequence analysis",WGS:"Whole genome sequencing",IChip:"IChip"};return e[t]}function l(t){var e={ABA:"Aboriginal Australian",AA:"African American or Afro-Caribbean",AF:"African unspecified",SSAF:"Sub-Saharan African",ASUN:"Asian unspecified",CA:"Central Asian",EA:"East Asian",SA:"South Asian",SEA:"South East Asian",EU:"European",GME:"Greater Middle Eastern (Middle Eastern, North African, or Persian)",HS:"Hispanic or Latin American",NAM:"Native American",NR:"Not reported",OC:"Oceanian",OTH:"Other",OAD:"Other admixed ancestry",Mixed:"Mixed ancestry"};return e[t]}function c(t){if(t)return t.replace(/(^|_|\s)([a-z])/g,(function(t,e,n){return"".concat(e.length>0?" ":"").concat(n.toUpperCase())}))}function u(t){if(t)return t.trim().toLowerCase().replaceAll(" ","_")}function d(t){return c(t)}function h(t){return p(t)}function p(t){return c(t)}function f(t){return p(t)}function _(t){var e={transcript_ablation:"It deletes a region that includes a transcript feature.",splice_donor_variant:"It is a splice variant that changes the 2-base region at the 5' end of an intron.",splice_acceptor_variant:"It is a splice variant that changes the 2-base region at the 3' end of an intron.",stop_gained:"It is a sequence variant that introduces a stop codon, leading to a shortened transcript.",frameshift_variant:"It causes a frameshift, disrupting the translational reading frame because the number of nucleotides inserted or deleted is not a multiple of three.",stop_lost:"It is a sequence variant that changes a stop codon, resulting in an elongated transcript.",initiator_codon_variant:"It changes the first codon of a transcript.",inframe_insertion:"It is an inframe non-synonymous variant that inserts base
1s into the coding sequence.",inframe_deletion:"It is an inframe non-synonymous variant that deletes bases from the coding sequence.",missense_variant:"It results in a different amino acid sequence but preserves length.",transript_amplification:"It amplifies a region containing a transcript.",splice_region_variant:"It is a sequence variant in which a change has occurred within the region of a splice site, either within 1-3 bases of the exon or 3-8 bases of the intron.",incomplete_terminal_codon_variant:"It is a sequence variant that changes at least one base of the final codon of an incompletely annotated transcript.",synonymous_variant:"It does not cause any change to the encoded amino acid.",stop_retained_variant:"It changes the set of bases in a stop codon, but the stop codon itself remains functional.",coding_sequence_variant:"It changes the coding sequence.",mature_miRNA_variant:"It is a transcript variant located with the sequence of the mature miRNA.","5_prime_UTR_variant":"It is found in the 5' untranslated region.","3_prime_UTR_variant":"It is found in the 3' untranslated region.",non_coding_exon_variant:"It changes the non-coding exon sequence.",nc_transcript_variant:"It is a transcript variant of a non-coding RNA.",intron_variant:"It is a transcript variant occurring within an intron.",nmd_transcript_variant:"It falls in a transcript that is the target of nonsense-mediated decay.",upstream_gene_variant:"It is located upstream (5') of the gene.",downstream_gene_variant:"It is located downstream (3') of the gene.",tfbs_ablation:"It deletes a region that includes a transcription factor binding site.",tfbs_amplification:"It amplifies a region that includes a transcription factor binding site.",tf_binding_site_variant:"It is located within a transcription factor binding site.",regulatory_region_variant:"It is located within a regulatory region.",regulatory_region_ablation:"It deletes a regulatory region.",regulatory_region_amplification:"It amplifies a regulatory region.",feature_elongation:"It causes the extension of a genomic feature with regard to the reference sequence.",feature_truncation:"It causes the truncation of a genomic feature with regard to the reference sequence.",intergenic_variant:"It is located in an intergenic region (between genes)."};return e[t]||"Unknown"}function g(t){return t}function m(t){return t?Number.parseFloat(t).toFixed(2):"-"}function v(t){return Number.isNaN(Number.parseFloat(t))?"-":Number.parseFloat(t).toFixed(3)}function y(t){if(!t)return"-";var e=Number.parseFloat(t);if(e<1e-5)return e.toExponential(2);var n=(1*e.toFixed(7)).toString();return n}function b(t){return t?Number.parseFloat(t).toFixed(4):"-"}function x(t){return t?Number.parseInt(t).toLocaleString():"-"}function w(t){var e=t.chr.charAt(3),n=t.start.replace(/,/g,""),r=t.end.replace(/,/g,"");return C(e,n,r)}function C(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return n?"".concat(t,":").concat(x(e),"-").concat(x(n)):"".concat(t,":").concat(x(e))}function P(t){return t?t.description:"-"}function k(t){return t?p(t):"-"}function M(t){return c(t)}function E(t,e){if(t===e)return 100;var n=Math.log(-Math.log10(e)),r=Math.log(-Math.log10(t)),a=r/n*100;return a>100?100:a}function D(t,e){var n=0==e?1:10*e,r=Math.round(t*n)/n;return r}function O(t){var e={LoF_HC:{description:"LofTee",sort:0},loftee:{description:"LofTee",sort:0},"16of16":{description:"16/16",sort:1},ns_severe:{description:"16/16",sort:1},"11of11":{description:"11/11 ",sort:2},ns_stringent:{description:"11/11 ",sort:2},"5of5":{description:"5/5",sort:3},ns_strict:{description:"5/5",sort:3},"5of5_LoF_LC":{description:"5/5 + LofTee LC",sort:4},ns_strict_fp_ptvs:{description:"5/5 + LofTee LC",sort:4},"1of5_1pct":{description:"5/5 + 1/5 1%",sort:5},ns_strict_ns_broad_1pct:{description:"5/5 + 1/5 1%",sort:5},"0of5_1pct":{description:"5/5 + 0/5 1%",sort:6},ns_strict_ns_1pct:{description:"5/5 + 0/5 1%",sort:6},hclof_noflag_canonical:{description:"Rare LoF",sort:7},"hclof_noflag_missense0.8_canonical":{description:"Rare LoF + Missense",sort:7},"missense0.5_canonical":{description:"Ultra-rare Missense",sort:7}};return e[t]?e[t]:{description:t,sort:7}}function L(t,e,n){var r;switch(e.type){case"link":var a=e.link;e.parameters.map((function(e){a=a.replace("$"+e,t[e])})),r="<a href='"+a+"'>"+n+"</a>";break;
1case"scientific notation":r=y(n),r="-"==r?0:r;break;case"ancestry":r=l(n);break}return r}function j(t,e,n,r,a,o,s,l,c){var u=this,d=t;return n.map((function(o){var h,p,f,_,g;switch(o){case"js math":var m=e["method"];d=Math[m](t);break;case"scientific notation":d=y(t),d="-"==d?0:d;break;case"fixed 2":d="-"==t?0:Math.round(10*Number.parseFloat(t))/10;break;case"fixed 3":d="-"==t?0:Math.round(100*Number.parseFloat(t))/100;break;case"fixed 4":d="-"==t?0:Math.round(1e3*Number.parseFloat(t))/1e3;break;case"fixed 5":d="-"==t?0:Math.round(1e4*Number.parseFloat(t))/1e4;break;case"fixed 6":d="-"==t?0:Math.round(1e5*Number.parseFloat(t))/1e5;break;case"fixed 7":d="-"==t?0:Math.round(1e6*Number.parseFloat(t))/1e6;break;case"fixed 8":d="-"==t?0:Math.round(1e7*Number.parseFloat(t))/1e7;break;case"fixed 9":d="-"==t?0:Math.round(1e8*Number.parseFloat(t))/1e8;break;case"fixed 10":d="-"==t?0:Math.round(1e9*Number.parseFloat(t))/1e9;break;case"kp phenotype link":var v=s[d]?s[d].description:d;h="<a href='"+e["link to"]+d,h+=e["link type"]&&"button"==e["link type"]?"' class='btn btn-sm btn-outline-secondary link-button":"",p=e["link label"]?e["link label"]:v,h+="true"==r?"' target='_blank'>"+p+"</a>":"'>"+p+"</a>",d=h;break;case"link":if(d&&""!=d){var b=[],x="string"==typeof d?d.split(","):"object"==Object(i["a"])(d)&&d.isArray()?d:[d];x.map((function(t){var n="<a href='"+e["link to"]+t;n+=e["link type"]&&"button"==e["link type"]?"' class='btn btn-sm btn-outline-secondary link-button":"",p=e["link label"]?e["link label"]:t,n+="true"==r?"' target='_blank'>"+p+"</a>":"'>"+p+"</a>",b.push(n)})),h=b.join()}d=d&&""!=d?h:d;break;case"link with parameters":if(d&&""!=d){var w="<a href='"+e["link to"],C=Object.keys(e["parameters"]);C.map((function(t){w+=t+"="+c[e["parameters"][t]]+"&"})),w+="true"==r?"' target='_blank'>"+d+"</a>":"'>"+d+"</a>",h=w}d=d&&""!=d?h:d;break;case"map name":var P=d;if("shared resource"==e["map"]){var k=u.$root.sharedResource[e["map name"]];d=k[d]}else d=e["map"][d];e["link to"]&&(d="<a href='"+P+"'>"+d+"</a>");break;case"as link":d="<a href='"+d+"'>"+d+"</a>";break;case"image":d&&""!=d&&(d='<img width="'+e["width"]+'" height="'+e["height"]+'" src="'+d+'" />');break;case"video":d&&""!=d&&(d='<video width="'+e["width"]+'" height="'+e["height"]+'" controls><source src="'+d+'" type="video/mp4" > Your browser does not support the video tag.</video>');break;case"list":if("object"!=Object(i["a"])(d))d='<div class="list-item">'.concat(d,"</div>");else if("object"===Object(i["a"])(d)&&Array.isArray(d)){var M="<ul>";d.map((function(t){M+="<li>".concat(t,"</li>")})),M+="</ul>",d=M}break;case"value in class":if("object"!=Object(i["a"])(d)){var E=n.includes("colorize");d='<span class="'.concat(d," ").concat(E?"do-color":"",'">').concat(d,"</span>")}else if("object"==Object(i["a"])(d)&&Array.isArray(d)){var D="";d.map((function(t){D+='<span class="'.concat(t," ").concat(colorize?"do-color":"",'">').concat(t,"</span>")})),d=D}break;case"render background percent":f="number"!=typeof t?e["percent if empty"]:t,_=Math.floor((Number(f)-l[a].low)/(l[a].high-l[a].low)*100),g="cell-weight-"+_+" ",g+=t<0?"weight-negative":"weight-positive",d="<span class='"+g+"'>"+d+"</span>";break;case"render background percent negative":f="number"!=typeof t?e["percent if empty"]:t,_=100-Math.floor((Number(f)-l[a].low)/(l[a].high-l[a].low)*100),g="cell-weight-"+_+" ",g+=t<0?"weight-negative":"weight-positive",d="<span class='"+g+"'>"+d+"</span>";break;case"direction triangle":d=d>0?'<span class="direction-positive">▲</span>'+d:'<span class="direction-negative">▼</span>'+d;break;case"direction triangle opposite":d=d>0?'<span class="direction-positive">▼</span>'+d:'<span class="direction-negative">▲</span>'+d;break;case"shorten":var O=e["shorten to"],L="start"==e["shorten anchor"]?d.substring(0,O):d.substring(d.length-O,d.length);d="start"==e["shorten anchor"]?"<span class='byor-shortened-string'><span class='raw-string'>"+d+"</span>"+L+"...</span>":"<span class='byor-shortened-string'><span class='raw-string'>"+d+"</span>..."+L+"</span>"}})),d}function S(t){var e;return e="number"!=typeof t||isNaN(t)?t:y(t),e}function A(t,e,n,r,o,s){if(void 0!=n["column formatting"]&&void 0!=n["column formatting"][e]){var l,c=n["column formatting"][e],u=c["type"],d=c["new tab"]?c["new tab"]:null;if(u.includes("cfde-datatypes"),"object"!=Object(i["a"])(t))if(u.includes("youtube")){var h='\n <iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/'.concat(t,'" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;
1 web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>\n ');l=h}else l=j(t,c,u,d,e,n,r,o,s);else if("object"==Object(i["a"])(t)&&Array.isArray(t))if(u.includes("object to mini-card")){var p="";t.map((function(t){p+="<div class='mini-card'>";Object.keys(t);p+='<div class="mini-card-video">\n <video src="'.concat(t["video"],'" poster="').concat(t["screenshot"],'" autoplay muted playsinline>\n </div>'),p+='<div class="mini-card-info">\n <a class="mini-card-title" href="'.concat(t["link"],'" target="_blank">').concat(t["title"],'<span>↗</span></a>\n <div class="mini-card-description">').concat(t["description"],"</div>\n </div>"),p+="</div>"})),l=p}else if(u.includes("custom-citation")){var f="";t.forEach((function(t){if(t.title&&""!==t.title){var e='\n <div class="citation">\n <div><strong>'.concat(t.title,"</strong></div>\n <div>").concat(t.authors," <i>").concat(t.publication,'</i></div>\n <div class="citation-links">\n <div>DOI: <a href="https://doi.org/').concat(t.doi,'" target="_blank">').concat(t.doi,'</a></div>\n <div style="display:').concat(""===t.pmid?"none":"block",'">PMID: <a href="http://www.ncbi.nlm.nih.gov/pubmed/').concat(t.pmid,'" target="_blank">').concat(t.pmid,'</a></div>\n <div style="display:').concat(""===t.pmcid?"none":"block",'">PMCID: <a href="http://www.ncbi.nlm.nih.gov/pubmed/').concat(t.pmcid,'" target="_blank">').concat(t.pmcid,'</a></div>\n </div>\n <div class="citation-notes">').concat(t.description,"</div>\n </div>\n ");f+=e}})),l=f}else{var _=u.includes("image")&&""!=t?"<div class='imgs_wrapper'>":"";t.map((function(t){_+=j(t,c,u,d,e,n,r,o,s)})),_+=u.includes("image")&&""!=t?"</div>":"",l=_}else if(u.includes("custom-extra")&&(l='<div class=""><div class="">'.concat(t["description"],'</div><a href="').concat(t["link"],'" target="_blank">').concat(t["link label"],"</a></div>")),u.includes("cfde-datatypes")){for(var g='<div style="display:flex;flex-direction:column; gap:10px;">',m=0,v=Object.entries(t);m<v.length;m++){var y=Object(a["a"])(v[m],2),b=y[0],x=y[1];if(""!=x.trim()){var w=b.replaceAll("_"," ");g+='<div style="'.concat("note"===w?"display:flex;gap:5px;font-style:italic;":"",'">\n <div style="font-weight:bold;text-transform:capitalize">').concat(w,"</div>\n <div>").concat(x,"</div>\n </div>\n ")}}l=g}return l}return t}function I(t){var e;return e=t.length>=15?"<span class='byor-shortened-string'><span class='raw-string'>"+t+"</span>"+t.substring(0,14)+"...</span>":t,e}function T(t,e){var n=e?Object.keys(e):[],i=t;if(i){var o,s=window.location.href,l={},c=new URL(s),u=c.searchParams,d=Object(r["a"])(u.entries());try{for(d.s();!(o=d.n()).done;){var h=Object(a["a"])(o.value,2),p=h[0],f=h[1];l[p]=f}}catch(_){d.e(_)}finally{d.f()}Object.keys(l).map((function(t){if(n.includes(t)){var r=e[t].values?e[t].values[l[t]]:l[t];i=i.replaceAll("$"+t,r)}})),i=i.replaceAll("$",'<small style="background-color: #cccccc; padding: 0 0.1em; font-size:0.65em; vertical-align: text-top; margin-right: 0.2em;">parameter</small>')}return i}e["a"]={alleleFormatter:o,ancestryFormatter:l,dataTypeFormatter:s,annotationFormatter:d,bioTypeFormatter:h,capitalizedFormatter:p,consequenceFormatter:f,consequenceMeaning:_,dbSNPFormatter:g,floatFormatter:m,tpmFormatter:v,intFormatter:x,locusFormatter:C,igvLocusFormatter:w,maskFormatter:O,phenotypeFormatter:P,snakeFormatter:c,toSnakeFormatter:u,tissueFormatter:M,methodFormatter:k,pValueFormatter:y,effectFormatter:b,pValueCss:E,decimalFormatter:D,BYORColumnFormatter:A,getHoverValue:S,get
1ShortName:I,ssColumnFormat:L,replaceWithParams:T}},"52ee":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"variant-search"}},[n("b-row",[n("b-col",{attrs:{cols:"9"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.tableData.length,expression:"tableData.length"}],staticClass:"legends"},[n("strong",{staticClass:"mr-2"},[t._v("Impact:")]),n("b-btn",{staticClass:"mr-1 btn-mini",attrs:{disabled:"",variant:"outline-danger",size:"sm"}},[t._v("HIGH")]),n("b-btn",{staticClass:"mr-1 btn-mini",attrs:{disabled:"",variant:"outline-warning",size:"sm"}},[t._v("MODERATE")]),n("b-btn",{staticClass:"mr-1 btn-mini",attrs:{disabled:"",variant:"outline-success",size:"sm"}},[t._v("LOW")]),n("b-btn",{staticClass:"btn-mini",attrs:{disabled:"",variant:"outline-secondary",size:"sm"}},[t._v("MODIFIER")]),n("b-form-checkbox",{staticClass:"ml-3",attrs:{name:"sort-impacts",switch:"",inline:"",size:"sm"},model:{value:t.sortByImpacts,callback:function(e){t.sortByImpacts=e},expression:"sortByImpacts"}},[t._v(" Rank by Impact ")])],1)]),n("b-col",{staticClass:"text-right mb-2"},[n("b-btn",{staticClass:"btn btn-secondary btn-sm",on:{click:function(e){return t.showHideElement("filter_pop_up")}}},[t._v("Filter Results")])],1),n("b-col",{staticClass:"text-right mb-2"},[t.tableData.length?n("data-download",{attrs:{data:t.tableData,filename:"variants"}}):t._e()],1)],1),n("b-row",[n("b-col",[n("div",{attrs:{id:"filter_pop_up_example"}},[n("div",{staticClass:"hidden",attrs:{id:"filter_pop_up"}},[n("div",[n("h4",{staticStyle:{"text-align":"center","margin-bottom":"20px"}},[t._v(" Filter variants ")]),n("form",[n("fieldset",[n("h6",[t._v("Select impact")]),n("div",{staticStyle:{"padding-left":"15px","margin-bottom":"15px"}},[t._l(t.disablebtn,(function(e,r){return[n("b-form-checkbox",{key:e+r,attrs:{name:"impact",disabled:e,value:r,inline:""},model:{value:t.filters["impacts"],callback:function(e){t.$set(t.filters,"impacts",e)},expression:"filters['impacts']"}},[n("b-btn",{staticClass:"mr-1 btn-mini",attrs:{disabled:"",variant:t.disablebtnstyle[r],size:"sm"}},[t._v(t._s(r))])],1)]}))],2)])])]),n("div",{staticStyle:{"text-align":"center","margin-top":"25px"}},[n("b-btn",{staticClass:"btn btn-warning btn-sm",staticStyle:{"margin-right":"5px"},on:{click:function(e){return t.showHideElement("filter_pop_up")}}},[t._v("Cancel")]),n("b-btn",{staticClass:"btn btn-success btn-sm",attrs:{disabled:!t.filters["phenotypes"].length||!t.filters["impacts"].length},on:{click:function(e){t.addfilter(),t.showHideElement("filter_pop_up")}}},[t._v("Apply filter")])],1)])])])],1),n("div",{directives:[{name:"show",rawName:"v-show",value:t.tableData.length,expression:"tableData.length"}]},[n("b-table",{attrs:{hover:"",small:"","sort-icon-left":"",responsive:"",fields:t.fields,items:t.tableData,"per-page":t.perPage,"current-page":t.currentPage},scopedSlots:t._u([{key:"thead-top",fn:function(e){return[n("b-tr",[n("b-th",{attrs:{colspan:"3"}},[n("span",{staticClass:"sr-only"},[t._v("Variant, dbSNP, Consequence")])]),n("b-th",{staticClass:"text-center",attrs:{colspan:"3",variant:"secondary"}},[t._v("Allele")]),n("b-th",[n("span",{staticClass:"sr-only"},[t._v("Max AF")])]),n("b-th",{staticClass:"text-center",attrs:{colspan:"2",variant:"secondary"}},[t._v("Heterozygous")]),n("b-th",{staticClass:"text-center",staticStyle:{"border-left":"1px solid #dee2e6"},attrs:{colspan:"2",variant:"secondary"}},[t._v("Homozygous")]),n("b-th",[n("span",{staticClass:"sr-only"},[t._v("View VEP Data")])])],1)]}},{key:"cell(varId)",fn:function(e){return[n("a",{attrs:{href:"/variant.html?variant="+e.item.varId}},[t._v(t._s(e.item.varId))])]}},{key:"cell(dbSNP)",fn:function(e){return[n("a",{attrs:{href:"/variant.html?variant="+e.item.dbSNP}},[t._v(t._s(e.item.dbSNP))])]}},{key:"cell(max_consequence)",fn:function(e){return[e.item.Max_Impact?n("div",{staticClass:"border-color",class:e.item.Max_Impact},[t._v(" "+t._s(e.item.max_consequence.substring(1,e.item.max_consequence.length-1))+" ")]):n("div",{staticClass:"border-color NONE"})]}},{key:"cell(view)",fn:function(e){return[e.item.consequence?n("b-button",{staticClass:"btn-mini showData",attrs:{size:"sm",variant:"outline-primary"},on:{click:function(n){t.showVariantData(e.item.varId),e.toggleDetails()}}},[t.loadingData[e.item.varId]?n("span",[n("b-spinner",{attrs:{small:""}}),n("span",{staticClass:"sr-only"},[t._v("Loading...")])],1):n("span",[t._v(" "+t._s(e.detailsShowing?"Hide":"Show")+" Annotations")])]):n("b-btn",{staticClass:"btn-mini",attrs:{disabled:"",size:"sm",variant:"outline-secondary"}},[t._v("No Annotation")])]}}
1,{key:"row-details",fn:function(e){return[n("div",{staticClass:"details"},[t.variantData[t.escapedVarID(e.item.varId)]&&t.variantData[t.escapedVarID(e.item.varId)].length?n("div",[n("b-table",{attrs:{items:t.variantData[t.escapedVarID(e.item.varId)],fields:t.subFields,"per-page":t.perPage,"tbody-tr-class":t.rowPickClass},scopedSlots:t._u([{key:"cell(varId)",fn:function(e){return[n("a",{attrs:{href:"/variant.html?variant="+e.item.varId}},[t._v(t._s(e.item.varId))])]}},{key:"head(transcriptId)",fn:function(e){return[n("span",{staticClass:"external_source"},[t._v("Feature ")])]}},{key:"cell(transcriptId)",fn:function(e){return[e.item.transcriptId?n("a",{attrs:{href:"https://grch37.ensembl.org/Homo_sapiens/Transcript/Summary?db=core;t="+e.item.transcriptId,target:"_blank",rel:"noopener noreferrer nofollow"}},[t._v(t._s(e.item.transcriptId))]):t._e()]}},{key:"cell(position)",fn:function(e){return[t._v(" "+t._s(e.item.proteinStart!==e.item.proteinEnd?e.item.proteinStart+"-"+e.item.proteinEnd:e.item.proteinStart)+" ")]}},{key:"cell(consequenceTerms)",fn:function(e){return[n("div",{staticClass:"border-color",class:e.item.impact},t._l(e.item.consequenceTerms,(function(r,a){return n("span",{key:r},[t._v(t._s(t.consequenceFormatter(r))+t._s(a<e.item.consequenceTerms.length-1?", ":""))])})),0)]}},{key:"cell(siftPrediction)",fn:function(e){return[t._v(" "+t._s(t.siftFormatter(e.item.siftPrediction))+" ")]}}],null,!0)})],1):t.variantData[t.escapedVarID(e.item.varId)]&&0===t.variantData[t.escapedVarID(e.item.varId)].length?n("div",[n("b-alert",{attrs:{show:"",variant:"warning"}},[t._v(" No predicted transcript consequences found for this variant.")])],1):t._e()])]}}])}),n("b-pagination",{attrs:{size:"sm","total-rows":t.rows,"per-page":t.perPage,"aria-controls":"my-table"},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1)],1)},a=[],i=n("53ca"),o=n("1da1"),s=n("5530"),l=(n("d9e2"),n("4de4"),n("caad"),n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("14d9"),n("fb6a"),n("4e82"),n("b0c0"),n("4ec9"),n("b680"),n("0c47"),n("23dc"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("2532"),n("5319"),n("0643"),n("2382"),n("3ca3"),n("4e3e"),n("159b"),n("ddb0"),n("0eb6"),n("b7ef"),n("8bd4"),n("ad1f"),n("2b0e")),c=n("e60d"),u=n("529c"),d=n("f529"),h=n("a282");function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
vendor: 4,270 bytes, line 1
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}
1var f=l["default"].component("VariantSearch",{components:{DataDownload:d["a"]},props:{gene:[String,Array]},data:function(){return{applyfilter:!1,disablebtn:{HIGH:!0,MODERATE:!0,LOW:!0,MODIFIER:!0},disablebtnstyle:{HIGH:"outline-danger",MODERATE:"outline-warning",LOW:"outline-success",MODIFIER:"outline-secondary"},filters:{impacts:["HIGH","MODERATE","LOW"],phenotypes:["AllSamples","Resistant","AdultResistant","PediatricResistant","Sensitive","AdultSensitive","PediatricSensitive","Uncategorized","AdultUncategorized","PediatricUncategorized"]},perPage:10,currentPage:1,variants:[],consequences:{},fields:[{key:"varId",label:"Variant"},{key:"dbSNP",label:"dbSNP"},{key:"max_consequence",label:"Consequence",tdClass:"border-color"},{key:"alleleCountCases",label:"Cases",sortable:!0},{key:"alleleCountControls",label:"Controls",sortable:!0},{key:"alleleCount",label:"Count",sortable:!0},{key:"maf",label:"Max AF",sortable:!0,thStyle:"min-width: 120px;"},{key:"heterozygousCases",label:"Cases",sortable:!0},{key:"heterozygousControls",label:"Controls",sortable:!0},{key:"homozygousCases",label:"Cases",sortable:!0},{key:"homozygousControls",label:"Controls",sortable:!0},{key:"view",label:"View VEP Data",class:"nowrap"}],subFields:[{key:"transcriptId",label:"Feature"},{key:"position",label:"Position"},{key:"aminoAcids",label:"Amino Acids"},{key:"consequenceTerms",label:"Consequence",tdClass:"border-color"},{key:"hgncId",label:"HGNC"},{key:"hgvsc",label:"HGVSc"},{key:"hgvsp",label:"HGVSp"},{key:"polyphen2HdivPred",label:"PolyPhen (HDIV)"},{key:"polyphen2HvarPred",label:"PolyPhen (HVAR)"},{key:"siftPrediction",label:"SIFT Prediction"},{key:"lrtPred",label:"LRT"},{key:"mutationTaster",label:"Mutation Taster"},{key:"caddRawRankscore",label:"CADD-Phred Score"},{key:"gnomadGenomesPopmaxAf",label:"gnomAD AF"}],variantData:{},loadingData:{},sortByImpacts:!1}},computed:{tableData:function(){var t=this;if(this.sortByImpacts&&this.variantData.length){var e=structuredClone(this.variantData);return e.sort((function(e,n){return t.sortImpacts(e,n)}))}return this.variantData||[]},rows:function(){if(this.tableData)return this.tableData.length}},watch:{gene:{handler:function(t){t&&this.searchVariants()},immediate:!0}},methods:Object(s["a"])(Object(s["a"])({},h["a"]),{},{showHideElement:function(t){h["a"].showHideElement(t)},selectAllElements:function(t,e){var n=document.getElementsByName(t);for(var r in n)parseInt(r)>=0&&(n[r].checked=!!e)},searchVariants:function(){var t=this;return Object(o["a"])(p().mark((function e(){var n,r,a;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.currentPage=1,e.next=3,Object(c["f"])("gene-variants",t.gene);case 3:if(t.variants=e.sent,t.variants&&t.variants.length){for(n=0;n<t.variants.length;n++)if(t.variants[n].gnomAD_info&&(t.variants[n].gnomAD_exomes_AC=t.variants[n].gnomAD_info.gnomADg_AC,t.variants[n].gnomAD_exomes_AN=t.variants[n].gnomAD_info.gnomADg_AN,t.variants[n].gnomAD_exomes_AF=t.variants[n].gnomAD_info.gnomADg_AF),t.variants[n].vepRecords.length>0)for(r=t.variants[n].vepRecords,a=0;a<r.length;a++)"1"==r[a].pick&&(t.variants[n].Gene_Symbol=r[a].Gene_Symbol,t.variants[n].Max_Impact=r[a].impact,"LOWEST"==t.variants[n].Max_Impact&&(t.variants[n].Max_Impact="MODIFIER"),t.variants[n].max_consequence=r[a].consequenceTerms,t.variants[n].Protein_Position=r[a].Protein_position,t.variants[n].Amino_Acids=r[a].Amino_acids,t.disablebtn[t.variants[n].Max_Impact]=!1,t.variants[n].HGVSc=r[a].HGVSc,t.variants[n].HGVSp=r[a].HGVSp);t.variantData=structuredClone(t.variants),(t.filters.impacts.length>0||t.filters.phenotypes.length>0)&&t.addfilter()}case 5:case"end":return e.stop()}}),e)})))()},addfilter:function(){var t=this,e=this.variants;this.filters["impacts"].length>0&&(e=e.filter((function(e){return t.filters["impacts"].includes(e.Max_Impact)}))),this.variantData=e},getTranscriptConsequences:function(t){return Object(o["a"])(p().mark((function e(){var n;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t){e.next=5;break}return e.next=3,Object(c["f"])("transcript-consequences",t);case 3:return n=e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})))()},consequenceFormatter:function(t){if(t){var e=t.replace("_prime_","' ").replace("_variant","");return u["a"].snakeFormatter(e)}},siftFormatter:function(t){return u["a"].snakeFormatter(t)},showVariantData:function(t){var e=this;return Object(o["a"])(p().mark((function n(){var r,a;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.escapedVarID(t),void 0!==e.variantData[r]){n.next=8;break}return e.loadingData[r]=!0,n.next=5,e.getTranscriptConsequences(t);case 5:a=n.sent,l["default"].set(e.variantData,r,a),e.loadingData[r]=!1;case 8:case"end":return n.stop()}}),n)})))()},escapedVarID:function(t){return t?t.replace(/:\s*/g,"_"):""},rowPickClass:function(t,e){if(t&&"row"===e)return 1===t.pick?"row-pick":void 0},sort:function(t){t===this.currentSort&&(this.currentSortDir="asc"===this.currentSortDir?"desc":"asc"),this.currentSort=t},sortImpacts:function(t,e){var n=["HIGH","MODERATE","LOW","MODIFIER","LOWEST"],r=t.Max_Impact,a=e.Max_Impact,i=n.indexOf(r),o=n.indexOf(a);return i<o?-1:i>o?1:0},format_hgvsc:function(t){return(null===t||void 0===t?void 0:t.split(":")[1])||""},format_hgvsp:function(t){return(null===t||void 0===t?void 0:t.split(":")[1].replace("/%3D/g","="))||""},format_freq:function(t){return(null===t||void 0===t?void 0:t.toFixed(5))||""}})}),_=f,g=(n("1996"),n("2877")),m=Object(g["a"])(_,r,a,!1,null,null,null);e["a"]=m.exports},5374:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",[n("div",{attrs:{id:"lz_"+t.salt}},[n("div",[t.locuszoommounted?t._t("default"):t._e()],2)])])},a=[],i=n("ade3"),o=n("5530"),s=(n("4de4"),n("5db7"),n("caad"),n("d81d"),n("14d9"),n("73d9"),n("4fad"),n("b64b"),n("d3b7"),n("4d63"),n("c607"),n("ac1f"),n("2c3e"),n("25f0"),n("2532"),n("0643"),n("2382"),n("cd1a"),n("4e3e"),n("a573"),n("159b"),n("2b0e")),l=n("ef2a"),c=n("faf9"),u=n("1ccd"),d=n("44dc"),h=function(){var t=this,e=this,n=e.$createElement,r=e._self._c||n;return r("lz-panel",{ref:"panel",attrs:{panelClass:e.panelClass},on:{updated:function(e){return t.panelId=e.panelId}}})},p=[],f=(n("99af"),n("a15b"),n("bacd")),_=n("5698"),g=n("06a9"),m=n("67a3"),v=s["default"].component("lz-intervals-panel",{components:{LzPanel:f["a"]},props:{index:{type:String,required:!0},primaryKey:{type:String,required:!0},secondaryKey:{type:String,required:!0}
1,scoring:Object,title:String},data:function(){return{panelId:null,panelClass:null}},created:function(){var t=this;this.panelClass=y(this.index,this.primaryKey,this.secondaryKey,this.scoring,this.title,(function(e){return t.$emit("input",e)}),(function(e){return t.$emit("resolve",e)}),(function(e){return t.$emit("error",e)})),this.addPanels=this.$parent.addPanels,this.plot=this.$parent.plot},watch:{annotation:function(){this.panelId&&this.$parent.plot.removePanel(this.panelId),this.$refs.panel.updatePanel()}}});function y(t,e,n,r,a,i,o,s,c){var u='$..data_layers[?(@.id === "intervals")]',d=new m["b"]("intervals",{y_index:2,title:{text:"".concat(a," Regions")}}).addFields(u,"intervals",["pValue","fold"]);l["a"].Layouts.mutate_attrs(d.layout,'$..data_layers[?(@.tag === "intervals")].split_tracks',!0);var h=function(t){var a=t?t.map((function(t){var a=Object(_["rgb"])(Object(_["color"])(g["c"].getColor(t[n]))),i=a.r,o=a.g,s=a.b;if(!t[n])return null;var l=r["".concat(t.annotation,"___").concat(t.tissue)]||{minP:void 0,maxFold:void 0};return{name:e,pValue:l.minP,fold:l.maxFold,chr:t.chromosome,start:t.start,end:t.end,state_id:"".concat(t[n]),state_name:"".concat(t[n]),itemRgb:[i,o,s].join()}})).filter((function(t){return!!t})):[];return a},p=new m["a"](g["b"]).withParams(Object(m["d"])(t,e,h,void 0,i,s,o,c)),f=new m["c"](d,p).initialize("intervals");return f.unwrap}var b=v,x=n("2877"),w=Object(x["a"])(b,h,p,!1,null,null,null),C=(w.exports,n("2d85")),P=function(){var t=this,e=this,n=e.$createElement,r=e._self._c||n;return r("lz-panel",{ref:"panel",attrs:{panelClass:e.panelClass},on:{updated:function(e){return t.panelId=e.panelId}}})},k=[],M=(n("3835"),n("bee2")),E=n("d4ec"),D=(n("6b93"),n("d8ef")),O=s["default"].component("lz-credset-panel",{components:{LzPanel:f["a"]},props:{phenotype:{type:String,required:!0},credibleSetId:{type:String,required:!0}},created:function(){var t=this;this.panelClass=new L(this.phenotype,this.credibleSetId,(function(e){return t.$emit("input",e)}),(function(e){return t.$emit("resolve",e)}),(function(e){return t.$emit("error",e)})),this.addPanels=this.$parent.addPanels,this.plot=this.$parent.plot},watch:{phenotype:function(t){this.panelId&&this.$parent.plot.removePanel(this.panelId),this.updatePanel()},credibleSetId:function(t){this.panelId&&this.$parent.plot.removePanel(this.panelId),this.updatePanel()}}}),L=Object(M["a"])((function t(e,n,r,a,i,s){Object(E["a"])(this,t),this.panel_layout_type="association",this.datasource_type="cred_vars",this.panel_id=D["a"].getUniqueId(this.panel_layout_type),this.datasource_namespace_symbol_for_panel="".concat(this.panel_id,"_src"),this.index="credible-variants",this.queryStringMaker=function(t,r,a){return"".concat(e,",").concat(n)},this.translator=function(t){return t.map((function(t){return{id:t.varId,position:t.position,pValue:t.pValue,posterior_prob:t.posteriorProbability,contrib_fraction:.5,is_member:!0,log_pvalue:(-1*Math.log10(t.pValue)).toPrecision(4),variant:t.varId,ref_allele:t.varId}}))},this.initialData=s,this.phenotype=e,this.locusZoomPanelOptions=Object(o["a"])(Object(o["a"])({},g["a"]),{},{y_index:2,title:{text:"".concat(n)},axes:{y1:{label:"Posterior Probability"}},data_layers:[{namespace:this.datasource_namespace_symbol_for_panel,id:this.panel_id,type:"scatter",id_field:"".concat(this.datasource_namespace_symbol_for_panel,":id"),fields:["".concat(this.datasource_namespace_symbol_for_panel,":id"),"".concat(this.datasource_namespace_symbol_for_panel,":position"),"".concat(this.datasource_namespace_symbol_for_panel,":posterior_prob"),"".concat(this.datasource_namespace_symbol_for_panel,":pValue")],x_axis:{field:"".concat(this.datasource_namespace_symbol_for_panel,":position")},y_axis:{axis:1,field:"".concat(this.datasource_namespace_symbol_for_panel,":posterior_prob"),floor:0,ceiling:1}}]}),this.bioIndexToLZReader=new g["b"]({index:this.index,queryStringMaker:this.queryStringMaker,translator:this.translator,onLoad:r,onResolve:a,onError:i,initialData:this.initalData}),this.layouts=[l["a"].Layouts.get("panel",this.panel_layout_type,this.locusZoomPanelOptions)],this.sources=[[this.datasource_namespace_symbol_for_panel,this.bioIndexToLZReader]]}));var j=O,S=Object(x["a"])(j,P,k,!1,null,null,null),A=(S.exports,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div")}),I=[],T=n("99de"),B=n("d967"),R=n("7e84"),F=n("262e"),G=(n("4ae1"),n("9a9a"),n("2ef0")),W=n("a8a4"),U=n("e60d"),q=n("da92"),N=n("98ab");function K(t,e,n){return e=Object(R["a"])(e),Object(T["a"])(t,Object(B["a"])()?Reflect.construct(e,n||[],Object(R["a"])(t).constructor):e.apply(t,n))}var V=s["default"].component("lz-computed-credset-panel",{props:{phenotype:{type:String,required:!0},credibleSetId:{type:String,required:!0},value:{required:!1},onLoad:Function,onResolve:Function,onError:Function},data:function(){return{panelId:null}},mounted:function(){this.updatePanel()},methods:{updatePanel:function(){var t=this;this.onLoad&&this.onLoad;this.panelId=this.addPanels(makeComputedCredibleVariantsPanel(this.phenotype,this.value))}},watch:{value:function(t,e){Object(G["isEqual"])(t,e)||Object(G["isEmpty"])(e)||(this.panelId&&this.$parent.plot.removePanel(this.panelId),this.updatePanel())},phenotype:function(t){this.id&&this.$parent.plot.removePanel(this.id
1),this.updatePanel()},credibleSetId:function(t){this.id&&this.$parent.plot.removePanel(this.id),this.updatePanel()}}}),z=Object(M["a"])((function t(e,n){Object(E["a"])(this,t),this.panel_layout_type="annotation_credible_set",this.datasource_type="credset",this.panel_id=D["a"].getUniqueId(this.panel_layout_type),this.datasource_namespace_symbol_for_panel="".concat(this.panel_id,"_src"),this.translator=function(t){return t.map((function(t){return{id:t.varId,chr:t.chromosome,start:t.position,end:t.position,position:t.position,pValue:t.pValue,posterior_prob:t.posteriorProbability,log_pvalue:(-1*Math.log10(t.pValue)).toPrecision(4),variant:t.varId,ref_allele:t.reference,state:"ssss"}}))},this.phenotype=e,this.initialData=n,this.locusZoomPanelOptions=Object(o["a"])(Object(o["a"])({},g["a"]),{},{title:{text:"SNPs in 95% credible set",style:{"font-size":"18px"},x:-.5},y_index:2,margin:{bottom:28},axes:{x:{label:"Chromosome {{chr}} (Mb)",label_offset:26,tick_format:"region",extent:"state"},y1:{label:"Posterior Probability",label_offset:28}},data_layers:[{namespace:this.datasource_namespace_symbol_for_panel,id:this.panel_id,type:"scatter",id_field:"".concat(this.datasource_namespace_symbol_for_panel,":id"),fields:["".concat(this.datasource_namespace_symbol_for_panel,":id"),"".concat(this.datasource_namespace_symbol_for_panel,":position"),"".concat(this.datasource_namespace_symbol_for_panel,":posterior_prob")],x_axis:{field:"".concat(this.datasource_namespace_symbol_for_panel,":position")},y_axis:{axis:1,field:"".concat(this.datasource_namespace_symbol_for_panel,":posterior_prob"),floor:0,ceiling:1}}]}),this.layouts=[l["a"].Layouts.get("panel",this.panel_layout_type,this.locusZoomPanelOptions)],this.bioIndexToLZReader=new $({phenotype:this.phenotype,translator:this.translator,initialData:this.initialData}),this.sources=[[this.datasource_namespace_symbol_for_panel,this.bioIndexToLZReader]]})),$=function(t){function e(t){return Object(E["a"])(this,e),K(this,e,[t])}return Object(F["a"])(e,t),Object(M["a"])(e,[{key:"parseInit",value:function(t){var e=t.phenotype,n=t.translator,r=t.initialData;this.translator=n,this.initialData=r,this.phenotype=e,this.params=Object.assign({threshold:.95,significance_threshold:7.301},t)}},{key:"fetchRequest",value:function(t,e,n){var r=this;return new Promise((function(e){if(r.initialData)e(r.translator(r.initialData)),r.initialData=null;else{var n=Object(N["e"])("Loading computed credset; please wait ..."),a="".concat(r.phenotype,",").concat(t.chr,":").concat(t.start,"-").concat(t.end);Object(U["f"])("associations",a).then((function(t){var n=r.translator(t),a=n.map((function(t){return t.log_pvalue}));if(!a.some((function(t){return t>=r.params.significance_threshold})))return e([]);var i=[];try{for(var s=q["scoring"].bayesFactors(a),l=q["scoring"].normalizeProbabilities(s),c=q["marking"].findCredibleSet(l,r.params.threshold),u=q["marking"].rescaleCredibleSet(c),d=q["marking"].markBoolean(c),h=0;h<n.length;h++)d[h]&&i.push(Object(o["a"])(Object(o["a"])({},n[h]),{},{posterior_prob:l[h],contrib_fraction:u[h],is_member:d[h]}))}catch(p){}e(i)})).finally((function(){return Object(N["a"])(n)}))}}))}}])}(W["BaseAdapter"]),H=V,Y=Object(x["a"])(H,A,I,!1,null,null,null),Z=(Y.exports,n("3473")),X=n("f643"),J=n("c0c5"),Q=n("7f5f"),tt=n.n(Q);function et(t,e,n){return e=Object(R["a"])(e),Object(T["a"])(t,Object(B["a"])()?Reflect.construct(e,n||[],Object(R["a"])(t).constructor):e.apply(t,n))}var nt=function(t){function e(t,n){var r;return Object(E["a"])(this,e),r=et(this,e,[t,n]),r._button_html=r.layout.button_html||"Toggle Log-Log Scale",r._button_title=r.layout.button_title||"Change log scale to log-log scale for p-values in associations plots",r}return Object(F["a"])(e,t),Object(M["a"])(e,[{key:"update",value:function(){if(this.button)return this;var t=this;return this.button=new J["_Button"](this).setColor(this.layout.color).setHtml(this._button_html).setTitle(this._button_title).setOnclick((function(){var e=function(t){return t.flatMap((function(t){return Object.entries(t).map((function(t){return t[1]}))}))},n=tt()("panels[*].data_layers[*]:forceKeys",{data:t.parent_plot,locals:{forceKeys:e}}).value;
1n.forEach((function(t){t.layout.y_axis.field&&(t.layout.y_axis.field.includes("log_pvalue")&&!t.layout.y_axis.field.includes("|log10")?(t.layout.y_axis.field=t.layout.y_axis.field.concat("|log10"),t.parent.layout.axes.y1.label="-log10(log10(p))",t.parent.layout.axes.y1.ticks=[1,10,100,1e3,1e4]):t.layout.y_axis.field.includes("log_pvalue")&&t.layout.y_axis.field.includes("|log10")&&(t.layout.y_axis.field=t.layout.y_axis.field.split("|log10")[0],t.parent.layout.axes.y1.label="-log10(p)",t.parent.layout.axes.y1.ticks=void 0))})),t.parent_plot.applyState()})),this.button.show(),this}}])}(J["BaseWidget"]),rt={type:"set_state",position:"right",color:"blue",button_html:"LD Population: ",show_selected:!0,button_title:"Select LD Population: ",state_field:"ld_pop",options:[{display_name:"ALL (default)",value:"ALL"},{display_name:"AFR",value:"AFR"},{display_name:"AMR",value:"AMR"},{display_name:"EAS",value:"EAS"},{display_name:"EUR",value:"EUR"},{display_name:"SAS",value:"SAS"}]},at={type:"download_png",color:"green",position:"right"},it=n("f73e");n("9d18");l["a"].use(c["a"]),l["a"].use(u["a"]),l["a"].use(d["a"]),l["a"].Widgets.add("toggleloglog",nt);var ot=s["default"].component("locuszoom",{props:["chr","start","end","scoring","refSeq","ldpop","filter","filterAssociations","filterAnnotations"],data:function(){return{locuszoommounted:!1,salt:Math.floor(1e4*Math.random()).toString(),plot:null}},mounted:function(){var t=this;this.dataSources=new l["a"].DataSources,Object.keys(lt).forEach((function(e){if(t[e])t.createSource(e,t[e]);else{var n=lt[e];n&&t.dataSources.add(e,n)}}));var e=[at];this.ldpop&&e.push(rt),this.plot=l["a"].populate("#lz_".concat(this.salt),this.dataSources,{responsive_resize:"width",max_region_scale:5e5,state:{chr:this.chr,start:this.start,end:this.end},toolbar:{widgets:e}}),this.locuszoommounted=!0;var n=this;this.plot.on("panel_removed",(function(t){n.$emit("panelremoved",t)})),this.plot.on("state_changed",(function(t){n.$emit("regionchanged",t)})),this.refSeq&&this.plot.addPanel(l["a"].Layouts.get("panel","genes",{height:200,min_height:200,y_index:3})),this.$emit("regionchanged",{data:{start:this.start,end:this.end}})},methods:{zoomOut:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e4,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e4;return this.plot.applyState({start:this.plot.state.start-t,end:this.plot.state.end+e}),[this.plot.state.start,this.plot.state.end]},addPanels:function(t){var e,n=t.layouts,r=t.sources,a={layouts:n,sources:r};if(this.dataSources._items.has(a.sources[0][0])||this.dataSources.add(a.sources[0][0],a.sources[0][1]),a.layouts){var s=a.layouts[0];e=this.plot.addPanel(s).addBasicLoader()}else{var c=Object(o["a"])({id:D["a"].getUniqueId(),namespace:Object(i["a"])({},a.datasource_type,a.datasource_namespace_symbol_for_panel)},a.locusZoomPanelOptions);e=this.plot.addPanel(l["a"].Layouts.get("panel",a.panel_layout_type,c)).addBasicLoader()}return this.filter&&this.applyFilter(this.filter),this.filterAssociations&&this.applyFilter(this.filterAssociations,"association"),this.filterAnnotations&&this.applyFilter(this.filterAnnotations,"intervals"),this.plot.applyState(),e.id},getDataLayers:function(){var t=function(t){return t.flatMap((function(t){return Object.entries(t).map((function(t){return t[1]}))}))},e=tt()("panels[*].data_layers[*]:forceKeys",{data:this.plot,locals:{forceKeys:t}}).value;return e},applyFilter:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.getDataLayers();""!==e&&(n=n.map((function(t){return t})).filter((function(t){return t.id.includes(e)}))),n.forEach((function(e){"annotation_catalog"!==e.id&&e.setFilter((function(e){var n=Object(it["a"])(e,{prefix:new RegExp(".+:")});return t(n)}))}))},addAssociationsPanel:function(t,e,n,r,a,i){var o=this.addPanels(new LZAssociationsPanel(t,e,r,a,i,n));return o},addCatalogAnnotationsPanel:function(t,e,n,r,a,i){var o=this.addPanels(Object(C["b"])(t,e,r,a,i,n));return o},addIntervalsPanel:function(t,e,n,r,a,i,o,s,l){var c=this.addPanels(y(t,e,n,r,a,o,s,l,i));return c},addCredibleVariantsPanel:function(t,e,n,r,a,i){var o=this.addPanels(new L(t,e,r,a,i,n));return o},addComputedCredibleVariantsPanel:function(t){var e=this.addPanels(new z(t));return e},addPhewasPanel:function(t,e,n,r,a,i,o){var s=this.addPanels(Object(Z["b"])(t,e,n,a,i,o,r));return s},addCoaccessibilityPanel:function(t,e,n,r,a){var i=this.addPanels(Object(X["b"])(t,e,n,r,a));return i}},computed:{region:function(){return{chr:this.chr,start:this.start,end:this.end}}},watch:{region:function(t){this.plot.applyState({chr:t.chr,start:t.start,end:t.end})},filter:function(t){this.applyFilter(t),this.plot.applyState()},filterAssociations:function(t){this.applyFilter(t,"association"),this.plot.applyState();this.getDataLayers()},filterAnnotations:function(t){this.applyFilter(t,"intervals"),this.plot.applyState()}}}),st="GRCh37",lt={catalog:["GwasCatalogLZ",{_enableCache:!1,url:"https://portaldev.sph.umich.edu/api/v1/annotation/gwascatalog/results/?decompose=1&variant_format=colons",params:{build:st}}],gene:["GeneLZ",{url:"https://portaldev.sph.umich.edu/api/v1/annotation/genes/",params:{build:st}}],ld:["LDLZ2",{url:"https://portaldev.sph.umich.edu/ld/",params:{source:"1000G",build:st,population:"ALL"}}],recomb:["RecombLZ",{url:"https://portaldev.sph.umich.edu/api/v1/annotation/recomb/results/",params:{build:st}}],constraint:["GeneConstraintLZ",{url:"https://gnomad.broadinstitute.org/api",params:{build:st}}]},ct=ot,ut=Object(x["a"])(ct,r,a,!1,null,null,null);e["a"]=ut.exports},"547b":function(t,e,n){"use strict";n("8e61")},5536:function(t,e,n){"use strict";n("a4d3"),n("e01a"),n("b0c0"),n("4ec9"),n("b64b"),n("d3b7"),n("ac1f"),n("6062"),n("5319"),n("5b81"),n("0643"),n("4e3e"),n("159b"),n("0eb6"),n("b7ef"),n("8bd4"),n("ad1f");function r(t){var e=structuredClone(t);return e.description=t.phenotype_name,e.name=t.phenotype,e.group=t.display_group.replaceAll(" ","_"),e}function a(t){var e={};return t.forEach((function(t){e[t.phenotype]=r(t)})),e}e["a"]={toOldStyle:r,mapPhenotypes:a}},5631:function(t,e,n){},5636:function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));n("b0c0");var r=n("2b0e"),a=n("5f5b"),i=n("b1e0"),o=(n("f9e3"),n("2dd8"),n("36ad")),s=n("c8cc"),l=n("4a13"),c=n("dfc6"),u=n("98ab");r["default"].use(a["a"]),r["default"].use(i["a"]),r["default"].config.productionTip=!1;var d={components:{PageHeader:o["a"],PageFooter:s["a"],Alert:u["b"],Documentation:l["a"],TooltipDocumentation:c["a"]},computed:{deployment:function(){return"production"},frontContents:function(){var t=this.$store.state.kp4cd.frontContents;return 0===t.length?{}:t[0]},diseaseGroup:function(){return this.$store.getters["bioPortal/diseaseGroup"]||{}}},watch:{diseaseGroup:function(t){this.$store.dispatch("kp4cd/getFrontContents",t.name)}},methods:{postAlert:u["c"],postAlertNotice:u["e"],postAlertError:u["d"],closeAlert:u["a"]}}},5744:function(t,e,n){},5778:function(t,e,n){},5780:function(t,e,n){},"57ae":function(t,e,n){},"57d2":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"rp-header-logo"},[n("p",[n("a",{attrs:{href:"https://cfdeknowledge.org/r/kc_landing"}},[n("img",{attrs:{src:t.kcLogo}})]),n("span",[t._v("|")]),n("img",{attrs:{src:t.cfdeLogo}})])])},a=[],i=n("2b0e"),o=n("5f5b");n("f9e3"),n("2dd8");i["default"].use(o["a"]);var s=i["default"].component("kc-cfde-logo",{name:"KcCfdeLogo",props:{kcLogo:{type:String,default:"https://hugeampkpncms.org/sites/default/files/users/user32/cfde_kc_logo_d_beta.svg"},cfdeLogo:{type:String,default:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/CFDE_logo.png"}}}),l=s,c=(n("1c86"),n("2877")),u=Object(c["a"])(l,r,a,!1,null,"6a841498",null);e["a"]=u.exports},"58c6":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"research-method-wrapper",domProps:{innerHTML:t._s(this.researchMethod[0]["body"])}})},a=[],i=n("2b0e"),o=i["default"].component("research-method-section",{props:["researchMethod"],mounted:function(){}}),s=o,l=n("2877"),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},"59c7":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"network-container",style:t.containerStyle},[t.error?n("div",{staticClass:"error-alert"},[t._v(" "+t._s(t.error)+" ")]):t._e(),t.isEmbed?t._e():[n("button",{staticClass:"btn btn-sm control-button physics-button",attrs:{disabled:t.stabilizing},on:{click:t.togglePhysics}},[n("b-icon",{attrs:{icon:t.physicsEnabled?"toggle-on":"toggle-off"}}),t._v(" Physics ")],1),n("button",{staticClass:"btn btn-sm control-button nav-button",on:{click:t.toggleNavigation}},[n("b-icon",{attrs:{icon:t.showNavigation?"eye":"eye-slash"}}),t._v(" Navigation ")],1),n("button",{staticClass:"btn btn-sm control-button fullscreen-button",on:{click:t.toggleFullscreen}},[n("b-icon",{attrs:{icon:t.isFullscreen?"fullscreen-exit":"fullscreen"}}),t._v(" Fullscreen ")],1)],n("div",{directives:[{name:"show",rawName:"v-show",value:!t.loading&&!t.stabilizing,expression:"!loading && !stabilizing"}],ref:"networkContainer",staticClass:"vis-network"}),t.loading?n("div",{staticClass:"loading"},[t._v("Loading data...")]):t._e(),t.stabilizing?n("div",{staticClass:"stabilization-progress"},[n("div",{staticClass:"progress-bar"},[n("div",{staticClass:"progress-fill",style:{width:t.stabilizationProgress+"%"}})]),n("div",{staticClass:"progress-text"},[t._v(" "+t._s(Math.round(t.stabilizationProgress))+"% ")])]):t._e()],2)},a=[],i=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("53ca")),o=n("5530"),s=n("1da1"),l=(n("99af"),n("4de4"),n("a630"),n("d81d"),n("fb6a"),n("b0c0"),n("4ec9"),n("b64b"),n("d3b7"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("3ca3"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),c=n("e60d"),u=n("eaa5"),d=n("9591");function h(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 6,737 bytes, line 1
1function E(t,e){function n(a,o,s,l){var c=p(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var p=l["default"].component("NetworkGraph",{props:{phenotype:{type:[Object,String],required:!0,default:function(){return{}}},genesetSize:{type:String,required:!0,default:"small"},isEmbed:{type:Boolean,default:!1}},data:function(){return{network:null,loading:!1,stabilizing:!1,stabilizationProgress:0,nodes:new d["DataSet"]({queue:!0}),edges:new d["DataSet"]({queue:!0}),physicsEnabled:!this.isEmbed||!1,error:null,showNavigation:!1,isFullscreen:!1}},computed:{phenotypeName:function(){return"string"===typeof this.phenotype?this.phenotype:this.phenotype.name||""},containerStyle:function(){return{height:this.isEmbed?"400px":"80vh",width:"100%",position:this.isFullscreen?"fixed":"relative",top:this.isFullscreen?"0":"auto",left:this.isFullscreen?"0":"auto",zIndex:this.isFullscreen?"9999":"1",background:"#fff"}}},watch:{phenotype:{handler:function(t,e){t!==e&&this.refreshGraph()},deep:!0},genesetSize:{handler:function(){this.refreshGraph()}}},mounted:function(){var t=this;return Object(s["a"])(h().mark((function e(){return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$nextTick();case 2:return e.next=4,t.fetchGraphData();case 4:document.addEventListener("fullscreenchange",(function(){t.isFullscreen=!!document.fullscreenElement,t.network&&t.network.fit()}
1));case 5:case"end":return e.stop()}}),e)})))()},beforeDestroy:function(){this.network&&this.network.destroy(),document.removeEventListener("fullscreenchange",(function(){}))},methods:{fetchGraphData:function(){var t=this;return Object(s["a"])(h().mark((function e(){var n,r,a,i,o;return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loading=!0,t.error=null,e.prev=2,e.next=5,fetch("".concat(c["a"],"/api/bio/query/pigean-graph?q=").concat(t.phenotypeName,",").concat(c["b"],",").concat(t.genesetSize));case 5:return r=e.sent,e.next=8,r.json();case 8:if(a=e.sent,null!==(n=a.data)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&null!==(n=n.nodes)&&void 0!==n&&n.length){e.next=14;break}return t.error="No data available",t.nodes.clear(),t.edges.clear(),e.abrupt("return");case 14:return t.nodes.clear(),t.edges.clear(),i=new Set,o=a.data[0].nodes.filter((function(t){return!i.has(t.id)&&(i.add(t.id),!0)})),t.nodes.add(o),t.nodes.flush(),t.edges.add(a.data[0].edges),t.edges.flush(),e.next=24,t.$nextTick();case 24:return e.next=26,t.initNetwork();case 26:t.network&&t.network.fit({animation:!1}),e.next=32;break;case 29:e.prev=29,e.t0=e["catch"](2),t.error=e.t0.message;case 32:return e.prev=32,t.loading=!1,e.finish(32);case 35:case"end":return e.stop()}}),e,null,[[2,29,32,35]])})))()},loadNetworkData:function(){var t=this;return Object(s["a"])(h().mark((function e(){var n,r,a;return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.loading=!0,n=1e3,r=h().mark((function e(){var r;return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.data.slice(a,a+n),e.next=3,new Promise((function(e){requestAnimationFrame((function(){t.nodes.add(r),e()}))}));case 3:case"end":return e.stop()}}),e)})),a=0;case 4:if(!(a<t.data.length)){e.next=9;break}return e.delegateYield(r(),"t0",6);case 6:a+=n,e.next=4;break;case 9:t.loading=!1;case 10:case"end":return e.stop()}}),e)})))()},preprocessData:function(t){var e=this;return t.map((function(t){return Object(o["a"])({id:t.id,label:t.label},e.getVisualProperties(t))}))},getNetworkOptions:function(){return{physics:{enabled:!0,stabilization:{enabled:!0,iterations:10,updateInterval:50,fit:!0},timestep:.5,adaptiveTimestep:!0,barnesHut:{gravitationalConstant:-1e4,centralGravity:.5,springLength:100,springConstant:.05,damping:.5,avoidOverlap:0},minVelocity:.1,maxVelocity:50,solver:"barnesHut"},interaction:{dragNodes:!this.isEmbed,navigationButtons:this.showNavigation,keyboard:!this.isEmbed,dragView:!this.isEmbed,zoomView:!this.isEmbed}}},processGraphData:function(t){var e=Array.from(new Map(t.data[0].nodes.map((function(t){return[String(t.id),Object(o["a"])(Object(o["a"])({},t),{},{id:String(t.id)})]}))).values()),n=t.data[0].edges.map((function(t){return Object(o["a"])(Object(o["a"])({},t),{},{from:String(t.from),to:String(t.to)})}));return{uniqueNodes:e,validEdges:n}},resetNetworkState:function(){var t=this;return Object(s["a"])(h().mark((function e(){return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.network&&(t.network.destroy(),t.network=null),t.nodes=new d["DataSet"]({queue:!0}),t.edges=new d["DataSet"]({queue:!0});case 3:case"end":return e.stop()}}),e)})))()},refreshGraph:function(){var t=this;return Object(s["a"])(h().mark((function e(){var n,r,a,i,o,s;return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t.error=null,t.loading=!0,t.stabilizing=!0,t.stabilizationProgress=0,e.next=7,t.resetNetworkState();case 7:return e.next=9,fetch("".concat(c["a"],"/api/bio/query/pigean-graph?q=").concat(t.phenotypeName,",").concat(c["b"],",").concat(t.genesetSize));case 9:return r=e.sent,e.next=12,r.json();case 12:if(a=e.sent,null!==(n=a.data)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&null!==(n=n.nodes)&&void 0!==n&&n.length){e.next=16;break}return t.error="No data available",e.abrupt("return");case 16:return i=t.processGraphData(a),o=i.uniqueNodes,s=i.validEdges,e.next=19,t.nodes.add(o);case 19:return e.next=21,t.nodes.flush();case 21:return e.next=23,t.edges.add(s);case 23:return e.next=25,t.edges.flush();case 25:return e.next=27,t.$nextTick();case 27:return e.next=29,t.initNetwork();case 29:e.next=34;break;case 31:e.prev=31,e.t0=e["catch"](0),t.error=e.t0.message;case 34:return e.prev=34,t.loading=!1,e.finish(34);case 37:case"end":return e.stop()}}),e,null,[[0,31,34,37]])})))()},initNetwork:function(){var t=this;return Object(s["a"])(h().mark((function e(){var n,r,a;return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=t.$refs.networkContainer,n){e.next=3;break}return e.abrupt("return");case 3:r={nodes:t.nodes,edges:t.edges},a=t.getNetworkOptions(),t.network=new u["Network"](n,r,a),t.network.on("stabilizationStart",(function(){t.stabilizing=!0,t.stabilizationProgress=0})),t.network.on("stabilizationProgress",(function(e){t.stabilizationProgress=Math.round(e.iterations/e.total*100)})),t.network.on("stabilizationIterationsDone",(function(){t.stabilizing=!1,t.stabilizationProgress=100,setTimeout((function(){t.network.fit({animation:{duration:1e3,easingFunction:"easeInOutQuad"},padding:50})}),100)})),t.setupNetworkEvents();case 10:case"end":return e.stop()}}),e)})))()},setupNetworkEvents:function(){var t=this;this.network.on("stabilizationProgress",(function(e){t.stabilizationProgress=e.iterations/e.total*100})),this.network.on("stabilizationIterationsDone",(function(){t.stabilizing=!1,t.stabilizationProgress=100,t.network.fit(),t.isEmbed&&t.network.setOptions({physics:{enabled:!1}})}))},togglePhysics:function(){var t=this;this.physicsEnabled=!this.physicsEnabled,this.network.setOptions({physics:{enabled:this.physicsEnabled,stabilization:{enabled:!1}}});var e=this.network.getPositions();Object.keys(e).forEach((function(e){t.nodes.update({id:e,fixed:!t.physicsEnabled})}
1))},toggleNavigation:function(){var t;this.showNavigation=!this.showNavigation,null===(t=this.network)||void 0===t||t.setOptions({interaction:{navigationButtons:this.showNavigation}})},toggleFullscreen:function(){var t=this;return Object(s["a"])(h().mark((function e(){return h().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,t.isFullscreen){e.next=6;break}return e.next=4,t.$refs.networkContainer.requestFullscreen();case 4:e.next=8;break;case 6:return e.next=8,document.exitFullscreen();case 8:e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](0);case 12:case"end":return e.stop()}}),e,null,[[0,10]])})))()}}}),f=p,_=(n("7089"),n("2877")),g=Object(_["a"])(f,r,a,!1,null,"537e7024",null);e["a"]=g.exports},"5a0c":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.isSubtable?"pigean-subtable":"",attrs:{id:"pigean-gene"}},[t.tableData.length>0?n("div",[t.isSubtable?t._e():n("div",{staticClass:"text-right mb-2"},[n("data-download",{attrs:{data:t.probData,filename:"pigean_gene"}})],1),n("div",{staticClass:"table-total-rows",domProps:{innerHTML:t._s("Total rows: "+t.rows)}}),n("b-table",{attrs:{hover:t.isSubtable,small:"",responsive:"",items:t.tableData,fields:t.probFields,"per-page":t.perPage,"current-page":t.currentPage,"sort-by":t.sortBy,"sort-desc":!0,"sort-null-last":!0},scopedSlots:t._u([{key:"cell(label)",fn:function(e){return[e.item.label?n("span",[t._v(" "+t._s(e.item.label.length>50?e.item.label.slice(0,50)+"...":e.item.label)+" ")]):t._e()]}},{key:"cell(gene)",fn:function(e){return[n("a",{attrs:{href:"/pigean/gene.html?gene="+e.item.gene+t.suffix}},[t._v(" "+t._s(e.item.gene)+" ")])]}},{key:"cell(phenotypeDesc)",fn:function(e){return[t.phenotypeMap[e.item.phenotype]?n("a",{attrs:{href:"/pigean/phenotype.html?phenotype="+e.item.phenotype+t.suffix}},[t._v(" "+t._s(e.item.phenotypeDesc)+" ")]):n("span",[t._v(t._s(e.item.phenotype))])]}},{key:"cell(gene_set)",fn:function(e){return[n("a",{attrs:{href:"/pigean/geneset.html?geneset="+e.item.gene_set+t.suffix}},[t._v(" "+t._s(e.item.gene_set)+" ")])]}},{key:"cell(top_gene_sets)",fn:function(e){return[n("div",{staticClass:"wrapped-cell-content"},[e.item.top_gene_sets?n("span",[t._v(" "+t._s(e.item.top_gene_sets)+" ")]):n("span",[t._v("-")])])]}},{key:"cell(top_genes)",fn:function(e){return[n("div",{staticClass:"wrapped-cell-content"},[e.item.top_genes?n("span",[t._v(" "+t._s(e.item.top_genes)+" ")]):n("span",[t._v("-")])])]}},{key:"cell(phewasPlot)",fn:function(e){return[n("b-button",{attrs:{variant:"outline-primary",size:"sm"},on:{click:function(n){return t.phewasPlotShow(e)}}},[t._v(" "+t._s(e.item.phewasActive?"Hide":"Show")+" ")])]}},{key:"cell(expand)",fn:function(e){return[n("b-button",{attrs:{variant:"outline-primary",size:"sm"},on:{click:function(n){return t.showDetails(e,1)}}},[t._v(" "+t._s(e.detailsShowing&&3!==e.item.subtableActive?"Hide":"Show")+" ")])]}},{key:"cell(expand1)",fn:function(e){return[n("b-dropdown",{attrs:{split:"",right:"",text:e.detailsShowing&&1===e.item.subtableActive?"Hide":"Show",variant:"outline-primary",size:"sm"},on:{click:function(n){return t.showDetails(e,1)}}},[n("b-dropdown-header",{attrs:{id:"dropdown-header-label"}},[t._v(" Top 5 Genes ")]),t._l(e.item.top_genes.split(";"),(function(e){return n("b-dropdown-item",{key:e,attrs:{href:"/pigean/gene.html?gene="+e+t.suffix}},[t._v(" "+t._s(e)+" ")])}))],2)]}},{key:"cell(expand2)",fn:function(e){return[n("b-dropdown",{attrs:{split:"",right:"",text:e.detailsShowing&&2===e.item.subtableActive?"Hide":"Show",variant:"outline-primary",size:"sm"},on:{click:function(n){return t.showDetails(e,2)}}},[n("b-dropdown-header",{attrs:{id:"dropdown-header-label"}},[t._v(" Top 5 Gene Sets ")]),t._l(e.item.top_gene_sets.split(";"),(function(e){return n("b-dropdown-item",{key:e,attrs:{href:"/pigean/geneset.html?geneset="+e+t.suffix}},[t._v(" "+t._s(e.length>40?e.slice(0,40)+"...":e)+" ")])}))],2)]}},{key:"cell(expand3)",fn:function(e){return[n("b-button",{attrs:{variant:"outline-primary",size:"sm",disabled:t.hideLocusButton(e.item.phenotype)}
1,on:{click:function(n){return t.showDetails(e,3)}}},[t._v(" "+t._s(e.detailsShowing&&3===e.item.subtableActive?"Hide":"Show")+" ")])]}},{key:"row-details",fn:function(e){return[e.item.phewasActive&&t.phewasData[t.phewasKey(e.item)]&&t.phewasData[t.phewasKey(e.item)].length>0?n("research-phewas-plot",{staticStyle:{width:"100%"},attrs:{"canvas-id":"pigean_"+e.item.phenotype+"_"+t.generateId(e.item.label),"plot-name":"PIGEAN_"+e.item.phenotype,"phenotypes-data":t.phewasData[t.phewasKey(e.item)],"phenotype-map":t.phenotypeMap||t.$store.state.bioPortal.phenotypeMap,linkPhenotypes:!0,isPigean:!0,colors:t.plotColors,"render-config":t.phewasRenderConfig,utils:t.utilsBox,"native-dl-btn":!1,top1500:!0}}):t._e(),2===e.item.subtableActive&&t.subtable2Data[t.subtableKey(e.item)]&&t.subtable2Data[t.subtableKey(e.item)].length>0?n("pigean-table",{attrs:{pigeanData:t.subtable2Data[t.subtableKey(e.item)],config:{fields:t.config.subtable2Fields},isSubtable:!0}}):t._e(),1===e.item.subtableActive&&t.subtableData[t.subtableKey(e.item)]&&t.subtableData[t.subtableKey(e.item)].length>0?n("pigean-table",{attrs:{pigeanData:t.subtableData[t.subtableKey(e.item)],config:{fields:t.config.subtableFields},isSubtable:!0}}):t._e(),3===e.item.subtableActive?n("div",[n("pigean-locus-zoom",{attrs:{phenotype:e.item.phenotype,gene:e.item.gene}})],1):t._e()]}}],null,!1,1424908835)}),n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.tableData.length,"per-page":t.perPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1):n("div",[n("b-alert",{staticClass:"text-center",attrs:{show:"",variant:"warning"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" No data available for this query. ")],1)],1)])},a=[],i=n("53ca"),o=n("1da1"),s=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("b0c0"),n("4ec9"),n("b64b"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("2532"),n("5319"),n("5b81"),n("498a"),n("3ca3"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("0eb6"),n("b7ef"),n("8bd4"),n("ad1f"),n("2b0e")),l=n("e60d"),c=n("529c"),u=n("f529"),d=n("fd66"),h=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.region?n("div",[n("research-region-plot",{attrs:{plotData:t.assocData,renderConfig:t.plotConfig,searchParameters:t.searchParameters,dataComparisonConfig:t.dataComparisonConfig,region:t.region,plotMargin:t.plotMargin,compareGroupColors:t.colors,regionZoom:0,regionViewArea:0,pkgData:[],pkgDataSelected:[],utils:t.utilsBox,sectionId:t.sectionId+"_region"}}),n("research-genes-track",{attrs:{region:t.region,plotConfig:t.plotConfig,plotType:"region plot",plotMargin:t.plotMargin,regionZoom:0,regionViewArea:0,utils:t.utilsBox,sectionId:t.sectionId+"_genes"}})],1):n("div",{staticClass:"loading"},[n("b-spinner",{attrs:{label:"Loading..."}})],1)])},p=[],f=(n("6b93"),n("a282")),_=n("1812"),g=n("a708"),m=n("1f3b"),v=n("ae39"),y=n("6d49"),b=n("3feb"),x=n("62d0"),w=n("8534"),C=n("1396");function P(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */P=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};u(x,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==n&&r.call(C,s)&&(x=C);var k=b.prototype=v.prototype=Object.create(x);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 5,824 bytes, line 1
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return y.prototype=b,a(k,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var k=s["default"].component("pigean-locus-zoom",{components:{ResearchRegionPlot:w["a"],ResearchGenesTrack:C["a"]},props:["phenotype","gene"],data:function(){return{plotConfig:{"x axis field":"position","y axis field":"minusLog10P","render by":"varId","y axis label":"-log10 (p)","x axis label":"Chromosome","hover content":["pValue","beta"],height:120,"star key":"varId","ld server"
1:{pos:"position",ref:"reference",alt:"alt","ref variant field":"varId","populations field":"minusLog10P","populations type":"fixed","fixed population":"ALL",populations:{ALL:"ALL"}}},sectionId:"",assocData:[],genesTrackData:[],region:"",searchParameters:{},dataComparisonConfig:{"key field":"Variant ID","fields group data key":["phenotype"],"fields to compare":["minusLog10P","beta","stdErr","zScore"]},plotMargin:{leftMargin:150,rightMargin:40,topMargin:20,bottomMargin:100,bump:11},colors:["#007bff50","#04884550","#8490C850","#BF61A550","#EE312450","#FCD70050","#5555FF50","#7aaa1c50","#9F78AC50","#F8808450","#F5A4C750","#CEE6C150","#cccc0050","#6FC7B650","#D5A76850","#d4d4d450"]}},mounted:function(){var t=this;return Object(o["a"])(P().mark((function e(){return P().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.sectionId=Math.floor(1e10*Math.random()),e.next=3,t.getGeneRegion();case 3:return t.region=e.sent,e.next=6,t.processAssocData();case 6:t.assocData=e.sent,t.setSearchParams();case 8:case"end":return e.stop()}}),e)})))()},computed:{utilsBox:function(){var t={Formatters:c["a"],uiUtils:f["a"],alertUtils:m["a"],keyParams:d["a"],dataConvert:v["a"],sortUtils:g["a"],plotUtils:_["a"],filterUtils:y["a"],regionUtils:b["a"],userUtils:x["a"]};return t}},methods:{getAssocData:function(){var t=arguments,e=this;return Object(o["a"])(P().mark((function n(){var r,a,i,o,s,c,u,d;return P().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=t.length>0&&void 0!==t[0]?t[0]:null,a="".concat(e.phenotype,",").concat(e.region),i="".concat(l["a"],"/api/bio/query/associations?q=").concat(a),null!==r){n.next=16;break}return n.next=6,fetch(i).then((function(t){return t.json()}));case 6:if(o=n.sent,null===o.continuation){n.next=13;break}return n.next=10,e.getAssocData(o);case 10:return n.abrupt("return",n.sent);case 13:return n.abrupt("return",o.data);case 14:n.next=31;break;case 16:return s="".concat(l["a"],"/api/bio/cont?token=").concat(r.continuation),n.next=19,fetch(s).then((function(t){return t.json()}));case 19:if(c=n.sent,null!=c.error){n.next=31;break}if(u=r.data,d=u.concat(c.data),c.data=d,null!=c.continuation){n.next=28;break}return n.abrupt("return",c.data);case 28:return n.next=30,e.getAssocData(c);case 30:return n.abrupt("return",n.sent);case 31:case"end":return n.stop()}}),n)})))()},processAssocData:function(){var t=this;return Object(o["a"])(P().mark((function e(){var n,r,a,i,o,s,l,c;return P().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getAssocData();case 2:for(n=e.sent,r={},a=t.dataComparisonConfig["fields to compare"],i=0;i<n.length;i++)for(o=n[i],o.varId=t.fixVarId(o.varId),o.minusLog10P=-Math.log10(o.pValue),r[o.varId]=o,s=0;s<a.length;s++)l=a[s],c={},c[t.phenotype]=o[l],r[o.varId][l]=c;return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})))()},getGeneRegion:function(){var t=this;return Object(o["a"])(P().mark((function e(){var n,r;return P().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,b["a"].parseRegion(t.gene,!0,25e4);case 2:return n=e.sent,r="".concat(n.chr,":").concat(n.start,"-").concat(n.end),e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))()},fixVarId:function(t){var e=t.split(":");return 4!==e.length?t:"".concat(e[0],":").concat(e[1],"_").concat(e[2],"/").concat(e[3])},setSearchParams:function(){this.searchParameters={phenotype:{type:"list",field:"phenotype",search:[this.phenotype]},gene:{type:"input",field:"gene",search:[this.gene]}}}}}),M=k,E=(n("fd6a"),n("2877")),D=Object(E["a"])(M,h,p,!1,null,"f73d2d66",null),O=D.exports;n("1203");function L(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */L=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};u(x,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==n&&r.call(C,s)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 8,002 bytes, line 1
1function M(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),u(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),u(P,c,"Generator"),u(P,s,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var j=s["default"].component("pigean-table",{components:{DataDownload:u["a"],PigeanTable:I,PigeanLocusZoom:O},props:["pigeanData","phenotypeMap","config","isSubtable","filter","phewasRenderConfig"],data:function(){return{perPage:10,currentPage:1,subtableData:{},subtable2Data:{},phewasData:{},plotColors:_["a"].plotColors()}},computed:{utilsBox:function(){var t={Formatters:c["a"],uiUtils:f["a"],alertUtils:m["a"],keyParams:d["a"],dataConvert:v["a"],sortUtils:g["a"],plotUtils:_["a"]};return t},probFields:function(){return this.collateFields()},probData:function(){return this.computeProbabilities()},rows:function(){return this.pigeanData.length||0},sortBy:function(){return 0===this.pigeanData.length?0:this.config.fields.map((function(t){return t.key})).includes("factor_value")?"factor_value":this.config.sortBy?this.config.sortBy:void 0!==this.pigeanData[0]["combined"]?"combined":"beta_uncorrected"},tableData:function(){var t=this.probData;return t.forEach((function(t){t.subtableActive=0,t.phewasActive=!1})),this.filter&&(t=t.filter(this.filter)),t},genesetSize:function(){return d["a"].genesetSize},traitGroup:function(){return d["a"].traitGroup},suffix:function(){return"&genesetSize=".concat(this.genesetSize,"&traitGroup=").concat(this.traitGroup)}},methods:{phenotypeFormatter:c["a"].phenotypeFormatter,pValueFormatter:c["a"].pValueFormatter,effectFormatter:c["a"].effectFormatter,intFormatter:c["a"].intFormatter,annotationFormatter:c["a"].annotationFormatter,tissueFormatter:c["a"].tissueFormatter,tpmFormatter:c["a"].tpmFormatter,phewasPlotShow:function(t){this.getPhewas(t),this.toggleTable(t,"phewas")},getSubtable:function(t,e){var n=this;return Object(o["a"])(L().mark((function r(){var a,i,o;return L().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=n.subtableKey(t.item),n.subtableData[a]||1!==e){r.next=6;break}return r.next=4,Object(l["f"])(n.config.subtableEndpoint,a);case 4:i=r.sent,s["default"].set(n.subtableData,a,i);case 6:if(!n.config.subtable2Endpoint||n.subtable2Data[a]||2!==e){r.next=11;break}return r.next=9,Object(l["f"])(n.config.subtable2Endpoint,a);case 9:o=r.sent,s["default"].set(n.subtable2Data,a,o);case 11:case"end":return r.stop()}}),r)})))()},getPhewas:function(t){var e=this;return Object(o["a"])(L().mark((function n(){var r,a;return L().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.phewasKey(t.item),e.phewasData[r]){n.next=6;break}return n.next=4,Object(l["f"])("pigean-phewas",r);case 4:a=n.sent,s["default"].set(e.phewasData,r,a);case 6:case"end":return n.stop()}}),n)})))()}
1,showDetails:function(t,e){this.toggleTable(t,e),this.getSubtable(t,e)},toggleTable:function(t,e){var n=!1;n="phewas"===e?!t.item.phewasActive:e!==t.item.subtableActive,"phewas"===e?t.item.phewasActive=!t.item.phewasActive:t.item.subtableActive=n?e:0,n||!t.detailsShowing||t.item.phewasActive||0!==t.item.subtableActive||t.toggleDetails(),!n||t.detailsShowing||!t.item.phewasActive&&0===t.item.subtableActive||t.toggleDetails()},phewasKey:function(t){return"".concat(t.phenotype,",").concat(l["b"],",").concat(this.genesetSize,",").concat(t.factor)},subtableKey:function(t){return"cluster"===this.config.queryParam?"".concat(t.phenotype,",").concat(l["b"],",").concat(this.genesetSize,",").concat(t.factor):"".concat(t.phenotype,",").concat(t[this.config.queryParam],",").concat(l["b"],",").concat(this.genesetSize)},generateId:function(t){return t.replaceAll(",","").replaceAll(" ","_")},probability:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.05,n=Math.exp(Math.log(e)+t);return n/(1+n)},computeProbabilities:function(){for(var t=this.isSubtable?this.pigeanData:this.describePhenotypes(this.pigeanData),e=0;e<this.config.fields.length;e++){var n=this.config.fields[e];if(n.showProbability)for(var r=n.key,a=0;a<t.length;a++)t[a][r]&&(t[a]["".concat(r,"_probability")]=this.tpmFormatter(this.probability(t[a][r])))}return t},collateFields:function(){var t=[];return this.config.fields.forEach((function(e){e.showProbability&&t.push({key:"".concat(e.key,"_probability"),sortable:!0}),t.push(e)})),t},describePhenotypes:function(t){for(var e=structuredClone(t),n=0;n<e.length;n++)if(e[n].phenotype){var r=this.phenotypeMap[e[n].phenotype];void 0===r&&(r={phenotype_name:e[n].phenotype});var a=r.phenotype_name.trim();e[n]["phenotypeDesc"]=a}return e},hideLocusButton:function(t){return this.phenotypeMap?void 0===this.phenotypeMap[t]||"portal"!==this.phenotypeMap[t].trait_group:"portal"!==this.traitGroup}}}),S=j,A=(n("0619"),Object(E["a"])(S,r,a,!1,null,"cce4297a",null)),I=e["a"]=A.exports},"5d63":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},a=[],i=n("34aa"),o=i["a"],s=n("2877"),l=Object(s["a"])(o,r,a,!1,null,null,null);e["a"]=l.exports},"5db6":function(t,e,n){"use strict";var r=n("1da1"),a=n("53ca"),i=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("ac1f"),n("5319"),n("5b81"),n("2b0e")),o=n("2b27"),s=n.n(o);n("fd66");function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(a["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(a["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}i["default"].use(s.a),e["a"]={namespaced:!0,state:function(){return{researchMode:[],researchPage:[],researchMethod:[],researchMenu:[],researchData:[],genesInRegion:[],genesData:null,researchDataEmpty:null,wildCard:null}},mutations:{setResearchMode:function(t,e){t.researchMode=e},setResearchPage:function(t,e){t.researchPage=e},setResearchMethod:function(t,e){t.researchMethod=e},setResearchMenu:function(t,e){t.researchMenu=e},setResearchData:function(t,e){t.researchData=e;var n="object"==Object(a["a"])(e)?e:"{"==e.charAt(0)?JSON.parse(e):e;"object"==Object(a["a"])(n)&&n.data&&(n.data.length>0?t.researchDataEmpty=!1:0==n.data.length&&(t.researchDataEmpty=!0))},setGenesInRegion:function(t,e){t.genesInRegion=e},setGenesData:function(t,e){t.genesData=e},setWildCard:function(t,e){t.wildCard=e}},actions:{getResearchMode:function(t,e){return Object(r["a"])(l().mark((function n(){var r,a;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,fetch("https://hugeampkpncms.org/view/rest/get_research_page_access?pageid="+e.pageID).then((function(t){return t.json()}));case 2:r=n.sent,r[0].field_page_mode&&"dev"===r[0].field_page_mode&&(a=i["default"].$cookies.get("KPN_".concat(e.pageID)),a&&t.dispatch("getResearchDevPage",{pageID:e.pageID,devID:a.u,devPW:a.p})),t.commit("setResearchMode",r);case 5:case"end":return n.stop()}}),n)})))()},getResearchMethod:function(t,e){return Object(r["a"])(l().mark((function n(){var r;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,fetch("https://hugeampkpncms.org/view/rest/get_research_method?method="+e.methodID).then((function(t){return t.json()}));case 2:r=n.sent,t.commit("setResearchMethod",r);case 4:case"end":return n.stop()}}),n)})))()},getResearchMenu:function(t,e){return Object(r["a"])(l().mark((function n(){var r;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,fetch("https://hugeampkpncms.org/view/rest/get_research_menu?menu="+e.menuID).then((function(t){return t.json()}));case 2:r=n.sent,t.commit("setResearchMenu",r);case 4:case"end":return n.stop()}}),n)})))()},getResearchDevPage:function(t,e){return Object(r["a"])(l().mark((function n(){var r,a;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(""==e.devID||""==e.devPW){n.next=6;break}return n.next=3,fetch("https://hugeampkpncms.org/view/rest/get_research_page_dev?pageid="+e.pageID+"&&devid="+e.devID+"&&devpw="+e.devPW).then((function(t){return t.json()}));case 3:r=n.sent,r.length>0&&e.devCK&&(a={u:e.devID,p:e.devPW},i["default"].$cookies.set("KPN_".concat(e.pageID),a,"14d")),t.commit("setResearchPage",r);case 6:case"end":return n.stop()}}),n)})))()},getResearchPage:function(t,e){return Object(r["a"])(l().mark((function n(){var r,a;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,fetch("https://hugeampkpncms.org/view/rest/get_research_page?pageid="+e.pageID).then((function(t){return t.json()}));case 2:r=n.sent,t.commit("setResearchPage",r),r&&r[0]["field_api_parameters"]&&(a=JSON.parse(r[0]["field_api_parameters"]),a["wild card"]&&t.commit("setWildCard",a["wild card"]));case 5:case"end":return n.stop()}}),n)})))()},cancelResearchData:function(t){t.commit("setResearchData",[])},getResearchData:function(t,e){return Object(r["a"])(l().mark((function n(){var r,a;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="hugeampkpn"==e.domain?"https://hugeampkpncms.org/servedata/dataset?dataset="+e.dataPoint:e.dataPoint,e.wildCard&&(r=r.replaceAll(e.wildCard+",",""),r=r.replaceAll(","+e.wildCard,"")),n.next=4,fetch(r).then((function(t){return t.text(r)}));case 4:a=n.sent,t.commit("setResearchData",a);case 6:case"end":return n.stop()}}),n)})))()},getGenesInRegion:function(t,e){return Object(r["a"])(l().mark((function n(){var r,a;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="https://bioindex.hugeamp.org/api/bio/query/genes?q="+e.region,n.next=3,fetch(r).then((function(t){return t.text(r)}));case 3:a=n.sent,t.commit("setGenesInRegion",a);case 5:case"end":return n.stop()}}),n)})))()},getGenesData:function(t,e){return Object(r["a"])(l().mark((function n(){var r,a;return l().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="https://portaldev.sph.umich.edu/api/v1/annotation/genes/?filter=source in 3 and gene_name in "+e.genes,n.next=3,fetch(r).then((function(t){return t.text(r)}));case 3:a=n.sent,t.commit("setGenesData",a);case 5:case"end":return n.stop()}}),n)})))()},directInputData:function(t,e){t.commit("setResearchData",e)}}}},"5f97":function(t,e,n){},"60ef":function(t,e,n){"use strict";n("5631")}
1,6119:function(t,e,n){},"61cc":function(t,e,n){},"62d0":function(t,e,n){"use strict";n("c740"),n("14d9"),n("a434"),n("b0c0"),n("e9c4"),n("b64b");function r(t){localStorage.setItem("_phenotypes",JSON.stringify(t))}function a(){return JSON.parse(localStorage.getItem("_phenotypes"))}function i(){localStorage.removeItem("_phenotypes")}function o(t){if(t&&t.name&&t.id){var e=a();null===e&&(e=[]);var n=e.findIndex((function(e){return e.id===t.id}));-1===n&&(e.push(t),r(e))}}function s(t){if(t){var e=a();null===e&&(e=[]);var n=e.findIndex((function(e){return e.id===t.id}));n>-1&&(e.splice(n,1),r(e))}}function l(t,e){localStorage.setItem(t,JSON.stringify(e))}function c(t){return JSON.parse(localStorage.getItem(t))}function u(t){localStorage.removeItem(t)}e["a"]={savePhenotypes:r,getPhenotypes:a,clearPhenotypes:i,addPhenotype:o,removePhenotype:s,saveContext:l,getContext:c,clearContext:u}},"63a0":function(t,e,n){},6645:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[null!=t.searchingRegion?n("div",{staticClass:"col-md-12 biosamples-plot-wrapper"},[n("div",{staticClass:"col-md-12"},[t.renderConfig["with annotations viewer"]&&"false"!=t.renderConfig["with annotations viewer"]?t._e():n("div",{attrs:{id:"biosamplesUIWrapper"}},[n("div",{staticClass:"filtering-ui-wrapper add-content",staticStyle:{width:"100%",padding:"0 10px","text-align":"left"}},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col",staticStyle:{padding:"2px"}},[n("div",{staticClass:"label",staticStyle:{display:"inline-block","margin-right":"10px"}},[t._v(" Select Annotation ")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.annotationOnFocus,expression:"annotationOnFocus"}],staticClass:"custom-select",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.annotationOnFocus=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"null"}},[t._v(" "+t._s("Select annotation")+" ")]),t._l(t.annoData,(function(e,r){return n("option",{key:r,domProps:{value:r,innerHTML:t._s(r)}})}))],2),"null"!=t.annotationOnFocus?n("div",{staticClass:"label",staticStyle:{display:"inline-block",margin:"0 10px"}},[t._v(" Select Tissue Category ")]):t._e(),"null"!=t.annotationOnFocus?n("select",{directives:[{name:"model",rawName:"v-model",value:t.tissueOnFocus,expression:"tissueOnFocus"}],staticClass:"custom-select",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.tissueOnFocus=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"null"}},[t._v(" "+t._s("Select tissue")+" ")]),t._l(t.annoAssoTissues,(function(e){return n("option",{key:e,domProps:{value:e,innerHTML:t._s(e)}})}))],2):t._e(),"null"!=t.annotationOnFocus&&"null"!=t.tissueOnFocus?n("span",{staticClass:"btn btn-primary btn-sm btn-biosamples",on:{click:function(e){return t.getBiosamples(t.annotationOnFocus,t.tissueOnFocus)}}}
1,[t._v("Get biosamples")]):t._e()])]),t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0&&!t.renderConfig["no search key bubbles"]?n("div",{staticStyle:{position:"absolute",right:"10px",top:"7px"}},[t._l(t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})),(function(e){return[n("span",{key:e.id,class:"btn search-bubble ",style:"background-color:"+t.getColorIndex(e.id),domProps:{innerHTML:t._s(e.id+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeAnno(e.id)}}})]})),t._l(t.pkgDataSelected.filter((function(t){return"Tissue"==t.type})),(function(e){return[n("span",{key:e.id,class:"btn search-bubble ",style:"background-color:#999999",domProps:{innerHTML:t._s(e.id+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeTissue(e.id)}}})]}))],2):t._e()])]),t.renderConfig["with annotations viewer"]&&"false"!=t.renderConfig["with annotations viewer"]?t._e():n("div",{staticClass:"col-md-12 bio-plot-ui-wrapper",staticStyle:{"border-bottom":"solid 1px #dddddd"}},[t._m(0),n("div",t._l(t.annoData,(function(e,r,a){return n("div",{key:r,staticClass:"bio-bubble-wrapper"},[n("span",{staticClass:"bio-bubble",style:"background-color:"+t.compareGroupColors[a]+";",domProps:{innerHTML:t._s(" ")}}),n("span",{domProps:{innerHTML:t._s(r)}})])})),0),null!=t.searchingPhenotype?n("div",{attrs:{id:"BSGEPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"BSGEInfoBox"}}),n("canvas",{staticStyle:{"background-color":"#ffffff"},attrs:{id:"BSGEPlot",width:"",height:""},on:{mousemove:function(e){return t.checkGEPosition(e)},mouseout:function(e){return t.onMouseOut("BSGEInfoBox")}}})]):t._e()]),t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0&&t.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).length>0?n("span",[n("strong",[t._v("Filter associated variants by location within regulatory regions annotated in specific tissue or cell types within the tissue categories selected above. ")])]):t._e()]),n("div",{staticClass:"col-md-9 bio-plot-wrapper"},[n("div",{class:0==t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length||0==t.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).length?"height-1px":"height-auto",attrs:{id:"biosamplesPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"biosampleInfoBox"}}),n("canvas",{attrs:{id:"biosamplesPlot",width:"",height:"0"},on:{resize:t.onResize,mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){return t.onMouseOut("biosampleInfoBox")}}})])]),null!=t.getPropsArr("methods")&&null!=t.getPropsArr("sources")?n("div",{staticClass:"col-md-3 reference-area",staticStyle:{display:"inline-block","vertical-align":"top"}},[n("button",{staticClass:"btn btn-sm btn-outline-secondary",staticStyle:{"margin-right":"5px","margin-bottom":"10px"},on:{click:function(e){return t.checkUncheckAll("check")}}},[t._v(" Select all ")]),n("button",{staticClass:"btn btn-sm btn-outline-secondary",staticStyle:{"margin-bottom":"10px"},on:{click:function(e){return t.checkUncheckAll("uncheck")}}},[t._v(" Unselect all ")]),t._m(1),t._l(t.getPropsArr("methods"),(function(e){return n("div",{key:e,staticStyle:{display:"inline-block"}},[n("label",{staticStyle:{"padding-right":"10px"}},[n("input",{attrs:{type:"checkbox"},domProps:{value:e,checked:!t.pkgDataSelected.filter((function(t){return"BS-Method"==t.type})).map((function(t){return t.id})).includes(e)},on:{click:function(n){return t.addRemoveParameter(e,"BS-Method")}}}),t._v(t._s(" "+e+" ")+" ")])])})),t._m(2),t._l(t.getPropsArr("sources"),(function(e){return n("div",{key:e,staticStyle:{display:"inline-block"}},[n("label",{staticStyle:{"padding-right":"10px"}},[n("input",{attrs:{type:"checkbox"},domProps:{value:e,checked:!t.pkgDataSelected.filter((function(t){return"BS-Source"==t.type})).map((function(t){return t.id})).includes(e)},on:{click:function(n){return t.addRemoveParameter(e,"BS-Source")}}}),t._v(t._s(" "+e+" ")+" ")])])}))],2):t._e()]):t._e()])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Global Enrichment")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Methods")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Sources")])])}],i=n("53ca"),o=n("1da1"),s=n("3835"),l=n("2909"),c=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("cb29"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("b0c0"),n("4ec9"),n("6b93"),n("a9e3"),n("0c47"),n("23dc"),n("4fad"),n("c1f9"),n("b64b"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),u=n("1157"),d=n.n(u),h=n("b1e0");function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 5,725 bytes, line 1
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}c["default"].use(h["a"]);var f=c["default"].component("research-biosamples-plot",{props:["region","phenotype","renderConfig","plotMargin","compareGroupColors","searchType","plotData","pkgData","pkgDataSelected","regionZoom","regionViewArea","utils"],data:function(){return{annoData:{}
1,biosamplesData:{},GEData:{},GEPosData:{},tissuesData:{},biosamplesPosData:{},spaceBy:24,annotationOnFocus:"null",tissueOnFocus:"null",trigger:0}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize),this.renderConfig["with annotations plot"]&&"false"!=this.renderConfig["with annotations plot"]||this.getBSAnnotations(this.searchingRegion)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{annoAssoTissues:function(){var t=this;if("null"!=this.annotationOnFocus&&Object.keys(this.tissuesData).length>0){var e=[];return Object.keys(this.tissuesData).filter((function(n){t.tissuesData[n][t.annotationOnFocus]&&e.push(n)})),e}return null},searchingParameters:function(){if(null!=this.searchingRegion&&null!=this.searchingPhenotype)return this.searchingRegion+","+this.searchingPhenotype},searchingRegion:function(){var t={},e=this.region.split(":");return t["chr"]=e[0],t["start"]=e[1].split("-")[0],t["end"]=e[1].split("-")[1],this.utils.uiUtils.showElement("biosamplesPlotWrapper"),t},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},searchingPhenotype:function(){if(null!=this.phenotype){this.utils.uiUtils.showElement("annotationsPlotWrapper");var t=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][this.phenotype]:this.phenotype;return t}if(null==this.phenotype){if(this.utils.keyParams[this.renderConfig["phenotype parameter"]]){this.utils.uiUtils.showElement("annotationsPlotWrapper");var e=this.utils.keyParams[this.renderConfig["phenotype parameter"]],n=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][e]:e;return n}return null}}},watch:{searchingParameters:function(t){"newSearch"==this.searchType?this.resetAll():this.renderConfig["with annotations plot"]&&"false"!=this.renderConfig["with annotations plot"]||this.getBSAnnotations(this.searchingRegion)},pkgDataSelected:{handler:function(t){var e=this.getSelectedParameters("Annotation"),n=this.getSelectedParameters("Tissue");0==e.length||0==n.length?this.resetAll():this.handleSearchUpdate(t)}},viewingRegion:{handler:function(t,e){this.renderBiosamplesTrack("viewing region change")},deep:!0,immediate:!0},annotationOnFocus:function(){this.renderGE()}},methods:{getSelectedParameters:function(t){var e=Object(l["a"])(new Set(this.pkgDataSelected.filter((function(e){return e.type==t})).map((function(t){return t.id}))));return e},handleSearchUpdate:function(t){var e=this,n=this.getSelectedParameters("Annotation"),r=this.getSelectedParameters("Tissue");n.length>0&&r.length>0?n.map((function(t){r.map((function(n){e.getBiosamples(t,n)}))})):this.renderBiosamplesTrack("anno or tissue missing")},resetAll:function(){var t=this;this.annoData={},this.biosamplesData={},this.GEData={},this.GEPosData={},this.tissuesData={},this.biosamplesPosData={},this.annotationOnFocus="null",this.tissueOnFocus="null",this.trigger=0,this.pkgDataSelected.map((function(e){"Biosample"!=e.type&&"BS-Method"!=e.type&&"BS-Source"!=e.type||t.$store.dispatch("pkgDataSelected",{type:e.type,id:e.id,action:"remove"})})),this.renderBiosamplesTrack("reset all"),this.renderConfig["with annotations viewer"]&&"false"!=this.renderConfig["with annotations viewer"]||this.getBSAnnotations(this.searchingRegion)},checkUncheckAll:function(t){var e=this;switch(t){case"check":[{type:"BS-Method",items:this.getPropsArr("methods")},{type:"BS-Source",items:this.getPropsArr("sources")}].map((function(t){t.items.map((function(n){e.pkgDataSelected.filter((function(e){return e.id==n&&e.type==t.type})).length>0&&e.$store.dispatch("pkgDataSelected",{type:t.type,id:n,action:"remove"})}))}));break;case"uncheck":[{type:"BS-Method",items:this.getPropsArr("methods")},{type:"BS-Source",items:this.getPropsArr("sources")}].map((function(t){t.items.map((function(n){0==e.pkgDataSelected.filter((function(e){return e.id==n&&e.type==t.type})).length&&e.$store.dispatch("pkgDataSelected",{type:t.type,id:n,action:"add"})}))}));break}this.trigger++},getPropsArr:function(t){var e=this,n=this.pkgDataSelected.filter((function(t){return"Biosample"==t.type}
1)),r=[];if(n.map((function(t){r.push(t.id)})),r.length>0){var a=[],i=[];r.map((function(t){var n=t.split(" / "),r=n[0],o=n[1],s=n[2];e.pkgData.biosamplesData&&e.pkgData.biosamplesData[r]&&e.pkgData.biosamplesData[r][o]&&e.pkgData.biosamplesData[r][o][s]&&e.pkgData.biosamplesData[r][o][s].map((function(t){a.push(t.method),i.push(t.source)}))})),a=Object(l["a"])(new Set(a)),i=Object(l["a"])(new Set(i));var o={methods:a,sources:i};return o[t]}return null},addRemoveParameter:function(t,e){this.pkgDataSelected.filter((function(n){return n.id==t&&n.type==e})).length>0?this.$store.dispatch("pkgDataSelected",{type:e,id:t,action:"remove"}):this.$store.dispatch("pkgDataSelected",{type:e,id:t,action:"add"})},getOverlappingBSRegion:function(){var t=this;if(this.renderConfig["overlapping regions"]&&"false"!=this.renderConfig["overlapping regions"]){var e=this.$store.state.pkgDataSelected.filter((function(t){return"BS-Method"==t.type})).map((function(t){return t.id})),n=this.$store.state.pkgDataSelected.filter((function(t){return"BS-Source"==t.type})).map((function(t){return t.id})),r={};if(this.pkgDataSelected.length>0&&this.pkgDataSelected.map((function(t){r[t.type]||(r[t.type]=[]),r[t.type].push(t.id)})),r["Biosample"]){var a={and:null,or:null};r["Biosample"].map((function(r){for(var i=r.split(" / "),o=i[0],l=i[1],c=i[2],u=function(){var r=Object(s["a"])(h[d],2),i=r[0],u=r[1],p=[];t.pkgData.biosamplesData&&t.pkgData.biosamplesData[o]&&t.pkgData.biosamplesData[o][l]&&t.pkgData.biosamplesData[o][l][c]&&t.pkgData.biosamplesData[o][l][c].map((function(t){if(-1==e.indexOf(t.method)&&-1==n.indexOf(t.source))for(var r=t.start;r<=t.end;r++)p.push(r)})),a[i]=null==u?p:"and"==i?t.getArraysIntersection(a[i],p):a[i].concat(p)},d=0,h=Object.entries(a);d<h.length;d++)u()}));for(var i=0,o=Object.entries(a);i<o.length;i++){var l=Object(s["a"])(o[i],2),u=l[0];l[1];a[u].sort((function(t,e){return t-e}))}for(var d={and:[],or:[]},h=0,p=Object.entries(d);h<p.length;h++)for(var f=Object(s["a"])(p[h],2),_=f[0],g=(f[1],0);g<a[_].length;g++)if(0==g||g==a[_].length-1)d[_].push(a[_][g]);else{var m=a[_][g-1]+1,v=a[_][g];v>m&&(d[_].push(a[_][g-1]),d[_].push(a[_][g]))}for(var y={and:[],or:[]},b=0,x=Object.entries(d);b<x.length;b++)for(var w=Object(s["a"])(x[b],2),C=w[0],P=(w[1],0);P<d[C].length-1;P+=2){var k={};k["start"]=d[C][P],k["end"]=d[C][P+1],y[C].push(k)}c["default"].set(this.pkgData,"overlappingBiosampleRegions",y)}else this.pkgData["overlappingBiosampleRegions"]&&delete this.pkgData["overlappingBiosampleRegions"]}},getArraysIntersection:function(t,e){return t.filter((function(t){return-1!==e.indexOf(t)}))},onMouseOut:function(t){this.utils.uiUtils.removeOnMouseOut(t,1e3)},onResize:function(t){this.utils.uiUtils.showElement("biosamplesPlotWrapper"),this.renderBiosamplesTrack("on resize"),this.renderConfig["with annotations viewer"]&&"false"!=this.renderConfig["with annotations viewer"]||this.renderGE()},removeAnno:function(t){this.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t,action:"remove"})},removeTissue:function(t){this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:t,action:"remove"})},addRemoveBiosampleTrack:function(t){var e=this.pkgDataSelected.filter((function(t){return"Biosample"==t.type})).map((function(t){return t.id})),n=e.indexOf(t);n>-1?null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Biosample",id:t,action:"remove"}):null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Biosample",id:t,action:"add"})},checkGEPosition:function(t){for(var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=Math.floor(e.clientY-n.top),i=Math.round(this.spaceBy/2),o=document.querySelector("#BSGEInfoBox"),l="",c=-5;c<=5;c++)for(var u=-5;u<=5;u++)if(void 0!=this.GEPosData[a+c]&&void 0!=this.GEPosData[a+c][r+u])for(var d=0,h=Object.entries(this.GEPosData[a+c][r+u]);d<h.length;d++){var p=Object(s["a"])(h[d],2),f=p[0],_=p[1];l+="<span style='color:"+this.compareGroupColors[_.annotationIndex]+"'>"+f+"</span><br />"}""!=l?(o.innerHTML=l,o.setAttribute("class",""),r<.75*n.width?(o.style.width="auto",o.style.left=r+15+"px",o.style.top=a+i+"px"):(o.style.width="200px",o.style.left=r-215+"px",o.style.top=a+i+"px")):o.setAttribute("class","hidden")},checkPosition:function(t,e){var n=t,r=n.target.getBoundingClientRect(),a=Math.floor(n.clientX-r.left),i=n.clientX-r.left,o=n.clientY-r.top,l=Math.round(this.spaceBy/2),c=Math.ceil(Math.floor(n.clientY-r.top)/l)-1,u=document.querySelector("#biosampleInfoBox"),d="";if("hover"==e)if(a>=this.plotMargin.leftMargin/2&&a<=r.width-this.plotMargin.leftMargin/2){if(this.bi
1osamplesPosData[c]){d+=this.biosamplesPosData[c].biosample;for(var h=0,p=Object.entries(this.biosamplesPosData[c].regions);h<p.length;h++){var f=Object(s["a"])(p[h],2),_=f[0],g=f[1],m=_.split("_"),v=m[0],y=m[1];a>=v&&a<=y&&(d+="<br />"+g.start+"-"+g.end+"<br />dataset: "+g.dataset+"<br />source: "+g.source+"<br />method: "+g.method+"<br />state: "+g.state+"<br />")}}}else if(a>=r.width-this.plotMargin.leftMargin/2&&a<=r.width)for(var b=Math.floor(o),x=b-8,w=b+8,C=x;C<=w;C++)if(this.biosamplesPosData[C]&&this.biosamplesPosData[C].annotation)for(var P=0,k=Object.entries(this.biosamplesPosData[C].regions);P<k.length;P++){var M=Object(s["a"])(k[P],2),E=M[0],D=M[1],O=E.split("_"),L=O[0],j=O[1];a>=L&&a<=j&&(d+=D)}"click"==e&&a>=this.plotMargin.leftMargin/2&&a<=r.width-this.plotMargin.leftMargin/2&&this.biosamplesPosData[c]&&(d+=this.biosamplesPosData[c].annotation+" / "+this.biosamplesPosData[c].tissue+" / "+this.biosamplesPosData[c].biosample),"hover"==e&&(""==d?(u.innerHTML="",u.setAttribute("class","hidden")):(u.innerHTML=d,u.setAttribute("class",""),u.style.left=i+15+"px",u.style.top=o+l+"px")),"click"==e&&""!=d&&this.addRemoveBiosampleTrack(d)},getColorIndex:function(t){var e=Object.keys(this.pkgData.annoData),n=e.indexOf(t);return this.compareGroupColors[n]},getGlobalEnrichment:function(){var t=this;return Object(o["a"])(p().mark((function e(){var n,r,a,i,o,l,u,d,h,f;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n="KP BioIndex"==t.renderConfig["biosamples server"]?t.utils.uiUtils.biDomain()+"/api/bio":t.renderConfig["biosamples server"],r=t.searchingPhenotype,a=t.renderConfig["global enrichment index"]?t.renderConfig["global enrichment index"]:"global-enrichment",i=n+"/query/"+a+"?q="+r,e.next=6,fetch(i).then((function(t){return t.json()}));case 6:if(o=e.sent,null==o.error){for("newSearch"==t.searchType&&(t.GEData={}),t.GEData[t.searchingPhenotype]=o.data,l=0,u=Object.entries(t.GEData);l<u.length;l++)d=Object(s["a"])(u[l],2),d[0],h=d[1],h.map((function(e){var n=e.ancestry,r=e.annotation,a=e.pValue,i=e.phenotype,o=e.tissue;t.annoData[r]&&t.annoData[r][o]&&(t.annoData[r][o].ancestries[n]||(t.annoData[r][o].ancestries[n]={}),t.annoData[r][o].ancestries[n][i]=a),t.tissuesData[o]&&t.tissuesData[o][r]&&(t.tissuesData[o][r].ancestries[n]||(t.tissuesData[o][r].ancestries[n]={}),t.tissuesData[o][r].ancestries[n][i]=a)}));t.tissuesData=Object.fromEntries(Object.entries(t.tissuesData).sort()),f=t.getGEByTissue(),null!=t.pkgData&&(c["default"].set(t.pkgData,"GEByTissueData",f),c["default"].set(t.pkgData,"GEData",t.GEData),c["default"].set(t.pkgData,"annoData",t.annoData),c["default"].set(t.pkgData,"tissuesData",t.tissuesData)),t.renderGE(),t.renderBiosamplesTrack()}t.$forceUpdate();case 9:case"end":return e.stop()}}),e)})))()},getGEByTissue:function(){var t=this,e={};Object.keys(this.GEData).map((function(n){e[n]={},Object.keys(t.annoData).map((function(t){e[n][t]=[]}))}));for(var n={},r=function(){var r=Object(s["a"])(i[a],2),o=r[0],l=r[1];n[o]={},l.map((function(r){n[o][r.tissue]||(n[o][r.tissue]={}),n[o][r.tissue][r.annotation]||(n[o][r.tissue][r.annotation]={pValue:null,fold:null,gregor:null,rank:null});var a=n[o][r.tissue][r.annotation].pValue;(null==a||r.pValue<a)&&(n[o][r.tissue][r.annotation].pValue=t.utils.Formatters.pValueFormatter(r.pValue),n[o][r.tissue][r.annotation].fold=t.utils.Formatters.pValueFormatter(r.SNPs/r.expectedSNPs)),e[o][r.annotation]&&e[o][r.annotation].push({tissue:r.tissue,fold:n[o][r.tissue][r.annotation].fold})}))},a=0,i=Object.entries(this.GEData);a<i.length;a++)r();return Object.keys(e).map((function(r){Object.keys(e[r]).map((function(a){e[r][a]=Object(l["a"])(new Map(e[r][a].map((function(t){return[t["tissue"],t]}))).values()),e[r][a].sort((function(t,e){return e.fold-t.fold}));var i=0;e[r][a].map((function(e){t.tissuesData[e.tissue]&&t.tissuesData[e.tissue][a]&&(n[r][e.tissue][a].rank=i,i++)}))}))})),n},getBiosamples:function(t,e){var n=this;return Object(o["a"])(p().mark((function r(){var a,i,o,s,l,c,u,d;return p().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=n.getSelectedParameters("Annotation").sort(),i=n.getSelectedParameters("Tissue").sort(),a.includes(t)||n.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t,action:"add"}),i.includes(e)||n.$store.dispatch("pkgDataSelected",{type:"Tissue",id:e,action:"add"}),!n.biosamplesData[t]||!n.biosamplesData[t][e]){r.next=8;break}n.renderBiosamplesTrack("after bs data load"),r.next=17;break;case 8:return o="KP BioIndex"==n.renderConfig["biosamples server"]?n.utils.uiUtils.biDomain()+"/api/bio":n.renderConfig["biosamples server"],s=n.renderConfig["biosamples index"]?n.renderConfig["biosamples index"]:"tissue-regions",l=e,c=n.searchingRegion,u=o+"/query/"+s+"?q="+l+","+c.chr+":"+c.start+"-"+c.end,r.next=15,fetch(u).then((function(t){return t.json()}));case 15:d=r.sent,null==d.error&&(null==d.continuation?n.runAfterBSDataLoad(d,t,e):n.loadContinue(d,t,e));case 17:case"end":return r.stop()}}),r)})))()},loadContinue:function(t,e,n){var r=this;return Object(o["a"])(p().mark((function a(){var i,o,s,l,c;return p().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return i="KP BioIndex"==r.renderConfig["biosamples server"]?r.utils.uiUtils.biDomain()+"/api/bio":r.renderConfig["biosamples server"],o=i+"/cont?token="+t.continuation,a.next=4,fetch(o).then((function(t){return t.json()}));case 4:s=a.sent,null==s.error&&(l=t.data,c=l.concat(s.data),s.data=c,null==s.continuation?r.runAfterBSDataLoad(s,e,n):r.loadContinue(s,e,n));case 6:case"end":return a.stop()}}),a)})))()},runAfterBSDataLoad:function(t,e,n){var r=this,a=[];if(t.data.map((function(t){t.annotation==e&&a.push(t)})),a.length>0){var i=Object(l["a"])(new Set(a.map((function(t){return t.biosample})))).sort(Intl.Collator().compare);
1this.biosamplesData[e]||(this.biosamplesData[e]={}),this.biosamplesData[e][n]||(this.biosamplesData[e][n]={}),i.map((function(t){r.biosamplesData[e][n][t]||(r.biosamplesData[e][n][t]=[]),a.map((function(a){a.biosample==t&&r.biosamplesData[e][n][a.biosample].push(a)}))}))}null!=this.pkgData&&c["default"].set(this.pkgData,"biosamplesData",this.biosamplesData),this.renderBiosamplesTrack("after bs data load")},renderBiosamplesTrack:function(t){var e=this;this.biosamplesPosData={};var n=[];if(this.renderConfig["star key"]){var r=Array.isArray(this.plotData)?this.array2Object(this.renderConfig["star key"]["key"],this.plotData):this.plotData,a=this.renderConfig["star key"]["key"],i=this.renderConfig["star key"]["position"];this.pkgDataSelected.filter((function(t){return t.type==a})).map((function(t){return t.id})).map((function(t){n.push(r[t][i])}))}var o=0,l=2*this.spaceBy,c=7*this.spaceBy,u=this.spaceBy,d=2*this.spaceBy,h=2*this.spaceBy,p=this.viewingRegion.start,f=this.viewingRegion.end,_=this.pkgDataSelected.filter((function(t){return"Biosample"==t.type})).map((function(t){return t.id})),g=[],m=this.getSelectedParameters("Annotation").sort(),v=this.getSelectedParameters("Tissue").sort();m.map((function(t){v.map((function(n){g.push(t+" / "+n),o+=l,o+=Object.keys(e.biosamplesData[t][n]).length*u,o+=c}))}));var y=document.querySelector("#biosamplesPlotWrapper"),b=document.querySelector("#biosamplesPlot");if(b&&y){var x,w,C=2*y.clientWidth,P=o+d+h,k=C-2*this.plotMargin.leftMargin,M=11,E=k/(f-p);x=b,x.setAttribute("width",C),x.setAttribute("height",P),x.setAttribute("style","width:"+C/2+"px;height:"+P/2+"px;"),w=x.getContext("2d"),w.clearRect(0,0,C,P);var D=l;g.map((function(t){w.font="28px Arial",w.textAlign="left",w.fillStyle="#000000",w.fillText(t,M,D),D+=l;var r=t.split(" / "),a=Object.keys(e.biosamplesData[r[0]][r[1]]).length*u;e.renderAnnoAxis(w,k,a,Number(f),Number(p),D,M),e.renderConfig["star key"]&&n.length>0&&e.renderStaredPositions(w,k,a,n,E,Number(f),Number(p),D,M);for(var i=0,o=function(){var t=Object(s["a"])(h[d],2),n=t[0],a=t[1],o=Math.ceil(D/e.spaceBy);e.biosamplesPosData[o]?e.biosamplesPosData[o]["biosample"]=n:e.biosamplesPosData[o]={biosample:n,annotation:r[0],tissue:r[1],regions:{}},i%2==0&&(w.fillStyle="#00000010",w.fillRect(e.plotMargin.leftMargin,D,k,u)),i++,a.map((function(t){if(t.start<=f&&t.end>=p){var a=(t.start-p)*E+e.plotMargin.leftMargin;a=a<=e.plotMargin.leftMargin?e.plotMargin.leftMargin:a;var i=(t.end-p)*E+e.plotMargin.leftMargin;i=i>e.plotMargin.leftMargin+k?e.plotMargin.leftMargin+k:i;var s=i-a<1?1:i-a;_.indexOf(r[0]+" / "+r[1]+" / "+n)>-1?w.fillStyle="#FF000066":w.fillStyle=e.getColorIndex(r[0]),w.fillRect(a,D,s,u-1);var l=Math.round(a/2)+"_"+Math.round((a+s)/2);e.biosamplesPosData[o].regions[l]={start:t.start,end:t.end,dataset:t.dataset,method:t.method,source:t.source,state:t.state}}})),D+=u,w.fillStyle="#000000",w.textAlign="start",w.textBaseline="middle",w.font="24px Arial",w.fillText(n,10,D-8)},d=0,h=Object.entries(e.biosamplesData[r[0]][r[1]]);d<h.length;d++)o();D+=c}))}this.getOverlappingBSRegion()},getBSAnnotations:function(t){var e=this;return Object(o["a"])(p().mark((function n(){var r,a,i,o;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!(t&&t.chr&&t.start&&t.end)){n.next=8;break}return r="KP BioIndex"==e.renderConfig["biosamples server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["biosamples server"],a=e.renderConfig["biosamples index"]?e.renderConfig["biosamples index"]:"regions",i=r+"/query/"+a+"?q="+t.chr+":"+t.start+"-"+t.end,n.next=6,fetch(i).then((function(t){return t.json()}));case 6:o=n.sent,null==o.error&&(e.annoData={},e.tissuesData={},o.data.map((function(t){e.annoData[t.annotation]||(e.annoData[t.annotation]={}),e.annoData[t.annotation][t.tissue]||(e.annoData[t.annotation][t.tissue]={region:[],ancestries:{}}),e.annoData[t.annotation][t.tissue].region.push(t),e.tissuesData[t.tissue]||(e.tissuesData[t.tissue]={}),e.tissuesData[t.tissue][t.annotation]||(e.tissuesData[t.tissue][t.annotation]={region:[],ancestries:{}}),e.tissuesData[t.tissue][t.annotation].region.push(t)})),null!=e.pkgData&&(c["default"].set(e.pkgData,"annoData",e.annoData),c["default"].set(e.pkgData,"tissuesData",e.tissuesData)),e.getGlobalEnrichment());case 8:case"end":return n.stop()}}),n)})))()},renderGE:function(){var t=this;this.GEPosData={};for(var e={},n=function(){var n=Object(s["a"])(a[r],2),i=n[0],o=n[1];e[i]={xMax:null,xMin:null,yMax:null,yMin:null},o.map((function(n){if(t.annoData[n.annotation]&&t.annoData[n.annotation][n.tissue]){e[i][n.annotation]||(e[i][n.annotation]={});var r=0==n.pValue?324:-Math.log10(n.pValue),a=n.SNPs/n.expectedSNPs;e[i].yMax=null==e[i].yMax||a>e[i].yMax?a:e[i].yMax,e[i].yMin=null==e[i].yMin||a<e[i].yMin?a:e[i].yMin,e[i].xMax=null==e[i].xMax||r>e[i].xMax?r:e[i].xMax,e[i].xMin=null==e[i].xMin||r<e[i].xMin?r:e[i].xMin,e[i][n.annotation][n.tissue]=e[i][n.annotation][n.tissue]?e[i][n.annotation][n.tissue]:{pValue:null,fold:null};var o=e[i][n.annotation][n.tissue].pValue,s=e[i][n.annotation][n.tissue].fold;e[i][n.annotation][n.tissue].pValue=null==o||r>o?r:o,e[i][n.annotation][n.tissue].fold=null==s||a>s?a:s}}))},r=0,a=Object.entries(this.GEData);r<a.length;r++)n();var i,o,l=Object.keys(e).length,c=2*document.querySelector("#BSGEPlotWrapper").clientWidth*.25,u=c*l,d=260,h=2*this.spaceBy,p=this.plotMargin.topMargin+this.plotMargin.bottomMargin+d+h,f=c-this.plotMargin.leftMargin-this.plotMargin.rightMargin,_=11;i=document.querySelector("#BSGEPlot"),i.setAttribute("width",u),i.setAttribute("height",p),i.setAttribute("style","width:"+u/2+"px;
1height:"+p/2+"px;"),o=i.getContext("2d");for(var g=0,m=function(){var e=Object(s["a"])(y[v],2),n=e[0],r=e[1],a=h,i=_+c*g;o.font="28px Arial",o.textAlign="left",o.fillStyle="#000000",o.fillText(n,i,a),t.renderGEAxis(o,f,d,r.xMax,r.xMin,r.yMax,r.yMin,i,a,_);var l=Object.keys(t.annoData),u=[],p=[];l.map((function(t){for(var e=0,n=Object.entries(r[t]);e<n.length;e++){var a=Object(s["a"])(n[e],2),i=(a[0],a[1]);p.push(i.pValue),u.push(i.fold)}})),u.sort((function(t,e){return e-t})),p.sort((function(t,e){return e-t}));var m=f/(r.xMax-r.xMin),b=d/(r.yMax-r.yMin);l.map((function(e,n){for(var l="null"==t.annotationOnFocus||t.annotationOnFocus==e?t.compareGroupColors[n]:"#00000030",h=0,f=Object.entries(r[e]);h<f.length;h++){var _=Object(s["a"])(f[h],2),g=_[0],v=_[1],y=i+t.plotMargin.leftMargin+(v.pValue-r.xMin)*m,x=a+t.plotMargin.topMargin+d-(v.fold-r.yMin)*b;o.fillStyle=l,o.lineWidth=0,o.beginPath(),o.arc(y,x,8,0,2*Math.PI),o.fill(),(v.fold>=u[2]||v.pValue>=p[2])&&(o.font="24px Arial",o.fillStyle="null"==t.annotationOnFocus||t.annotationOnFocus==e?"#000000":"#00000050",y>.75*c?(o.textAlign="right",o.fillText(g,y-14,x+6)):(o.textAlign="left",o.fillText(g,y+14,x+6))),t.GEPosData[Math.round(x/2)]||(t.GEPosData[Math.round(x/2)]={}),t.GEPosData[Math.round(x/2)][Math.round(y/2)]||(t.GEPosData[Math.round(x/2)][Math.round(y/2)]={}),t.GEPosData[Math.round(x/2)][Math.round(y/2)][g]={pValue:null,fold:null},t.GEPosData[Math.round(x/2)][Math.round(y/2)][g]["pValue"]=v.pValue,t.GEPosData[Math.round(x/2)][Math.round(y/2)][g]["fold"]=v.fold,t.GEPosData[Math.round(x/2)][Math.round(y/2)][g]["annotationIndex"]=n}})),g++},v=0,y=Object.entries(e);v<y.length;v++)m()},renderGEAxis:function(t,e,n,r,a,i,o,s,l,c){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]);var u=Math.round(s+this.plotMargin.leftMargin-c);t.moveTo(u,l+this.plotMargin.topMargin),t.lineTo(u,l+this.plotMargin.topMargin+n+c);for(var d=(i-o)/5,h=n/5,p=0;p<6;p++){var f=l+this.plotMargin.topMargin+p*h,_=Math.floor(f);t.moveTo(s+this.plotMargin.leftMargin-2*c,_),t.lineTo(s+this.plotMargin.leftMargin-c,_),t.stroke(),t.textAlign="right",t.font="24px Arial";var g=i-o,m=g<=1?2:g<=50?1:0,v=this.utils.Formatters.decimalFormatter(o+p*d,m);v=v>=1e5?Math.round(.001*v)+"k":v,t.fillText(v,s+this.plotMargin.leftMargin-3*c,l+this.plotMargin.topMargin+n+c-p*h)}var y=this.renderConfig["global enrichment y axis label"]?this.renderConfig["global enrichment y axis label"]:"Fold(SNPs/expectedSNPs)";t.textAlign="center",t.rotate(-2*Math.PI/4),t.fillText(y,-(this.plotMargin.topMargin+n/2)-l,s+c+12),t.rotate(-2*Math.PI/4*3),t.moveTo(s+this.plotMargin.leftMargin-c,l+this.plotMargin.topMargin+n+c),t.lineTo(s+this.plotMargin.leftMargin+e,l+this.plotMargin.topMargin+n+c),t.stroke();for(var b=(r-a)/5,x=e/5,w=0;w<6;w++){var C=s+this.plotMargin.leftMargin+w*x,P=Math.floor(C);t.moveTo(P,l+n+this.plotMargin.topMargin+c),t.lineTo(P,l+n+this.plotMargin.topMargin+2*c),t.stroke(),t.textAlign="center",t.font="24px Arial";var k=r-a,M=k<=1?2:k<=50?1:0,E=this.utils.Formatters.decimalFormatter(a+w*b,M);E=E>=1e5?Math.round(.001*E)+"k":E,t.fillText(E,P,l+n+this.plotMargin.topMargin+4*c)}var D=this.renderConfig["global enrichment x axis label"]?this.renderConfig["global enrichment x axis label"]:"-Log10(p-value)";t.textAlign="center",t.fillText(D,s+this.plotMargin.leftMargin+e/2,l+n+6*c+this.plotMargin.topMargin+24)},array2Object:function(t,e){var n={};return e.map((function(e){var r=e[t];n[r]=e})),n},renderAnnoAxis:function(t,e,n,r,a,i,o){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]),t.moveTo(this.plotMargin.leftMargin-o,i),t.lineTo(this.plotMargin.leftMargin-o,i+n+o),t.stroke();var s=Math.round(this.plotMargin.leftMargin+e+o);t.moveTo(s,i),t.lineTo(s,i+n+o),t.stroke(),t.moveTo(this.plotMargin.leftMargin-o,i+n+o),t.lineTo(s,i+n+o),t.stroke();for(var l=Math.ceil((r-a)/5),c=e/5,u=0;u<6;u++){var d=this.plotMargin.leftMargin+u*c,h=Math.floor(d);t.moveTo(h,i+n+o),t.lineTo(h,i+n+2*o),t.stroke(),t.textAlign="center",t.font="24px Arial",t.fillStyle="#000000";var p=r-a,f=p<=1?2:p<=50?1:0,_=this.utils.Formatters.decimalFormatter(a+u*l,f);_=_>=1e5?Math.round(.001*_)+"k":_,t.fillText(_,h,i+n+8*o)}},renderStaredPositions:function(t,e,n,r,a,i,o,s,l){var c=this;t.beginPath(),t.lineWidth=2,t.strokeStyle="#FFAA00",t.setLineDash([6,6]),r.map((function(e){var r=(e-o)*a+c.plotMargin.leftMargin;t.moveTo(r,s-l),t.lineTo(r,s+n+l),t.stroke()}))}}});d()((function(){}));var _=f,g=(n("ace5"),n("2877")),m=Object(g["a"])(_,r,a,!1,null,null,null);e["a"]=m.exports},6772:function(t,e,n){"use strict";n("ba87")},"67a3":function(t,e,n){"use strict";n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return m})),n.d(e,"c",(function(){return w})),n.d(e,"d",(function(){return C}));var r=n("5530"),a=n("2909"),i=n("53ca"),o=n("d4ec"),s=n("bee2"),l=n("ade3"),c=(n("d9e2"),n("99af"),n("13d5"),n("b0c0"),n("d3b7"),n("3ca3"),n("10d1"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("ef2a")),u=n("d8ef");n("060c");function d(t,e,n){h(t,e),e.set(t,n)}function h(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function p(t,e){return t.get(_(t,e))}function f(t,e,n){return t.set(_(t,e),n),n}function _(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var g=function(){function t(e,n){Object(o["a"])(this,t),Object(l["a"])(this,"layout",null),e!==Object(e)||"object"!==Object(i["a"])(n)||Array.isArray(n)?e===Object(e)?this.layout=e:"string"!==typeof e||"object"!==Object(i["a"])(n)||Array.isArray(n)?"string"===typeof e&&(this.layout=c["a"].Layouts.get("panel",e)):this.layout=c["a"].Layouts.get("panel",e,n):this.layout=c["a"].Layouts.merge(e,n),this.layout=Object.assign(this.layout,{id:u["a"].getUniqueId()})}return Object(s["a"])(t,[{key:"withNamespace",value:function(t,e){var n=this,r=["type","tag","id"],i=function(t,e){return"$..data_layers[?(@.".concat(t,' === "').concat(e,'")]')}
1,o=function(t,e){return"$..toolbar.*[?(@.".concat("data_layer_id",' === "',e,'")]')},s=r.reduce((function(e,n){return e.concat.apply(e,Object(a["a"])(i(n,t)).concat(Object(a["a"])(o(n,t))))}),[]).length>0;if(this.layout=c["a"].Layouts.renameField(this.layout,t,e),s){var l=function(t,e){return"".concat(i(t,e),".").concat(t)},u=function(t,e){return"".concat(o(t,e),".").concat(t)};r.forEach((function(r){c["a"].Layouts.mutate_attrs(n.layout,l(r,e),t),c["a"].Layouts.mutate_attrs(n.layout,u(r,e),t)}))}return this}},{key:"mergeLayoutObject",value:function(t,e){var n=c["a"].Layouts.query_attrs(this.layout,t)[0];return"object"!==Object(i["a"])(n)||Array.isArray(n)||c["a"].Layouts.mutate_attrs(this.layout,t,(function(t){return Object.assign(t,e)})),this}},{key:"addProperty",value:function(t,e,n){var r=Object(l["a"])({},e,n);return this.mergeLayoutObject(t,r),this}},{key:"setProperty",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=c["a"].Layouts.query_attrs(this.layout,t);if(r){var a=Array.isArray(r[0]);if(a&&!1===n)return this}return c["a"].Layouts.mutate_attrs(this.layout,t,e),this}},{key:"addRule",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=Array.isArray(c["a"].Layouts.query_attrs(this.layout,t)[0]);return r&&this.setProperty(t,(function(t){return n?[e].concat(Object(a["a"])(t)):[].concat(Object(a["a"])(t),[e])}),!0),this}},{key:"addFields",value:function(t,e,n){var r=this;return n.forEach((function(n){r.addRule("".concat(t,".fields"),"".concat(e,":").concat(n))})),this}},{key:"renameField",value:function(t,e){return c["a"].Layouts.renameFields(this.layout,t,e),this}},{key:"full",get:function(){try{if(null!==this.layout)return this.layout;throw Error("Layout hasn't been properly initialized. layout: ".concat(this.layout))}catch(t){}finally{return null}}}])}(),m=function(){function t(e,n,r){Object(o["a"])(this,t),Object(l["a"])(this,"name",null),Object(l["a"])(this,"datasource",null),Object(l["a"])(this,"params",{}),e===Object(e)?this.datasource=e:"string"===typeof e&&(this.name=e),Object(n),this.params=r}return Object(s["a"])(t,[{key:"withName",value:function(t){return this.name=t,this}},{key:"withParams",value:function(t){return this.params=t,this}},{key:"withParam",value:function(t,e){return this.params=Object(r["a"])(Object(r["a"])({},this.params),{},Object(l["a"])({},t,e)),this}},{key:"full",value:function(){try{if(null!==this.name&&null!==this.datasource)return[this.name,new this.datasource(params)];throw Error("One of 'name' or 'datasource' hasn't been initialized. name: ".concat(this.name," datasource: ").concat(this.datasource))}catch(t){return null}}}])}(),v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap,w=function(){function t(e,n,r){Object(o["a"])(this,t),d(this,v,void 0),d(this,y,void 0),d(this,b,void 0),d(this,x,void 0),f(b,this,e),f(x,this,n),"string"===typeof r&&this.initialize(r)}return Object(s["a"])(t,[{key:"initialize",value:function(t){return f(v,this,u["a"].getUniqueId()),f(y,this,"".concat(t,"_").concat(p(v,this))),f(b,this,p(b,this).withNamespace(t,p(y,this))),f(x,this,p(x,this).withName(p(y,this))),this}},{key:"unwrap",get:function(){return{layouts:[p(b,this).layout],sources:[[p(x,this).name,new(p(x,this).datasource)(p(x,this).params)]]}}}])}();function C(t,e,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(t){return t},i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(t){return t},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(t){return t},s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[];return{index:t,queryStringMaker:r?function(){return"".concat(e,",").concat(r)}:function(t,n,r){return"".concat(e).concat(t&&n&&r?",".concat(t,":").concat(n,"-").concat(r):"")},translator:n||function(t){return t},onLoad:a,onResolve:i,onError:o,initialData:s}}},6972:function(t,e,n){},"69f4":function(t,e,n){"use strict";n("884c")},"6b05":function(t,e,n){"use strict";n("b6bf")},"6d21":function(t,e,n){"use strict";n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("0643"),n("4e3e"),n("159b");var r=n("53ca"),a=n("1da1");n("d9e2"),n("99af"),n("d3b7"),n("8a79"),n("3ca3"),n("ddb0"),n("2b3d"),n("bf19"),n("9861"),n("88a7"),n("271a"),n("5494");function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,i=Object.create(a.prototype),s=new S(r||[]);return o(i,"_invoke",{value:D(t,n,s)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,l,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,l)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;
vendor: 7,703 bytes, line 1
1return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,o(k,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,l,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function o(t,e){return s.apply(this,arguments)}function s(){return s=Object(a["a"])(i().mark((function t(e,n){var r,a,o,s,l;return i().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=e,a=n,t.prev=2,t.next=5,fetch(r);case 5:if(o=t.sent,!o.ok){t.next=14;break}return t.next=9,o.json();case 9:if(s=t.sent,!Array.isArray(s)||0!==s.length){t.next=13;break}t.next=14;break;case 13:return t.abrupt("return",s);case 14:t.next=18;break;case 16:t.prev=16,t.t0=t["catch"](2);case 18:return o&&o.ok,t.prev=19,t.next=22,fetch(a);case 22:if(l=t.sent,l.ok){t.next=25;break}throw new Error("Fallback URL (".concat(a,") returned ").concat(l.status));case 25:return t.next=27,l.json();case 27:return t.abrupt("return",t.sent);case 30:throw t.prev=30,t.t1=t["catch"](19),t.t1;case 33:case"end":return t.stop()}}),t,null,[[2,16],[19,30]])}))),s.apply(this,arguments)}e["a"]={namespaced:!0,state:function(){return{newsFeed:[],frontContents:[],datasetsInfo:[],datasetInfo:[],pageInfo:[],newFeatures:[],resources:[],researchMethod:[],eglSummaries:[],eglData:[],researchData:[],researchDataPage:[],eglConfig:[],paperMenu:[],forestPlotData:{},staticContent:[],portals:[],helpBook:[],helpBookSearch:[],contentByID:[]}},mutations:{setNewsFeed:function(t,e){t.newsFeed=e},setFrontContents:function(t,e){t.frontContents=e},setDatasetsInfo:function(t,e){t.datasetsInfo=e},setDatasetInfo:function(t,e){t.datasetInfo=e},setPageInfo:function(t,e){t.pageInfo=e},setNewFeatures:function(t,e){t.newFeatures=e},setResources:function(t,e){t.resources=e},setEglSummaries:function(t,e){t.eglSummaries=e},setResearchMethod:function(t,e){t.researchMethod=e},setEglData:function(t,e){t.eglData=e},setResearchData:function(t,e){t.researchData=e},setResearchDataPage:function(t,e){t.researchDataPage=e},setEglConfig:function(t,e){t.eglConfig=e},setForestPlotData:function(t,e){t.forestPlotData=e},setStaticContent:function(t,e){t.staticContent=e},setPaperMenu:function(t,e){t.paperMenu=e},setPortals:function(t,e){t.portals=e},setHelpBook:function(t,e){t.helpBook=e},setHelpBookSearch:function(t,e){t.helpBookSearch=e},setContentByID:function(t,e){t.contentByID=e}},actions:{getNewsFeed:function(t,e){return Object(a["a"])(i().mark((function n(){var r,a;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e||"md",n.next=3,o("https://hugeampkpncms.org/rest/views/ne
1ws2vueportal?portal="+r,"https://kp4cd.org/rest/views/news2vueportal?portal="+r);case 3:a=n.sent,t.commit("setNewsFeed",a);case 5:case"end":return n.stop()}}),n)})))()},getFrontContents:function(t,e){return Object(a["a"])(i().mark((function n(){var r,a;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e||"md",n.next=3,o("https://hugeampkpncms.org/reset/views/portal_front?portal="+r,"https://kp4cd.org/reset/views/portal_front?portal="+r);case 3:a=n.sent,t.commit("setFrontContents",a);case 5:case"end":return n.stop()}}),n)})))()},getDatasetsInfo:function(t,e){return Object(a["a"])(i().mark((function n(){var r,a;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="md"==e?"":e,n.next=3,o("https://hugeampkpncms.org/rest/views/kpdatasets?portal="+r,"https://kp4cd.org/rest/views/kpdatasets?portal="+r);case 3:a=n.sent,t.commit("setDatasetsInfo",a);case 5:case"end":return n.stop()}}),n)})))()},getDatasetInfo:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/datasetinfo?datasetid="+e,"https://kp4cd.org/rest/views/datasetinfo?datasetid="+e);case 2:r=n.sent,t.commit("setDatasetInfo",r);case 4:case"end":return n.stop()}}),n)})))()},getPageInfo:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/".concat(e.page,"?portal=").concat(e.portal),"https://kp4cd.org/rest/views/".concat(e.page,"?portal=").concat(e.portal));case 2:r=n.sent,t.commit("setPageInfo",r);case 4:case"end":return n.stop()}}),n)})))()},getNewFeatures:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e||"md",n.next=3,o("https://hugeampkpncms.org/rest/views/newfeatures?portal="+e,"https://kp4cd.org/rest/views/newfeatures?portal="+e);case 3:r=n.sent,t.commit("setNewFeatures",r);case 5:case"end":return n.stop()}}),n)})))()},getResources:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e||"md",n.next=3,o("https://hugeampkpncms.org/rest/views/newresources?portal="+e,"https://kp4cd.org/rest/views/newresources?portal="+e);case 3:r=n.sent,t.commit("setResources",r);case 5:case"end":return n.stop()}}),n)})))()},getResearchMethod:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/eglmethod?from="+e,"https://kp4cd.org/rest/views/eglmethod?from="+e);case 2:r=n.sent,t.commit("setResearchMethod",r);case 4:case"end":return n.stop()}}),n)})))()},getEglSummaries:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e||"md",n.next=3,o("https://hugeampkpncms.org/rest/views/eglmethodsperportal?portal="+e,"https://kp4cd.org/rest/views/eglmethodsperportal?portal="+e);case 3:r=n.sent,t.commit("setEglSummaries",r);case 5:case"end":return n.stop()}}),n)})))()},getEglData:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/egldata/dataset?dataset="+e.dataset+"&trait="+e.trait,"https://kp4cd.org/egldata/dataset?dataset="+e.dataset+"&trait="+e.trait);case 2:r=n.sent,t.commit("setEglData",r);case 4:case"end":return n.stop()}}),n)})))()},getResearchData:function(t,e){return Object(a["a"])(i().mark((function n(){var r,a,s,l;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a=!1,e)try{s=new URL(e),l=s.hostname.toLowerCase(),a="kp4cd.org"===l||l.endsWith(".kp4cd.org")}catch(i){a=!1}if(!a){n.next=8;break}return n.next=5,o(e);case 5:r=n.sent,n.next=11;break;case 8:return n.next=10,fetch(e).then((function(t){return t.json()}));case 10:r=n.sent;case 11:t.commit("setResearchData",r);case 12:case"end":return n.stop()}}),n)})))()},getResearchDataPage:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/research_data?dataid="+e.pageID+"&&reviewerid="+e.reviewerID+"&&reviewercode="+e.reviewerCode,"https://kp4cd.org/rest/views/research_data?dataid="+e.pageID+"&&reviewerid="+e.reviewerID+"&&reviewercode="+e.reviewerCode);case 2:r=n.sent,t.commit("setResearchDataPage",r);case 4:case"end":return n.stop()}}),n)})))()},getEglConfig:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/egldata/config?dataset="+e.dataset+"&trait="+e.trait,"https://kp4cd.org/egldata/config?dataset="+e.dataset+"&trait="+e.trait);case 2:r=n.sent,t.commit("setEglConfig",r);case 4:case"end":return n.stop()}}),n)})))()},getForestPlotData:function(t){return Object(a["a"])(i().mark((function e(){var n;return i().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,fetch("https://raw.githubusercontent.com/statgen/locuszoom/develop/examples/data/phewas_forest.json").then((function(t){return t.json()}));case 2:n=e.sent,t.commit("setForestPlotData",n);case 4:case"end":return e.stop()}}),e)})))()},getStaticContent:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/static_content?field_page="+e,"https://kp4cd.org/rest/views/static_content?field_page="+e);case 2:r=n.sent,t.commit("setStaticContent",r);case 4:case"end":return n.stop()}}),n)})))()},getPaperMenu:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/paperheadermenu?paper="+e,"https://kp4cd.org/rest/views/paperheadermenu?paper="+e);case 2:r=n.sent,t.commit("setPaperMenu",r);case 4:case"end":return n.stop()}}),n)})))()},getPortals:function(t){return Object(a["a"])(i().mark((function e(){var n;return i().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o("https://hugeampkpncms.org/rest/views/a2f_community_kps","https://kp4cd.org/rest/views/a2f_community_kps");case 2:n=e.sent,t.commit("setPortals",n);case 4:case"end":return e.stop()}}),e)})))()},getHelpBook:function(t){return Object(a["a"])(i().mark((function e(){var n;return i().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o("https://hugeampkpncms.org/rest/views/help_book","https://kp4cd.org/rest/views/help_book");case 2:n=e.sent,t.commit("setHelpBook",n);case 4:case"end":return e.stop()}}),e)})))()},getContentByID:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/content_by_id?nid="+e,"https://kp4cd.org/rest/views/content_by_id?nid="+e);case 2:r=n.sent,t.commit("setContentByID",r);case 4:case"end":return n.stop()}}),n)})))()},getHelpBookSearch:function(t,e){return Object(a["a"])(i().mark((function n(){var r;return i().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,o("https://hugeampkpncms.org/rest/views/help_book_search?body="+e,"https://kp4cd.org/rest/views/help_book_search?body="+e);case 2:r=n.sent,t.commit("setHelpBookSearch",r);case 4:case"end":return n.stop()}}),n)})))()}}}},"6d49":function(t,e,n){"use strict";var r=n("2909"),a=n("53ca"),i=(n("4de4"),n("caad"),n("d81d"),n("14d9"),n("d3b7"),n("25f0"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("498a"),n("0643"),n("2382"),n("a573"),n("ddb0"),function(t,e,n){var i=[],o=e;return o.map((function(e){var o=!0;t.map((function(t){var i,s=n&&n[t.parameter]?n[t.parameter]:t.values?t.values:t.value;if(e[t.field]&&void 0!=e[t.field]&&1==o&&s)switch(t.type){case"search":if(t.value){if(e[t.field]&&"string"==typeof e[t.field])o=!!e[t.field].toLowerCase().includes(s.toLowerCase());else if(e[t.field]&&"object"==Object(a["a"])(e[t.field])&&Array.isArray(e[t.field])){var l=Object(r["a"])(new Set(e[t.field].map((function(t){return t.toLowerCase()}))));o=!!l.includes(s.toLowerCase())}}else if(t.values)if(o=!1,e[t.field]&&"string"==typeof e[t.field])s.map((function(n){o=!!e[t.field].toLowerCase().includes(n.toLowerCase())||o}));else if(e[t.field]&&"object"==Object(a["a"])(e[t.field])&&Array.isArray(e[t.field])){e[t.field].toString().toLowerCase();s.map((function(n){o=!!e[t.field].toLowerCase().includes(n.toLowerCase())||o}))}break;case"search greater than":o="number"==typeof e[t.field]&&e[t.field]>=s;break;case"search lower than":o="number"==typeof e[t.field]&&e[t.field]<=s;break;case"search or":i=s.split(","),o="number"==typeof e[t.field]&&(e[t.field]<=i[0].trim()||e[t.field]>=i[1].trim());break;case"search and":i=s.split(","),o="number"==typeof e[t.field]&&e[t.field]>=i[0].trim()&&e[t.field]<=i[1].trim();break;case"filter out":o=!(!e[t.field]||"string"!=typeof e[t.field])&&(!s.includes(e[t.field])&&!e[t.field].includes(s));break;case"contains":e[t.field]&&"string"==typeof e[t.field]?(o=!1,s.map((function(n){e[t.field].includes(n)&&(o=!0)}))):o=!1;break}else o=!1})),1==o&&i.push(e)})),i}),o=function(t,e,n,a,i){var o=i;if(a&&a.length>0)switch(n){case"search":var s=Object(r["a"])(new Set(a.map((function(e){return e[t].toLowerCase()}))));o=Object(r["a"])(new Set(i.filter((function(t){return!!s.includes(t[e].toLowerCase())}))));break}return o};e["a"]={applyFilters:i,filterMulti2Multi:o}},"6d76":function(t,e,n){},"6e4e":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12 phewas-plot-wrapper"},[n("div",{staticClass:"col-md-12",staticStyle:{display:"inline-block"},attrs:{id:t.canvasId+"pheWasPlotWrapper"}},[n("div",{staticClass:"phe-was-info-box hidden",attrs:{id:t.canvasId+"pheWasInfoBox"}},[n("div",{staticClass:"fixed-info-box-close",attrs:{id:t.canvasId+"info_box_close"},on:{click:function(e){return t.utils.uiUtils.removeOnMouseOut(t.canvasId+"pheWasInfoBox",100)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}}
1)],1),n("span",{attrs:{id:t.canvasId+"pheWasInfoBoxContent"}}),t._l(t.hoverItems,(function(e,r){return n("span",{key:r},[t.linkPhenotypes?n("strong",[n("a",{attrs:{href:t.phenotypeLink(r)}},[t._v(" "+t._s(t.phenotypeMap[r]&&t.phenotypeMap[r].description||r)+" ")])]):n("strong",[t._v(" "+t._s(t.phenotypeMap[r]&&t.phenotypeMap[r].description||r)+" ")]),n("br"),t._l(e.data,(function(e,r){return n("span",{key:r},[n("span",[t._v(t._s(r+": "))]),n("span",[t._v(t._s(e))]),t._v(" "),n("br")])})),null!=t.options&&1==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"pheWasInfoBox")?[t.options.includes("add phenotype")?n("button",{staticClass:"option-button",on:{click:function(n){return t.addPhenotype(e.id)}}},[t._v(" Add this phenotype below ")]):t._e(),t.options.includes("open phenotype page")?n("button",{staticClass:"option-button",on:{click:function(n){return t.openPage("phenotype.html",{phenotype:e.id})}}},[t._v(" Go to phenotype page ")]):t._e()]:t._e(),null!=t.options&&0==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"pheWasInfoBox")?n("span",[t._v("Click for options")]):t._e(),n("br")],2)}))],2),t.hasMultipleYAxisFields?n("div",{staticClass:"y-axis-fields-selector"},[t._l(t.yAxisFields,(function(e){return n("label",{key:e,staticClass:"y-axis-field-checkbox"},[n("input",{attrs:{type:"checkbox"},domProps:{value:e,checked:t.selectedYAxisFields.includes(e)},on:{change:function(n){return t.toggleYAxisField(e)}}}),n("span",[n("span",{staticClass:"shape-symbol"},[t._v(t._s(t.getFieldShapeLabel(e)))]),t._v(" "+t._s(t.getFieldDisplayLabel(e)))])])})),t.renderConfig.thresholds&&t.renderConfig.thresholds.length>0?n("label",{staticClass:"y-axis-field-checkbox threshold-filter-checkbox"},[n("input",{attrs:{type:"checkbox"},domProps:{checked:t.filterByThreshold},on:{change:function(e){t.filterByThreshold=!t.filterByThreshold}}}),n("span",[t._v("Show only above threshold")])]):t._e(),t.availableGroups.length>0?n("div",{staticClass:"phenotype-group-filter-inline"},[n("div",{staticClass:"dropdown-wrapper"},[n("button",{staticClass:"btn btn-sm btn-secondary dropdown-toggle",attrs:{type:"button"},on:{click:function(e){e.stopPropagation(),t.showGroupDropdown=!t.showGroupDropdown}}},[t._v(" Filter by Groups ("+t._s(t.selectedGroups.length)+"/"+t._s(t.availableGroups.length)+") "),n("b-icon",{attrs:{icon:"chevron-down"}})],1),t.showGroupDropdown?n("div",{staticClass:"group-dropdown-menu",on:{click:function(t){t.stopPropagation()}}},[n("div",{staticClass:"group-dropdown-header"},[n("label",{staticClass:"select-all-groups"},[n("input",{attrs:{type:"checkbox"},domProps:{checked:t.selectedGroups.length===t.availableGroups.length},on:{change:t.toggleAllGroups}}),n("span",[t._v("Select All")])])]),n("div",{staticClass:"group-dropdown-content"},t._l(t.availableGroups,(function(e){return n("label",{key:e,staticClass:"group-checkbox-item"},[n("input",{attrs:{type:"checkbox"},domProps:{value:e,checked:t.selectedGroups.includes(e)},on:{change:function(n){return t.toggleGroup(e)}}}),n("span",[t._v(t._s(e))])])})),0)]):t._e()])]):t._e()],2):t._e(),n("canvas",{attrs:{hidden:!t.showCanvas,id:t.canvasId+"pheWasPlot",width:"",height:""},on:{mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){!t.utils.uiUtils.isIdFixed("#"+t.canvasId+"pheWasInfoBox")&&t.utils.uiUtils.removeOnMouseOut(t.canvasId+"pheWasInfoBox",1e3)}}}),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.canvasId,t.canvasId+"_pheWasPlot","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage(t.canvasId+"pheWasPlot",t.canvasId+"_pheWasPlot","png")}}},[t._v("Download PNG")])])])]),t.renderData?n("research-phewas-plot-vector",{ref:t.canvasId+"_pheWasPlot",attrs:{renderData:t.groupData(t.renderData),renderConfig:t.renderConfig,phenotypeMap:t.phenotypeMap,colors:t.colors,margin:t.adjPlotMargin,sectionId:t.canvasId,utils:t.utils}}):t._e()],1)])])},a=[],i=n("b11e"),o=i["a"],s=(n("22ee"),n("2877")),l=Object(s["a"])(o,r,a,!1,null,null,null);e["a"]=l.exports},7089:function(t,e,n){"use strict";n("eba1")},"70db":function(t,e,n){},"712d":function(t,e,n){"use strict";n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0");var r=n("53ca"),a=n("1da1"),i=(n("99af"),n("dca8"),n("d3b7"),n("2ca0"),n("e60d")),o=n("98ab"),s=n("2ef0");function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;
vendor: 7,123 bytes, line 1
1return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}e["a"]=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.host,c={namespaced:!0,limit:null,state:function(){return{id:Object.freeze(t.toLowerCase()),data:[],count:0,restricted:0,profile:{},progress:null,error:null}},getters:{data:function(t){return t.data},percentComplete:function(t){return t.progress?Math.min(t.progress.bytes_read/t.progress.bytes_total,1):null}},mutations:{clearData:function(t){t.data=[],t.restricted=0,t.count=0,t.error=null},updateCount:function(t,e){t.count+=e.count,t.restricted+=e.restricted},setResponse:function(t,e){t.data=e.data,t.profile=e.profile,t.error=null},setProgress:function(t,e){t.progress=e},setError:function(t,e){t.error=e}},actions:{clear:function(t){return Object(a["a"])(l().mark((function e(){return l().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.commit("clearData");case 1:case"end":return e.stop()}}),e)})))()},query:function(e,n){return Object(a["a"])(l().mark((function a(){var s,c,u,d,h,p,f;return l().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(s=n.q,c=n.limit,u=n.limitWhile,d=n.append,d||e.commit("clearData"),h={fetch:0,query:0},!s){a.next=12;break}if(p=Object(o["e"])("Loading ".concat(t,"; please wait ...")),"variant"!==t||!s.startsWith("rs")){a.next=8;break}return a.next=8,fetch("".concat(r||i["a"],"/api/bio/varIdLookup/").concat(s)).then((function(t){return t.json()})).then((function(t){s=t.data.varid}));case 8:return a.next=10,Object(i["f"])(t,s,{limit:c||e.state.limit,limitWhile:u,host:r,onResolve:function(t){h.fetch+=t.profile.fetch||0,h.query+=t.profile.query||0,e.commit("updateCount",t),e.commit("setProgress",t.progress)},onError:function(t){Object(o["d"])(t.detail),e.commit("setError",t.detail)}}).finally((function(){return Object(o["a"])(p)}
1));case 10:f=a.sent,e.commit("setResponse",{data:f,profile:h});case 12:case"end":return a.stop()}}),a)})))()}}};return Object(s["merge"])(c,e||{})}},7413:function(t,e,n){"use strict";n("8d9b")},7644:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.filterList&&t.filterList.length>0?n("span",{staticClass:"filter-pill-collection center"},[t._v(" "+t._s(t.header)+" "),t._l(t.filterList,(function(e,r){return n("b-badge",{key:e.field+e.predicate+e.threshold+r,class:"btn filter-pill-"+e.field,style:{"background-color":e.color?e.color+" !important":""},attrs:{pill:""},on:{click:function(n){t.clearable&&t.$emit("unset",e)}}},[t._v(" "+t._s(e.label?"function"===typeof e.label?e.label(e):new String(e.label):e.field+" = "+e.threshold)+" "),t.clearable?n("span",{staticClass:"remove"},[t._v("X")]):t._e()])}))],2):t._e()},a=[],i=n("2b0e"),o=i["default"].component("criterion-pills",{props:{header:String,filterList:Array,clearable:{type:Boolean,default:!1}}}),s=o,l=n("2877"),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},"76a9":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("criterion-group-template",{ref:Math.floor(1e4*Math.random()).toString(),attrs:{value:t.value,hide:t.hide,filterType:"function",looseMatch:!0,header:t.header,noPills:t.noPills,inlinePills:t.inlinePills,inclusive:t.inclusive,filterList:t.filterList,filterFunction:t.filterFunction},on:{input:t.emitInput,"update:filter-function":t.emitFilterFunction,"update:filter-list":t.emitFilterList},scopedSlots:t._u([{key:"filtered",fn:function(e){var n=e.filter;return[t._t("filtered",null,{filter:n})]}}],null,!0)},[t._t("default")],2)},a=[],i=n("2b0e"),o=n("e861"),s=i["default"].component("criterion-function-group",{props:{value:{type:Function,default:function(t){return!0}},filterList:{type:Array},filterFunction:{type:Function},header:String,hide:Boolean,noPills:Boolean,inlinePills:Boolean,inclusive:{type:Boolean}},components:{CriterionGroupTemplate:o["a"]},methods:{emitInput:function(t){this.$emit("input",t)},emitFilterList:function(t){this.$emit("update:filter-list",t)},emitFilterFunction:function(t){this.$emit("update:filter-function",t)}}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},"77eb":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"col-md-12 page-description-content",domProps:{innerHTML:t._s(t.pageContent)}})},a=[],i=n("3835"),o=(n("d81d"),n("4fad"),n("b64b"),n("ac1f"),n("5319"),n("a573"),n("2b0e")),s=o["default"].component("research-page-description",{props:["content","utils"],components:{},data:function(){return{plotData:[],plotMargin:{left:100,right:20,top:20,bottom:60,bump:10}}},mounted:function(){this.renderPlots()},computed:{pageContent:function(t){if(t&&""!=t){var e=this.content.replace(/<plot>/g,"<div class='plot'>").replace(/<plot-end>/g,"</div>");return e}return""}},methods:{renderPlots:function(){for(var t=this,e=document.querySelectorAll("div.plot"),n=0;n<e.length;++n)if(!document.querySelector("canvas#plot"+n)){var r=e[n].innerHTML.replace(/<p>/g,"").replace(/<\/p>/g,"").replace(/<br>/g,"");this.plotData[n]=JSON.parse(r);var a=this.plotData[n]["label space"]?this.plotData[n]["label space"]:0,i="<canvas id='plot"+n+"' width='"+2*this.plotData[n].width+"' height='"+2*(this.plotData[n].height+a)+"' style='width:"+this.plotData[n].width+"px;height:"+(this.plotData[n].height+a)+"px;'></canvas>";e[n].innerHTML=i,e[n].setAttribute("style","")}this.plotData.map((function(t,e){t["x label angle"]||(t["x label angle"]=null),t["y label angle"]||(t["y label angle"]=null)})),this.plotData.map((function(e,n){var r,a;switch(r=document.getElementById("plot"+n),a=r.getContext("2d"),e.type){case"bar":t.renderBarPlot(a,e.data,2*e.width,2*e.height,e.color,e["x label angle"],e["y label angle"]);break;case"pie":t.renderPiePlot(a,e.data,2*e.width,2*e.height,e.color);break;case"line":t.renderLinePlot(a,e.data,2*e.width,2*e.height,e["x label angle"],e["y label angle"],e["data labels on top"]);break}}
1))},renderBarPlot:function(t,e,n,r,a,o,s){for(var l=this.plotMargin,c=20,u={high:null,low:null},d=0,h=Object.entries(e);d<h.length;d++){var p=Object(i["a"])(h[d],2),f=(p[0],p[1]);null==u.high&&(u.high=f),null==u.low&&(u.low=f),u.high=f>u.high?f:u.high,u.low=f<u.low?f:u.low}var _=.2*u.high;u.high=Math.ceil(u.high+_),Math.floor(u.low)>=0&&Math.floor(u.low-_)<0?u.low=0:u.low=Math.floor(u.low-_),this.utils.plotUtils.renderAxis(t,n,r,l,"y",5,u.low,u.high),this.utils.plotUtils.renderGuideLine(t,n,r,l,"y",5,u.low,u.high),this.utils.plotUtils.renderAxis(t,n,r,l,"x",null),this.utils.plotUtils.renderTicksByKeys(t,n,r,l,"x",Object.keys(e),c,o),this.utils.plotUtils.renderBars(t,n,r,l,"x",5,e,u.low,u.high,c,a)},renderPiePlot:function(t,e,n,r,a){this.utils.plotUtils.renderPie(t,e,n,r,a)},renderLinePlot:function(t,e,n,r,a,o,s){for(var l=this.plotMargin,c={high:null,low:null},u=0,d=Object.entries(e);u<d.length;u++)for(var h=Object(i["a"])(d[u],2),p=(h[0],h[1]),f=0,_=Object.entries(p);f<_.length;f++){var g=Object(i["a"])(_[f],2),m=(g[0],g[1]);null==c.high&&(c.high=m),null==c.low&&(c.low=m),c.high=m>c.high?m:c.high,c.low=m<c.low?m:c.low}var v=.2*c.high;c.high=Math.ceil(c.high+v),Math.floor(c.low)>=0&&Math.floor(c.low-v)<0?c.low=0:c.low=Math.floor(c.low-v),this.utils.plotUtils.renderAxis(t,n,r,l,"y",5,c.low,c.high,2),this.utils.plotUtils.renderAxis(t,n,r,l,"x",null);var y=Object.keys(e[Object.keys(e)[0]]);this.utils.plotUtils.renderTicksByKeys(t,n,r,l,"x",y,0,a),this.utils.plotUtils.renderGuideLine(t,n,r,l,"y",5,c.low,c.high),this.utils.plotUtils.renderLine(t,n,r,l,"x",5,e,c.low,c.high,s)}},watch:{pageContent:function(){this.renderPlots()}}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},7927:function(t,e,n){"use strict";n("e360")},"7af8":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("filter-control-template",{staticClass:"filter-col-sm",attrs:{field:t.field,type:"number",predicate:t.predicate,pillFormatter:t.pillFormatter,computedField:t.computedField,multiple:!1,color:t.color,placeholder:t.placeholder}},[t._t("default")],2)},a=[],i=(n("99af"),n("2b0e")),o=n("27d5"),s=n("529c"),l=i["default"].component("filter-pvalue-control",{props:{field:String,placeholder:String,computedField:Function,color:{type:String,default:"#dc3545"},pillFormatter:{type:Function,default:function(t){return"".concat(t.field," <= ").concat(t.labelFormatter?s["a"].pValueFormatter(t.threshold):t.threshold)}},predicate:{type:Function,default:function(t,e){return t<=e}}},components:{FilterControlTemplate:o["a"]}}),c=l,u=n("2877"),d=Object(u["a"])(c,r,a,!1,null,null,null);e["a"]=d.exports},"7b60":function(t,e,n){"use strict";n("2225")},"7b68":function(t,e,n){"use strict";n("5780")},"7c4d":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{attrs:{id:t.pkgID}}),n("div",{attrs:{id:"viewers_collection"}},[1==t.pkgConfig.viewers.includes("region plot")?n("research-region-plot",{attrs:{plotData:t.$store.state.filteredData,renderConfig:t.pkgConfig["region viewer"],dataComparisonConfig:t.dataComparisonConfig,region:t.$store.state.searchingRegion,plotMargin:t.plotMargin,compareGroupColors:t.colors.moderate,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,sharedPlotXpos:t.sharedPlotXpos,pkgData:t.pkgData,pkgDataSelected:t.pkgDataSelected,utils:t.utils}}):t._e(),1==t.pkgConfig.viewers.includes("genes plot")&&null!=t.$store.state.codingGenesData?n("research-genes-track",{attrs:{region:t.$store.state.searchingRegion,genesData:t.$store.state.codingGenesData,plotConfig:t.pkgConfig["region viewer"],plotType:"region plot",plotMargin:t.plotMargin,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,utils:t.utils}}):t._e(),1==t.pkgConfig.viewers.includes("credible sets plot")?n("div",{staticClass:"section-opener",attrs:{id:"credibleSetSectionOpener"},on:{click:function(e){return t.showHideSection(e,"credibleSetSection","Show credible sets filter","credibleSetSectionOpener","Hide filter")}}},[t._v(" Hide filter ")]):t._e(),1==t.pkgConfig.viewers.includes("credible sets plot")?n("giant-credible-sets-plot",{staticClass:"svg-wrapper",attrs:{id:"credibleSetSection",region:t.$store.state.searchingRegion,phenotype:t.$store.state.searchingPhenotype,plotMargin:t.plotMargin,compareGroupColors:t.colors.bold,renderConfig:t.pkg
1Config["credible sets viewer"],dataComparison:this.$store.state.dataComparison,pkgData:t.$store.state.pkgData,pkgDataSelected:t.pkgDataSelected,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,utils:t.utils}}):t._e(),1==t.pkgConfig.viewers.includes("annotations plot")||1==t.pkgConfig.viewers.includes("annotations plot v2")?n("div",{staticClass:"section-opener",attrs:{id:"annotationSectionOpener"},on:{click:function(e){return t.showHideSection(e,"annotationSection","Show annotations filter","annotationSectionOpener","Hide filter")}}},[t._v(" Hide filter ")]):t._e(),1==t.pkgConfig.viewers.includes("annotations plot")?n("research-annotations-plot",{ref:"annotationsRef",staticClass:"svg-wrapper",attrs:{id:"annotationSection",region:t.$store.state.searchingRegion,phenotype:t.$store.state.searchingPhenotype,renderConfig:t.pkgConfig["annotations viewer"],plotMargin:t.plotMargin,compareGroupColors:t.colors.bold,dataComparison:this.$store.state.dataComparison,plotData:t.$store.state.filteredData,pkgData:t.pkgData,pkgDataSelected:t.pkgDataSelected,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,sharedPlotXpos:t.sharedPlotXpos,utils:t.utils}}):t._e(),1==t.pkgConfig.viewers.includes("annotations plot v2")?n("research-annotations-plot-v2",{ref:"annotationsRef",staticClass:"svg-wrapper",attrs:{id:"annotationSection",region:t.$store.state.searchingRegion,phenotype:t.$store.state.searchingPhenotype,ancestry:t.$store.state.searchingAncestry,renderConfig:t.pkgConfig["annotations viewer"],plotMargin:t.plotMargin,compareGroupColors:t.colors.bold,dataComparison:this.$store.state.dataComparison,plotData:t.$store.state.filteredData,pkgData:t.pkgData,pkgDataSelected:t.pkgDataSelected,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,sharedPlotXpos:t.sharedPlotXpos,searchParameters:this.$store.state.searchParameters,searchParametersArr:this.$store.state.searchParametersArr,utils:t.utils}}):t._e(),1==t.pkgConfig.viewers.includes("biosamples plot")&&this.$store.state.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0&&this.$store.state.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).length>0?n("div",{staticClass:"section-opener",attrs:{id:"biosamplesSectionOpener"},on:{click:function(e){return t.showHideSection(e,"biosamplesSection","Show biosamples filter","biosamplesSectionOpener","Hide filter")}}},[t._v(" Hide filter ")]):t._e(),1==t.pkgConfig.viewers.includes("biosamples plot")?n("research-biosamples-plot",{ref:"biosamplesRef",staticClass:"svg-wrapper",attrs:{id:"biosamplesSection",region:t.$store.state.searchingRegion,phenotype:t.$store.state.searchingPhenotype,renderConfig:t.pkgConfig["biosamples viewer"],plotMargin:t.plotMargin,compareGroupColors:t.colors.bold,searchType:this.$store.state.dataComparison,plotData:t.$store.state.filteredData,pkgData:t.pkgData,pkgDataSelected:this.$store.state.pkgDataSelected,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,sharedPlotXpos:t.sharedPlotXpos,utils:t.utils}}):t._e(),1==t.pkgConfig.viewers.includes("gene-links plot")?n("div",{staticClass:"section-opener",attrs:{id:"geneLinksSectionOpener"},on:{click:function(e){return t.showHideSection(e,"geneLinksSection","Show gene-links filter","geneLinksSectionOpener","Hide filter")}}},[t._v(" Hide filter ")]):t._e(),1==t.pkgConfig.viewers.includes("gene-links plot")?n("research-gene-links-plot",{staticClass:"svg-wrapper",attrs:{id:"geneLinksSection",region:t.$store.state.searchingRegion,phenotype:t.$store.state.searchingPhenotype,plotMargin:t.plotMargin,methodsColors:t.colors.bold,renderConfig:t.pkgConfig["gene-links viewer"],dataComparison:this.$store.state.dataComparison,plotData:t.$store.state.filteredData,pkgData:t.pkgData,pkgDataSelected:t.pkgDataSelected,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,utils:t.utils}}):t._e()],1)])},a=[],i=(n("d81d"),n("a573"),n("2b0e")),o=n("b1e0"),s=n("8534"),l=n("1396"),c=n("6645"),u=n("2521"),d=n("3cd7"),h=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12 CS-plot-wrapper"},[n("div",{staticClass:"col-md-12"},[n("div",{attrs:{id:"CSUIWrapper"}},[t._m(0),n("div",{staticClass:"filtering-ui-wrapper add-content",staticStyle:{width:"100%",padding:"0 10px","text-align":"left"}},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col",staticStyle:{padding:"2px"}},[n("div",{staticClass:"label",staticStyle:{display:"inline-block","margin-right":"8px"}},[t._v(" Select Credible Sets ")]),n("select",{staticClass:"custom-select",on:{change:function(e){return t.getCS(e)}}},[n("option",{attrs:{value:""}},[t._v(" "+t._s("Select credible set")+" ")]),t._l(t.credibleSets,(function(e){return n("option",{key:e.credibleSetId+","+e.phenotype,domProps:{value:e.credibleSetId+","+e.phenotype,innerHTML:t._s("KP BioIndex"==t.renderConfig["credible sets server"]?e.credibleSetId+" (Method:"+e.method+", PMID:"+e.pmid+")":e.credibleSetId+"("+e.phenotype+", "+e.dataset+")")}})}))],2)])]),n("div",{staticStyle:{position:"absolute",right:"10px",top:"7px"}},[t._l(t.credibleSets,(function(e){return[t.pkgDataSelected.filter((function(t){return"Credible Set"==t.type})).map((function(t){return t.id})).indexOf(e.credibleSetId)>-1?n("span",{key:e.credibleSetId+", "+e.phenotype,staticClass:"CS-bubble",style:"background-color:"+t.getColorIndex(e.credibleSetId+", "+e.phenotype)+";",attrs:{id:t.getBubbleId(e.credibleSetId,e.phenotype)},domProps:{innerHTML:t._s(e.credibleSetId+", "+e.phenotype+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeCSData(e.credibleSetId,e.phenotype)}}}):t._e()]}))],2)])])]),n("div",{staticClass:"col-md-9",staticStyle:{display:"inline-block"},attrs:{id:"CSPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"CSInfoBox"}},[n("div",{staticClass:"fixed-info-box-close",on:{click:function(e){return t.showHidePanel("#CSInfoBox","closeBtn")}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}}
vendor: 4,592 bytes, line 1
1)],1),n("div",{staticClass:"info-box-content",attrs:{id:"CSInfoBoxContent"}})]),n("canvas",{class:Object.keys(t.CSData).length>0?"CS-plot":"CS-empty-plot",attrs:{id:"CSPlot",width:"",height:""},on:{mousemove:function(e){return t.checkCSPosition(e)},mouseout:function(e){return t.onMouseOut("CSInfoBox")},click:function(e){return t.showHidePanel("#CSInfoBox")}}}),0!=t.pkgDataSelected.filter((function(t){return"Credible Set"==t.type})).map((function(t){return t.id})).length&&0==t.credibleSets.length?n("div",{attrs:{id:"CSInitialMessage"},domProps:{innerHTML:t._s("There is no available credible set.")}}):t._e()]),n("div",{staticClass:"col-md-3",staticStyle:{display:"inline-block"}})])])},p=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",[n("strong",[t._v("Filter associated variants by credible set membership to view the set(s) of fine-mapped variants most likely to include the causal variant for this locus.")])])}],f=n("53ca"),_=n("1da1"),g=n("3835"),m=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("cb29"),n("4de4"),n("caad"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("4fad"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("00b4"),n("2532"),n("3ca3"),n("5319"),n("841c"),n("0643"),n("2382"),n("4e3e"),n("159b"),n("ddb0"),n("1157")),v=n.n(m),y=n("72bf"),b=n.n(y);function x(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */x=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var h="suspendedStart",p="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var w={};c(w,o,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,o)&&(w=P);var k=b.prototype=v.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,i,o,s){var l=d(t[a],t,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Object(f["a"])(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function D(e,n,r){var a=h;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===h)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=d(e,n,r);if("normal"===c.type){if(a=r.done?g:p,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[o];if(n)return n.call(e);
vendor: 3,730 bytes, line 1
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(f["a"])(e)+" is not iterable")}return y.prototype=b,a(k,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),c(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),c(k,l,"Generator"),c(k,o,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}i["default"].use(o["a"]);var w=i["default"].component("giant-credible-sets-plot",{props:["region","phenotype","renderConfig","compareGroupColors","plotMargin","dataComparison","pkgData","pkgDataSelected","regionZoom","regionViewArea","utils"],data:function(){return{credibleSets:[],CSData:{},CSPosData:{}
1,spaceBy:14,test:null,searchingAncestry:null,searchingPhenotype:null,searchingRegion:null,urlSearch:window.location.search}},modules:{},components:{},mounted:function(){var t=this;window.addEventListener("resize",this.onResize),this.checkAllPropertiesReady(),window.addEventListener("popstate",this.updateUrlSearch);var e=history.pushState,n=history.replaceState,r=this;history.pushState=function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];e.apply(history,n),Promise.resolve().then((function(){r.updateUrlSearch()}))},history.replaceState=function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];n.apply(history,e),Promise.resolve().then((function(){r.updateUrlSearch()}))},this.originalPushState=e,this.originalReplaceState=n,this.urlCheckInterval=setInterval((function(){var e=window.location.search;e!==t.urlSearch&&(t.urlSearch=e)}),100),this.renderCSPlot()},beforeDestroy:function(){window.removeEventListener("resize",this.onResize),window.removeEventListener("popstate",this.updateUrlSearch),this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState),this.urlCheckInterval&&clearInterval(this.urlCheckInterval)},computed:{viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t}},watch:{urlSearch:function(){var t=this;Promise.resolve().then((function(){t.checkAllPropertiesReady()}))},pkgDataSelected:{handler:function(t){0==t.length?this.resetAll():this.renderCSPlot()},deep:!0,immediate:!0},viewingRegion:{handler:function(t,e){this.renderCSPlot()},deep:!0,immediate:!0}},methods:{updateUrlSearch:function(){this.urlSearch=window.location.search},getSearchingRegion:function(){if(null!=this.region){var t={},e=this.region.split(":");return t["chr"]=e[0],t["start"]=e[1].split("-")[0],t["end"]=e[1].split("-")[1],t}var n=b.a.parse(window.location.search,{parseNumbers:!0,parseBooleans:!0}),r=this.renderConfig&&this.renderConfig["region parameter"]?this.renderConfig["region parameter"]:"region",a=n[r]||null;if(!a&&this.utils&&this.utils.keyParams&&this.renderConfig&&this.renderConfig["region parameter"]&&(a=this.utils.keyParams[this.renderConfig["region parameter"]]||null),null!=this.phenotype&&a){var i={},o=a.split(":");return i["chr"]=o[0],i["start"]=o[1].split("-")[0],i["end"]=o[1].split("-")[1],i}return null},getSearchingPhenotype:function(){var t=null;if(null!=this.phenotype&&(t=this.phenotype),null==this.phenotype){var e=b.a.parse(window.location.search,{parseNumbers:!0,parseBooleans:!0}),n=this.renderConfig&&this.renderConfig["phenotype parameter"]?this.renderConfig["phenotype parameter"]:"phenotype";t=e[n]||null,!t&&this.utils&&this.utils.keyParams&&this.renderConfig&&this.renderConfig["phenotype parameter"]&&(t=this.utils.keyParams[this.renderConfig["phenotype parameter"]]||null)}return null!=t&&this.renderConfig&&this.renderConfig["phenotype match"]&&this.renderConfig["phenotype match"][t]&&(t=this.renderConfig["phenotype match"][t]),t},getSearchingAncestry:function(){var t=null,e=b.a.parse(window.location.search,{parseNumbers:!0,parseBooleans:!0}),n=this.renderConfig&&this.renderConfig["ancestry parameter"]?this.renderConfig["ancestry parameter"]:"ancestry";return t=e[n]||null,!t&&this.utils&&this.utils.keyParams&&this.renderConfig&&this.renderConfig["ancestry parameter"]&&(t=this.utils.keyParams[this.renderConfig["ancestry parameter"]]||null),null!=t&&this.renderConfig&&this.renderConfig["ancestry match"]&&this.renderConfig["ancestry match"][t]&&(t=this.renderConfig["ancestry match"][t]),t},checkAllPropertiesReady:function(){var t=this.getSearchingRegion(),e=this.getSearchingPhenotype(),n=this.getSearchingAncestry(),r=this.renderConfig["ancestry parameter"];
1this.renderConfig["region parameter"],this.renderConfig["phenotype parameter"];null!==r&&null!==t&&null!==e&&null!==n&&this.getCredibleSetsList(t,e,n),null==r&&null!==t&&null!==e&&this.getCredibleSetsList(t,e,null)},resetAll:function(){this.CSData={},this.CSPosData={},this.test=null,this.renderCSPlot()},checkStared:function(t){var e=this,n=this.pkgDataSelected.filter((function(t){return t.type==e.renderConfig["star key"]})).map((function(t){return t.id}));return!!n.includes(t)},addStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"add"})},removeStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"remove"})},showHidePanel:function(t,e){for(var n=document.querySelector(t),r=event,a=r.target.getBoundingClientRect(),i=Math.floor(r.clientX-a.left),o=Math.floor(r.clientY-a.top),s=null,l=-5;l<=5;l++)for(var c=-5;c<=5;c++)void 0!=this.CSPosData[o+l]&&void 0!=this.CSPosData[o+l][i+c]&&(s=!0);1!=s&&"closeBtn"!=e||(n.classList.contains("fixed")?n.classList.remove("fixed"):n.classList.add("fixed"))},onMouseOut:function(t){this.utils.uiUtils.removeOnMouseOut(t,1e3)},onResize:function(t){this.renderCSPlot()},getColorIndex:function(t){var e=this.credibleSets.map((function(t){return t.credibleSetId+", "+t.phenotype})),n=e.indexOf(t);return this.compareGroupColors[n]},getBubbleId:function(t,e){var n=t+e;return n=n.replace(/[^a-zA-Z0-9 ]/g,""),n},removeCSData:function(t,e){var n=t+e;n=n.replace(/[^a-zA-Z0-9 ]/g,"");var r=document.getElementById(n);r.classList.add("hidden"),delete this.CSData[e][t],0==Object.keys(this.CSData[e]).length&&delete this.CSData[e],null!=this.pkgData&&(delete this.pkgData.CSData[e][t],0==Object.keys(this.pkgData.CSData[e]).length&&delete this.pkgData.CSData[e]),this.$store.dispatch("pkgDataSelected",{type:"Credible Set",id:t,action:"remove"})},checkCSPosition:function(t){var e=this,n=t,r=n.target.getBoundingClientRect(),a=Math.floor(n.clientX-r.left),i=Math.floor(n.clientY-r.top),o=document.querySelector("#CSInfoBox"),s=document.querySelector("#CSInfoBoxContent");if(!o.classList.contains("fixed")){for(var l="",c=-5;c<=5;c++)for(var u=-5;u<=5;u++)if(void 0!=this.CSPosData[i+c]&&void 0!=this.CSPosData[i+c][a+u])for(var d=function(){var t=Object(g["a"])(p[h],2),n=t[0],r=t[1];l+="<strong>"+n+"</strong>",e.renderConfig["star key"]&&(l+=1==e.checkStared(r)?" <span style='color:#ffcc00'>★</span>":" <span style='color:#ffcc00'>☆</span>"),l+="<br />",e.renderConfig["hover content"].map((function(t){l+="<span>"+t+": <span>"+r[t]+"<br />"})),null!=e.pkgData&&e.pkgData.selectedTissues&&e.pkgData.selectedTissues.length>0&&e.pkgData.selectedTissues.map((function(t){for(var n=0,a="",i={start:null,end:null},o=function(){var o=Object(g["a"])(c[s],2),l=o[0],u=o[1];u.region.map((function(o){r.position>=o.start&&r.position<=o.end&&(i.start=null==i.start||i.start<o.start?o.start:i.start,i.end=null==i.end||i.end>o.end?o.end:i.end,n=1,a+="<span class='spacer-1'></span>"+l+"<br /><span class='spacer-2'></span>Region: "+o.start+"-"+o.end+e.getGregor(t,l,r.phenotype)+"<br />")}))},s=0,c=Object.entries(e.pkgData.tissuesData[t]);s<c.length;s++)o();1==n&&(a=a.substring(0,a.length-2),a="<span><strong>"+t+":</strong> <br />"+a+"</span><span class='spacer-1'></span>Overlapping Region <br /><span class='spacer-2'></span>Start: "+i.start+"<br /><span class='spacer-2'></span>End: "+i.end+"<br />",l+=a)})),l+="<br />"},h=0,p=Object.entries(this.CSPosData[i+c][a+u]);h<p.length;h++)d();if(""!=l){var f="";l=f+"<strong>Click to fix info panel</strong><br /><br />"+l,s.innerHTML=l,o.classList.remove("hidden"),a<.75*r.width?(o.style.width="auto",o.style.left=a+25+"px",o.style.top=i+this.spaceBy+"px"):(o.style.width="200px",o.style.left=a-215+"px",o.style.top=i+this.spaceBy+"px")}else o.classList.add("hidden")}},getGregor:function(t,e,n){var r=this.utils.Formatters.pValueFormatter(this.pkgData.GEByTissueData[n][t][e].pValue),a=this.utils.Formatters.pValueFormatter(this.pkgData.GEByTissueData[n][t][e].fold),i="<br /><span class='spacer-2'></span>Fold: "+a+"<br /><span class='spacer-2'></span>P-Value: "+r;return i},renderCSPlot:function(){var t=this,e=this.pkgDataSelected.filter((function(t){return"Credible Set"==t.type})).map((function(t){return t.id}));this.CSPosData={};var n=this.viewingRegion.start,r=this.viewingRegion.end,a=document.querySelector("#CSPlot"),i=document.querySelector("#CSPlotWrapper");if(a&&i){var o,s,l=100,c=2*this.spaceBy,u=7*this.spaceBy,d=this.plotMargin.bump,h=2*i.clientWidth,p=this.plotMargin.topMargin,f=h-30-2*this.plotMargin.leftMargin,_=l,m=f/(r-n),v=_/1,y=Object.keys(this.CSData).length;if(p+=c*y+l*y+u*y,a.setAttribute("width",h),a.setAttribute("height",p),a.setAttribute("style","margin-left: -15px; width:"+h/2+"px;
1height:"+p/2+"px;"),o=a,s=o.getContext("2d"),s.clearRect(0,0,h,p),e.length>0){var b=this.plotMargin.topMargin;if(Object.keys(this.CSData).length>0)for(var x=function(){var e=Object(g["a"])(C[w],2),a=e[0],i=e[1];s.font="24px Arial",s.textAlign="left",s.fillStyle="#000000",s.fillText(a,d,b+t.spaceBy),b+=c,t.renderAxis(s,f,_,r,n,b,d);for(var o=function(){var e=Object(g["a"])(p[h],2),i=(e[0],e[1]),o=0;i.map((function(e){if(e.position>=n&&e.position<=r){var i=(e[t.renderConfig["x axis field"]]-n)*m+t.plotMargin.leftMargin,l=b+_-e[[t.renderConfig["y axis field"]]]*v,c=e.credibleSetId+", "+e.phenotype,u=t.getColorIndex(c);1==t.checkStared(e[t.renderConfig["star key"]])?t.utils.plotUtils.renderStar(s,i,l,5,10,6,u,u):t.renderDot(s,i,l,u),t.CSPosData[Math.round(l/2)]||(t.CSPosData[Math.round(l/2)]={}),t.CSPosData[Math.round(l/2)][Math.round(i/2)]||(t.CSPosData[Math.round(l/2)][Math.round(i/2)]={});var d={};d["phenotype"]=a,d["position"]=e[t.renderConfig["x axis field"]],t.renderConfig["hover content"].map((function(t){d[t]=e[t]})),t.CSPosData[Math.round(l/2)][Math.round(i/2)][e[t.renderConfig["render by"]]]=d,o++}})),0==o&&(s.font="28px Arial",s.textAlign="center",s.fillStyle="#000000",s.fillText("No credible variant in the region for "+a,t.plotMargin.leftMargin+f/2,b+_/2))},h=0,p=Object.entries(i);h<p.length;h++)o();b+=l+u},w=0,C=Object.entries(this.CSData);w<C.length;w++)x()}}},checkIfInRegion:function(t){var e=this,n=!1;if(this.pkgData.selectedTissues&&this.pkgData.selectedTissues.length>0){var r=0,a=this.pkgData.selectedTissues.length;this.pkgData.selectedTissues.map((function(n){var a=0;e.pkgData.selectedAnnos.map((function(r){e.pkgData.tissuesData[n]&&e.pkgData.tissuesData[n][r]&&e.pkgData.tissuesData[n][r].region.map((function(e){t>=e.start&&t<=e.end&&a++}))})),a>0&&r++})),r==a&&(n=!0)}else n=!0;return n},renderDot:function(t,e,n,r){t.fillStyle=r,t.lineWidth=0,t.beginPath(),t.arc(e,n,8,0,2*Math.PI),t.fill()},renderAxis:function(t,e,n,r,a,i,o){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]),t.moveTo(this.plotMargin.leftMargin-o,i),t.lineTo(this.plotMargin.leftMargin-o,i+n+o),t.stroke();var s=Math.round(this.plotMargin.leftMargin+e+o);t.moveTo(s,i),t.lineTo(s,i+n+o),t.stroke(),t.moveTo(this.plotMargin.leftMargin-2*o,i),t.lineTo(this.plotMargin.leftMargin-o,i),t.stroke(),t.moveTo(this.plotMargin.leftMargin-2*o,i+n),t.lineTo(this.plotMargin.leftMargin-o,i+n),t.stroke(),t.textAlign="right",t.font="24px Arial",t.fillStyle="#000000",t.fillText("1",this.plotMargin.leftMargin-3*o,i+o),t.fillText("0",this.plotMargin.leftMargin-3*o,i+n+o),t.moveTo(this.plotMargin.leftMargin-o,i+n+o),t.lineTo(s,i+n+o),t.stroke();for(var l=Math.ceil((r-a)/5),c=e/5,u=0;u<6;u++){var d=this.plotMargin.leftMargin+u*c,h=Math.floor(d);t.moveTo(h,i+n+o),t.lineTo(h,i+n+2*o),t.stroke(),t.textAlign="center";var p=u<5?Number(a)+u*l:r;p=p>=1e5?Math.round(.001*p)+"k":p,t.font="24px Arial",t.fillStyle="#000000",t.fillText(p,h,i+n+4*o)}t.textAlign="center",t.rotate(-2*Math.PI/4),t.fillText("PPA",-(i+n/2),this.plotMargin.leftMargin-5*o),t.rotate(-2*Math.PI/4*3)},getCS:function(t){var e=this;return Object(_["a"])(x().mark((function n(){var r,a,i,o,s,l,c,u,d,h;return x().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(""==t.target.value){n.next=14;break}return r=t.target.value.split(","),a=r[0],i=r[1],o="KP BioIndex"==e.renderConfig["credible sets server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["credible sets server"],s=e.renderConfig["credible variants index"]?e.renderConfig["credible variants index"]:"credible-variants",l=e.renderConfig["ancestry wild card"]?e.renderConfig["ancestry wild card"]:null,c=e.getSearchingAncestry(),u=e.renderConfig["ancestry parameter"]&&"*"!=c&&c!=l?i+","+c+","+a:i+","+a,d=o+"/query/"+s+"?q="+u,n.next=12,fetch(d).then((function(t){return t.json()}));case 12:h=n.sent,null==h.error&&(e.CSData[i]||(e.CSData[i]={}),e.CSData[i][a]=e.renderConfig["data convert"]?e.utils.dataConvert.convertData(e.renderConfig["data convert"],h.data):h.data,e.pkgData&&e.pkgData.CSData&&(e.pkgData.CSData[i]||(e.pkgData.CSData[i]={}),e.pkgData.CSData[i][a]=h.data,e.$store.dispatch("pkgDataSelected",{type:"Credible Set",id:a,action:"add"})),t.target.value.replace(/[^a-zA-Z0-9 ]/g,""));case 14:case"end":return n.stop()}}),n)})))()},getCredibleSetsList:function(t,e,n){var r=this;return Object(_["a"])(x().mark((function a(){var i,o,s,l,c;return x().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return i=r.renderConfig["ancestry wild card"]?r.renderConfig["ancestry wild card"]:null,o="https://giant.hugeampkpnbi.org/api/bio/query/credible-sets?q=",s=null!=n&&"*"!=n&&n!=i?e+","+n+","+t.chr+":"+t.start+"-"+t.end:e+","+t.chr+":"+t.start+"-"+t.end,l=o+s,a.next=6,fetch(l).then((function(t){return t.json()}));case 6:c=a.sent,null==c.error&&("newSearch"==r.dataComparison&&(r.credibleSets=[],r.CSData={},null==r.pkgData||r.pkgData.CSData||(r.pkgData["CSData"]={})),c.data.map((function(t){t.credibleSetId.includes("bottom-line")||r.credibleSets.push(t)})));case 8:case"end":return a.stop()}}),a)})))()}}});v()((function(){}));var C=w,P=(n("e1d2"),n("2877")),k=Object(P["a"])(C,h,p,!1,null,null,null),M=k.exports,E=n("b463");i["default"].use(o["a"]);var D=i["default"].component("giant-gem-pkg",{props:["pkgConfig","dataComparisonConfig","plotMargin","colors","pkgData","pkgDataSelected","regionZoom","regionViewArea","
1sharedPlotXpos","utils"],data:function(){return{}},modules:{},components:{ResearchRegionPlot:s["a"],ResearchGenesTrack:l["a"],ResearchBiosamplePlot:c["a"],ResearchAnnotationsPlot:u["a"],ResearchAnnotationsPlotV2:d["a"],GiantCredibleSets:M,ResearchGeneLinks:E["a"]},mounted:function(){var t=this;if(null!=this.pkgConfig){document.getElementById(this.pkgConfig.pkgID);this.pkgConfig.viewers.map((function(e){document.getElementById(t.pkgConfig.pkgID+"_"+e)}))}},beforeDestroy:function(){},computed:{pkgID:function(){return null==this.pkgConfig?null:this.pkgConfig.pkgID}},watch:{},methods:{showHideSection:function(t,e,n,r,a){var i=document.getElementById(r);i.classList.contains("open")?(i.classList.remove("open"),t.target.innerText=a):(i.classList.add("open"),t.target.innerText=n),this.utils.uiUtils.showHideSvg(e)}}}),O=D,L=(n("af7f"),Object(P["a"])(O,r,a,!1,null,null,null));e["a"]=L.exports},"7c5b":function(t,e,n){"use strict";n("ca4a")},"7d61":function(t,e,n){},"80ca":function(t,e,n){"use strict";n("63a0")},8119:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("select",{directives:[{name:"model",rawName:"v-model",value:t.traitGroup,expression:"traitGroup"}],staticClass:"form-control",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.traitGroup=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"all"}},[t._v("All")]),t.cvdi?t._e():n("option",{attrs:{value:"all_but_hpo"}},[t._v("All but HPO")]),t.cvdi?t._e():n("option",{attrs:{value:"all_complex"}},[t._v("Complex traits")]),t._l(t.groups,(function(e){return n("option",{domProps:{value:e[0]}},[t._v(" "+t._s(e[1])+" ")])}))],2)},a=[],i=(n("d81d"),n("b64b"),n("a573"),n("2b0e")),o=n("5f5b"),s=n("b1e0"),l=n("fd66"),c=n("e60d"),u=n("0571");n("f9e3"),n("2dd8");i["default"].use(o["a"]),i["default"].use(s["b"]);var d=i["default"].component("trait-group-selectpicker",{props:{cvdi:{type:Boolean,default:!1}},data:function(){return{traitGroup:l["a"].traitGroup}},computed:{keyParamsTraitGroup:function(){return l["a"].traitGroup},groups:function(){var t=this.cvdi?u["d"].TRAIT_GROUPS:c["d"].TRAIT_GROUPS,e=Object.keys(t).map((function(e){return[e,t[e]]}));return e}},watch:{traitGroup:function(t){this.$store.state.traitGroupToQuery=t,this.$emit("onTraitGroupChange",t)},keyParamsTraitGroup:function(t){null===this.size&&(this.size=t)}}}),h=d,p=n("2877"),f=Object(p["a"])(h,r,a,!1,null,null,null);e["a"]=f.exports},"812e":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.rows>0?n("div",[n("div",{staticClass:"table-total-rows",domProps:{innerHTML:t._s("Total rows: "+t.rows)}}),n("div",{staticClass:"text-right mb-2"},[n("data-download",{attrs:{data:t.items,filename:"mouse_summary_"+t.pageParam}})],1)]):t._e(),n("b-table",{attrs:{small:"",items:t.filteredData,fields:t.fields,"sort-by":t.isGenePage?"tissue":"gene","per-page":t.perPage,"current-page":t.currentPage,"sort-compare":t.sortRows},scopedSlots:t._u([{key:"cell(tissue)",fn:function(e){return[n("a",{attrs:{href:"/mouse_diff_exp.html?gene="+e.item.gene+"&tissue="+e.item.tissue}},[t._v(" "+t._s(e.item.tissue)+" ")])]}},{key:"cell(gene)",fn:function(e){return[n("a",{attrs:{href:"/mouse_diff_exp.html?gene="+e.item.gene+"&tissue="+e.item.tissue}},[t._v(" "+t._s(e.item.gene)+" ")])]}},{key:"cell(gene_id)",fn:function(e){return[n("a",{attrs:{href:"https://useast.ensembl.org/Mus_musculus/Gene/Summary?db=core;g="+e.item.gene_id}},[t._v(" "+t._s(e.item.gene_id)+" ")])]}},{key:"cell(gene_region)",fn:function(e){return[t._v(" "+t._s(e.item.chromosome+":"+e.item.start+"-"+e.item.end)+" ")]}}])}),n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.rows,"per-page":t.perPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1)},a=[],i=(n("99af"),n("4de4"),n("4ec9"),n("b64b"),n("d3b7"),n("6062"),n("0643"),n("2382"),n("0eb6"),n("b7ef"),n("8bd4"),n("ad1f"),n("2b0e")),o=n("f529"),s=i["default"].component("MouseSummaryTable",{components:{DataDownload:o["a"]},props:["items","isGenePage","filter"],data:function(){return{perPage:10,currentPage:1,commonFields:[{key:"P_adj_sex",label:"Adjusted p-value: sex",sortable:!0},{key:"P_adj_strain",label:"Adjusted p-value: strain",sortable:!0},{key:"P_adj_strain_sex",label:"Adjusted p-value: strain and sex",sortable:!0}],tissueOnlyFields:[{key:"gene",label:"Gene",sortable:!0},{key:"gene_id",label:"Gene ID",sortable:!0},{key:"gene_region",label:"Gene region",sortable:!0}],geneOnlyFields:[{key:"tissue",label:"Tissue",sortable:!0}]}},computed:{fields:function(){var t=this.isGenePage?this.geneOnlyFields:this.tissueOnlyFields;return t.concat(this.commonFields)},pageParam:function(){var t,e=this.isGenePage?"gene":"tissue";return(null===(t=this.items[0])||void 0===t?void 0:t[e])||""},filteredData:function(){var t=structuredClone(this.items);return this.filter&&(t=t.filter(this.filter)),t},rows:function(){return this.filteredData.length}},methods:{sortRows:function(t,e,n){var r=t[n],a=e[n];return"gene_region"===n?this.compareRegions(t,e):"number"===typeof r&&"number"===typeof a?r<a?-1:r>a?1:0:String(r).localeCompare(String(a))},compareRegions:function(t,e){var n=t.chromosome,r=e.chromosome,a=n.localeCompare(r,void 0,{numeric:!0});if(0!==a)return a;var i=t.start,o=e.start;return i<o?-1:i>o?1:0}}}),l=s,c=(n("f1d1"),n("2877")),u=Object(c["a"])(l,r,a,!1,null,"b4491b4e",null);e["a"]=u.exports},8135:function(t,e,n){"use strict";n("2623")},8160:function(t,e,n){"use strict";n("ffb8")},"81a9":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},a=[],i=n("2909"),o=n("3835"),s=(n("99af"),n("d81d"),n("13d5"),n("4fad"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("3ca3"),n("5319"),n("5b81"),n("0643"),n("a573"),n("9d4a"),n("ddb0"),n("2b0e")),l=n("1157"),c=n.n(l),u=n("5698"),d=(n("2ef0"),n("b1e0"));s["default"].use(d["a"]);var h=s["default"].component("research-box-plot-vector",{props:["renderData","renderConfig","colors","margin","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{canvasId:function(t){}}
1,methods:{renderPlot:function(){for(var t=".vector-wrapper-".concat(this.canvasId),e=("vector_wrapper_".concat(this.sectionId),document.querySelector("#"+this.sectionId+"boxPlotWrapper")),n={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},r=this.renderConfig["width"]?this.renderConfig["width"]:e.clientWidth-(n.left+n.right),a=this.renderConfig["height"]?this.renderConfig["height"]-(n.top+n.bottom):150,s=u["select"](t).append("svg").attr("id","vector_box_plot_"+this.sectionId).attr("width",r+n.left+n.right).attr("height",a+n.top+n.bottom).append("g").attr("transform","translate("+n.left+","+n.top+")"),l=[],c=0,d=Object.entries(this.renderData);c<d.length;c++){var h=Object(o["a"])(d[c],2),p=(h[0],h[1]);l=l.concat(p)}var f=this.renderConfig["y axis field"].max,_=this.renderConfig["y axis field"].min,g=this.renderConfig["y axis field"].median,m=this.renderConfig["y axis field"].q1,v=this.renderConfig["y axis field"].q3,y=this.renderConfig["group by"],b=this.renderConfig["render by"],x=Object(i["a"])(new Set(l.map((function(t){return t[f]})))),w=Object(i["a"])(new Set(l.map((function(t){return t[_]})))),C=Object(i["a"])(new Set(l.map((function(t){return t[y]})))),P=this.colors,k=Math.ceil(x.reduce((function(t,e){return t>e?t:e}))),M=Math.floor(w.reduce((function(t,e){return t<e?t:e}))),E=u["nest"]().key((function(t){return t[b]})).rollup((function(t){var e=t[0],n=e[v]-e[m];return{q1:e[m],median:e[g],q3:e[v],interQuantileRange:n,min:e[_],max:e[f],name:e[b],group:e[y]}})).entries(l);s.append("text").attr("x",r/2).attr("y",a+n.top-12).style("font-family","Arial").style("font-size",12).style("text-anchor","middle").text(this.renderConfig["x axis label"]),s.append("text").attr("transform",(function(t){return"translate("+(20-n.left)+","+a/2+")rotate(-90)"})).attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",12).style("text-anchor","middle").text(this.renderConfig["y axis label"]);var D=u["scaleBand"]().range([0,r]).domain(E.map((function(t){return t.key}))).paddingInner(1).paddingOuter(.5),O=u["scaleLinear"]().domain([M,k]).range([a,0]);s.append("g").call(u["axisLeft"](O)),s.append("g").attr("transform","translate(0,"+a+")").call(u["axisBottom"](D).tickFormat((function(){return""})));var L="";s.selectAll("groupText").data(E).enter().append("text").attr("transform",(function(t){return"translate("+(D(t.key)-6)+","+(O(0)+12)+")rotate(45)"})).attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",11).style("fill",(function(t){var e=C.indexOf(t.value.group)%P.length,n=P[e];return n})).text((function(t){return""==L?(L=t.value.group,t.value.group):t.value.group==L?(L=t.value.group,""):t.value.group!=L?(L=t.value.group,t.value.group):void 0})),s.selectAll("vertLines").data(E).enter().append("line").attr("x1",(function(t){return D(t.key)})).attr("x2",(function(t){return D(t.key)})).attr("y1",(function(t){return O(t.value.min)})).attr("y2",(function(t){return O(t.value.max)})).attr("stroke",(function(t){var e=C.indexOf(t.value.group)%P.length,n=P[e];return n})).style("stroke-width",1),s.selectAll("labelLines").data(E).enter().append("line").attr("x1",(function(t){return D(t.key)})).attr("x2",(function(t){return D(t.key)})).attr("y1",(function(t){return O(t.value.max)-3})).attr("y2",(function(t){return O(t.value.max)-8})).attr("stroke",(function(t){var e="#999999";return e})).style("stroke-width",1),s.selectAll("labelText").data(E).enter().append("text").attr("transform",(function(t){return"translate("+(D(t.key)+3)+","+(O(t.value.max)-11)+")rotate(-90)"})).attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",11).text((function(t){return t.key}));var j=(r-(n.left+n.right))/E.length-20;j=j<=10?10:j>=40?40:j,s.selectAll("boxes").data(E).enter().append("rect").attr("x",(function(t){return D(t.key)-j/2})).attr("y",(function(t){return O(t.value.q3)})).attr("height",(function(t){return O(t.value.q1)-O(t.value.q3)})).attr("width",j).attr("stroke",(function(t){var e=C.indexOf(t.value.group)%P.length,n=P[e];return n})).style("fill","#ffffff"),s.selectAll("medianLines").data(E).enter().append("line").attr("x1",(function(t){return D(t.key)-j/2})).attr("x2",(function(t){return D(t.key)+j/2})).attr("y1",(function(t){return O(t.value.median)})).attr("y2",(function(t){return O(t.value.median)})).attr("stroke",(function(t){var e=C.indexOf(t.value.group)%P.length,n=P[e];return n})).style("stroke-width",2)}}});c()((function(){}));var p=h,f=n("2877"),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},"821b":function(t,e,n){},"82e0":function(t,e,n){},8534:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row",attrs:{id:"rp_region_plot"}},[t.plotsList.length>1?n("div",{staticClass:"show-hide-plots col-md-12"},[n("strong",[t._v("Show/hide region plots")]),t._l(t.plotsList,(function(e,r){return["Combined"!=e?n("span",{key:e,staticClass:"group-bubble",style:"background-color:"+t.compareGroupColors[r]+";",domProps:{innerHTML:t._s(e)},on:{click:function(n){t.utils.uiUtils.showHideElement("plotsWrapper"+e.replaceAll(" ","_"))}}}):t._e(),"Combined"==e?n("span",{staticClass:"group-bubble reference",staticStyle:{"background-color":"#ffffff",border:"solid 1px #666666"},attrs:{type:"button"},on:{click:function(e){return t.utils.uiUtils.showHideElement("plotsWrapperCombined")}}},[t._v(" Combined ")]):t._e()]}))],2):t._e(),n("div",{staticClass:"fixed-info-box hidden",attrs:{id:"fixedInfoBox"}},[n("div",{staticClass:"fixed-info-box-close",on:{click:function(e){return t.showHidePanel("#fixedInfoBox")}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}}
1)],1),n("div",{staticClass:"fixed-info-box-content"},t._l(t.dotsClicked,(function(e,r){return n("div",[n("div",[n("strong",{domProps:{innerHTML:t._s(e)}}),t.renderConfig["star key"]&&1==t.checkStared(e)?n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer","margin-left":"4px"},attrs:{icon:"star-fill"},on:{click:function(n){return t.removeStarItem(e)}}}):t._e(),t.renderConfig["star key"]&&0==t.checkStared(e)?n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer","margin-left":"4px"},attrs:{icon:"star"},on:{click:function(n){return t.addStarItem(e)}}}):t._e()],1),n("div",[n("strong",{domProps:{innerHTML:t._s("Set this LD reference for: ")}}),t._l(t.plotsList,(function(r,a){return["Combined"!=r&&t.assoData[r].data[e]?n("strong",{staticClass:"group-bubble",style:"background-color:"+t.compareGroupColors[a]+";",domProps:{innerHTML:t._s(r)},on:{click:function(n){return t.resetLdReference(r,e)}}}):t._e(),"Combined"==r?n("strong",{staticClass:"group-bubble",staticStyle:{"background-color":"#dddddd"},domProps:{innerHTML:t._s("All")},on:{click:function(n){return t.resetLdReference("All",e)}}}):t._e()]}))],2),t._l(t.plotsList,(function(r,a){return"Combined"!=r&&t.assoData[r].data[e]?n("div",t._l(t.renderConfig["hover content"],(function(a,i){return n("div",[n("span",{domProps:{innerHTML:t._s(a+"("+r+"):"+t.assoData[r].data[e][a])}})])})),0):t._e()}))],2)})),0)]),t.renderConfig.legend?n("div",{staticClass:"mbm-plot-legend col-md-12",domProps:{innerHTML:t._s(t.renderConfig.legend)}}):t._e(),t._l(t.plotsList,(function(e,r){return n("div",{staticClass:"col-md-12 region-plots-wrapper",attrs:{id:"plotsWrapper"+e.replaceAll(" ","_")}},[n("div",{staticClass:"col-md-9 region-plot-default-legend"},["Combined"!=e?n("div",[n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#824099cc"}}),n("span",[t._v("Reference variant")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#d0363360"}}),n("span",[t._v("1 > r2 >= 0.8")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#ee982d50"}}),n("span",[t._v("0.8 > r2 >= 0.6")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#4db05240"}}),n("span",[t._v("0.6 > r2 >= 0.4")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#32afd530"}}),n("span",[t._v("0.4 > r2 >= 0.2")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#2074b620"}}),n("span",[t._v("0.2 > r2 > 0")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#33333320"}}),n("span",[t._v("No data")])]):t._e()]),n("div",{staticClass:"col-md-9 asso-plots-wrapper"},[n("div",{attrs:{id:"assoPlotsWrapper"+e.replaceAll(" ","_")+t.sectionId}},["default"!=e?n("h6",{class:"text color-"+r,domProps:{innerHTML:t._s(e)}}):t._e(),n("canvas",{staticClass:"asso-plot",attrs:{id:"asso_plot_"+e.replaceAll(" ","_")+t.sectionId,width:"",height:""},on:{resize:t.onResize,click:function(n){return t.checkPosition(n,e,"asso","click")},mousemove:function(n){return t.checkPosition(n,e,"asso","move")},mouseout:function(n){return t.onMouseOut("assoInfoBox"+e+t.sectionId)}}}),n("div",{staticClass:"asso-info-box hidden",attrs:{id:"assoInfoBox"+e.replaceAll(" ","_")+t.sectionId}})])]),n("div",{staticClass:"col-md-3 ld-plots-wrapper reference-area",attrs:{id:"ldPlotsWrapper"+e.replaceAll(" ","_")+t.sectionId}},[n("h6",{class:"text color-"+r,domProps:{innerHTML:t._s("default"!=e?e+" <small>*Showing only with LD</small>":" <small>*Showing only with LD</small>")}}),n("canvas",{staticClass:"ld-plot",attrs:{id:"ld_plot_"+e.replaceAll(" ","_")+t.sectionId,width:"",height:""},on:{resize:t.onResize,click:function(n){return t.checkPosition(n,e,"LD","click")},mousemove:function(n){return t.checkPosition(n,e,"LD","move")},mouseout:function(n){return t.onMouseOut("ldInfoBox"+e+t.sectionId)}}}),n("div",{staticClass:"ld-info-box hidden",attrs:{id:"ldInfoBox"+e.replaceAll(" ","_")+t.sectionId}})])])}))],2)},a=[],i=n("53ca"),o=n("1da1"),s=n("2909"),l=n("3835"),c=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("cb29"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("4fad"),n("b64b"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("5319"),n("5b81"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),u=n("1157"),d=n.n(u),h=n("b1e0");function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 5,580 bytes, line 1
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}c["default"].use(h["a"]);var f=c["default"].component("research-region-plot",{props:["plotData","renderConfig","dataComparisonConfig","regi
1on","plotMargin","compareGroupColors","regionZoom","regionViewArea","pkgData","pkgDataSelected","isSectionPage","sectionId","utils","starItems"],data:function(){return{plotRenderBy:"all",ldColor:["#2074B620","#32AFD520","#4DB05220","#EE982D20","#D0363320"],ldDotColor:["#2074B650","#32AFD550","#4DB05250","#EE982D50","#D0363350","#824099cc"],assoData:{},ldData:{},recombData:"",assoPos:{},ldPos:{},dotsClicked:[],refProperties:{region:null,refVariants:{},groups:[]},fixedRefVariants:{}}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{pageLevelLD:function(){return this.$store.state.topLevelLDData},adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},staredVariants:function(){var t=this;if(this.renderConfig["star key"]&&!this.isSectionPage){var e="";return this.pkgDataSelected.filter((function(e){return e.type==t.renderConfig["star key"]})).map((function(t){e+=t.id})),e}return null},plotsList:function(){var t=this;if(this.refProperties.region&&this.refProperties.region==this.region||(this.refProperties={region:this.region,refVariants:{},groups:[]},!0),null!=this.plotData){var e=this.plotData,n=[];if(null!=this.dataComparisonConfig){for(var r=this.dataComparisonConfig["fields to compare"][0],a=0,i=Object.entries(e);a<i.length;a++)for(var o=Object(l["a"])(i[a],2),c=(o[0],o[1]),u=0,d=Object.entries(c[r]);u<d.length;u++){var h=Object(l["a"])(d[u],2),p=h[0];h[1];n.push(p)}n=Object(s["a"])(new Set(n)),n.length>1&&n.push("Combined")}else null==this.dataComparisonConfig&&n.push("default");this.assoData={},this.ldData={},this.recombData="",this.assoPos={},this.ldPos={};var f=this.renderConfig["y axis field"],_=this.renderConfig["ld server"]["populations type"];return n.map((function(n){if(t.assoData[n]={yAxHigh:null,yAxLow:null,data:{}},t.ldData[n]){var r=t.refProperties.refVariants[n];e[r]||(t.ldData[n]={refVariant:null,population:[],data:null},t.refProperties.refVariants[n]=null)}else t.ldData[n]={refVariant:null,population:[],data:null};if("Combined"!=n&&(t.assoPos[n]={},t.ldPos[n]={}),"default"!=n)for(var a=0,i=Object.entries(e);a<i.length;a++){var o=Object(l["a"])(i[a],2),c=o[0],u=o[1];if("Combined"!=n){var d=u[f][n];if(d){if("fixed"==_)t.ldData[n].population=t.renderConfig["ld server"]["fixed population"];else if("dynamic"==_){var h=u[t.renderConfig["ld server"]["populations field"]][n];t.ldData[n].population.push(h)}t.refProperties.refVariants[n]?t.ldData[n].refVariant=t.refProperties.refVariants[n]:t.ldData[n].refVariant=null==t.assoData[n].yAxHigh||d>t.assoData[n].yAxHigh?c:t.ldData[n].refVariant,t.assoData[n].yAxHigh=null==t.assoData[n].yAxHigh||d>t.assoData[n].yAxHigh?Math.ceil(d):t.assoData[n].yAxHigh,t.assoData[n].yAxLow=null==t.assoData[n].yAxLow||d<t.assoData[n].yAxLow?Math.floor(d):t.assoData[n].yAxLow,t.assoData[n].data[c]={};for(var p=0,g=Object.entries(u);p<g.length;p++){var m=Object(l["a"])(g[p],2),v=m[0],y=m[1];null!=t.dataComparisonConfig?t.assoData[n].data[c][v]=1==t.dataComparisonConfig["fields to compare"].includes(v)?y[n]:y:null==t.dataComparisonConfig&&(t.assoData[n].data[c][v]=y)}}}}else if("default"==n){var b=null;e.map((function(e){var r=e[f];if(r){if("fixed"==_)t.ldData[n].population=t.renderConfig["ld server"]["fixed population"];else if("dynamic"==_){var a=e[t.renderConfig["ld server"]["populations field"]];t.ldData[n].population.push(a)}var i=e[t.renderConfig["render by"]];b=null==t.assoData[n].yAxHigh||r>t.assoData[n].yAxHigh?i:b,t.assoData[n].yAxHigh=null==t.assoData[n].yAxHigh?Math.ceil(r):r>t.assoData[n].yAxHigh?r:Math.ceil(t.assoData[n].yAxHigh),t.assoData[n].yAxLow=null==t.assoData[n].yAxLow?Math.floor(r):r<t.assoData[n].yAxLow?r:Math.floor(t.assoData[n].yAxLow),t.assoData[n].data[i]={};for(var o=0,s=Object.entries(e);o<s.length;o++){var c=Object(l["a"])(s[o],2),u=c[0],d=c[1];null!=t.dataComparisonConfig?t.assoData[n].data[i][u]=1==t.dataComparisonConfig["fields to compare"].includes(u)?d[n]:d:null==t.dataComparisonConfig&&(t.assoData[n].data[i][u]=d)}}})),t.fixedRefVariants[n]&&t.assoData[n].data[t.fixedRefVariants[n]]?t.ldData[n].refVariant=t.fixedRefVariants[n]:t.ldData[n].refVariant=b}var x=Object(s["a"])(new Set(t.ldData[n].population));t.ldData[n].population=x.length>1?"ALL":t.renderConfig["ld server"].populations[x[0]]})),1==n.includes("Combined")&&n.map((function(e){var n=t.assoData[e].yAxHigh,r=t.assoData[e].yAxLow;t.assoData.Combined.yAxHigh=null==t.assoData.Combined.yAxHigh||n>t.assoData.Combined.yAxHigh?Math.ceil(n):t.assoData.Combined.yAxHigh,t.assoData.Combined.yAxLow=null==t.assoData.Combined.yAxLow||r<t.assoData.Combined.yAxLow?Math.floor(r):t.assoData.Combined.yAxLow})),this.setUpWrappers(),n}return null},searchingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=parseInt(e[0],10),r=parseInt(e[1],10),a=r-n;if(this.regionZoom>0){var i=Math.round(a*(this.regionZoom/200)),o=Math.round(i*(this.regionViewArea/100));t["start"]=n+i+o,t["end"]=r-i+o}else 0==this.regionZoom&&(t["start"]=n,t["end"]=r);return t}},watch:{staredVariants:function(t){this.renderPlots()},starItems:function(t){this.renderPlots()}},methods:{onResize:function(t){this.renderPlots()},getColumns:function(t){var e,n=this;if(null!=this.dataComparisonConfig)for(var r=0,a=Object.entries(this.plotData);r<a.length;r++){var i=Object(l["a"])(a[r],2),o=(i[0],i[1]);o[this.renderConfig["star key"]]==t&&(e=o)}else e=this.plotData.filter((function(e){return e[n.renderConfig["star key"]]==t}))[0];return e},checkStared:function(t){var e,n=this;return e=this.isSectionPage?this.starItems.filter((function(t){return t.type==n.renderConfig["star key"]})).map((function(t){return t.id})):this.pkgDataSelected.filter((function(t){return t.type==n.renderConfig["star key"]})).map((function(t){return t.id})),!!e.includes(t)},addStarItem:function(t){if(this.isSectionPage){var e=Object(s["a"])(new Set(this.starItems)),n={type:this.renderConfig["star key"],id:t,columns:this.getColumns(t)};e.push(n),this.$emit("on-star",e)}
1else this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"add"})},removeStarItem:function(t){if(this.isSectionPage){var e=Object(s["a"])(new Set(this.starItems)).filter((function(e){return e.id!=t}));this.$emit("on-star",e)}else this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"remove"})},resetLdReference:function(t,e){var n=this;this.showHidePanel("#fixedInfoBox"),"All"!=t?(this.ldData[t].refVariant=e,this.fixedRefVariants[t]=e,this.ldData[t].data=null,this.refProperties.refVariants[t]=e):"All"==t&&this.plotsList.map((function(t){"combined"!=t&&(n.ldData[t].refVariant=e,n.fixedRefVariants[t]=e,n.ldData[t].data=null,n.refProperties.refVariants[t]=e)})),this.callForLDData()},showHidePanel:function(t){var e=document.querySelector(t);e.classList.contains("hidden")?e.classList.remove("hidden"):e.classList.add("hidden")},showHideSplitPlots:function(){this.plotsList.map((function(t){if("Combined"!=t){var e=document.querySelector("#plotsWrapper"+t.replaceAll(" ","_"));e.classList.contains("hidden")?e.classList.remove("hidden"):e.classList.add("hidden")}}))},getDotsOnPosition:function(t,e,n,r){for(var a="asso"==t?this.assoPos[e]:this.ldPos[e],i=[],o=-5;o<=5;o++)for(var s=-5;s<=5;s++)void 0!=a[n+o]&&void 0!=a[n+o][r+s]&&(i=i.concat(a[n+o][r+s]));return i},checkPosition:function(t,e,n,r){var a=this,i=t,o=i.target.getBoundingClientRect(),l=Math.floor(i.clientX-o.left),c=Math.floor(i.clientY-o.top),u=(i.clientX,this.getDotsOnPosition(n,e,l,c));u=Object(s["a"])(new Set(u));var d="asso"==n?"#assoInfoBox"+e.replaceAll(" ","_")+this.sectionId:"#ldInfoBox"+e.replaceAll(" ","_")+this.sectionId,h="asso"==n?"#asso_plot_"+e.replaceAll(" ","_")+this.sectionId:"#ld_plot_"+e.replaceAll(" ","_")+this.sectionId,p=document.querySelector(d),f=document.querySelector(h);if(p.style.top=c+f.offsetTop+"px",p.style.left=l+f.offsetLeft+150>f.width?l+f.offsetLeft+-215+"px":l+f.offsetLeft+15+"px",p.style.width=l+f.offsetLeft+150>f.width?"200px":"auto",u.length>0)if("move"==r){var _=u.length>5?"<span class='info-box-direction'>Viewing 5 of "+u.length+" variants. Click to view full list or to change LD reference variant.</span><br />":"<span class='info-box-direction'>Click to change LD reference variant.</span><br />";u.map((function(t,n){n<5&&(_+="<strong>"+t+"</strong>",a.renderConfig["star key"]&&(_+=1==a.checkStared(t)?" <span style='color:#ffcc00'>★</span>":" <span style='color:#ffcc00'>☆</span>"),_+="<br />",a.renderConfig["hover content"].map((function(n){"Combined"!=e?_+=n+": "+a.assoData[e].data[t][n]+"<br />":"Combined"==e&&a.plotsList.map((function(e){"Combined"!=e&&a.assoData[e].data[t]&&(_+=n+"("+e+"): "+a.assoData[e].data[t][n]+"<br />")}))})))})),p.classList.remove("hidden"),p.innerHTML=_}else"click"==r&&(this.dotsClicked=u,this.showHidePanel("#fixedInfoBox"));else p.classList.add("hidden")},onMouseOut:function(t){this.utils.uiUtils.removeOnMouseOut(t.replaceAll(" ","_"),1e3)},setUpWrappers:function(){this.searchingRegion&&this.callForRecombData()},callForRecombData:function(){var t=this;return Object(o["a"])(p().mark((function e(){var n,r;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.renderConfig["genome reference"]&&"GRCh38"==t.renderConfig["genome reference"]?n="https://portaldev.sph.umich.edu/api/v1/annotation/recomb/results/?build=GRCh38&filter=chromosome eq '"+t.searchingRegion.chr+"' and position gt "+t.searchingRegion.start+" and position lt "+t.searchingRegion.end:(!t.renderConfig["genome reference"]||t.renderConfig["genome reference"]&&"GRCh37"==t.renderConfig["genome reference"])&&(n="https://portaldev.sph.umich.edu/api/v1/annotation/recomb/results/?filter=id in 15 and chromosome eq '"+t.searchingRegion.chr+"' and position gt "+t.searchingRegion.start+" and position lt "+t.searchingRegion.end),e.next=3,fetch(n).then((function(t){return t.json()}));case 3:r=e.sent,t.recombData={},null==r.error&&(t.recombData["position"]=r.data.position,t.recombData["recomb_rate"]=r.data.recomb_rate,t.callForLDData());case 6:case"end":return e.stop()}}),e)})))()},callForLDData:function(){var t=this;return Object(o["a"])(p().mark((function e(){var n,r,a,i,o,s,l,c;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:n=document.querySelectorAll(".region-plots-wrapper"),n.forEac
1h((function(t){t.classList.remove("hidden")})),r=null,a=0;case 4:if(!(a<t.plotsList.length)){e.next=11;break}if("Combined"==t.plotsList[a]||null!=t.ldData[t.plotsList[a]].data){e.next=8;break}return r=t.plotsList[a],e.abrupt("break",11);case 8:a++,e.next=4;break;case 11:if(null==r){e.next=19;break}return i="https://portaldev.sph.umich.edu/ld/genome_builds/GRCh37/references/1000G/populations/"+t.ldData[r].population+"/variants?correlation=rsquare&variant="+t.ldData[r].refVariant+"&chrom="+t.searchingRegion.chr+"&start="+t.searchingRegion.start+"&stop="+t.searchingRegion.end+"&limit=100000",e.next=15,fetch(i).then((function(t){return t.json()}));case 15:o=e.sent,null==o.error&&(s={},o.data.variant2.map((function(t,e){s[t]=o.data.correlation[e]})),t.ldData[r].data=s,t.callForLDData()),e.next=30;break;case 19:l=p().mark((function e(){var n;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("Combined"==t.plotsList[c]){e.next=4;break}return n=t.plotsList[c],Object.keys(t.plotData).map((function(e){t.plotData[e]["LDS"]=t.plotData[e]["LDS"]?t.plotData[e]["LDS"]:{},t.plotData[e]["LDS"][n]=t.ldData[n].data[e]})),e.abrupt("return",1);case 4:case"end":return e.stop()}}),e)})),c=0;case 21:if(!(c<t.plotsList.length)){e.next=28;break}return e.delegateYield(l(),"t0",23);case 23:if(!e.t0){e.next=25;break}return e.abrupt("break",28);case 25:c++,e.next=21;break;case 28:t.isSectionPage||t.$store.dispatch("filteredData",t.plotData),t.renderPlots();case 30:t.$forceUpdate();case 31:case"end":return e.stop()}}),e)})))()},renderPlots:function(t){var e=this,n=this.searchingRegion.start,r=this.searchingRegion.end,a=.75*document.querySelector("#rp_region_plot").clientWidth*2-60,i=.25*document.querySelector("#rp_region_plot").clientWidth*2-60,o=this.renderConfig.height?2*this.renderConfig.height+this.adjPlotMargin.top+this.adjPlotMargin.bottom:600+this.adjPlotMargin.top+this.adjPlotMargin.bottom,s=a-2*this.adjPlotMargin.left,l=i-this.adjPlotMargin.left-this.adjPlotMargin.right,c=this.renderConfig.height?2*this.renderConfig.height:600,u=this.adjPlotMargin.bump;this.plotsList.map((function(t){var d,h;d=document.getElementById("asso_plot_"+t.replaceAll(" ","_")+e.sectionId),d.setAttribute("width",a),d.setAttribute("height",o),d.setAttribute("style","width:"+a/2+"px;height:"+o/2+"px;"),h=d.getContext("2d"),h.clearRect(0,0,a,o),e.renderAxis(h,s,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,r,n,u,"asso",t),e.renderRecombLine(h,s,c,r,n),e.renderDots(h,s,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,r,n,u,"asso",t),d=document.getElementById("ld_plot_"+t.replaceAll(" ","_")+e.sectionId),d.setAttribute("width",i),d.setAttribute("height",o),d.setAttribute("style","width:"+i/2+"px;height:"+o/2+"px;"),h=d.getContext("2d"),h.clearRect(0,0,i,o),e.renderAxis(h,l,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,1,0,u,"LD",t),e.renderDots(h,l,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,1,0,u,"LD",t)}))},renderDots:function(t,e,n,r,a,i,o,s,c,u){var d=this,h=this.adjPlotMargin.left,p=this.adjPlotMargin.top+n,f=e/(i-o),_=n/(r-a);if("asso"==c){this.assoPos[u]={};var g=this.renderConfig["x axis field"],m=this.renderConfig["y axis field"];if(this.renderConfig["star key"]&&this.isSectionPage){var v=this.adjPlotMargin.top-3*this.adjPlotMargin.bump,y=this.adjPlotMargin.top+n+2*this.adjPlotMargin.bump;this.starItems.map((function(e){var n=h+(e.columns[d.renderConfig["x axis field"]]-o)*f;d.utils.plotUtils.renderDashedLine(t,n,v,n,y,3,"#FFAA0055",[6,2]),d.renderDot(t,n,y,"#FFAA0055",5)}))}if("Combined"!=u)for(var b=0,x=Object.entries(this.assoData[u].data);b<x.length;b++){var w=Object(l["a"])(x[b],2),C=w[0],P=w[1];if(P[g]>=o&&P[g]<=i){var k=h+(P[g]-o)*f,M=p-(P[m]-a)*_;this.feedPosData(this.assoPos[u],Math.round(k/2),Math.round(M/2),C);var E=this.getDotColor(this.ldData[u].data[C]);C==this.ldData[u].refVariant?this.renderConfig["star key"]&&1==this.checkStared(C)?this.utils.plotUtils.renderStar(t,k,M,5,10,6,E,E):this.renderDiamond(t,k,M,E):this.renderConfig["star key"]&&1==this.checkStared(C)?this.utils.plotUtils.renderStar(t,k,M,5,10,6,E,E):this.renderDot(t,k,M,E)}}if("Combined"==u){var D={};this.plotsList.map((function(e,n){if("Combined"!=e)for(var r=0,s=Object.entries(d.assoData[e].data);r<s.length;r++){var c=Object(l["a"])(s[r],2),v=c[0],y=c[1];if(y[g]>=o&&y[g]<=i){if(D[v])D[v]&&(D[v].xValue.push(y[g]),D[v].yValue.push(y[m]));else{var b={xValue:[],yValue:[]};b.xValue.push(y[g]),b.yValue.push(y[m]),D[v]=b}var x=h+(y[g]-o)*f,w=p-(y[m]-a)*_;d.feedPosData(d.assoPos[u],Math.round(x/2),Math.round(w/2),v);var C=d.compareGroupColors[n];v==d.ldData[e].refVariant?d.renderConfig["star key"]&&1==d.checkStared(v)?d.utils.plotUtils.renderStar(t,x,w,5,10,6,C,C):d.renderDiamond(t,x,w,C):d.renderConfig["star key"]&&1==d.checkStared(v)?d.utils.plotUtils.renderStar(t,x,w,5,10,6,C,C):d.renderDot(t,x,w,C)}}})),this.renderConntingLine(t,h,p,o,a,f,_,D)}}if("LD"==c){if(this.ldPos[u]={},"Combined"!=u)if(0==Object.keys(this.ldData[u].data).length)t.textAlign="center",t.fillStyle="#000000",t.fillText("No LD data loaded against "+this.ldData[u].refVariant,this.adjPlotMargin.left+e/2,this.adjPlotMargin.top+n/2);else for(var O=this.renderConfig["y axis field"],L=0,j=Object.entries(this.ldData[u].data);L<j.length;L++){var S=Object(l["a"])(j[L],2),A=S[0],I=S[1];if(this.assoData[u].data[A]){var T=h+I*f,B=p-(this.assoData[u].data[A][O]-a)*_;this.feedPosData(this.ldPos[u],Math.round(T/2),Math.round(B/2),A);var R=this.getDotColor(I);A==this.ldData[u].refVariant?this.renderConfig["star key"]&&1==this.checkStared(A)?this.utils.plotUtils.renderStar(t,T,B,5,10,6,R,R):this.renderDiamond(t,T,B,R):this.renderConfig["star key"]&&1==this.checkStared(A)?this.utils.plotUtils.renderStar(t,T,B,5,10,6,R,R):this.renderDot(t,T,B,R)}}if("Combined"==u){var F={},G=this.renderConfig["y axis field"];this.plotsList.map((function(e,n){if("Combined"!=e){var r=d.compareGroupColors[n];if(0!=Object.keys(d.ldData[e].data).length)for(var i=0,o=Object.entries(d.ldData[e].data);i<o.length;i++){var s=Object(l["a"])(o[i],2),c=s[0],g=s[1];if(d.assoData[e].data[c]){if(F[c])F[c]&&(F[c].xValue.push(g),F[c].yValue.push(d.assoData[e].data[c][G]));else{var m={xValue:[],yValue:[]};m.xValue.push(g),m.yValue.push(d.assoData[e].data[c][G]),F[c]=m}var v=h+g*f,y=p-(d.assoData[e].data[c][G]-a)*_;d.feedPosData(d.ldPos[u],Math.round(v/2),Math.round(y/2),c),c==d.ldData[e].refVariant?d.renderConfig["star key"]&&1==d.checkStared(c)?d.utils.plotUtils.renderStar(t,v,y,5,10,
16,r,r):d.renderDiamond(t,v,y,r):d.renderConfig["star key"]&&1==d.checkStared(c)?d.utils.plotUtils.renderStar(t,v,y,5,10,6,r,r):d.renderDot(t,v,y,r)}}}})),this.renderConntingLine(t,h,p,o,a,f,_,F)}}},feedPosData:function(t,e,n,r){var a=Math.floor(e),i=Math.floor(n);t[a]?(t[a][i]||(t[a][i]=[]),t[a][i].push(r)):(t[a]={},t[a][i]=[],t[a][i].push(r))},getDotColor:function(t){if(void 0==t)return"#00000030";var e=Math.floor(5*t);return this.ldDotColor[e]},renderConntingLine:function(t,e,n,r,a,i,o,s){for(var c=0,u=Object.entries(s);c<u.length;c++){var d=Object(l["a"])(u[c],2),h=(d[0],d[1]);if(h.xValue.length>1)for(var p=0;p<h.xValue.length-1;p++){var f=e+(h.xValue[p]-r)*i,_=e+(h.xValue[p+1]-r)*i,g=n-(h.yValue[p]-a)*o,m=n-(h.yValue[p+1]-a)*o;t.beginPath(),t.lineWidth=1,t.strokeStyle="#00000050",t.moveTo(f,g),t.lineTo(_,m),t.stroke()}}},renderDot:function(t,e,n,r,a){t.fillStyle=r,t.lineWidth=0,t.beginPath();var i=a||9;t.arc(e,n,i,0,2*Math.PI),t.fill()},renderDiamond:function(t,e,n,r){var a=18,i=24,o=e,s=n;t.save(),t.fillStyle=r,t.lineWidth=0,t.beginPath(),t.moveTo(o,s-i/2),t.lineTo(o-a/2,s),t.lineTo(o,s+i/2),t.lineTo(o+a/2,s),t.closePath(),t.strokeStyle="#824099",t.stroke(),t.fill(),t.restore()},renderRecombLine:function(t,e,n,r,a){var i=this,o=this.recombData,s=e/(r-a),l=n/100;t.beginPath(),t.lineWidth=1,t.strokeStyle="#007BFF",o&&o.position&&o.position.map((function(e,r){var c=(e-a)*s,u=o.recomb_rate[r]*l,d=(o.position[r+1]-a)*s,h=o.recomb_rate[r+1]*l;t.moveTo(i.adjPlotMargin.left+c,i.adjPlotMargin.top+n-u),t.lineTo(i.adjPlotMargin.left+d,i.adjPlotMargin.top+n-h),t.stroke()}))},renderAxis:function(t,e,n,r,a,i,o,s,l,c){var u=r-a,d=u<=1?2:u<=50?1:0,h=i-o,p=h<=1?2:h<=50?1:0;t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="24px Arial",t.fillStyle="#000000",t.setLineDash([]),t.moveTo(this.adjPlotMargin.left-s,this.adjPlotMargin.top),t.lineTo(this.adjPlotMargin.left-s,n+this.adjPlotMargin.top+s),t.stroke();var f=Math.round(this.adjPlotMargin.left+e+s);"asso"==l&&(t.moveTo(f,this.adjPlotMargin.top),t.lineTo(f,n+this.adjPlotMargin.top+s),t.stroke()),t.moveTo(this.adjPlotMargin.left-s,n+this.adjPlotMargin.top+s),t.lineTo("asso"==l?e+this.adjPlotMargin.left+s:e+this.adjPlotMargin.left,n+this.adjPlotMargin.top+s),t.stroke();for(var _=(r-a)/5,g=n/5,m=0;m<6;m++){var v=this.adjPlotMargin.top+m*g,y=Math.floor(v);t.moveTo(this.adjPlotMargin.left-2*s,y),t.lineTo(this.adjPlotMargin.left-s,y),t.stroke(),t.textAlign="right";var b=this.utils.Formatters.decimalFormatter(a+m*_,d);b+=u>=1e5?"k":"",t.fillText(b,this.adjPlotMargin.left-3*s,this.adjPlotMargin.top+n+s-m*g)}if("asso"==l)for(var x=20,w=n/5,C=0,P=0;P<6;P++){var k=this.adjPlotMargin.top+P*w,M=Math.floor(k);t.moveTo(f,M),t.lineTo(f+s,M),t.stroke(),t.textAlign="left",t.fillText(C+P*x,this.adjPlotMargin.left+e+3*s,this.adjPlotMargin.top+n+5-P*w)}for(var E="asso"==l?Math.ceil((i-o)/5):.2,D=e/5,O=0;O<6;O++){var L=this.adjPlotMargin.left+O*D,j=Math.floor(L);t.moveTo(j,this.adjPlotMargin.top+n+s),t.lineTo(j,this.adjPlotMargin.top+n+2*s),t.stroke(),t.textAlign="center";var S=this.utils.Formatters.decimalFormatter(o+O*E,p);S=S>=1e5?Math.round(.001*S)+"k":S,t.fillText(S,j,this.adjPlotMargin.top+n+4*s)}if(t.textAlign="center",t.rotate(-2*Math.PI/4),t.fillText(this.renderConfig["y axis label"],-(this.adjPlotMargin.top+n/2),s+24),"asso"==l&&t.fillText("Recombination Rate (cM/Mb)",-(this.adjPlotMargin.top+n/2),2*this.adjPlotMargin.left+e-(s+24)),t.rotate(-2*Math.PI/4*3),t.fillText("LD"==l?"LD(r2)":this.renderConfig["x axis label"],e/2+this.adjPlotMargin.left,this.adjPlotMargin.top+this.adjPlotMargin.bottom+n-24),"LD"==l&&"Combined"==c)for(var A=e/5,I=0;I<5;I++){var T=this.adjPlotMargin.left+I*A,B=Math.floor(T);t.fillStyle=this.ldColor[I],t.fillRect(B,this.adjPlotMargin.top,A-1,n)}}}});d()((function(){}));var _=f,g=(n("b832"),n("2877")),m=Object(g["a"])(_,r,a,!1,null,null,null);e["a"]=m.exports},8599:function(t,e,n){},"875d":function(t,e,n){},"884c":function(t,e,n){},"89e4":function(t,e,n){},"8ad5":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.isSubtable?"pigean-subtable":"",attrs:{id:"pigean-gene"}},[t.tableData.length>0?n("div",[t.isSubtable?t._e():n("div",{staticClass:"text-right mb-2"},[n("data-download",{attrs:{data:t.probData,filename:"pigean_gene"}})],1),n("div",{staticClass:"table-total-rows",domProps:{innerHTML:t._s("Total rows: "+t.rows)}}),n("b-table",{attrs:{hover:t.isSubtable,small:"",responsive:"",items:t.tableData,fields:t.probFields,"per-page":t.perPage,"current-page":t.currentPage,"sort-by":t.sortBy,"sort-desc":!0,"sort-null-last":!0},scopedSlots:t._u([{key:"cell(label)",fn:function(e){return[e.item.label?n("span",[t._v(" "+t._s(e.item.label.length>50?e.item.label.slice(0,50)+"...":e.item.label)+" ")]):t._e()]}},{key:"cell(gene)",fn:function(e){return[n("a",{attrs:{href:"/cvdi_pigean/gene.html?gene="+e.item.gene+t.suffix}},[t._v(" "+t._s(e.item.gene)+" ")])]}},{key:"cell(phenotypeDesc)",fn:function(e){return[t.phenotypeMap[e.item.phenotype]?n("a",{attrs:{href:"/cvdi_pigean/phenotype.html?phenotype="+e.item.phenotype+t.suffix}},[t._v(" "+t._s(e.item.phenotypeDesc)+" ")]):n("span",[t._v(t._s(e.item.phenotype))])]}},{key:"cell(gene_set)",fn:function(e){return[n("a",{attrs:{href:"/cvdi_pigean/geneset.html?geneset="+e.item.gene_set+t.suffix}},[t._v(" "+t._s(e.item.gene_set)+" ")])]}},{key:"cell(top_gene_sets)",fn:function(e){return[n("div",{staticClass:"wrapped-cell-content"},[e.item.top_gene_sets?n("span",[t._v(" "+t._s(e.item.top_gene_sets)+" ")]):n("span",[t._v("-")])])]}},{key:"cell(top_genes)",fn:function(e){return[n("div",{staticClass:"wrapped-cell-content"},[e.item.top_genes?n("span",[t._v(" "+t._s(e.item.top_genes)+" ")]):n("span",[t._v("-")])])]}},{key:"cell(expand)",fn:function(e){return[n("b-button",{attrs:{variant:"outline-primary",size:"sm"}
1,on:{click:function(n){return t.showDetails(e,1)}}},[t._v(" "+t._s(e.detailsShowing&&3!==e.item.subtableActive?"Hide":"Show")+" ")])]}},{key:"cell(expand1)",fn:function(e){return[n("b-dropdown",{attrs:{split:"",right:"",text:e.detailsShowing&&1===e.item.subtableActive?"Hide":"Show",variant:"outline-primary",size:"sm"},on:{click:function(n){return t.showDetails(e,1)}}},[n("b-dropdown-header",{attrs:{id:"dropdown-header-label"}},[t._v(" Top 5 Genes ")]),t._l(e.item.top_genes.split(";"),(function(e){return n("b-dropdown-item",{key:e,attrs:{href:"/cvdi_pigean/gene.html?gene="+e+t.suffix}},[t._v(" "+t._s(e)+" ")])}))],2)]}},{key:"cell(expand2)",fn:function(e){return[n("b-dropdown",{attrs:{split:"",right:"",text:e.detailsShowing&&2===e.item.subtableActive?"Hide":"Show",variant:"outline-primary",size:"sm"},on:{click:function(n){return t.showDetails(e,2)}}},[n("b-dropdown-header",{attrs:{id:"dropdown-header-label"}},[t._v(" Top 5 Gene Sets ")]),t._l(e.item.top_gene_sets.split(";"),(function(e){return n("b-dropdown-item",{key:e,attrs:{href:"/cvdi_pigean/geneset.html?geneset="+e+t.suffix}},[t._v(" "+t._s(e.length>40?e.slice(0,40)+"...":e)+" ")])}))],2)]}},{key:"cell(expand3)",fn:function(e){return[n("b-button",{attrs:{variant:"outline-primary",size:"sm",disabled:t.hideLocusButton(e.item.phenotype)},on:{click:function(n){return t.showDetails(e,3)}}},[t._v(" "+t._s(e.detailsShowing&&3===e.item.subtableActive?"Hide":"Show")+" ")])]}},{key:"row-details",fn:function(e){return[2===e.item.subtableActive&&t.subtable2Data[t.subtableKey(e.item)]&&t.subtable2Data[t.subtableKey(e.item)].length>0?n("cvdi-pigean-table",{attrs:{pigeanData:t.subtable2Data[t.subtableKey(e.item)],config:{fields:t.config.subtable2Fields},isSubtable:!0}}):t._e(),1===e.item.subtableActive&&t.subtableData[t.subtableKey(e.item)]&&t.subtableData[t.subtableKey(e.item)].length>0?n("cvdi-pigean-table",{attrs:{pigeanData:t.subtableData[t.subtableKey(e.item)],config:{fields:t.config.subtableFields},isSubtable:!0}}):t._e(),3===e.item.subtableActive?n("div",[t._v(" Locus zoom unavailable ")]):t._e()]}}],null,!1,1121342611)}),n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.tableData.length,"per-page":t.perPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1):n("div",[n("b-alert",{staticClass:"text-center",attrs:{show:"",variant:"warning"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" No data available for this query. ")],1)],1)])},a=[],i=n("53ca"),o=n("1da1"),s=(n("d9e2"),n("99af"),n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("b0c0"),n("4ec9"),n("b64b"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("2532"),n("5319"),n("5b81"),n("498a"),n("3ca3"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("0eb6"),n("b7ef"),n("8bd4"),n("ad1f"),n("2b0e")),l=n("0571"),c=n("529c"),u=n("f529"),d=n("fd66"),h=n("a282"),p=n("1f3b"),f=n("1812"),_=n("a708"),g=n("ae39");function m(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */m=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 7,426 bytes, line 1
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var v=s["default"].component("cvdi-pigean-table",{components:{DataDownload:u["a"],CVDIPigeanTable:w},props:["pigeanData","phenotypeMap","config","isSubtable","filter"],data:function(){return{perPage:10,currentPage:1,subtableData:{},subtable2Data:{},plotColors:f["a"].plotColors()}},computed:{utilsBox:function(){var t={Formatters:c["a"],uiUtils:h["a"],alertUtils:p["a"],keyParams:d["a"],dataConvert:g["a"],sortUtils:_["a"],plotUtils:f["a"]};return t},probFields:function(){return this.collateFields()},probData:function(){return this.computeProbabilities()},rows:function(){return this.pigeanData.length||0},sortBy:function(){return 0===this.pigeanData.length?0:this.config.fields.map((function(t){return t.key})).includes("factor_value")?"factor_value":this.config.sortBy?this.config.sortBy:void 0!==this.pigeanData[0]["combined"]?"combined":"beta_uncorrected"},tableData:function(){var t=this.probData;return t.forEach((function(t){t.subtableActive=0})),this.filter&&(t=t.filter(this.filter)),t},traitGroup:function(){return d["a"].traitGroup||l["c"]},suffix:function(){return"&traitGroup=".concat(this.traitGroup)}},methods:{phenotypeFormatter:c["a"].phenotypeFormatter,pValueFormatter:c["a"].pValueFormatter,effectFormatter:c["a"].effectFormatter,intFormatter:c["a"].intFormatter,annotationFormatter:c["a"].annotationFormatter,tissueFormatter:c["a"].tissueFormatter,tpmFormatter:c["a"].tpmFormatter,getSubtable:function(t,e){var n=this;return Object(o["a"])(m().mark((function r(){var a,i,o;return m().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=n.subtableKey(t.item),n.subtableData[a]||1!==e){r.next=6;break}return r.next=4,Object(l["g"])(n.config.subtableEndpoint,a);case 4:i=r.sent,s["default"].set(n.subtableData,a,i);case 6:if(!n.config.subtable2Endpoint||n.subtable2Data[a]||2!==e){r.next=11;break}return r.next=9,Object(l["g"])(n.config.subtable2Endpoint,a);case 9:o=r.sent,s["default"].set(n.subtable2Data,a,o);case 11:case"end":return r.stop()}}),r)})))()}
1,showDetails:function(t,e){this.toggleTable(t,e),this.getSubtable(t,e)},toggleTable:function(t,e){var n=!1;n=e!==t.item.subtableActive,t.item.subtableActive=n?e:0,!n&&t.detailsShowing&&0===t.item.subtableActive&&t.toggleDetails(),n&&!t.detailsShowing&&0!==t.item.subtableActive&&t.toggleDetails()},subtableKey:function(t){return"".concat(t.phenotype,",").concat(t[this.config.queryParam],",").concat(l["b"])},generateId:function(t){return t.replaceAll(",","").replaceAll(" ","_")},probability:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.05,n=Math.exp(Math.log(e)+t);return n/(1+n)},computeProbabilities:function(){for(var t=this.isSubtable?this.pigeanData:this.describePhenotypes(this.pigeanData),e=0;e<this.config.fields.length;e++){var n=this.config.fields[e];if(n.showProbability)for(var r=n.key,a=0;a<t.length;a++)t[a][r]&&(t[a]["".concat(r,"_probability")]=this.tpmFormatter(this.probability(t[a][r])))}return t},collateFields:function(){var t=[];return this.config.fields.forEach((function(e){e.showProbability&&t.push({key:"".concat(e.key,"_probability"),sortable:!0}),t.push(e)})),t},describePhenotypes:function(t){for(var e=structuredClone(t),n=0;n<e.length;n++)if(e[n].phenotype){var r=this.phenotypeMap[e[n].phenotype];void 0===r&&(r={phenotype_name:e[n].phenotype});var a=r.phenotype_name.trim();e[n]["phenotypeDesc"]=a}return e},hideLocusButton:function(t){return this.phenotypeMap?void 0===this.phenotypeMap[t]||"portal"!==this.phenotypeMap[t].trait_group:"portal"!==this.traitGroup}}}),y=v,b=(n("efd6"),n("2877")),x=Object(b["a"])(y,r,a,!1,null,"091cc0ce",null),w=e["a"]=x.exports},"8b9c":function(t,e,n){},"8d29":function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0");var r=n("53ca"),a=n("1da1"),i=n("2b0e"),o=n("2b27"),s=n.n(o),l=n("de86"),c=n("1ab4");function u(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */u=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,c,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}i["default"].use(s.a);var d={computed:{user:function(){return this.$store.state.bioPortal.user}},methods:{saveCurrentPage:function(){i["default"].$cookies.set("whereAmI",location.href,"","",l["a"].domain)},loginUser:function(){var t=this;return Object(a["a"])(u().mark((function e(){return u().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.saveCurrentPage(),e.next=3,c["a"].logPageView(window.location.protocol+"//"+window.location.host+"/login",location.href);case 3:window.location.href="/login";case 4:case"end":return e.stop()}}),e)})))()}}}},"8d9b":function(t,e,n){},"8d9f":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"disease-group-select"},[n("b-form-select",{on:{change:function(e){return t.changeDiseaseGroup(t.selectedPortal)}},model:{value:t.selectedPortal,callback:function(e){t.selectedPortal=e},expression:"selectedPortal"}},t._l(t.visibleDiseaseGroups,(function(e){return n("option",{key:e.name,domProps:{value:e.name}},[t._v(" "+t._s(e.description)+" ")])})),0)],1)},a=[],i=(n("a4d3"),n("e01a"),n("4de4"),n("4e82"),n("b0c0"),n("d3b7"),n("0643"),n("2382"),n("2b0e")),o=(n("1157"),n("de86")),s=n("5f5b"),l=n("b1e0");n("f9e3"),n("2dd8");i["default"].use(s["a"]),i["default"].use(l["b"]);var c=i["default"].component("DiseaseGroupSelect",{props:["diseaseGroups"],data:function(){return{diseaseGroup:this.$store.getters["bioPortal/diseaseGroup"].portalGroup||null,selectedPortal:""}},computed:{visibleDiseaseGroups:function(){var t=this;return this.diseaseGroups.filter((function(e){return e.name!==e.portalGroup&&e.portalGroup===t.diseaseGroup})).sort((function(t,e){return t.description>e.description?1:-1}))}},methods:{changeDiseaseGroup:function(t){window.location.href=o["a"].urlWithSubdomain(t).href}}}),u=c,d=n("2877"),h=Object(d["a"])(u,r,a,!1,null,null,null);e["a"]=h.exports},"8e61":function(t,e,n){},9142:function(t,e,n){"use strict";n("875d")},9171:function(t,e,n){},9341:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"scatter-plot-content"},[t.colorLegend.length>0?n("div",{staticClass:"plot-legend"},t._l(t.colorLegend,(function(e){return n("div",{key:e.value,staticClass:"legend-item",on:{mouseenter:function(n){t.hoveredLegendValue=e.value},mouseleave:function(e){t.hoveredLegendValue=null}}},[n("span",{staticClass:"legend-dot",style:{backgroundColor:e.color}}),n("span",[t._v(t._s(e.value))])])})),0):t._e(),n("div",{staticClass:"clicked-dot-value hidden",attrs:{id:"clicked_dot_value"+t.sectionId}}),n("div",{staticClass:"scatter-plots-row"},t._l(t.resolvedPlots,(function(e,r){return n("div",{key:t.plotPanelKey(e,r),staticClass:"scatter-plot-panel"},[e.renderConfig?n("canvas",{staticClass:"scatter-plot",style:t.canvasStyle(e.renderConfig),attrs:{id:t.canvasId(r),width:2*e.renderConfig.width+240,height:2*e.renderConfig.height+240},on:{mouseleave:t.onCanvasMouseLeave,mousemove:function(e){return t.checkPosition(e,r)}}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v(" Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){t.downloadImage(t.canvasId(r),t.downloadName(r),"png")}}},[t._v("Download PNG")])])])]),e.title?n("div",{staticClass:"scatter-plot-title"},[t._v(" "+t._s(e.title)+" ")]):t._e()])})),0)])},a=[],i=n("b85c"),o=n("53ca"),s=n("3835"),l=n("2909"),c=(n("99af"),n("cb29"),n("4de4"),n("7db0"),n("a15b"),n("d81d"),n("14d9"),n("4e82"),n("4057"),n("4fad"),n("d3b7"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("3ca3"),n("0643"),n("2382"),n("fffc"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),u=n("b1e0"),d=n("bc8f");c["default"].use(u["a"]);var h=c["default"].component("research-simple-scatter-plot",{props:{plotData:{type:Array,default:function(){return[]}},data:{type:Array,default:null},renderConfig:{type:Object,default:null},plots:{type:Array,default:null},utils:{type:Object,required:!0},sectionId:{type:String,required:!0},colors:{type:Object,default:null},rowKeyField:{type:String,default:null},linkedHoverKey:{type:String,default:null}},data:function(){return{posDataByPlot:{},rowKeyToCanvasPos:{},hoveredLegendValue:null,localHoverActive:!1,highlightedRowKey:null,activePlotIndex:null}},computed:{sourcePlotData:function(){var t;return null!==(t=this.plotData)&&void 0!==t&&t.length?this.plotData:this.data||[]},resolvedPlots:function(){return Array.isArray(this.plots)&&this.plots.length>0?this.plots:this.renderConfig?[{title:this.renderConfig.title||this.renderConfig.label||"",renderConfig:this.renderConfig}]:[]},adjPlotMargin:function(){var t,e=null===(t=this.resolvedPlots[0])||void 0===t?void 0:t.renderConfig;return e?this.plotMarginFor(e):{left:80,right:20,top:20,bottom:60,bump:5}},colorByField:function(){var t,e,n=null===(t=this.renderConfig)||void 0===t?void 0:t["color by"],r=null===(e=this.resolvedPlots[0])||void 0===e||null===(e=e.renderConfig)||void 0===e?void 0:e["color by"];return this.colorByFieldFrom(n||r)},palette:function(){var t,e,n=null===(t=this.resolvedPlots[0])||void 0===t?void 0:t.renderConfig;return(null===(e=this.colors)||void 0===e?void 0:e.moderate)||(null===n||void 0===n?void 0:n.colors)||d["a"]},colorScaleMap:function(){var t=this;if(!this.colorByField)return{};var e=Object(l["a"])(new Set((this.sourcePlotData||[]).map((function(e){return e[t.colorByField]})).filter((function(t){return null!=t&&""!==t})))).sort(),n={};return e.forEach((function(e,r){n[e]=t.palette[r%t.palette.length]})),n},colorLegend:function(){return Object.entries(this.colorScaleMap).map((function(t){var e=Object(s["a"])(t,2),n=e[0],r=e[1];return{value:n,color:r}}))}},watch:{plotData:{handler:function(){this.highlightedRowKey=null,this.scheduleRenderPlot()},deep:!0},plots:{handler:function(){this.scheduleRenderPlot()},deep:!0},renderConfig:{handler:function(){this.scheduleRenderPlot()},deep:!0},hoveredLegendValue:function(){this.highlightedRowKey=null,this.scheduleRenderPlot()},linkedHoverKey:function(t){this.localHoverActive||(t&&this.rowKeyToCanvasPos[t]?(this.setHighlightedRowKey(t),this.showTooltipForRowKey(t,!1)):this.localHoverActive||(this.setHighlightedRowKey(null),this.hidePanel()))}},mounted:function(){this.scheduleRenderPlot()},methods:{plotPanelKey:function(t,e){var n;return[this.sectionId,e,t.title,null===(n=t.renderConfig)||void 0===n?void 0:n["x axis field"]].join("-")},canvasId:function(t){return"simpleScatterPlot".concat(this.sectionId,"_").concat(t)},downloadName:function(t){return"".concat(this.sectionId,"_simpleScatterPlot_").concat(t)},canvasStyle:function(t){return"width:"+(t.width+120)+"px;height:"+(t.height+120)+"px;"},plotMarginFor:function(t){var e=t["plot margin"]?t["plot margin"]:null;return e?{left:e.left,right:e.right,top:e.top,bottom:e.bottom,bump:e.bump?e.bump:5}:{left:80,right:20,top:20,bottom:60,bump:5}},colorByFieldFrom:function(t){if(!t)return null;if(Array.isArray(t)){var e=t[0];return"object"===Object(o["a"])(e)?e.field:e}return t},renderDataFor:function(t){var e=this,n=this.sourcePlotData||[],r=[];return n.map((function(n){var a,i={};i[t["render by"]]=n[t["render by"]],i[t["x axis field"]]=n[t["x axis field"]],i[t["y axis field"]]=n[t["y axis field"]],e.colorByField&&(i[e.colorByField]=n[e.colorByField]),null===(a=t["on hover"])||void 0===a||a.forEach((function(t){i[t]=n[t]})),e.rowKeyField&&(i[e.rowKeyField]=n[e.rowKeyField]),r.push(i)})),r},scheduleRenderPlot:function(){var t=this;this.$nextTick((function(){requestAnimationFrame((function(){t.clearPlot(),t.renderAllPlots()}))}))},downloadImage:function(t,e,n){this.utils.uiUtils.downloadImg(t,e,n)},hidePanel:function(){var t=this;this.utils.uiUtils.hideElement("clicked_dot_value"+this.sectionId),this.resolvedPlots.forEac
1h((function(e,n){var r=document.getElementById(t.canvasId(n));r&&r.classList.remove("hover")}))},onCanvasMouseLeave:function(){this.localHoverActive=!1,this.activePlotIndex=null,this.setHighlightedRowKey(null),this.hidePanel(),this.rowKeyField&&this.$emit("hover-key-change",null)},setHighlightedRowKey:function(t){var e=t||null;e!==this.highlightedRowKey&&(this.highlightedRowKey=e,this.scheduleRenderPlot())},drawHighlightRing:function(t,e,n,r){t.save(),t.beginPath(),t.arc(e,n,r+6,0,2*Math.PI),t.strokeStyle="#ffffff",t.lineWidth=5,t.stroke(),t.beginPath(),t.arc(e,n,r+6,0,2*Math.PI),t.strokeStyle="#e07b39",t.lineWidth=3,t.stroke(),t.restore()},rowKeyForDatum:function(t){if(!this.rowKeyField||!t)return null;var e=t[this.rowKeyField];return null==e||""===e?null:String(e)},buildHoverHtml:function(t,e){if(!t)return"";var n,r="";e["on hover"]?e["on hover"].forEach((function(n,a){var i,o=n,s=o?"<b>".concat(o,":</b> "):"";r+='<span class="gene-on-clicked-dot-scatter">\n\t\t\t\t\t'.concat(s,"\n\t\t\t\t\t").concat(null!==(i=t[n])&&void 0!==i?i:"","\n\t\t\t\t\t</span><br>"),a<e["on hover"].length-1&&(r+="<hr>")})):r='<span class="gene-on-clicked-dot-scatter">'.concat(null!==(n=t[e["render by"]])&&void 0!==n?n:"","</span>");return r},primaryEntryForRowKey:function(t){var e=this,n=this.rowKeyToCanvasPos[t];return n&&n.length?null!=this.activePlotIndex&&n.find((function(t){return t.plotIndex===e.activePlotIndex}))||n[0]:null},tooltipContainerRect:function(){var t=this.$el;return t?t.getBoundingClientRect():null},positionTooltipAtClient:function(t,e,n){var r=this.tooltipContainerRect();t&&r&&(t.style.top="".concat(n-r.top,"px"),t.style.left="".concat(e-r.left+15,"px"))},positionTooltipAtEntry:function(t,e){var n=document.getElementById(this.canvasId(e.plotIndex));if(t&&n&&e){var r=n.getBoundingClientRect(),a=r.left+e.xPos/n.width*r.width,i=r.top+e.yPos/n.height*r.height;this.positionTooltipAtClient(t,a,i)}},showTooltipForRowKey:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.primaryEntryForRowKey(t);if(n){var r=document.getElementById("clicked_dot_value"+this.sectionId),a=document.getElementById(this.canvasId(n.plotIndex));r&&a&&(r.classList.remove("hidden"),this.positionTooltipAtEntry(r,n),r.innerHTML=this.buildHoverHtml(n.row,this.resolvedPlots[n.plotIndex].renderConfig),a.classList.add("hover"),e&&this.rowKeyField&&this.$emit("hover-key-change",t))}},checkPosition:function(t,e){var n;this.activePlotIndex=e;var r=null===(n=this.resolvedPlots[e])||void 0===n?void 0:n.renderConfig;if(r){var a=document.getElementById("clicked_dot_value"+this.sectionId);a.classList.remove("hidden");var i=t,o=document.getElementById(this.canvasId(e)).getBoundingClientRect(),s=document.getElementById(this.canvasId(e)),l=s?s.width/o.width:1,c=s?s.height/o.height:1,u=Math.floor((i.clientX-o.left)*l/2),d=Math.floor((i.clientY-o.top)*c/2);this.positionTooltipAtClient(a,i.clientX,i.clientY);for(var h=this.posDataByPlot[e]||{},p="",f=-3;f<=3;f++)if(h[u+f])for(var _=-3;_<=3;_++)h[u+f][d+_]&&(h[u+f][d+_].map((function(t,e){var n=r["on hover"][e],a=n?"<b>".concat(n,":</b> "):"";p+='<span class="gene-on-clicked-dot-scatter">\n\t\t\t\t\t\t\t\t\t'.concat(a,"\n\t\t\t\t\t\t\t\t\t").concat(t,"\n\t\t\t\t\t\t\t\t\t</span><br>")})),p+=r["on hover"]?"<hr>":"");if(""!=p){if(a.innerHTML=p,s.classList.add("hover"),this.localHoverActive=!0,this.rowKeyField){var g=this.findRowKeyNearCanvasPoint(u,d,e);this.setHighlightedRowKey(g),this.$emit("hover-key-change",g)}}else a.innerHTML=p,a.classList.add("hidden"),s.classList.remove("hover"),this.localHoverActive=!1,this.setHighlightedRowKey(null),this.rowKeyField&&this.$emit("hover-key-change",null)}},findRowKeyNearCanvasPoint:function(t,e,n){for(var r=null,a=1/0,o=0,l=Object.entries(this.rowKeyToCanvasPos);o<l.length;o++){var c,u=Object(s["a"])(l[o],2),d=u[0],h=u[1],p=Object(i["a"])(h);try{for(p.s();!(c=p.n()).done;){var f=c.value;if(f.plotIndex===n){var _=Math.hypot(f.x-t,f.y-e);_<=8&&_<a&&(a=_,r=d)}}}catch(g){p.e(g)}finally{p.f()}}return r},clearPlot:function(){var t=this;this.posDataByPlot={},this.rowKeyToCanvasPos={}
1,this.resolvedPlots.forEach((function(e,n){var r=e.renderConfig;if(r){var a=document.getElementById(t.canvasId(n));if(a){var i=a.getContext("2d");i.clearRect(0,0,2*r.width+240,2*r.height+240)}}}))},dotFillStyle:function(t){var e="#00000080";if(!this.colorByField)return e;var n=t[this.colorByField],r=this.colorScaleMap[n]||e;return null!=this.hoveredLegendValue&&n!==this.hoveredLegendValue?"#80808014":this.withAlpha(r)},withAlpha:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CC";return t?9===String(t).length?t:"".concat(t).concat(e):"#00000080"},registerRowPosition:function(t,e,n,r,a,i,o){if(e){this.rowKeyToCanvasPos[e]||(this.rowKeyToCanvasPos[e]=[]);var s=this.rowKeyToCanvasPos[e].find((function(e){return e.plotIndex===t})),l={plotIndex:t,x:n,y:r,xPos:a,yPos:i,row:o};s?Object.assign(s,l):this.rowKeyToCanvasPos[e].push(l)}},renderSinglePlot:function(t,e){var n=this,r=this.renderDataFor(e);if(r.length){var a=[],i=[],o=2*e.width,s=2*e.height,l=149,c=89,u=.04*o,d=.04*s,h=document.getElementById(this.canvasId(t));if(h){var p=h.getContext("2d");p.clearRect(0,0,o+240,s+240),p.beginPath(),p.lineWidth=1,p.strokeStyle="#000000",p.setLineDash([]),r.map((function(t){a.push(t[e["x axis field"]]),i.push(t[e["y axis field"]])}));var f=8,_=Math.min.apply(Math,a),g=Math.max.apply(Math,a),m=Math.min.apply(Math,i),v=Math.max.apply(Math,i),y=this.utils.uiUtils.getAxisTicks(_,g),b=this.utils.uiUtils.getAxisTicks(m,v);p.moveTo(l,s+c+d),p.lineTo(o+l+u,s+c+d),p.stroke();for(var x=o/5,w=0;w<6;w++)p.moveTo(l+w*x+u,c+s+d),p.lineTo(l+w*x+u,s+c+10+d),p.stroke(),p.font="24px Arial",p.textAlign="center",p.fillStyle="#000000",y.lo+w*y.step==0?p.fillText(0,l+w*x+u,c+s+34+d):p.fillText(this.utils.Formatters.floatFormatter(y.lo+w*y.step),l+w*x+u,c+s+34+d);p.font="28px Arial",p.textAlign="center",p.fillStyle="#000000",p.fillText(e["x axis label"],l+o/2,c+s+70+d),p.moveTo(l,c),p.lineTo(l,s+c+d),p.stroke();for(var C=s/5,P=0;P<6;P++)p.moveTo(l-5,c+P*C),p.lineTo(l,c+P*C),p.stroke(),p.font="24px Arial",p.textAlign="right",p.fillStyle="#000000",b.lo+b.step*P==0?p.fillText(0,l-14,c+(5-P)*C+3):p.fillText(this.utils.Formatters.floatFormatter(b.lo+b.step*P),l-14,c+(5-P)*C+3);p.font="28px Arial",p.textAlign="center",p.fillStyle="#000000",p.rotate(-90*Math.PI/180),p.fillText(e["y axis label"],-(c+s/2),l-110),p.rotate(90*Math.PI/180);var k=y.lo+5*y.step,M=b.lo+5*b.step,E={};if(this.posDataByPlot[t]=E,r.map((function(r){var a=l+u+o*((r[e["x axis field"]]-y.lo)/(k-y.lo)),i=c+s-s*((r[e["y axis field"]]-b.lo)/(M-b.lo)),d=Math.round(a/2),h=Math.round(i/2),_=n.rowKeyForDatum(r);n.registerRowPosition(t,_,d,h,a,i,r),E[d]||(E[d]={}),E[d][h]=[],e["on hover"]?e["on hover"].forEach((function(t){E[d][h].push(r[t])})):E[d][h].push(r[e["render by"]]),p.fillStyle=n.dotFillStyle(r),p.lineWidth=0,p.beginPath(),p.arc(a,i,f,0,2*Math.PI),p.fill(),e["dot label score"]&&(p.font="24px Arial",p.textAlign="center",p.fillStyle="#000000",p.fillText(r[e["render by"]],a,i-16))})),this.highlightedRowKey){var D=this.rowKeyToCanvasPos[this.highlightedRowKey]||[];D.filter((function(e){return e.plotIndex===t})).forEach((function(t){n.drawHighlightRing(p,t.xPos,t.yPos,f)}))}}}},renderAllPlots:function(){var t=this;this.resolvedPlots.length&&(this.rowKeyToCanvasPos={},this.resolvedPlots.forEach((function(e,n){e.renderConfig&&t.renderSinglePlot(n,e.renderConfig)})),this.highlightedRowKey&&!this.localHoverActive&&this.rowKeyToCanvasPos[this.highlightedRowKey]&&this.showTooltipForRowKey(this.highlightedRowKey,!1))}}}),p=h,f=(n("b9ca"),n("2877")),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},"93ba":function(t,e,n){},"944a8":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("filter-control-template",{staticClass:"filter-col-sm",attrs:{field:t.field,type:"number",predicate:t.predicate,pillFormatter:t.pillFormatter,placeholder:t.placeholder,color:t.color,computedField:t.computedField,multiple:!1}},[t._t("default",(function(){return[t._v(t._s(t.field))]}))],2)},a=[],i=(n("99af"),n("2b0e")),o=n("27d5"),s=i["default"].component("filter-greater-control",{props:{field:String,computedField:Function,predicate:{type:Function,default:function(t,e){return t>=e}},pillFormatter:{type:Function,default:function(t){return"".concat(t.field," ⥠").concat(t.threshold)}},color:{type:String},placeholder:String},components:{FilterControlTemplate:o["a"]}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},9487:function(t,e,n){"use strict";n("70db")},"948d":function(t,e,n){},"966c":function(t,e,n){"use strict";n("02b9")},"97b5":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"heatmap-wrapper"},[t._m(0),n("div",{staticClass:"heatmap-content",attrs:{id:"heatmapContent",hidden:this.hideHeatmap}},[t.renderConfig.label?n("div",{staticClass:"heatmap-label",domProps:{innerHTML:t._s(t.renderConfig.label)}}):t._e(),t.renderConfig.legend?n("div",{staticClass:"heatmap-legend",domProps:{innerHTML:t._s(t.renderConfig.legend)}}):t._e(),t.renderConfig.legend?n("div",{staticClass:"heatmap-scale-legend",attrs:{id:"heatmap_scale_legend"}}):t._e(),n("div",{staticClass:"heatmap-canvas-wrapper",attrs:{id:"heatmapPlotWrapper"}},[n("div",{staticClass:"heatmap-columns-wrapper",attrs:{id:"heatmapColumnsWrapper"}}),n("div",{staticClass:"heatmap-rows-wrapper",attrs:{id:"heatmapRowsWrapper"}}),n("div",{staticClass:"heatmap-canvas-wrapper",attrs:{id:"heatmapCanvasWrapper"}},[t.renderConfig?n("canvas",{attrs:{id:"heatmap",width:"",height:""},on:{mouseleave:t.hidePanel,mousemove:t.checkPosition}}):t._e()])])])])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clicked-cell-value hidden",attrs:{id:"clicked_cell_value"}},[n("div",{attrs:{id:"clicked_cell_value_content"}})])}],i=n("5530"),o=(n("a4d3"),n("e01a"),n("99af"),n("cb29"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("d3b7"),n("07ac"),n("4c53"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("2b0e")),s=n("1157"),l=n.n(s),c=n("a282"),u=n("1812"),d=n("b1e0"),h=n("529c");o["default"].use(d["a"]);var p=o["default"].component("heatmap",{props:{heatmapData:{type:Array,required:!0},renderConfig:{type:Object,required:!0},alwaysHideTooltip:{type:Boolean,default:!1}},data:function(){return{squareData:{},canvasHover:!1,hideHeatmap:!1,phenotypeMap:this.$store.state.bioPortal.phenotypeMap,colors:{},separator:"___",lo:null,mid:null,hi:null}},modules:{uiUtils:c["a"],Formatters:h["a"]}
1,mounted:function(){this.colors=this.groupColors(),this.renderHeatmap(),this.renderScaleLegend()},beforeDestroy:function(){},computed:{renderData:function(){var t=this;if(0===this.heatmapData.length)return{columns:[],rows:[],empty:!0};this.hideHeatmap=!1,this.renderConfig.colorByPhenotype&&this.getExtremes();var e={},n=this.heatmapData,r=n.map((function(e){return e[t.renderConfig.rowField]})).filter((function(t,e,n){return n.indexOf(t)==e})).filter((function(t,e,n){return""!=t})),a=n.map((function(e){return e[t.renderConfig.columnField]})).filter((function(t,e,n){return n.indexOf(t)==e})).filter((function(t,e,n){return""!=t}));e["rows"]=r.sort((function(e,n){return t.renderConfig.sortRowsDescending?-1*e.localeCompare(n,void 0,{sensitivity:"base"}):1}));var i=a.sort((function(e,n){var r=t.applyPrefix(e),a=t.applyPrefix(n);return r.localeCompare(a,void 0,{sensitivity:"base"})}));return e["columns"]=i,r.map((function(t){e[t]={},a.map((function(n){e[t][n]={}}))})),n.map((function(n){var r=t.renderConfig.rowField,a=t.renderConfig.columnField;e[n[r]][n[a]]["main"]=n[t.renderConfig.main.field],t.renderConfig.sub&&(e[n[r]][n[a]]["sub"]=n[t.renderConfig.sub.field])})),e},boxSize:function(){return 1.5*this.renderConfig.fontSize}},watch:{renderData:function(t){t.empty?this.hideHeatmap=!0:(this.hideHeatmap=!1,this.renderHeatmap())}},methods:Object(i["a"])(Object(i["a"])({},c["a"]),{},{hidePanel:function(){c["a"].hideElement("clicked_cell_value"),this.renderHeatmap()},renderScaleLegend:function(){var t=document.getElementById("heatmap_scale_legend"),e="<div class='scale-legend-main-field'><div class='field-label'>"+this.renderConfig.main.label+":</div> ",n=(this.renderConfig.main.low,this.renderConfig.main.middle),r=this.renderConfig.main.high;if(r!=n){var a=(r-n)/5,i=0==n?"0.00":h["a"].floatFormatter(n);e+="<div class='scale-legend-main-colors'><div class='scale-color' style='background-color: rgb(255,255,255)'>"+i+"</div>";for(var o=1;o<6;o++){var s=1-.2*o;s*=255,s=0==s?0:h["a"].intFormatter(s),e+="<div class='scale-color' style='background-color: rgb(255,"+s+","+s+")'>"+h["a"].floatFormatter(a*o)+"</div>"}e+="</div></div>"}if(this.renderConfig.sub){e+="<div class='scale-legend-sub-field'><div class='field-label'>"+this.renderConfig.sub.label+"</div>:";var l,c=this.renderConfig.sub.valueRange,u=this.renderConfig.sub.direction,d=.75*this.boxSize;c.map((function(t,n){"positive"==u?(l=d*((n+1)/c.length),e+="<div class='sub-legend-steps'> >= "):(l=d*((c.length-n)/c.length),e+="<div class='sub-legend-steps'> <= "),e+=t+": <span style = 'display: inline-block; background-color: #00000075; width:"+l+"px; height:"+l+"px; border-radius:"+l/2+"px;'></span></div>"})),e+="</div>"}t.innerHTML=e},checkPosition:function(t){if(!this.alwaysHideTooltip){var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=Math.floor(e.clientY-n.top),i=Math.floor((e.clientX-n.left)/this.boxSize),o=Math.floor((e.clientY-n.top)/this.boxSize),s="";if(i>=0&&o>=0&&this.squareData[o]&&this.squareData[o][i]){s+='<span class="field-on-clicked-cell">'+this.removeRowPrefix(this.renderData.rows[o])+"</sub>",s+='<span class="field-on-clicked-cell">';var l=this.renderConfig.sortPhenotypeColumns?this.getPhenotypeDescription(this.renderData.columns[i]):this.renderData.columns[i];s+=l+"</sub>",s+='<span class="content-on-clicked-cell"><b>'+this.renderConfig.main.label+": </b>"+this.squareData[o][i].main.value+"</span>",this.squareData[o][i].sub&&(s+='<span class="content-on-clicked-cell"><b>'+this.renderConfig.sub.label+": </b>"+this.squareData[o][i].sub.value+"</span>"),this.squareData[o][i].group&&(s+='<span class="content-on-clicked-cell"><b>'+this.squareData[o][i].group.field+": </b>"+this.squareData[o][i].group.value+"</span>")}var c=document.getElementById("clicked_cell_value"),u=document.getElementById("clicked_cell_value_content"),d=document.getElementById("heatmapCanvasWrapper").getBoundingClientRect(),h=d.left,p=document.getElementById("heatmapContent").offsetHeight-document.getElementById("heatmapPlotWrapper").offsetHeight+document.getElementById("heatmapColumnsWrapper").offsetWidth;""!=s?(u.innerHTML=s,c.classList.remove("hidden"),c.style.top=p+a+"px",c.style.left=h-30+r+"px"):c.classList.add("hidden"),this.renderHeatmap(i,o)}},renderHeatmap:function(t,e){var n=this;this.squareData={},document.getElementById("heatmapColumnsWrapper").innerHTML="",document.getElementById("heatmapRowsWrapper").innerHTML="";var r=1.5*this.renderConfig.fontSize*this.renderData.columns.length,a=this.boxSize*this.renderData.rows.length;document.getElementById("heatmapColumnsWrapper").style.fontSize=this.renderConfig.fontSize+"px",document.getElementById("heatmapRowsWrapper").style.fontSize=this.renderConfig.fontSize+"px",this.renderData.columns.map((function(t){var e=document.createElement("div"),r=n.truncateColumn(n.getPhenotypeDescription(t)),a=document.createTextNode(r);e.appendChild(a),e.setAttribute("style","height: "+n.boxSize+"px;"),document.getElementById("heatmapColumnsWrapper").appendChild(e)})),this.renderData.rows.map((function(t){var e=document.createElement("div"),r=document.createTextNode(n.removeRowPrefix(t));e.appendChild(r),e.setAttribute("style","height: "+n.boxSize+"px;"),document.getElementById("heatmapRowsWrapper").appendChild(e)}));document.getElementById("heatmapColumnsWrapper").offsetHeight,document.getElementById("heatmapColumnsWrapper").offsetWidth;var i=document.getElementById("heatmapColumnsWrapper").offsetWidth+20,o=0;document.getElementById("heatmapColumnsWrapper").style.left=document.getElementById("heatmapRowsWrapper").offsetWidth+(this.boxSize-this.renderConfig.fontSize)/2+"px",document.getElementById("heatmapPlotWrapper").style.paddingTop=i+"px";var s=document.getElementById("heatmap");s.setAttribute("width",r),s.setAttribute("height",a);var l=s.getContext("2d");this.renderData.rows.map((function(r){n.squareData[o]={};var a=0;n.renderData.columns.map((function(i){var s=n.renderData[r][i].main,c=n.boxSize*a,u=n.boxSize*o;if(n.squareData[o][a]={},n.squareData[o][a]["main"]={field:n.renderConfig.main.field,value:n.renderData[r][i].main},n.renderConfig.sub&&(n.squareData[o][a]["sub"]={field:n.renderConfig.sub.field,value:n.renderData[r][i].sub}),n.renderConfig.sortPhenotypeColumns){var d=n.getGroup(i);n.squareData[o][a]["group"]={field:"Group",value:"ZZZ_UNGROUPED"===d?"UNGROUPED":d}}var h=n.renderConfig.colorByPhenotype?n.groupColorString(i,s):n.colorString(s);if(t==a&&e==o?(l.beginPath(),l.rect(c,u,n.boxSize,n.boxSize),l.fillStyle="black",l.fill(),l.beginPath(),l.rect(c+2,u+2,n.boxSize-4,n.boxSize-4),l.fillStyle=h,l.fill()):(l.beginPath(),l.rect(c,u,n.boxSize,n.boxSize),l.fillStyle=h,l.fill()),n.renderConfig.sub){var p,f=n.renderConfig.sub.valueRange,_=n.renderConfig.sub.direction,g=.75*n.boxSize/2,m=n.boxSize/2,v=0,y=n.renderData[r][i].sub;if("steps"==n.renderConfig.sub.type){var b=g/f.length;if("positive"==_)for(var x=0;x<=f.length-1;x++)v+=y>=f[x]?1:0;else for(var w=f.length-1;w>=0;w--)v+=y<=f[w]?1:0;p=b*v}else if("scale"==n.renderConfig.sub.type){var C=f[1]-f[0];"positive"==_?(y-=f[0],v=y<=f[0]?0:y>=f[1]?1:y/C):(y-=f[0],v=y>=f[1]?0:y<=f[0]?1:(f[1]-y)/C),p=g*v}l.fillStyle="#00000075",l.lineWidth=0,l.beginPath(),l.arc(c+m,u+m,p,0,2*Math.PI),l.fill()}a++})),o++}))},getGroup:function(t){return this.phenotypeMap[t]?this.phenotypeMap[t].group:"ZZZ_UNGROUPED"},applyPrefix:function(t){return this.renderConfig.sortPhenotypeColumns?"".concat(this.getGroup(t)).concat(this.separator).concat(t):t},groupColors:function(){var t=Object.values(this.phenotypeMap).map((function(t){return t.group})),e=[];t.forEach((function(t){e.includes(t)||e.push(t)})),e.push("ZZZ_UNGROUPED"),e.sort();for(var n={},r=u["a"].plotColors(),a=0;a<e.length;a++)n[e[a]]=r[a%r.length];return n},colorString:function(t){this.renderConfig.main.direction;var e,n,r,a=this.renderConfig.main.high,i=this.renderConfig.main.middle,o=this.renderConfig.main.low;e=t>=i?255:255-255*((i-t)/i-o),n=t>=this.renderConfig.main.middle?255-(t-i)/(a-i)*255:255-255*((i-t)/i-o),r=t<this.renderConfig.main.middle?255:255-(t-i)/(a-i)*255,e=e>255?255:e<0?0:e,n=n>255?255:n<0?0:n,r=r>255?255:r<0?0:r;var s="rgba("+Math.floor(e)+","+Math.floor(n)+","+Math.floor(r)+",1)";return s},groupColorString:function(t,e){if(void 0!==t){var n=255*(e-this.lo)/(this.hi-this.lo),r=this.getGroup(t),a="".concat(this.colors[r]).concat(this.alphaToHex(n));return a}}
1,alphaToHex:function(t){var e=Math.round(t),n="0123456789ABCDEF",r=e%16,a=n[r],i=(e-r)/16,o=n[i];return"".concat(o).concat(a)},getExtremes:function(){var t=this.renderConfig.main.field,e=this.heatmapData[0][t],n=this.heatmapData[0][t];this.heatmapData.forEach((function(r){r[t]>e&&(e=r[t]),r[t]<n&&(n=r[t])})),this.lo=0,this.hi=e,this.mid=(this.lo+this.hi)/2},truncateColumn:function(t){return this.renderConfig.truncateColumns?t.length<=30?t:"".concat(t.slice(0,30),"..."):t},getPhenotypeDescription:function(t){return this.phenotypeMap[t]?this.phenotypeMap[t].description:t},removeRowPrefix:function(t){if(!this.renderConfig.rowScorePrefixes)return t;var e=t.indexOf(this.separator);return-1===e?t:t.slice(e+this.separator.length)}})});l()((function(){}));var f=p,_=(n("69f4"),n("2877")),g=Object(_["a"])(f,r,a,!1,null,null,null);e["a"]=g.exports},"97f3":function(t,e,n){"use strict";n("8b9c")},"986e":function(t,e,n){"use strict";var r=n("2b0e"),a=new r["default"];e["a"]=a},"98ab":function(t,e,n){"use strict";n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return f})),n.d(e,"e",(function(){return _})),n.d(e,"a",(function(){return g}));var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div")},a=[],i=(n("14d9"),n("d3b7"),n("0643"),n("4e3e"),n("159b"),n("2b0e")),o=n("d8ef"),s=n("986e"),l=n("1ab4"),c=i["default"].component("alert",{data:function(){return{message:null}},mounted:function(){s["a"].$on("ALERT",this.pushAlert),s["a"].$on("CLOSE_ALERT",this.popAlert),s["a"].$on("UPDATE_ALERT",this.processAlertQueue)},methods:{showAlert:function(t){var e={info:"Information",success:"Success",warning:"Warning",danger:"Error!",primary:"Notice",secondary:"Status"};this.$bvToast.toast(t.message,{id:t.params?t.params.id:null,variant:t.type,title:"".concat(e[t.type]),solid:!0,toaster:"b-toaster-bottom-right",autoHideDelay:1e4,noAutoHide:!!t.params&&t.params.noHide,appendToast:!0,noCloseButton:!!t.params&&t.params.noClose})},closeAlert:function(t){var e=this;setTimeout((function(){return e.$bvToast.hide(t)}),200)},pushAlert:function(t){var e=this;u.push((function(){return e.showAlert(t)}))},popAlert:function(t){var e=this;u.push((function(){return e.closeAlert(t)}))},processAlertQueue:function(){u.forEach((function(t){return t()})),u=[]}}}),u=[],d=60;function h(){m(),setTimeout((function(){requestAnimationFrame(h)}),1e3/d)}requestAnimationFrame(h);var p=function(t,e,n){s["a"].$emit("ALERT",{type:t,message:e,params:n})},f=function(t,e){var n=o["a"].getUniqueId("alert");return e=e||"danger",s["a"].$emit("ALERT",{type:e,message:t,params:{noHide:!0,id:n}}),Object(l["a"])(e,t),n},_=function(t){var e=o["a"].getUniqueId("alert");return s["a"].$emit("ALERT",{type:"secondary",message:t,params:{noHide:!0,noClose:!0,id:e}}),e},g=function(t){s["a"].$emit("CLOSE_ALERT",t)},m=function(){s["a"].$emit("UPDATE_ALERT")},v=c,y=n("2877"),b=Object(y["a"])(v,r,a,!1,null,null,null);e["b"]=b.exports},9958:function(t,e,n){"use strict";n("a5ab")},"9aba":function(t,e,n){},"9ba9":function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("autocomplete",{ref:"genesetSelect",attrs:{placeholder:t.$store.state.genesetToQuery?t.$store.state.genesetToQuery:"Search gene set",matches:t.matchingGenesets},on:{"input-change":function(e){return t.lookupGenesets(e)},"item-select":function(e){return t.selectGeneset(e)}}})},a=[],i=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("53ca")),o=n("1da1"),s=n("2b0e"),l=n("5f5b"),c=n("b1e0"),u=n("d726"),d=n("bb0b"),h=(n("f9e3"),n("2dd8"),n("e60d"));function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}s["default"].use(l["a"]),s["default"].use(c["b"]),s["default"].component("vue-typeahead-bootstrap",u["a"]),s["default"].component("autocomplete",d["a"]);var f=s["default"].component("geneset-selectpicker",{props:[],data:function(){return{matchingGenesets:[]}},computed:{},methods:{setFocus:function(){var t=this;this.$nextTick((function(){t.$refs.genesetSelect.$refs.input.focus()}))},lookupGenesets:function(t){var e=this;return Object(o["a"])(p().mark((function n(){var r;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!t){n.next=5;break}return n.next=3,Object(h["e"])("pigean-gene-set",t,{limit:10});case 3:r=n.sent,e.matchingGenesets=r;case 5:case"end":return n.stop()}}),n)})))()},selectGeneset:function(t){var e=this;return Object(o["a"])(p().mark((function n(){return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:e.$store.state.genesetToQuery=t,e.$emit("onGenesetChange",t);case 2:case"end":return n.stop()}}),n)})))()}}}),_=f,g=n("2877"),m=Object(g["a"])(_,r,a,!1,null,null,null);e["a"]=m.exports},"9d09":function(t,e,n){"use strict";var r=function(){var t=this,e=this,n=e.$createElement,r=e._self._c||n;return r("lz-panel",{ref:"panel",attrs:{panelClass:e.panelClass},on:{updated:function(e){return t.panelId=e.panelId}}})},a=[],i=n("3835"),o=(n("99af"),n("d81d"),n("6b93"),n("a573"),n("2b0e")),s=n("bacd"),l=n("06a9"),c=n("67a3"),u=o["default"].component("lz-associations-panel",{components:{LzPanel:s["a"]},props:{phenotype:String,title:String},created:function(){var t=this;this.panelClass=d(this.phenotype,this.title,(function(e){return t.$emit("input",e)}),(function(e){return t.$emit("resolve",e)}),(function(e){return t.$emit("error",e)})),this.addPanels=this.$parent.addPanels,this.plot=this.$parent.plot},watch:{phenotype:function(t,e){this.panelId&&this.$parent.plot.removePanel(this.panelId),this.$refs.panel.updatePanel()}}});function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=function(t){return'$..data_layers[?(@.id === "'.concat(t,'")]')},u=s("associationpvaluescatalog"),d=new c["b"]("association_catalog",{title:{text:e?"".concat(e," Variant Associations"):"Variant Associations",style:{"font-size":"18px"},x:-.5},y_index:0}).addFields(u,"assoc",["pValue","position","consequence","nearest","beta"]);d.addProperty("".concat(u),"toolbar",{widgets:[{type:"remove_panel",color:"red",position:"right"},{type:"toggle_legend",position:"right"},{type:"toggleloglog",color:"gray",position:"right"}]}).addProperty("".concat(u),"match",{send:"assoc:position",receive:"assoc:position"}).addProperty("".concat(u),"y_axis",{axis:1,field:"assoc:log_pvalue",upper_buffer:.1}).addRule("".concat(u,".color"),{field:"lz_highlight_match",scale_function:"if",parameters:{field_value:!0,then:"#FF00FF"}},!0);var h=function(t){function e(t){var e=t.split(":"),n=Object(i["a"])(e,4),r=n[0],a=n[1],o=n[2],s=n[3];return"".concat(r,":").concat(a,"_").concat(o,"/").concat(s)}return t.map((function(t){return{chromosome:t.chromosome,id:e(t.varId),position:t.position,pValue:t.pValue,log_pvalue:-1*Math.log10(t.pValue),variant:e(t.varId),ref_allele:t.reference,consequence:t.consequence,beta:t.beta,nearest:t.nearest}}))},p=new c["a"](l["b"]).withParams(Object(c["d"])("associations",t,h,void 0,n,a,r,o)),f=new c["c"](d,p).initialize("assoc");return f.unwrap}var h=u,p=n("2877"),f=Object(p["a"])(h,r,a,!1,null,null,null);e["a"]=f.exports},"9dd5":function(t,e,n){"use strict";n("e0b2")},"9e27":function(t,e,n){},a12e:function(t,e,n){"use strict";n("a3fc")},a282:function(t,e,n){"use strict";var r=n("b85c"),a=n("2909"),i=n("53ca"),o=n("3835"),s=(n("99af"),n("caad"),n("a15b"),n("d81d"),n("14d9"),n("e9c4"),n("6b93"),n("4fad"),n("b64b"),n("d3b7"),n("2532"),n("3ca3"),n("a573"),n("ddb0"),n("2b3d"),n("bf19"),n("9861"),n("88a7"),n("271a"),n("5494"),n("1816")),l=n.n(s),c=function(t){var e=C(t);e.classList.toggle("popped-out")},u=function(t){var e=C(t);e&&e.classList.add("hidden")},d=function(t,e){var n=C(t);if(n&&(n.classList.remove("hidden"),e)){var r=C(e);r&&(r.focus(),r.select())}},h=function(t){var e=C(t);e&&(e.classList.contains("hidden-svg")?p(t):f(t))},p=function(t){var e=C(t);e&&e.classList.remove("hidden-svg")},f=function(t){var e=C(t);e&&e.classList.add("hidden-svg")},_=function(t,e){var n=C(t);
1n&&(n.classList.contains("hidden")?d(t,e):u(t))},g=function(t,e){var n=C(t);n&&(n.classList.contains(e)?n.classList.remove(e):n.classList.add(e))},m=function(t){var e=C(t);e.classList.contains("hidden")?e.classList.remove("hidden"):e.classList.add("hidden"),v(t)},v=function(t){var e=document.getElementsByClassName(t)[0],n=document.getElementById(t),r=window.innerWidth,a=n.offsetWidth,i=y(e),o=i.left>r-a?-a+"px":"1.0em";n.style.setProperty("left",o)},y=function(t){var e=0,n=0;while(t&&!isNaN(t.offsetLeft)&&!isNaN(t.offsetTop))e+=t.offsetLeft-t.scrollLeft,n+=t.offsetTop-t.scrollTop,t=t.offsetParent;return{top:n,left:e}},b=function(t,e){for(var n,r=t.length,a=0;a<r;a++){var i=C(t[a]);0==i.classList.contains("hidden")&&(i.classList.add("hidden"),n=a+1==r?0:a+1)}var o=C(t[n]);event.target.innerHTML=e[n],o.classList.remove("hidden")},x=function(t,e){for(var n,r=t.length,a=0;a<r;a++){var i=C(t[a]);0==i.classList.contains("hidden-svg")&&(i.classList.add("hidden-svg"),n=a+1==r?0:a+1)}var o=C(t[n]);event.target.innerHTML=e[n],o.classList.remove("hidden-svg")},w=function(t,e){for(var n="./"+t+"?",r=0,a=Object.entries(e);r<a.length;r++){var i=Object(o["a"])(a[r],2),s=i[0],l=i[1];n+=s+"="+l+"&"}window.location.href=n},C=function(t){var e=document.getElementById(t);return"undefined"!=typeof e&&null!=e||(e=document.getElementsByClassName(t)[0]),e},P=function(t){for(var e=document.getElementsByClassName(t),n=e.length,r=0;r<=n;r++)e[r].classList.toggle("hidden")},k=function(t){var e=window.top.scrollY,n=document.getElementsByClassName("search-header")[0];e>this.tableTop?n.classList.contains("fixed-header")||n.classList.add("fixed-header"):n.classList.contains("fixed-header")&&n.classList.remove("fixed-header")},M=function(t,e){var n=[],r={},s=e||"download";t.map((function(t){for(var e=0,a=Object.entries(t);e<a.length;e++){var s=Object(o["a"])(a[e],2),l=s[0],c=s[1];if("features"!=l)if("object"!=Object(i["a"])(c)||c.length)n.includes(l)||n.push(l);else for(var u=0,d=Object.entries(c);u<d.length;u++){var h=Object(o["a"])(d[u],2),p=h[0],f=(h[1],l+"__"+p);n.includes(f)||n.push(f)}else for(var _=0,g=Object.entries(c);_<g.length;_++){var m=Object(o["a"])(g[_],2),v=m[0],y=m[1];r[v]||(r[v]=[]);for(var b=0,x=Object.entries(y[0]);b<x.length;b++){var w=Object(o["a"])(x[b],2),C=w[0];w[1];r[v].includes(C)||r[v].push(C)}}}}));var l=[];Object.keys(r).length>0?t.map((function(t){for(var e=0,a=Object.entries(r);e<a.length;e++)for(var i=Object(o["a"])(a[e],2),s=i[0],c=(i[1],function(e){var a=[];n.map((function(e){var n=e.split("__");if(2==n.length){var r=null!==t[n[0]][n[1]]?0===t[n[0]][n[1]]?0:t[n[0]][n[1]]:"";a.push(r)}else{var i=null!==t[n[0]]?0===t[n[0]]?0:t[n[0]]:"";a.push(i)}}));for(var i=function(){var n=Object(o["a"])(u[c],2),i=n[0];n[1];i==s?r[i].map((function(n){a.push(t.features[i][e][n])})):r[i].map((function(t){a.push("")}))},c=0,u=Object.entries(r);c<u.length;c++)i();l.push(a)}),u=0;u<t.features[s].length;u++)c(u)})):0==Object.keys(r).length&&t.map((function(t){var e=[];n.map((function(n){var r=n.split("__");if(2==r.length){var a=null!==t[r[0]][r[1]]?0===t[r[0]][r[1]]?0:t[r[0]][r[1]]:"";e.push(a)}else{var i=null!==t[r[0]]?0===t[r[0]]?0:t[r[0]]:"";e.push(i)}})),l.push(e)}));for(var c=n,u=function(){var t=Object(o["a"])(h[d],2),e=t[0],n=t[1];n.map((function(t){c.push("feature__"+e+"__"+t)}))},d=0,h=Object.entries(r);d<h.length;d++)u();var p=[c.join(",")].concat(Object(a["a"])(l.map((function(t){return t.join(",")})))).join("\r\n"),f=document.createElement("a"),_=new Blob(["\ufeff",p]),g=URL.createObjectURL(_);f.href=g,f.download=s+".csv",document.body.appendChild(f),f.click(),document.body.removeChild(f)},E=function(t,e){var n=[],r={},s=e||"download";t.map((function(t){for(var e=0,a=Object.entries(t);e<a.length;e++){var s=Object(o["a"])(a[e],2),l=s[0],c=s[1];if("features"!=l)if("object"!=Object(i["a"])(c)||c.length)n.includes(l)||n.push(l);else for(var u=0,d=Object.entries(c);u<d.length;u++){var h=Object(o["a"])(d[u],2),p=h[0],f=(h[1],l+"__"+p);n.includes(f)||n.push(f)}else for(var _=0,g=Object.entries(c);_<g.length;_++){var m=Object(o["a"])(g[_],2),v=m[0],y=m[1];r[v]||(r[v]=[]);for(var b=0,x=Object.entries(y[0]);b<x.length;b++){var w=Object(o["a"])(x[b],2),C=w[0];w[1];r[v].includes(C)||r[v].push(C)}}}}));var l=[];Object.keys(r).length>0?t.map((function(t){for(var e=0,a=Object.entries(r);e<a.length;e++)for(var i=Object(o["a"])(a[e],2),s=i[0],c=(i[1],function(e){var a=[];n.map((function(e){var n=e.split("__");if(2==n.length){var r=null!==t[n[0]][n[1]]?0===t[n[0]][n[1]]?0:t[n[0]][n[1]]:"";a.push(r)}else{var i=null!==t[n[0]]?0===t[n[0]]?0:t[n[0]]:"";a.push(i)}}));for(var i=function(){var n=Object(o["a"])(u[c],2),i=n[0];n[1];i==s?r[i].map((function(n){a.push(t.features[i][e][n])})):r[i].map((function(t){a.push("")}))},c=0,u=Object.entries(r);c<u.length;c++)i();l.push(a)}),u=0;u<t.features[s].length;u++)c(u)})):0==Object.keys(r).length&&t.map((function(t){var e=[];n.map((function(n){var r=n.split("__");if(2==r.length){var a=null!==t[r[0]][r[1]]?0===t[r[0]][r[1]]?0:t[r[0]][r[1]]:"";e.push(a)}else{var i=null!==t[r[0]]?0===t[r[0]]?0:t[r[0]]:"";e.push(i)}})),l.push(e)}));for(var c=n,u=function(){var t=Object(o["a"])(h[d],2),e=t[0],n=t[1];n.map((function(t){c.push("feature__"+e+"__"+t)}))},d=0,h=Object.entries(r);d<h.length;d++)u();var p=[c.join("\t")].concat(Object(a["a"])(l.map((function(t){return t.join("\t")})))).join("\r\n"),f=document.createElement("a"),_=new Blob(["\ufeff",p]
1),g=URL.createObjectURL(_);f.href=g,f.download=s+".tsv",document.body.appendChild(f),f.click(),document.body.removeChild(f)},D=function(t,e){var n=t,r=e||"download",i=function(t,e){return null===e?"":e},o=Object.keys(n[0]),s=[o.join(",")].concat(Object(a["a"])(n.map((function(t){return o.map((function(e){return JSON.stringify(t[e],i)})).join(",")})))).join("\r\n"),l=document.createElement("a"),c=new Blob(["\ufeff",s]),u=URL.createObjectURL(c);l.href=u,l.download=r+".csv",document.body.appendChild(l),l.click(),document.body.removeChild(l)},O=function(t,e){var n=t,r=e||"download",i=function(t,e){return null===e?"":e},o=Object.keys(n[0]),s=[o.join("\t")].concat(Object(a["a"])(n.map((function(t){return o.map((function(e){return JSON.stringify(t[e],i)})).join("\t")})))).join("\r\n"),l=document.createElement("a"),c=new Blob(["\ufeff",s]),u=URL.createObjectURL(c);l.href=u,l.download=r+".tsv",document.body.appendChild(l),l.click(),document.body.removeChild(l)},L=function(t,e){var n=e||"download",r=document.createElement("a"),a=new Blob(["\ufeff",JSON.stringify(t),null,4]),i=URL.createObjectURL(a);r.href=i,r.download=n+".json",document.body.appendChild(r),r.click(),document.body.removeChild(r)},j=function(t,e){var n=Math.pow(10,Math.round(Math.log10(e-t))-1),r=(Math.floor((t+n)/n)-1)*n,a=n/2,i={};t=r,n=Math.floor((Math.floor((e-r)/n)/5*n+a)/a)*a,e=Math.floor((e+a)/n)*n;do{i[r]=(r-t)/(e-t),r+=n}while(r<=e+a);return{lo:t,hi:e,step:n,ticks:i}},S=function(t,e,n,r){for(var a=document.querySelectorAll(".kp-tabs#"+n+" .kp-tab"),i=document.querySelectorAll(".kp-tabs-contents#"+r+" .kp-tab-content"),o=0;o<a.length;o++)a[o].classList.remove("active");for(var s=0;s<i.length;s++)i[s].classList.remove("active");document.getElementById(t).classList.add("active"),document.getElementById(e).classList.add("active")},A=function(t,e){var n=document.getElementById(t);setTimeout((function(){n.classList.remove("fixed"),n.classList.add("hidden")}),e)},I=function(t){var e=document.querySelector(t),n=!(!e||1!=e.getAttribute("class").includes("fixed"));return n};function T(){var t=l()(window.location.href),e=""==t.port?"https://bioindex.hugeamp.org":"https://bioindex-dev.hugeamp.org";return e}function B(){var t=l()(window.location.href);return t}function R(t){var e=["0","1","2","3","4","5","6","7","8","9",0,1,2,3,4,5,6,7,8,9,"e","E","-","."],n=!0;return"string"==typeof t&&t.split("").map((function(t){e.includes(t)||(n=!1)})),n}var F=function(t,e,n,r,a){for(var i=document.getElementById(e),o=i.getElementsByClassName("tab-ui-tab"),s=0;s<o.length;s++){var l=o[s],c=l.getAttribute("class");c.includes("loading")?l.setAttribute("class","tab-ui-tab loading"):l.setAttribute("class","tab-ui-tab")}document.getElementById(t).setAttribute("class","tab-ui-tab active");for(var u=document.getElementById(r),d=a?u.getElementsByClassName("plot-tab-content-wrapper"):u.getElementsByClassName("tab-content-wrapper"),h=0;h<d.length;h++){var p=d[h];a?p.setAttribute("class","plot-tab-content-wrapper hidden-content"):p.setAttribute("class","tab-content-wrapper hidden-content")}a?document.getElementById(n).setAttribute("class","plot-tab-content-wrapper"):document.getElementById(n).setAttribute("class","tab-content-wrapper")},G=function(t){var e=document.getElementById(t).closest(".tabgroup-fixed-bottom");e.classList.contains("open")?e.classList.remove("open"):(e.classList.add("open"),e.querySelector(".fixed-group-toggle").classList.remove("has-updates"))},W=function(t){var e=document.querySelector(t);e.classList.contains("hidden")?e.classList.remove("hidden"):e.classList.add("hidden")},U=function(t,e,n,a){var i,o=document.getElementById(t),s=document.createElement("a");if("svg"==n){for(var l=document.createElementNS("http://www.w3.org/2000/svg","svg"),c=["width","height","viewBox"],u=0,d=c;u<d.length;u++){var h=d[u];o.hasAttribute(h)&&l.setAttribute(h,o.getAttribute(h))}var p,f=Object(r["a"])(o.children);try{for(f.s();!(p=f.n()).done;){var _=p.value;"script"!==_.nodeName.toLowerCase()&&l.appendChild(_.cloneNode(!0))}}catch(v){f.e(v)}finally{f.f()}var g=(new XMLSerializer).serializeToString(l);i=new Blob([g],{type:"image/svg+xml"})}else"png"==n&&(i=o.toDataURL("image/png"));if(s.href="svg"==n?URL.createObjectURL(i):i,s.download="svg"==n?e+".svg":e+".png",s.click(),URL.revokeObjectURL(s.href),"svg"==n){var m=document.getElementById(a);m.remove()}},q=function(t,e){var n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)},N=function(t){window.navigator.clipboard.writeText(t)}
1,K=function(t,e,n){var r=t.id,a=document.getElementById(r);if(a){var i=document.getElementById(e+"_wrapper");if(i){var o=r+"_wrapper",s=document.getElementById(o);s||(s=document.createElement("div"),s.setAttribute("id",o)),s.innerHTML="";var l=document.createElement("canvas");l.width=a.width,l.height=a.height;var c=l.getContext("2d");c.drawImage(a,0,0);var u=l.toDataURL(),d=document.createElement("img");d.setAttribute("width",t.width),d.setAttribute("height",t.height),d.src=u,d.alt="Canvas Image",s.appendChild(d),i.innerHTML="",i.appendChild(s)}}},V=function(t,e){var n=document.getElementById(t);if(n){var r=document.getElementById(e);n.parentNode,n.parentNode&&n.parentNode.removeChild(n),r.appendChild(n)}};e["a"]={addRemoveClass:g,popOutElement:c,hideElement:u,showElement:d,showHideElement:_,showHideSvg:h,showHideHelpContent:m,openPage:w,showHideByClass:P,switchViews:b,switchPlotViews:x,getToolTipPosition:v,onScroll:k,convertJson2Csv:D,convertJson2Tsv:O,saveByorCsv:M,saveByorTsv:E,saveJson:L,getAxisTicks:j,showTabContent:S,removeOnMouseOut:A,isIdFixed:I,biDomain:T,getUrl:B,checkIfNumeric:R,setTabActive:F,toggleFixedSummarySection:G,showHidePanel:W,downloadImg:U,downloadChart:q,copy2Clipboard:N,copyCanvasToDiv:K,moveElement:V}},a378:function(t,e,n){"use strict";n("8599")},a3fc:function(t,e,n){},a5ab:function(t,e,n){},a5ad:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("vue-typeahead-bootstrap",{ref:"phenotypeSelect",attrs:{placeholder:t.placeholder||"Type in a phenotype ...",data:t.phenotypeOptions,serializer:function(t){return t.description},maxMatches:1e3,minMatchingChars:0,showOnFocus:!0},on:{hit:function(e){return t.onPhenotypeSelected(e)}},scopedSlots:t._u([{key:"suggestion",fn:function(e){var r=e.data,a=e.htmlText;return[n("span",{domProps:{innerHTML:t._s(a)}}),t._v("Â "),n("small",{staticClass:"text-secondary"},[t._v(t._s(r.group))])]}}]),model:{value:t.userText,callback:function(e){t.userText=e},expression:"userText"}})},a=[],i=n("53ca"),o=n("1da1"),s=(n("a4d3"),n("e01a"),n("d9e2"),n("14d9"),n("fb6a"),n("4e82"),n("b636"),n("d28b"),n("944a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("3ca3"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("2b0e")),l=n("5f5b"),c=n("b1e0"),u=n("d726");n("f9e3"),n("2dd8");function d(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */d=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,o,s,l){var c=p(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}s["default"].use(l["a"]),s["default"].use(c["b"]),s["default"].component("vue-typeahead-bootstrap",u["a"]);var h=s["default"].component("phenotype-selectpicker",{props:["phenotypes","clearOnSelected","defaultPhenotype","placeholder","useInLocal","localPlace"],data:function(){return{userText:this.defaultPhenotype||""}},computed:{phenotypeOptions:function(){return this.phenotypes?this.phenotypes.sort((function(t,e){return t.group<e.group?-1:e.group<t.group?1:t.description<e.description?-1:e.description<t.description?1:0})):[]}},methods:{onPhenotypeSelected:function(t){if(this.useInLocal)switch(this.localPlace){case"diseaseSystems":this.getPhenotypeCorrelation(t.name);break}else this.$store.dispatch("onPhenotypeChange",t),this.clearOnSelected&&(this.userText="",this.$refs.phenotypeSelect.inputValue="")},setFocus:function(){var t=this;this.$nextTick((function(){t.$refs.phenotypeSelect.$refs.input.focus()}))},getPhenotypeCorrelation:function(t){var e=this;return Object(o["a"])(d().mark((function n(){var r,a;return d().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="https://bioindex-dev.hugeamp.org/api/bio/query/genetic-correlation?q="+t,n.next=3,fetch(r).then((function(t){return t.json()}));case 3:a=n.sent,null==a.error&&e.$store.dispatch("phenotypeCorrelation",a);case 5:case"end":return n.stop()}}),n)})))()}}}),p=h,f=n("2877"),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},a661:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"col-md-12"},[t.plotData?n("div",{staticClass:"plot-legend",domProps:{innerHTML:t._s(t.plotLegend)}}):t._e(),t.plotConfig?["manhattan bitmap plot"==t.plotConfig["type"]?n("research-m-bitmap-plot",{attrs:{plotData:t.plotData,renderConfig:t.plotConfig,dataComparisonConfig:t.dataComparisonConfig,compareGroupColors:t.colors.moderate,utils:t.utils,sectionId:t.sectionId}}):t._e(),"box plot"==t.plotConfig["type"]?n("research-box-plot",{attrs:{phenotypesData:t.plotData,phenotypeMap:t.phenotypeMap,colors:t.colors.extraBold,plotMargin:t.plotMargin,renderConfig:t.plotConfig,pkgData:null,pkgDataSelected:null,canvasId:t.sectionId,utils:t.utils}}):t._e(),"bar plot"==t.plotConfig["type"]?n("research-bar-plot",{attrs:{phenotypesData:t.plotData,phenotypeMap:t.phenotypeMap,colors:t.colors.extraBold,plotMargin:t.plotMargin,renderConfig:t.plotConfig,pkgData:null,pkgDataSelected:null,canvasId:t.sectionId,utils:t.utils}}):t._e(),"cfde xing"==t.plotConfig["type"]?n("research-cfde-xing",{attrs:{data:t.plotData,colors:t.colors,plotMargin:t.plotMargin,renderConfig:t.plotConfig,canvasId:t.sectionId,utils:t.utils}}):t._e(),"bar in cell plot"==t.plotConfig["type"]?n("research-bar-in-cell-plot",{attrs:{plotData:t.plotData,plotMargin:t.plotMargin,plotConfig:t.plotConfig,canvasId:t.sectionId,utils:t.utils}}):t._e(),"phewas plot"==t.plotConfig["type"]?n("research-phewas-plot",{attrs:{phenotypesData:t.plotData,phenotypeMap:t.phenotypeMap,colors:t.colors.extraBold,plotMargin:t.plotMargin,renderConfig:t.plotConfig,pkgData:null,pkgDataSelected:null,canvasId:t.sectionId,utils:t.utils}}):t._e(),"heat map"==t.plotConfig["type"]?n("research-heatmap",{attrs:{heatmapData:t.plotData,renderConfig:t.plotConfig,utils:t.utils,sectionId:t.sectionId}}):t._e(),"volcano plot"==t.plotConfig["type"]?n("research-volcano-plot",{attrs:{plotData:t.plotData,renderConfig:t.plotConfig,utils:t.utils,sectionId:t.sectionId}}):t._e(),"manhattan qq plot"==t.plotConfig["type"]?n("research-m-qq-plot",{attrs:{plotData:t.plotData,renderConfig:t.plotConfig,utils:t.utils,sectionId:t.sectionId}}):t._e(),t.plotConfig&&"region plot"==t.plotConfig["type"]&&t.region?n("multi-region-plot",{attrs:{plotData:t.plotData,renderConfig:t.plotConfig,searchParameters:t.searchParameters,dataComparisonConfig:t.dataComparisonConfig,region:t.region,plotMargin:t.plotMargin,compareGroupColors:t.colors.moderate,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,pkgData:null,pkgDataSelected:null,isSectionPage:!0,sectionId:t.sectionId,utils:t.utils,starItems:t.starItems,colors:t.colors},on:{"ld-data-loaded":function(e){return t.receiveLDData(e)},"on-star":t.starColumn}}):t._e(),t.plotConfig&&"region track"==t.plotConfig["type"]&&t.region?n("research-region-track",{attrs:{sectionId:t.sectionId,plotConfig:t.plotConfig,plotData:t.plotData,dataComparisonConfig:t.dataComparisonConfig,regionParam:t.region,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,colors:t.colors,utils:t.utils,plotMargin:t.plotMargin,starItems:t.starItems}}):t._e(),t.plotConfig&&"region dots track"==t.plotConfig["type"]&&t.region?n("research-region-dots-track",{attrs:{sectionId:t.sectionId,plotConfig:t.plotConfig,plotData:t.plotData,dataComparisonConfig:t.dataComparisonConfig,region:t.region,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,colors:t.colors,utils:t.utils,plotMargin:t.plotMargin,starItems:t.starItems}}):t._e(),t.plotConfig&&("region plot"==t.plotConfig["type"]||"region track"==t.plotConfig["type"]||"region dots track"==t.plotConfig["type"])&&t.plotConfig["genes track"]&&t.region?n("multi-genes-track",{attrs:{region:t.region,genesData:null,plotConfig:t.plotConfig,plotType:t.plotConfig["type"],plotMargin:t.plotMargin,regionZoom:t.regionZoom,regionViewArea:t.regionViewArea,utils:t.utils,sectionId:t.sectionId,starItems:t.starItems}}):t._e(),t.plotConfig&&"simple scatter plot"==t.plotConfig["type"]?n("research-simple-scatter-plot",{attrs:{plotData:t.plotData,renderConfig:t.plotConfig,plotMargin:t.plotMargin,colors:t.colors,sectionId:t.sectionId,utils:t.utils,"row-key-field":t.rowKeyField,"linked-hover-key":t.linkedHoverKey},on:{"hover-key-change":function(e){return t.$emit("hover-key-change",e)}}}):t._e(),t.plotConfig&&"scatter plot"==t.plotConfig["type"]?n("research-scatter-plot",{attrs:{plotData:t.plotData,renderConfig:t.plotConfig,searchParameters:t.searchParameters,dataComparisonConfig:t.dataComparisonConfig,plotMargin:t.plotMargin,compareGroupColors:t.colors.moderate,isSectionPage:!0,sectionId:t.sectionId,starItems:t.starItems,utils:t.utils}}):t._e(),t.plotConfig&&"cell browser"==t.plotConfig["type"]?n("research-single-cell-browser",{attrs:{sectionId:t.sectionId,renderConfig:t.plotConfig,utils:t.utils,data:t.plotData}}):t._e()]:t._e(),t.sectionId.startsWith("sQTL_by_region0_2")?n("research-splice-track",{attrs:{region:t.region,plotConfig:t.plotConfig,plotType:t.plotConfig["type"],plotMargin:t.plotMargin,regionZoom:0,regionViewArea:t.regionViewArea,utils:t.utils,c
1olors:t.colors,sectionId:t.sectionId}}):t._e()],2)},a=[],i=(n("d81d"),n("a573"),n("2b0e")),o=n("1157"),s=n.n(o),l=n("a7af"),c=n("c706"),u=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row",attrs:{id:"rp_region_plot"}},[n("div",{staticClass:"col-md-12"},[t.plotsList.length>1?n("div",{staticClass:"show-hide-plots"},[n("strong",[t._v("Show/hide region plots")]),t._l(t.plotsList,(function(e,r){return["Combined"!=e?n("span",{key:e,staticClass:"group-bubble",style:"background-color:"+t.compareGroupColors[r]+";",domProps:{innerHTML:t._s(e)},on:{click:function(n){t.utils.uiUtils.showHideElement("assoPlotsWrapper"+e.replaceAll(" ","_")+t.sectionId)}}}):t._e(),"Combined"==e?n("span",{staticClass:"group-bubble reference",staticStyle:{"background-color":"#ffffff",border:"solid 1px #666666"},attrs:{type:"button"},on:{click:function(e){return t.utils.uiUtils.showHideElement("assoPlotsWrapperCombined"+t.sectionId)}}},[t._v(" Combined ")]):t._e()]}))],2):t._e(),n("div",{staticClass:"fixed-info-box hidden",attrs:{id:"fixedInfoBox"+t.sectionId}},[n("div",{staticClass:"fixed-info-box-close",on:{click:function(e){return t.showHidePanel("#fixedInfoBox"+t.sectionId)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("div",{staticClass:"fixed-info-box-content"},t._l(t.dotsClicked,(function(e,r){return n("div",[n("div",[n("strong",{domProps:{innerHTML:t._s(e)}}),t.renderConfig["star key"]&&1==t.checkStared(e,"fixed panel")?n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer","margin-left":"4px"},attrs:{icon:"star-fill"},on:{click:function(n){return t.removeStarItem(e)}}}):t._e(),t.renderConfig["star key"]&&0==t.checkStared(e,"fixed panel")?n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer","margin-left":"4px"},attrs:{icon:"star"},on:{click:function(n){return t.addStarItem(e)}}}):t._e()],1),n("div",[n("strong",{domProps:{innerHTML:t._s("Set this LD reference for: ")}}),t._l(t.plotsList,(function(r,a){return["Combined"!=r&&t.assoData[r].data[e]?n("strong",{staticClass:"group-bubble",style:"background-color:"+t.compareGroupColors[a]+";",domProps:{innerHTML:t._s(r)},on:{click:function(n){return t.resetLdReference(r,e)}}}):t._e(),"Combined"==r?n("strong",{staticClass:"group-bubble",staticStyle:{"background-color":"#dddddd"},domProps:{innerHTML:t._s("All")},on:{click:function(n){return t.resetLdReference("All",e)}}}):t._e()]}))],2),t._l(t.plotsList,(function(r,a){return"Combined"!=r&&t.assoData[r].data[e]?n("div",t._l(t.renderConfig["hover content"],(function(a,i){return n("div",[n("span",{domProps:{innerHTML:t._s(a+"("+r+"):"+t.assoData[r].data[e][a])}})])})),0):t._e()}))],2)})),0)]),t.renderConfig.legend?n("div",{staticClass:"mbm-plot-legend",domProps:{innerHTML:t._s(t.renderConfig.legend)}}):t._e(),t.renderConfig["ld server"]?n("div",{staticClass:"region-plot-default-legend"},[n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#824099cc"}}),n("span",[t._v("Reference variant")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#d0363360"}}),n("span",[t._v("1 > r2 >= 0.8")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#ee982d50"}}),n("span",[t._v("0.8 > r2 >= 0.6")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#4db05240"}}),n("span",[t._v("0.6 > r2 >= 0.4")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#32afd530"}}),n("span",[t._v("0.4 > r2 >= 0.2")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#2074b620"}}),n("span",[t._v("0.2 > r2 > 0")]),n("span",{staticClass:"plot-legend-dot",staticStyle:{"background-color":"#33333320"}}),n("span",[t._v("No data")])]):t._e(),t.renderConfig["ld server"]?n("div",{staticClass:"ld-plots-opener",on:{click:function(e){return t.utils.uiUtils.showHideElement("ldPlotsWrapper"+t.sectionId)}}},[t._v("View P-Value / LD plot(s)")]):t._e(),n("div",{staticClass:"ld-plots-wrapper hidden",attrs:{id:"ldPlotsWrapper"+t.sectionId}},[t._l(t.plotsList,(function(e,r){return[n("h6",{class:"text color-"+r,domProps:{innerHTML:t._s("default"!=e?e+" <small>*Showing only with LD</small>":" <small>*Showing only with LD</small>")}}),n("canvas",{staticClass:"ld-plot",attrs:{id:"ld_plot_"+e.replaceAll(" ","_")+t.sectionId,width:"",height:""},on:{resize:t.onResize,click:function(n){return t.checkPosition(n,e,"LD","click")},mousemove:function(n){return t.checkPosition(n,e,"LD","move")},mouseout:function(n){return t.onMouseOut("ldInfoBox"+e+t.sectionId)}}}),n("div",{staticClass:"ld-info-box hidden",attrs:{id:"ldInfoBox"+e.replaceAll(" ","_")+t.sectionId}})]}))],2),t._l(t.plotsList,(function(e,r){return[n("div",{staticClass:"asso-plots-wrapper",attrs:{id:"assoPlotsWrapper"+e.replaceAll(" ","_")+t.sectionId}},["default"!=e?n("h6",{class:"text color-"+r,domProps:{innerHTML:t._s(e)}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_assoPlot","svg","vector_asso_plot_"+t.sectionId,e.replaceAll(" ","_"),t.sectionId+"_assoPlot")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){t.downloadImage("asso_plot_"+e.replaceAll(" ","_")+t.sectionId,t.sectionId+"_assoPlot","png")}}},[t._v("Download PNG")])])])]),n("canvas",{staticClass:"asso-plot",attrs:{id:"asso_plot_"+e.replaceAll(" ","_")+t.sectionId,width:"",height:""},on:{resize:t.onResize,click:function(n){return t.checkPosition(n,e,"asso","click")},mousemove:function(n){return t.checkPosition(n,e,"asso","move")},mouseleave:function(e){return t.resetPosMarker()},mouseout:function(n){return t.onMouseOut("assoInfoBox"+e+t.sectionId)}}}),n("span",{staticClass:"x-pos-marker",attrs:{id:t.sectionId+"_xPosMarker"}},[t._v("Â ")]),n("div",{staticClass:"asso-info-box hidden",attrs:{id:"assoInfoBox"+e.replaceAll(" ","_")+t.sectionId}})])]})),t.assoData?n("research-region-plot-vector",{ref:t.sectionId+"_assoPlot",attrs:{assoData:t.assoData,ldData:t.globalLDData,recombData:t.recombData,renderConfig:t.renderConfig,colors:t.ldDotColor,margin:t.adjPlotMargin,region:t.searchingRegion,sectionId:t.sectionId,utils:t.utils}}):t._e()],2)])},d=[],h=n("53ca"),p=n("1da1"),f=n("2909"),_=n("3835"),g=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("cb29"),n("4de4"),n("caad"),n("14d9"),n("fb6a"),n("4e82"),n("b0c0"),n("0c47"),n("23dc"),n("4fad"),n("b64b"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("5319"),n("5b81"),n("cc71"),n("0643"),n("2382"),n("4e3e"),n("159b"),n("ddb0"),n("b1e0")),m=n("2ef0"),v=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.sectionId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},y=[],b=n("5698");i["default"].use(g["a"]);var x=i["default"].component("research-region-plot-vector",{props:["assoData","ldData","recombData","renderConfig","colors","margin","region","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{},watch:{},methods:{renderPlot:function(t){var e=this,n=this.assoData[t],r={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},a=".vector-wrapper-".concat(this.sectionId),i=document.querySelector("#assoPlotsWrapper"+t+this.sectionId),o=this.renderConfig["width"]?this.renderConfig["width"]:i.clientWidth-(r.left+r.right),s=this.renderConfig["height"]?this.renderConfig["height"]:200,l=b["select"](a).append("svg").attr("id","vector_asso_plot_"+this.sectionId).attr("width",o+r.left+r.right).attr("height",s+r.top+r.bottom);l.append("g").attr("id","plot").attr("transform","translate(0,0)"),l.select("#plot").style("font-family","Arial").style("font-size","12px").style("text-anchor","middle"),l.select("#plot").append("text").attr("x",r.left+o/2).attr("y",s+r.top+r.bottom-10).text(this.renderConfig["x axis label"]),l.select("#plot").append("text").attr("transform","translate("+(r.bump+20)+","+(r.top+s/2)+")rotate(-90)").attr("x",0).attr("y",0).text(this.renderConfig["y axis label"]),l.select("#plot").append("text").attr("transform","translate("+(r.left+r.right+o-20)+","+(r.top+r.bottom+s)/2+")rotate(-90)").attr("x",0).attr("y",0).text("Recombination Rate (cM/Mb)");var c=b["scaleLinear"]().domain([this.region.start,this.region.end]).range([r.left,o+r.left]);l.select("#plot").append("line").attr("x1",r.left-r.bump).attr("y1",r.top+s+r.bump).attr("x2",r.left+o+r.bump).attr("y2",r.top+s+r.bump).attr("stroke","#000000").style("stroke-width",.7
15);for(var u=Math.ceil((this.region.end-this.region.start)/5),d=0;d<6;d++){var h=c(this.region.start+u*d);l.select("#plot").append("line").attr("x1",h).attr("y1",r.top+s+r.bump).attr("x2",h).attr("y2",r.top+s+2*r.bump);var p=this.region.end-this.region.start,f=p<=1?2:p<=50?1:0,_=this.utils.Formatters.decimalFormatter(this.region.start+d*u,f);_=_>=1e5?Math.round(.001*_)+"k":_,l.select("#plot").append("text").attr("x",h).attr("y",r.top+s+20).style("text-anchor","middle").text(_)}var g=b["scaleLinear"]().domain([Math.floor(n.yAxLow),Math.ceil(n.yAxHigh)]).range([r.top+s,r.top]);l.select("#plot").append("g").attr("transform",(function(t){return"translate("+(r.left-r.bump)+",0)"})).style("font","12px Arial").call(b["axisLeft"](g).ticks(6));var m=b["scaleLinear"]().domain([0,100]).range([r.top+s,r.top]);l.select("#plot").append("g").attr("transform",(function(t){return"translate("+(r.left+o+r.bump)+",0)"})).style("font","12px Arial").call(b["axisRight"](m).ticks(5)),this.recombData.position.map((function(t,n){if(0!=n){var r=c(e.recombData.position[n-1]),a=c(t),i=m(e.recombData.recomb_rate[n-1]),o=m(e.recombData.recomb_rate[n]);l.select("#plot").append("line").attr("x1",r).attr("y1",i).attr("x2",a).attr("y2",o).attr("stroke","#007BFF").style("stroke-width",.75)}}));var v=this.renderConfig["y axis field"],y=this.renderConfig["x axis field"],x=(this.renderConfig["render by"],Object.keys(n.data));x.map((function(r){var a=n.data[r][y];if(a>=e.region.start&&a<=e.region.end){var i=c(a),o=g(n.data[r][v])+2.5,s="#00000030",u=e.renderConfig["ld server"]["ref variant field"],d=n.data[r][u];if(e.ldData[t].data[d]){var h=Math.floor(5*e.ldData[t].data[d]);s=e.colors[h]}if(d==e.ldData[t].refVariant){var p=b["symbol"]().type(b["symbolDiamond"]).size(50);l.select("#plot").append("path").attr("d",p).attr("fill",s).attr("transform","translate("+i+","+o+")").attr("stroke","#000000").style("stroke-width",.5)}else l.select("#plot").append("circle").attr("cx",i).attr("cy",o).attr("r",5).style("fill",s)}}))}}});s()((function(){}));var w=x,C=n("2877"),P=Object(C["a"])(w,v,y,!1,null,null,null),k=P.exports;function M(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */M=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};c(x,o,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==n&&r.call(C,o)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,i,o,s){var l=d(t[a],t,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Object(h["a"])(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=d(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
vendor: 4,406 bytes, line 1
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(h["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(E.prototype),c(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),c(P,l,"Generator"),c(P,o,(function(){return this})),c(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}i["default"].use(g["a"]);var E=i["default"].component("multi-region-plot",{props:["plotData","renderConfig","dataComparisonConfig","regi
1on","plotMargin","compareGroupColors","regionZoom","regionViewArea","pkgData","pkgDataSelected","isSectionPage","sectionId","utils","starItems","colors"],data:function(){return{plotRenderBy:"all",ldColor:["#2074B620","#32AFD520","#4DB05220","#EE982D20","#D0363320"],ldDotColor:["#2074B650","#32AFD550","#4DB05250","#EE982D50","#D0363350","#824099cc"],assoData:{},ldData:{},recombData:"",assoPos:{},ldPos:{},dotsClicked:[],refProperties:{region:null,refVariants:{},groups:[]},fixedRefVariants:{},starGroups:[]}},modules:{},components:{regionPlotVector:k},mounted:function(){window.addEventListener("resize",this.onResize)},created:function(){},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{hoverPos:function(){return this.$root.hoverPos},adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},staredVariants:function(){var t=this;if(this.renderConfig["star key"]&&!this.isSectionPage){var e="";return this.pkgDataSelected.filter((function(e){return e.type==t.renderConfig["star key"]})).map((function(t){e+=t.id})),e}return null},plotsList:function(){var t=this,e=this.renderConfig["ld server"]?this.renderConfig["ld server"]["ref variant field"]:null,n=this.renderConfig["render by"],r=this.renderConfig["y axis field"];if(this.refProperties.region&&this.refProperties.region==this.region||(this.refProperties={region:this.region,refVariants:{},groups:[]},!0),null!=this.plotData){var a=this.plotData,i=[];if(null!=this.dataComparisonConfig){for(var o=this.dataComparisonConfig["fields to compare"][0],s=0,l=Object.entries(a);s<l.length;s++)for(var c=Object(_["a"])(l[s],2),u=(c[0],c[1]),d=0,h=Object.entries(u[o]);d<h.length;d++){var p=Object(_["a"])(h[d],2),g=p[0];p[1];i.push(g)}i=Object(f["a"])(new Set(i)),i.length>1&&i.push("Combined")}else null==this.dataComparisonConfig&&i.push("default");this.assoData={},this.ldData={},this.recombData="",this.assoPos={},this.ldPos={};var m=this.renderConfig["ld server"]?this.renderConfig["ld server"]["populations type"]:null;return i.map((function(i){if(t.assoData[i]={yAxHigh:null,yAxLow:null,data:{},variantData:{}},t.ldData[i]){var o=t.refProperties.refVariants[i];a[o]||(t.ldData[i]={refVariant:null,population:[],data:null},t.refProperties.refVariants[i]=null)}else t.ldData[i]={refVariant:null,population:[],data:null};if("Combined"!=i&&(t.assoPos[i]={},t.ldPos[i]={}),"default"!=i)for(var s=0,l=Object.entries(a);s<l.length;s++){var c=Object(_["a"])(l[s],2),u=c[0],d=c[1];if("Combined"!=i){var h=d[r][i];if(h){if("fixed"==m)t.ldData[i].population=t.renderConfig["ld server"]["fixed population"];else if("dynamic"==m){var p=d[t.renderConfig["ld server"]["populations field"]][i];t.ldData[i].population.push(p)}else t.ldData[i].population=null;t.refProperties.refVariants[i]?t.ldData[i].refVariant=t.refProperties.refVariants[i]:t.ldData[i].refVariant=null==t.assoData[i].yAxHigh||h>t.assoData[i].yAxHigh?d[e]:t.ldData[i].refVariant,t.assoData[i].yAxHigh=null==t.assoData[i].yAxHigh||h>t.assoData[i].yAxHigh?Math.ceil(h):t.assoData[i].yAxHigh,t.assoData[i].yAxLow=null==t.assoData[i].yAxLow||h<t.assoData[i].yAxLow?Math.floor(h):t.assoData[i].yAxLow,t.assoData[i].data[u]={};for(var g=0,v=Object.entries(d);g<v.length;g++){var y=Object(_["a"])(v[g],2),b=y[0],x=y[1];null!=t.dataComparisonConfig?t.assoData[i].data[u][b]=1==t.dataComparisonConfig["fields to compare"].includes(b)?x[i]:x:null==t.dataComparisonConfig&&(t.assoData[i].data[u][b]=x)}var w=t.assoData[i].data[u][e];t.assoData[i].variantData[w]=t.assoData[i].data[u]}}}else if("default"==i){var C=null;a.map((function(a){var o=a[r];if(o){if("fixed"==m)t.ldData[i].population=t.renderConfig["ld server"]["fixed population"];else if("dynamic"==m){var s=a[t.renderConfig["ld server"]["populations field"]];t.ldData[i].population.push(s)}else t.ldData[i].population=null;var l=a[e],c=a[n];C=null==t.assoData[i].yAxHigh||o>t.assoData[i].yAxHigh?l:C,t.assoData[i].yAxHigh=null==t.assoData[i].yAxHigh?Math.ceil(o):o>t.assoData[i].yAxHigh?o:Math.ceil(t.assoData[i].yAxHigh),t.assoData[i].yAxLow=null==t.assoData[i].yAxLow?Math.floor(o):o<t.assoData[i].yAxLow?o:Math.floor(t.assoData[i].yAxLow),t.assoData[i].data[c]={};for(var u=0,d=Object.entries(a);u<d.length;u++){var h=Object(_["a"])(d[u],2),p=h[0],f=h[1];null!=t.dataComparisonConfig?t.assoData[i].data[c][p]=1==t.dataComparisonConfig["fields to compare"].includes(p)?f[i]:f:null==t.dataComparisonConfig&&(t.assoData[i].data[c][p]=f)}var g=t.assoData[i].data[c][e];t.assoData[i].variantData[g]=t.assoData[i].data[c]}})),t.fixedRefVariants[i]&&t.assoData[i].data[t.fixedRefVariants[i]]?t.ldData[i].refVariant=t.fixedRefVariants[i]:t.ldData[i].refVariant=C}var P=Object(f["a"])(new Set(t.ldData[i].population));t.ldData[i].population=P.length>1?"ALL":t.renderConfig["ld server"]?t.renderConfig["ld server"].populations[P[0]]:null})),1==i.includes("Combined")&&i.map((function(e){var n=t.assoData[e].yAxHigh,r=t.assoData[e].yAxLow;t.assoData.Combined.yAxHigh=null==t.assoData.Combined.yAxHigh||n>t.assoData.Combined.yAxHigh?Math.ceil(n):t.assoData.Combined.yAxHigh,t.assoData.Combined.yAxLow=null==t.assoData.Combined.yAxLow||r<t.assoData.Combined.yAxLow?Math.floor(r):t.assoData.Combined.yAxLow})),this.setUpWrappers(),i}return null},searchingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=parseInt(e[0],10),r=parseInt(e[1],10),a=r-n;if(this.regionZoom>0){var i=Math.round(a*(this.regionZoom/200)),o=Math.round(i*(this.regionViewArea/100));t["start"]=n+i+o,t["end"]=r-i+o}else 0==this.regionZoom&&(t["start"]=n,t["end"]=r);return t},globalLDData:function(){return null!==this.$store.state.topLevelLDData?this.$store.state.topLevelLDData:this.ldData}},watch:{hoverPos:function(t){this.renderPlots()},staredVariants:function(t){this.renderPlots()},starItems:function(t){this.starGroups=Object(f["a"])(new Set(t.map((function(t){return t.section})))).sort(),this.renderPlots()},ldData:{handler:function(t,e){if(!Object(m["isEqual"])(t,e)&&"send"===this.renderConfig.propagateLD){var n={data:t,server:this.renderConfig["ld server"]};this.$emit("ld-data-loaded",n)}},deep:!0}}
1,methods:{downloadImage:function(t,e,n,r,a,i){if("svg"==n){var o=i;this.$refs[o].renderPlot(a),this.utils.uiUtils.downloadImg(t,e,n,r)}else"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},onResize:function(t){this.renderPlots()},getColumns:function(t){var e,n=this;if(null!=this.dataComparisonConfig)for(var r=0,a=Object.entries(this.plotData);r<a.length;r++){var i=Object(_["a"])(a[r],2),o=(i[0],i[1]);o[this.renderConfig["star key"]]==t&&(e=o)}else e=this.plotData.filter((function(e){return e[n.renderConfig["star key"]]==t}))[0];return e},checkStared:function(t,e){var n,r=this,a=t;if(e)for(var i=0,o=Object.entries(this.assoData);i<o.length;i++){var s=Object(_["a"])(o[i],2),l=(s[0],s[1]);l.data[t]&&(a=l.data[t][this.renderConfig["star key"]])}return n=this.isSectionPage?this.starItems.filter((function(t){return t.type==r.renderConfig["star key"]})).map((function(t){return t.id})):this.pkgDataSelected.filter((function(t){return t.type==r.renderConfig["star key"]})).map((function(t){return t.id})),!!n.includes(a)},addStarItem:function(t){for(var e,n=0,r=Object.entries(this.assoData);n<r.length;n++){var a=Object(_["a"])(r[n],2),i=(a[0],a[1]);i.data[t]&&(e=i.data[t][this.renderConfig["star key"]])}if(this.isSectionPage){var o=Object(f["a"])(new Set(this.starItems)),s={type:this.renderConfig["star key"],id:e,columns:this.getColumns(e),section:this.sectionId};o.push(s),this.$emit("on-star",o)}else this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:e,action:"add"})},removeStarItem:function(t){for(var e,n=0,r=Object.entries(this.assoData);n<r.length;n++){var a=Object(_["a"])(r[n],2),i=(a[0],a[1]);i.data[t]&&(e=i.data[t][this.renderConfig["star key"]])}if(this.isSectionPage){var o=Object(f["a"])(new Set(this.starItems)).filter((function(t){return t.id!=e}));this.$emit("on-star",o)}else this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:e,action:"remove"})},resetLdReference:function(t,e){var n=this,r=this.renderConfig["ld server"]["ref variant field"],a=this.assoData[t].data[e][r];this.showHidePanel("#fixedInfoBox"+this.sectionId),"All"!=t?(this.ldData[t].refVariant=a,this.fixedRefVariants[t]=a,this.ldData[t].data=null,this.refProperties.refVariants[t]=a):"All"==t&&this.plotsList.map((function(t){"combined"!=t&&(n.ldData[t].refVariant=a,n.fixedRefVariants[t]=a,n.ldData[t].data=null,n.refProperties.refVariants[t]=a)})),this.callForLDData()},showHidePanel:function(t){var e=document.querySelector(t);e.classList.contains("hidden")?e.classList.remove("hidden"):e.classList.add("hidden")},showHideSplitPlots:function(){this.plotsList.map((function(t){if("Combined"!=t){var e=document.querySelector("#plotsWrapper"+t.replaceAll(" ","_"));e.classList.contains("hidden")?e.classList.remove("hidden"):e.classList.add("hidden")}}))},getDotsOnPosition:function(t,e,n,r){for(var a="asso"==t?this.assoPos[e]:this.ldPos[e],i=[],o=-5;o<=5;o++)for(var s=-5;s<=5;s++)void 0!=a[n+o]&&void 0!=a[n+o][r+s]&&(i=i.concat(a[n+o][r+s]));return i},resetPosMarker:function(){var t=document.getElementById(this.sectionId+"_xPosMarker");t.style.left="0px",t.style.top="0px",t.style.height="1px"},checkPosition:function(t,e,n,r){var a=this,i=t.target.getBoundingClientRect(),o=Math.floor(t.clientX-i.left),s=Math.floor(t.clientY-i.top),l=document.getElementById("assoPlotsWrapper"+e+this.sectionId).getBoundingClientRect();if(this.getPosInfo(o,s,e,n,r),"move"==r&&o>=this.adjPlotMargin.left/2&&o<=i.width-this.adjPlotMargin.right/2&&s>=i.height-this.adjPlotMargin.bottom/2){var c=document.getElementById(this.sectionId+"_xPosMarker");c.style.left=o+"px",c.style.top=l.height-i.height+"px",c.style.height=i.height-this.adjPlotMargin.bottom/2+"px"}else this.resetPosMarker();if("click"==r&&o>=this.adjPlotMargin.left/2&&o<=i.width-this.adjPlotMargin.right/2&&s>=i.height-this.adjPlotMargin.bottom/2){var u=i.width-(this.adjPlotMargin.left/2+this.adjPlotMargin.right/2),d=o-this.adjPlotMargin.left/2,h=this.convertXPos(d,u),p=!1,f=[];this.hoverPos.length>0&&(this.hoverPos.map((function(t){var e=2*Math.floor((a.searchingRegion.end-a.searchingRegion.start)/u);t>=h-e&&t<=h+e?p=!0:f.push(t)})),this.$root.hoverPos=f),p||this.$root.hoverPos.push(h)}},convertXPos:function(t,e){var n=(this.searchingRegion.end-this.searchingRegion.start)/e,r=t*n+this.searchingRegion.start;return Math.floor(r)},getPosInfo:function(t,e,n,r,a){var i=this,o=this.getDotsOnPosition(r,n,t,e);o=Object(f["a"])(new Set(o));var s="asso"==r?"#assoInfoBox"+n.replaceAll(" ","_")+this.sectionId:"#ldInfoBox"+n.replaceAll(" ","_")+this.sectionId,l="asso"==r?"#asso_plot_"+n.replaceAll(" ","_")+this.sectionId:"#ld_plot_"+n.replaceAll(" ","_")+this.sectionId,c=document.querySelector(s),u=document.querySelector(l);
1if(o.length>0)if("move"==a){var d=o.length>5?"<span class='info-box-direction'>Viewing 5 of "+o.length+" variants. Click to view full list or to change LD reference variant.</span><br />":"<span class='info-box-direction'>Click to change LD reference variant.</span><br />";o.map((function(t,e){if(e<5){if(d+="<strong>"+t+"</strong>",i.renderConfig["star key"]){var r=i.assoData[n].data[t][i.renderConfig["star key"]];d+=1==i.checkStared(r)?" <span style='color:#ffcc00'>★</span>":" <span style='color:#ffcc00'>☆</span>"}d+="<br />",i.renderConfig["hover content"].map((function(e){"Combined"!=n?d+=e+": "+i.assoData[n].data[t][e]+"<br />":"Combined"==n&&i.plotsList.map((function(n){"Combined"!=n&&i.assoData[n].data[t]&&(d+=e+"("+n+"): "+i.assoData[n].data[t][e]+"<br />")}))}))}})),c.classList.remove("hidden"),c.innerHTML=d,c.style.top=e+u.offsetTop+25+"px";var h=t/u.offsetWidth;c.style.left=t-c.offsetWidth*h+u.offsetLeft+"px"}else"click"==a&&(this.dotsClicked=o,this.showHidePanel("#fixedInfoBox"+this.sectionId));else c.classList.add("hidden")},onMouseOut:function(t){this.utils.uiUtils.removeOnMouseOut(t.replaceAll(" ","_"),1e3)},setUpWrappers:function(){this.searchingRegion&&this.callForRecombData()},callForRecombData:function(){var t=this;return Object(p["a"])(M().mark((function e(){var n,r;return M().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.renderConfig["genome reference"]&&"GRCh38"==t.renderConfig["genome reference"]?n="https://portaldev.sph.umich.edu/api/v1/annotation/recomb/results/?build=GRCh38&filter=chromosome eq '"+t.searchingRegion.chr+"' and position gt "+t.searchingRegion.start+" and position lt "+t.searchingRegion.end:(!t.renderConfig["genome reference"]||t.renderConfig["genome reference"]&&"GRCh37"==t.renderConfig["genome reference"])&&(n="https://portaldev.sph.umich.edu/api/v1/annotation/recomb/results/?filter=id in 15 and chromosome eq '"+t.searchingRegion.chr+"' and position gt "+t.searchingRegion.start+" and position lt "+t.searchingRegion.end),e.next=3,fetch(n).then((function(t){return t.json()}));case 3:r=e.sent,t.recombData={},null==r.error&&(t.recombData["position"]=r.data.position,t.recombData["recomb_rate"]=r.data.recomb_rate,t.callForLDData());case 6:case"end":return e.stop()}}),e)})))()},callForLDData:function(){var t=this;return Object(p["a"])(M().mark((function e(){var n,r,a,i,o,s,l,c;return M().wrap((function(e){while(1)switch(e.prev=e.next){case 0:n=document.querySelectorAll(".region-plots-wrapper"),n.forEach((function(t){t.classList.remove("hidden")})),r=null,a=0;case 4:if(!(a<t.plotsList.length)){e.next=11;break}if("Combined"==t.plotsList[a]||null!=t.ldData[t.plotsList[a]].data){e.next=8;break}return r=t.plotsList[a],e.abrupt("break",11);case 8:a++,e.next=4;break;case 11:if(null==r||!t.ldData[r].population||!t.ldData[r].refVariant){e.next=19;break}return t.renderConfig["genome reference"]&&"GRCh38"==t.renderConfig["genome reference"]?i="https://portaldev.sph.umich.edu/ld/genome_builds/GRCh38/references/1000G/populations/"+t.ldData[r].population+"/variants?correlation=rsquare&variant="+t.ldData[r].refVariant+"&chrom="+t.searchingRegion.chr+"&start="+t.searchingRegion.start+"&stop="+t.searchingRegion.end+"&limit=100000":(!t.renderConfig["genome reference"]||t.renderConfig["genome reference"]&&"GRCh37"==t.renderConfig["genome reference"])&&(i="https://portaldev.sph.umich.edu/ld/genome_builds/GRCh37/references/1000G/populations/"+t.ldData[r].population+"/variants?correlation=rsquare&variant="+t.ldData[r].refVariant+"&chrom="+t.searchingRegion.chr+"&start="+t.searchingRegion.start+"&stop="+t.searchingRegion.end+"&limit=100000"),e.next=15,fetch(i).then((function(t){return t.json()}));case 15:o=e.sent,null==o.error&&(s={},o.data.variant2.map((function(t,e){s[t]=o.data.correlation[e]})),t.ldData[r].data=s,t.callForLDData()),e.next=30;break;case 19:l=M().mark((function e(){var n;return M().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if("Combined"==t.plotsList[c]){e.next=4;break}return n=t.plotsList[c],Object.keys(t.plotData).map((function(e){t.plotData[e]["LDS"]=t.plotData[e]["LDS"]?t.plotData[e]["LDS"]:{},t.plotData[e]["LDS"][n]=t.renderConfig["ld server"]?t.ldData[n].data[e]:null})),e.abrupt("return",1);case 4:case"end":return e.stop()}}),e)})),c=0;case 21:if(!(c<t.plotsList.length)){e.next=28;break}return e.delegateYield(l(),"t0",23);case 23:if(!e.t0){e.next=25;break}return e.abrupt("break",28);case 25:c++,e.next=21;break;case 28:t.isSectionPage||t.$store.dispatch("filteredData",t.plotData),t.renderPlots();case 30:t.$forceUpdate();case 31:case"end":return e.stop()}}),e)})))()},renderPlots:function(t){var e=this,n=this.searchingRegion.start,r=this.searchingRegion.end,a=2*document.querySelector(".asso-plots-wrapper").clientWidth,i=700,o=this.renderConfig.height?2*this.renderConfig.height+this.adjPlotMargin.top+this.adjPlotMargin.bottom:600+this.adjPlotMargin.top+this.adjPlotMargin.bottom,s=a-(this.adjPlotMargin.left+this.adjPlotMargin.right),l=i-this.adjPlotMargin.left-this.adjPlotMargin.right,c=this.renderConfig.height?2*this.renderConfig.height:600,u=this.adjPlotMargin.bump;this.plotsList.map((function(t){var d,h;d=document.getElementById("asso_plot_"+t.replaceAll(" ","_")+e.sectionId),d.setAttribute("width",a),d.setAttribute("height",o),d.setAttribute("style","width:"+a/2+"px;
1height:"+o/2+"px;"),h=d.getContext("2d"),h.clearRect(0,0,a,o),e.renderAxis(h,s,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,r,n,u,"asso",t),h.fillStyle="#ff880025",h.fillRect(e.adjPlotMargin.left,c+e.adjPlotMargin.top+2*e.adjPlotMargin.bump+12,s,12);var p=s/(r-n);e.hoverPos.length>0&&e.hoverPos.map((function(t){var r=e.adjPlotMargin.top-e.adjPlotMargin.bump,a=e.adjPlotMargin.top+c+3*e.adjPlotMargin.bump,i=e.adjPlotMargin.left+(t-n)*p;e.utils.plotUtils.renderDashedLine(h,i,r,i,a,1,"#ff0000",[6,2])})),e.renderRecombLine(h,s,c,r,n),e.renderDots(h,s,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,r,n,u,"asso",t),d=document.getElementById("ld_plot_"+t.replaceAll(" ","_")+e.sectionId),d.setAttribute("width",i),d.setAttribute("height",o),d.setAttribute("style","width:"+i/2+"px;height:"+o/2+"px;"),h=d.getContext("2d"),h.clearRect(0,0,i,o),e.renderAxis(h,l,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,1,0,u,"LD",t),e.renderDots(h,l,c,e.assoData[t].yAxHigh,e.assoData[t].yAxLow,1,0,u,"LD",t)}))},renderDots:function(t,e,n,r,a,i,o,s,l,c){var u=this,d=this.adjPlotMargin.left,h=this.adjPlotMargin.top+n,p=e/(i-o),f=n/(r-a),g=this.renderConfig["ld server"]?this.renderConfig["ld server"]["ref variant field"]:"receive"===this.renderConfig.propagateLD?"LD Variant ID":null,m=(this.renderConfig["render by"],this.renderConfig["star key"]),v=this.renderConfig["x axis field"],y=this.renderConfig["y axis field"],b=document.createElement("canvas"),x=b.getContext("2d"),w=function(t,e,n){return x.font=e+"px "+n,x.measureText(t).width};if("asso"==l){if(this.assoPos[c]={},this.renderConfig["star key"]&&this.isSectionPage){var C=this.adjPlotMargin.top-3*this.adjPlotMargin.bump,P=this.adjPlotMargin.top+n+2*this.adjPlotMargin.bump;this.starItems.map((function(e){var n=d+(e.columns[v]-o)*p,r=u.colors.moderate[u.starGroups.indexOf(e.section)%16];u.utils.plotUtils.renderDashedLine(t,n,C,n,P,3,r,[6,2]),u.renderDot(t,n,P,r,5)}));var k=this.adjPlotMargin.bump;this.starGroups.map((function(e,r){var a=u.colors.bold[r],i=u.adjPlotMargin.top+n+u.adjPlotMargin.bottom-u.adjPlotMargin.bump;u.utils.plotUtils.renderDashedLine(t,k,i,k+50,i,3,a,[12,4]),k+=60,t.font="24px Arial",t.textAlign="start",t.fillStyle=a,t.fillText(e,k,i),k+=w(e,24,"Arial")+u.adjPlotMargin.bump}))}if("Combined"!=c)for(var M=0,E=Object.entries(this.assoData[c].data);M<E.length;M++){var D=Object(_["a"])(E[M],2),O=D[0],L=D[1];if(L[v]>=o&&L[v]<=i){var j=d+(L[v]-o)*p,S=h-(L[y]-a)*f;this.feedPosData(this.assoPos[c],Math.round(j/2),Math.round(S/2),O);var A=L[g],I=L[m],T="receive"===this.renderConfig.propagateLD?this.globalLDData.default.data[this.getGlobalDot(L)]:this.ldData[c].data[A],B=A||"receive"===this.renderConfig.propagateLD?this.getDotColor(T):"#00000030";A==this.ldData[c].refVariant?this.renderConfig["star key"]&&1==this.checkStared(I)?this.utils.plotUtils.renderStar(t,j,S,5,10,6,B,B):A?this.renderDiamond(t,j,S,B):this.renderDot(t,j,S,B):this.renderConfig["star key"]&&1==this.checkStared(I)?this.utils.plotUtils.renderStar(t,j,S,5,10,6,B,B):this.renderDot(t,j,S,B)}}if("Combined"==c){var R={};this.plotsList.map((function(e,n){if("Combined"!=e)for(var r=0,s=Object.entries(u.assoData[e].data);r<s.length;r++){var l=Object(_["a"])(s[r],2),g=l[0],m=l[1];if(m[v]>=o&&m[v]<=i){if(R[g])R[g]&&(R[g].xValue.push(m[v]),R[g].yValue.push(m[y]));else{var b={xValue:[],yValue:[]};b.xValue.push(m[v]),b.yValue.push(m[y]),R[g]=b}var x=d+(m[v]-o)*p,w=h-(m[y]-a)*f;u.feedPosData(u.assoPos[c],Math.round(x/2),Math.round(w/2),g);var C=u.compareGroupColors[n];g==u.ldData[e].refVariant?u.renderConfig["star key"]&&1==u.checkStared(g)?u.utils.plotUtils.renderStar(t,x,w,5,10,6,C,C):u.ldData[e].refVariant?u.renderDiamond(t,x,w,C):u.renderDot(t,x,w,C):u.renderConfig["star key"]&&1==u.checkStared(g)?u.utils.plotUtils.renderStar(t,x,w,5,10,6,C,C):u.renderDot(t,x,w,C)}}})),this.renderConntingLine(t,d,h,o,a,p,f,R)}}if("LD"==l&&this.renderConfig["ld server"]){if(this.ldPos[c]={},"Combined"!=c)if(0==Object.keys(this.ldData[c].data).length)t.textAlign="center",t.fillStyle="#000000",t.fillText("No LD data loaded against "+this.ldData[c].refVariant,this.adjPlotMargin.left+e/2,this.adjPlotMargin.top+n/2);else for(var F=0,G=Object.entries(this.ldData[c].data);F<G.length;F++){var W=Object(_["a"])(G[F],2),U=W[0],q=W[1];if(this.assoData[c].variantData[U]){var N=d+q*p,K=h-(this.assoData[c].variantData[U][y]-a)*f;this.feedPosData(this.ldPos[c],Math.round(N/2),Math.round(K/2),U);var V=this.getDotColor(q);U==this.ldData[c].refVariant?this.renderConfig["star key"]&&1==this.checkStared(U)?this.utils.plotUtils.renderStar(t,N,K,5,10,6,V,V):this.renderDiamond(t,N,K,V):this.renderConfig["star key"]&&1==this.checkStared(U)?this.utils.plotUtils.renderStar(t,N,K,5,10,6,V,V):this.renderDot(t,N,K,V)}}if("Combined"==c){var z={},$=this.renderConfig["y axis field"];this.plotsList.map((function(e,n){if("Combined"!=e){var r=u.compareGroupColors[n];if(0!=Object.keys(u.ldData[e].data).length)for(var i=0,o=Object.entries(u.ldData[e].data);i<o.length;i++){var s=Object(_["a"])(o[i],2),l=s[0],g=s[1];if(u.assoData[e].variantData[l]){if(z[l])z[l]&&(z[l].xValue.push(g),z[l].yValue.push(u.assoData[e].variantData[l][$]));else{var m={xValue:[],yValue:[]};m.xValue.push(g),m.yValue.push(u.assoData[e].variantData[l][$]),z[l]=m}var v=d+g*p,y=h-(u.assoData[e].variantData[l][$]-a)*f;u.feedPosData(u.ldPos[c],Math.round(v/2),Math.round(y/2),l),l==u.ldData[e].refVariant?u.renderConfig["star key"]&&1==u.checkStared(l)?u.utils.plotUtils.renderStar(t,v,y,5,10,
16,r,r):u.renderDiamond(t,v,y,r):u.renderConfig["star key"]&&1==u.checkStared(l)?u.utils.plotUtils.renderStar(t,v,y,5,10,6,r,r):u.renderDot(t,v,y,r)}}}})),this.renderConntingLine(t,d,h,o,a,p,f,z)}}},feedPosData:function(t,e,n,r){var a=Math.floor(e),i=Math.floor(n);t[a]?(t[a][i]||(t[a][i]=[]),t[a][i].push(r)):(t[a]={},t[a][i]=[],t[a][i].push(r))},getDotColor:function(t){if(void 0==t)return"#00000030";var e=Math.floor(5*t);return this.ldDotColor[e]},getGlobalDot:function(t){var e="Variant ID",n=t[e].split("_"),r=n[0].replace("chr",""),a=n[1],i=n[2],o=n[3],s="".concat(r,":").concat(a,"_").concat(i,"/").concat(o);return s},renderConntingLine:function(t,e,n,r,a,i,o,s){for(var l=0,c=Object.entries(s);l<c.length;l++){var u=Object(_["a"])(c[l],2),d=(u[0],u[1]);if(d.xValue.length>1)for(var h=0;h<d.xValue.length-1;h++){var p=e+(d.xValue[h]-r)*i,f=e+(d.xValue[h+1]-r)*i,g=n-(d.yValue[h]-a)*o,m=n-(d.yValue[h+1]-a)*o;t.beginPath(),t.lineWidth=1,t.strokeStyle="#00000050",t.moveTo(p,g),t.lineTo(f,m),t.stroke()}}},renderDot:function(t,e,n,r,a){t.fillStyle=r,t.lineWidth=0,t.beginPath();var i=a||9;t.arc(e,n,i,0,2*Math.PI),t.fill()},renderDiamond:function(t,e,n,r){var a=18,i=24,o=e,s=n;t.save(),t.fillStyle=r,t.lineWidth=0,t.beginPath(),t.moveTo(o,s-i/2),t.lineTo(o-a/2,s),t.lineTo(o,s+i/2),t.lineTo(o+a/2,s),t.closePath(),t.strokeStyle="#824099",t.stroke(),t.fill(),t.restore()},renderRecombLine:function(t,e,n,r,a){var i=this,o=this.recombData,s=e/(r-a),l=n/100;t.beginPath(),t.lineWidth=1,t.strokeStyle="#007BFF",o&&o.position&&o.position.map((function(e,r){var c=(e-a)*s,u=o.recomb_rate[r]*l,d=(o.position[r+1]-a)*s,h=o.recomb_rate[r+1]*l;t.moveTo(i.adjPlotMargin.left+c,i.adjPlotMargin.top+n-u),t.lineTo(i.adjPlotMargin.left+d,i.adjPlotMargin.top+n-h),t.stroke()}))},renderAxis:function(t,e,n,r,a,i,o,s,l,c){var u=r-a,d=u<=1?2:u<=50?1:0,h=i-o,p=h<=1?2:h<=50?1:0;t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="24px Arial",t.fillStyle="#000000",t.setLineDash([]),t.moveTo(this.adjPlotMargin.left-s,this.adjPlotMargin.top),t.lineTo(this.adjPlotMargin.left-s,n+this.adjPlotMargin.top+s),t.stroke();var f=Math.round(this.adjPlotMargin.left+e+s);"asso"==l&&(t.moveTo(f,this.adjPlotMargin.top),t.lineTo(f,n+this.adjPlotMargin.top+s),t.stroke()),t.moveTo(this.adjPlotMargin.left-s,n+this.adjPlotMargin.top+s),t.lineTo("asso"==l?e+this.adjPlotMargin.left+s:e+this.adjPlotMargin.left,n+this.adjPlotMargin.top+s),t.stroke();for(var _=(r-a)/5,g=n/5,m=0;m<6;m++){var v=this.adjPlotMargin.top+m*g,y=Math.floor(v);t.moveTo(this.adjPlotMargin.left-2*s,y),t.lineTo(this.adjPlotMargin.left-s,y),t.stroke(),t.textAlign="right";var b=this.utils.Formatters.decimalFormatter(a+m*_,d);b+=u>=1e5?"k":"",t.fillText(b,this.adjPlotMargin.left-3*s,this.adjPlotMargin.top+n+s-m*g)}if("asso"==l)for(var x=20,w=n/5,C=0,P=0;P<6;P++){var k=this.adjPlotMargin.top+P*w,M=Math.floor(k);t.moveTo(f,M),t.lineTo(f+s,M),t.stroke(),t.textAlign="left",t.fillText(C+P*x,this.adjPlotMargin.left+e+3*s,this.adjPlotMargin.top+n+5-P*w)}for(var E="asso"==l?Math.ceil((i-o)/5):.2,D=e/5,O=0;O<6;O++){var L=this.adjPlotMargin.left+O*D,j=Math.floor(L);t.moveTo(j,this.adjPlotMargin.top+n+s),t.lineTo(j,this.adjPlotMargin.top+n+2*s),t.stroke(),t.textAlign="center";var S=this.utils.Formatters.decimalFormatter(o+O*E,p);S=S>=1e5?Math.round(.001*S)+"k":S,t.fillText(S,j,this.adjPlotMargin.top+n+4.5*s)}if(t.textAlign="center",t.rotate(-2*Math.PI/4),t.fillText(this.renderConfig["y axis label"],-(this.adjPlotMargin.top+n/2),s+24),"asso"==l&&t.fillText("Recombination Rate (cM/Mb)",-(this.adjPlotMargin.top+n/2),2*this.adjPlotMargin.left+e-(s+24)),t.rotate(-2*Math.PI/4*3),t.fillText("LD"==l?"LD(r2)":this.renderConfig["x axis label"],e/2+this.adjPlotMargin.left,this.adjPlotMargin.top+this.adjPlotMargin.bottom+n-24),"LD"==l&&"Combined"==c)for(var A=e/5,I=0;I<5;I++){var T=this.adjPlotMargin.left+I*A,B=Math.floor(T);t.fillStyle=this.ldColor[I],t.fillRect(B,this.adjPlotMargin.top,A-1,n)}}}});s()((function(){}));var D=E,O=(n("cda2"),Object(C["a"])(D,u,d,!1,null,"71108e33",null)),L=O.exports,j=n("a916"),S=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12"},[t.localGeneTypes?n("div",{staticClass:"genes-track-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Genes "),n("b-icon",{attrs:{icon:"gear-fill"}}
1)],1),n("ul",{staticClass:"options"},[n("li",[n("input",{staticClass:"chkbox",attrs:{type:"checkbox"},on:{click:function(e){return t.utils.uiUtils.showHideElement("genesTrackWrapper"+t.sectionId)}}}),n("label",[t._v(" Hide track")])]),n("li",[n("input",{staticClass:"chkbox",attrs:{type:"checkbox",id:t.sectionId+"GenesTrackAll"},domProps:{checked:!!t.plotConfig["genes track"]["show all biotypes"]},on:{click:function(e){return t.checkAll()}}}),n("label",[t._v(" Show all biotypes")])]),t._l(t.localGeneTypes,(function(e){return n("li",{key:e},[n("input",{staticClass:"chkbox",attrs:{type:"checkbox",id:t.sectionId+e},domProps:{value:e,checked:!("protein_coding"!=e&&!t.plotConfig["genes track"]["show all biotypes"])},on:{click:function(e){return t.renderTrack(t.localGenesData)}}}),n("label",{attrs:{for:e}},[t._v(t._s(e.replaceAll("_"," ")))])])})),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_genesTrack","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("genesTrack"+t.sectionId,t.sectionId+"_genesTrack","png")}}},[t._v("Download PNG")])])],2)]):t._e(),n("div",{staticClass:"genes-plot-wrapper",attrs:{id:"genesTrackWrapper"+t.sectionId}},[n("canvas",{attrs:{id:"genesTrack"+t.sectionId,width:"",height:""},on:{resize:t.onResize}})])]),t.renderingGenes.length>0?n("research-genes-track-vector",{ref:t.sectionId+"_genesTrack",attrs:{genesData:t.renderingGenes,renderConfig:t.plotConfig,margin:t.adjPlotMargin,region:t.viewingRegion,sectionId:t.sectionId,utils:t.utils}}):t._e()],1)},A=[],I=(n("a9e3"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.sectionId,attrs:{id:"vector_wrapper_"+t.sectionId}})])}),T=[];i["default"].use(g["a"]);var B=i["default"].component("research-genes-track-vector",{props:["genesData","renderConfig","colors","margin","region","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{},watch:{},methods:{renderPlot:function(){var t=this,e=".vector-wrapper-".concat(this.sectionId),n=document.querySelector("#genesTrackWrapper"+this.sectionId),r={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},a=this.renderConfig["width"]?this.renderConfig["width"]:n.clientWidth-(r.left+r.right),i=30,o=i*this.genesData.length,s=b["select"](e).append("svg").attr("id","genesTrack"+this.sectionId).attr("width",a+r.left+r.right).attr("height",o+r.top);s.append("g").attr("id","genesTrackVector").attr("transform","translate(0,0)").style("font-family","Arial").style("font-size","12px").style("text-anchor","middle");var l=b["scaleLinear"]().domain([this.region.start,this.region.end]).range([r.left,a+r.left]);this.genesData.map((function(e,n){e.map((function(e){var a=r.top+n*i,o="â",c="â",u="+"==e.strand?e.gene_name+" "+c:o+" "+e.gene_name,d=e.start<=t.region.start?t.region.start:e.start,h=e.end>=t.region.end?t.region.end:e.end,p=d+(h-d)/2;s.select("#genesTrackVector").append("text").attr("x",l(p)).attr("y",a).attr("font-weight","700").attr("font-style","italic").text(u),s.select("#genesTrackVector").append("line").attr("x1",l(d)).attr("y1",a+10).attr("x2",l(h)).attr("y2",a+10).attr("stroke","#000000").style("stroke-width",.75),e.exons.map((function(e){if(e.start<t.region.end&&e.end>t.region.start){var n=l(e.end)-l(e.start);n=n<1?1:n,s.select("#genesTrackVector").append("rect").attr("x",l(e.start)).attr("y",a+5).attr("height",10).attr("width",n).style("fill","#000000")}}))}))}))}}});s()((function(){}));var R=B,F=Object(C["a"])(R,I,T,!1,null,null,null),G=F.exports;function W(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */W=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new j(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};c(x,o,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(S([])));C&&C!==n&&r.call(C,o)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(a,i,o,s){var l=d(t[a],t,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Object(h["a"])(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=d(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
1(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(h["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),c(M.prototype,s,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),c(P,l,"Generator"),c(P,o,(function(){return this})),c(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}i["default"].use(g["a"]);var U=i["default"].component("multi-genes-track",{props:["region","genesData","plotConfig","plotType","plotMargin","regionZoom","regionViewArea","utils","sectionId","starItems","hoverPos"],data:function(){return{plotRendered:0,localGenesData:null,localGeneTypes:null,renderingGenes:[]}},modules:{},components:{genesTrackVector:G},mounted:function(){window.addEventListener("resize",this.onResize),this.genesData?this.renderTrack(this.genesData):this.getGenesInRegion(this.region)},created:function(){},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{adjPlotMargin:function(){var t=this.plotConfig["plot margin"]?this.plotConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},searchingRegion:function(){var t={},e=this.region.split(":")[1].split("-");return t["start"]=e[0],t["end"]=e[1],t},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},codingGenes:function(){var t=this.genesData;return t}},watch:{codingGenes:function(t){this.renderTrack(this.genesData)},viewingRegion:{handler:function(t,e){this.genesData?this.renderTrack(this.genesData):this.getGenesInRegion(t.chr+":"+t.start+"-"+t.end)},deep:!0,immediate:!0},starItems:function(t){this.genesData?this.renderTrack(this.genesData):this.renderTrack(this.localGenesData)}},methods:{downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.sectionId+"_genesTrack"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"genesTrack"+this.sectionId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},onResize:function(t){this.genesData?this.renderTrack(this.genesData):this.renderTrack(this.localGenesData)},checkAll:function(){var t=this;document.getElementById(this.sectionId+"GenesTrackAll").checked?this.localGeneTypes.map((function(e){document.getElementById(t.sectionId+e).checked=!0})):this.localGeneTypes.map((function(e){"protein_coding"!=e&&(document.getElementById(t.sectionId+e).checked=!1)})),this.renderTrack(this.localGenesData)},sortGenesByRegion:function(t){var e=this,n=[],r=0,a=document.createElement("canvas"),i=a.getContext("2d");t.map((function(t){n[r]=[],r++}));var o=Object(f["a"])(new Set(this.localGeneTypes.filter((function(t){return!!document.getElementById(e.sectionId+t)&&!!document.getElementById(e.sectionId+t).checked}))));return t.map((function(t){if(o.includes(t.gene_type))if(0==n[0].length)n[0].push(t);else{var r=!1;n.map((function(n){if(n.length>0&&0==r){var a=n[n.length-1],o=a.xEndPos-a.xStartPos,s=t.xEndPos-t.xStartPos,l=e.getWidth(i,t.gene_name+" â",24,"Arial"),c=o<=l?
1(l-o)/2+a.xEndPos:a.xEndPos,u=s<=l?t.xStartPos-(l-s)/2:t.xStartPos;c<=u&&(n.push(t),r=!0)}else 0==n.length&&0==r&&(n.push(t),r=!0)}))}})),n=n.filter((function(t){return t.length>0})),n},getWidth:function(t,e,n,r){return t.font=n+"px "+r,t.measureText(e).width},renderTrack:function(t){var e,n,r=this;if(document.getElementById("genesTrackWrapper"+this.sectionId)){var a=60;e=this.plotConfig.width?2*this.plotConfig.width+this.adjPlotMargin.left+this.adjPlotMargin.right:2*document.getElementById("genesTrackWrapper"+this.sectionId).clientWidth;var i="region plot"==this.plotType?e-2*this.adjPlotMargin.left:e-(this.adjPlotMargin.left+this.adjPlotMargin.right),o=Number(this.viewingRegion.start),s=Number(this.viewingRegion.end),l=this.adjPlotMargin.left,c=(this.adjPlotMargin.top,i/(s-o)),u=this.utils.sortUtils.sortArrOfObjects(t,"start","number","asc").filter((function(t){return t.start<=s&&t.end>=o}));u.map((function(t){var e=t.start>o?l+(t.start-o)*c:l,n=t.end<s?l+(t.end-o)*c:l+(s-o)*c;t["xStartPos"]=e,t["xEndPos"]=n}));var d=this.sortGenesByRegion(u);this.renderingGenes=d,n=this.adjPlotMargin.top+a*d.length;this.adjPlotMargin.bump;var h=document.getElementById("genesTrack"+this.sectionId);h.setAttribute("width",e),h.setAttribute("height",n),h.setAttribute("style","width:"+e/2+"px;height:"+n/2+"px;");var p=h.getContext("2d");if(p.clearRect(0,0,e,n),p.beginPath(),p.lineWidth=1,p.strokeStyle="#000000",p.setLineDash([]),p.font="italic bold 24px Arial",p.textAlign="center",p.fillStyle="#000000",d.map((function(t,e){t.map((function(t){var n=r.adjPlotMargin.top+e*a,i="â",u="â",d="+"==t.strand?t.gene_name+" "+u:i+" "+t.gene_name;p.fillText(d,t.xStartPos+(t.xEndPos-t.xStartPos)/2,n),p.beginPath(),p.lineWidth=1,p.strokeStyle="#000000",p.setLineDash([]),p.moveTo(t.xStartPos,n+20),p.lineTo(t.xEndPos,n+20),p.stroke(),t.exons.map((function(t){if(t.start<s&&t.end>o){var e=t.start>o?l+(t.start-o)*c:l,r=t.end<s?l+(t.end-o)*c:l+(s-o)*c,a=r-e<=1?1:r-e;p.fillRect(e,n+10,a,20)}}))}))})),this.starItems){var f=this.adjPlotMargin.top-3*this.adjPlotMargin.bump,_=this.adjPlotMargin.top+t.length*a;this.starItems.map((function(t){var e=l+(t.columns[r.plotConfig["x axis field"]]-o)*c;r.utils.plotUtils.renderDashedLine(p,e,f,e,_,3,"#FFAA0055",[6,2])}))}}},getGenesInRegion:function(t){var e=this;return Object(p["a"])(W().mark((function n(){var r,a,i,o,s;return W().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=e.plotConfig["genes track"]["search point"],r=a?a+"/api/bio/query/genes?q="+t:e.utils.uiUtils.biDomain()+"/api/bio/query/genes?q="+t,n.next=4,fetch(r).then((function(t){return t.text(r)}));case 4:i=n.sent,null==i.error&&(o=JSON.parse(i),s="",o["data"]&&o["data"].length>1&&(o["data"].map((function(t){(t.type="protein_coding")&&(s+="'"+t.name+"',")})),s=s.slice(0,-1),s.length>1&&e.getGenesData(s)));case 6:case"end":return n.stop()}}),n)})))()},getGenesData:function(t){var e=this;return Object(p["a"])(W().mark((function n(){var r,a;return W().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.plotConfig["genome reference"]&&"GRCh38"==e.plotConfig["genome reference"]?r="https://portaldev.sph.umich.edu/api/v1/annotation/genes/?filter=source in 1 and gene_name in "+t:e.plotConfig["genome reference"]&&(!e.plotConfig["genome reference"]||"GRCh37"!=e.plotConfig["genome reference"]&&"hg19"!=e.plotConfig["genome reference"])||(r="https://portaldev.sph.umich.edu/api/v1/annotation/genes/?filter=source in 3 and gene_name in "+t),n.next=3,fetch(r).then((function(t){return t.text(r)}));case 3:a=n.sent,null==a.error&&(e.localGenesData=JSON.parse(a).data,e.localGeneTypes=Object(f["a"])(new Set(e.localGenesData.map((function(t){return t.gene_type})))).sort(),e.renderTrack(e.localGenesData));case 5:case"end":return n.stop()}}),n)})))()}}});s()((function(){}));var q=U,N=(n("cb2d8"),Object(C["a"])(q,S,A,!1,null,null,null)),K=N.exports,V=n("08f0"),z=n("b8dc"),$=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[null!=t.searchingRegion?n("div",{staticClass:"col-md-12 annotations-plot-wrapper"},[n("div",{staticClass:"col-md-12 anno-plot-wrapper"},[n("div",{attrs:{id:"annotationsUIWrapper"}},[t._m(0),n("div",{staticClass:"filtering-ui-wrapper add-content",staticStyle:{width:"100%",padding:"0 10px","text-align":"left"}},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col",staticStyle:{padding:"2px"}},[n("div",{staticClass:"label",staticStyle:{display:"inline-block","margin-right":"10px"}},[t._v(" Select Annotation ")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.annotationOnFocus,expression:"annotationOnFocus"}],staticClass:"custom-select",on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,
1(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.annotationOnFocus=e.target.multiple?n:n[0]},function(e){return t.addAnnoTrack(e)}]}},[n("option",{attrs:{value:"null"}},[t._v(" "+t._s("Show all")+" ")]),t._l(t.annoData,(function(e,r){return n("option",{key:r,domProps:{value:r,innerHTML:t._s(r)}})}))],2)])]),t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0&&!t.renderConfig["no search key bubbles"]?n("div",{staticStyle:{position:"absolute",right:"10px",top:"7px"}},[t._l(t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})),(function(e){return[n("span",{key:e.id,class:"btn search-bubble ",style:"background-color:"+t.getColorIndex(e.id),domProps:{innerHTML:t._s(e.id+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeAnnoTrack(e.id)}}})]}))],2):t._e()])]),n("div",{staticClass:"col-md-12 anno-plot-ui-wrapper",staticStyle:{"padding-top":"15px"}},[t._m(1),n("div",t._l(t.annoData,(function(e,r,a){return n("div",{key:r,staticClass:"anno-bubble-wrapper"},[n("span",{staticClass:"anno-bubble",style:"background-color:"+t.compareGroupColors[a]+";",domProps:{innerHTML:t._s(" ")}}),n("span",{domProps:{innerHTML:t._s(r)}})])})),0),null!=t.searchingPhenotype?n("div",{attrs:{id:"GEPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"GEInfoBox"}}),n("canvas",{staticStyle:{"background-color":"#ffffff"},attrs:{id:"GEPlot",width:"",height:""},on:{mousemove:function(e){return t.checkGEPosition(e)},mouseout:function(e){return t.onMouseOut("GEInfoBox")}}})]):t._e()]),n("div",{class:0==t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length?"height-1px":"height-auto",attrs:{id:"annotationsPlotWrapper"}},[t.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).length>0?n("strong",[t._v(" Click on a tissue track to see annotations in specific cell types.")]):t._e(),n("div",{staticClass:"hidden",attrs:{id:"tissueInfoBox"}}),n("canvas",{attrs:{id:"annotationsPlot",width:"",height:""},on:{resize:t.onResize,mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){return t.onMouseOut("tissueInfoBox")}}})])])]):t._e()])},H=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",[n("strong",[t._v("Filter associated variants by location within regulatory regions annotated in broad tissue categories.")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Global Enrichment")])])}];n("a434"),n("4ec9"),n("6b93"),n("b680"),n("c1f9"),n("841c");function Y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Y=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new j(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};c(x,o,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(S([])));C&&C!==n&&r.call(C,o)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(a,i,o,s){var l=d(t[a],t,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Object(h["a"])(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=d(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
vendor: 4,534 bytes, line 1
1(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(h["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),c(M.prototype,s,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),c(P,l,"Generator"),c(P,o,(function(){return this})),c(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}i["default"].use(g["a"]);var Z=i["default"].component("research-multi-annotations-plot",{props:["region","phenotype","ancestry","renderConfig","plotMargin","compareGroupColors","dataComparison","plotData","pkgData","pkgDataSelected","regionZoom","regionViewArea","
1searchParameters","searchParametersArr","utils"],data:function(){return{annoData:{},GEData:{},GEPosData:{},tissuesData:{},tissuesPosData:{},selectedAnnos:[],selectedTissues:[],annoPosData:{},spaceBy:24,annotationOnFocus:"null",tissueOnFocus:"null"}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize),this.getAnnotations(this.searchingRegion)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{searchingParameters:function(){var t="";if(null!=this.searchingRegion&&null!=this.searchingPhenotype){var e=this.searchingRegion.chr+":"+this.searchingRegion.start+"-"+this.searchingRegion.end;t=e+","+this.searchingPhenotype}return t+=this.renderConfig["ancestry parameter"]?","+document.querySelector("#search_param_"+this.renderConfig["ancestry parameter"]).value:"",t},searchingRegion:function(){var t={},e=this.region.split(":");return t["chr"]=e[0],t["start"]=e[1].split("-")[0],t["end"]=e[1].split("-")[1],this.utils.uiUtils.showElement("annotationsPlotWrapper"),t},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},searchingPhenotype:function(){if(null!=this.phenotype){this.utils.uiUtils.showElement("annotationsPlotWrapper");var t=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][this.phenotype]:this.phenotype;return t}if(null==this.phenotype){if(this.utils.keyParams[this.renderConfig["phenotype parameter"]]){this.utils.uiUtils.showElement("annotationsPlotWrapper");var e=this.utils.keyParams[this.renderConfig["phenotype parameter"]],n=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][e]:e;return n}return null}}},watch:{searchParametersArr:function(t){this.renderGE(),this.renderByAnnotations()},searchingParameters:function(t){this.getAnnotations(this.searchingRegion)},pkgDataSelected:{handler:function(t){var e=Object(f["a"])(new Set(this.pkgDataSelected.filter((function(t){return"Annotation"==t.type}))));0==t.length||0==e.length?this.resetAll():this.renderByAnnotations()},deep:!0,immediate:!0},viewingRegion:{handler:function(t){this.renderByAnnotations()},deep:!0,immediate:!0}},methods:{resetAll:function(t){var e=this;t&&"all"==t&&(this.GEData={},this.GEPosData={}),this.annoData={},this.tissuesData={},this.tissuesPosData={},this.selectedAnnos=[],this.selectedTissues=[],this.annoPosData={},this.annotationOnFocus="null",this.tissueOnFocus="null",this.pkgDataSelected.map((function(t){"Tissue"==t.type&&e.$store.dispatch("pkgDataSelected",{type:t.type,id:t.id,action:"remove"})})),this.getAnnotations(this.searchingRegion),this.renderByAnnotations()},getOverlappingRegion:function(){var t=this;if(this.renderConfig["overlapping regions"]&&"false"!=this.renderConfig["overlapping regions"]){var e={};if(this.pkgDataSelected.length>0&&this.pkgDataSelected.map((function(t){e[t.type]||(e[t.type]=[]),e[t.type].push(t.id)})),e["Tissue"]&&e["Tissue"].length>0&&e["Annotation"]&&e["Annotation"].length>0){var n={and:null,or:null};e["Annotation"].map((function(r){e["Tissue"].map((function(e){if(t.pkgData.annoData[r]&&t.pkgData.annoData[r][e])for(var a=function(){var a=Object(_["a"])(o[i],2),s=a[0],l=a[1],c=[];t.pkgData.annoData[r][e].region.map((function(t){for(var e=t.start;e<=t.end;e++)c.push(e)})),n[s]=null==l?c:"and"==s?t.getArraysIntersection(n[s],c):n[s].concat(c)},i=0,o=Object.entries(n);i<o.length;i++)a()}))}));for(var r=0,a=Object.entries(n);r<a.length;r++){var o=Object(_["a"])(a[r],2),s=o[0];o[1];n[s].sort((function(t,e){return t-e}))}for(var l={and:[],or:[]},c=0,u=Object.entries(l);c<u.length;c++)for(var d=Object(_["a"])(u[c],2),h=d[0],p=(d[1],0);p<n[h].length;p++)if(0==p||p==n[h].length-1)l[h].push(n[h][p]);else{var f=n[h][p-1]+1,g=n[h][p];g>
1f&&(l[h].push(n[h][p-1]),l[h].push(n[h][p]))}for(var m={and:[],or:[]},v=0,y=Object.entries(l);v<y.length;v++)for(var b=Object(_["a"])(y[v],2),x=b[0],w=(b[1],0);w<l[x].length-1;w+=2){var C={};C["start"]=l[x][w],C["end"]=l[x][w+1],m[x].push(C)}i["default"].set(this.pkgData,"overlappingRegions",m)}else delete this.pkgData["overlappingRegions"]}},getArraysIntersection:function(t,e){return t.filter((function(t){return-1!==e.indexOf(t)}))},onMouseOut:function(t){this.utils.uiUtils.removeOnMouseOut(t,1e3)},onResize:function(t){this.utils.uiUtils.showElement("annotationsPlotWrapper"),this.renderByAnnotations(),this.renderGE()},addAnnoTrack:function(t){if("null"!=t.target.value){var e=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id}));e.indexOf(t.target.value)<0&&(e.push(t.target.value),null!=this.pkgData&&(this.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t.target.value,action:"add"}),i["default"].set(this.pkgData,"selectedAnnos",e)))}this.renderGE()},removeAnnoTrack:function(t){var e=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id})),n=e.indexOf(t);n>-1&&(e.splice(n,1),null!=this.pkgData&&(this.$store.dispatch("pkgDataSelected",{type:"Annotation",id:t,action:"remove"}),i["default"].set(this.pkgData,"selectedAnnos",e)),this.renderGE())},addRemoveTissueTrack:function(t){var e=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id})),n=e.indexOf(t);n>-1?null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:t,action:"remove"}):null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:t,action:"add"})},removeTissueTrack:function(t){var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=(e.clientX,n.left,Math.ceil(Math.floor(e.clientY-n.top)/this.spaceBy)),i=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id}));if(r>n.width-this.plotMargin.leftMargin&&this.tissuesPosData[a])for(var o=0,s=Object.entries(this.tissuesPosData[a].regions);o<s.length;o++){var l=Object(_["a"])(s[o],2),c=l[0],u=(l[1],c.split("_")),d=u[0],h=u[1];if(r>=d&&r<=h){var p=this.tissuesPosData[a].tissue,f=i.indexOf(p);f>-1&&null!=this.pkgData&&this.$store.dispatch("pkgDataSelected",{type:"Tissue",id:p,action:"remove"})}}},checkGEPosition:function(t){for(var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=Math.floor(e.clientY-n.top),i=document.querySelector("#GEInfoBox"),o="",s=-5;s<=5;s++)for(var l=-5;l<=5;l++)if(void 0!=this.GEPosData[a+s]&&void 0!=this.GEPosData[a+s][r+l])for(var c=0,u=Object.entries(this.GEPosData[a+s][r+l]);c<u.length;c++){var d=Object(_["a"])(u[c],2),h=d[0],p=d[1];o+="<span style='color:"+this.compareGroupColors[p.annotationIndex]+"'>"+h+"</span><br />"}""!=o?(i.innerHTML=o,i.setAttribute("class",""),r<.75*n.width?(i.style.width="auto",i.style.left=r+15+"px",i.style.top=a+this.spaceBy+"px"):(i.style.width="200px",i.style.left=r-215+"px",i.style.top=a+this.spaceBy+"px")):i.setAttribute("class","hidden")},checkPosition:function(t,e){var n=t,r=n.target.getBoundingClientRect(),a=Math.floor(n.clientX-r.left),i=n.clientX-r.left,o=n.clientY-r.top,s=Math.round(this.spaceBy/2),l=Math.ceil(Math.floor(n.clientY-r.top)/s)-1,c=document.querySelector("#tissueInfoBox"),u="";if("hover"==e)if(a>=this.plotMargin.leftMargin/2&&a<=r.width){if(this.annoPosData[l]){u+=this.annoPosData[l].tissue;for(var d=0,h=Object.entries(this.annoPosData[l].regions);d<h.length;d++){var p=Object(_["a"])(h[d],2),f=p[0],g=p[1],m=f.split("_"),v=m[0],y=m[1];a>=v&&a<=y&&(u+="<br />"+g.start+"-"+g.end+"<br />State: "+g.state)}}}else if(a>=r.width-this.plotMargin.leftMargin&&a<=r.width)for(var b=Math.floor(o),x=b-4,w=b+4,C=x;C<=w;C++)if(this.annoPosData[C]&&this.annoPosData[C].annotation)for(var P=0,k=Object.entries(this.annoPosData[C].regions);P<k.length;P++){var M=Object(_["a"])(k[P],2),E=M[0],D=M[1],O=E.split("_"),L=O[0],j=O[1];a>=L&&a<=j&&(u+=D)}"click"==e&&a>=this.plotMargin.leftMargin/2&&a<=r.width&&this.annoPosData[l]&&(u+=this.annoPosData[l].tissue),"hover"==e&&(""==u?(c.innerHTML="",c.setAttribute("class","hidden")):(c.innerHTML=u,c.setAttribute("class",""),c.style.left=i+15+"px",c.style.top=o+s+"px")),"click"==e&&""!=u&&this.addRemoveTissueTrack(u)},getColorIndex:function(t){var e=Object.keys(this.annoData),n=e.indexOf(t);return this.compareGroupColors[n]},getGlobalEnrichment:function(){var t=this;return Object(p["a"])(Y().mark((function e(){var n,r,a,o,s,l,c,u,d,h;return Y().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n="KP BioIndex"==t.renderConfig["annotations server"]?t.utils.uiUtils.biDomain()+"/api/bio":t.renderConfig["annotations server"],r=t.searchingPhenotype,a=t.renderConfig["global enrichment index"]?t.renderConfig["global enrichment index"]:"global-enrichment",o=n+"/query/"+a+"?q="+r,e.next=6,fetch(o).then((function(t){return t.json()}));case 6:if(s=e.sent,null==s.error){for("newSearch"==t.dataComparison&&(t.GEData={}),t.GEData[t.searchingPhenotype]=s.data,l=0,c=Object.entries(t.GEData);l<c.length;l++)u=Object(_["a"])(c[l],2),u[0],d=u[1],d.map((function(e){var n=e.ancestry,r=e.annotation,a=e.pValue,i=e.phenotype,o=e.tissue;t.annoData[r]&&t.annoData[r][o]&&(t.annoData[r][o].ancestries[n]||(t.annoData[r][o].ancestries[n]={}),t.annoData[r][o].ancestries[n][i]=a),t.tissuesData[o]&&t.tissuesData[o][r]&&(t.tissuesData[o][r].ancestries[n]||(t.tissuesData[o][r].ancestries[n]={}),t.tissuesData[o][r].ancestries[n][i]=a)}));t.tissuesData=Object.fromEntries(Object.entries(t.tissuesData).sort()),h=t.getGEByTissue(),null!=t.pkgData&&(i["default"].set(t.pkgData,"GEByTissueData",h),i["default"].set(t.pkgData,"GEData",t.GEData),i["default"].set(t.pkgData,"annoData",t.annoData),i["default"].set(t.pkgData,"tissuesData",t.tissuesData)),t.renderByAnnotations(),t.renderGE()}t.$forceUpdate();case 9:case"end":return e.stop()}}),e)})))()},getGEByTissue:function(){var t=this,e={};Object.keys(this.GEData).map((function(n){e[n]={},Object.keys(t.annoData).map((function(t){e[n][t]={}}))}
1));for(var n={},r=function(){var r=Object(_["a"])(i[a],2),o=r[0],s=r[1];n[o]={},s&&s.map((function(r){n[o][r.tissue]||(n[o][r.tissue]={}),n[o][r.tissue][r.annotation]||(n[o][r.tissue][r.annotation]={pValue:null,fold:null,gregor:null,rank:null,ancestries:{}});var a=n[o][r.tissue][r.annotation];a.ancestries[r.ancestry]||(a.ancestries[r.ancestry]={fold:null,pValue:null,rank:null}),a.ancestries[r.ancestry].pValue=t.utils.Formatters.pValueFormatter(r.pValue),a.ancestries[r.ancestry].fold=t.utils.Formatters.pValueFormatter(r.SNPs/r.expectedSNPs);var i=n[o][r.tissue][r.annotation].pValue;(null==i||r.pValue<i)&&(n[o][r.tissue][r.annotation].pValue=t.utils.Formatters.pValueFormatter(r.pValue),n[o][r.tissue][r.annotation].fold=t.utils.Formatters.pValueFormatter(r.SNPs/r.expectedSNPs)),e[o]&&e[o][r.annotation]&&!e[o][r.annotation][r.ancestry]&&(e[o][r.annotation][r.ancestry]=[]),e[o]&&e[o][r.annotation]&&e[o][r.annotation][r.ancestry].push({tissue:r.tissue,fold:a.ancestries[r.ancestry].fold})}))},a=0,i=Object.entries(this.GEData);a<i.length;a++)r();return Object.keys(e).map((function(r){Object.keys(e[r]).map((function(a){Object.keys(e[r][a]).map((function(i){e[r][a][i]=Object(f["a"])(new Map(e[r][a][i].map((function(t){return[t["tissue"],t]}))).values()),e[r][a][i].sort((function(t,e){return e.fold-t.fold}));var o=0;e[r][a][i].map((function(e){t.tissuesData[e.tissue]&&t.tissuesData[e.tissue][a]&&(n[r][e.tissue][a].ancestries[i].rank=o,o++)}))}))}))})),n},getAnnotations:function(t){var e=this;return Object(p["a"])(Y().mark((function n(){var r,a,i,o;return Y().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!(t&&t.chr&&t.start&&t.end)){n.next=8;break}return r="KP BioIndex"==e.renderConfig["annotations server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["annotations server"],a=e.renderConfig["annotations index"]?e.renderConfig["annotations index"]:"regions",i=r+"/query/"+a+"?q="+t.chr+":"+t.start+"-"+t.end,n.next=6,fetch(i).then((function(t){return t.json()}));case 6:o=n.sent,null==o.error&&(null==o.continuation?e.runAfterAnnoDataLoad(o):e.loadContinue(o));case 8:case"end":return n.stop()}}),n)})))()},loadContinue:function(t){var e=this;return Object(p["a"])(Y().mark((function n(){var r,a,i,o,s;return Y().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r="KP BioIndex"==e.renderConfig["annotations server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["annotations server"],a=r+"/cont?token="+t.continuation,n.next=4,fetch(a).then((function(t){return t.json()}));case 4:i=n.sent,null==i.error&&(o=t.data,s=o.concat(i.data),i.data=s,null==i.continuation?e.runAfterAnnoDataLoad(i):e.loadContinue(i));case 6:case"end":return n.stop()}}),n)})))()},runAfterAnnoDataLoad:function(t){var e=this;this.annoData={},this.tissuesData={},t.data.map((function(t){e.annoData[t.annotation]||(e.annoData[t.annotation]={}),e.annoData[t.annotation][t.tissue]||(e.annoData[t.annotation][t.tissue]={region:[],ancestries:{}}),e.annoData[t.annotation][t.tissue].region.push(t),e.tissuesData[t.tissue]||(e.tissuesData[t.tissue]={}),e.tissuesData[t.tissue][t.annotation]||(e.tissuesData[t.tissue][t.annotation]={region:[],ancestries:{}}),e.tissuesData[t.tissue][t.annotation].region.push(t)})),null!=this.pkgData&&(i["default"].set(this.pkgData,"annoData",this.annoData),i["default"].set(this.pkgData,"tissuesData",this.tissuesData)),this.getGlobalEnrichment()},renderGE:function(){var t=this;this.GEPosData={};var e={},n=[],r=this.renderConfig["phenotype parameter"],a=this.renderConfig["ancestry parameter"],i=0;this.searchParameters[r].search.map((function(e){n[i]={},n[i]["phenotype"]=e,n[i]["ancestry"]=a?t.searchParameters[a].search[i]:"Mixed",i++})),n.map((function(n){var r=t.renderConfig["phenotype match"]?t.renderConfig["phenotype match"][n.phenotype]:n.phenotype,a=n.ancestry,i=t.GEData[r];e[r]||(e[r]={}),e[r][a]={xMax:null,xMin:null,yMax:null,yMin:null},i&&i.map((function(n){if(n.ancestry==a){var i=null;if((a&&t.annoData[n.annotation][n.tissue]&&t.annoData[n.annotation][n.tissue]["ancestries"][a]||!a&&t.annoData[n.annotation][n.tissue]&&t.annoData[n.annotation][n.tissue])&&(i=!0),i){e[r][a][n.annotation]||(e[r][a][n.annotation]={});var o=a?t.annoData[n.annotation][n.tissue]["ancestries"][a][r]:n.pValue;o=0==o?324:-Math.log10(o);var s=n.SNPs/n.expectedSNPs;e[r][a].yMax=null==e[r][a].yMax||s>e[r][a].yMax?s:e[r][a].yMax,e[r][a].yMin=null==e[r][a].yMin||s<e[r][a].yMin?s:e[r][a].yMin,e[r][a].xMax=null==e[r][a].xMax||o>e[r][a].xMax?o:e[r][a].xMax,e[r][a].xMin=null==e[r][a].xMin||o<e[r][a].xMin?o:e[r][a].xMin,e[r][a][n.annotation][n.tissue]=e[r][a][n.annotation][n.tissue]?e[r][a][n.annotation][n.tissue]:{pValue:null,fold:null};var l=e[r][a][n.annotation][n.tissue].pValue,c=e[r][a][n.annotation][n.tissue].fold;e[r][a][n.annotation][n.tissue].pValue=null==l||o>l?o:l,e[r][a][n.annotation][n.tissue].fold=null==c||s>c?s:c}}}))}));var o=0;Object.keys(e).map((function(t){o+=Object.keys(e[t]).length}));var s,l,c=2*document.querySelector("#GEPlotWrapper").clientWidth*.25,u=c*o,d=260,h=2*this.spaceBy,p=this.plotMargin.topMargin+this.plotMargin.bottomMargin+d+h,f=c-this.plotMargin.leftMargin-this.plotMargin.rightMargin,g=11;s=document.querySelector("#GEPlot"),s.setAttribute("width",u),s.setAttribute("height",p),s.setAttribute("style","width:"+u/2+"px;
1height:"+p/2+"px;"),l=s.getContext("2d");var m=0;n.map((function(n){var r=t.renderConfig["phenotype match"]?t.renderConfig["phenotype match"][n.phenotype]:n.phenotype,a=n.ancestry,i=e[r][a],o=h,s=g+c*m,u=r+"("+a+")";l.font="28px Arial",l.textAlign="left",l.fillStyle="#000000",l.fillText(u,s,o),t.renderGEAxis(l,f,d,i.xMax,i.xMin,i.yMax,i.yMin,s,o,g);var p=Object.keys(t.annoData),v=[],y=[];p.map((function(t){if(i[t])for(var e=0,n=Object.entries(i[t]);e<n.length;e++){var r=Object(_["a"])(n[e],2),a=(r[0],r[1]);y.push(a.pValue),v.push(a.fold)}})),v.sort((function(t,e){return e-t})),y.sort((function(t,e){return e-t}));var b=f/(i.xMax-i.xMin),x=d/(i.yMax-i.yMin);p.map((function(e,n){var r="null"==t.annotationOnFocus||e==t.annotationOnFocus?t.compareGroupColors[n]:"#00000030";if(i[e])for(var a=0,u=Object.entries(i[e]);a<u.length;a++){var h=Object(_["a"])(u[a],2),p=h[0],f=h[1],g=s+t.plotMargin.leftMargin+(f.pValue-i.xMin)*b,m=o+t.plotMargin.topMargin+d-(f.fold-i.yMin)*x;l.fillStyle=r,l.lineWidth=0,l.beginPath(),l.arc(g,m,8,0,2*Math.PI),l.fill(),(f.fold>=v[2]||f.pValue>=y[2])&&(l.font="24px Arial",l.fillStyle=t.pkgData.selectedAnnos&&0!=t.pkgData.selectedAnnos.length?t.pkgData.selectedAnnos&&t.pkgData.selectedAnnos.includes(e)?"#000000":"#00000050":"#000000",g>.75*c?(l.textAlign="right",l.fillText(p,g-14,m+6)):(l.textAlign="left",l.fillText(p,g+14,m+6))),t.GEPosData[Math.round(m/2)]||(t.GEPosData[Math.round(m/2)]={}),t.GEPosData[Math.round(m/2)][Math.round(g/2)]||(t.GEPosData[Math.round(m/2)][Math.round(g/2)]={}),t.GEPosData[Math.round(m/2)][Math.round(g/2)][p]={pValue:null,fold:null},t.GEPosData[Math.round(m/2)][Math.round(g/2)][p]["pValue"]=f.pValue,t.GEPosData[Math.round(m/2)][Math.round(g/2)][p]["fold"]=f.fold,t.GEPosData[Math.round(m/2)][Math.round(g/2)][p]["annotationIndex"]=n}})),m++}))},renderGEAxis:function(t,e,n,r,a,i,o,s,l,c){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]);var u=Math.round(s+this.plotMargin.leftMargin-c);t.moveTo(u,l+this.plotMargin.topMargin),t.lineTo(u,l+this.plotMargin.topMargin+n+c);for(var d=(i-o)/5,h=n/5,p=0;p<6;p++){var f=l+this.plotMargin.topMargin+p*h,_=Math.floor(f);t.moveTo(s+this.plotMargin.leftMargin-2*c,_),t.lineTo(s+this.plotMargin.leftMargin-c,_),t.stroke(),t.textAlign="right",t.font="24px Arial";var g=i-o,m=g<=1?2:g<=50?1:0,v=this.utils.Formatters.decimalFormatter(o+p*d,m);v=v>=1e5?Math.round(.001*v)+"k":v,t.fillText(v,s+this.plotMargin.leftMargin-3*c,l+this.plotMargin.topMargin+n+c-p*h)}var y=this.renderConfig["global enrichment y axis label"]?this.renderConfig["global enrichment y axis label"]:"Fold(SNPs/expectedSNPs)";t.textAlign="center",t.rotate(-2*Math.PI/4),t.fillText(y,-(this.plotMargin.topMargin+n/2)-l,s+c+24),t.rotate(-2*Math.PI/4*3),t.moveTo(s+this.plotMargin.leftMargin-c,l+this.plotMargin.topMargin+n+c),t.lineTo(s+this.plotMargin.leftMargin+e,l+this.plotMargin.topMargin+n+c),t.stroke();for(var b=(r-a)/5,x=e/5,w=0;w<6;w++){var C=s+this.plotMargin.leftMargin+w*x,P=Math.floor(C);t.moveTo(P,l+n+this.plotMargin.topMargin+c),t.lineTo(P,l+n+this.plotMargin.topMargin+2*c),t.stroke(),t.textAlign="center",t.font="24px Arial";var k=r-a,M=k<=1?2:k<=50?1:0,E=this.utils.Formatters.decimalFormatter(a+w*b,M);E=E>=1e5?Math.round(.001*E)+"k":E,t.fillText(E,P,l+n+this.plotMargin.topMargin+4*c)}var D=this.renderConfig["global enrichment x axis label"]?this.renderConfig["global enrichment x axis label"]:"-Log10(p-value)";t.textAlign="center",t.fillText(D,s+this.plotMargin.leftMargin+e/2,l+n+6*c+this.plotMargin.topMargin+24)},array2Object:function(t,e){var n={};return e.map((function(e){var r=e[t];n[r]=e})),n},renderByAnnotations:function(){var t=this;if(this.pkgData.GEByTissueData){var e=this.getGEByTissue(),n=[],r=this.renderConfig["phenotype parameter"],a=this.renderConfig["ancestry parameter"],i=0;this.searchParameters[r].search.map((function(e){n[i]={},n[i]["phenotype"]=e,n[i]["ancestry"]=a?t.searchParameters[a].search[i]:"Mixed",i++}));var o=[];if(this.annoPosData={},this.renderConfig["star key"]){var s=Array.isArray(this.plotData)?this.array2Object(this.renderConfig["star key"]["key"],this.plotData):this.plotData,l=this.renderConfig["star key"]["key"],c=this.renderConfig["star key"]["position"];this.pkgDataSelected.filter((function(t){return t.type==l})).map((function(t){return t.id})).map((function(t){o.push(s[t][c])}))}for(var u=0,d=2*this.spaceBy,h=7*this.spaceBy,p=this.spaceBy,f=2*this.spaceBy,g=2*this.spaceBy,m=this.viewingRegion.start,v=this.viewingRegion.end,y=240,b=this.pkgDataSelected.filter((function(t){return"Annotation"==t.type})).map((function(t){return t.id})),x=this.pkgDataSelected.filter((function(t){return"Tissue"==t.type})).map((function(t){return t.id})),w=0,C=Object.entries(this.annoData);w<C.length;w++){var P=Object(_["a"])(C[w],2),k=P[0],M=P[1];b.includes(k)&&(u+=d,u+=Object.keys(M).length*p,u+=h)}var E=document.querySelector("#annotationsPlotWrapper"),D=document.querySelector("#annotationsPlot");if(D&&E){var O,L,j=2*document.querySelector("#annotationsPlotWrapper").clientWidth*.75,S=j+n.length*y,A=u+f+g,I=j-2*this.plotMargin.leftMargin,T=11,B=I/(v-m);O=document.querySelector("#annotationsPlot"),O.setAttribute("width",S),O.setAttribute("height",A),O.setAttribute("style","width:"+S/2+"px;
1height:"+A/2+"px;"),L=O.getContext("2d"),L.clearRect(0,0,j,A);for(var R=d,F=function(){var r=Object(_["a"])(W[G],2),a=r[0],i=r[1];if(b.includes(a)){L.font="28px Arial",L.textAlign="left",L.fillStyle="#000000",L.fillText(a,T,R),n.map((function(t,e){L.fillStyle="#000000",L.textAlign="start",L.textBaseline="middle",L.font="28px Arial";var n=t.phenotype+" ("+t.ancestry+")";L.fillText(n,j+y*e,R)}));var s=Object.keys(i).length*p;R+=d,t.renderAnnoAxis(L,I,s,Number(v),Number(m),R,T),t.renderConfig["star key"]&&o.length>0&&t.renderStaredPositions(L,I,s,o,B,Number(v),Number(m),R,T);var l=0,c=Object.keys(i).sort();c.map((function(r){var o=i[r],s=Math.ceil(R/t.spaceBy);t.annoPosData[s]?t.annoPosData[s]["tissue"]=r:t.annoPosData[s]={annotation:a,tissue:r,regions:{}},l%2==0&&(L.fillStyle="#00000010",L.fillRect(t.plotMargin.leftMargin,R,I,p)),l++,o.region.map((function(e){if(e.start<=v&&e.end>=m){var n=(e.start-m)*B+t.plotMargin.leftMargin;n=n<=t.plotMargin.leftMargin?t.plotMargin.leftMargin:n;var i=(e.end-m)*B+t.plotMargin.leftMargin;i=i>t.plotMargin.leftMargin+I?t.plotMargin.leftMargin+I:i;var o=i-n<2?2:i-n;x.indexOf(r)>-1?L.fillStyle="#FF0000":L.fillStyle=t.getColorIndex(a),L.fillRect(n,R,o,p-1);var l=Math.round(n/2)+"_"+Math.round((n+o)/2);t.annoPosData[s].regions[l]={start:e.start,end:e.end,state:e.state}}})),R+=p,L.fillStyle="#000000",L.textAlign="start",L.textBaseline="middle",L.font="24px Arial",L.fillText(r,10,R-8),n.map((function(n,i){var o=t.renderConfig["phenotype match"]?t.renderConfig["phenotype match"][n.phenotype]:n.phenotype,s=n.ancestry;if(e[o][r]&&e[o][r][a]){var l=e[o][r][a].ancestries[s]["pValue"]+" / "+Number(e[o][r][a].ancestries[s]["fold"]).toFixed(3);e[o][r][a].ancestries[s]["rank"]<5&&(L.fillStyle=t.getColorIndex(a),L.lineWidth=0,L.beginPath(),L.arc(j+y*i-10,R-8,6,0,2*Math.PI),L.fill()),e[o][r][a].ancestries[s]["pValue"]<.05&&(L.fillStyle="#FF9999",L.lineWidth=0,L.beginPath(),L.arc(j+y*i-20,R-8,6,0,2*Math.PI),L.fill()),L.fillStyle="#000000",L.textAlign="start",L.textBaseline="middle",L.font="22px Arial",L.fillText(l,j+y*i,R-8)}}))})),R+=h}},G=0,W=Object.entries(this.annoData);G<W.length;G++)F()}this.getOverlappingRegion()}},renderAnnoAxis:function(t,e,n,r,a,i,o){t.lineWidth=1,t.setLineDash([]),t.beginPath(),t.strokeStyle="#999999",t.moveTo(this.plotMargin.leftMargin-o,i),t.lineTo(this.plotMargin.leftMargin-o,i+n+o),t.stroke();var s=Math.round(this.plotMargin.leftMargin+e+o);t.moveTo(s,i),t.lineTo(s,i+n+o),t.stroke(),t.closePath(),t.beginPath(),t.strokeStyle="#000000",t.moveTo(this.plotMargin.leftMargin-o,i+n+o),t.lineTo(s,i+n+o),t.stroke();for(var l=Math.ceil((r-a)/5),c=e/5,u=0;u<6;u++){var d=this.plotMargin.leftMargin+u*c,h=Math.floor(d);t.moveTo(h,i+n+o),t.lineTo(h,i+n+2*o),t.stroke(),t.textAlign="center",t.font="24px Arial",t.fillStyle="#000000";var p=r-a,f=p<=1?2:p<=50?1:0,_=this.utils.Formatters.decimalFormatter(a+u*l,f);_=_>=1e5?Math.round(.001*_)+"k":_,t.fillText(_,h,i+n+4*o)}t.closePath()},renderStaredPositions:function(t,e,n,r,a,i,o,s,l){var c=this;t.beginPath(),t.lineWidth=2,t.strokeStyle="#FFAA00",t.setLineDash([6,6]),r.map((function(e){var r=(e-o)*a+c.plotMargin.leftMargin;t.moveTo(r,s-l),t.lineTo(r,s+n+l),t.stroke()}))}}});s()((function(){}));var X=Z,J=(n("d083"),Object(C["a"])(X,$,H,!1,null,null,null)),Q=J.exports,tt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.renderData.length>0?n("div",{staticClass:"scatter-plot-content row",staticStyle:{display:"flex","flex-direction":"row","justify-content":"center"},attrs:{id:"rp_scatter_plot"}},[n("div",{staticStyle:{display:"flex"}},[n("div",{},[n("div",{staticClass:"scatter-dot-value hidden",attrs:{id:"scatter_dot_value"+t.sectionId},on:{mouseenter:function(e){return t.checkPosition(e,"","enter popup")}}},[n("div",{staticClass:"fixed-info-box-close",style:t.isDotPanelClick?"display:block":"display:none",on:{click:function(e){return t.checkPosition(e,"","click")}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("div",{staticClass:"scatter-dot-value-content",attrs:{id:"scatter_dot_value_content"+t.sectionId}})]),!t.renderConfig||t.groupsList||t.multiList?t._e():n("canvas",{staticClass:"scatter-plot",style:"width:"+t.plotDimension.width/2+"px;
1height:"+t.plotDimension.height/2+"px;",attrs:{id:"scatterPlot"+t.sectionId,width:t.plotDimension.width,height:t.plotDimension.height},on:{mousemove:function(e){return t.checkPosition(e,"","move")},click:function(e){return t.checkPosition(e,"","click")},mouseleave:function(e){return t.checkPosition(e,"","leave")}}})]),t.renderConfig&&t.multiList?[n("div",{staticClass:"scatter-plot-groups",staticStyle:{display:"flex","flex-wrap":"wrap"}},t._l(t.multiList,(function(e,r){return n("div",{staticClass:"scatter-plot-group"},[n("div",{staticClass:"colors-list"},t._l(t.colorsList,(function(e,r){return n("div",{staticClass:"anno-bubble-wrapper"},[n("span",{staticClass:"anno-bubble",style:"background-color:"+t.compareGroupColors[r%16]},[t._v("Â ")]),n("span",[t._v(t._s(e))])])})),0),n("canvas",{key:t.sectionId+"multi"+r,staticClass:"scatter-plot",style:"width:"+t.plotDimension.width/2+"px;height:"+t.plotDimension.height/2+"px;",attrs:{id:"scatterPlot"+t.sectionId+"multi"+r,width:t.plotDimension.width,height:t.plotDimension.height},on:{click:function(e){return t.checkPosition(e,"multi"+r,"click")},mousemove:function(e){return t.checkPosition(e,"multi"+r,"move")},mouseleave:function(e){return t.checkPosition(e,"","leave")}}})])})),0)]:t._e(),t.multiList||t.groupsList?t._e():n("div",{staticClass:"plot-extras",staticStyle:{"padding-top":"35px"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column"}},[t.renderConfig&&t.renderConfig["y axis fields"].length>1?n("label",[t._v(" Y Axis ")]):t._e(),n("select",{staticClass:"y-axis-select",on:{change:function(e){return t.setPlotAxisIndex(e,"y")}}},t._l(t.renderConfig["y axis fields"],(function(e,r){return n("option",{domProps:{value:e,selected:t.renderConfig["y axis index"]===e}},[t._v(" "+t._s(e)+" ")])})),0),t.renderConfig&&t.renderConfig["x axis fields"].length>1?n("label",[t._v(" X Axis ")]):t._e(),n("select",{staticClass:"x-axis-select",on:{change:function(e){return t.setPlotAxisIndex(e,"x")}}},t._l(t.renderConfig["x axis fields"],(function(e,r){return n("option",{domProps:{value:e,selected:t.renderConfig["x axis field"]===e}},[t._v(" "+t._s(e)+" ")])})),0)]),n("div",{staticClass:"color-key-options",staticStyle:{display:"flex","flex-direction":"column"}},[t.renderConfig&&t.renderConfig["color by"].length>1?n("label",[t._v(" Color by ")]):t._e(),n("select",{staticClass:"color-by-select",on:{change:function(e){return t.setColorField(e)}}},t._l(t.renderConfig["color by"],(function(e,r){return n("option",{domProps:{value:"object"===typeof e?e["field"]:e,selected:t.renderConfig["color by"]===r}},[t._v(" "+t._s("object"===typeof e?e["field"]:e)+" ")])})),0),t.renderConfig&&t.colorByList&&!t.colorByGradient?n("div",{staticClass:"color-key"},[n("div",{staticStyle:{"text-align":"right","font-size":"10px","font-style":"italic"}},[t._v("click key to highlight")]),t._l(t.colorByList[t.colorByField],(function(e,r){return n("div",{staticClass:"anno-bubble-wrapper",staticStyle:{cursor:"pointer"},on:{click:function(n){return t.setHighlightField(n,e)}}},[n("span",{staticClass:"anno-bubble",style:"background-color:"+t.compareGroupColors[r%16]},[t._v("Â ")]),n("span",[t._v(t._s(e))])])}))],2):t._e(),t.renderConfig&&t.colorByList&&t.colorByGradient?n("div",{staticClass:"color-key"},[n("div",{staticStyle:{"text-align":"right","font-size":"10px","font-style":"italic"}},[t._v("drag sliders to highlight in range")]),n("div",{staticClass:"color-gradient-wrapper",on:{mousedown:function(e){return t.gradientHandleDown(e)},mousemove:function(e){return t.gradientHandleMove(e)}}},[n("div",{staticClass:"color-gradient",style:t.colorGradient()}),n("div",{staticClass:"color-gradient-handle color-gradient-max",attrs:{"data-val":""}},[t._v(" "+t._s(t.gradientMinMax.currMax)+" ")]),n("div",{staticClass:"color-gradient-handle color-gradient-min",attrs:{"data-val":""}},[t._v(" "+t._s(t.gradientMinMax.currMin)+" ")])])]):t._e()])])])],2),t.renderConfig&&t.groupsList?[n("div",{staticClass:"colors-list"},t._l(t.colorsList,(function(e,r){return n("div",{staticClass:"anno-bubble-wrapper"},[n("span",{staticClass:"anno-bubble",style:"background-color:"+t.compareGroupColors[r%16]},[t._v("Â ")]),n("span",[t._v(t._s(e))])])})),0),t._l(t.groupsList,(function(e){return n("canvas",{key:e,staticClass:"scatter-plot",style:"width:"+t.plotDimension.width/2+"px;
1height:"+t.plotDimension.height/2+"px;",attrs:{id:"scatterPlot"+t.sectionId+e,width:t.plotDimension.width,height:t.plotDimension.height},on:{click:function(n){return t.checkPosition(n,e,"click")},mousemove:function(n){return t.checkPosition(n,e,"move")},mouseleave:function(e){return t.checkPosition(e,"","leave")}}})}))]:t._e()],2):t._e()},et=[],nt=n("ade3"),rt=n("5530");i["default"].use(g["a"]);var at=i["default"].component("research-scatter-plot",{props:["plotData","renderConfig","searchParameters","dataComparisonConfig","plotMargin","compareGroupColors","isSectionPage","sectionId","starItems","utils"],data:function(){return{multiList:null,groupsList:null,colorsList:null,colorByList:null,colorByField:null,colorByGradient:null,gradientMinMax:{},posData:{},isDotPanelClick:!1,dotPanelCloseTimer:null}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize),this.renderPlot()},updated:function(){this.renderPlot()},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{plotDimension:function(){var t={};t["height"]=this.renderConfig.height?2*this.renderConfig.height:600,t["width"]=this.renderConfig.width?2*this.renderConfig.width:1e3;var e=this.plotMargin;return this.renderConfig["plot margin"]&&(e.topMargin=this.renderConfig["plot margin"]["top"],e.bottomMargin=this.renderConfig["plot margin"]["bottom"],e.leftMargin=this.renderConfig["plot margin"]["left"],e.rightMargin=this.renderConfig["plot margin"]["right"],e.bump=this.renderConfig["plot margin"]["bump"]),e.topMargin=2*e.topMargin,e.bottomMargin=2*e.bottomMargin,e.leftMargin=2*e.leftMargin,e.rightMargin=2*e.rightMargin,e.bump=2*e.bump,t["plotMargin"]=e,t["height"]+=e.topMargin+e.bottomMargin,t["width"]+=e.leftMargin+e.rightMargin,t},renderData:function(){var t=this,e=this.dataComparisonConfig?this.utils.dataConvert.object2Array(this.plotData,this.dataComparisonConfig,this.dataComparisonConfig["key field"]):this.plotData,n=[],r=[],a=[],i=[],o={},s=[];if("single plot"===this.renderConfig["render type"]?(this.renderConfig["x axis fields"]?(this.renderConfig["x axis field"]=this.renderConfig["x axis fields"][0],this.renderConfig["y axis field"]=this.renderConfig["y axis fields"][0]):(this.renderConfig["x axis fields"]=[this.renderConfig["x axis field"]],this.renderConfig["y axis fields"]=[this.renderConfig["y axis field"]]),this.renderConfig["x axis fields"].forEach((function(t){s.push(t)})),this.renderConfig["y axis fields"].forEach((function(t){s.push(t)}))):"multi plot"===this.renderConfig["render type"]&&this.renderConfig["axis fields"].forEach((function(t){i.push([t["x axis field"],t["y axis field"],t["color by"]])})),this.renderConfig["color by"].constructor!==Array&&(this.renderConfig["color by"]=[this.renderConfig["color by"]]),o={},this.renderConfig["color by"].forEach((function(t){o="object"===Object(h["a"])(t)?Object(rt["a"])(Object(rt["a"])({},o),{},Object(nt["a"])({},t["field"],[])):Object(rt["a"])(Object(rt["a"])({},o),{},Object(nt["a"])({},t,[]))})),this.colorByField=this.renderConfig["color field"]=this.renderConfig["color by"][0],this.renderConfig["color highlight"]=null,e.map((function(e){var i={};"single plot"===t.renderConfig["render type"]?(i["x"]={},t.renderConfig["x axis fields"].forEach((function(t){var n=t,r="string"==typeof e[t]?0:e[t];i["x"]=Object(rt["a"])(Object(rt["a"])({},i["x"]),{},Object(nt["a"])({},n,r))})),i["y"]={},t.renderConfig["y axis fields"].forEach((function(t){var n=t,r="string"==typeof e[t]?0:e[t];i["y"]=Object(rt["a"])(Object(rt["a"])({},i["y"]),{},Object(nt["a"])({},n,r))}))):"multi plot"===t.renderConfig["render type"]&&(i["x"]={},i["y"]={},i["color"]={},t.renderConfig["axis fields"].forEach((function(t){var n=0===e[t["x axis field"]]?0:"string"==typeof e[t["x axis field"]]?Number(e[field]):e[t["x axis field"]],r=0===e[t["y axis field"]]?0:"string"==typeof e[t["y axis field"]]?Number(e[field]):e[t["y axis field"]];if(i["x"]=Object(rt["a"])(Object(rt["a"])({},i["x"]),{},Object(nt["a"])({},t["x axis field"],n)),i["y"]=Object(rt["a"])(Object(rt["a"])({},i["y"]),{},Object(nt["a"])({},t["y axis field"],r)),t["color by"]){var a=t["color by"],s=e[a];i["color"]=Object(rt["a"])(Object(rt["a"])({},i["color"]),{},Object(nt["a"])({},a,s)),o[a]?o[a].includes(s)||o[a].push(s):o=Object(rt["a"])(Object(rt["a"])({},o),{},Object(nt["a"])({},a,[s]))}}))),i["key"]=e[t.renderConfig["render by"]],i["hover"]={},t.renderConfig["group by"]&&(i["group"]=e[t.renderConfig["group by"]],r.includes(i["group"])||r.push(i["group"])),t.renderConfig["color by"]&&!i["color"]&&(i["color"]={},t.renderConfig["color by"].length>1?t.renderConfig["color by"].forEach((function(n,r){"object"===Object(h["a"])(n)?(i["color"]=Object(rt["a"])(Object(rt["a"])({},i["color"]),{},Object(nt["a"])({},n["field"],e[n["field"]])),o[n["field"]].includes(e[n["field"]])||o[n["field"]].push(e[n["field"]])):(i["color"]=Object(rt["a"])(Object(rt["a"])({},i["color"]),{},Object(nt["a"])({},n,e[t.renderConfig["color by"][r]])),o[n].includes(e[t.renderConfig["color by"][r]])||o[n].push(e[t.renderConfig["color by"][r]]))})):t.renderConfig["color by"].forEach((function(t,n){i["color"]=Object(rt["a"])(Object(rt["a"])({},i["color"]),{},Object(nt["a"])({},t,e[t])),a.includes(e[t])||a.push(e[t])}))),t.renderConfig["hover content"]&&t.renderConfig["hover content"].length>0&&t.renderConfig["hover content"].map((function(t){i["hover"][t]=e[t]})),n.push(i)})),o){var l=Object.keys(o);l.forEach((function(t){if("number"===typeof o[t][0]){var e=o[t].filter((function(t){return"number"===typeof t}));e.sort((function(t,e){return t-e})),o[t]=e}}))}return this.groupsList=r.length>0?r.sort():null,this.colorsList=a.length>0?a.sort():null,this.multiList=i.length>0?i:null,this.colorByList=Object.keys(o).length>0?o:null,n}},watch:{renderData:function(t){this.renderPlot()},groupsList:function(t){this.renderPlot()},starItems:function(t){this.renderPlot()}},methods:{clearPlot:function(){},renderIndividualPlot:function(t,e,n,r){var a=this,i=[],o=[],s=r?this.plotDimension.width/2:this.plotDimension.width,l=r?this.plotDimension.height/2:this.plotDimension.height,c=this.plotDimension.plotMargin.leftMargin,u=this.plotDimension.plotMargin.topMargin,d=this.plotDimension.plotMargin.rightMargin,h=this.plotDimension.plotMargin.bottomMargin,p=this.plotDimension.plotMargin.bump,f=document.getElementById(e),_=f.getContext("2d");_.clearRect(0,0,s,l),n&&n.constructor===Array?t.map((function(t){t.xValue=t["x"][n[0]],t.yValue=t["y"][n[1]],i.push(t.xValue),o.push(t.yValue)})):t.map((function(t){t.x.constructor===Object?(t.xValue=t["x"][a.renderConfig["x axis field"]],i.push(t.xValue)):i.push(t.x),t.y.constructor===Object?(t.yValue=t["y"][a.renderConfig["y axis field"]],o.push(t.yValue)):o.push(t.y)}));var g=r?r.xMin:Math.min.apply(Math,i),m=r?r.xMax:Math.max.apply(Math,i);g==m&&(g-=.5,m+=.5);var v=r?r.yMin:Math.min.apply(Math,o),y=r?r.yMax:Math.max.apply(Math,o);v==y&&(v-=.5,y+=.5);var b={top:u,bottom:h,left:c,right:d,bump:p};if(this.multiList?(this.utils.plotUtils.renderAxisWBump(_,s,l,b,"x",5,g,m,n[0]),this.utils.plotUtils.renderAxisWBump(_,s,l,b,"y",5,v,y,n[1])):(this.utils.plotUtils.renderAxisWBump(_,s,l,b,"x",5,g,m,[this.renderConfig["x axis field"]]),this.utils.plotUtils.renderAxisWBump(_,s,l,b,"y",5,v,y,[this.renderConfig["y axis field"]])),this.colorsList&&!this.multiList){var x=0;this.colorsList.map((function(e){var n=t.filter((function(t){return t.color[a.renderConfig["color field"]]===e})),r=a.compareGroupColors[x%16];a.utils.plotUtils.renderDots(_,s,l,b,g,m,v,y,r,n,a.starItems,a.renderConfig["star key"]),x++}))}else if(this.colorByList){var w=0;if(n)if(n.constructor===Array){w=0;var C=this.renderConfig["color field"];
1n[2]&&(C=n[2]),this.colorByList[C].map((function(e){var n=t.filter((function(t){return t.color[C]===e})),r=a.compareGroupColors[w%16];a.utils.plotUtils.renderDots(_,s,l,b,g,m,v,y,r,n,a.starItems,a.renderConfig["star key"]),a.utils.plotUtils.renderBestFitLine(_,s,l,b,g,m,v,y,r,n),w++}))}else w=0,this.colorByList[this.renderConfig["color field"]].map((function(e){if(n===e){var r=t.filter((function(t){return t.color[a.renderConfig["color field"]]==e})),i=a.compareGroupColors[w%16];a.utils.plotUtils.renderDots(_,s,l,b,g,m,v,y,i,r,a.starItems,a.renderConfig["star key"]),a.utils.plotUtils.renderBestFitLine(_,s,l,b,g,m,v,y,i,r),w++}}));else if(this.renderConfig["color field gradient"]){this.colorByList[this.renderConfig["color field"]].map((function(e){var n=t.filter((function(t){return t.color[a.renderConfig["color field"]]==e})),r="#00000001";e>=a.gradientMinMax.currMin&&e<=a.gradientMinMax.currMax&&(r=a.colorFromGradientByValue(e,a.colorByList[a.renderConfig["color field"]][0],a.colorByList[a.renderConfig["color field"]][a.colorByList[a.renderConfig["color field"]].length-1])),a.utils.plotUtils.renderDots(_,s,l,b,g,m,v,y,r,n,a.starItems,a.renderConfig["star key"])}));var P=t.filter((function(t){return t.color[a.renderConfig["color field"]]>=a.gradientMinMax.currMin&&t.color[a.renderConfig["color field"]]<=a.gradientMinMax.currMax})),k="#00000050";this.utils.plotUtils.renderBestFitLine(_,s,l,b,g,m,v,y,k,P)}else{var M=this.renderConfig["color highlight"];w=0,this.colorByList[this.renderConfig["color field"]].map((function(e){var n=t.filter((function(t){return t.color[a.renderConfig["color field"]]==e})),r=a.compareGroupColors[w%16];M&&(r=r.substring(0,r.length-2),r+=M===e?"90":"05"),a.utils.plotUtils.renderDots(_,s,l,b,g,m,v,y,r,n,a.starItems,a.renderConfig["star key"]),a.utils.plotUtils.renderBestFitLine(_,s,l,b,g,m,v,y,r,n),w++}))}}else{var E=this.compareGroupColors[0];this.utils.plotUtils.renderDots(_,s,l,b,g,m,v,y,E,t,this.starItems,this.renderConfig["star key"])}if(n){_.font="26px Arial",_.fillStyle="#000000",_.textAlign="center";var D=this.renderConfig["group by"]+": "+n,O=n;n.constructor===Array&&(D="".concat(n[1]," : ").concat(n[0]),O="multi"+e.substring(e.length-1,e.length)),_.fillText(D,s/2+c/2,p+26),this.posData[O]=this.utils.plotUtils.getDotsPosData(s,l,b,g,m,v,y,t)}else this.posData=this.utils.plotUtils.getDotsPosData(s,l,b,g,m,v,y,t);return{xMin:g,xMax:m,yMin:v,yMax:y}},renderPlot:function(){var t=this;if(this.renderData.length>0)if(this.multiList)this.multiList.forEach((function(e,n){var r="scatterPlot"+t.sectionId+"multi"+n;document.getElementById(r)&&t.renderIndividualPlot(t.renderData,r,e)}));else if(this.groupsList)this.groupsList.map((function(e){var n=t.renderData.filter((function(t){return t.group==e})),r="scatterPlot"+t.sectionId+e;document.getElementById(r)&&t.renderIndividualPlot(n,r,e)}));else if(this.colorByList)this.renderIndividualPlot(this.renderData,"scatterPlot"+this.sectionId);else this.renderIndividualPlot(this.renderData,"scatterPlot"+this.sectionId)},setPlotAxisIndex:function(t,e){this.renderConfig[e+" axis field"]=t.target.value,this.renderPlot()},setColorField:function(t){t.target.parentNode.querySelector(".color-key").childNodes.forEach((function(t){t.classList.remove("selected")})),this.colorByField=this.renderConfig["color highlight"]=null,this.colorByGradient=this.renderConfig["color field gradient"]=null,this.colorByField=this.renderConfig["color field"]=t.target.value,this.renderConfig["color by"].includes(this.renderConfig["color field"])||(this.colorByGradient=this.renderConfig["color field gradient"]=this.renderConfig["color field"],this.gradientMinMax.max=this.colorByList[this.renderConfig["color field"]][this.colorByList[this.renderConfig["color field"]].length-1],this.gradientMinMax.min=this.colorByList[this.renderConfig["color field"]][0],this.gradientMinMax.currMax=this.gradientMinMax.max,this.gradientMinMax.currMin=this.gradientMinMax.min,this.gradientMinMax.activeEl=null),this.renderPlot()},setHighlightField:function(t,e){t.target.closest(".color-key").childNodes.forEach((function(t){t.classList.remove("selected")})),this.renderConfig["color highlight"]&&this.renderConfig["color highlight"]===e?this.renderConfig["color highlight"]=null:(this.renderConfig["color highlight"]=e,t.target.closest(".anno-bubble-wrapper").classList.add("selected")),this.renderPlot()},colorGradient:function(){var t=["#450c54","#481668","#482677","#453681","#3e4788","#39558c","#31648d","#2e708e","#277d8e","#218a8d","#21968b","#20a286","#28af7f","#3dbc75","#56c667","#75d056","#94d841","#b9de28","#dce318","#fde724"],e=t,n="linear-gradient(0deg, ";return e.forEach((function(t,r){n+=t,n+=r<e.length-1?",":")"})),{width:"30px",height:"100px",background:n}},colorFromGradientByValue:function(t,e,n){var r=["#450c54","#481668","#482677","#453681","#3e4788","#39558c","#31648d","#2e708e","#277d8e","#218a8d","#21968b","#20a286","#28af7f","#3dbc75","#56c667","#75d056","#94d841","#b9de28","#dce318","#fde724"],a=n-e,i=t-e,o=i/a*100,s=Math.floor(o/100*(r.length-1));return r[s]},gradientHandleDown:function(t){t.target.classList.contains("color-gradient-handle")&&(this.gradientMinMax.activeEl=t.target,this.gradientMinMax.yOffset=t.target.getBoundingClientRect().y-t.clientY,window.addEventListener("mouseup",this.gradientHandleUp))},gradientHandleMove:function(t){if(this.gradientMinMax.activeEl){var e=this.gradientMinMax.activeEl,n=!!e.classList.contains("color-gradient-max"),r=e.closest(".color-gradient-wrapper").getBoundingClientRect(),a=t.clientY-r.top+this.gradientMinMax.yOffset;a=Math.min(Math.max(a,0),100);var i=this.gradientMinMax.max-this.gradientMinMax.min;e.dataset.val=(this.gradientMinMax.min+i*((100-a)/100)).toFixed(2),n?this.gradientMinMax.currMax=Number(e.dataset.val):this.gradientMinMax.currMin=Number(e.dataset.val),e.innerHTML=e.dataset.val,n&&(e.style.top="".concat(a+2,"px")),n||(e.style.bottom="".concat(100-a+2,"px"))}},gradientHandleUp:function(){this.gradientMinMax.activeEl&&(this.gradientMinMax.activeEl=null,window.removeEventListener("mouseup",this.gradientHandleUp),this.renderPlot())},onResize:function(t){this.renderPlot()},checkPosition:function(t,e,n){var r=this,a=e?this.posData[e]:this.posData,i=document.querySelector("#scatter_dot_value"+this.sectionId),o=document.querySelector("#scatter_dot_value_content"+this.sectionId),s=(t.target,t.target.getBoundingClientRect()),l=Math.floor(t.clientX-s.left),c=Math.floor(t.clientY-s.top),u=this.utils.plotUtils.getDotsInPos(l,c,a);if(u.length>0){var d=u.length>5&&"move"==n&&!this.isDotPanelClick?"<strong>There are more items to display. <br />Click to view the full list.</strong><br /><br />":"",h=0;if(u.map((function(t){if("move"==n&&h<6&&!r.isDotPanelClick){d+="<strong>"+t.key+"</strong><br />";for(var e=0,a=Object.entries(t.hover);e<a.length;e++){var i=Object(_["a"])(a[e],2),o=i[0],s=i[1];d+="<span>"+o+": ",d+=r.utils.Formatters.getHoverValue(s)+"</span><br />"}}else if("click"==n){d+="<strong>"+t.key+"</strong><br />";for(var l=0,c=Object.entries(t.hover);l<c.length;l++){var u=Object(_["a"])(c[l],2),p=u[0],f=u[1];d+="<span>"+p+": ",d+=r.utils.Formatters.getHoverValue(f)+"</span><br />"}}h++})),"move"==n&&!this.isDotPanelClick){o.innerHTML=d;var p=i.offsetWidth,f=i.offsetHeight,g={top:t.clientY,right:window.innerWidth-t.clientX,bottom:window.innerHeight-t.clientY,left:t.clientX}
1,m=10,v={x:g.right<p+m?-p-m:m,y:g.bottom<f+m?-f-m:m};i.style.left=g.left+v.x+"px",i.style.top=g.top+v.y+"px",i.setAttribute("class","scatter-dot-value")}"click"==n&&(this.isDotPanelClick=!0,i.setAttribute("class","scatter-dot-value fixed-panel"),o.innerHTML=d)}else"click"==n&&(this.isDotPanelClick=!1,i.setAttribute("class","scatter-dot-value hidden"),clearTimeout(this.dotPanelCloseTimer)),"move"!=n||this.isDotPanelClick||(o.innerHTML="",i.setAttribute("class","scatter-dot-value hidden"),clearTimeout(this.dotPanelCloseTimer)),"leave"==n&&(this.dotPanelCloseTimer=setTimeout((function(){r.isDotPanelClick=!1,i.setAttribute("class","scatter-dot-value hidden")}),2e3)),"enter popup"==n&&(this.isDotPanelClick=!0,clearTimeout(this.dotPanelCloseTimer))}}});s()((function(){}));var it=at,ot=(n("8135"),Object(C["a"])(it,tt,et,!1,null,null,null)),st=ot.exports,lt=n("9341"),ct=n("1203"),ut=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12 bar-plot-wrapper"},[n("div",{staticClass:"col-md-12",staticStyle:{display:"inline-block"},attrs:{id:t.canvasId+"barPlotWrapper"}},[n("div",{staticClass:"barplot-info-box hidden",attrs:{id:t.canvasId+"barInfoBox"}},[n("div",{staticClass:"fixed-info-box-close",attrs:{id:t.canvasId+"info_box_close"},on:{click:function(e){return t.utils.uiUtils.removeOnMouseOut(t.canvasId+"barInfoBox",100)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("span",{attrs:{id:t.canvasId+"barInfoBoxContent"}}),t._l(t.hoverItems,(function(e,r){return n("span",{key:r},[n("strong",[t._v(t._s(r))]),n("br"),t._l(e.data,(function(e,r){return n("span",[n("span",[t._v(t._s(r+": "))]),n("span",[t._v(t._s(e))]),t._v(" "),n("br")])})),null!=t.options&&1==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"barInfoBox")?[t.options.includes("add phenotype")?n("button",{staticClass:"option-button",on:{click:function(n){return t.addPhenotype(e.id)}}},[t._v(" Add this phenotype below ")]):t._e(),t.options.includes("open phenotype page")?n("button",{staticClass:"option-button",on:{click:function(n){return t.openPage("phenotype.html",{phenotype:e.id})}}},[t._v(" Go to phenotype page ")]):t._e()]:t._e(),null!=t.options&&0==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"barInfoBox")?n("span",[t._v("Click for options")]):t._e()],2)}))],2),n("canvas",{attrs:{hidden:!t.showCanvas,id:t.canvasId+"barPlot",width:"",height:""},on:{mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){!t.utils.uiUtils.isIdFixed("#"+t.canvasId+"barInfoBox")&&t.utils.uiUtils.removeOnMouseOut(t.canvasId+"barInfoBox",1e3)}}}),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.canvasId,t.canvasId+"_barPlot","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage(t.canvasId+"barPlot",t.canvasId+"_barPlot","png")}}},[t._v("Download PNG")])])])]),t.renderData?n("research-bar-plot-vector",{ref:t.canvasId+"_barPlot",attrs:{renderData:t.groupData(t.renderData),renderConfig:t.renderConfig,colors:t.colors,margin:t.adjPlotMargin,sectionId:t.canvasId,utils:t.utils}}):t._e()],1)])])},dt=[],ht=n("45ab"),pt=ht["a"],ft=(n("0542"),Object(C["a"])(pt,ut,dt,!1,null,null,null)),_t=ft.exports,gt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12 bar-plot-wrapper"},[n("div",{staticClass:"col-md-12",staticStyle:{display:"inline-block"},attrs:{id:t.canvasId+"barInCellPlotWrapper"}},[n("canvas",{attrs:{hidden:!t.showCanvas,id:t.canvasId+"barInCellPlot",width:"",height:""}})])])])},mt=[],vt=n("b85c"),yt=n("b300");i["default"].use(g["a"]);var bt=i["default"].component("research-bar-in-cell-plot",{props:["canvasId","plotData","plotConfig","plotMargin","utils"],data:function(){return{barData:null,barPosData:{},spaceBy:7,trigger:0,hoverItems:{},showCanvas:!0}},modules:{},components:{barPlotVector:yt["a"]},created:function(){this.renderPlot()},mounted:function(){window.addEventListener("resize",this.onResize),this.renderPlot()},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{adjPlotMargin:function(){var t=this.plotConfig["plot margin"]?this.plotConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},plotGroups:function(){var t,e={xAxis:[],yAxis:[],barFields:{},barFieldsType:{},max:null,min:null},n=this.plotConfig["x axis field"],r=this.plotConfig["y axis field"],a=this.plotConfig["bars in cell"],i=Object(vt["a"])(a);try{for(i.s();!(t=i.n()).done;){var o=t.value;e.barFields[o["field"]]=o["color"],e.barFieldsType[o["field"]]=o["value type"]}}catch(s){i.e(s)}finally{i.f()}return this.plotData.map((function(t){t[n]&&(e.xAxis.includes(t[n])||e.xAxis.push(t[n])),t[r]&&(e.yAxis.includes(t[r])||e.yAxis.push(t[r])),Object.keys(e.barFields).map((function(n){var r=t[n];e.max=r&&(!e.max||e.max<r)?r:e.max,e.min=r&&(!e.min||e.min>r)?r:e.min}))})),e.min=e.min>0?0:e.min,e},renderData:function(){return this.plotData}},watch:{renderData:function(t){this.renderPlot()}},methods:{onResize:function(){this.renderPlot()},renderPlot:function(){var t=document.querySelector("#"+this.canvasId+"barInCellPlotWrapper"),e=document.querySelector("#"+this.canvasId+"barInCellPlot"),n=this.adjPlotMargin,r=this.plotGroups,a=this.plotConfig,i=a["bar width"],o=a["bar height"],s=i*Object.keys(r.barFields).length+n.bump,l=o+n.bump,c=i/r.max,u=2*n.left+n.bump,d=2*n.top+n.bump;if(e&&t){var h,p=2*(n.left+n.right+r.xAxis.length*s),f=2*(n.top+n.bottom+r.yAxis.length*l);e.setAttribute("width",p),e.setAttribute("height",f),e.setAttribute("style","width:"+p/2+"px;
1height:"+f/2+"px;"),h=e.getContext("2d");var _=function(t,e,n){return h.font=e+"px "+n,h.measureText(t).width};h.clearRect(0,0,p,f),this.barPosData={};var g=2*n.bump;Object.keys(r.barFields).map((function(t){h.fillStyle=r.barFields[t],h.fillRect(g,2*n.bump,24,24),g+=24+n.bump,h.textAlign="start",h.font="26px Arial",h.fillStyle="#000000",h.fillText(t,g,2*n.bump+24),g+=_(t,26,"Arial")+2*n.bump})),h.font="26px Arial",h.fillStyle="#000000",r.yAxis.map((function(t,e){var a=d+2*l*e;h.textAlign="end",h.fillText(t,2*n.left-n.bump/2,a+(2*o-n.bump)),h.moveTo(u-n.bump/2+2*s*e,d-n.bump/2),h.lineTo(u-n.bump/2+2*s*e,d+(r.yAxis.length*(2*l)-n.bump/2)),h.strokeStyle="#666666",h.lineWidth=1,h.stroke()})),r.xAxis.map((function(t,e){h.textAlign="center",h.fillText(t,2*n.left+2*s*(e+1)-s,2*n.top-n.bump)}));var m=c*r.max*2;r.xAxis.map((function(t,e){r.yAxis.map((function(t,n){Object.keys(r.barFields).map((function(t,r){var a=d+2*l*n,c=u+2*s*e+2*i*r;h.fillStyle="#999999",h.fillRect(c,a+o,m,2)}))}))})),this.plotData.map((function(t){var e=r.xAxis.indexOf(t[a["x axis field"]]),p=r.yAxis.indexOf(t[a["y axis field"]]);Object.keys(r.barFields).map((function(a,f){var g=d+2*l*p,v=u+2*s*e+2*i*f,y=c*t[a]*2;if(h.fillStyle="#ffffff",h.fillRect(v,g,m,2*o),"number"==r.barFieldsType[a]){h.fillStyle="#eeeeee",h.fillRect(v,g,m,2*o),h.fillStyle=r.barFields[a],h.fillRect(v,g,y,2*o);var b=_(t[a],26,"Arial");b+y>m?(h.textAlign="end",h.fillStyle="#ffffff",h.fillText(t[a],v+y-n.bump,g+(2*o-n.bump))):(h.textAlign="start",h.fillStyle="#000000",h.fillText(t[a],v+y+n.bump,g+(2*o-n.bump)))}else"string"==r.barFieldsType[a]&&(h.textAlign="start",h.fillStyle=r.barFields[a],h.fillText(t[a],v+n.bump,g+(2*o-n.bump)))}))})),h.textAlign="center",h.font="700 30px Arial",h.fillStyle="#000000",h.fillText(a.label,p/2,f-n.bump)}}}});s()((function(){}));var xt=bt,wt=Object(C["a"])(xt,gt,mt,!1,null,null,null),Ct=wt.exports,Pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12 box-plot-wrapper"},[n("div",{staticClass:"col-md-12",staticStyle:{display:"inline-block"},attrs:{id:t.canvasId+"boxPlotWrapper"}},[n("div",{staticClass:"boxplot-info-box hidden",attrs:{id:t.canvasId+"boxInfoBox"}},[n("div",{staticClass:"fixed-info-box-close",attrs:{id:t.canvasId+"info_box_close"},on:{click:function(e){return t.utils.uiUtils.removeOnMouseOut(t.canvasId+"boxInfoBox",100)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("span",{attrs:{id:t.canvasId+"boxInfoBoxContent"}}),t._l(t.hoverItems,(function(e,r){return n("span",{key:r},[n("strong",[t._v(t._s(r))]),n("br"),t._l(e.data,(function(e,r){return n("span",[n("span",[t._v(t._s(r+": "))]),n("span",[t._v(t._s(e))]),t._v(" "),n("br")])})),null!=t.options&&1==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"boxInfoBox")?[t.options.includes("add phenotype")?n("button",{staticClass:"option-button",on:{click:function(n){return t.addPhenotype(e.id)}}},[t._v(" Add this phenotype below ")]):t._e(),t.options.includes("open phenotype page")?n("button",{staticClass:"option-button",on:{click:function(n){return t.openPage("phenotype.html",{phenotype:e.id})}}},[t._v(" Go to phenotype page ")]):t._e()]:t._e(),null!=t.options&&0==t.utils.uiUtils.isIdFixed("#"+t.canvasId+"boxInfoBox")?n("span",[t._v("Click for options")]):t._e()],2)}))],2),n("div"),n("canvas",{attrs:{hidden:!t.showCanvas,id:t.canvasId+"boxPlot",width:"",height:""},on:{mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){!t.utils.uiUtils.isIdFixed("#"+t.canvasId+"boxInfoBox")&&t.utils.uiUtils.removeOnMouseOut(t.canvasId+"boxInfoBox",1e3)}}}),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.canvasId,t.canvasId+"_boxPlot","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage(t.canvasId+"boxPlot",t.canvasId+"_boxPlot","png")}}},[t._v("Download PNG")])])])]),t.renderData?n("research-box-plot-vector",{ref:t.canvasId+"_boxPlot",attrs:{renderData:t.groupData(t.renderData),renderConfig:t.renderConfig,colors:t.colors,margin:t.adjPlotMargin,sectionId:t.canvasId,utils:t.utils}}):t._e()],1)])])},kt=[],Mt=n("c1fa"),Et=Mt["a"],Dt=(n("a7ad"),Object(C["a"])(Et,Pt,kt,!1,null,null,null)),Ot=Dt.exports,Lt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"region-track-wrapper",attrs:{id:"region_track_wrapper"+t.sectionId}},[n("div",{staticClass:"block-data hidden",attrs:{id:"block_data_"+t.sectionId}},[n("div",{staticClass:"fixed-info-box-close",on:{click:function(e){t.infoBoxFrozen=!1,t.hidePanel("block_data_"+t.sectionId)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}}
1)],1),n("div",{staticClass:"block-data-content",attrs:{id:"block_data_content_"+t.sectionId}},[t._l(t.infoBoxContent.data,(function(e,r){return["hover"==t.infoBoxContent.action&&r<5?n("span",[n("strong",[t._v(t._s(e.title))]),t._l(e,(function(e,r){return["title"!=r?n("span",[n("br"),t._v(t._s(r+": "+e))]):t._e()]})),t.plotConfig["set region parameter by"]&&e[t.plotConfig["set region parameter by"]["field"]]?[n("br"),n("span",{staticStyle:{color:"#5fa331"}},[t._v("Click to set region.")])]:t._e(),n("br")],2):t._e(),"click"==t.infoBoxContent.action?n("span",[n("strong",[t._v(t._s(e.title))]),t._l(e,(function(e,r){return["title"!=r?n("span",[n("br"),t._v(t._s(r+": "+e))]):t._e()]})),t.plotConfig["set region parameter by"]&&e[t.plotConfig["set region parameter by"]["field"]]?[n("br"),n("button",{staticClass:"btn btn-primary btn-sm",on:{click:function(n){return t.setRegion(e[t.plotConfig["set region parameter by"]["field"]],t.plotConfig["set region parameter by"]["parameter"],t.plotConfig["set region parameter by"]["max region"])}}},[t._v(" Set region ")]),n("br"),t._v("Max length: "+t._s(t.plotConfig["set region parameter by"]["max region"])+" ")]:t._e(),n("br")],2):t._e(),t.infoBoxContent.data.length>1?[n("br"),n("br")]:t._e()]}))],2)]),n("div",{staticClass:"col-md-11"},t._l(t.colorGroups,(function(e,r){return n("span",{key:e,staticClass:"color-groups",on:{mouseover:function(n){return t.renderPlot(e)},mouseleave:function(e){return t.renderPlot()}}},[n("span",{staticClass:"box",style:"background-color:"+t.colors.bold[r%16]}),n("span",{staticClass:"label",domProps:{innerHTML:t._s(e)}})])})),0),t.plotConfig?n("canvas",{staticClass:"region-track",attrs:{id:"track_"+t.sectionId,width:"",height:""},on:{mouseleave:function(e){t.hidePanel("block_data_"+t.sectionId),t.resetPosMarker()},mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},resize:t.onResize}}):t._e(),n("span",{staticClass:"x-pos-marker",attrs:{id:t.sectionId+"_xPosMarker"}}),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_regionTrack","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("track_"+t.sectionId,t.sectionId+"_regionTrack","png")}}},[t._v("Download PNG")])])])]),t.renderData?n("research-region-track-vector",{ref:t.sectionId+"_regionTrack",attrs:{renderData:t.renderData,renderConfig:t.plotConfig,colors:t.colors.bold,margin:t.adjPlotMargin,region:t.viewingRegion,sectionId:t.sectionId,utils:t.utils}}):t._e()],1)},jt=[],St=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},At=[];n("07ac");i["default"].use(g["a"]);var It=i["default"].component("research-region-track-vector",{props:["renderData","renderConfig","colors","margin","region","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{canvasId:function(t){}},methods:{renderPlot:function(){var t=this,e=".vector-wrapper-".concat(this.canvasId),n=document.createElement("canvas"),r=n.getContext("2d"),a=function(t,e,n){return r.font=e+"px "+n,r.measureText(t).width},i=document.querySelector("#region_track_wrapper"+this.sectionId),o={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},s=Object.keys(this.renderData).sort(),l=[];Object.values(this.renderData).map((function(e){Object.values(e).map((function(e){e.map((function(e){l.push(e[t.renderConfig["color by"]])}))}))})),l=Object(f["a"])(new Set(l)).sort();var c=0;l.map((function(t){return c+=a(t,12,"Arial")+20}));var u=this.renderConfig["width"]?this.renderConfig["width"]:i.clientWidth-(o.left+o.right),d=Math.ceil((20*l.length+c)/u);o.top=o.top+20*d;var h=this.renderConfig["track height"]*s.length,p=b["select"](e).append("svg").attr("id","vector_region_track_"+this.sectionId).attr("width",u+o.left+o.right).attr("height",h+o.top+o.bottom);p.append("g").attr("id","tracksGroup").attr("transform","translate(0,0)").style("font-family","Arial").style("font-size",12).style("text-anchor","start");var _=o.bump,g=20;l.map((function(e,n){var r=t.renderConfig["color by"]?n%t.colors.length:null,i=r||0===r?t.colors[r]:"#00000066";p.select("#tracksGroup").append("rect").attr("x",_).attr("y",g-12).attr("height",12).attr("width",12).style("fill",i);var s=a(e,12,"Arial");p.select("#tracksGroup").append("text").attr("x",_+15).attr("y",g).text(e),s+=a(l[n+1],12,"Arial"),_+s+20>u+o.left?(_=o.bump,g+=20):_+=a(e,12,"Arial")+20}));var m=b["scaleLinear"]().domain([this.region.start,this.region.end]).range([o.left,u+o.left]);p.select("#tracksGroup").append("line").attr("x1",o.left-o.bump).attr("y1",o.top+h+o.bump).attr("x2",o.left+u+o.bump).attr("y2",o.top+h+o.bump).attr("stroke","#000000").style("stroke-width",.7
15);for(var v=Math.ceil((this.region.end-this.region.start)/5),y=0;y<6;y++){var x=m(this.region.start+v*y);p.select("#tracksGroup").append("line").attr("x1",x).attr("y1",o.top+h+o.bump).attr("x2",x).attr("y2",o.top+h+2*o.bump).attr("stroke","#000000").style("stroke-width",.75);var w=this.region.end-this.region.start,C=w<=1?2:w<=50?1:0,P=this.utils.Formatters.decimalFormatter(this.region.start+y*v,C);P=P>=1e5?Math.round(.001*P)+"k":P,p.select("#tracksGroup").append("text").attr("x",x).attr("y",o.top+h+20).style("text-anchor","middle").text(P)}p.select("#tracksGroup").append("line").attr("x1",o.left-o.bump).attr("y1",o.top).attr("x2",o.left-o.bump).attr("y2",o.top+h+o.bump).attr("stroke","#000000").style("stroke-width",.75),p.select("#tracksGroup").append("line").attr("x1",o.left+u+o.bump).attr("y1",o.top).attr("x2",o.left+u+o.bump).attr("y2",o.top+h+o.bump).attr("stroke","#000000").style("stroke-width",.75),s.map((function(e,n){var r="",i=a(e,12,"Arial");if(i>o.left-o.bump){for(var s=0;s<e.length;s++)a(r+e[s],12,"Arial")<o.left-6*o.bump&&(r+=e[s]);r+="..."}else r=e;p.select("#tracksGroup").append("text").attr("x",o.bump).attr("y",n*t.renderConfig["track height"]+o.top+10).text(r),n%2==0&&p.select("#tracksGroup").append("rect").attr("x",o.left).attr("y",n*t.renderConfig["track height"]+o.top).attr("height",t.renderConfig["track height"]).attr("width",u).style("fill","#eeeeee"),Object.keys(t.renderData[e]).map((function(r){var a=r.split("-"),i=m(a[0])<m(t.region.start)?m(t.region.start):m(a[0]),s=m(a[1])>m(t.region.end)?m(t.region.end):m(a[1]),c=s-i<1?1:s-i;t.renderData[e][r].map((function(e){var r=t.renderConfig["color by"]?l.indexOf(e[t.renderConfig["color by"]])%t.colors.length:null,a=r||0===r?t.colors[r]:"#00000066";p.select("#tracksGroup").append("rect").attr("x",i).attr("y",n*t.renderConfig["track height"]+o.top).attr("height",t.renderConfig["track height"]).attr("width",c).style("fill",a)}))}))}))}}});s()((function(){}));var Tt=It,Bt=Object(C["a"])(Tt,St,At,!1,null,null,null),Rt=Bt.exports;n("6e0f");i["default"].use(g["a"]);var Ft=i["default"].component("research-region-track",{props:["sectionId","plotConfig","plotData","dataComparisonConfig","regionParam","regionZoom","regionViewArea","colors","utils","plotMargin","starItems"],data:function(){return{posData:{},groupsList:null,colorGroups:[],infoBoxFrozen:!1,starGroups:[],infoBoxContent:{action:null,data:[]}}},modules:{},components:{regionTrackVector:Rt},mounted:function(){this.renderPlot(),window.addEventListener("resize",this.onResize)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{hoverPos:function(){return this.$root.hoverPos},region:function(){var t=this.regionParam;if(this.plotConfig["expand region by"]){var e=t.split(":"),n=e[0],r=e[1].split("-"),a=Number(r[0]),i=Number(r[1]);a-=this.plotConfig["expand region by"]/2,a=a<=0?0:a,i+=this.plotConfig["expand region by"]/2,t=n+":"+a+"-"+i}return t},adjPlotMargin:function(){var t=this.plotConfig["plot margin"]?this.plotConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},renderData:function(){var t=this,e={},n=[];return this.plotData.map((function(r){e[r[t.plotConfig["y axis field"]]]||(e[r[t.plotConfig["y axis field"]]]={}),t.plotConfig["color by"]&&!n.includes(r[t.plotConfig["color by"]])&&n.push(r[t.plotConfig["color by"]]),e[r[t.plotConfig["y axis field"]]][r[t.plotConfig["render by"]]]||(e[r[t.plotConfig["y axis field"]]][r[t.plotConfig["render by"]]]=[]),e[r[t.plotConfig["y axis field"]]][r[t.plotConfig["render by"]]].push(r)})),this.colorGroups=n.sort(),e}},watch:{hoverPos:function(t){this.renderPlot(null,"enter")},viewingRegion:function(t){this.renderPlot()},plotData:function(t){this.renderPlot()},starItems:function(t){this.starGroups=Object(f["a"])(new Set(t.map((function(t){return t.section})))).sort(),this.renderPlot()}},methods:{setRegion:function(t,e,n){var r=t.split(":"),a=r[1].split("-"),i=Math.floor(Number(a[0])+(a[1]-a[0])/2),o=i-n/2<=0?0:Math.floor(i-n/2),s=Math.floor(i+n/2),l=r[0]+":"+o+"-"+s,c=window.location.href.split("?"),u=c[1].split("&"),d="?";u.map((function(t,n){var r=t.split("=");d+=r[0]==e?r[0]+"="+l:r[0]+"="+r[1],d+=n<u.length-1?"&":""})),window.location.href=c[0]+d},downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.sectionId+"_regionTrack"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_region_track_"+this.sectionId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},renderPlot:function(t,e){var n=this;this.posData={};var r,a,i=Object.keys(this.renderData).sort(),o=2*this.plotConfig["track height"],s=2*document.querySelector("#regi
1on_track_wrapper"+this.sectionId).clientWidth,l=o*i.length+this.adjPlotMargin.top+this.adjPlotMargin.bottom;r=document.getElementById("track_"+this.sectionId),r.setAttribute("width",s),r.setAttribute("height",l),r.setAttribute("style","width: "+s/2+"px;height:"+l/2+"px;"),a=r.getContext("2d"),a.clearRect(0,0,s,l);var c=0,u=o*i.length,d=s-(this.adjPlotMargin.left+this.adjPlotMargin.right),h=this.viewingRegion,p=d/(h.end-h.start);a.fillStyle="#ff880025",a.fillRect(this.adjPlotMargin.left,u+this.adjPlotMargin.top+2*this.adjPlotMargin.bump+12,d,12),this.renderAxis(a,d,u,Number(h.end),Number(h.start),this.adjPlotMargin.top,this.adjPlotMargin);var f=document.createElement("canvas"),_=f.getContext("2d"),g=function(t,e,n){return _.font=e+"px "+n,_.measureText(t).width};i.map((function(e){var r=n.adjPlotMargin.top+o*c;a.fillStyle="#000000",a.textAlign="start",a.textBaseline="middle",a.font="24px Arial";Math.floor((n.adjPlotMargin.left-n.adjPlotMargin.bump)/16);var i="",s=g(e,24,"Arial");if(s>n.adjPlotMargin.left-n.adjPlotMargin.bump){for(var l=0;l<e.length;l++)g(i+e[l],24,"Arial")<n.adjPlotMargin.left-6*n.adjPlotMargin.bump&&(i+=e[l]);i+="..."}else i=e;a.fillText(i,2,r+12),c%2==0&&(a.fillStyle="#00000010",a.fillRect(n.adjPlotMargin.left,r,d,o));var u=n.renderData[e],f=Object.keys(u);f.map((function(i){u[i].map((function(i,s){var l,c,u,f=i[n.plotConfig["render by"]].split("-"),_=f[0],g=f[1];_<=h.end&&g>=h.start?(l=(_-h.start)*p+n.adjPlotMargin.left,l=l<=n.adjPlotMargin.left?n.adjPlotMargin.left:l,c=(g-h.start)*p+n.adjPlotMargin.left,c=c>n.adjPlotMargin.left+d?n.adjPlotMargin.left+d:c):_<=h.start&&g>=h.start?(l=n.adjPlotMargin.left-n.adjPlotMargin.bump,c=(g-h.start)*p+n.adjPlotMargin.left,c=c>n.adjPlotMargin.left+d?n.adjPlotMargin.left+d:c):_<=h.end&&g>=h.end?(l=(_-h.start)*p+n.adjPlotMargin.left,l=l<=n.adjPlotMargin.left?n.adjPlotMargin.left:l,c=n.adjPlotMargin.left+d+n.adjPlotMargin.bump):g<=h.start?(l=n.adjPlotMargin.left-n.adjPlotMargin.bump-15,c=n.adjPlotMargin.left-n.adjPlotMargin.bump-5):_>=h.end&&(l=n.adjPlotMargin.left+d+n.adjPlotMargin.bump+5,c=n.adjPlotMargin.left+d+n.adjPlotMargin.bump+15),u=c-l<2?2:c-l;var m=n.plotConfig["color by"]?n.colorGroups.indexOf(i[n.plotConfig["color by"]])%16:null,v=!(!t||i[n.plotConfig["color by"]]!=t)||null;v&&(a.fillStyle="#FF0000",a.fillRect(l-2,r-2,u+4,o+4)),a.fillStyle=m||0===m?n.colors.bold[m]:"#00000066",a.fillRect(l,r,u,o),n.posData[Math.round(r/2)]||(n.posData[Math.round(r/2)]={label:e,regions:[]}),n.posData[Math.round(r/2)]["regions"].push({start:Math.round(l/2),end:Math.round((l+u)/2),data:i})}))})),c++}));var m=this.adjPlotMargin.left;if(this.starItems){var v=this.adjPlotMargin.top-this.adjPlotMargin.bump,y=this.adjPlotMargin.top+u+3*this.adjPlotMargin.bump;this.starItems.map((function(t){var e=m+(t.columns[n.plotConfig["x axis field"]]-h.start)*p,r=n.colors.moderate[n.starGroups.indexOf(t.section)%16];n.utils.plotUtils.renderDashedLine(a,e,v,e,y,3,r,[6,2])}));var b=this.adjPlotMargin.bump;this.starGroups.map((function(t,e){var r=n.colors.bold[e],i=n.adjPlotMargin.top+u+n.adjPlotMargin.bottom-n.adjPlotMargin.bump;n.utils.plotUtils.renderDashedLine(a,b,i,b+50,i,3,r,[12,4]),b+=60,a.font="24px Arial",a.fillStyle=r,a.fillText(t,b,i),b+=g(t,24,"Arial")+n.adjPlotMargin.bump}))}if(this.hoverPos.length>0&&this.hoverPos.map((function(t){var e=n.adjPlotMargin.top-n.adjPlotMargin.bump,r=n.adjPlotMargin.top+u+3*n.adjPlotMargin.bump,i=m+(t-h.start)*p;n.utils.plotUtils.renderDashedLine(a,i,e,i,r,1,"#ff0000",[6,2])})),this.plotConfig["expand region by"]){var x=this.regionParam.split(":")[1].split("-"),w=this.adjPlotMargin.top+u+this.adjPlotMargin.bump/2,C=m+(x[0]-h.start)*p,P=m+(x[1]-h.start)*p,k=P-C;a.fillStyle="#FF0000",a.fillRect(C,w,k,10),a.font="24px Arial",a.fillStyle="#ff0000",a.textAlign="center",a.fillText("Viewing region",C+k/2,w+3*this.adjPlotMargin.bump)}},renderAxis:function(t,e,n,r,a,i,o){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]),t.moveTo(this.adjPlotMargin.left-this.adjPlotMargin.bump,i),t.lineTo(this.adjPlotMargin.left-this.adjPlotMargin.bump,i+n+this.adjPlotMargin.bump),t.stroke();var s=Math.round(this.adjPlotMargin.left+e+this.adjPlotMargin.bump);t.moveTo(s,i),t.lineTo(s,i+n+this.adjPlotMargin.bump),t.stroke(),t.moveTo(this.adjPlotMargin.left-this.adjPlotMargin.bump,i+n+this.adjPlotMargin.bump),t.lineTo(s,i+n+this.adjPlotMargin.bump),t.stroke();for(var l=Math.ceil((r-a)/5),c=e/5,u=0;u<6;u++){var d=this.adjPlotMargin.left+u*c,h=Math.floor(d);t.moveTo(h,i+n+this.adjPlotMargin.bump),t.lineTo(h,i+n+2*this.adjPlotMargin.bump),t.stroke(),t.textAlign="center",t.font="24px Arial",t.fillStyle="#000000";var p=r-a,f=p<=1?2:p<=50?1:0,_=this.utils.Formatters.decimalFormatter(a+u*l,f);_=_>=1e5?Math.round(.001*_)+"k":_,t.fillText(_,h,i+n+36+this.adjPlotMargin.bump)}},resetPosMarker:function(){var t=document.getElementById(this.sectionId+"_xPosMarker");t.style.left="0px",t.style.top="0px",t.style.height="1px"},checkPosition:function(t,e){var n=this,r=t.target.getBoundingClientRect(),a=Math.floor(t.clientX-r.left),i=Math.floor(t.clientY-r.top),o=document.getElementById("region_track_wrapper"+this.sectionId).getBoundingClientRect();if(this.getPosInfo(a,i,e),"hover"==e&&a>=this.adjPlotMargin.left/2&&a<=r.width-this.adjPlotMargin.right/2&&i>=r.height-this.adjPlotMargin.bottom/2){var s=document.getElementById(this.sectionId+"_xPosMarker");s.style.left=a+"px",s.style.top=o.height-r.height+"px",s.style.height=r.height-this.adjPlotMargin.bottom/2+"px"}else this.resetPosMarker();if("click"==e&&a>=this.adjPlotMargin.left/2&&a<=r.width-this.adjPlotMargin.right/2&&i>=r.height-this.adjPlotMargin.bottom/2){var l=r.width-(this.adjPlotMargin.left/2+this.adjPlotMargin.right/2),c=a-this.adjPlotMargin.left/2,u=this.convertXPos(c,l),d=!1,h=[];this.hoverPos.length>0&&(this.hoverPos.map((function(t){var e=2*Math.floor((n.viewingRegion.end-n.viewingRegion.start)/l);t>=u-e&&t<=u+e?d=!0:h.push(t)})),this.$root.hoverPos=h),d||this.$root.hoverPos.push(Math.floor(u))}},convertXPos:function(t,e){var n=(this.viewingRegion.end-this.viewingRegion.start)/e,r=t*n+this.viewingRegion.start;return r},getPosInfo:function(t,e,n){var r=this;if(0==this.infoBoxFrozen){var a=document.getElementById("block_data_"+this.sectionId),i=(document.getElementById("block_data_content_"+this.sectionId),document.getElementById("track_"+this.sectionId));"click"==n&&a.setAttribute("style","");var o=Object.keys(this.posData),s=[],l="";if(o.map((function(n){var a=Number(n),i=a+Math.round(r.plotConfig["track height"]);e>=a&&e<=i&&(l=r.posData[n].label,r.posData[n]["regions"].map((function(e){t>=e.start&&t<=e.end&&s.push(e.data)})))})),s.length>0||""!=l){"click"==n&&(this.infoBoxFrozen=!0,document.getElementById("block_data_"+this.sectionId).classList.add("fixed-info-box"));var c=[];if(s.map((function(t){var e={};e["title"]=t[r.plotConfig["render by"]],r.plotConfig["hover content"].map((function(n){e[n]=r.utils.Formatters.getHoverValue(t[n])})),c.push(e)})),this.infoBoxContent.action=n,this.infoBoxContent.data=c.length>0?c:[{title:l}],"hover"==n){a.classList.remove("hidden"),a.classList.add("hover"),a.style.top=e+i.offsetTop+25+"px";var u=t/i.offsetWidth;a.style.left=t-a.offsetWidth*u+i.offsetLeft+"px",document.getElementById("block_data_"+this.sectionId).classList.remove("fixed-info-box"),document.getElementById("track_"+this.sectionId).classList.add("hover")}else a.classList.remove("hover")}else(n=0==this.infoBoxFrozen)&&(a.classList.add("hidden"),document.getElementById("track_"+this.sectionId).classList.remove("hover"))}},onResize:function(t){this.renderPlot()},hidePanel:function(t){0==this.infoBoxFrozen&&this.utils.uiUtils.hideElement(t)}}});s()((function(){}));var Gt=Ft,Wt=(n("ecb6"),Object(C["a"])(Gt,Lt,jt,!1,null,null,null)),Ut=Wt.exp
1orts,qt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"region-track-wrapper",attrs:{id:"region_track_wrapper"+t.sectionId}},[n("div",{staticClass:"block-data hidden",attrs:{id:"block_data_"+t.sectionId}},[n("div",{staticClass:"fixed-info-box-close",on:{click:function(e){t.infoBoxFrozen=!1,t.hidePanel("block_data_"+t.sectionId)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("div",{staticClass:"block-data-content",attrs:{id:"block_data_content_"+t.sectionId}})]),n("div",t._l(t.colorGroups,(function(e,r){return n("span",{key:e,staticClass:"color-groups",on:{mouseover:function(n){return t.renderPlot(e)},mouseleave:function(e){return t.renderPlot()}}},[n("span",{staticClass:"box",style:"background-color:"+t.colors.bold[r%16]}),n("span",{staticClass:"label",domProps:{innerHTML:t._s(e)}})])})),0),t.plotConfig?n("canvas",{staticClass:"region-track",attrs:{id:"track_"+t.sectionId,width:"",height:""},on:{mouseleave:function(e){return t.hidePanel("block_data_"+t.sectionId)},mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},resize:t.onResize}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_regionDots","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("track_"+t.sectionId,t.sectionId+"_regionDots","png")}}},[t._v("Download PNG")])])])]),t.plotData?n("research-region-dots-vector",{ref:t.sectionId+"_regionDots",attrs:{renderData:t.renderData,renderConfig:t.plotConfig,colorGroups:t.colorGroups,colors:t.colors,margin:t.adjPlotMargin,region:t.viewingRegion,sectionId:t.sectionId,utils:t.utils}}):t._e()],1)])},Nt=[],Kt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.sectionId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},Vt=[];i["default"].use(g["a"]);var zt=i["default"].component("research-region-dots-vector",{props:["renderData","colorGroups","renderConfig","colors","margin","region","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{canvasId:function(t){}},methods:{renderPlot:function(){var t=this,e=document.createElement("canvas"),n=e.getContext("2d"),r=function(t,e,r){return n.font=e+"px "+r,n.measureText(t).width},a={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},i=".vector-wrapper-".concat(this.sectionId),o=document.querySelector("#region_track_wrapper"+this.sectionId),s=0;this.colorGroups.map((function(t){return s+=r(t,12,"Arial")+20}));var l=this.renderConfig["width"]?this.renderConfig["width"]:o.clientWidth-(a.left+a.right),c=Math.ceil((20*this.colorGroups.length+s)/l);a.top=a.top+20*c;var u=this.renderConfig["track height"]?this.renderConfig["track height"]:200,d=b["select"](i).append("svg").attr("id","vector_region_dots_"+this.sectionId).attr("width",l+a.left+a.right).attr("height",u+a.top+a.bottom);d.append("g").attr("id","plot").attr("transform","translate(0,0)");var h=a.bump,p=20;this.colorGroups.map((function(e,n){var i=t.renderConfig["color by"]?n%t.colors.moderate.length:null,o=i||0===i?t.colors.moderate[i]:"#00000066";d.select("#plot").append("rect").attr("x",h).attr("y",p-12).attr("height",12).attr("width",12).style("fill",o);var s=r(e,12,"Arial");d.select("#plot").append("text").attr("x",h+15).attr("y",p).style("text-anchor","start").text(e),s+=r(t.colorGroups[n+1],12,"Arial"),h+s+20>l+a.left?(h=a.bump,p+=20):h+=r(e,12,"Arial")+20})),d.select("#plot").style("font-family","Arial").style("font-size","12px").style("text-anchor","middle"),d.select("#plot").append("text").attr("transform","translate("+(a.bump+20)+","+(a.top+u/2)+")rotate(-90)").attr("x",0).attr("y",0).text(this.renderConfig["y axis label"]);var f=b["scaleLinear"]().domain([this.region.start,this.region.end]).range([a.left,l+a.left]);d.select("#plot").append("line").attr("x1",a.left-a.bump).attr("y1",a.top+u+a.bump).attr("x2",a.left+l+a.bump).attr("y2",a.top+u+a.bump).attr("stroke","#000000").style("stroke-width",.7
15);for(var _=Math.ceil((this.region.end-this.region.start)/5),g=0;g<6;g++){var m=f(this.region.start+_*g);d.select("#plot").append("line").attr("x1",m).attr("y1",a.top+u+a.bump).attr("x2",m).attr("y2",a.top+u+2*a.bump);var v=this.region.end-this.region.start,y=v<=1?2:v<=50?1:0,x=this.utils.Formatters.decimalFormatter(this.region.start+g*_,y);x=x>=1e5?Math.round(.001*x)+"k":x,d.select("#plot").append("text").attr("x",m).attr("y",a.top+u+20).style("text-anchor","middle").text(x)}for(var w=this.renderConfig["x axis field"],C=this.renderConfig["y axis field"],P=this.renderData.high,k=this.renderData.low,M=(P-k)/2,E=[],D=0;D<3;D++){var O=P-k,L=O<=1?2:O<=50?1:0,j=this.utils.Formatters.decimalFormatter(P-D*M,L);j=j>=1e5?Math.round(.001*j)+"k":j,E.push(j)}k=Number(E[2]),P=Number(E[0]);var S=b["scaleLinear"]().domain([k,P]).range([a.top+u,a.top]);d.select("#plot").append("g").attr("transform","translate("+(a.left-a.bump)+",0)").call(b["axisLeft"](S).ticks(2)),this.colorGroups.map((function(e,n){var r=t.renderData.data.filter((function(n){return n[t.renderConfig["color by"]]===e})),a=n%t.colors.moderate.length,i=a||0===a?t.colors.moderate[a]:"#00000066";r.map((function(e,n){var r=e[w],a=e[C];if(r>=t.region.start&&r<=t.region.end&&a){var o=f(r),s=S(a);d.select("#plot").append("circle").attr("cx",o).attr("cy",s).attr("r",5).style("fill",i)}}))}))}}});s()((function(){}));var $t=zt,Ht=Object(C["a"])($t,Kt,Vt,!1,null,null,null),Yt=Ht.exports;i["default"].use(g["a"]);var Zt=i["default"].component("research-region-dots-track",{props:["sectionId","plotConfig","plotData","dataComparisonConfig","region","regionZoom","regionViewArea","colors","utils","plotMargin","starItems"],data:function(){return{posData:{},groupsList:null,colorGroups:[],infoBoxFrozen:!1}},modules:{},components:{regionDotsVector:Yt},mounted:function(){this.renderPlot(),window.addEventListener("resize",this.onResize)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{adjPlotMargin:function(){var t=this.plotConfig["plot margin"]?this.plotConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},renderData:function(){var t=this,e={high:null,low:null,data:this.plotData},n=[];return this.plotData.map((function(r){t.plotConfig["color by"]&&!n.includes(r[t.plotConfig["color by"]])&&n.push(r[t.plotConfig["color by"]]);var a=r[t.plotConfig["y axis field"]];e.high=!e.high||e.high<a?a:e.high,e.low=!e.low||e.low>a?a:e.low})),this.colorGroups=n.sort(),e}},watch:{viewingRegion:function(t){this.renderPlot()},plotData:function(t){this.renderPlot()},starItems:function(t){this.renderPlot()}},methods:{downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.sectionId+"_regionDots"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_region_dots_"+this.sectionId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},renderPlot:function(t){var e=this;this.posData={};var n,r,a=2*this.plotConfig["track height"],i=2*document.querySelector("#region_track_wrapper"+this.sectionId).clientWidth,o=a+this.adjPlotMargin.top+this.adjPlotMargin.bottom;n=document.getElementById("track_"+this.sectionId),n.setAttribute("width",i),n.setAttribute("height",o),n.setAttribute("style","background-color: #ffffff;width: "+i/2+"px;height:"+o/2+"px;"),r=n.getContext("2d"),r.clearRect(0,0,i,o);var s=o-(this.adjPlotMargin.top+this.adjPlotMargin.bottom),l=i-(this.adjPlotMargin.left+this.adjPlotMargin.right),c=this.viewingRegion,u=l/(c.end-c.start),d=s/(this.renderData.high-this.renderData.low);this.renderAxis(r,l,s,Number(c.end),Number(c.start),this.renderData.high,this.renderData.low,this.adjPlotMargin);var h=this.plotConfig["x axis field"],p=this.plotConfig["y axis field"],f=this.adjPlotMargin.left,_=this.adjPlotMargin.top+s;if(this.colorGroups.map((function(t,n){var a=e.plotData.filter((function(n){return n[e.plotConfig["color by"]]===t})),i=n%16,o=i||0===i?e.colors.moderate[i]:"#00000066";a.map((function(t,n){var a=t[h],i=t[p];if(a>=c.start&&a<=c.end){var s=f+(a-c.start)*u,l=_-(i-e.renderData.low)*d;r.fillStyle=o,r.lineWidth=0,r.beginPath();var g=9;r.arc(s,l,g,0,2*Math.PI),r.fill(),e.posData[Math.round(l/2)]||(e.posData[Math.round(l/2)]=[]),e.posData[Math.round(l/2)].push({x:Math.round(s/2),data:t})}}))})),this.starItems){var g=this.adjPlotMargin.top-this.adjPlotMargin.bump,m=this.adjPlotMargin.top+s+3*this.adjPlotMargin.bump;this.starItems.map((function(t){var n=f+(t.columns[e.plotConfig["x axis field"]]-c.start)*u;e.utils.plotUtils.renderDashedLine(r,n,g,n,m,3,"#FFAA0055",[6,2])}))}},renderAxis:function(t,e,n,r,a,i,o,s){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]),t.moveTo(s.left-s.bump,s.top),t.lineTo(s.left-s.bump,s.top+n+s.bump),t.stroke();for(var l=(i-o)/2,c=n/2,u=0;u<3;u++){var d=s.top+u*c,h=Math.floor(d);t.moveTo(s.left-s.bump,h),t.lineTo(s.left-2*s.bump,h),t.stroke(),t.textAlign="end",t.font="24px Arial",t.fillStyle="#000000";var p=i-o,f=p<=1?2:p<=50?1:0,_=this.utils.Formatters.decimalFormatter(i-u*l,f);_=_>=1e5?Math.round(.001*_)+"k":_,t.fillText(_,s.left-3*s.bump,h)}var g=Math.round(s.left+e+s.bump);t.moveTo(g,s.top),t.lineTo(g,s.top+n+s.bump),t.stroke(),t.moveTo(s.left-s.bump,s.top+n+s.bump),t.lineTo(g,s.top+n+s.bump),t.stroke();for(var m=Math.ceil((r-a)/5),v=e/5,y=0;y<6;y++){var b=s.left+y*v,x=Math.floor(b);t.moveTo(x,s.top+n+s.bump),t.lineTo(x,s.top+n+2*s.bump),t.stroke(),t.textAlign="center",t.font="24px Arial",t.fillStyle="#000000";var w=r-a,C=w<=1?2:w<=50?1:0,P=this.utils.Formatters.decimalFormatter(a+y*m,C);P=P>=1e5?Math.round(.001*P)+"k":P,t.fillText(P,x,s.top+n+36+s.bump)}},checkPosition:function(t,e){var n=this;if(0==this.infoBoxFrozen){var r=t.target.getBoundingClientRect(),a=Math.floor(t.clientX-r.left),i=Math.floor(t.clientY-r.top),o=document.getElementById("block_data_"+this.sectionId),s=document.getElementById("block_data_content_"+this.sectionId),l=document.getElementById("track_"+this.sectionId);"click"==e&&o.setAttribute("style","");var c=Object.keys(this.posData),u=[];
1if(c.map((function(t){var e=Number(t)-5,r=Number(t)+5;i>=e&&i<=r&&n.posData[t].map((function(t){a>=t.x-5&&a<=t.x+5&&u.push(t.data)}))})),u.length>0){"click"==e&&(this.infoBoxFrozen=!0,document.getElementById("block_data_"+this.sectionId).classList.add("fixed-info-box"));var d="",h=0;if(u.map((function(t){("hover"==e&&h<5||"click"==e)&&(d+="<strong>"+t[n.plotConfig["render by"]]+"</strong><br />",n.plotConfig["hover content"].map((function(e){d+="<strong>"+e+"</strong>: <span>"+t[e]+"</span><br />"})),d+="<br />"),h++})),"hover"==e&&u.length>5&&(d+='<strong style="color: #36c;">Viewing 5 of '+u.length+" items. Click to view full list.</strong>"),s.innerHTML=d,"hover"==e){o.classList.remove("hidden"),o.style.top=i+l.offsetTop+25+"px";var p=a/l.offsetWidth;o.style.left=a-o.offsetWidth*p+l.offsetLeft+"px",document.getElementById("block_data_"+this.sectionId).classList.remove("fixed-info-box")}(e="hover")&&document.getElementById("track_"+this.sectionId).classList.add("hover")}else(e=0==this.infoBoxFrozen)&&(o.classList.add("hidden"),document.getElementById("track_"+this.sectionId).classList.remove("hover"))}},onResize:function(t){this.renderPlot()},hidePanel:function(t){0==this.infoBoxFrozen&&this.utils.uiUtils.hideElement(t)}}});s()((function(){}));var Xt=Zt,Jt=(n("ddbe"),Object(C["a"])(Xt,qt,Nt,!1,null,null,null)),Qt=Jt.exports,te=n("aaa1"),ee=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[this.selectedSplice?n("div",[n("h4",[t._v("Splicing event data for "+t._s(this.exonData[0].gene_name)+", "+t._s(this.spliceData[0].tissue))]),t._m(0)]):n("div",[t._v(" Select a splice track to view from the table below. ")]),n("div",{staticClass:"col-md-10"},[this.selectedSplice?n("div",[n("strong",[t._v(t._s(this.exonData[0].gene_name)+" "+t._s(this.exonData[0].strand))])]):t._e(),n("div",{staticClass:"genes-plot-wrapper",attrs:{id:"spliceTrackWrapper"+t.sectionId}},[n("canvas",{attrs:{id:"xaxis_"+t.sectionId}}),n("canvas",{class:t.exonData?"":"hidden",attrs:{id:"spliceTrack"+t.sectionId,width:"",height:""},on:{resize:t.onResize,mousemove:t.checkPosition}})])]),n("div",{staticClass:"col-md-2"},[this.selectedSplice?n("div",{staticClass:"highlighted-data"},[n("strong",[t._v("Highlighted splicing event:")]),n("div",{attrs:{id:"spliceData"}},[-1!==this.hoverTent?n("div",[n("div",[t._v("Chromosome: "+t._s(this.hoverTentData.chr))]),n("div",[t._v("Start position: "+t._s(this.hoverTentData.splice_start))]),n("div",[t._v("End position: "+t._s(this.hoverTentData.splice_end))]),n("div",[t._v("Gene ID: "+t._s(this.hoverTentData.gene_id))]),n("div",[t._v("Gene symbol: "+t._s(this.exonData[0].gene_name))]),n("div",[t._v("Tissue: "+t._s(this.hoverTentData.tissue))]),n("div",[t._v("Cluster ID: "+t._s(t.getClusterID(t.hoverTentData.full_id)))])]):n("div",[t._v("Hover over the diagram to highlight a splicing event.")])]),n("strong",[t._v("Highlighted exon:")]),-1!==this.hoverExon?n("div",[n("div",[t._v("Chromosome: "+t._s(this.hoverExonData.chr))]),n("div",[t._v("Start position: "+t._s(this.hoverExonData.exon_start))]),n("div",[t._v("End position: "+t._s(this.hoverExonData.exon_end))]),n("div",[t._v("Gene ID: "+t._s(this.hoverExonData.gene_id))]),n("div",[t._v("Gene symbol: "+t._s(this.hoverExonData.gene_name))])]):n("div",[t._v("Hover over the diagram to highlight an exon.")])]):t._e()])])},ne=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",{attrs:{id:"explanation"}},[n("li",[t._v("Rectangles represent exons. Hover to highlight splicing events overlapping the exon.")]),n("li",[t._v("Dot-and-line symbols represent splicing events. Hover over the dot to highlight exons overlapping the splicing event.")]),n("li",[t._v("The splicing event indicated by an arrow corresponds to the selected row from the table.")])])}];n("8c77"),n("0eb6"),n("b7ef"),n("8bd4"),n("ad1f");function re(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */re=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new j(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};c(x,o,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(S([])));C&&C!==n&&r.call(C,o)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(a,i,o,s){var l=d(t[a],t,i);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Object(h["a"])(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=d(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
vendor: 4,700 bytes, line 1
1(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=d(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(h["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),c(M.prototype,s,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),c(P,l,"Generator"),c(P,o,(function(){return this})),c(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}i["default"].use(g["a"]);var ae=i["default"].component("research-splice-track",{props:["plotConfig","plotType","plotMargin","regionZoom","utils","sectionId","hoverPos"],data:function(){return{plotRendered:0,localGenesData:null,biHost:"https://vision.hugeampkpnbi.org/api/bio/query",spliceData:null,exonData:null,gene:null,spliceVisualMap:[],exonVisualMap:[],hoverTent:-1,hoverExon:-1,colors:{green:"#00FF00",gray:"#DDDDDD99",charc
1oal:"#999999",purple:"#AA4499",blue:"#2F67B1",red:"#BF2C23",magenta:"#9F4A96",teal:"#5DA899",gold:"#DCCD7D"},dotRadius:6,selectedSpliceStart:null,selectedSpliceEnd:null}},modules:{},mounted:function(){window.addEventListener("resize",this.onResize),this.exonData&&this.renderTrack(this.exonData)},created:function(){},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{adjPlotMargin:function(){var t=this.plotConfig["plot margin"]?this.plotConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:4*t.top,bottom:t.bottom,bump:t.bump?t.bump:10,tentHeightFactor:.4}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump,tentHeightFactor:.33};return e},searchingRegion:function(){return{start:this.gene.start,end:this.gene.end}},viewingRegion:function(){return null===this.gene?null:{chr:this.gene.chromosome,start:this.gene.start,end:this.gene.end}},selectedSplice:function(){return this.$store.state.selectedSplice},hoverExonData:function(){return-1===this.hoverExon?null:this.exonVisualMap[this.hoverExon]},hoverTentData:function(){return-1===this.hoverTent?null:this.spliceVisualMap[this.hoverTent]}},watch:{viewingRegion:{handler:function(t,e){this.exonData&&this.renderTrack(this.exonData)},deep:!0,immediate:!0},selectedSplice:function(t){var e=this;return Object(p["a"])(re().mark((function n(){var r,a,i,o,s,l;return re().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.split("___"),a=r[0],i=r[1],o=r[2],s=r[3],l=r[4],e.selectedSpliceStart=parseInt(s),e.selectedSpliceEnd=parseInt(l),n.next=10,e.getGene(a);case 10:return e.gene=n.sent,n.next=13,e.getSplices(i,o);case 13:return e.spliceData=n.sent,n.next=16,e.getExons(a);case 16:e.exonData=n.sent,e.calculatePlot(),e.renderTrack(e.exonData);case 19:case"end":return n.stop()}}),n)})))()},hoverTent:function(t,e){-1!==t&&t!==e&&this.renderTrack(this.exonData)},hoverExon:function(t,e){-1!==t&&t!==e&&this.renderTrack(this.exonData)}},methods:{downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.sectionId+"_spliceTrack"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"spliceTrack"+this.sectionId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},onResize:function(t){this.exonData||this.renderTrack(this.exonData)},getClusterID:function(t){for(var e=t.split(":"),n=0;n<e.length;n++){var r=e[n];if("clu_"===r.slice(0,4))return r}return""},getWidth:function(t,e,n,r){return t.font=n+"px "+r,t.measureText(e).width},renderTrack:function(t){var e=this;if(null!==this.gene){var n,r,a=document.getElementById("spliceTrack"+this.sectionId),i=a.getContext("2d"),o=this.viewingRegion.start,s=this.viewingRegion.end;if(document.getElementById("spliceTrackWrapper"+this.sectionId)){var l=45;n=this.plotConfig.width?2*this.plotConfig.width+this.adjPlotMargin.left+this.adjPlotMargin.right:2*document.getElementById("spliceTrackWrapper"+this.sectionId).clientWidth;var c="region plot"==this.plotType?n-2*this.adjPlotMargin.left:n-(this.adjPlotMargin.left+this.adjPlotMargin.right),u=this.adjPlotMargin.left,d=c/(s-o),h=this.utils.sortUtils.sortArrOfObjects(t,"start","number","asc").filter((function(t){return t.exon_start<=s&&t.exon_end>=o})),p=this.tileExons(h);r=this.adjPlotMargin.top+l*p.length,a.setAttribute("width",n),a.setAttribute("height",r),a.setAttribute("style","width:"+n/2+"px;height:"+r/2+"px;"),i.clearRect(0,0,n,r),i.beginPath(),i.lineWidth=1,i.strokeStyle="#000000",i.setLineDash([]),i.font="italic bold 24px Arial",i.textAlign="center",i.fillStyle="#000000";var f=[],_=0;p.map((function(t,n){t.map((function(t){var r=u+(t.exon_start-o)*d,a=u+(t.exon_end-o)*d,s=e.adjPlotMargin.top+n*l,c=a-r<=1?1:a-r,h=e.highlightExon(t),p=_===e.hoverExon;i.fillStyle=h?e.colors.teal:p?e.colors.magenta:e.colors.charcoal,i.fillRect(r,s+10,c,20);var g=structuredClone(t);g.exonStart=r,g.exonEnd=r+c,g.exonTop=s+10,g.exonBottom=s+30,f.push(g),_++}))})),this.exonVisualMap=f;for(var g=[],m=0;m<this.spliceData.length;m++){var v=this.spliceData[m],y=u+(v.midpoint-o)*d,b=u+(v.splice_start-o)*d,x=u+(v.splice_end-o)*d,w=structuredClone(v);w.spliceStart=b,w.spliceEnd=x,w.spliceMidpoint=y,g.push(w);
1var C=m===this.hoverTent,P=v.splice_start===this.selectedSpliceStart&&v.splice_end===this.selectedSpliceEnd,k=this.highlightTent(v);i.fillStyle=C?this.colors.teal:k?this.colors.magenta:P?this.colors.gold:"black",i.strokeStyle=i.fillStyle,i.lineWidth=2;var M=2,E=this.adjPlotMargin.top-M,D=E*this.adjPlotMargin.tentHeightFactor;if(i.beginPath(),i.moveTo(b,E),i.lineTo(y,D),i.stroke(),i.lineTo(x,E),i.stroke(),i.moveTo(y,D),i.beginPath(),i.arc(y,D,this.dotRadius,0,2*Math.PI,!0),i.fill(),P){i.strokeStyle="red",i.fillStyle="red",i.lineWidth=3;var O=D-2*this.dotRadius;i.moveTo(y,O),i.lineTo(y,0),i.moveTo(y,O),i.lineTo(y-6,O-9),i.moveTo(y,O),i.lineTo(y+6,O-9),i.stroke()}}this.spliceVisualMap=g}this.renderAxis(n,s,o)}},tileExons:function(t){var e=[],n=structuredClone(t);e.push([n.shift()]);while(n.length>0){var r=e[e.length-1],a=r[r.length-1],i=this.findNextTileIndex(a,n);if(null!==i){var o=n[i];r.push(o),n=n.slice(0,i).concat(n.slice(i+1))}else e.push([n.shift()])}return e},findNextTileIndex:function(t,e){for(var n=0;n<e.length;n++){var r=e[n];if(r.exon_start>t.exon_end)return n}return null},getSplices:function(t,e){var n=this;return Object(p["a"])(re().mark((function r(){var a;return re().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,fetch("".concat(n.biHost,"/splices?q=").concat(t,",").concat(e)).then((function(t){return t.json()}));case 2:return a=r.sent,r.abrupt("return",n.getSpliceMidpoints(a.data));case 4:case"end":return r.stop()}}),r)})))()},getSpliceMidpoints:function(t){for(var e=structuredClone(t),n=0;n<e.length;n++)e[n].midpoint=(e[n].splice_start+e[n].splice_end)/2;return e},getExons:function(t){var e=this;return Object(p["a"])(re().mark((function n(){var r;return re().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,fetch("".concat(e.biHost,"/exons?q=").concat(t)).then((function(t){return t.json()}));case 2:return r=n.sent,n.abrupt("return",r.data);case 4:case"end":return n.stop()}}),n)})))()},getGene:function(t){var e=this;return Object(p["a"])(re().mark((function n(){var r;return re().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,fetch("".concat(e.biHost,"/gene?q=").concat(t)).then((function(t){return t.json()}));case 2:return r=n.sent,n.abrupt("return",r.data[0]);case 4:case"end":return n.stop()}}),n)})))()},calculatePlot:function(){var t=this,e=this.exonData[0].strand,n=this.spliceStart(e),r=this.spliceEnd(e),a=structuredClone(this.exonData);a=a.filter((function(a){return!!t.validExon(e,a,n,r)}))},spliceStart:function(t){var e=this.spliceData.toSorted((function(t,e){return t.splice_start-e.splice_start}));return"+"===t?e[0].splice_start:e[e.length-1].splice_start},spliceEnd:function(t){var e=this.spliceData.toSorted((function(t,e){return t.splice_end-e.splice_end}));return"+"===t?e[e.length-1].splice_end:e[0].splice_end},validExon:function(t,e,n,r){return"-"===t?e.exon_start<n+5e3&&e.exon_end>r-5e3:e.exon_start>n-5e3&&e.exon_end<r+5e3},highlightExon:function(t){if(-1===this.hoverTent)return!1;var e=this.spliceData[this.hoverTent];return void 0!==e&&this.overlap(e.splice_start,e.splice_end,t.exon_start,t.exon_end)},highlightTent:function(t){if(-1===this.hoverExon)return!1;var e=this.exonVisualMap[this.hoverExon];return void 0!==e&&this.overlap(t.splice_start,t.splice_end,e.exon_start,e.exon_end)},overlap:function(t,e,n,r){return!(n>e||t>r)},checkPosition:function(t){var e=t,n=e.target.getBoundingClientRect(),r=2*Math.floor(e.clientX-n.left),a=2*Math.floor(e.clientY-n.top);if(a<this.adjPlotMargin.top){var i=this.getTent(r,a);this.hoverTent=i,-1!=i&&(this.hoverExon=-1)}else{var o=this.getExon(r,a);this.hoverExon=o,-1!=o&&(this.hoverTent=-1)}},getTent:function(t,e){for(var n=0;n<this.spliceVisualMap.length;n++){var r=this.spliceVisualMap[n],a=(this.adjPlotMargin.top-2)*this.adjPlotMargin.tentHeightFactor,i=r.spliceMidpoint-t,o=a-e;if(Math.abs(i)<=this.dotRadius&&Math.abs(o)<=this.dotRadius)return n}return-1},getExon:function(t,e){for(var n=0;n<this.exonVisualMap.length;n++){var r=this.exonVisualMap[n],a=t>=r.exonStart&&t<=r.exonEnd,i=e>=r.exonTop&&e<=r.exonBottom;if(a&&i)return n}return-1},renderAxis:function(t,e,n){var r=document.getElementById("xaxis_"+this.sectionId),a=r.getContext("2d"),i=50;r.setAttribute("width",t),r.setAttribute("height",i),r.setAttribute("style","width:"+t/2+"px;
1height:"+i/2+"px;"),a.clearRect(0,0,t,i),a.beginPath(),a.lineWidth=1,a.strokeStyle="#000000",a.font="24px Arial",a.fillStyle="#000000",a.setLineDash([]);var o=10;a.moveTo(this.adjPlotMargin.left,o),a.lineTo(t+this.adjPlotMargin.left,o),a.stroke();for(var s=Math.ceil((e-n)/5),l=t/5,c=0;c<6;c++){var u=this.adjPlotMargin.left+c*l,d=Math.floor(u);a.moveTo(d,o),a.lineTo(d,o),a.stroke(),a.lineTo(d,o+10),a.stroke(),a.textAlign="center";var h=n+c*s;a.fillText(h,d,i-5)}a.rotate(-2*Math.PI/4*3),a.fillText("Position",t/2+this.adjPlotMargin.left,this.adjPlotMargin.top+this.adjPlotMargin.bottom+i-24)}}});s()((function(){}));var ie=ae,oe=(n("fc02"),Object(C["a"])(ie,ee,ne,!1,null,null,null)),se=oe.exports,le=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"phenotype-xing-legend"},[n("strong",[t._v(t._s(t.renderConfig["x axis field"])+": ")]),t._v(" Max: "+t._s(t.utils.Formatters.pValueFormatter(t.dataMax))+", "),n("span",{staticStyle:{color:"#ffaa00"}},[t._v("Mean: "+t._s(t.utils.Formatters.pValueFormatter(t.dataMean)))]),t._v(", Min: "+t._s(t.utils.Formatters.pValueFormatter(t.dataMin))+" | "),n("strong",[t._v(t._s(t.renderConfig["suppliment field"])+" "),n("span",{staticClass:"value-dot",staticStyle:{"background-color":"#000000",width:"10px",height:"10px",top:"5px",position:"relative",display:"inline-block"}},[t._v("Â ")]),t._v(" : ")]),t._v(" Max: "+t._s(t.utils.Formatters.pValueFormatter(t.suppMax))+", Mean: "+t._s(t.utils.Formatters.pValueFormatter(t.suppMean))+", Min: "+t._s(t.utils.Formatters.pValueFormatter(t.suppMin))+" ")]),n("table",{staticClass:"cfde-xing-table"},[n("thead",[n("tr",[n("th",[t._v(t._s(t.renderConfig["render by"]))]),n("th",[t._v(t._s(t.renderConfig["x axis field"]))]),n("th",[t._v(t._s(t.renderConfig["suppliment field"]))]),n("th",[t._v("Background")]),n("th",[t._v("Log10("+t._s(t.renderConfig["x axis field"])+") : "+t._s(t.renderConfig["suppliment field"]))])])]),n("tbody",[t._l(t.renderData,(function(e,r){return n("tr",{class:r%2==0?"shady-tr":""},[n("td",{staticClass:"phenotype-td"},[t.renderConfig["link to"]?[n("a",{attrs:{href:t.renderConfig["link to"]+e[t.renderConfig["link field"]]}},[t._v(t._s(e[t.renderConfig["render by"]]))])]:[t._v(" "+t._s(e[t.renderConfig["render by"]])+" ")]],2),n("td",[t._v(" "+t._s(t.utils.Formatters.pValueFormatter(e[t.renderConfig["x axis field"]]))+" ")]),n("td",[t._v(" "+t._s(t.utils.Formatters.pValueFormatter(e[t.renderConfig["suppliment field"]]))+" ")]),n("td",[t._v(t._s(e["Background"]))]),n("td",{staticClass:"value-td"},[n("span",{staticClass:"mean-pos",style:"left:"+t.getMeanXpos(t.dataMean)}),n("span",{staticClass:"value-dot",style:"background-color:"+t.getBGColor(e[t.renderConfig["color by"]])+";left:"+t.getXpos(e[t.renderConfig["x axis field"]],e[t.renderConfig["suppliment field"]])+"width:"+t.getDotScale(e[t.renderConfig["suppliment field"]])+"px;height:"+t.getDotScale(e[t.renderConfig["suppliment field"]])+"px;"},[t._v(" Â ")])])])})),n("tr",[n("td"),n("td"),n("td"),n("td"),n("td",[n("span",{staticStyle:{float:"left","margin-left":"-10px"}},[t._v(t._s(t.utils.Formatters.pValueFormatter(t.dataMin)))]),n("span",{staticStyle:{float:"right","margin-right":"-10px"}},[t._v(t._s(t.utils.Formatters.pValueFormatter(t.dataMax)))])])])],2)])])},ce=[];i["default"].use(g["a"]);var ue=i["default"].component("research-cfde-xing",{props:["canvasId","data","renderConfig","colors","plotMargin","utils"],data:function(){return{dataMax:null,dataMin:null,dataMean:null,suppMax:null,suppMean:null,suppMin:null}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{renderData:function(){var t,e=this,n=Object(f["a"])(new Set(this.data));switch(this.renderConfig["threshold type"]){case"highest n":n=this.utils.sortUtils.sortArrOfObjects(n,this.renderConfig["x axis field"],"number","desc"),this.dataMax=n[0][this.renderConfig["x axis field"]],this.dataMin=n[n.length-1][this.renderConfig["x axis field"]],this.dataMean=n[Math.round(n.length/2)][this.renderConfig["x axis field"]];var r=Object(f["a"])(new Set(this.data));r=this.utils.sortUtils.sortArrOfObjects(r,this.renderConfig["suppliment field"],"number","desc"),this.suppMax=r[0][this.renderConfig["suppliment field"]],this.suppMin=r[r.length-1][this.renderConfig["suppliment field"]],this.suppMean=r[Math.round(r.length/2)][this.renderConfig["suppliment field"]],t=this.utils.sortUtils.sortArrOfObjects(n,this.renderConfig["threshold field"],"number","desc"),t=t.filter((function(t,n){return n<e.renderConfig["threshold"]}));break}return t}},watch:{},methods:{getBGColor:function(t){return this.renderConfig["dot colors"][t]},getXpos:function(t,e){var n=100*(Math.log10(t)-Math.log10(this.dataMin))/(Math.log10(this.dataMax)-Math.log10(this.dataMin)),r=this.getDotScale(e);return"calc("+n+"% - "+r/2+"px);margin-top:-"+r/2+"px;"},getMeanXpos:function(t){var e=100*(Math.log10(t)-Math.log10(this.dataMin))/(Math.log10(this.dataMax)-Math.log10(this.dataMin));return"calc("+e+"%);"},getDotScale:function(t){var e=Math.round(20*(t-this.suppMin)/(this.suppMax-this.suppMin));return e}}}),de=ue,he=(n("2d5b"),Object(C["a"])(de,le,ce,!1,null,"0708c96e",null)),pe=he.exports,fe=i["default"].component("research-section-visualizers",{props:["plotConfig","plotData","plotLegend","phenotypeMap","plotMargin","colors","sectionId","utils","dataComparisonConfig","searchParameters","regionZoom","regionViewArea","
1starItems","region","bigRegion","rowKeyField","linkedHoverKey"],components:{ResearchAnnotationsPlot:Q,ResearchScatterPlot:st,ResearchSimpleScatterPlot:lt["a"],ResearchMPlotBitmap:l["a"],ResearchMQQPlot:c["a"],ResearchRegionPlot:L,ResearchScorePlot:j["a"],ResearchGenesTrack:K,ResearchVolcanoPlot:V["a"],ResearchHeatmap:z["a"],ResearchPheWAS:ct["a"],ResearchBarPlot:_t,ResearchBarInCellPlot:Ct,ResearchBoxPlot:Ot,ResearchRegionTrack:Ut,ResearchRegionDotsTrack:Qt,ResearchSingleCellBrowser:te["a"],ResearchSpliceTrack:se,cfdePhenotypeXing:pe},data:function(){return{}},modules:{},mounted:function(){},computed:{groupedPlotData:function(){var t=this;if(this.plotData){var e={};return this.plotData.map((function(n){e[t.dataComparisonConfig["key field"]]=n})),e}return null}},watch:{},methods:{starColumn:function(t){this.$emit("on-star",t)},receiveLDData:function(t){this.$emit("ld-data-loaded",t)}}});s()((function(){}));var _e=fe,ge=(n("9142"),Object(C["a"])(_e,r,a,!1,null,null,null));e["a"]=ge.exports},a6f5:function(t,e,n){"use strict";n("b371")},a708:function(t,e,n){"use strict";var r=n("2909"),a=(n("99af"),n("caad"),n("d81d"),n("14d9"),n("13d5"),n("4e82"),n("4ec9"),n("a9e3"),n("d3b7"),n("ac1f"),n("2532"),n("3ca3"),n("5319"),n("498a"),n("0643"),n("a573"),n("9d4a"),n("ddb0"),function(t,e,n,r){return t.sort((function(t,a){var i=n?t[e]:t[e].toLowerCase(),o=n?a[e]:a[e].toLowerCase();return n&&("string"==typeof i&&(i=Number(i.replace(/\,/g,""))),"string"==typeof o&&(o=Number(o.replace(/\,/g,"")))),r?i<o?-1:i>o?1:0:i>o?-1:i<o?1:0}))}),i=function(t,e,n,r){var a=r?"asc":"desc";if(n)return l(t,e,"number",a);var i=[],o=[],s=[];t.map((function(t){t[e]?"number"==typeof t[e]||0===t[e]?i.push(t):"string"==typeof t[e]&&o.push(t):s.push(t)}));var c=l(i,e,"number",a),u=l(o,e,"alphabetical",a);return"asc"==a?c.concat(u).concat(s):u.concat(c).concat(s)},o=function(t,e,n){var r=n?"asc":"desc";return t.map((function(t){var n,r=t[e].split(":"),a=r[0].trim();n=r[1]?1==r[1].includes("-")?(Number(r[1].split("-")[0].trim())+Number(r[1].split("-")[1].trim()))/2:Number(r[1]):0,t["chr"]="X"!=a&&"Y"!=a?Number(a):"X"==a?23:24,t["bp"]=n})),i(t,"bp",!0,r),i(t,"chr",!0,r),t},s=function(t,e){var n="function"===typeof e?e:function(t){return t[e]};return Object(r["a"])(t.reduce((function(t,e){var r=null===e||void 0===e?e:n(e);return t.has(r)||t.set(r,e),t}),new Map).values())},l=function(t,e,n,r){var a;return"number"==n&&(a="asc"==r?t.sort((function(t,n){return t[e]-n[e]})):t.sort((function(t,n){return n[e]-t[e]}))),"alphabetical"==n&&(a="asc"==r?t.sort((function(t,n){return t[e]>n[e]?1:n[e]>t[e]?-1:0})):t.sort((function(t,n){return t[e]<n[e]?1:n[e]<t[e]?-1:0}))),a};e["a"]={sort:a,sortEGLTableData:i,sortLocusField:o,uniqBy:s,sortArrOfObjects:l}},a7ad:function(t,e,n){"use strict";n("7d61")},a7af:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content"},[n("div",{staticClass:"clicked-dot-value hidden",attrs:{id:"clicked_dot_value_"+t.sectionId}},[n("div",{staticClass:"clicked-dot-value-content",attrs:{id:"clicked_dot_value_content_"+t.sectionId}})]),n("div",{staticClass:"dot-value-full-list hidden",attrs:{id:"dot_value_full_list_"+t.sectionId}},[n("div",{staticClass:"clicked-dot-value-close",on:{click:function(e){return t.hidePanel("dot_value_full_list_"+t.sectionId)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("div",{staticClass:"dot-value-full-list-content",attrs:{id:"dot_value_full_list_content_"+t.sectionId}})]),t.renderConfig.legend?n("div",{staticClass:"mbm-plot-legend",domProps:{innerHTML:t._s(t.renderConfig.legend)}}):t._e(),t._l(t.plotsList,(function(e){return n("div",{key:e,attrs:{id:t.sectionId+"mPlotWrapper"}},["default"!=e?n("h4",[t._v(t._s(e))]):t._e(),t.renderConfig?n("canvas",{staticClass:"manhattan-plot",attrs:{id:"manhattanPlot_"+t.sectionId+e,width:"",height:""},on:{mouseleave:t.hidePanel,mousemove:function(n){return t.checkPosition(n,e)},resize:t.onResize,click:function(n){return t.getFullList(n,e)}}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_mPlot","svg","vector_m_plot_"+t.sectionId,e)}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.downloadImage("manhattanPlot_"+t.sectionId+e,t.sectionId+"_mPlot","png")}}},[t._v("Download PNG")])])])])])})),t.renderData?n("research-m-bitmap-plot-vector",{ref:t.sectionId+"_mPlot",attrs:{renderData:t.renderData,renderConfig:t.renderConfig,colors:t.chromosomeColors,margin:t.adjPlotMargin,chrLengths:t.chromosomeLength,sectionId:t.sectionId,utils:t.utils}}):t._e(),t.renderConfig.label?n("div",{staticClass:"mbm-plot-label",domProps:{innerHTML:t._s(t.renderConfig.label)}}):t._e()],2)},a=[],i=n("2909"),o=n("3835"),s=(n("cb29"),n("4de4"),n("d81d"),n("14d9"),n("a9e3"),n("4fad"),n("b64b"),n("d3b7"),n("25f0"),n("498a"),n("0643"),n("2382"),n("a573"),n("2b0e")),l=n("1157"),c=n.n(l),u=n("b1e0"),d=n("fc3b");s["default"].use(u["a"]);var h=s["default"].component("research-m-bitmap-plot",{props:["plotData","renderConfig","dataComparisonConfig","compareGroupColors","utils","sectionId"],data:function(){return{plotRendered:0,
1chromosomeLength:{1:248956422,2:242193529,3:198295559,4:190214555,5:181538259,6:170805979,7:159345973,8:145138636,9:138394717,10:133797422,11:135086622,12:133275309,13:114364328,14:107043718,15:101991189,16:90338345,17:83257441,18:80373285,19:58617616,20:64444167,21:46709983,22:50818468,23:156040895,24:57227415,X:156040895,Y:57227415},chromosomeColors:["#08306b","#41ab5d","#000000","#f16913","#3f007d","#cb181d"],leftMargin:150,rightMargin:40,topMargin:40,bottomMargin:100,dotPosData:{},compareGroups:null,groupsList:null}},modules:{},components:{ResearchMPlotBitmapVector:d["a"]},mounted:function(){this.renderPlot(this.renderData),window.addEventListener("resize",this.onResize)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{plotsList:function(){var t=this.plotData,e=[];if(t){if(null!=this.dataComparisonConfig)for(var n=this.dataComparisonConfig["fields to compare"][0],r=0,a=Object.entries(t);r<a.length;r++){var i=Object(o["a"])(a[r],2),s=(i[0],i[1]);Object.keys(s[n]).map((function(t){e.indexOf(t)<0&&e.push(t)}))}else e=["default"];return e}return null},renderData:function(){var t=this,e=this.plotData,n={},r=Object(i["a"])(this.plotsList);for(var a in r.map((function(t){var e={sorted:{},unsorted:[]};n[t]=e})),this.chromosomeLength)for(var s=0,l=Object.entries(n);s<l.length;s++){var c=Object(o["a"])(l[s],2),u=(c[0],c[1]);u.sorted[a]=[]}if(null!=this.dataComparisonConfig)for(var d=function(){var e=Object(o["a"])(p[h],2),a=(e[0],e[1]);r.map((function(e){var r=a[t.renderConfig["x axis field"]];if(void 0!=r&&""!=r&&null!=r){var i={};if(i[t.renderConfig["render by"]]=a[t.renderConfig["render by"]],t.renderConfig["hover content"]){var o=t.renderConfig["hover content"];o.map((function(n){var r=t.dataComparisonConfig["fields to compare"].indexOf(n);i[n]=r<0?a[n]:a[n][e]}))}var s=a[t.renderConfig["x axis field"]].split(":"),l=s[0].trim(),c=s[1].split("-");i["locus"]=c.length>1?(Number(c[0].trim())+Number(c[1].trim()))/2:Number(c[0].trim()),i[t.renderConfig["y axis field"]]=a[t.renderConfig["y axis field"]][e],n[e].sorted[l].push(i),n[e].unsorted.push(i)}}))},h=0,p=Object.entries(e);h<p.length;h++)d();else e.map((function(e){var r=e[t.renderConfig["x axis field"]];if(void 0!=r&&""!=r&&null!=r){var a={};if(a[t.renderConfig["render by"]]=e[t.renderConfig["render by"]],t.renderConfig["hover content"]){var i=t.renderConfig["hover content"];i.map((function(t){a[t]=e[t]}))}var o=e[t.renderConfig["x axis field"]].split(":"),s=o[0].trim(),l=o[1].split("-");a["locus"]=l.length>1?(Number(l[0].trim())+Number(l[1].trim()))/2:Number(l[0].trim()),a[t.renderConfig["y axis field"]]=e[t.renderConfig["y axis field"]],n["default"].sorted[s].push(a),n["default"].unsorted.push(a)}}));return n},adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.leftMargin,right:this.rightMargin,top:this.topMargin,bottom:this.bottomMargin,bump:10};return e}},watch:{renderData:function(t){setTimeout((function(){window.dispatchEvent(new Event("resize"))}),100)}},methods:{downloadImage:function(t,e,n,r,a){if("svg"==n){var i=this.sectionId+"_mPlot";this.$refs[i].renderPlot(a),this.utils.uiUtils.downloadImg(t,e,n,r)}else"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},hidePanel:function(t){this.utils.uiUtils.hideElement(t)},onResize:function(t){this.renderPlot(this.renderData)},getFullList:function(t,e){var n=this,r=document.getElementById("dot_value_full_list_"+this.sectionId);r.classList.remove("hidden");for(var a=t,i=a.target.getBoundingClientRect(),o=Math.floor(a.clientX-i.left),s=Math.floor(a.clientY-i.top),l="",c=-5;c<=5;c++)for(var u=function(){if(void 0!=n.dotPosData[e][o+c]&&void 0!=n.dotPosData[e][o+c][s+d]){var t=n.dotPosData[e][o+c][s+d];if(l+='<span class="gene-on-clicked-dot-mplot"><b>'+t[n.renderConfig["render by"]]+"</b></span>",n.renderConfig["hover content"]){var r=n.renderConfig["hover content"];r.map((function(e){l+='<span class="content-on-clicked-dot">'+e+": "+n.utils.Formatters.getHoverValue(t[e])+"</span>"}))}}},d=-5;d<=5;d++)u();var h=document.getElementById("dot_value_full_list_content_"+this.sectionId);""!=l?(h.innerHTML=l,document.getElementById("manhattanPlot_"+this.sectionId+e).classList.add("hover"),document.getElementById("clicked_dot_value_"+this.sectionId).classList.add("hidden")):(r.classList.add("hidden"),document.getElementById("manhattanPlot_"+this.sectionId+e).classList.remove("hover"))},getHoverValue:function(t){var e;return e="number"!=typeof t||isNaN(t)?t:this.utils.Formatters.pValueFormatter(t),e},checkPosition:function(t,e){var n=this,r=document.getElementById("clicked_dot_value_"+this.sectionId),a=document.getElementById("manhattanPlot_"+this.sectionId+e);r.classList.remove("hidden");var i=t,o=i.target.getBoundingClientRect(),s=Math.floor(i.clientX-o.left),l=Math.floor(i.clientY-o.top);r.style.top=l+a.offsetTop+"px",r.style.left=s+a.offsetLeft+15+"px";for(var c="",u=0,d=-5;d<=5;d++)for(var h=function(){if(void 0!=n.dotPosData[e][s+d]&&void 0!=n.dotPosData[e][s+d][l+p]){if(u<6){var t=n.dotPosData[e][s+d][l+p];if(c+='<span class="gene-on-clicked-dot-mplot"><b>'+t[n.renderConfig["render by"]]+"</b></span>",n.renderConfig["hover content"]){var r=n.renderConfig["hover content"];r.map((function(e){c+='<span class="content-on-clicked-dot">'+e+": "+n.utils.Formatters.getHoverValue(t[e])+"</span>"}))}}u+=1}
1},p=-5;p<=5;p++)h();u>5&&(c+='<span class="gene-on-clicked-dot-mplot" style="color: #36c;"><b>Viewing 5 of '+u+" items. Click to view full list.<b><span>");var f=document.getElementById("clicked_dot_value_content_"+this.sectionId);""!=c?(f.innerHTML=c,document.getElementById("manhattanPlot_"+this.sectionId+e).classList.add("hover")):(r.classList.add("hidden"),document.getElementById("manhattanPlot_"+this.sectionId+e).classList.remove("hover"))},renderPlot:function(t){var e=this;this.dotPosData={};var n=document.getElementById("clicked_dot_value_"+this.sectionId);n.classList.add("hidden");for(var r=this.renderConfig.width?2*this.renderConfig.width+this.leftMargin+this.rightMargin:2*(window.innerWidth-115),a=this.renderConfig.height?2*this.renderConfig.height+this.topMargin+this.bottomMargin:800,i=.02*r,s=.02*a,l=10,c=r-(this.leftMargin+this.rightMargin+i),u=a-(this.topMargin+s+this.bottomMargin),d=function(){var t=Object(o["a"])(p[h],2),n=t[0],i=t[1],d=document.getElementById("manhattanPlot_"+e.sectionId+n);if(d){d.setAttribute("width",r),d.setAttribute("height",a),d.setAttribute("style","width:"+r/2+"px;height:"+a/2+"px;");var f=d.getContext("2d");f.clearRect(0,0,r,a),f.beginPath(),f.lineWidth=1,f.strokeStyle="#000000",f.setLineDash([]),f.moveTo(e.leftMargin-l,e.topMargin),f.lineTo(e.leftMargin-l,u+e.topMargin+s+l),f.moveTo(e.leftMargin-l,u+e.topMargin+s+l),f.lineTo(c+e.leftMargin+l,u+e.topMargin+s+l);var _=null,g=null;i.unsorted.map((function(t){var n=t[e.renderConfig["y axis field"]];null==_&&(_=n),null==g&&(g=n),n<_&&(_=n),n>g&&(g=n)}));for(var m=(g-_)/4,v=u/4,y=0;y<5;y++){var b=e.topMargin+y*v,x=Math.floor(b);f.moveTo(e.leftMargin-2*l,x),f.lineTo(e.leftMargin-l,x),f.stroke(),f.font="24px Arial",f.textAlign="right",f.fillStyle="#000000";var w=e.utils.Formatters.floatFormatter(_+y*m);w="-"==w?0:w,f.fillText(w,e.leftMargin-3*l,e.topMargin+u+10-y*v)}f.stroke(),f.font="28px Arial",f.textAlign="center",f.fillStyle="#000000",f.rotate(-2*Math.PI/4),f.fillText(e.renderConfig["y axis label"],-(e.topMargin+u/2),e.leftMargin-e.leftMargin/2-28);var C=0,P=Object.keys(i.sorted).filter((function(t){return i.sorted[t].length>0}));P.map((function(t){var n=0;i.sorted[t].map((function(t){n=t.locus>n?t.locus:n})),e.chromosomeLength[t]=n>e.chromosomeLength[t]?n:e.chromosomeLength[t]})),P.map((function(t){C+=e.chromosomeLength[t]}));var k=c/C,M=e.leftMargin;f.textAlign="center",f.rotate(2*Math.PI/4),P.map((function(t){var n=e.chromosomeLength[t]*k;M+=n;var r=M-n/2;f.fillText(t,r,e.topMargin+u+s+28+l)})),f.fillText(e.renderConfig["x axis label"],c/2+e.leftMargin,e.topMargin+u+s+88),M=0;var E=1;P.map((function(t){i.sorted[t].map((function(t){var r=(M+t.locus)*k+e.leftMargin,a=u/(g-_),i=e.topMargin+u-(t[e.renderConfig["y axis field"]]-_)*a,o=e.chromosomeColors[E%e.chromosomeColors.length];f.fillStyle=o+"75",f.lineWidth=0,f.beginPath(),f.arc(r,i,8,0,2*Math.PI),f.fill();var s,l=Math.round(r.toString().split(".")[0]/2),c=Math.round(i.toString().split(".")[0]/2);e.renderConfig["hover content"]&&(s=e.renderConfig["hover content"]),e.dotPosData[n]||(e.dotPosData[n]={}),e.dotPosData[n][l]||(e.dotPosData[n][l]={}),e.dotPosData[n][l][c]={},e.dotPosData[n][l][c][e.renderConfig["render by"]]=t[e.renderConfig["render by"]],e.renderConfig["hover content"]&&s.map((function(r){e.dotPosData[n][l][c][r]=t[r]}))})),M+=e.chromosomeLength[t],E++}))}},h=0,p=Object.entries(t);h<p.length;h++)d()}}});c()((function(){}));var p=h,f=(n("6b05"),n("2877")),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},a850:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("criterion-group-template",{ref:Math.floor(1e4*Math.random()).toString(),attrs:{value:t.value,hide:t.hide,filterType:"list",looseMatch:!0,header:t.header,filterList:t.filterList,filterFunction:t.filterFunction},on:{input:t.emitInput,"update:filter-function":t.emitFilterFunction,"update:filter-list":t.emitFilterList},scopedSlots:t._u([{key:"filtered",fn:function(e){var n=e.filter;return[t._t("filtered",null,{filter:n})]}}],null,!0)},[t._t("default")],2)},a=[],i=(n("d3b7"),n("0643"),n("76d6"),n("2b0e")),o=n("e861"),s=i["default"].component("criterion-list-group",{props:{hide:Boolean,value:{type:Array,default:function(){return[]},validator:function(t){if(Array.isArray(t))return!(t.length>0)||t.every((function(t){return"undefined"!==typeof t.field&&"undefined"!==typeof t.threshold}))}},filterList:{type:Array},filterFunction:{type:Function},header:String},components:{CriterionGroupTemplate:o["a"]},methods:{emitInput:function(t){this.$emit("input",t)},emitFilterList:function(t){this.$emit("update-filter-list",t)},emitFilterFunction:function(t){this.$emit("update-filter-function",t)}}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},a896:function(t,e,n){"use strict";n("d06c")},a916:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[t._m(0),n("div",{staticClass:"dot-value-full-list hidden",attrs:{id:"dot_value_full_list"}},[n("div",{staticClass:"clicked-dot-value-close",on:{click:function(e){return t.hidePanel("dot_value_full_list")}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}}
1)],1),n("div",{attrs:{id:"dot_value_full_list_content"}})]),t.renderConfig.legend?n("div",{staticClass:"mbm-plot-legend",domProps:{innerHTML:t._s(t.renderConfig.legend)}}):t._e(),n("div",{staticClass:"col-md-12"},[null!=t.dataComparisonConfig?n("div",{staticClass:"score-plot-bubbles"},[n("span",{staticClass:"plot-item-bubble reference",staticStyle:{"background-color":"#00000030"}},[t._v("Avarage")]),t._l(t.searchParameters[t.dataComparisonConfig.fieldsGroupDataKey].search,(function(e,r){return n("span",{key:e,class:"plot-item-bubble reference bg-color-"+r,domProps:{innerHTML:t._s(e)}})}))],2):t._e(),n("div",{staticClass:"plot-score-options-ui"},[null!=t.dataComparisonConfig?n("label",[t._v("Render plot by: "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.plotRenderBy,expression:"plotRenderBy"}],staticClass:"score-plot-render-by",on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.plotRenderBy=e.target.multiple?n:n[0]},function(e){return t.renderPlot()}]}},[n("option",{attrs:{value:"avarage"}},[t._v("Avarage Score")]),n("option",{attrs:{value:"high"}},[t._v("Highest Score")]),n("option",{attrs:{value:"all"}},[t._v("All")])])]):t._e(),1==t.renderConfig["recalculate score"]?n("label",[t._v("Score by: "),t._l(t.renderConfig["score by"],(function(e,r){return n("div",{key:r,staticClass:"plot-score-option"},[n("input",{attrs:{type:"checkbox",id:"score_chkbox_"+r,name:"score_chkbox_"+r,checked:""},on:{click:t.calculateScore}}),n("label",{attrs:{for:"score_chkbox_"+r},domProps:{innerHTML:t._s(e.field)}})])}))],2):t._e()])]),n("div",{staticClass:"col-md-12",attrs:{id:"scorePlotWrapper"}},[t.renderConfig?n("canvas",{attrs:{id:"scorePlot",width:"",height:""},on:{mouseleave:t.hidePanel,mousemove:t.checkPosition,resize:t.onResize,click:t.getFullList}}):t._e()]),t.renderConfig.label?n("div",{staticClass:"mbm-plot-label",domProps:{innerHTML:t._s(t.renderConfig.label)}}):t._e()])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"clicked-dot-value hidden",attrs:{id:"clicked_dot_value"}},[n("div",{attrs:{id:"clicked_dot_value_content"}})])}],i=n("3835"),o=(n("cb29"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("4e82"),n("a9e3"),n("4fad"),n("b64b"),n("d3b7"),n("ac1f"),n("25f0"),n("2532"),n("841c"),n("498a"),n("0643"),n("2382"),n("a573"),n("2b0e")),s=n("1157"),l=n.n(s),c=n("b1e0");o["default"].use(c["a"]);var u=o["default"].component("research-score-plot",{props:["region","plotData","renderConfig","dataComparisonConfig","searchParameters","utils"],data:function(){return{plotRenderBy:"avarage",plotRendered:0,chromosomeLength:{1:248956422,2:242193529,3:198295559,4:190214555,5:181538259,6:170805979,7:159345973,8:145138636,9:138394717,10:133797422,11:135086622,12:133275309,13:114364328,14:107043718,15:101991189,16:90338345,17:83257441,18:80373285,19:58617616,20:64444167,21:46709983,22:50818468,23:156040895,24:57227415,X:156040895,Y:57227415},chromosomeColors:["#08306b","#41ab5d","#000000","#f16913","#3f007d","#cb181d"],compareGroupColors:["#007bff50","#04884550","#8490C850","#BF61A550","#EE312450","#FCD70050","#5555FF50","#7aaa1c50","#9F78AC50","#F8808450","#F5A4C750","#CEE6C150","#cccc0050","#6FC7B650","#D5A76850","#d4d4d450"],leftMargin:150,rightMargin:1,topMargin:20,bottomMargin:100,dotPosData:{}}},modules:{},components:{},mounted:function(){this.renderPlot(),window.addEventListener("resize",this.onResize)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{searchingRegion:function(){if(null==this.region)return null;var t={},e=this.region.split(":")[1].split("-");return t["start"]=e[0],t["end"]=e[1],t},renderData:function(){var t=this.plotData,e={sorted:{},unsorted:[]};for(var n in this.chromosomeLength)e.sorted[n]=[];var r=this.renderConfig,a=function(t){var n=t[r["x axis field"]];if(void 0!=n&&""!=n&&null!=n){var a={};if(a[r["render by"]]=t[r["render by"]],r["hover content"]){var i=r["hover content"];i.map((function(e){a[e]=t[e]}))}var o=t[r["x axis field"]].split(":"),s=o[0].trim(),l=o[1].split("-");a["locus"]=l.length>1?(Number(l[0].trim())+Number(l[1].trim()))/2:Number(l[0].trim()),a[r["y axis field"]]=t[r["y axis field"]],e.sorted[s].push(a),e.unsorted.push(a)}};if(this.dataComparisonConfig)for(var o=0,s=Object.entries(t);o<s.length;o++){var l=Object(i["a"])(s[o],2),c=(l[0],l[1]);a(c)}else t.map((function(t){a(t)}));return e}},watch:{renderData:function(){this.renderPlot()}},methods:{calculateScore:function(){var t=this,e=function(t,e){var n=0,r=e.length;return e.map((function(e){var r=e.type,a=e.field;switch(r){case"boolean":var i=e["value to score"][t[a]]*e.weight;n+=i;break}}
1)),n/r},n=[];this.renderConfig["score by"].map((function(t,e){document.getElementById("score_chkbox_"+e).checked&&n.push(t)}));var r=this.plotData;this.plotData.map((function(a,i){var o=e(a,n);r[i][t.renderConfig["score column table header"]]=o})),this.$store.dispatch("filteredData",r)},hidePanel:function(t){this.utils.uiUtils.hideElement(t)},onResize:function(t){this.renderPlot()},getFullList:function(t){var e=this,n=document.getElementById("dot_value_full_list");document.getElementById("scorePlot");n.classList.remove("hidden");for(var r=t,a=r.target.getBoundingClientRect(),o=Math.floor(r.clientX-a.left),s=Math.floor(r.clientY-a.top),l="",c=-5;c<=5;c++)for(var u=function(){if(void 0!=e.dotPosData[o+c]&&void 0!=e.dotPosData[o+c][s+d]){var t=e.dotPosData[o+c][s+d];if(l+='<span class="gene-on-clicked-dot-mplot"><b>'+t[e.renderConfig["render by"]]+"</b></span>",e.renderConfig["hover content"]){var n=e.renderConfig["hover content"];n.map((function(n){if(null!=e.dataComparisonConfig&&e.dataComparisonConfig.fieldsToCompare.includes(n)){l+='<span class="content-on-clicked-dot">'+n+":</span>";for(var r=0,a=Object.entries(t[n]);r<a.length;r++){var o=Object(i["a"])(a[r],2),s=o[0],c=o[1];l+='<span class="content-on-clicked-dot"> '+s+": "+c+"</span>"}}
1else l+='<span class="content-on-clicked-dot">'+n+": "+t[n]+"</span>"}))}}},d=-5;d<=5;d++)u();var h=document.getElementById("dot_value_full_list_content");""!=l?(h.innerHTML=l,document.getElementById("scorePlot").classList.add("hover"),document.getElementById("clicked_dot_value").classList.add("hidden")):(n.classList.add("hidden"),document.getElementById("scorePlot").classList.remove("hover"))},checkPosition:function(t){var e=this,n=document.getElementById("clicked_dot_value"),r=document.getElementById("scorePlot");n.classList.remove("hidden");var a=t,o=a.target.getBoundingClientRect(),s=Math.floor(a.clientX-o.left),l=Math.floor(a.clientY-o.top);n.style.top=l+r.offsetTop+"px",n.style.left=s+r.offsetLeft+15+"px";for(var c="",u=0,d=-5;d<=5;d++)for(var h=function(){if(void 0!=e.dotPosData[s+d]&&void 0!=e.dotPosData[s+d][l+p]){if(u<6){var t=e.dotPosData[s+d][l+p];if(c+='<span class="gene-on-clicked-dot-mplot"><b>'+t[e.renderConfig["render by"]]+"</b></span>",e.renderConfig["hover content"]){var n=e.renderConfig["hover content"];n.map((function(n){if(null!=e.dataComparisonConfig&&e.dataComparisonConfig.fieldsToCompare.includes(n)){c+='<span class="content-on-clicked-dot">'+n+":</span>";for(var r=0,a=Object.entries(t[n]);r<a.length;r++){var o=Object(i["a"])(a[r],2),s=o[0],l=o[1];c+='<span class="content-on-clicked-dot"> '+s+": "+l+"</span>"}}else c+='<span class="content-on-clicked-dot">'+n+": "+t[n]+"</span>"}))}}u+=1}},p=-5;p<=5;p++)h();u>5&&(c+='<span class="gene-on-clicked-dot-mplot" style="color: #36c;"><b>Viewing 5 of '+u+" items. Click to view full list.<b><span>");var f=document.getElementById("clicked_dot_value_content");""!=c?(f.innerHTML=c,document.getElementById("scorePlot").classList.add("hover")):(n.classList.add("hidden"),document.getElementById("scorePlot").classList.remove("hover"))},getColorIndex:function(t){var e=this.dataComparisonConfig.fieldsGroupDataKey,n=this.searchParameters[e].search,r="";return n.map((function(e,n){t==e&&(r=n)})),r},renderPlot:function(){var t=this;this.dotPosData={};var e=document.getElementById("clicked_dot_value");e.classList.add("hidden");var n=this.renderConfig.width?2*this.renderConfig.width+this.leftMargin+this.rightMargin:2*document.getElementById("scorePlotWrapper").clientWidth-60,r=this.renderConfig.height?2*this.renderConfig.height+this.topMargin+this.bottomMargin:800,a=.03*n,o=.03*r,s=n-(this.leftMargin+this.rightMargin+a),l=s-10,c=r-(this.topMargin+o+this.bottomMargin),u=document.getElementById("scorePlot");u.setAttribute("width",n),u.setAttribute("height",r),u.setAttribute("style","width:"+n/2+"px;height:"+r/2+"px;");var d=u.getContext("2d");d.clearRect(0,0,n,r),d.beginPath(),d.lineWidth=1,d.strokeStyle="#000000",d.setLineDash([]),d.moveTo(this.leftMargin,this.topMargin),d.lineTo(this.leftMargin,c+this.topMargin+o),d.moveTo(this.leftMargin,c+this.topMargin+o),d.lineTo(s+this.leftMargin,c+this.topMargin+o);var h=null,p=null;this.renderData.unsorted.map((function(e){if(t.dataComparisonConfig&&1==t.dataComparisonConfig.fieldsToCompare.includes(t.renderConfig["y axis field"]))for(var n=0,r=Object.entries(e[t.renderConfig["y axis field"]]);n<r.length;n++){var a=Object(i["a"])(r[n],2),o=(a[0],a[1]),s=o;null==h&&(h=s),null==p&&(p=s),s<h&&(h=s),s>p&&(p=s)}else{var l=e[t.renderConfig["y axis field"]];null==h&&(h=l),null==p&&(p=l),l<h&&(h=l),l>p&&(p=l)}}));for(var f=(p-h)/4,_=c/4,g=0;g<5;g++){var m=this.topMargin+g*_,v=Math.floor(m);d.moveTo(this.leftMargin-10,v),d.lineTo(this.leftMargin,v),d.stroke(),d.font="24px Arial",d.textAlign="right",d.fillStyle="#000000";var y=this.utils.Formatters.floatFormatter(h+g*f);y="-"==y?0:y,d.fillText(y,this.leftMargin-20,this.topMargin+c+10-g*_)}d.stroke(),d.font="28px Arial",d.textAlign="center",d.fillStyle="#000000",d.rotate(-2*Math.PI/4),d.fillText(this.renderConfig["y axis label"],-(this.topMargin+c/2),this.leftMargin-this.leftMargin/2-28),d.rotate(2*Math.PI/4);var b=0,x=Object.keys(this.renderData.sorted).filter((function(e){return t.renderData.sorted[e].length>0})),w=0,C=0;if(1==x.length){var P=x[0];null!=this.searchingRegion?(C=Number(this.searchingRegion.start),w=Number(this.searchingRegion.end)):this.renderData.sorted[P].map((function(t){0==C&&(C=t.locus),0==w&&(w=t.locus),t.locus<C&&(C=t.locus),t.locus>w&&(w=t.locus)})),this.chromosomeLength[P]=w,b=w-C;for(var k=Math.ceil((w-C)/4),M=(s-10)/4,E=0;E<5;E++){var D=this.leftMargin+E*M+10,O=Math.floor(D);d.moveTo(O,this.topMargin+c+o),d.lineTo(O,this.topMargin+c+o+10),d.stroke(),d.font="24px Arial",d.textAlign="center",d.fillStyle="#000000";var L=E<4?C+E*k:w;d.fillText(L,O,this.topMargin+c+o+30)}}else x.map((function(e){var n=0;t.renderData.sorted[e].map((function(t){n=t.locus>n?t.locus:n})),t.chromosomeLength[e]=n>
1t.chromosomeLength[e]?n:t.chromosomeLength[e]})),x.map((function(e){b+=t.chromosomeLength[e]}));var j=l/b,S=this.leftMargin+10;if(d.textAlign="center",x.length>1&&x.map((function(e){var n=t.chromosomeLength[e]*j;S+=n;var r=S-n/2;d.fillText(e,r,t.topMargin+c+o+28)})),d.fillText(this.renderConfig["x axis label"],s/2+this.leftMargin,this.topMargin+c+o+88),1==x.length){S=C;var A=x[0];this.renderData.sorted[A].map((function(e){var n=(e.locus-S)*j+t.leftMargin+10,r=c/(p-h);if(t.dataComparisonConfig&&1==t.dataComparisonConfig.fieldsToCompare.includes(t.renderConfig["y axis field"])){var a,o,s,l,u,f,_,g,m,v=e[t.renderConfig["y axis field"]];switch(t.plotRenderBy){case"avarage":g=0,m=0,_="";for(var y=0,b=Object.entries(v);y<b.length;y++){var x=Object(i["a"])(b[y],2),w=x[0],C=x[1];g++,m+=C,_=w}f=m/g,a=t.topMargin+c-(f-h)*r,l=t.getColorIndex(_),u=1==g?t.compareGroupColors[l]:"#00000030",d.fillStyle=u,d.lineWidth=0,d.beginPath(),d.arc(n,a,8,0,2*Math.PI),d.fill(),o=Math.round(n.toString().split(".")[0]/2),s=Math.round(a.toString().split(".")[0]/2),t.add2HoverContent(o,s,e);break;case"high":f=0,_="",g=0;for(var P=0,k=Object.entries(v);P<k.length;P++){var M=Object(i["a"])(k[P],2),E=M[0],D=M[1];_=0==g||D>f?E:_,f=0==g||D>f?D:f,g++}a=t.topMargin+c-(f-h)*r,l=t.getColorIndex(_),u=t.compareGroupColors[l],d.fillStyle=u,d.lineWidth=0,d.beginPath(),d.arc(n,a,8,0,2*Math.PI),d.fill(),o=Math.round(n.toString().split(".")[0]/2),s=Math.round(a.toString().split(".")[0]/2),t.add2HoverContent(o,s,e);break;case"all":for(var O=[],L=0,I=Object.entries(v);L<I.length;L++){var T=Object(i["a"])(I[L],2),B=T[0],R=T[1];a=t.topMargin+c-(R-h)*r,O.push(a),l=t.getColorIndex(B),u=t.compareGroupColors[l],d.fillStyle=u,d.lineWidth=0,d.beginPath(),d.arc(n,a,8,0,2*Math.PI),d.fill(),o=Math.round(n.toString().split(".")[0]/2),s=Math.round(a.toString().split(".")[0]/2),t.add2HoverContent(o,s,e)}O.length>1&&(O.sort((function(t,e){return t-e})),d.beginPath(),d.lineWidth=1,d.strokeStyle="#00000030",d.moveTo(n,O[0]),d.lineTo(n,O[O.length-1]),d.stroke());break}}else{var F=t.topMargin+c-(e[t.renderConfig["y axis field"]]-h)*r,G=t.chromosomeColors[A%t.chromosomeColors.length];d.fillStyle=G+"75",d.lineWidth=0,d.beginPath(),d.arc(n,F,8,0,2*Math.PI),d.fill();var W=Math.round(n.toString().split(".")[0]/2),U=Math.round(F.toString().split(".")[0]/2);t.add2HoverContent(W,U,e)}}))}else{S=0;var I=1;x.map((function(e){t.renderData.sorted[e].map((function(e){var n=(S+e.locus)*j+t.leftMargin+10,r=c/(p-h),a=t.topMargin+c-(e[t.renderConfig["y axis field"]]-h)*r,i=t.chromosomeColors[I%t.chromosomeColors.length];d.fillStyle=i+"75",d.lineWidth=0,d.beginPath(),d.arc(n,a,8,0,2*Math.PI),d.fill();var o=Math.round(n.toString().split(".")[0]/2),s=Math.round(a.toString().split(".")[0]/2);t.add2HoverContent(o,s,e)})),S+=t.chromosomeLength[e],I++}))}},add2HoverContent:function(t,e,n){var r,a=this;this.renderConfig["hover content"]&&(r=this.renderConfig["hover content"]),this.dotPosData[t]||(this.dotPosData[t]={}),this.dotPosData[t][e]={},this.dotPosData[t][e][this.renderConfig["render by"]]=n[this.renderConfig["render by"]],this.renderConfig["hover content"]&&r.map((function(r){a.dotPosData[t][e][r]=n[r]}))}}});l()((function(){}));var d=u,h=(n("ecb1"),n("2877")),p=Object(h["a"])(d,r,a,!1,null,null,null);e["a"]=p.exports},aaa1:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"10px"}},[t._e(),t._e(),t.showDatasetSelect?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"10px"}},[t._m(0),t.singleCellMetadata?n("b-table",{attrs:{items:t.singleCellMetadata,fields:t.tableColumns,small:"",striped:"",hover:"",responsive:"sm","head-variant":"light","sticky-header":"300px","per-page":t.datasetsPerPage,"current-page":t.currentDatasetsPage,"tbody-tr-class":t.datasetsRowClass},on:{"row-clicked":function(e){return t.selectDataset(e.datasetId)}},scopedSlots:t._u([{key:"cell(datasetId)",fn:function(e){return[e.item.datasetId!==t.datasetId?n("button",{on:{click:function(n){return t.selectDataset(e.item.datasetId)}}},[t._v("Select")]):n("div",[t._v("Selected")])]}}],null,!1,3917555800)}):t._e()],1):t._e(),t.datasetId?t._e():n("div",{staticStyle:{color:"red",margin:"0 auto"}},[t._v(" Please Select a Dataset ")]),t.datasetId&&!t.dataLoaded?n("div",{staticStyle:{margin:"0 auto"}},[t._v(" Loading "+t._s(t.preloadItem)+"... ")]):t._e(),t.dataLoaded?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",width:"100%","max-width":"100%","overflow-x":"auto"}},[0===t.layout?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",background:"#f8f8f8",padding:"20px",width:"100%","min-width":"840px"}},[t.metadata?n("research-single-cell-info",{attrs:{data:t.metadata}}):t._e(),t.dataReady?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px"}},[n("div",{staticStyle:{display:"flex",gap:"20px"}},[t.coordinates?n("div",{staticStyle:{display:"flex",gap:"20px",flex:"1",padding:"20px",background:"white","max-width":"50%"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",width:"min-content",flex:"1"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"baseline",margin:"0 0 5px"}},[n("div",[n("strong",{staticStyle:{"font-size":"16px"}},[t._v("Embedding")]),t._v(" "+t._s(t.embeddingType))]),n("div",[t._v(t._s(t.totalCells.toLocaleStr
1ing())+" cells")])]),n("research-umap-plot-gl",{attrs:{group:t.datasetId,points:t.coordinates,labels:t.fields,colors:t.labelColors,cellTypeField:t.cellCompositionVars.colorByField,colorByField:t.cellCompositionVars.colorByField,hoverFields:[],highlightLabel:t.cellCompositionVars.highlightLabel,highlightLabels:t.cellCompositionVars.highlightLabels,width:400,height:400}})],1),t.colorByFields?n("div",{staticStyle:{display:"flex","flex-direction":"column","align-self":"flex-start",width:"200px"}},[n("strong",{staticStyle:{"font-size":"16px",margin:"0 0 5px"}},[t._v("Color By")]),n("div",{staticStyle:{display:"flex","flex-direction":"column",height:"400px",gap:"5px"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.cellCompositionVars.colorByField,expression:"cellCompositionVars.colorByField"}],staticStyle:{width:"100%"},on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.cellCompositionVars,"colorByField",e.target.multiple?n:n[0])},function(e){return t.selectColorBy(e.target.value)}]}},[n("option",{attrs:{value:""}},[t._v("--Select--")]),t._l(t.colorByFields.show,(function(e,r){return n("option",{domProps:{value:r}},[t._v(" "+t._s(t.displayLabel(r))+" ")])}))],2),n("div",{staticStyle:{width:"100%","flex-grow":"1","overflow-x":"hidden","overflow-y":"auto"}},[n("research-single-cell-selector",{attrs:{data:t.fields["metadata_labels_sorted"]||t.fields["metadata_labels"],displayData:t.displayFields,selectedField:t.cellCompositionVars.colorByField,layout:"list",colors:t.labelColors},on:{"on-update":function(e){return t.handleSelectorUpdate(e)},"on-hover":function(e){return t.handleSelectorHover(e)}}})],1)])]):t._e()]):t._e(),t.coordinates?n("div",{staticStyle:{display:"flex",gap:"20px",flex:"1",padding:"20px",background:"white","max-width":"50%"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",width:"min-content",flex:"1"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"baseline",margin:"0 0 5px"}},[n("div",[n("strong",{staticStyle:{"font-size":"16px"}},[t._v(t._s(t.geneExpressionVars.selectedGene?""+t.geneExpressionVars.selectedGene:"Gene")+" Expression")]),t._v(" "+t._s(t.embeddingType))]),n("div",[t._v(t._s(t.totalCells.toLocaleString())+" cells")])]),n("div",{staticStyle:{position:"relative",width:"100%"}},[n("research-umap-plot-gl",{attrs:{group:t.datasetId,points:t.coordinates,labels:t.fields,colors:t.labelColors,expression:t.expressionData[t.geneExpressionVars.selectedGene],expressionColorScale:t.expressionColorScale,cellTypeField:t.cellCompositionVars.colorByField,hoverFields:[],highlightLabel:t.cellCompositionVars.highlightLabel,highlightLabels:t.cellCompositionVars.highlightLabels,width:400,height:400}})],1)]),n("div",{staticStyle:{display:"flex","flex-direction":"column","align-self":"flex-start",width:"200px"}},[n("strong",{staticStyle:{"font-size":"16px",margin:"0 0 5px"}},[t._v("Gene Search")]),n("div",{staticStyle:{display:"flex","flex-direction":"column",height:"400px",gap:"5px"}},[n("div",{staticStyle:{display:"flex",gap:"5px"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.geneToSearch,expression:"geneToSearch"}],staticStyle:{width:"100%",position:"relative"},attrs:{type:"text",placeholder:"Gene name"},domProps:{value:t.geneToSearch},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchGene(t.geneToSearch)},input:function(e){e.target.composing||(t.geneToSearch=e.target.value)}}}),n("button",{on:{click:function(e){return t.searchGene(t.geneToSearch)}}},[n("svg",{staticStyle:{width:"20px"},style:"display:"+(t.geneLoading?"none":"block"),attrs:{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"#000"}},[n("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15 10.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-.82 4.74a6 6 0 1 1 1.06-1.06l4.79 4.79-1.06 1.06-4.79-4.79Z",fill:"#080341"}})]),n("div",{staticClass:"geneLoader",style:"display:"+(t.geneLoading?"block":"none")})])]),t.genesNotFound.length>0?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"1px",flex:"0 0 auto","max-height":"100%","overflow-y":"auto"}},t._l(t.genesNotFound,(function(e){return n("div",{staticStyle:{display:"flex",gap:"5px",width:"100%",background:"#ff4500",color:"white"}},[n("div",{staticStyle:{display:"flex",flex:"1","align-items":"center",padding:"0 5px","font-size":"12px"}},[t._v(t._s(e)+" not found.")]),n("div",{staticStyle:{width:"28px",height:"28px",display:"flex","align-items":"center","justify-content":"center","font-size":"18px","line-height":"18px",cursor:"pointer"},on:{click:function(n){return t.clearGeneNotFound(e)}}},[t._v("Ã")])])})),0):t._e(),n("research-single-cell-selector",{staticStyle:{"margin-top":"4px","flex-grow":"1","overflow-x":"hidden","overflow-y":"auto"},attrs:{data:t.sortedGeneNames,layout:"list",listSelection:"exclusive",colors:null,selectedField:t.geneExpressionVars.selectedGene},on:{"on-update":function(e){return t.geneClick(e.coloredLabels[0])}}}
1)],1)])]):t._e()]),n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px"}},[n("div",{staticStyle:{display:"flex","flex-direction":"row",padding:"20px",background:"white",gap:"20px"}},[t.displayGroups&&t.displayGroups.cellType&&t.displayGroups.cellType.length>1?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px",width:"300px"}},[n("div",{staticStyle:{display:"flex",gap:"5px","align-items":"center"}},[n("div",{staticStyle:{"font-weight":"bold","font-size":"16px","white-space":"nowrap"}},[t._v("Group By")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.activeGroup,expression:"activeGroup"}],staticStyle:{width:"100%","max-width":"500px"},on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.activeGroup=e.target.multiple?n:n[0]},t.handleSampleChange]}},t._l(t.displayGroups.cellType,(function(e){return n("option",{domProps:{value:e}},[t._v(t._s(t.displayLabel(e)))])})),0),n("b-icon",{attrs:{icon:"info-circle-fill",variant:"secondary"},on:{mouseover:function(e){return t.showTooltip("Select primary annotation<br/>by which to group the data.")},mouseout:function(e){return t.hideTooltip()}}})],1)]):t._e(),n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px",width:"300px"}},[n("div",{staticStyle:{display:"flex",gap:"5px","align-items":"center"}},[n("div",{staticStyle:{"font-weight":"bold","font-size":"16px","white-space":"nowrap"}},[t._v("Stratify By")]),n("select",{staticStyle:{width:"200px"},on:{change:function(e){return t.selectSegmentBy(t.cellCompositionVars.displayByLabel,e.target.value)}}},[n("option",{attrs:{value:""}},[t._v("--Select--")]),t._l(t.traitFields.show,(function(e,r){return n("option",{domProps:{value:r}},[t._v(" "+t._s(t.displayLabel(r))+" ")])})),Object.keys(t.traitFields.hide).length>0?n("optgroup",{attrs:{label:"Unused"}},t._l(t.traitFields.hide,(function(e,r){return n("option",{attrs:{disabled:""},domProps:{value:r}},[t._v(" "+t._s(t.displayLabel(r))+" ")])})),0):t._e()],2),n("b-icon",{attrs:{icon:"info-circle-fill",variant:"secondary"},on:{mouseover:function(e){return t.showTooltip("Select secondary annotation<br/>by which to stratify grouped data.")},mouseout:function(e){return t.hideTooltip()}}})],1)])]),n("div",{ref:"expressionPanels",staticStyle:{display:"flex",gap:"0","align-items":"stretch"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",padding:"20px",background:"white","min-width":"0"},style:t.resizableColumnStyle(t.leftPanelWidth)},[n("div",{staticStyle:{display:"flex","justify-content":"space-between",gap:"10px"}},[n("div",{staticStyle:{"font-size":"16px"}},[n("span",{staticStyle:{"font-weight":"bold"}},[t._v(t._s(t.isATACseq?"Nuclei":"Cell")+" "+t._s(t.isNormalized?"Proportion":"Count"))]),t.displayFields&&t.cellCompositionVars.segmentByLabel&&"cat"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))]),t._v(" per "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))])]:t.cellCompositionVars.segmentByLabel?[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))]),t._v(" per "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))])]:[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))])],t.displayFields&&t.cellCompositionVars.segmentByLabel&&"cont"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?[n("div",{staticStyle:{"font-size":"12px"}},[t._v(" Each point represents the average "+t._s(t.isATACseq?"nuclei":"cell")+" "+t._s(t.isNormalized?"proportion":"distribution")+" per "+t._s(this.aggregateType)+" ")])]:t._e()],2),n("download-chart",{staticClass:"download",staticStyle:{width:"125px","align-self":"flex-start"},style:t.countDownloadDisabled?"pointer-events:none; opacity:0.5":"",attrs:{chartId:t.countDownloadChartId,titleText:t.countSectionTitle}}
1)],1),!t.cellCompositionVars.segmentByLabel||t.displayFields&&"cat"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px"}},[n("research-stacked-bar-plot",{attrs:{data:t.cellCompositionVars.segmentByCounts2,primaryKey:t.cellCompositionVars.segmentByLabel?t.cellCompositionVars.segmentByLabel:t.cellCompositionVars.displayByLabel,subsetKey:t.cellCompositionVars.segmentByLabel?t.cellCompositionVars.displayByLabel:t.cellCompositionVars.segmentByLabel,xAxisLabel:t.useVerticalCellProportionPlot?t.isNormalized?"Percent of "+(t.isATACseq?"Nuclei":"Cells"):"Number of "+(t.isATACseq?"Nuclei":"Cells"):t.cellCompositionVars.segmentByLabel?t.displayLabel(t.cellCompositionVars.segmentByLabel):t.displayLabel(t.cellCompositionVars.displayByLabel),yAxisLabel:t.useVerticalCellProportionPlot?t.cellCompositionVars.segmentByLabel?t.displayLabel(t.cellCompositionVars.segmentByLabel):t.displayLabel(t.cellCompositionVars.displayByLabel):t.isNormalized?"Percent of "+(t.isATACseq?"Nuclei":"Cells"):"Number of "+(t.isATACseq?"Nuclei":"Cells"),highlightKey:t.cellCompositionVars.highlightLabel,normalize:t.isNormalized,stack:!!t.cellCompositionVars.segmentByLabel,verticalCategoryLayout:t.useVerticalCellProportionPlot}}),n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v(t._s(t.cellCompositionVars.segmentByLabel?t.displayLabel(t.cellCompositionVars.displayByLabel):t.displayLabel(t.cellCompositionVars.segmentByLabel)))]),n("research-single-cell-selector",{attrs:{data:t.plotMetadataLabels,layout:"list",listDirection:"horizontal",listAlignment:"start",colors:t.labelColors,selectedField:t.cellCompositionVars.segmentByLabel?t.cellCompositionVars.displayByLabel:t.cellCompositionVars.segmentByLabel},on:{"on-update":function(e){return t.handleSelectorUpdate(e)},"on-hover":function(e){return t.handleSelectorHover(e)}}})],1):t._e(),t.contCountResults?n("div",{attrs:{id:"sc_count_scatter_group"}},[n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))]),n("div",{staticStyle:{display:"flex","flex-wrap":"wrap",gap:"10px"}},t._l(t.contCountResults,(function(e){return n("div",{staticStyle:{"min-width":"250px",flex:"1"}},[n("div",[t._v(t._s(e.groupKey))]),n("research-scatter-plot",{attrs:{data:e.data,width:300,height:150,xKey:t.cellCompositionVars.segmentByLabel,yKey:"cell_proportion",xLabel:t.displayLabel(t.cellCompositionVars.segmentByLabel),yLabel:"Cell Proportion",yDomain:[0,1],renderAs:"svg"}})],1)})),0)]):t._e()]),t.geneExpressionVars.expressionStats.length>0?n("div",{style:t.resizeHandleStyle,on:{mousedown:t.startColumnResize,touchstart:function(e){return e.preventDefault(),t.startColumnResize.apply(null,arguments)}}}):t._e(),t.geneExpressionVars.expressionStats.length>0?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",padding:"20px",background:"white","min-width":"0"},style:t.resizableColumnStyle(t.rightPanelWidth)},[n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"3px"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between",gap:"10px"}},[n("span",{staticStyle:{"font-size":"16px"}},[n("span",{staticStyle:{"font-weight":"bold"}},[t._v(t._s(t.geneExpressionVars.selectedGene)+" "+t._s(t.isATACseq?"Chromatin Accessibility":"Expression"))]),t.displayFields&&t.cellCompositionVars.segmentByLabel&&"cat"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))]),t._v(" per "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))])]:t.cellCompositionVars.segmentByLabel?[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))]),t._v(" per "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))])]:[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))])],t.displayFields&&t.cellCompositionVars.segmentByLabel&&"cont"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?[n("div",{staticStyle:{"font-size":"12px"}},[t._v(" Each point represents the average "+t._s(t.isATACseq?"chromatin accessibility":"gene expression")+" per "+t._s(this.aggregateType)+" ")])]:t._e(),t.coordinates?t._e():n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px"}},[n("div",{staticStyle:{display:"flex",gap:"5px"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.geneToSearch,expression:"geneToSearch"}],staticStyle:{width:"100%",position:"relative"},attrs:{type:"text",placeholder:"Gene name"},domProps:{value:t.geneToSearch},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.searchGene(t.geneToSearch)},input:function(e){e.target.composing||(t.geneToSearch=e.target.value)}}}),n("button",{on:{click:function(e){return t.searchGene(t.geneToSearch)}}},[n("svg",{staticStyle:{width:"20px"},style:"display:"+(t.geneLoading?"none":"block"),attrs:{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"#000"}},[n("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15 10.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-.82 4.74a6 6 0 1 1 1.06-1.06l4.79 4.79-1.06 1.06-4.79-4.79Z",fill:"#080341"}})]),n("div",{staticClass:"geneLoader",style:"display:"+(t.geneLoading?"block":"none")})])]),t.genesNotFound.length>0?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"1px",flex:"0 0 auto","max-height":"100%","overflow-y":"auto"}},t._l(t.genesNotFound,(function(e){return n("div",{staticStyle:{display:"flex",gap:"5px",width:"100%",background:"#ff4500",color:"white"}},[n("div",{staticStyle:{display:"flex",flex:"1","align-items":"center",padding:"0 5px","font-size":"12px"}},[t._v(t._s(e)+" not found.")]),n("div",{staticStyle:{width:"28px",height:"28px",display:"flex","align-items":"center","justify-content":"center","font-size":"18px","line-height":"18px",cursor:"pointer"},on:{click:function(n){return t.clearGeneNotFound(e)}}},[t._v("Ã")])])})),0):t._e()])],2),n("download-chart",{staticClass:"download",staticStyle:{width:"125px","align-self":"flex-start"},style:t.expressionDownloadDisabled?"pointer-events:none; opacity:0.5":"",attrs:{chartId:t.expressionDownloadChartId,titleText:t.expressionSectionTitle}}
1)],1),t.showExpressionPlotTypeSelect?n("div",{staticStyle:{display:"flex",gap:"5px","align-items":"center","align-self":"flex-end"}},[n("div",{staticStyle:{"font-size":"12px","white-space":"nowrap",opacity:"0.7"}},[t._v("Plot type")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.stratifyPlotType,expression:"stratifyPlotType"}],staticStyle:{width:"125px"},on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.stratifyPlotType=e.target.multiple?n:n[0]}}},t._l(t.availableExpressionPlotTypes,(function(e){return n("option",{key:e,domProps:{value:e}},[t._v(" "+t._s(t.stratifyPlotTypeLabel(e))+" ")])})),0)]):t._e()]),t.contExprResults?t._e():n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px"}},[""===t.cellCompositionVars.segmentByLabel?["dot"===t.stratifyPlotType?n("research-dot-plot",{staticStyle:{display:"flex","align-self":"center"},attrs:{data:t.geneExpressionVars.expressionStats,xKey:t.geneExpressionVars.selectedLabel,yKey:"gene",xLabel:t.displayLabel(t.geneExpressionVars.selectedLabel),yLabel:t.geneExpressionVars.selectedGene,fillKey:"mean",sizeKey:"pctExpr",fitToSize:!0,cellWidth:30,highlightKey:"",showYLabels:!1,showYTicks:!0,colorScale:t.expressionColorScale,colorScaleMode:t.dotPlotColorScaleMode}}):n("research-violin-plot",{attrs:{data:t.geneExpressionVars.expressionStats,primaryKey:t.geneExpressionVars.selectedLabel,subsetKey:t.cellCompositionVars.segmentByLabel,highlightKey:t.cellCompositionVars.highlightLabel,height:300,xAxisLabel:"Log-Normalized Expression",xAxisLabel:t.isATACseq?"Gene Activity Score":"Log-Normalized Expression",yAxisLabel:t.displayLabel(t.geneExpressionVars.selectedLabel)}}),n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))]),n("research-single-cell-selector",{attrs:{data:t.plotMetadataLabels,layout:"list",listDirection:"horizontal",listAlignment:"start",colors:t.labelColors,selectedField:t.cellCompositionVars.segmentByLabel},on:{"on-update":function(e){return t.handleSelectorUpdate(e)},"on-hover":function(e){return t.handleSelectorHover(e)}}})]:["dot"===t.stratifyPlotType?n("research-dot-plot",{staticStyle:{display:"flex","align-self":"center"},attrs:{data:t.getAllStats(),xKey:t.cellCompositionVars.segmentByLabel,yKey:t.geneExpressionVars.selectedLabel,xLabel:t.displayLabel(t.cellCompositionVars.segmentByLabel),yLabel:t.displayLabel(t.geneExpressionVars.selectedLabel),fillKey:"mean",sizeKey:"pctExpr",fitToSize:!0,cellWidth:30,highlightKey:"",colorScale:t.expressionColorScale,colorScaleMode:t.dotPlotColorScaleMode}}):"combined"===t.stratifyPlotType?n("research-violin-plot",{attrs:{data:t.geneExpressionVars.expressionStats,primaryKey:t.cellCompositionVars.segmentByLabel,subsetKey:t.geneExpressionVars.selectedLabel,facetRows:!0,facetRowHeight:55,facetAxisLabel:t.displayLabel(t.geneExpressionVars.selectedLabel),highlightKey:t.cellCompositionVars.highlightLabel,height:320,xAxisLabel:"Log-Normalized Expression",xAxisLabel:t.isATACseq?"Gene Activity Score":"Log-Normalized Expression",yAxisLabel:t.displayLabel(t.cellCompositionVars.segmentByLabel),range:[t.minExpressionValue(t.geneExpressionVars.selectedGene),t.maxExpressionValue(t.geneExpressionVars.selectedGene)]}}):n("div",{attrs:{id:"sc_violin_plot_group"}},[n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))]),t._l(t.getPlotMetadataLabels(t.cellCompositionVars.segmentByLabel),(function(e){return n("div",{key:e},[n("div",{staticStyle:{display:"flex",gap:"3px","align-items":"baseline"}},[n("div",{staticStyle:{"font-weight":"bold"}},[t._v(t._s(e))])]),n("research-violin-plot",{attrs:{data:t.getStatsByPropValue(t.geneExpressionVars.expressionStats,t.cellCompositionVars.segmentByLabel,e),primaryKey:t.geneExpressionVars.selectedLabel,highlightKey:t.cellCompositionVars.highlightLabel,height:300,xAxisLabel:"Log-Normalized Expression",yAxisLabel:t.displayLabel(t.geneExpressionVars.selectedLabel),range:[t.minExpressionValue(t.geneExpressionVars.selectedGene),t.maxExpressionValue(t.geneExpressionVars.selectedGene)]}})],1)}))],2)]],2),t.contExprResults?n("div",{attrs:{id:"sc_expression_scatter_group"}},[n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))]),n("div",{staticStyle:{display:"flex","flex-wrap":"wrap",gap:"10px"}},t._l(t.contExprResults,(function(e){return n("div",{staticStyle:{"min-width":"250px",flex:"1"}},[n("div",[t._v(t._s(e.groupKey))]),n("research-scatter-plot",{attrs:{data:e.data,width:300,height:150,xKey:t.cellCompositionVars.segmentByLabel,yKey:t.geneExpressionVars.selectedGene,xLabel:t.displayLabel(t.cellCompositionVars.segmentByLabel),yLabel:"Log-Norm. Expression",yDomain:[0,Math.ceil(t.maxExpressionValue(t.geneExpressionVars.selectedGene))],renderAs:"svg"}})],1)})),0)]):t._e()]):t._e()])]),n("div",{staticStyle:{display:"flex",gap:"25px"}},[t.markers&&(t.markerGenes||t.expressionStatsAll.length>0)?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",background:"white",padding:"20px",width:"100%"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px","min-width":"50%"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column"}},[n("div",{staticStyle:{display:"flex",gap:"10px"}},[n("strong",{staticStyle:{"font-size":"16px"}},[t._v(" Top Marker Genes for ")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.dotPlotCellType,expression:"dotPlotCellType"}],on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,
1(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.dotPlotCellType=e.target.multiple?n:n[0]},function(e){return t.showMarkersByCellType(e.target.value)}]}},[n("option",{attrs:{value:""}},[t._v("All")]),t._l(t.markerCellTypes,(function(e){return n("option",{domProps:{value:e}},[t._v(" "+t._s(e)+" ")])}))],2),t.markerFileOptions.length?n("select",{directives:[{name:"model",rawName:"v-model",value:t.markerFile,expression:"markerFile"}],on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.markerFile=e.target.multiple?n:n[0]},function(e){return t.handleMarkerFileChange()}]}},t._l(t.markerFileOptions,(function(e){return n("option",{domProps:{value:e}},[t._v(t._s(e.markerKeyLabel))])})),0):n("strong",{staticStyle:{"font-size":"16px"}},[t._v("Cell Types")])])]),n("download-chart",{staticClass:"download",staticStyle:{width:"125px","align-self":"flex-start"},attrs:{chartId:"sc_marker_dot_plot",titleText:t.markerDotPlotTitle}})],1),n("div",[n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v("Ranked by "+t._s(t.markersHaveZscores?"z-score":"mean expression"))]),n("div",{staticStyle:{"font-size":"13px"}},[t._v("Select a type to view its full marker profile.")])]),n("research-dot-plot",{staticStyle:{display:"flex","align-self":"center"},attrs:{wrapperId:"sc_marker_dot_plot",data:t.markerGenes||t.expressionStatsAll,"data-blah":"pct_cells_expression",yKey:t.markerFile.markerKey,xKey:"gene",yLabel:t.markerFile.markerKeyLabel,xLabel:"Gene",fillKey:"mean_expression",sizeKey:t.markerGenesSizeKey,fitToSize:!0,cellWidth:30,highlightKey:"",colorScale:t.expressionColorScale,colorScaleMode:t.dotPlotColorScaleMode}})],1),t.markerGenesTable?n("b-table",{staticStyle:{"font-size":"12px"},attrs:{items:t.markerGenesTable,fields:t.markerTableColumns,striped:"",hover:"",small:"",responsive:"sm","head-variant":"light","sticky-header":"300px"}}):t._e()],1):t._e()])]):t._e()],1):t._e(),1===t.layout?n("div",{staticStyle:{display:"flex","flex-direction":"column",width:"100%","align-self":"center"}},[n("research-single-cell-info",{attrs:{data:t.metadata}}),t.dataReady?n("div",{staticStyle:{display:"flex",gap:"40px",flex:"1"}},[n("research-single-cell-selector",{staticStyle:{"max-width":"200px"},attrs:{data:t.fields["metadata_labels_sorted"]||t.fields["metadata_labels"],layout:"dropdown-list",showSelect:!1,colors:t.labelColors,selectedField:t.cellCompositionVars.colorByField},on:{"on-update":function(e){return t.handleSelectorUpdate(e)},"on-hover":function(e){return t.handleSelectorHover(e)}}}),n("div",{staticStyle:{display:"flex",gap:"20p",width:"400px"}},[t.coordinates?n("div",{staticStyle:{display:"flex","flex-direction":"column",flex:"1"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"baseline"}},[n("span",{staticStyle:{"font-size":"16px",margin:"0 0 5px"}},[n("span",{staticStyle:{"font-weight":"bold"}},[t._v(t._s(t.embeddingType))]),t._v(" "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.geneExpressionVars.selectedGene?""+t.geneExpressionVars.selectedGene:""))])]),t._v(" "+t._s(t.totalCells.toLocaleString())+" cells ")]),n("div",{staticStyle:{display:"flex",position:"relative"}},[n("research-umap-plot-gl",{attrs:{group:t.datasetId,points:t.coordinates,labels:t.fields,colors:t.labelColors,expression:t.expressionData[t.geneExpressionVars.selectedGene],expressionColorScale:t.expressionColorScale,cellTypeField:t.cellCompositionVars.colorByField,hoverFields:[],highlightLabel:t.cellCompositionVars.highlightLabel,highlightLabels:t.cellCompositionVars.highlightLabels,width:400,height:400}})],1)]):t._e()]),t.geneExpressionVars.expressionStats.length>0?n("div",{staticStyle:{display:"flex","flex-direction":"column",flex:"1"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px"}},[n("span",{staticStyle:{"font-size":"16px"}},[n("span",{staticStyle:{"font-weight":"bold"}},[t._v("Gene Expression")]),t._v(" "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.geneExpressionVars.selectedGene?""+t.geneExpressionVars.selectedGene:""))])])]),n("research-violin-
1plot",{attrs:{data:t.geneExpressionVars.expressionStats,primaryKey:t.geneExpressionVars.selectedLabel,subsetKey:t.geneExpressionVars.subsetLabel,highlightKey:t.cellCompositionVars.highlightLabel,height:400,xAxisLabel:"Log-Normalized Expression",yAxisLabel:t.geneExpressionVars.selectedLabel}})],1):t._e()],1):t._e()],1):t._e(),2===t.layout?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",background:"#f8f8f8",padding:"20px",width:"100%","min-width":"840px"}},[t.dataReady?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px"}},[t.metadata?n("research-single-cell-info",{attrs:{data:t.metadata}}):t._e(),n("div",{staticStyle:{display:"flex",gap:"20px"}},[t.coordinates?n("div",{staticStyle:{display:"flex",gap:"20px",flex:"1",padding:"20px",background:"white"}},[t.colorByFields?n("div",{staticStyle:{display:"flex","flex-direction":"column","align-self":"flex-start",width:"400px"}},[n("strong",{staticStyle:{"font-size":"16px",margin:"0 0 5px"}},[t._v("Color By")]),n("div",{staticStyle:{display:"flex","flex-direction":"column",height:"400px",gap:"5px"}},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.cellCompositionVars.colorByField,expression:"cellCompositionVars.colorByField"}],staticStyle:{width:"100%"},on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.$set(t.cellCompositionVars,"colorByField",e.target.multiple?n:n[0])},function(e){return t.selectColorBy(e.target.value)}]}},[n("option",{attrs:{value:""}},[t._v("--Select--")]),t._l(t.colorByFields.show,(function(e,r){return n("option",{domProps:{value:r}},[t._v(" "+t._s(t.displayLabel(r))+" ")])}))],2),n("div",{staticStyle:{width:"100%","flex-grow":"1","overflow-x":"hidden","overflow-y":"auto"}},[n("research-single-cell-selector",{attrs:{data:t.fields["metadata_labels_sorted"]||t.fields["metadata_labels"],displayData:t.displayFields,selectedField:t.cellCompositionVars.colorByField,layout:"list",colors:t.labelColors},on:{"on-update":function(e){return t.handleSelectorUpdate(e)},"on-hover":function(e){return t.handleSelectorHover(e)}}})],1)])]):t._e(),n("div",{staticStyle:{display:"flex","flex-direction":"column",width:"min-content",flex:"1"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"baseline",margin:"0 0 5px"}},[n("div",[n("strong",{staticStyle:{"font-size":"16px"}},[t._v("Embedding")]),t._v(" "+t._s(t.embeddingType))]),n("div",[t._v(t._s(t.totalCells.toLocaleString())+" cells")])]),n("research-umap-plot-gl",{attrs:{group:t.datasetId,points:t.coordinates,labels:t.fields,colors:t.labelColors,cellTypeField:t.cellCompositionVars.colorByField,colorByField:t.cellCompositionVars.colorByField,hoverFields:[],highlightLabel:t.cellCompositionVars.highlightLabel,highlightLabels:t.cellCompositionVars.highlightLabels,width:400,height:400}})],1)]):t._e()])],1):t._e()]):t._e(),3===t.layout?n("div",{staticStyle:{display:"flex","flex-direction":"column",width:"100%","align-self":"center"}},[n("research-single-cell-info",{attrs:{data:t.metadata}}),t.dataReady?n("div",{staticStyle:{display:"flex",gap:"40px",flex:"1"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",flex:"1"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",flex:"1",gap:"20px",padding:"20px",background:"white"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between",gap:"10px"}},[n("div",{staticStyle:{"font-size":"16px"}},[n("span",{staticStyle:{"font-weight":"bold"}},[t._v(t._s(t.isATACseq?"Nuclei":"Cell")+" "+t._s(t.isNormalized?"Proportion":"Count"))]),t.displayFields&&t.cellCompositionVars.segmentByLabel&&"cat"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))]),t._v(" per "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))])]:t.cellCompositionVars.segmentByLabel?[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.segmentByLabel)))]),t._v(" per "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))])]:[t._v(" by "),n("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))])],t.displayFields&&t.cellCompositionVars.segmentByLabel&&"cont"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?[n("div",{staticStyle:{"font-size":"12px"}},[t._v(" Each point represents the average "+t._s(t.isATACseq?"nuclei":"cell")+" "+t._s(t.isNormalized?"proportion":"distribution")+" per "+t._s(this.aggregateType)+" ")])]:t._e()],2),n("download-chart",{staticClass:"download",staticStyle:{width:"125px","align-self":"flex-start"},style:t.countDownloadDisabled?"pointer-events:none; opacity:0.5":"",attrs:{chartId:t.countDownloadChartId,titleText:t.countSectionTitle}}
1)],1),!t.cellCompositionVars.segmentByLabel||t.displayFields&&"cat"===t.displayFields[t.cellCompositionVars.segmentByLabel].dataType?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"5px"}},[n("research-stacked-bar-plot",{attrs:{data:t.cellCompositionVars.segmentByCounts2,primaryKey:t.cellCompositionVars.segmentByLabel?t.cellCompositionVars.segmentByLabel:t.cellCompositionVars.displayByLabel,subsetKey:t.cellCompositionVars.segmentByLabel?t.cellCompositionVars.displayByLabel:t.cellCompositionVars.segmentByLabel,xAxisLabel:t.useVerticalCellProportionPlot?t.isNormalized?"Percent of "+(t.isATACseq?"Nuclei":"Cells"):"Number of "+(t.isATACseq?"Nuclei":"Cells"):t.cellCompositionVars.segmentByLabel?t.displayLabel(t.cellCompositionVars.segmentByLabel):t.displayLabel(t.cellCompositionVars.displayByLabel),yAxisLabel:t.useVerticalCellProportionPlot?t.cellCompositionVars.segmentByLabel?t.displayLabel(t.cellCompositionVars.segmentByLabel):t.displayLabel(t.cellCompositionVars.displayByLabel):t.isNormalized?"Percent of "+(t.isATACseq?"Nuclei":"Cells"):"Number of "+(t.isATACseq?"Nuclei":"Cells"),highlightKey:t.cellCompositionVars.highlightLabel,normalize:t.isNormalized,stack:!!t.cellCompositionVars.segmentByLabel,verticalCategoryLayout:t.useVerticalCellProportionPlot}}),n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v(t._s(t.cellCompositionVars.segmentByLabel?t.displayLabel(t.cellCompositionVars.displayByLabel):t.displayLabel(t.cellCompositionVars.segmentByLabel)))]),n("research-single-cell-selector",{attrs:{data:t.plotMetadataLabels,layout:"list",listDirection:"horizontal",listAlignment:"start",colors:t.labelColors,selectedField:t.cellCompositionVars.segmentByLabel?t.cellCompositionVars.displayByLabel:t.cellCompositionVars.segmentByLabel},on:{"on-update":function(e){return t.handleSelectorUpdate(e)},"on-hover":function(e){return t.handleSelectorHover(e)}}})],1):t._e(),t.contCountResults?n("div",{attrs:{id:"sc_count_scatter_group"}},[n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v(t._s(t.displayLabel(t.cellCompositionVars.displayByLabel)))]),n("div",{staticStyle:{display:"flex","flex-wrap":"wrap",gap:"10px"}},t._l(t.contCountResults,(function(e){return n("div",{staticStyle:{"min-width":"250px",flex:"1"}},[n("div",[t._v(t._s(e.groupKey))]),n("research-scatter-plot",{attrs:{data:e.data,width:300,height:150,xKey:t.cellCompositionVars.segmentByLabel,yKey:"cell_proportion",xLabel:t.displayLabel(t.cellCompositionVars.segmentByLabel),yLabel:"Cell Proportion",yDomain:[0,1],renderAs:"svg"}})],1)})),0)]):t._e()]),n("div",{staticStyle:{display:"flex",gap:"25px"}},[t.markers&&(t.markerGenes||t.expressionStatsAll.length>0)?n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px",background:"white",padding:"20px",width:"100%"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"20px","min-width":"50%"}},[n("div",{staticStyle:{display:"flex","justify-content":"space-between"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column"}},[n("strong",{staticStyle:{"font-size":"16px"}},[t._v(t._s(""!=t.dotPlotCellType?"Marker Genes for "+t.dotPlotCellType:"Top Marker Genes by Cell Type"))]),n("div",{staticStyle:{"font-size":"12px",opacity:"0.5"}},[t._v("Ranked by "+t._s(t.markersHaveZscores?"z-score":"mean expression"))])]),n("div",{staticStyle:{display:"flex",gap:"20px"}},[n("download-chart",{staticClass:"download",staticStyle:{width:"125px","align-self":"flex-start"},attrs:{chartId:"sc_dot_plot"}})],1)]),n("research-dot-plot",{staticStyle:{display:"flex","align-self":"center"},attrs:{data:t.markerGenes||t.expressionStatsAll,"data-blah":"pct_cells_expression",yKey:t.markerFile.markerKey,xKey:"gene",yLabel:t.markerFile.markerKeyLabel,xLabel:"Gene",fillKey:"mean_expression",sizeKey:t.markerGenesSizeKey,fitToSize:!0,cellWidth:30,highlightKey:"",colorScale:t.expressionColorScale,colorScaleMode:t.dotPlotColorScaleMode}})],1),t.markerGenesTable?n("b-table",{staticStyle:{"font-size":"12px"},attrs:{items:t.markerGenesTable,fields:t.markerTableColumns,striped:"",hover:"",small:"",responsive:"sm","head-variant":"light","sticky-header":"300px"}}):t._e()],1):t._e()])])]):t._e()],1):t._e()]):t._e()],2)},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticStyle:{"font-weight":"bold","font-size":"16px"}},[t._v("Select Tissue")]),n("div",[t._v("Click on a row to select")])])}],i=n("53ca"),o=n("3835"),s=n("5530"),l=n("b85c"),c=n("1da1"),u=n("2909"),d=n("ade3"),h=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("4de4"),n("7db0"),n("0481"),n("caad"),n("a15b"),n("d81d"),n("14d9"),n("13d5"),n("fb6a"),n("4e82"),n("a434"),n("4069"),n("b0c0"),n("a9e3"),n("b680"),n("4fad"),n("0c47"),n("23dc"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("07ac"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("8a79"),n("2532"),n("3ca3"),n("1276"),n("498a"),n("0643"),n("76d6"),n("2382"),n("fffc"),n("4e3e"),n("a573"),n("9d4a"),n("9a9a"),n("159b"),n("ddb0"),n("5698")),p=n("2b0e"),f=n("fd66"),_=n("986e"),g=(n("841c"),n("9861"),n("88a7"),n("271a"),n("5494"),new URLSearchParams(window.location.search));g.get("dev");function m(){}var v,y=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"tooltip",staticClass:"mouse-tooltip"})},b=[],x=p["default"].component("research-mouse-tooltip",{props:{},data:function(){return{tt:null,content:null,mousePos:{x:0,y:0},showing:!1}},watch:{},mounted:function(){this.tt=this.$refs.tooltip},created:function(){},beforeDestroy:function(){},methods:{showTooltip:function(t){this.content=t,this.tt.innerHTML=this.content,this.positionTooltip(),this.tt.classList.add("show")},positionTooltip:function(){var t=this.tt,e=t.offsetWidth,n=t.offsetHeight,r=window.innerWidth,a=window.innerHeight,i=this.mousePos.y-10,o=this.mousePos.x+10;o+e>r&&(o=this.mousePos.x-e-10),i+n>
1a&&(i=a-n-10),i<0&&(i=10),t.style.top="".concat(i,"px"),t.style.left="".concat(o,"px"),this.showing=!0},hideTooltip:function(){this.tt.classList.remove("show"),this.tt.style.top="-10000px",this.tt.style.left="-10000px",this.showing=!1},updateMousePosition:function(t,e){this.mousePos={x:t,y:e},this.showing&&this.positionTooltip()}}}),w=x,C=(n("f4df"),n("2877")),P=Object(C["a"])(w,y,b,!1,null,"902f79a0",null),k=P.exports,M=!1;function E(){if(!v){var t=p["default"].extend(k);v=new t,v.$mount(document.createElement("div")),document.body.appendChild(v.$el)}}function D(t){v&&v.updateMousePosition(t.clientX,t.clientY)}var O={show:function(t){E(),v.showTooltip(t),M||(document.addEventListener("mousemove",D),M=!0)},hide:function(){v&&v.hideTooltip(),M&&(document.removeEventListener("mousemove",D),M=!1)}},L=(n("4ec9"),n("f00c"),n("8ba4"),n("aff5"),n("00b4"),n("5319"),n("5b81"),n("ae39"));function j(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */j=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};u(x,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==n&&r.call(C,s)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);
1if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),u(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),u(P,c,"Generator"),u(P,s,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var S=new Set(["","na","n/a","n.a.","n\\a","missing","null","none","-","--",".",".."]);function A(t){return null===t||void 0===t||S.has(String(t).trim().toLowerCase())}function I(t){return T.apply(this,arguments)}function T(){return T=Object(c["a"])(j().mark((function t(e){var n,r,a,i;return j().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return m("getting metadata",e),t.prev=1,t.next=4,fetch(e);case 4:return n=t.sent,t.next=7,n.text();case 7:return r=t.sent,a=r.split("\n").filter((function(t){return""!==t.trim()})),i=a.map((function(t){return JSON.parse(t)})),t.abrupt("return",i);case 13:return t.prev=13,t.t0=t["catch"](1),m("Error fetching metadata:",t.t0),t.abrupt("return",null);case 17:case"end":return t.stop()}}),t,null,[[1,13]])}))),T.apply(this,arguments)}function B(t,e){return R.apply(this,arguments)}function R(){return R=Object(c["a"])(j().mark((function t(e,n){var r,a,i;return j().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=e.replace("$datasetId",n),m("getting fields",r),t.prev=2,t.next=5,fetch(r);case 5:return a=t.sent,t.next=8,a.json();case 8:return i=t.sent,t.abrupt("return",i);case 12:return t.prev=12,t.t0=t["catch"](2),m("Error fetching fields:",t.t0),t.abrupt("return",null);case 16:case"end":return t.stop()}}),t,null,[[2,12]])}))),R.apply(this,arguments)}function F(t,e){return G.apply(this,arguments)}function G(){return G=Object(c["a"])(j().mark((function t(e,n){var r,a,i;return j().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=e.replace("$datasetId",n),m("getting coordinates",r),t.prev=2,t.next=5,fetch(r);case 5:return a=t.sent,t.t0=L["a"],t.next=9,a.text();case 9:return t.t1=t.sent,i=t.t0.tsv2Json.call(t.t0,t.t1),t.abrupt("return",i);case 14:return t.prev=14,t.t2=t["catch"](2),m("Error fetching coordinates:",t.t2),t.abrupt("return",null);case 18:case"end":return t.stop()}}),t,null,[[2,14]])}))),G.apply(this,arguments)}function W(t,e){return U.apply(this,arguments)}function U(){return U=Object(c["a"])(j().mark((function t(e,n){var r,a,i,o,s;return j().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=e.replace("$datasetId",n),m("getting markers",r),t.prev=2,t.next=5,fetch(r);case 5:return a=t.sent,t.next=8,a.text();case 8:i=t.sent;try{o=JSON.parse(i)}catch(l){s=i.split("\n").filter((function(t){return""!==t.trim()})),o=s.map((function(t){return JSON.parse(t)}))}return t.abrupt("return",o);case 13:return t.prev=13,t.t0=t["catch"](2),m("Error fetching markers:",t.t0),t.abrupt("return",null);case 17:case"end":return t.stop()}}),t,null,[[2,13]])}))),U.apply(this,arguments)}function q(t,e,n){return N.apply(this,arguments)}function N(){return N=Object(c["a"])(j().mark((function t(e,n,r){var a,i,o,s;return j().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.replace("$datasetId",r).replace("$gene",n),m("getting ".concat(n," expression"),a),t.prev=2,t.next=5,fetch(a);case 5:return i=t.sent,t.next=8,i.json();case 8:if(o=t.sent,0!==o.data.length){t.next=12;break}return m("".concat(n," not found")),t.abrupt("return",null);case 12:return s=o.data[0]["expression"],t.abrupt("return",s);case 16:return t.prev=16,t.t0=t["catch"](2),m(" Error fetching gene expression",t.t0),t.abrupt("return",null);case 20:case"end":return t.stop()}}),t,null,[[2,16]])}))),N.apply(this,arguments)}function K(t,e){for(var n=0,r=h["scaleOrdinal"](e),a={},i=0,s=Object.entries(t.metadata_labels);i<s.length;i++){var l=Object(o["a"])(s[i],2),c=l[0],u=l[1];a[c]={};for(var d=0;d<u.length;d++)a[c][u[d]]=r(n),n++}return m("calcLabelColors",a),a}function V(t,e,n,r){m("calcCellCounts",{fields:t,labelColors:e,primaryKey:n,subsetKey:r});var a=t.metadata_labels,i=t.metadata,o=a[n],s=i[n],l=[];
1if(r){var c=i[r],u=a[r];o.forEach((function(t,a){if(!A(t)){for(var i=[],o=0;o<s.length;o++)s[o]===a&&i.push(o);u.forEach((function(a,o){if(!A(a)){var s=i.filter((function(t){return c[t]===o}));l.push(Object(d["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n,t),r,a),"count",s.length),"color",e[r][a]))}}))}}))}else o.forEach((function(t,r){if(!A(t)){for(var a=[],i=0;i<s.length;i++)s[i]===r&&a.push(i);l.push(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n,t),"count",a.length),"color",e[n][t]))}}));return J(t,l,[n,r].filter(Boolean))}function z(t,e,n,r,a){m("calcCellCounts2",{fields:t,labelColors:e,primaryKey:n,subsetKey:r,facetKey:a});var i=t.metadata_labels,o=t.metadata,s=i[n],l=o[n],c=[];if(a||r)if(a){var u=o[r],h=i[r],p=o[a],f=i[a];s.forEach((function(t,i){if(!A(t)){for(var o=[],s=0;s<l.length;s++)l[s]===i&&o.push(s);f.forEach((function(i,s){if(!A(i)){var l=o.filter((function(t){return p[t]===s}));h.forEach((function(o,s){if(!A(o)){var h=l.filter((function(t){return u[t]===s}));c.push(Object(d["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n,t),r,o),a,i),"count",h.length),"color",e[r][o]))}}))}}))}}))}else{var _=o[r],g=i[r];s.forEach((function(t,a){if(!A(t)){for(var i=[],o=0;o<l.length;o++)l[o]===a&&i.push(o);g.forEach((function(a,o){if(!A(a)){var s=i.filter((function(t){return _[t]===o}));c.push(Object(d["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n,t),r,a),"count",s.length),"color",e[r][a]))}}))}}))}else s.forEach((function(t,r){if(!A(t)){for(var a=[],i=0;i<l.length;i++)l[i]===r&&a.push(i);c.push(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n,t),"count",a.length),"color",e[n][t]))}}));return J(t,c,[n,a,r].filter(Boolean))}function $(t,e,n,r,a){for(var i=t[n],s=t[r],l=t[a],c=e[n],u=e[r],h=e[a],p={},f={},_=0;_<i.length;_++){var g,m=null!==(g=c[i[_]])&&void 0!==g?g:"unknown",v=h[l[_]],y=u[s[_]];if(!(A(m)||A(v)||null===v||void 0===v||null===y||void 0===y||isNaN(Number(y)))){y=Number(y),f[v]||(f[v]=0),f[v]+=1;var b="".concat(m,"|").concat(v);p[b]||(p[b]=Object(d["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n,m),a,v),r,y),"cell_count",0)),p[b].cell_count+=1}}for(var x in p){var w=p[x],C=w[a],P=f[C];w.cell_proportion=w.cell_count/P}for(var k={},M=0,E=Object.values(p);M<E.length;M++){var D=E[M],O=D[n];k[O]||(k[O]=[]),k[O].push(D)}return Object.entries(k).map((function(t){var e=Object(o["a"])(t,2),n=e[0],r=e[1];return{groupKey:n,data:r}}))}function H(t,e,n,r){for(var a=t[n],i=t[r],l=e[n],c=e[r],u=[],h=0;h<a.length;h++){var p,f,_=null!==(p=l[a[h]])&&void 0!==p?p:"unknown",g=null!==(f=c[i[h]])&&void 0!==f?f:null;A(_)||("string"===typeof g&&(g=g.trim().toLowerCase()),null===g||void 0===g||"na"===g||"n/a"===g||""===g||isNaN(Number(g))||(g=Number(g),u.push(Object(d["a"])(Object(d["a"])({},n,_),r,g))))}var m=function(t,e){var n={};return t.forEach((function(t){var r=e(t);n[r]||(n[r]=[]),n[r].push(t)})),n},v=m(u,(function(t){return t[n]})),y=Object.entries(v).map((function(t){var e=Object(o["a"])(t,2),a=e[0],i=e[1],l=i.map((function(t){return t[r]}));return Object(s["a"])(Object(d["a"])({},n,a),Y(l))}));return y}function Y(t){var e=Object(u["a"])(t).sort((function(t,e){return t-e})),n=h["quantile"](e,.25),r=h["quantile"](e,.5),a=h["quantile"](e,.75),i=a-n,o=h["max"]([h["min"](e),n-1.5*i]),s=h["min"]([h["max"](e),a+1.5*i]),l=e.filter((function(t){return t<o||t>s}));return{min:e[0]||0,q1:n,median:r,q3:a,max:e[e.length-1]||0,outliers:l,exprValues:e}}function Z(t,e,n,r,a,i){for(var l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,c=a,u=t[r],h=e[r],p=t[n],f=e[n],_=l?t[l]:null,g=l?e[l]:null,m=[],v=0;v<c.length;v++){var y=c[v],b=h[u[v]],x=f[p[v]],w=l?g[_[v]]:null;A(x)||l&&A(w)||null===y||void 0===y||isNaN(y)||null===b||void 0===b||isNaN(b)||m.push(Object(s["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n,x),r,Number(b)),i,Number(y)),l?Object(d["a"])({},l,w):{}))}for(var C={},P=0,k=m;P<k.length;P++){var M=k[P],E=M[n],D=l?M[l]:null,O=l?"".concat(E,"|").concat(D):E;C[O]||(C[O]={group:E,aggregate:D,values:[]}),C[O].values.push(Object(d["a"])(Object(d["a"])({},r,M[r]),i,M[i]))}for(var L={},j=0,S=Object.entries(C);j<S.length;j++){var I=Object(o["a"])(S[j],2),T=(I[0],I[1]),B=T.group,R=T.aggregate,F=T.values,G=F.reduce((function(t,e){return t+e[r]}),0)/F.length,W=F.reduce((function(t,e){return t+e[i]}),0)/F.length;L[B]||(L[B]=[]),L[B].push(Object(s["a"])(Object(s["a"])({},l?Object(d["a"])({},l,R):{}),{},Object(d["a"])(Object(d["a"])({},r,G),i,W)))}return Object.entries(L).map((function(t){var e=Object(o["a"])(t,2),n=e[0],r=e[1];return{groupKey:n,data:r}}))}function X(t,e,n,r,a,i){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=t.metadata_labels,c=t.metadata,u=l[a],h=c[a],p=[];if(i){var f=c[i],_=l[i];u.forEach((function(t,o){if(!A(t)){for(var l=[],c=0;c<h.length;c++)h[c]===o&&l.push(c);_.forEach((function(o,c){if(!A(o)){var u=l.filter((function(t){return f[t]===c})),h=u.map((function(t){return n[t]}));p.push(Object(s["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])({gene:r},a,t),i,o),"color",e[i][o]),Q(h)))}}))}}))}else u.forEach((function(t,i){if(!A(t)){for(var l=[],c=0;c<h.length;c++)h[c]===i&&l.push(c);var u=l.map((function(t){return n[t]}));p.push(Object(s["a"])(Object(d["a"])(Object(d["a"])({gene:r},a,t),"color",e[a][t]),Q(u,o)))}}));
1return J(t,p,[a,i].filter(Boolean))}function J(t,e,n){if(!e||0===e.length)return e;var r=t.metadata_labels_sorted||{},a={};return n.forEach((function(e){var n=r[e]||t.metadata_labels[e];n&&(a[e]=new Map(n.map((function(t,e){return[t,e]}))))})),Object(u["a"])(e).sort((function(t,e){var r,i=Object(l["a"])(n);try{for(i.s();!(r=i.n()).done;){var o=r.value,s=a[o];if(s){var c=s.get(t[o]),u=s.get(e[o]);if(c!==u)return(null!==c&&void 0!==c?c:Number.MAX_SAFE_INTEGER)-(null!==u&&void 0!==u?u:Number.MAX_SAFE_INTEGER)}}}catch(d){i.e(d)}finally{i.f()}return 0}))}function Q(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.sort(h["ascending"]),r=h["mean"](n)||0,a=h["quantile"](n,.5)||0,i=n.filter((function(t){return t>0})).length/n.length*100||0,o=h["quantile"](n,.25)||0,s=h["quantile"](n,.75)||0;return e?{mean:r,pctExpr:i}:{exprValues:n,interQuantileRange:s-o,min:n[0]||0,max:n[n.length-1]||0,mean:r,median:a,pctExpr:i,q1:o,q3:s}}function tt(t,e){return t.reduce((function(t,n){return t[n[e]]||(t[n[e]]=[]),t[n[e]].push(n),t}),{})}function et(t){var e=5e3,n=nt(t,e),r=n.filter((function(t){return!A(t)}));if(0===r.length)return"cat";var a=Object(u["a"])(new Set(r)),i=a.length,o=function(t){var e=Number(t);return Number.isFinite(e)},s=function(t){return"string"===typeof t&&(/^(\d+)\s*[-â]\s*(\d+)$/.test(t)||/^\d+\s*\+$/.test(t)||/under|over|less|more|to/i.test(t))},l=function(t){return"string"===typeof t&&/[a-zA-Z]/.test(t)&&/\d/.test(t)},c=function(t){return"string"===typeof t&&/^0\d+$/.test(t.trim())};if(r.some(s)||r.some(l)||r.some(c))return"cat";var d=r.every(o);if(!d)return"cat";var h=a.map((function(t){return Number(t)})).sort((function(t,e){return t-e})),p=h.every(Number.isInteger),f=h[0],_=h[h.length-1],g=_-f;if(p){if(i<=12)return"cat";if(g<=12)return"cat";var m=g>0&&i/(g+1)>=.8;if(i<=24&&m)return"cat"}var v=h.some((function(t){return!Number.isInteger(t)}));return v?i>=5?"cont":"cat":i>=15?"cont":"cat"}function nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;if(!Array.isArray(t)||t.length<=e)return Array.isArray(t)?t:[];for(var n=[],r=t.length/e,a=0;a<e;a++){var i=Math.min(t.length-1,Math.floor(a*r));n.push(t[i])}return n}var rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"umapContainer",staticClass:"umap-container",staticStyle:{width:"100%",position:"relative","overflow-x":"hidden"},on:{mousedown:t.onMouseDown,mousemove:t.onMouseMove,mouseup:t.onMouseUp,mouseleave:t.onMouseLeave,mouseover:t.onMouseOver,mouseout:t.onMouseOut,wheel:function(e){return e.preventDefault(),t.onWheel.apply(null,arguments)},contextmenu:function(t){t.preventDefault()}}},[t.expression?n("div",{staticClass:"legend",staticStyle:{display:"flex","flex-direction":"column",position:"absolute",top:"4px",left:"5px"}},[n("div",{staticClass:"label"},[t._v("Expression")]),n("div",{staticClass:"gradient",style:"background: linear-gradient(to right, "+t.colorScaleArray()+"); height:5px;"}),n("div",{staticClass:"marks",staticStyle:{display:"flex"}},[n("div",[t._v(t._s(t.minExpressionValue()))]),n("div",[t._v(t._s(t.maxExpressionValue()))])])]):t._e(),t.points?n("div",{staticStyle:{display:"flex","align-items":"center","justify-content":"flex-end",gap:"5px",position:"absolute",right:"5px",top:"5px","z-index":"1"}},[n("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",modifiers:{hover:!0,bottom:!0}}],style:t.showTooltips?"background:white":"background:#ddd",attrs:{title:"toggle cell info"},on:{click:function(e){t.showTooltips=!t.showTooltips}}},[n("svg",{staticStyle:{width:"12px",margin:"0 4px"},attrs:{viewBox:"0 0 15.098 18.794","xml:space":"preserve",xmlns:"http://www.w3.org/2000/svg"}},[n("g",{attrs:{transform:"translate(-.27 -.301)"}},[n("path",{attrs:{d:"M.77 14.361V.801h14.098v13.56H10.51l-2.853 4.234-2.605-4.234z",fill:"none",stroke:"#000","stroke-linecap":"round","stroke-linejoin":"round"}}),n("circle",{attrs:{cx:"7.845",cy:"4.296",r:".979"}}),n("path",{attrs:{d:"M7.094 5.928h1.501v5.876H7.094z"}})])])]),n("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",modifiers:{hover:!0,bottom:!0}}],style:t.showLabels?"background:white":"background:#ddd",attrs:{title:"toggle labels"},on:{click:t.toggleLabels}},[n("svg",{staticStyle:{width:"20px"},attrs:{viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg","xml:space":"preserve",transform:"rotate(270)"}},[n("path",{attrs:{d:"M24.896 9.463a.997.997 0 0 0-.707-.293l-12.957-.001a1 1 0 0 0-1 .996l-.046 13.005a.998.998 0 0 0 .293.711l16.995 16.995a.997.997 0 0 0 1.414 0l13.004-13.004a.999.999 0 0 0 0-1.414L24.896 9.463zm3.285 29.292L12.188 22.761l.041-11.592 11.547.001 15.995 15.995-11.59 11.59z"}}),n("circle",{attrs:{cx:"20.362",cy:"19.346",r:"2.61"}}
1)])]),n("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",modifiers:{hover:!0,bottom:!0}}],attrs:{title:"recenter"},on:{click:t.resetPanZoom}},[n("svg",{staticStyle:{width:"18px"},attrs:{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M6 12H4V4h8v2H6v6zM28 12h-2V6h-6V4h8v8zM12 28H4v-8h2v6h6v2zM28 28h-8v-2h6v-6h2v8zM15 10h2v4h-2zM10 15h4v2h-4zM18 15h4v2h-4zM15 18h2v4h-2z"}}),n("path",{attrs:{fill:"none",d:"M0 0h32v32H0z"}})])]),n("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom.html",modifiers:{hover:!0,bottom:!0,html:!0}}],attrs:{title:t.is3dMode?"zoom: mouse wheel<br>rotate: click + drag<br>pan: shift + drag or right drag":"zoom: mouse wheel<br>pan: click + drag"}},[n("svg",{staticStyle:{width:"18px"},attrs:{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M12 19.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Zm0 1.5a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm.75-6v1.5h-1.5V15h1.5Zm-2.25-4.568C10.5 9.662 11.15 9 12 9s1.5.663 1.5 1.432c0 .307-.185.671-.592 1.084-.395.4-.898.743-1.315 1.013l-.343.222v1.499h1.5v-.688c.381-.259.833-.595 1.225-.992.507-.514 1.025-1.24 1.025-2.138C15 8.79 13.635 7.5 12 7.5s-3 1.291-3 2.932h1.5Z",fill:"#000"}})])]),n("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover.bottom",modifiers:{hover:!0,bottom:!0}}],attrs:{title:"Download"},on:{click:t.download}},[n("svg",{staticStyle:{width:"24px"},attrs:{fill:"#000000",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[n("g",{attrs:{id:"SVGRepo_iconCarrier"}},[n("path",{attrs:{d:"M512 666.5L367.2 521.7l36.2-36.2 83 83V256h51.2v312.5l83-83 36.2 36.2L512 666.5zm-204.8 50.3V768h409.6v-51.2H307.2z"}})])])])]):t._e(),n("canvas",{ref:"umapCanvas",staticClass:"umap-canvas",on:{click:t.onClick}}),n("canvas",{ref:"umapLabelCanvas",staticClass:"umap-label-canvas",style:"display:"+(t.showLabels?"block":"none")}),t.is3dMode?n("canvas",{ref:"axisIndicatorCanvas",staticClass:"umap-axis-indicator"}):t._e()])},at=[],it=(n("cb29"),n("a630"),n("c19f"),n("ace4"),n("2c66"),n("249d"),n("40e9"),n("4057"),n("6b93"),n("9129"),n("cfc3"),n("5cc6"),n("907a"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("986a"),n("1d02"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("6ce5"),n("2834"),n("72f7"),n("4ea1"),n("d4ec")),ot=n("bee2"),st=function(){function t(){Object(it["a"])(this,t),this.groups=new Map}return Object(ot["a"])(t,[{key:"initPoints",value:function(t,e){if(this.groups.has(t))this.groups.get(t).instances++;else{for(var n=e.length,r=new Map,a=new Float32Array(3*e.length),i=0,o=0;o<e.length;o++){var s;r.set(e[o],o),a[i++]=e[o].X,a[i++]=e[o].Y,a[i++]=null!==(s=e[o].Z)&&void 0!==s?s:0}var l=h["quadtree"]().x((function(t){return t.X})).y((function(t){return t.Y})).addAll(e),c=1;this.groups.set(t,{numPoints:n,positions:a,points:e,pointIndexMap:r,quadtree:l,instances:c})}}},{key:"getPositions",value:function(t){var e=this.groups.get(t);return e?e.positions:null}},{key:"getPoints",value:function(t){var e=this.groups.get(t);return e?e.points:null}},{key:"getQuadtree",value:function(t){var e=this.groups.get(t);return e?e.quadtree:null}},{key:"getPointIndex",value:function(t,e){var n=this.groups.get(t);return n?n.pointIndexMap.get(e):null}},{key:"getNumPoints",value:function(t){var e=this.groups.get(t);return e?e.numPoints:null}},{key:"release",value:function(t){if(this.groups.has(t)){var e=this.groups.get(t);e.instances--,e.instances<=0&&this.groups.delete(t)}}}])}(),lt=new st,ct=lt,ut=Math.PI/180,dt=1e-6,ht=.1,pt=.9,ft=1.2,_t=50,gt=.1,mt=20,vt=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function yt(t,e,n){return Math.min(Math.max(t,e),n)}function bt(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function xt(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function wt(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ct(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Pt(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function kt(t){return Math.hypot(t[0],t[1],t[2])}function Mt(t){var e=kt(t);return e<dt?[0,0,0]:[t[0]/e,t[1]/e,t[2]/e]}function Et(t,e,n,r){var a=1/Math.tan(t/2),i=1/(n-r);return new Float32Array([a/e,0,0,0,0,a,0,0,0,0,(n+r)*i,-1,0,0,n*r*i*2,0])}function Dt(t,e,n,r,a,i){return new Float32Array([2/(e-t),0,0,0,0,2/(r-n),0,0,0,0,-2/(i-a),0,-(e+t)/(e-t),-(r+n)/(r-n),-(i+a)/(i-a),1])}function Ot(t,e,n){var r=Mt(xt(t,e)),a=Mt(Pt(n,r)),i=Pt(r,a);return new Float32Array([a[0],i[0],r[0],0,a[1],i[1],r[1],0,a[2],i[2],r[2],0,-Ct(a,t),-Ct(i,t),-Ct(r,t),1])}function Lt(t,e){for(var n=new Float32Array(16),r=0;r<4;r++)for(var a=0;a<4;a++){for(var i=0,o=0;o<4;o++)i+=t[4*o+a]*e[4*r+o];n[4*r+a]=i}return n}function jt(t,e){var n=Object(o["a"])(e,3),r=n[0],a=n[1],i=n[2];return[t[0]*r+t[4]*a+t[8]*i+t[12],t[1]*r+t[5]*a+t[9]*i+t[13],t[2]*r+t[6]*a+t[10
1]*i+t[14],t[3]*r+t[7]*a+t[11]*i+t[15]]}function St(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255,n=h["color"](t||"#000000").rgb();return[n.r,n.g,n.b,e]}var At=p["default"].component("research-umap-plot-gl",{props:{group:{type:String,required:!0},points:{type:Array,required:!0},labels:{type:Object,required:!0},colors:{type:Object,required:!0},cellTypeField:{type:String,required:!1},colorByField:{type:String,required:!1},hoverFields:{type:Array,required:!1},width:{type:Number,default:800},height:{type:Number,default:800},highlightLabel:{type:String,default:null},highlightLabels:{type:Array,default:function(){return[]}},expression:{type:Array,default:null},expressionColorScale:{type:String,required:!1,default:"blue"}},data:function(){return{gl:null,program:null,locations:null,buffers:{points:{},axes:{},hover:{}},showLabels:!0,showTooltips:!0,pointBounds:{minX:0,maxX:0,minY:0,maxY:0,minZ:0,maxZ:0,center:[0,0,0],size:[0,0,0],radius:1},camera:{target:[0,0,0],distance:1,yaw:0,pitch:0},resetCamera:{target:[0,0,0],distance:1,yaw:0,pitch:0},projection:{fov:45*ut,near:.1,far:1e4,aspect:1},orthoBaseHalfHeight:1,isHovering:!1,interactionMode:null,lastMouse:{x:0,y:0},vertexCount:0,axisVertexCount:0,clusterCenters:[],expressionScale:null,expressionExtent:{min:null,max:null},resizeTimeout:null,colorOptions:{red:h["interpolateReds"],blue:h["interpolate"]("lightgrey","blue")},projectedPoints:[],projectedLabels:[],renderMatrix:null,viewMatrix:vt,orthoBounds:null,hoveredPointIndex:-1,pointDrawOrder:[],cameraVectors:{eye:[0,0,1],forward:[0,0,-1],right:[1,0,0],up:[0,1,0]},sharedGroupAttached:!1,renderQueued:!1,renderProjectionDirty:!0,syncPending:!1,rafId:null,hoverVertexCount:0}},computed:{is3dMode:function(){return this.points.some((function(t){var e;return 0!==(null!==(e=t.Z)&&void 0!==e?e:0)}))},currColorOption:function(){return this.colorOptions[this.expressionColorScale]}},watch:{points:{handler:function(){this.cleanUp(),this.init()}},labels:{handler:function(){this.cleanUpBuffers(),this.calculateClusterCenters(),this.setupBuffers(),this.requestRender(!0)}},cellTypeField:function(){this.points&&(this.cleanUp(),this.init())},colorByField:function(){this.setupBuffers({rebuildPositions:!1,rebuildColors:!0,rebuildOrder:!1,rebuildHighlight:!0,rebuildAxes:!1}),this.requestRender(!0)},highlightLabel:function(){this.updateHighlightBuffer(),this.requestRender(!0)},highlightLabels:function(){this.updateHighlightBuffer(),this.requestRender(!0)},expression:function(){this.updateExpressionScale(),this.setupBuffers({rebuildPositions:!this.is3dMode,rebuildColors:!0,rebuildOrder:!this.is3dMode,rebuildHighlight:!this.is3dMode,rebuildAxes:!1}),this.requestRender(!0)}},mounted:function(){_["a"].$on("view-transform-change",this.handleUpdateViewTransform),window.addEventListener("resize",this.handleResize),this.init()},beforeDestroy:function(){_["a"].$off("view-transform-change",this.handleUpdateViewTransform),window.removeEventListener("resize",this.handleResize),this.cleanUp()},methods:{colorScaleArray:function(){var t=this;return h["range"](0,1.01,.1).map((function(e){return t.currColorOption(e)})).join(", ")},minExpressionValue:function(){return this.expressionExtent.min},maxExpressionValue:function(){return this.expressionExtent.max},handleResize:function(){var t=this;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){t.init()}),100)},toggleLabels:function(){this.showLabels=!this.showLabels,this.requestRender(!0)},init:function(){if(m("---glUMAP init"),this.$refs.umapContainer&&this.points&&0!==this.points.length){this.sharedGroupAttached&&ct.release(this.group),ct.initPoints(this.group,this.points),this.sharedGroupAttached=!0;var t=this.$refs.umapContainer.parentElement.offsetWidth;this.$refs.umapContainer.style.height="".concat(this.height,"px");var e=window.devicePixelRatio||1,n=this.$refs.umapCanvas;n.width=t*e,n.height=this.height*e,n.style.width="".concat(t,"px"),n.style.height="".concat(this.height,"px");var r=this.$refs.umapLabelCanvas;r.width=t*e,r.height=this.height*e,r.style.width="".concat(t,"px"),r.style.height="".concat(this.height,"px"),this.setupAxisIndicatorCanvas(e),this.calculatePointBounds(),this.calculateClusterCenters(),this.resetCameraFromBounds(),this.initializeWebGL(),this.updateExpressionScale(),this.setupBuffers(),this.requestRender(!0)}},cleanUpBuffers:function(){var t=this.gl;
1t&&(Object.values(this.buffers.points).forEach((function(e){e&&t.deleteBuffer(e)})),Object.values(this.buffers.axes).forEach((function(e){e&&t.deleteBuffer(e)})),Object.values(this.buffers.hover).forEach((function(e){e&&t.deleteBuffer(e)})),this.buffers={points:{},axes:{},hover:{}})},cleanUp:function(){this.cleanUpBuffers(),this.gl&&this.program&&this.gl.deleteProgram(this.program),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.program=null,this.gl=null,this.locations=null,O.hide(),this.sharedGroupAttached&&(ct.release(this.group),this.sharedGroupAttached=!1)},setupAxisIndicatorCanvas:function(t){var e=this.$refs.axisIndicatorCanvas;e&&(e.width=_t*t,e.height=_t*t,e.style.width="".concat(_t,"px"),e.style.height="".concat(_t,"px"))},calculatePointBounds:function(){var t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minZ:1/0,maxZ:-1/0};this.points.forEach((function(e){var n,r=null!==(n=e.Z)&&void 0!==n?n:0;e.X<t.minX&&(t.minX=e.X),e.X>t.maxX&&(t.maxX=e.X),e.Y<t.minY&&(t.minY=e.Y),e.Y>t.maxY&&(t.maxY=e.Y),r<t.minZ&&(t.minZ=r),r>t.maxZ&&(t.maxZ=r)}));var e=[Math.max(t.maxX-t.minX,1),Math.max(t.maxY-t.minY,1),Math.max(t.maxZ-t.minZ,1)],n=[(t.minX+t.maxX)/2,(t.minY+t.maxY)/2,(t.minZ+t.maxZ)/2];this.pointBounds=Object(s["a"])(Object(s["a"])({},t),{},{size:e,center:n,radius:Math.max.apply(Math,e)/2||1})},calculateClusterCenters:function(){var t=this;this.clusterCenters=[];var e=this.cellTypeField||Object.keys(this.labels.metadata_labels)[0],n=this.labels.metadata[e],r=this.labels.metadata_labels[e],a={};this.points.forEach((function(e,i){var o,s=n[i],l=r[s]||"Unlabeled";a[l]||(a[l]={xSum:0,ySum:0,zSum:0,count:0}),a[l].xSum+=e.X,a[l].ySum+=e.Y,a[l].zSum+=t.is3dMode&&null!==(o=e.Z)&&void 0!==o?o:0,a[l].count++})),Object.entries(a).forEach((function(e){var n=Object(o["a"])(e,2),r=n[0],a=n[1];t.clusterCenters.push({label:r,position:[a.xSum/a.count,a.ySum/a.count,a.zSum/a.count]})}))},resetCameraFromBounds:function(){this.projection.aspect=this.$refs.umapCanvas.width/Math.max(this.$refs.umapCanvas.height,1);var t,e=1-2*ht;if(this.is3dMode){var n=-Math.PI/4,r=Math.PI/7,a=Mt([Math.cos(r)*Math.sin(n),Math.sin(r),Math.cos(r)*Math.cos(n)]),i=Mt(wt(a,-1)),s=Mt(Pt(i,[0,1,0])),l=Mt(Pt(s,i)),c=Math.tan(this.projection.fov/2)*e,d=c*this.projection.aspect,h=Object(o["a"])(this.pointBounds.size,3),p=h[0],f=h[1],_=h[2],g=[p/2,f/2,_/2];t=this.projection.near;for(var m=0,v=[-g[0],g[0]];m<v.length;m++)for(var y=v[m],b=0,x=[-g[1],g[1]];b<x.length;b++)for(var w=x[b],C=0,P=[-g[2],g[2]];C<P.length;C++){var k=P[C],M=[y,w,k],E=Math.abs(Ct(M,s)),D=Math.abs(Ct(M,l)),O=Ct(M,i);t=Math.max(t,E/Math.max(d,dt)-O,D/Math.max(c,dt)-O)}t*=pt}else{var L=Math.max(this.pointBounds.size[0]/2,dt),j=Math.max(this.pointBounds.size[1]/2,dt);this.orthoBaseHalfHeight=Math.max(j,L/Math.max(this.projection.aspect,dt))/Math.max(e,dt),t=1}var S={target:Object(u["a"])(this.pointBounds.center),distance:t,yaw:this.is3dMode?-Math.PI/4:0,pitch:this.is3dMode?Math.PI/7:0};this.camera={target:Object(u["a"])(S.target),distance:S.distance,yaw:S.yaw,pitch:S.pitch},this.resetCamera={target:Object(u["a"])(S.target),distance:S.distance,yaw:S.yaw,pitch:S.pitch},this.updateCameraState()},initializeWebGL:function(){var t=this.$refs.umapCanvas,e=t.getContext("webgl",{preserveDrawingBuffer:!0});if(e){this.gl=e;var n="\n attribute vec3 a_position;\n attribute vec4 a_color;\n attribute float a_isHighlight;\n\n uniform mat4 u_matrix;\n uniform float u_pointSize;\n uniform float u_renderPoints;\n uniform float u_hoverScale;\n uniform float u_minPointScale;\n uniform float u_maxPointScale;\n uniform float u_highlightMode;\n\n varying vec4 v_color;\n varying float v_renderPoints;\n\n void main() {\n if (u_highlightMode < 1.5 && a_isHighlight < 0.5) {\n gl_Position = vec4(-2.0, -2.0, 0.0, 1.0);\n gl_PointSize = 0.0;\n v_color = vec4(0.0);\n v_renderPoints = u_renderPoints;\n return;\n }\n\n if (u_highlightMode > 1.5 && a_isHighlight > 0.5) {\n gl_Position = vec4(-2.0, -2.0, 0.0, 1.0);\n gl_PointSize = 0.0;\n v_color = vec4(0.0);\n v_renderPoints = u_renderPoints;\n return;\n }\n\n gl_Position = u_matrix * vec4(a_position, 1.0
1);\n float pointScale = mix(u_minPointScale, u_maxPointScale, a_isHighlight);\n gl_PointSize = u_pointSize * pointScale * u_hoverScale;\n v_color = a_color;\n v_renderPoints = u_renderPoints;\n }\n ",r="\n precision mediump float;\n varying vec4 v_color;\n varying float v_renderPoints;\n\n void main() {\n if (v_renderPoints > 0.5) {\n vec2 centered = gl_PointCoord - vec2(0.5);\n if (dot(centered, centered) > 0.25) {\n discard;\n }\n }\n\n gl_FragColor = v_color;\n }\n ",a=this.createShader(e,e.VERTEX_SHADER,n),i=this.createShader(e,e.FRAGMENT_SHADER,r);this.program=this.createProgram(e,a,i),e.useProgram(this.program),this.locations={position:e.getAttribLocation(this.program,"a_position"),color:e.getAttribLocation(this.program,"a_color"),highlight:e.getAttribLocation(this.program,"a_isHighlight"),matrix:e.getUniformLocation(this.program,"u_matrix"),pointSize:e.getUniformLocation(this.program,"u_pointSize"),renderPoints:e.getUniformLocation(this.program,"u_renderPoints"),hoverScale:e.getUniformLocation(this.program,"u_hoverScale"),minPointScale:e.getUniformLocation(this.program,"u_minPointScale"),maxPointScale:e.getUniformLocation(this.program,"u_maxPointScale"),highlightMode:e.getUniformLocation(this.program,"u_highlightMode")},e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.enable(e.DEPTH_TEST)}},getActiveLabelField:function(){return this.colorByField||this.cellTypeField||Object.keys(this.labels.metadata_labels)[0]},updateExpressionScale:function(){if(!this.expression||0===this.expression.length)return this.expressionScale=null,void(this.expressionExtent={min:null,max:null});for(var t=1/0,e=-1/0,n=0;n<this.expression.length;n++){var r=this.expression[n];null==r||Number.isNaN(r)||(r<t&&(t=r),r>e&&(e=r))}if(t===1/0||e===-1/0)return this.expressionScale=null,void(this.expressionExtent={min:null,max:null});this.expressionExtent={min:t,max:e},this.expressionScale=h["scaleSequential"](this.currColorOption).domain([0,e])},buildPointOrder:function(){var t=this,e=this.points.length,n=Array.from({length:e},(function(t,e){return e}));return!this.is3dMode&&this.expression&&n.sort((function(e,n){var r,a,i=null!==(r=t.expression[e])&&void 0!==r?r:-1/0,o=null!==(a=t.expression[n])&&void 0!==a?a:-1/0;return i-o})),n},buildPositionBuffer:function(t){for(var e=t.length,n=ct.getPositions(this.group),r=new Float32Array(3*e),a=0;a<e;a++){var i=t[a];r[3*a]=n[3*i],r[3*a+1]=n[3*i+1],r[3*a+2]=this.is3dMode?n[3*i+2]:0}return r},buildColorBuffer:function(t){for(var e=this.getActiveLabelField(),n=this.labels.metadata[e],r=this.labels.metadata_labels[e],a=new Uint8Array(4*t.length),i=this.colors[e]||{},o=0;o<t.length;o++){var s=t[o],l=void 0;if(this.expressionScale&&null!=this.expression[s])l=St(this.expressionScale(this.expression[s]));else{var c=n[s],u=r[c];l=St(i[u]||"#000000")}l[3]=255,a.set(l,4*o)}return a},buildAxisBuffers:function(){var t=Object(o["a"])(this.pointBounds.size,3),e=t[0],n=t[1],r=t[2],a=.65*Math.max(e,n,r)||1,i=Object(o["a"])(this.pointBounds.center,3),s=i[0],l=i[1],c=i[2],d=new Float32Array([s-a,l,c,s+a,l,c,s,l-a,c,s,l+a,c,s,l,c-a,s,l,c+a]),h=St("#d64545"),p=St("#2e9b46"),f=St("#2f6fe4"),_=new Uint8Array([].concat(Object(u["a"])(h),Object(u["a"])(h),Object(u["a"])(p),Object(u["a"])(p),Object(u["a"])(f),Object(u["a"])(f))),g=new Uint8Array([255,255,255,255,255,255]);return{positions:d,colors:_,highlight:g,vertexCount:6}},makeBuffer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.gl,r=e||n.createBuffer();return n.bindBuffer(n.ARRAY_BUFFER,r),n.bufferData(n.ARRAY_BUFFER,t,n.STATIC_DRAW),r},setupBuffers:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.gl;if(e){var n=t.rebuildPositions,r=void 0===n||n,a=t.rebuildColors,i=void 0===a||a,o=t.rebuildOrder,s=void 0===o||o,l=t.rebuildHighlight,c=void 0===l||l,u=t.rebuildAxes,d=void 0===u||u;if((s||this.pointDrawOrder.length!==this.points.length)&&(this.pointDrawOrder=this.buildPointOrder()),this.vertexCount=this.points.length,r){var h=this.buildPositionBuffer(this.pointDrawOrder);this.buffers.points.position=this.makeBuffer(h,this.buffers.points.position)}if(i){var p=this.buildColorBuffer(this.pointDrawOrder);this.buffers.points.color=this.makeBuffer(p,this.buffers.points.color)}if(c&&this.updateHighlightBuffer(this.pointDrawOrder),d){var f=this.buildAxisBuffers();this.axisVertexCount=f.vertexCount,this.buffers.axes.position=this.makeBuffer(f.positions,this.buffers.axes.position),this.buffers.axes.color=this.makeBuffer(f.colors,this.buffers.axes.color),this.buffers.axes.highlight=this.makeBuffer(f.highlight,this.buffers.axes.highlight)}this.updateHoverBuffer()}},updateHoverBuffer:function(){var t,e=this.gl;if(e)if(-1!==this.hoveredPointIndex){var n=this.points[this.hoveredPointIndex];if(n){var r=new Float32Array([n.X,n.Y,this.is3dMode&&null!==(t=n.Z)&&void 0!==t?t:0]),a=new Uint8Array([0,0,0,255]),i=new Uint8Array([255]);this.buffers.hover.position=this.makeBuffer(r,this.buffers.hover.position),this.buffers.hover.color=this.makeBuffer(a,this.buffers.hover.color),this.buffers.hover.highlight=this.makeBuffer(i,this.buffers.hover.highlight),this.hoverVertexCount=1}else this.hoverVertexCount=0}else this.hoverVertexCount=0},updateHighlightBuffer:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=this.gl;if(e){for(var n=t||this.pointDrawOrder||Array.from({length:this.vertexCount},(function(t,e){return e})),r=this.getActiveLabelField(),a=this.labels.metadata[r],i=this.labels.metadata_labels[r],o=!!this.highlightLabel||this.highlightLabels.length>0,s=new Uint8Array(n.length),l=0;l<n.length;l++){var c=n[l];if(o){var u=a[c],d=i[u];s[l]=d===this.highlightLabel||this.highlightLabels.includes(d)?255:0}else s[l]=255}this.buffers.points.highlight=this.makeBuffer(s,this.buffers.points.highlight)}},getEyePosition:function(){var t=this.camera,e=t.target,n=t.distance,r=t.yaw,a=t.pitch;return[e[0]+n*Math.cos(a)*Math.sin(r),e[1]+n*Math.sin(a),e[2]+n*Math.cos(a)*Math.cos(r)]},updateCameraState:function(){if(this.is3dMode){var t=this.getEyePosition(),e=this.camera.target,n=Mt(xt(e,t)),r=Mt(Pt(n,[0,1,0])),a=Mt(Pt(r,n));return this.cameraVectors={eye:t,forward:n,right:r,up:a},this.orthoBounds=null,this.viewMatrix=Ot(t,e,a),void(this.renderMatrix=Lt(Et(this.projection.fov,this.projection.aspect,this.projection.near,this.projection.far),this.viewMatrix))}var i=this.camera.distance/this.resetCamera.distance,s=Math.max(this.orthoBaseHalfHeight*i,.1),l=s*this.projection.aspect,c=Object(o["a"])(this.camera.target,2),u=c[0],d=c[1];this.orthoBounds={left:u-l,right:u+l,top:d+s,bottom:d-s},this.cameraVectors={eye:[u,d,this.camera.distance],forward:[0,0,-1],right:[1,0,0],up:[0,1,0]},this.viewMatrix=vt,this.renderMatrix=Dt(u-l,u+l,d-s,d+s,-Math.max(4*this.pointBounds.radius,10),Math.max(4*this.pointBounds.radius,10))},projectWorldPoint:function(t){if(!this.renderMatrix)return null;var e=jt(this.renderMatrix,t),n=e[3];
1if(Math.abs(n)<dt)return null;var r=e[0]/n,a=e[1]/n,i=e[2]/n,o=this.$refs.umapCanvas;return{x:(.5*r+.5)*o.width,y:(1-(.5*a+.5))*o.height,depth:i,visible:r>=-1&&r<=1&&a>=-1&&a<=1&&i>=-1&&i<=1}},updateProjectedGeometry:function(){var t=this;this.is3dMode?this.projectedPoints=this.points.map((function(e){var n;return t.projectWorldPoint([e.X,e.Y,null!==(n=e.Z)&&void 0!==n?n:0])})):this.projectedPoints=[],this.projectedLabels=this.clusterCenters.map((function(e){var n=t.projectWorldPoint(e.position);return n&&n.visible?Object(s["a"])(Object(s["a"])({},e),{},{projection:n}):null})).filter(Boolean)},requestRender:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&(this.renderProjectionDirty=!0),this.renderQueued||(this.renderQueued=!0,this.rafId=requestAnimationFrame((function(){t.renderQueued=!1,t.rafId=null,t.renderUMAP(),t.syncPending&&(t.syncPending=!1,t.updateViewTransform())})))},scheduleSync:function(){this.syncPending=!0},renderUMAP:function(){this.gl&&this.program&&(this.projection.aspect=this.$refs.umapCanvas.width/Math.max(this.$refs.umapCanvas.height,1),this.updateCameraState(),!this.renderProjectionDirty&&this.interactionMode&&this.is3dMode||(this.updateProjectedGeometry(),this.renderProjectionDirty=!1),this.renderPoints(),this.drawLabels(),this.drawAxisIndicator())},drawAxisIndicator:function(){var t=this,e=this.$refs.axisIndicatorCanvas;if(e){var n=e.getContext("2d"),r=window.devicePixelRatio||1,a=e.width/2,i=.24*e.width,o=.09*e.width;if(n.clearRect(0,0,e.width,e.height),this.is3dMode){var l=[{label:"X",vector:[1,0,0],color:"#d64545"},{label:"Y",vector:[0,1,0],color:"#2e9b46"},{label:"Z",vector:[0,0,1],color:"#2f6fe4"}].map((function(e){var n=Ct(e.vector,t.cameraVectors.right),r=Ct(e.vector,t.cameraVectors.up),a=Ct(e.vector,t.cameraVectors.forward);return Object(s["a"])(Object(s["a"])({},e),{},{screenX:n,screenY:r,depth:a})})).sort((function(t,e){return t.depth-e.depth}));n.font="".concat(11*r,"px Arial"),n.textAlign="center",n.textBaseline="middle",l.forEach((function(t){var e=a+t.screenX*i,s=a-t.screenY*i,l=a+t.screenX*(i+o),c=a-t.screenY*(i+o);n.strokeStyle=t.color,n.lineWidth=2.5*r,n.beginPath(),n.moveTo(a,a),n.lineTo(e,s),n.stroke(),n.fillStyle=t.color,n.beginPath(),n.arc(e,s,3*r,0,2*Math.PI),n.fill(),n.fillText(t.label,l,c)}))}}},bindAttributes:function(t){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t.position),e.enableVertexAttribArray(this.locations.position),e.vertexAttribPointer(this.locations.position,3,e.FLOAT,!1,0,0),e.bindBuffer(e.ARRAY_BUFFER,t.color),e.enableVertexAttribArray(this.locations.color),e.vertexAttribPointer(this.locations.color,4,e.UNSIGNED_BYTE,!0,0,0),e.bindBuffer(e.ARRAY_BUFFER,t.highlight),e.enableVertexAttribArray(this.locations.highlight),e.vertexAttribPointer(this.locations.highlight,1,e.UNSIGNED_BYTE,!0,0,0)},renderPoints:function(){var t=this.gl;t.viewport(0,0,t.canvas.width,t.canvas.height),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),t.useProgram(this.program),t.uniformMatrix4fv(this.locations.matrix,!1,this.renderMatrix);var e=this.is3dMode?yt(Math.max(1.25,4.5-Math.log10(Math.max(this.camera.distance/this.pointBounds.radius,1))),1.25,5):yt(2.2/(this.camera.distance/this.resetCamera.distance),1.15,3),n=!!this.highlightLabel||this.highlightLabels.length>0;this.is3dMode?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.is3dMode&&(this.bindAttributes(this.buffers.axes),t.uniform1f(this.locations.renderPoints,0),t.uniform1f(this.locations.pointSize,1),t.uniform1f(this.locations.hoverScale,1),t.uniform1f(this.locations.minPointScale,1),t.uniform1f(this.locations.maxPointScale,1),t.uniform1f(this.locations.highlightMode,0),t.drawArrays(t.LINES,0,this.axisVertexCount)),this.bindAttributes(this.buffers.points),t.uniform1f(this.locations.renderPoints,1),t.uniform1f(this.locations.pointSize,e*(window.devicePixelRatio||1)),t.uniform1f(this.locations.hoverScale,1),n?(t.uniform1f(this.locations.minPointScale,this.is3dMode?.3:.2),t.uniform1f(this.locations.maxPointScale,this.is3dMode?1.6:2),t.uniform1f(this.locations.highlightMode,2),t.drawArrays(t.POINTS,0,this.vertexCount),t.uniform1f(this.locations.highlightMode,1),t.drawArrays(t.POINTS,0,this.vertexCount)):(t.uniform1f(this.locations.minPointScale,1),t.uniform1f(this.locations.maxPointScale,1),t.uniform1f(this.locations.highlightMode,0),t.drawArrays(t.POINTS,0,this.vertexCount)),this.hoverVertexCount>0&&(this.bindAttributes(this.buffers.hover),t.uniform1f(this.locations.renderPoints,1),t.uniform1f(this.locations.pointSize,1.75*e*(window.devicePixelRatio||1)),t.uniform1f(this.locations.hoverScale,1),t.uniform1f(this.locations.minPointScale,1),t.uniform1f(this.locations.maxPointScale,1),t.uniform1f(this.locations.highlightMode,0),t.drawArrays(t.POINTS,0,this.hoverVertexCount))},drawLabels:function(){var t=this.$refs.umapLabelCanvas,e=t.getContext("2d");e.clearRect(0,0,t.width,t.height),this.showLabels&&(this.is3dMode&&this.interactionMode||(e.font="".concat(14*(window.devicePixelRatio||1),"px Arial"),e.fillStyle="black",e.textAlign="center",e.textBaseline="middle",e.strokeStyle="white",e.lineWidth=5,this.projectedLabels.forEac
1h((function(t){e.strokeText(t.label,t.projection.x,t.projection.y),e.fillText(t.label,t.projection.x,t.projection.y)}))))},panCamera:function(t,e){var n,r,a=this.$refs.umapCanvas;if(this.is3dMode){var i=2*this.camera.distance*Math.tan(this.projection.fov/2)/Math.max(a.height,1);n=i*ft,r=n}else n=this.camera.distance/this.resetCamera.distance*(.0045*this.pointBounds.radius),r=n*(a.width/Math.max(a.height,1));var o=bt(wt(this.cameraVectors.right,-t*r),wt(this.cameraVectors.up,e*n));this.camera.target=bt(this.camera.target,o)},rotateCamera:function(t,e){this.is3dMode&&(this.camera.yaw-=.01*t,this.camera.pitch=yt(this.camera.pitch+.01*e,-Math.PI/2+.05,Math.PI/2-.05))},onWheel:function(t){var e=t.deltaY<0?.9:1.1;this.is3dMode?this.camera.distance=yt(this.camera.distance*e,.2*this.pointBounds.radius,30*this.pointBounds.radius):this.camera.distance=yt(this.camera.distance*e,this.resetCamera.distance*gt,this.resetCamera.distance*mt),this.scheduleSync(),this.requestRender(!0)},onMouseDown:function(t){this.interactionMode=!this.is3dMode||2===t.button||t.shiftKey?"pan":"rotate",this.lastMouse.x=t.clientX,this.lastMouse.y=t.clientY},onMouseMove:function(t){var e=t.clientX-this.lastMouse.x,n=t.clientY-this.lastMouse.y;if(this.interactionMode)return"rotate"===this.interactionMode?this.rotateCamera(e,n):this.panCamera(e,n),this.lastMouse.x=t.clientX,this.lastMouse.y=t.clientY,O.hide(),this.scheduleSync(),void this.requestRender(!1);this.lastMouse.x=t.clientX,this.lastMouse.y=t.clientY,this.isHovering&&this.showTooltips&&this.handleHover(t)},handleHover:function(t){var e=this.$refs.umapCanvas.getBoundingClientRect(),n=this.$refs.umapCanvas.width/Math.max(e.width,1),r=(t.clientX-e.left)*n,a=(t.clientY-e.top)*n;if(!this.is3dMode){var i=this.find2DHoverIndex(r,a);return this.updateHoveredPoint(i),-1===i?void O.hide():void this.showHoverTooltip(i)}for(var o=-1,s=1/0,l=12*(window.devicePixelRatio||1),c=0;c<this.projectedPoints.length;c++){var u=this.projectedPoints[c];if(u&&u.visible){var d=u.x-r,h=u.y-a,p=Math.hypot(d,h);p<l&&p<s&&(s=p,o=c)}}this.updateHoveredPoint(o),-1!==o?this.showHoverTooltip(o):O.hide()},find2DHoverIndex:function(t,e){var n;if(!this.orthoBounds)return-1;var r=this.$refs.umapCanvas,a=this.orthoBounds.left+t/r.width*(this.orthoBounds.right-this.orthoBounds.left),i=this.orthoBounds.top-e/r.height*(this.orthoBounds.top-this.orthoBounds.bottom),o=Math.max((this.orthoBounds.right-this.orthoBounds.left)/r.width*8,(this.orthoBounds.top-this.orthoBounds.bottom)/r.height*8),s=null===(n=ct.getQuadtree(this.group))||void 0===n?void 0:n.find(a,i,o);if(!s)return-1;var l=ct.getPointIndex(this.group,s);return null==l?-1:l},updateHoveredPoint:function(t){this.hoveredPointIndex!==t&&(this.hoveredPointIndex=t,this.updateHoverBuffer(),this.requestRender(!1))},showHoverTooltip:function(t){var e=this,n='<div style="display:grid; grid-template-columns: max-content 1fr; grid-column-gap: 5px; font-size: 12px;">';n+='<div style="font-weight:bold">Cell ID</div><div>'.concat((this.labels.NAME||this.labels.ID)[t],"</div>"),this.expression&&(n+='<div style="font-weight:bold">Expression</div><div>'.concat(this.expression[t],"</div>")),Object.keys(this.labels.metadata_labels).forEach((function(r){if(e.isHoverField(r)){var a=e.labels.metadata_labels[r][e.labels.metadata[r][t]];a&&""!==a&&(n+='<div style="font-weight:bold;">'.concat(r,"</div><div>").concat(a,"</div>"))}})),n+="</div>",O.show(n)},isHoverField:function(t){return!this.hoverFields||0===this.hoverFields.length||this.hoverFields.includes(t)},onMouseOver:function(){this.isHovering=!0},onMouseOut:function(){this.isHovering=!1,this.updateHoveredPoint(-1),O.hide()},onMouseUp:function(){this.interactionMode=null,this.requestRender(!0)},onMouseLeave:function(){this.interactionMode=null,this.isHovering=!1,this.updateHoveredPoint(-1),O.hide(),this.requestRender(!0)},onClick:function(){},resetPanZoom:function(){this.camera={target:Object(u["a"])(this.resetCamera.target),distance:this.resetCamera.distance,yaw:this.resetCamera.yaw,pitch:this.resetCamera.pitch},this.scheduleSync(),this.requestRender(!0)},updateViewTransform:function(){_["a"].$emit("view-transform-change",{id:this.group,viewMode:this.is3dMode?"3d":"2d",camera:{target:Object(u["a"])(this.camera.target),distance:this.camera.distance,yaw:this.camera.yaw,pitch:this.camera.pitch}})},handleUpdateViewTransform:function(t){t.id===this.group&&t.viewMode===(this.is3dMode?"3d":"2d")&&t.camera&&(this.camera={target:Object(u["a"])(t.camera.target),distance:t.camera.distance,yaw:t.camera.yaw,pitch:t.camera.pitch},this.requestRender(!0))},createShader:function(t,e,n){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS)?r:(t.deleteShader(r),null)},createProgram:function(t,e,n){var r=t.createProgram();return t.attachShader(r,e),t.attachShader(r,n),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?r:(t.deleteProgram(r),null)},download:function(){var t=this.$refs.umapCanvas,e=this.$refs.umapLabelCanvas,n=2,r=document.createElement("canvas");r.width=t.width*n,r.height=t.height*n;var a=r.getContext("2d");a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(t,0,0,r.width,r.height),a.drawImage(e,0,0,r.width,r.height);var i=document.createElement("a");i.download="umap.png",i.href=r.toDataURL("image/png"),i.click()}}}),It=At,Tt=(n("a12e"),Object(C["a"])(It,rt,at,!1,null,"51da75aa",null)),Bt=Tt.exports,Rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"chartWrapper",staticStyle:{width:"100%",position:"relative","overflow-x":"hidden"}},[n("div",{ref:"chart"})])},Ft=[],Gt=p["default"].component("research-stacked-bar-plot",{props:{data:{type:null,required:!0},primaryKey:{type:String,required:!0},subsetKey:{type:String,required:!1},facetKey:{type:String,required:!1},highlightKey:{type:String,required:!1},normalize:{type:Boolean,default:!1},stack:{type:Boolean,default:!1},height:{type:Number,default:300},xAxisLabel:{type:String,required:!1},yAxisLabel:{type:String,required:!1},range:{type:Array,required:!1},verticalCategoryLayout:{type:Boolean,default:!1}},data:function(){return{isNormalized:!1,isStacked:!1,eventElements:[],resizeTimeout:null,resizeObserver:null}},watch:{data:function(){this.drawChart()},stack:function(){this.isStacked=this.stack,this.drawChart()},normalize:function(){this.isNormalized=this.normalize,this.drawChart()},verticalCategoryLayout:function(){this.drawChart()},highlightKey:function(t,e){this.doHighlight(t)}},mounted:function(){this.data?this.drawChart():m("no data"),window.addEventListener("resize",this.handleResize),this.initResizeObserver()},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize),this.teardownResizeObserver(),this.eventElements.length>0&&this.removeAllListeners(this.eventElements)},methods:{initResizeObserver:function(){var t,e=this;if("undefined"!==typeof ResizeObserver){var n=(null===(t=this.$refs.chartWrapper)||void 0===t?void 0:t.parentElement)||this.$refs.chartWrapper;n&&(this.resizeObserver=new ResizeObserver((function(){e.handleResize()})),this.resizeObserver.observe(n))}},teardownResizeObserver:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},handleResize:function(){var t=this;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){t.drawChart()}),100)},drawChart:function(){var t=this;if(h["select"](this.$refs.chart).style("position","relative"),m("---StackedBar Plot"),m(" data",this.data),this.data){this.eventElements.length>0&&(this.removeAllListeners(this.eventElements),this.eventElements=[]),m(" settings",{isStacked:this.isStacked,isNormalized:this.isNormalized});var e=this.primaryKey,n=this.subsetKey,r=(this.facetKey,n&&""!=n),a=Array.from(new Set(this.data.map((function(t){return t[e]}))));this.isNormalized=this.normalize,this.isStacked=this.stack,h["select"](this.$refs.chart).html("");var i=h["select"](this.$refs.chart).append("svg"),l=i.append("g").selectAll("text").data(a).enter().append("text").text((function(t){return t})).style("text-anchor","end").attr("font-size","12px").attr("transform","rotate(-55)"),c=l.node().parentNode.getBBox(),u=c.height;h["select"](this.$refs.chart).html("");var p=this.$refs.chartWrapper.parentElement.offsetWidth,f={xAxis:this.xAxisLabel?20:0,yAxis:this.yAxisLabel?20:0},_={top:10,right:10,bottom:u+f.xAxis,left:50},g=p,v=this.height;_.bottom>v/2&&(v=2*_.bottom);var y=g-_.left-_.right-f.xAxis,b=v-_.top-_.bottom-f.yAxis;this.$refs.chartWrapper.style.height=v+"px";var x=[],w={};this.data.forEach((function(t){w[t[e]]||(w[t[e]]=0),w[t[e]]+=t.count})),x=Object.entries(w).map((function(t){var n=Object(o["a"])(t,2),r=n[0],a=n[1];return Object(d["a"])(Object(d["a"])({},e,r),"count",a)}));var C=h["sum"](x,(function(t){return t.count})),P=0,k=this.range?this.range[1]:h["max"](this.data,(function(t){return t.count})),M=0,E=h["max"](x,(function(t){return t.count})),D=function(t){return r?t[e]+" - "+t[n]:t[e]};if(this.verticalCategoryLayout)this.drawVerticalCategoryChart({primaryKey:e,subsetKey:n,hasSubsetKey:r,primaryKeys:a,primaryCounts:x,primarySum:C,min:P,max:k,minPrimary:M,maxPrimary:E,entryKey:D});else{var O=h["select"](this.$refs.chart).append("svg").attr("id","sc_stacked_bar_plot").attr("width",g).attr("height",v);if(this.xAxisLabel){var L=O.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(this.xAxisLabel),j=L.node().getBBox(),S=g-y/2-j.width/2;L.attr("transform","translate(".concat(S,",").concat(v-15,")"))}if(this.yAxisLabel){var A=O.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(this.yAxisLabel),I=A.node().getBBox(),T=_.top+b/2+I.width/2;A.attr("transform","rotate(-90) translate( -".concat(T,", 15)"))}var B,R=O.append("g").attr("transform","translate(".concat(_.left+f.xAxis,",").concat(_.top,")")).attr("class","plot"),F=r?this.data.map((function(t){return t[e]+" - "+t[n]})):a,G=h["scaleBand"]().domain(F).range([5,y]).padding(0);this.isStacked&&(G=h["scaleBand"]().domain([e]).range([5,y]).padding(0)),r&&(B=h["scaleBand"]().domain(a).range([5,y]).padding(0));var W,U=h["scaleLinear"]().domain([P,k]).range([b,0]).nice();if(this.isStacked&&(U=h["scaleLinear"]().domain([0,C]).range([b,0]).nice(!1)),this.isNormalized&&(U=h["scaleLinear"]().domain([0,100]).range([b,0]).nice()),r&&(W=h["scaleLinear"]().domain([this.isNormalized?0:M,this.isNormalized?100:E]).range([b,0]).nice()),R.append("g").attr("transform","translate(0,".concat(b,")")).call(h["axisBottom"](r?B:G)).selectAll("text").style("text-anchor","end").attr("font-size","12px").attr("transform","rotate(-55) translate(-5, 0)"),R.append("g").call(h["axisLeft"](r&&this.isStacked?W:U)),r&&!this.isStacked&&a.forEach((function(t,e){R.append("rect").attr("width",B.bandwidth()).attr("height",b).attr("x",B(t)).attr("class","violin-bg").attr("fill",e%2?"#fff":"#eee")})),r)if(this.isStacked){var q=.6*B.bandwidth();x.forEach((function(r){var a=t.data.filter((function(t){return t[e]===r[e]})),i=B(r[e])+B.bandwidth()/2,o=0;a.forEach((function(a){var l=t.isNormalized?a.count/r.count*100:a.count,c=W(0)-W(l),u=W(o+l),d=R.append("rect").attr("x",i-q/2).attr("y",u).attr("width",q).attr("height",c).attr("fill",a.color).attr("class","bar").attr("data-label","".concat(a[e],",").concat(a[n])),h=d.node(),p=t.isNormalized?Object(s["a"])(Object(s["a"])({},a),{pct:(a.count/r.count*100).toFixed(2)+"%"}):a;t.addListener(h,p),o+=l}))}))}else{var N=.6*G.bandwidth();this.data.forEach((function(r){var a=G(D(r))+G.bandwidth()/2,i=x.find((function(t){return t[e]===r[e]})).count,o=t.isNormalized?r.count/i*100:r.count,l=R.append("rect").attr("x",a-N/2).attr("y",U(o)).attr("width",N).attr("height",b-U(o)).attr("fill",r.color).attr("class","bar").attr("data-label","".concat(r[e],",").concat(r[n])),c=l.node(),u=t.isNormalized?Object(s["a"])(Object(s["a"])({},r),{pct:(r.count/i*100).toFixed(2)+"%"}):r;t.addListener(c,u)}))}else{var K=.6*G.bandwidth();if(this.isStacked){var V=0;this.data.forEach((function(r){var a=t.isNormalized?r.count/C*100:r.count,i=U(0)-U(a),o=U(V+a),l=G(e)+G.bandwidth()/2,c=R.append("rect").attr("x",l-K/2).attr("y",o).attr("width",K).attr("height",i).attr("fill",r.color).attr("class","bar").attr("data-label","".concat(r[e],",").concat(r[n])),u=c.node(),d=t.isNormalized?Object(s["a"])(Object(s["a"])({},r),{pct:(r.count/C*100).toFixed(2)+"%"}):r;t.addListener(u,d),V+=a}))}else this.data.forEach((function(n){var r=G(D(n))+G.bandwidth()/2,a=t.isNormalized?n.count/C*100:n.count,i=R.append("rect").attr("x",r-K/2).attr("y",U(a)).attr("width",K).attr("height",b-U(a)).attr("fill",n.color).attr("class","bar").attr("data-label","".concat(n[e])),o=i.node(),l=t.isNormalized?Object(s["a"])(Object(s["a"])({},n),{pct:(n.count/C*100).toFixed(2)+"%"}):n;t.addListener(o,l)}))}}}},drawVerticalCategoryChart:function(t){var e=this,n=t.primaryKey,r
1=t.subsetKey,a=t.hasSubsetKey,i=t.primaryKeys,o=t.primaryCounts,l=t.primarySum,c=(t.min,t.max),u=(t.minPrimary,t.maxPrimary),d=t.entryKey,p=h["select"](this.$refs.chart),f=p.append("svg"),_=f.append("g").selectAll("text").data(i).enter().append("text").text((function(t){return t})).attr("font-size","12px"),g=_.node().parentNode.getBBox(),m=g.width;p.html("");var v=this.$refs.chartWrapper.parentElement.offsetWidth,y={xAxis:this.xAxisLabel?20:0,yAxis:this.yAxisLabel?20:0},b={top:10,right:10,bottom:40+y.xAxis,left:m+20+y.yAxis},x=18,w=v,C=Math.max(this.height,i.length*x+b.top+b.bottom),P=w-b.left-b.right,k=C-b.top-b.bottom;this.$refs.chartWrapper.style.height=C+"px";var M,E=a&&this.isStacked?this.isNormalized?100:u:this.isStacked?this.isNormalized?100:l:this.isNormalized?100:c,D=h["scaleLinear"]().domain([0,E]).range([0,P]).nice(),O=h["scaleBand"]().domain(a&&!this.isStacked?this.data.map((function(t){return d(t)})):i).range([0,k]).padding(.2);a&&!this.isStacked&&(M=h["scaleBand"]().domain(i).range([0,k]).padding(.2));var L=p.append("svg").attr("id","sc_stacked_bar_plot").attr("width",w).attr("height",C);if(this.xAxisLabel){var j=L.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(this.xAxisLabel),S=j.node().getBBox(),A=b.left+P/2-S.width/2;j.attr("transform","translate(".concat(A,",").concat(C-15,")"))}if(this.yAxisLabel){var I=L.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(this.yAxisLabel),T=I.node().getBBox(),B=b.top+k/2+T.width/2;I.attr("transform","rotate(-90) translate(-".concat(B,", 15)"))}var R=L.append("g").attr("transform","translate(".concat(b.left,",").concat(b.top,")")).attr("class","plot");if(R.append("g").attr("transform","translate(0,".concat(k,")")).call(h["axisBottom"](D)),R.append("g").call(h["axisLeft"](O)).selectAll("text").attr("font-size","12px"),a&&!this.isStacked&&i.forEach((function(t,e){R.append("rect").attr("width",P).attr("height",M.bandwidth()).attr("y",M(t)).attr("class","violin-bg").attr("fill",e%2?"#fff":"#eee")})),a)if(this.isStacked){var F=.75*O.bandwidth();o.forEach((function(t){var a=e.data.filter((function(e){return e[n]===t[n]})),i=O(t[n])+O.bandwidth()/2,o=0;a.forEach((function(a){var l=e.isNormalized?a.count/t.count*100:a.count,c=D(l),u=R.append("rect").attr("x",D(o)).attr("y",i-F/2).attr("width",c).attr("height",F).attr("fill",a.color).attr("class","bar").attr("data-label","".concat(a[n],",").concat(a[r])),d=u.node(),h=e.isNormalized?Object(s["a"])(Object(s["a"])({},a),{pct:(a.count/t.count*100).toFixed(2)+"%"}):a;e.addListener(d,h),o+=l}))}))}else{var G=.75*O.bandwidth();this.data.forEach((function(t){var a=o.find((function(e){return e[n]===t[n]})).count,i=e.isNormalized?t.count/a*100:t.count,l=R.append("rect").attr("x",0).attr("y",O(d(t))+(O.bandwidth()-G)/2).attr("width",D(i)).attr("height",G).attr("fill",t.color).attr("class","bar").attr("data-label","".concat(t[n],",").concat(t[r])),c=l.node(),u=e.isNormalized?Object(s["a"])(Object(s["a"])({},t),{pct:(t.count/a*100).toFixed(2)+"%"}):t;e.addListener(c,u)}))}else{var W=.75*O.bandwidth();if(this.isStacked){var U=0;this.data.forEach((function(t){var a=e.isNormalized?t.count/l*100:t.count,i=R.append("rect").attr("x",D(U)).attr("y",O(n)+(O.bandwidth()-W)/2).attr("width",D(a)).attr("height",W).attr("fill",t.color).attr("class","bar").attr("data-label","".concat(t[n],",").concat(t[r])),o=i.node(),c=e.isNormalized?Object(s["a"])(Object(s["a"])({},t),{pct:(t.count/l*100).toFixed(2)+"%"}):t;e.addListener(o,c),U+=a}))}else this.data.forEach((function(t){var r=e.isNormalized?t.count/l*100:t.count,a=R.append("rect").attr("x",0).attr("y",O(d(t))+(O.bandwidth()-W)/2).attr("width",D(r)).attr("height",W).attr("fill",t.color).attr("class","bar").attr("data-label","".concat(t[n])),i=a.node(),o=e.isNormalized?Object(s["a"])(Object(s["a"])({},t),{pct:(t.count/l*100).toFixed(2)+"%"}):t;e.addListener(i,o)}))}},addListener:function(t,e){var n=this.mouseOverHandler.bind(this,e),r=this.mouseOutHandler.bind(this);t._listeners={mouseOver:n,mouseOut:r},this.eventElements.push(t),t.addEventListener("mouseover",n),t.addEventListener("mouseout",r)},removeListener:function(t){t._listeners&&(t.addEventListener("mouseover",t._listeners.mouseOver),t.addEventListener("mouseout",t._listeners.mouseOut),delete t._listeners)},removeAllListeners:function(t){var e=this;t.forEach((function(t){e.removeListener(t)}))},mouseOverHandler:function(t){var e='<div style="display: grid; grid-template-columns: 1fr max-content; gap:5px; row-gap:2px; font-size:12px;">\n <div style="font-weight:bold;">'.concat(this.primaryKey,":</div> <div>").concat(t[this.primaryKey],'</div>\n <div style="display:').concat(t[this.subsetKey]?"block":"none",';font-weight:bold;">').concat(this.subsetKey,':</div> \n <div style="display:').concat(t[this.subsetKey]?"block":"none",';">').concat(t[this.subsetKey],'</div>\n <div style="font-weight:bold">Count:</div> <div>
1').concat(t.count.toLocaleString(),'</div>\n <div style="display:').concat(t.pct?"block":"none",';font-weight:bold">Pct.:</div> <div style="display:').concat(t.pct?"block":"none",';">').concat(t.pct,"</div>\n </div>");O.show(e)},mouseMoveHandler:function(t){},mouseOutHandler:function(t){O.hide()},doHighlight:function(t){var e=this.$refs.chart.querySelector(".plot");if(e){e.classList.remove("highlighting");var n=this.$refs.chart.querySelectorAll(".plot .bar");if(n.forEach((function(t){t.classList.remove("on")})),t&&""!=t){var r=this.$refs.chart.querySelectorAll('.bar[data-label*="'.concat(t,'"]')),a=!1;r.forEach((function(e){var n=e.dataset.label.split(",");n.includes(t)&&(e.classList.add("on"),a=!0)})),a&&e.classList.add("highlighting")}}}}}),Wt=Gt,Ut=(n("f0da"),Object(C["a"])(Wt,Rt,Ft,!1,null,"6026921e",null)),qt=Ut.exports,Nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"chart",staticClass:"stacked-bar-chart"})},Kt=[],Vt=(n("5db7"),n("73d9"),n("cd1a"),p["default"].component("research-stacked-bar-plot-2",{name:"GroupedStackedBarChart",props:{proportions:{type:Object,required:!0},colors:{type:Object,required:!1},width:{type:Number,default:800},height:{type:Number,default:300},margin:{type:Object,default:function(){return{top:60,right:20,bottom:50,left:60}}}},watch:{proportions:{handler:function(){var t=this;this.$nextTick((function(){t.drawChart()}))},deep:!0,immediate:!0}},methods:{drawChart:function(){var t=this,e=this.$refs.chart;h["select"](e).selectAll("*").remove();var n=this.proportions,r=n.data,a=n.roles,i=a.x,o=a.stack,s=a.facet,l=h["select"](e).append("svg").attr("width",this.width).attr("height",this.height).append("g").attr("transform","translate(".concat(this.margin.left,",").concat(this.margin.top,")")),c=this.width-this.margin.left-this.margin.right,u=this.height-this.margin.top-this.margin.bottom,d=h["nest"]().key((function(t){return t[s]})).entries(r).map((function(t){return{group:t.key,donors:Array.from(new Set(t.values.map((function(t){return t[i]}))))}}));d.sort((function(t,e){return h["ascending"](t.group,e.group)}));var p=d.flatMap((function(t){return t.donors})),f=h["scaleBand"]().domain(p).range([0,c]).padding(.1),_=Array.from(new Set(r.map((function(t){return t[o]})))),g=(h["scaleOrdinal"](h["schemeCategory10"]).domain(_),h["scaleLinear"]().domain([0,1]).range([u,0])),m=h["nest"]().key((function(t){return t[i]})).entries(r);m.forEach((function(e){var n=e.key,r=f(n);if(null!=r){var a=new Map(e.values.map((function(t){return[t[o],t]}))),i=0;_.forEach((function(e){var n=a.get(e),s=n?n.Proportion:0,c=g(i);i+=s;var u=g(i),d=Math.min(c,u),h=Math.abs(c-u);l.append("rect").attr("x",r).attr("y",d).attr("width",f.bandwidth()).attr("height",h).attr("fill",t.colors[o][e])}))}}));var v=h["axisBottom"](f);l.append("g").attr("transform","translate(0, ".concat(u,")")).call(v).selectAll("text").attr("transform","rotate(-45)").style("text-anchor","end");var y=h["axisLeft"](g).ticks(5);l.append("g").call(y),d.forEach((function(t){var e=t.donors[0],n=t.donors[t.donors.length-1],r=f(e),a=f(n)+f.bandwidth(),i=(r+a)/2;l.append("text").attr("x",i).attr("y",-20).attr("text-anchor","middle").attr("font-weight","bold").text(t.group),l.append("line").attr("x1",r).attr("x2",a).attr("y1",-10).attr("y2",-10).attr("stroke","#999").attr("stroke-width",5)}))}}})),zt=Vt,$t=(n("80ca"),Object(C["a"])(zt,Nt,Kt,!1,null,"14f449a7",null)),Ht=($t.exports,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"plotWrapper",staticStyle:{width:"100%",position:"relative","overflow-x":"hidden",display:"flex","flex-direction":"column",gap:"10px"},attrs:{id:t.wrapperId}},[n("svg",{staticClass:"legend-svg",attrs:{width:"230",height:"54",viewBox:"0 0 230 54"}},[n("defs",[n("linearGradient",{attrs:{id:t.legendGradientId,x1:"0%",y1:"0%",x2:"100%",y2:"0%"}},t._l(t.legendGradientStops,(function(t){return n("stop",{key:t.offset,attrs:{offset:t.offset,"stop-color":t.color}})})),1)],1),n("text",{attrs:{x:"0",y:"12","font-family":"Arial","font-size":"11","font-weight":"600",fill:"#333"}},[t._v(t._s(t.legendTitle))]),n("rect",{attrs:{x:"0",y:"18",width:"100",height:"10",rx:"5",fill:"url(#"+t.legendGradientId+")"}}),n("text",{attrs:{x:"0",y:"44","font-family":"Arial","font-size":"11",fill:"#333"}},[t._v(t._s(t.legendMinLabel))]),n("text",{attrs:{x:"100",y:"44","text-anchor":"end","font-family":"Arial","font-size":"11",fill:"#333"}},[t._v(t._s(t.legendMaxLabel))]),n("text",{attrs:{x:"122",y:"12","font-family":"Arial","font-size":"11","font-weight":"600",fill:"#333"}},[t._v("% Cells Expressing")]),t._l(t.legendCircles,(function(t){return n("g",{key:t.cx,attrs:{transform:"translate("+t.cx+", 23)"}}
1,[n("circle",{attrs:{r:"8",fill:"white",stroke:"#ccc"}}),n("circle",{attrs:{r:t.r,fill:"#ccc"}})])})),n("text",{attrs:{x:"122",y:"44","font-family":"Arial","font-size":"11",fill:"#333"}},[t._v("0")]),n("text",{attrs:{x:"227",y:"44","text-anchor":"end","font-family":"Arial","font-size":"11",fill:"#333"}},[t._v("100")])],2),n("div",{ref:"plot"})])}),Yt=[],Zt=p["default"].component("research-dot-plot",{props:{data:{type:Array,required:!0},yKey:{type:String,required:!0},xKey:{type:String,required:!0},xLabel:{type:String,required:!1},yLabel:{type:String,required:!1},sizeKey:{type:String,required:!0},fillKey:{type:String,required:!0},width:{type:Number,default:300},height:{type:Number,default:300},fitToSize:{type:Boolean,default:!1},cellWidth:{type:Number,default:15},highlightKey:{type:String,required:!1},showXLabels:{type:Boolean,default:!0},showYLabels:{type:Boolean,default:!0},showYTicks:{type:Boolean,default:!0},colorScale:{type:String,required:!1,default:"blue"},colorScaleMode:{type:String,required:!1,default:"raw",validator:function(t){return["raw","scaled-per-gene"].includes(t)}},wrapperId:{type:String,required:!1,default:""}},data:function(){return{marginLeft:20,marginRight:20,marginTop:20,marginBottom:20,resizeTimeout:null,resizeObserver:null,colorOptions:{red:h["interpolateReds"],blue:h["interpolate"]("lightgrey","blue")}}},watch:{data:{handler:function(){this.renderPlot()}},highlightKey:function(t,e){this.renderPlot()},colorScale:function(){this.renderPlot()},colorScaleMode:function(){this.renderPlot()}},computed:{currColorOption:function(){return this.colorOptions[this.colorScale]},markerGenesMaxMean:function(){var t=this;return(h["max"](this.data.map((function(e){return e[t.fillKey]})))||0).toFixed(1)},legendTitle:function(){return"scaled-per-gene"===this.colorScaleMode?"Scaled Expression":"Mean Expression"},legendMinLabel:function(){return"0.0"},legendMaxLabel:function(){return"scaled-per-gene"===this.colorScaleMode?"1.0":this.markerGenesMaxMean},legendGradientId:function(){return"".concat(this.wrapperId||"sc-dot-plot","-legend-gradient")},legendGradientStops:function(){var t=this;return h["range"](0,1.01,.1).map((function(e){return{offset:"".concat(100*e,"%"),color:t.currColorOption(e)}}))},legendCircles:function(){return[.2,.4,.6,.8,1].map((function(t,e){return{cx:130+22*e,r:8*t}}))}},mounted:function(){this.renderPlot(),window.addEventListener("resize",this.handleResize),this.initResizeObserver()},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize),this.teardownResizeObserver()},methods:{initResizeObserver:function(){var t,e=this;if("undefined"!==typeof ResizeObserver){var n=(null===(t=this.$refs.plotWrapper)||void 0===t?void 0:t.parentElement)||this.$refs.plotWrapper;n&&(this.resizeObserver=new ResizeObserver((function(){e.handleResize()})),this.resizeObserver.observe(n))}},teardownResizeObserver:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},colorScaleArray:function(){var t=this;return h["range"](0,1.01,.1).map((function(e){return t.currColorOption(e)})).join(", ")},handleResize:function(){var t=this;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){t.renderPlot()}),100)},getColorPlotData:function(){var t=this;if("scaled-per-gene"!==this.colorScaleMode)return this.data.map((function(e){var n;return Object(s["a"])(Object(s["a"])({},e),{},{__dotPlotColorValue:null!==(n=e[t.fillKey])&&void 0!==n?n:0})}));var e=this.data.reduce((function(t,e){var n,r=null!==(n=e.gene)&&void 0!==n?n:"__default__";return t[r]||(t[r]=[]),t[r].push(e),t}),{});return this.data.map((function(n){var r,a,i,o,l=null!==(r=n.gene)&&void 0!==r?r:"__default__",c=e[l]||[],u=c.map((function(e){var n;return null!==(n=e[t.fillKey])&&void 0!==n?n:0})),d=null!==(a=h["min"](u))&&void 0!==a?a:0,p=null!==(i=h["max"](u))&&void 0!==i?i:0,f=null!==(o=n[t.fillKey])&&void 0!==o?o:0,_=p===d?0:(f-d)/(p-d);return Object(s["a"])(Object(s["a"])({},n),{},{__dotPlotColorValue:_})}))},renderPlot:function(){var t=this;if(h["select"](this.$refs.plot).style("position","relative").style("overflow-x","auto"),m("---DotPlot"),m(" data",this.data),m(" keys",{x:this.xKey,y:this.yKey,fill:this.fillKey,size:this.sizeKey}),this.data&&0!==this.data.length)if(this.xKey&&void 0!==this.xKey)if(this.yKey&&void 0!==this.yKey)if(this.fillKey&&void 0!==this.fillKey)if(this.sizeKey&&void 0!==this.sizeKey){var e=this.xKey,n=this.yKey,r
1=Array.from(new Set(this.data.map((function(t){return t[e]})))),a=Array.from(new Set(this.data.map((function(t){return t[n]})))),i=this.fillKey,o=this.sizeKey,s=this.getColorPlotData(),l=s.map((function(t){var e;return null!==(e=t.__dotPlotColorValue)&&void 0!==e?e:0})),c=h["select"](this.$refs.plot).append("svg"),d=c.append("g").selectAll("text").data(r).enter().append("text").text((function(t){return t})).style("text-anchor","end").attr("font-size","12px").attr("transform","rotate(-55)"),p=d.node().parentNode.getBBox(),f=p.height+10;h["select"](this.$refs.plot).html("");var _=h["select"](this.$refs.plot).append("svg"),g=_.append("g").selectAll("text").data(a).enter().append("text").text((function(t){return t})).attr("font-size","12px"),v=g.node().parentNode.getBBox(),y=v.width+10;h["select"](this.$refs.plot).html("");var b=this.$refs.plotWrapper.offsetWidth,x={top:this.showXLabels?f+this.marginTop:0,bottom:this.marginBottom,right:this.marginRight,left:(this.showYLabels?y:0)+(this.yLabel||this.yKey?this.marginLeft:0)},w=0,C=0,P=0,k=0,M=0;this.fitToSize?(w=b,P=w-x.left-x.right,M=P/r.length,M>this.cellWidth&&(M=this.cellWidth,P=r.length*M,w=P+x.left+x.right),k=a.length*M,C=k+x.top+x.bottom):(M=this.cellWidth,P=r.length*M,w=P+x.left+x.right,k=a.length*M,C=k+x.top+x.left),M<13&&(M=13,P=r.length*M,w=P+x.left+x.right,k=a.length*M,C=k+x.top+x.bottom),this.$refs.plotWrapper.style.height="".concat(C+64,"px");var E=h["scaleBand"]().range([x.top,C-x.bottom]).domain(a).padding(.1),D=h["scaleBand"]().range([x.left,w-x.right]).domain(r).padding(.1),L=h["scaleLinear"]().range([1,D.bandwidth()/2]).domain([0,100]).nice(),j=h["scaleSequential"](this.currColorOption).domain([0,h["max"](l)||0]),S=h["select"](this.$refs.plot).append("svg").attr("id","sc_dot_plot").attr("width",w).attr("height",C);if(this.showXLabels){var A=S.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(this.xLabel?this.xLabel:this.xKey),I=A.node().getBBox(),T=w-P/2-I.width/2;A.attr("transform","translate(".concat(T,", 10)"))}var B=S.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(this.yLabel?this.yLabel:this.yKey),R=B.node().getBBox(),F=x.top+k/2+R.width/2;if(B.attr("transform","rotate(-90) translate( -".concat(F,", 10)")),this.showXLabels){var G=S.append("g").attr("transform","translate(0, ".concat(x.top,")")).call(h["axisTop"](D).tickSizeOuter(0));G.select(".domain").remove(),G.selectAll("text").attr("font-family","Arial").style("text-anchor","start").attr("transform","rotate(-55) translate(5, 5)")}if(this.showYLabels||this.showYTicks){var W=S.append("g").attr("transform","translate(".concat(x.left,",0)")).call(h["axisLeft"](E).tickSizeOuter(0));W.select(".domain").remove(),this.showYLabels||W.selectAll("text").remove(),W.selectAll("text").attr("font-family","Arial")}var U=Math.max.apply(Math,Object(u["a"])(s.map((function(t){var e;return null!==(e=t[o])&&void 0!==e?e:0}))))<=1?100:1,q=S.append("g");s.forEach((function(r,a){var s=q.append("circle").attr("cx",D(r[e])+D.bandwidth()/2).attr("cy",E(r[n])+E.bandwidth()/2).attr("r",L(100)).style("stroke","#ccc").attr("stroke-width","0.5").style("fill","#f9f9f9").attr("data-key",r[n]).attr("fill-opacity",""===t.highlightKey||t.highlightKey===r.key?"1":"0.1").node();q.append("circle").attr("cx",D(r[e])+D.bandwidth()/2).attr("cy",E(r[n])+E.bandwidth()/2).attr("r",L(r[o]*U)).style("fill",j(r.__dotPlotColorValue)).style("pointer-events","none").attr("data-key",r[n]).attr("fill-opacity",""===t.highlightKey||t.highlightKey===r[n]?"1":"0.1"),s.addEventListener("mouseover",function(t){var a="scaled-per-gene"===this.colorScaleMode?'<div style="font-weight:bold">Scaled Expr.</div> <div>'.concat(r.__dotPlotColorValue.toFixed(4),"</div>"):"",s='<div style="display: grid; grid-template-columns: 1fr max-content; gap:5px; row-gap:2px; font-size:12px;">\n <div style="font-weight:bold">'.concat(e,"</div> <div>").concat(r[e],'</div>\n <div style="font-weight:bold">').concat(n,"</div> <div>").concat(r[n],'</div>\n <div style="font-weight:bold">Mean Expr.</div> <div>').concat(r[i].toFixed(4),"</div>\n ").concat(a,'\n <div style="font-weight:bold">% Expr.</div> <div>').concat((r[o]*U).toFixed(4),"</div>\n </div>");O.show(s)}.bind(t)),s.addEventListener("mouseout",(function(t){O.hide()}))})),S.selectAll("text").style("font-size","12px").attr("font-family","Arial")}else m(" sizeKey required");else m(" fillKey required");else m(" yKey required");else m(" xKey required");else m(" expression data required")}}}),Xt=Zt,Jt=(n("97f3"),Object(C["a"])(Xt,Ht,Yt,!1,null,"502ade1a",null)),Qt=Jt.exports,te=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"chartWrapper",staticStyle:{width:"100%",position:"relative","overflow-x":"hidden"}},[n("div",{ref:"chart"})])}
1,ee=[],ne=p["default"].component("research-violin-plot",{props:{data:{type:null,required:!0},primaryKey:{type:String,required:!0},subsetKey:{type:String,required:!1,default:null},width:{type:Number,requred:!1,default:600},height:{type:Number,requred:!1,default:300},highlightKey:{type:String,required:!1},colors:{type:Object,required:!1},yAxisLabel:{type:String,required:!1},xAxisLabel:{type:String,required:!1},range:{type:Array,required:!1},showViolins:{type:Boolean,default:!0},facetRows:{type:Boolean,default:!1},facetRowHeight:{type:Number,default:55},facetRowGap:{type:Number,default:6},facetAxisLabel:{type:String,required:!1}},computed:{primaryAxisLabel:function(){return this.facetRows?this.yAxisLabel:this.xAxisLabel},valueAxisLabel:function(){return this.facetRows?this.xAxisLabel:this.yAxisLabel},facetLabelText:function(){return this.facetRows?this.facetAxisLabel:null}},data:function(){return{eventElements:[],resizeTimeout:null,resizeObserver:null}},watch:{data:function(){this.drawChart()},highlightKey:function(t){this.doHighlight(t)},facetRowHeight:function(){this.drawChart()},facetRowGap:function(){this.drawChart()},facetAxisLabel:function(){this.drawChart()}},mounted:function(){this.data?this.drawChart():m("no data"),window.addEventListener("resize",this.handleResize),this.initResizeObserver()},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize),this.teardownResizeObserver(),this.eventElements.length>0&&this.removeAllListeners(this.eventElements)},methods:{initResizeObserver:function(){var t,e=this;if("undefined"!==typeof ResizeObserver){var n=(null===(t=this.$refs.chartWrapper)||void 0===t?void 0:t.parentElement)||this.$refs.chartWrapper;n&&(this.resizeObserver=new ResizeObserver((function(){e.handleResize()})),this.resizeObserver.observe(n))}},teardownResizeObserver:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},handleResize:function(){var t=this;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){t.drawChart()}),100)},drawChart:function(){var t=this;if(h["select"](this.$refs.chart).style("position","relative"),m("---Violin Plot"),m(" data",this.data),this.data){this.eventElements.length>0&&(this.removeAllListeners(this.eventElements),this.eventElements=[]);var e=this.primaryKey,n=this.subsetKey,r=n,a=Array.from(new Set(this.data.map((function(t){return t[e]})))),i=r?Array.from(new Set(this.data.map((function(t){return t[n]})))):[],o=Boolean(this.facetRows&&r),s=this.range?this.range[0]:h["min"](this.data,(function(t){return t.min})),l=this.range?this.range[1]:h["max"](this.data,(function(t){return t.max}));h["select"](this.$refs.chart).html("");var c=h["select"](this.$refs.chart).append("svg"),u=c.append("g").selectAll("text").data(a).enter().append("text").text((function(t){return t})).style("text-anchor","end").attr("font-size","12px").attr("transform","rotate(-55)"),d=u.node().parentNode.getBBox(),p=d.height,f=0;if(this.primaryAxisLabel){var _=c.append("g").append("text").text(this.primaryAxisLabel).attr("font-size","12px");f=_.node().getBBox().height}var g=0;if(o&&i.length){var v=c.append("g").selectAll("text").data(i).enter().append("text").text((function(t){return t})).attr("font-size","12px");g=h["max"](v.nodes().map((function(t){return t.getBBox().width})))||0}var y=0;if(o){var b=h["scaleLinear"]().domain([s,l]).nice().ticks(4).map((function(t){return"".concat(t)})),x=c.append("g").selectAll("text").data(b).enter().append("text").text((function(t){return t})).attr("font-size","12px");y=h["max"](x.nodes().map((function(t){return t.getBBox().width})))||0}h["select"](this.$refs.chart).html("");var w,C,P,k,M,E=this.$refs.chartWrapper.parentElement.offsetWidth,D=E;if(o){var O=this.facetLabelText?28:0,L=this.valueAxisLabel?28:0,j=g>0?14:0,S=y>0?y+12:0,A=Math.max(0,i.length-1)*this.facetRowGap;M={top:10,right:L+S+8,bottom:p+(this.primaryAxisLabel?f+24:0),left:O+g+j+8},w=i.length*this.facetRowHeight+A+M.top+M.bottom,C=D-M.left-M.right,P=i.length*this.facetRowHeight+A,k=M.left}else{var I={xAxis:this.primaryAxisLabel?20:0,yAxis:this.valueAxisLabel?20:0};M={top:10,right:10,bottom:p+I.xAxis,left:40},w=this.height,M.bottom>w/2&&(w=2*M.bottom),C=D-M.left-M.right-I.xAxis,P=w-M.top-M.bottom-I.yAxis,k=M.left+I.xAxis}this.$refs.chartWrapper.style.height=w+"px";var T=h["select"](this.$refs.chart).append("svg").attr("id","sc_violin_plot").attr("width",D).attr("height",w);if(o)this.valueAxisLabel&&T.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").attr("text-anchor","middle").text(this.valueAxisLabel).attr("transform","translate(".concat(D-14,", ").concat(M.top+P/2,") rotate(90)")),this.facetLabelText&&T.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").attr("text-anchor","middle").text(this.facetLabelText).attr("transform","translate(18, ".concat(M.top+P/2,") rotate(-90)"));else if(this.primaryAxisLabel){var B=T.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(this.primaryAxisLabel),R=B.node().getBBox(),F=M.top+P/2+R.width/2;B.attr("transform","rotate(-90) translate( -".concat(F,", 15)"))}if(o?this.primaryAxisLabel:this.valueAxisLabel){var G=T.append("g").append("text").attr("style","font-size:12px; opacity:0.5; font-family: Arial;").attr("class","chart-label").text(o?this.primaryAxisLabel:this.valueAxisLabel),W=G.node().getBBox(),U=k+C/2-W.width/2;G.attr("transform","translate(".concat(U,",").concat(w-15,")"))}var q,N=T.append("g").attr("transform","translate(".concat(k,",").concat(M.top,")")).attr("class","plot"),K=function(t){return r?t[e]+" - "+t[n]:t[e]},V=h["scaleBand"]().domain(a).range([o?0:5,C]).padding(o?.1:0);if(r&&!o){var z=this.data.map((function(t){return t[e]+" - "+t[n]}));q=h["scaleBand"]().domain(z).range([5,C]).padding(0)}var $=h["scaleLinear"]().domain([s,l]).range([o?this.facetRowHeight:P,0]).nice();o?N.append("g").attr("transform","translate(0,".concat(P,")")).call(h["axisBottom"](V)).selectAll("text").style("text-anchor","end").attr("font-size","12px").attr("transform","rotate(-55) translate(-5, 0)"):(N.append("g").attr("transform","translate(0,".concat(P,")")).call(h["axisBottom"](V)).selectAll("text").style("text-anchor","end").attr("font-size","12px").attr("transform","rotate(-55) translate(-5, 0)"),N.append("g").call(h["axisLeft"]($)));var H=o?V.bandwidth():r&&q?q.bandwidth():V.bandwidth(),Y=.6*H;if(r&&!o&&a.forEach((function(t,e){N.append("rect").attr("width",V.bandwidth()).attr("height",P).attr("x",V(t)).attr("class","violin-bg").attr("fill",e%2?"#fff":"#eee")})),o){var Z=this.facetRowHeight,X=this.facetRowGap,J=$.range()[0],Q=Math.max(2,Math.min(4,Math.floor(this.facetRowHeight/18))),tt=this.data.reduce((function(t,e){var r=e[n];return t[r]||(t[r]=[]),t[r].push(e),t}),{});
1i.forEach((function(n,a){var i=a*(Z+X),o=N.append("g").attr("transform","translate(0,".concat(i,")")).attr("class","facet-row");o.append("rect").attr("width",C).attr("height",J).attr("fill",a%2?"#fff":"#f7f7f7"),o.append("g").attr("transform","translate(".concat(C,",0)")).call(h["axisRight"]($).ticks(Q)).call((function(t){return t.selectAll("text").attr("font-size","12px").style("text-anchor","start")})).call((function(t){return t.selectAll(".tick line").attr("x2",6)})),o.append("line").attr("x1",0).attr("x2",C).attr("y1",J).attr("y2",J).attr("stroke","#000"),T.append("text").attr("x",k-8).attr("y",M.top+i+J/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("style","font-size:12px; font-weight:normal;").text(n);var s=tt[n]||[];s.forEach((function(n){var a=V(n[e])+V.bandwidth()/2;t.drawEntry(o,n,a,Y,$,r)}))}))}else this.data.forEach((function(e){var n=r?q(K(e))+q.bandwidth()/2:V(K(e))+V.bandwidth()/2;t.drawEntry(N,e,n,Y,$,r)}))}},drawEntry:function(t,e,n,r,a,i){var o=this.primaryKey,s=this.subsetKey,l=t.append("g").attr("width",r).attr("class","bar").attr("data-label","".concat(e[o],",").concat(i?e[s]:"")),c=l.node();if(this.addListener(c,e),this.showViolins&&e.exprValues){var u=.4,d=e.exprValues[0]||0,p=e.exprValues[e.exprValues.length-1]||0,f=h["ticks"](d,p,50),_=this.kde(this.epanechnikovKernel(u),f,e.exprValues),g=r/1.5,m=h["max"](_,(function(t){return t[1]})),v=h["scaleLinear"]().domain([-m,m]).range([-g,g]),y=h["line"]().x((function(t){return v(t[1])+n})).y((function(t){return a(t[0])})),b=_.map((function(t){return[t[0],-t[1]]})).reverse();l.append("path").datum(_.concat(b)).attr("d",y).attr("fill",e.color).attr("stroke","none")}e.rawPoints&&e.rawPoints.forEach((function(t){l.append("circle").attr("cx",n).attr("cy",a(t.proportion)).attr("r",4).attr("stroke","white").attr("fill","black")}));var x=this.showViolins?r/8:r/4,w=this.showViolins?r/4:r/2;l.append("rect").attr("x",n-x).attr("y",a(e.q3)).attr("width",w).attr("height",Math.max(0,a(e.q1)-a(e.q3))).attr("fill",this.colors?this.colors[e[o]]:"transparent").attr("stroke","black"),l.append("line").attr("x1",n-r/4).attr("x2",n+r/4).attr("y1",a(e.median)).attr("y2",a(e.median)).attr("stroke","black").attr("stroke-width",2),l.append("line").attr("x1",n).attr("x2",n).attr("y1",a(e.min)).attr("y2",a(e.q1)).attr("stroke","black"),l.append("line").attr("x1",n).attr("x2",n).attr("y1",a(e.q3)).attr("y2",a(e.max)).attr("stroke","black"),l.append("line").attr("x1",n-r/4).attr("x2",n+r/4).attr("y1",a(e.min)).attr("y2",a(e.min)).attr("stroke","black"),l.append("line").attr("x1",n-r/4).attr("x2",n+r/4).attr("y1",a(e.max)).attr("y2",a(e.max)).attr("stroke","black"),l.append("rect").attr("x",n-r/2).attr("y",a(e.max)).attr("width",r).attr("height",a(e.min)-a(e.max)).attr("fill","transparent").style("pointer-events","all")},kde:function(t,e,n){return e.map((function(e){return[e,n.reduce((function(n,r){return n+t(e-r)}),0)]}))},epanechnikovKernel:function(t){return function(e){return e/=t,Math.abs(e)<=1?.75*(1-e*e)/t:0}},addListener:function(t,e){var n=this.mouseOverHandler.bind(this,e),r=this.mouseOutHandler.bind(this);t._listeners={mouseOver:n,mouseOut:r},this.eventElements.push(t),t.addEventListener("mouseover",n),t.addEventListener("mouseout",r)},removeListener:function(t){t._listeners&&(t.removeEventListener("mouseover",t._listeners.mouseOver),t.removeEventListener("mouseout",t._listeners.mouseOut),delete t._listeners)},removeAllListeners:function(t){var e=this;t.forEach((function(t){e.removeListener(t)}))},mouseOverHandler:function(t){var e='<div style="display: grid; grid-template-columns: 1fr max-content; gap:5px; row-gap:2px; font-size:12px;">\n <div style="font-weight:bold;">'.concat(this.primaryKey,":</div> <div>").concat(t[this.primaryKey],'</div>\n <div style="display:').concat(this.subsetKey?"block":"none",';font-weight:bold;">').concat(this.subsetKey,':</div> \n <div style="display:').concat(this.subsetKey?"block":"none",';">').concat(t[this.subsetKey],'</div>\n <div style="font-weight:bold">Gene:</div> <div>').concat(t.gene,'</div>\n <div style="font-weight:bold">Max:</div> <div>').concat(t.max.toFixed(4),'</div>\n <div style="font-weight:bold">Q3:</div> <div>').concat(t.q3.toFixed(4),'</div>\n <div style="font-weight:bold">Median:</div> <div>').concat(t.median.toFixed(4),'</div>\n <div style="font-weight:bold">Q1:</div> <div>').concat(t.q1.toFixed(4),'</div>\n <div style="font-weight:bold">Min:</div> <div>').concat(t.min.toFixed(4),"</div>\n </div>");O.show(e)},mouseOutHandler:function(t){O.hide()},doHighlight:function(t){var e=this.$refs.chart.querySelector(".plot");if(e){e.classList.remove("highlighting");var n=this.$refs.chart.querySelectorAll(".plot .bar");
vendor: 4,912 bytes, line 1
1if(n.forEach((function(t){t.classList.remove("on")})),t&&""!=t){var r=this.$refs.chart.querySelectorAll('.bar[data-label*="'.concat(t,'"]')),a=!1;r.forEach((function(e){var n=e.dataset.label.split(",");n.includes(t)&&(e.classList.add("on"),a=!0)})),a&&e.classList.add("highlighting")}}}}}),re=ne,ae=(n("8160"),Object(C["a"])(re,te,ee,!1,null,"78d55a46",null)),ie=ae.exports,oe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"chartWrapper",staticStyle:{width:"100%",position:"relative","overflow-x":"hidden"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:"svg"===t.renderAs,expression:"renderAs === 'svg'"}],ref:"chart"}),n("canvas",{directives:[{name:"show",rawName:"v-show",value:"canvas"===t.renderAs,expression:"renderAs === 'canvas'"}],ref:"canvas"})])},se=[];function le(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */le=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new j(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};u(x,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(S([])));C&&C!==n&&r.call(C,s)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),u(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Prom
1ise);var o=new M(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),u(P,c,"Generator"),u(P,s,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var ce=p["default"].component("research-scatter-plot",{props:{data:Array,xKey:String,yKey:String,xLabel:String,yLabel:String,yDomain:{type:Array},width:{type:Number,default:300},height:{type:Number,default:300},renderAs:{type:String,default:"svg"},opacity:{type:Number,default:1},drawFit:{type:Boolean,default:!0},drawCI:{type:Boolean,default:!0},ci:{type:Number,default:1.96}},data:function(){return{margin:{top:20,right:20,bottom:40,left:50},xScale:null,yScale:null,chartW:0,chartH:0,resizeTimeout:null,computedWidth:0,resizeObserver:null}},watch:{data:function(t){this.initPlot()}},mounted:function(){this.initPlot(),window.addEventListener("resize",this.handleResize),this.initResizeObserver()},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize),this.teardownResizeObserver()},methods:{initResizeObserver:function(){var t,e=this;if("undefined"!==typeof ResizeObserver){var n=(null===(t=this.$refs.chartWrapper)||void 0===t?void 0:t.parentElement)||this.$refs.chartWrapper;n&&(this.resizeObserver=new ResizeObserver((function(){e.handleResize()})),this.resizeObserver.observe(n))}},teardownResizeObserver:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},handleResize:function(){var t=this;clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){t.initPlot()}),100)},linearRegression:function(t){var e=this,n=t.length;if(n<2)return null;for(var r=h["sum"](t,(function(t){return t[e.xKey]})),a=h["sum"](t,(function(t){return t[e.yKey]})),i=r/n,o=a/n,s=0,l=0,c=0;c<n;c++){var u=t[c][this.xKey]-i;s+=u*(t[c][this.yKey]-o),l+=u*u}var d=s/l,p=o-d*i;return{slope:d,intercept:p}},computeConfidenceBand:function(t,e,n,r){var a=this,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.ci,o=t.length,s=h["mean"](t,(function(t){return t[a.xKey]})),l=h["sum"](t,(function(t){var r=t[a.xKey],i=t[a.yKey],o=e*r+n;return Math.pow(i-o,2)}
1))/(o-2);return r.map((function(r){var c=Math.sqrt(l*(1/o+Math.pow(r-s,2)/h["sum"](t,(function(t){return Math.pow(t[a.xKey]-s,2)})))),u=e*r+n;return{x:r,yLow:u-i*c,yHigh:u+i*c}}))},initPlot:function(){this.initScales(),"canvas"===this.renderAs?this.renderCanvas():this.renderSVG()},initScales:function(){var t=this,e=this.$refs.chartWrapper.parentElement.offsetWidth;this.computedWidth=e,this.chartW=this.computedWidth-this.margin.left-this.margin.right,this.chartH=this.height-this.margin.top-this.margin.bottom,this.xScale=h["scaleLinear"]().domain(h["extent"](this.data,(function(e){return e[t.xKey]}))).range([0,this.chartW]),this.yScale=h["scaleLinear"]().domain(this.yDomain||h["extent"](this.data,(function(e){return e[t.yKey]}))).range([this.chartH,0])},drawAxesCanvas:function(t){var e=this;t.save(),t.translate(this.margin.left,this.margin.top),t.strokeStyle="#000",t.lineWidth=1,t.font="11px Arial",t.fillStyle="rgba(0,0,0,1)",t.textAlign="center",t.beginPath(),t.moveTo(0,this.chartH),t.lineTo(this.chartW,this.chartH),t.stroke();var n=this.xScale.ticks(Math.max(2,Math.floor(this.chartW/20)));n.forEach((function(n){var r=e.xScale(n);t.beginPath(),t.moveTo(r,e.chartH),t.lineTo(r,e.chartH+4),t.stroke(),t.fillText(n,r,e.chartH+14)})),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.chartH),t.stroke(),t.textAlign="right",t.textBaseline="middle";var r=this.yScale.ticks(Math.max(2,Math.floor(this.chartH/20)));r.forEach((function(n){var r=e.yScale(n);t.beginPath(),t.moveTo(-4,r),t.lineTo(0,r),t.stroke(),t.fillText(n,-6,r)})),t.font="12px Arial",t.fillStyle="rgba(0,0,0,0.5)",this.xLabel&&(t.textAlign="center",t.textBaseline="top",t.fillText(this.xLabel,this.chartW/2,this.chartH+25)),this.yLabel&&(t.save(),t.rotate(-Math.PI/2),t.textAlign="center",t.textBaseline="top",t.fillText(this.yLabel,-this.chartH/2,-50),t.restore()),t.restore()},drawPointsCanvas:function(t){var e=this;t.save(),t.translate(this.margin.left,this.margin.top),this.data.forEach((function(n){t.beginPath(),t.arc(e.xScale(n[e.xKey]),e.yScale(n[e.yKey]),2,0,2*Math.PI),t.fillStyle="rgba(128,128,128,".concat(e.opacity,")"),t.fill()})),t.restore()},drawTrendlineCanvas:function(t){var e=this,n=this.linearRegression(this.data);if(n){var r=h["extent"](this.data,(function(t){return t[e.xKey]})),a=h["range"](r[0],r[1],(r[1]-r[0])/100),i=this.computeConfidenceBand(this.data,n.slope,n.intercept,a),o=r.map((function(t){return{x:e.xScale(t),y:e.yScale(n.slope*t+n.intercept)}}));t.save(),t.translate(this.margin.left,this.margin.top),this.drawCI&&(t.beginPath(),t.moveTo(this.xScale(i[0].x),this.yScale(i[0].yLow)),i.forEac
1h((function(n){t.lineTo(e.xScale(n.x),e.yScale(n.yLow))})),i.slice().reverse().forEach((function(n){t.lineTo(e.xScale(n.x),e.yScale(n.yHigh))})),t.closePath(),t.fillStyle="rgba(0, 0, 0, 0.1)",t.fill()),t.beginPath(),t.moveTo(o[0].x,o[0].y),t.lineTo(o[1].x,o[1].y),t.strokeStyle="red",t.lineWidth=1,t.stroke(),t.restore()}},renderCanvas:function(){var t=this,e=window.devicePixelRatio||1,n=this.$refs.canvas,r=n.getContext("2d");n.width=this.computedWidth*e,n.height=this.height*e,n.style.width=this.computedWidth+"px",n.style.height=this.height+"px",r.setTransform(1,0,0,1,0,0),r.scale(e,e),r.clearRect(0,0,this.computedWidth,this.height),this.drawAxesCanvas(r),this.drawPointsCanvas(r),this.drawFit&&this.drawTrendlineCanvas(r),n.onmousemove=function(e){var r=n.getBoundingClientRect(),a=e.clientX-r.left-t.margin.left,i=e.clientY-r.top-t.margin.top,o=t.data.find((function(e){var n=t.xScale(e[t.xKey])-a,r=t.yScale(e[t.yKey])-i;return n*n+r*r<16}));o?t.mouseOverHandler(o):t.mouseOutHandler()}},renderSVG:function(){var t=this;return Object(c["a"])(le().mark((function e(){var n,r,a,i,o,s,l,c,u,d,p;return le().wrap((function(e){while(1)switch(e.prev=e.next){case 0:h["select"](t.$refs.chart).html(""),n=h["select"](t.$refs.chart).append("svg").attr("width",t.computedWidth).attr("height",t.height),r=n.append("g").attr("transform","translate(".concat(t.margin.left,",").concat(t.margin.top,")")),a=Math.max(2,Math.floor(t.chartW/20)),i=Math.max(2,Math.floor(t.chartH/20)),r.append("g").attr("transform","translate(0,".concat(t.chartH,")")).call(h["axisBottom"](t.xScale).ticks(a)).selectAll("text").attr("font-family","Arial"),r.append("g").call(h["axisLeft"](t.yScale).ticks(i)).selectAll("text").attr("font-family","Arial"),t.xLabel&&r.append("text").attr("x",t.chartW/2).attr("y",t.chartH+35).attr("text-anchor","middle").attr("font-size","12px").attr("font-family","Arial").attr("fill","rgba(0,0,0,0.5)").text(t.xLabel),t.yLabel&&r.append("text").attr("transform","rotate(-90)").attr("x",-t.chartH/2).attr("y",-40).attr("text-anchor","middle").attr("font-size","12px").attr("font-family","Arial").attr("fill","rgba(0,0,0,0.5)").text(t.yLabel),r.selectAll("circle").data(t.data).enter().append("circle").attr("cx",(function(e){return t.xScale(e[t.xKey])})).attr("cy",(function(e){return t.yScale(e[t.yKey])})).attr("r",2).attr("fill","gray").attr("fill-opacity",t.opacity).on("mouseover",(function(e){t.mouseOverHandler(e)})).on("mouseout",(function(e){t.mouseOutHandler()})),t.drawFit&&(o=t.linearRegression(t.data),o&&(s=h["extent"](t.data,(function(e){return e[t.xKey]})),t.drawCI&&(l=h["range"](s[0],s[1],(s[1]-s[0])/100),c=t.computeConfidenceBand(t.data,o.slope,o.intercept,l),u=h["area"]().x((function(e){return t.xScale(e.x)})).y0((function(e){return t.yScale(e.yLow)})).y1((function(e){return t.yScale(e.yHigh)})),r.append("path").datum(c).attr("fill","rgba(0, 0, 0, 0.1)").attr("d",u).style("pointer-events","none")),d=s.map((function(t){return{x:t,y:o.slope*t+o.intercept}})),p=h["line"]().x((function(e){return t.xScale(e.x)})).y((function(e){return t.yScale(e.y)})),r.append("path").datum(d).attr("d",p).attr("stroke","red").attr("stroke-width",1).attr("fill","none").style("pointer-events","none")));case 11:case"end":return e.stop()}}),e)})))()},mouseOverHandler:function(t){var e='<div style="display: grid; grid-template-columns: 1fr max-content; gap:5px; row-gap:2px; font-size:12px;">\n <div style="font-weight:bold">'.concat(this.xKey,":</div><div>").concat(t[this.xKey],'</div>\n <div style="font-weight:bold">').concat(this.yKey,":</div><div>").concat(t[this.yKey].toFixed(3),"</div>\n </div>");O.show(e)},mouseOutHandler:function(t){O.hide()}}}),ue=ce,de=Object(C["a"])(ue,oe,se,!1,null,null,null),he=de.exports,pe=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{display:"flex",flex:"1"}},["list"===t.layout?n("div",{staticClass:"list-container",class:[t.listDirection,t.listAlignment]},t._l(t.listData,(function(e){return n("div",{key:e,staticClass:"list-option",attrs:{"data-label":e},on:{click:function(n){return t.colorLabel(n,e)}}},[n("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip:hover.left.window",value:"isolate label",expression:"'isolate label'",arg:"hover",modifiers:{left:!0,window:!0}}],staticClass:"colorize-option",class:[t.labelIsolated(t.coloredOption,e),{selected:e===t.selectedOption}]},[n("svg",{attrs:{width:"1em",viewBox:"0 -0.5 17 17",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M3 10.333C3 13.463 5.427 16 8.418 16 11.41 16 14 13.463 14 10.333 14 7.204 8.418 0 8.418 0S3 7.204 3 10.333Z",fill:t.colors?t.colors[t.selectedOption][e]:e===t.selectedOption?"#434343":"#ccc"}})])]),n("div",{staticClass:"option-label",attrs:{title:e},on:{mouseover:function(n){return t.emitHover(e)},mouseout:function(e){return t.emitHover("")}}},[t._v(t._s(e))])])})),0):t._e(),"dropdown"===t.layout?n("div",{staticClass:"dropdown-container"},[n("div",{staticClass:"dropdown-group"},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedOption,expression:"selectedOption"}],staticStyle:{width:"100%"},on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,
1(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.selectedOption=e.target.multiple?n:n[0]},function(e){return t.selectOption(e.target.value)}]}},[n("option",{attrs:{value:""}},[t._v("--Select--")]),t._l(t.filteredData,(function(e,r){return n("option",{domProps:{value:r}},[t._v(" "+t._s(t.displayLabel(r))+" ")])}))],2)])]):t._e(),"dropdown-list"===t.layout?n("div",{staticClass:"dropdown-container"},[n("div",{staticClass:"dropdown-group"},[n("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip:hover.left",value:"color all labels",expression:"'color all labels'",arg:"hover",modifiers:{left:!0}}],staticClass:"colorize-option on",on:{click:function(e){return t.colorOption(t.selectedOption)}}},[n("svg",{attrs:{width:"1em",viewBox:"0 -0.5 17 17",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M3 10.333C3 13.463 5.427 16 8.418 16 11.41 16 14 13.463 14 10.333 14 7.204 8.418 0 8.418 0S3 7.204 3 10.333Z",fill:"#434343"}})])]),t.showSelect?[n("select",{directives:[{name:"model",rawName:"v-model",value:t.selectedOption,expression:"selectedOption"}],staticStyle:{width:"100%"},on:{change:[function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.selectedOption=e.target.multiple?n:n[0]},function(e){return t.selectOption(e.target.value)}]}},[n("option",{attrs:{value:""}},[t._v("--Select--")]),t._l(t.filteredData,(function(e,r){return n("option",{domProps:{value:r}},[t._v(" "+t._s(t.displayLabel(r))+" ")])}))],2)]:[n("div",{staticStyle:{"font-size":"16px","font-weight":"bold"}},[t._v(t._s(t.selectedOption))])]],2),n("div",{staticClass:"dropdown-content"},t._l(t.data[t.selectedOption],(function(e){return n("div",{key:e,staticClass:"dropdown-option",on:{click:function(n){return t.colorLabel(n,e)}}},[n("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip:hover.left.window",value:"isolate label",expression:"'isolate label'",arg:"hover",modifiers:{left:!0,window:!0}}],staticClass:"colorize-option",class:t.labelIsolated(t.coloredOption,e)},[n("svg",{attrs:{width:"1em",viewBox:"0 -0.5 17 17",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M3 10.333C3 13.463 5.427 16 8.418 16 11.41 16 14 13.463 14 10.333 14 7.204 8.418 0 8.418 0S3 7.204 3 10.333Z",fill:t.colors?t.colors[t.selectedOption][e]:"#434343"}})])]),n("div",{staticClass:"option-label",attrs:{title:e},on:{mouseover:function(n){return t.emitHover(e)},mouseout:function(e){return t.emitHover("")}}},[t._v(t._s(e))])])})),0)]):t._e(),"accordion"===t.layout?n("div",{staticClass:"accordion-container"},[t._l(t.data,(function(e,r){return[n("div",{staticClass:"accordion-group",class:[r===t.selectedOption?"selected":"",r===t.coloredOption?"colored":""]},[n("div",{staticClass:"accordion-control"},[n("div",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip:hover.left",value:"color all labels",expression:"'color all labels'",arg:"hover",modifiers:{left:!0}}],staticClass:"colorize-option",on:{click:function(e){return t.colorOption(r)}}},[n("svg",{attrs:{width:"1em",viewBox:"0 -0.5 17 17",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M3 10.333C3 13.463 5.427 16 8.418 16 11.41 16 14 13.463 14 10.333 14 7.204 8.418 0 8.418 0S3 7.204 3 10.333Z",fill:"#434343"}})])]),n("div",{staticClass:"select-option",on:{click:function(e){return t.selectOption(r)}}},[n("div",{staticClass:"option-label",attrs:{title:r}},[t._v(t._s(r))]),n("div",{staticClass:"arrow"},[n("svg",{staticStyle:{"font-size":"10px"},attrs:{height:"1em",viewBox:"0 0 320 512",xmlns:"http://www.w3.org/2000/svg","stroke-width":"0"}},[n("path",{attrs:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"}})])])])]),n("div",{staticClass:"accordion-content",attrs:{"data-key":r}},t._l(e,(function(e){return n("div",{key:e,staticClass:"label-option"},[n("button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip:hover.left.window",value:"isolate label",expression:"'isolate label'",arg:"hover",modifiers:{left:!0,window:!0}}],staticClass:"colorize-option",class:t.labelIsolated(r,e),attrs:{disabled:r!==t.coloredOption},on:{click:function(n){return t.colorLabel(n,e)}}},[n("svg",{attrs:{width:"1em",viewBox:"0 -0.5 17 17",xmlns:"http://www.w3.org/2000/svg"}},[n("path",{attrs:{d:"M3 10.333C3 13.463 5.427 16 8.418 16 11.41 16 14 13.463 14 10.333 14 7.204 8.418 0 8.418 0S3 7.204 3 10.333Z",fill:t.colors&&r===t.coloredOption?t.colors[r][e]:"#434343"}})])]),n("div",{staticClass:"option-label",attrs:{title:e},on:{mouseover:function(n){return t.emitHover(e)},mouseout:function(e){return t.emitHover("")}}},[t._v(t._s(e))])])})),0)])]}))],2):t._e()])},fe=[],_e=p["default"].component("research-single-cell-selector",{props:{data:{type:null,required:!0},displayData:{type:Object,required:!1,default:null},selectedField:{type:String,required:!1,default:""},colors:{type:Object,required:!1},layout:{type:String,required:!1,default:"dropdown"},listDirection:{type:String,required:!1,default:"vertical"},listAlignment:{type:String,required:!1,default:"start"},listSelection:{type:String,required:!1,default:"inclusive"},showSelect:{type:Boolean,required:!1,default:!0}},data:function(){return{selectedOption:"",coloredOption:"",coloredLabels:[],listData:null,filteredData:null}},watch:{data:function(t,e){t!==e&&this.init()},selectedField:function(t){this.init()},coloredOption:function(){"list"===this.layout&&this.scrollToOption(this.coloredOption)}},created:function(){},mounted:function(){this.init()},computed:{},methods:{init:function(){if(this.data){var t=Array.isArray(this.data),e=this.data;if(!t&&this.selectedField){if(e=this.data[this.selectedField],!e)return;t=Array.isArray(e)}this.filteredData=this.data,!t||"list"!==this.layout&&"dropdown-list"!==this.layout?"accordion"===this.layout&&this.colorOption(this.selectedField):(this.selectedOption=this.selectedField,this.coloredOption=this.selectedField,this.listData=e),this.scrollToOption(this.coloredOption)}},selectOption:function(t){var e=t;this.coloredLabels=[],"dropdown-list"===this.layout||"dropdown"===this.layout?(this.selectedOption=e,this.coloredOption=e):this.selectedOption=this.selectedOption===e?"":e,this.emitUpdate()},colorOption:function(t){this.coloredOption=t,this.coloredLabels=[]},colorLabel:function(t,e){var n=t.target;"inclusive"===this.listSelection?this.coloredLabels.includes(e)?(this.coloredLabels.splice(this.coloredLabels.indexOf(e),1),n.classList.remove("on")):this.coloredLabels.push(e):this.coloredLabels[0]=e,this.emitUpdate()},labelIsolated:function(t,e){if(this.coloredLabels.length>0&&this.coloredLabels.includes(e))return"on";if(t===this.coloredOption){if(0===this.coloredLabels.length||this.coloredLabels.includes(e))return"on"}else if("list"===this.layout&&(0===this.coloredLabels.length||this.coloredLabels.includes(e)))return"on";return""},scrollToOption:function(t){var e=document.querySelector('.list-container .list-option[data-label="'.concat(t,'"]')),n=null===e||void 0===e?void 0:e.closest(".list-container").parentNode;null===n||void 0===n||n.scrollTo({top:e.offsetTop-n.offsetTop,behavior:"smooth"})},emitUpdate:function(){var t={selectedField:this.selectedOption,coloredField:this.coloredOption,coloredLabels:this.coloredLabels};m("emitUpdate",t),this.$emit("on-update",t)},emitHover:function(t){this.$emit("on-hover",{hoveredLabel:t})},displayLabel:function(t){var e;return null!==(e=this.displayData)&&void 0!==e&&e[t]?this.displayData[t].displayName:t}}}),ge=_e,me=(n("37aa"),Object(C["a"])(ge,pe,fe,!1,null,"4c2e7bf2",null)),ve=me.exports,ye=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.data?n("div",{staticStyle:{height:"100%",display:"flex",width:"100%","flex-direction":"column",gap:"10px",margin:"0 0 10px 0"}},[n("div",{staticStyle:{display:"flex",gap:"20px",background:"#f8f8f8",padding:"20px","flex-wrap":"wrap"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",flex:"1","min-width":"300
1px"}},[n("strong",{staticStyle:{"font-size":"20px","line-height":"22px"}},[t._v(t._s(t.data["datasetName"]))]),n("div",{staticStyle:{flex:"1",position:"relative"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column",gap:"10px",position:"absolute",top:"0",right:"0",bottom:"0",left:"0","max-height":"-webkit-fill-available",overflow:"scroll","text-overflow":"ellipsis",margin:"10px 0 0"}},[n("em",{staticStyle:{"font-size":"13px"}},[t._v(t._s(t.data["authors"]||""))]),n("div",[t._v(t._s(t.data["summary"]||""))])])])]),n("div",{staticStyle:{display:"flex",gap:"10px"}},[n("div",{staticStyle:{display:"flex","flex-direction":"column","border-left":"1px solid #ccc","padding-left":"20px",width:"25%","min-width":"300px"}},[n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Species ")]),n("div",[t._v(t._s(t.data["species"]))])]),t.data["organ"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v("Organ")]),n("div",{staticStyle:{"text-transform":"capitalize"}},[t._v(t._s(t.data["organ"]))])]):t._e(),n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Tissue ")]),n("div",{staticStyle:{"text-transform":"capitalize"}},[t._v(t._s(t.data["tissue"]))])]),t.data["depot"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v("Depot")]),n("div",{staticStyle:{"text-transform":"capitalize"}},[t._v(t._s(t.data["depot"]))])]):t._e(),t.data["depot2"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Sub-Depot ")]),n("div",{staticStyle:{"text-transform":"capitalize"}},[t._v(t._s(t.data["depot2"]))])]):t._e(),t.data["totalCells"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Cell Count ")]),n("div",[t._v(" "+t._s(t.data["totalCells"]&&t.data["totalCells"].toLocaleString())+" ")])]):t._e(),t.data["totalDonors"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Donors ")]),n("div",[t._v(" "+t._s(t.data["totalDonors"]&&t.data["totalDonors"].toLocaleString())+" ")])]):t._e(),t.data["totalBiosamples"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Biosamples ")]),n("div",[t._v(" "+t._s(t.data["totalBiosamples"]&&t.data["totalBiosamples"].toLocaleString())+" ")])]):t._e(),t.data["totalSamples"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Cells ")]),n("div",[t._v(" "+t._s(t.data["totalSamples"]&&t.data["totalSamples"].toLocaleString())+" ")])]):t._e(),t.data["disease__ontology_label"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Disease ")]),Array.isArray(t.data["disease__ontology_label"])?t._l(t.data["disease__ontology_label"],(function(e){return n("div",[t._v(" "+t._s(e)+" ")])})):[n("div",[t._v(t._s(t.data["disease__ontology_label"]))])]],2):t._e()]),n("div",{staticStyle:{display:"flex","flex-direction":"column","border-left":"1px solid #ccc","padding-left":"20px",width:"25%","min-width":"300px"}},[t.data["method"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Method ")]),n("div",[t._v(t._s(t.data["method"]))])]):t._e(),t.data["assay"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Assay ")]),n("div",[t._v(t._s(t.data["assay"]))])]):t._e(),t.data["platform"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Platform ")]),n("div",[t._v(t._s(t.data["platform"]))])]):t._e(),t.data["contact"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Contact ")]),n("div",{staticStyle:{overflow:"hidden","overflow-wrap":"break-word"}},[t._v(" "+t._s(t.data["contact"])+" ")])]):t._e(),t.data["email"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}}
1,[t._v(" Email ")]),n("div",{staticStyle:{overflow:"hidden","overflow-wrap":"break-word"}},[t._v(" "+t._s(t.data["email"])+" ")])]):t._e(),t.data["doi"]&&"NA"!==t.data["doi"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v("DOI")]),n("div",{staticStyle:{overflow:"hidden","overflow-wrap":"break-word"}},[n("a",{attrs:{href:t.data["doi"],target:"_blank"}},[t._v(t._s(t.data["doi"].replace("https://doi.org/","")))])])]):t._e(),t.data["previous_versions"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px",opacity:"0.7"}},[t._v(" Prev. Versions ")]),n("div",{staticStyle:{display:"flex","flex-direction":"column"}},t._l(t.data["previous_versions"],(function(e,r){return n("div",{staticStyle:{overflow:"hidden","overflow-wrap":"break-word"}},[n("a",{attrs:{href:e}},[t._v(t._s(r))])])})),0)]):t._e(),t.data["download"]?n("div",{staticClass:"metadata-item"},[n("div",{staticStyle:{"font-weight":"bold","min-width":"100px"}},[t._v(" Download ")]),n("div",{staticStyle:{overflow:"hidden","overflow-wrap":"break-word"}},[n("a",{attrs:{href:t.data["download"],target:"_blank"}},[t._v("here")])])]):t._e()])])])]):t._e()},be=[],xe=p["default"].component("research-single-cell-info",{props:{data:{type:Object,required:!0},displayDirection:{type:String,required:!1,default:"horizontal"}},data:function(){return{}},watch:{},mounted:function(){},computed:{},methods:{}}),we=xe,Ce=(n("9487"),Object(C["a"])(we,ye,be,!1,null,"26943285",null)),Pe=Ce.exports,ke=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-dropdown",{staticClass:"download-chart",attrs:{variant:"secondary",right:"",size:"sm",text:"Download chart"}},[n("b-dropdown-text",[t._v("Save chart as")]),n("b-dropdown-divider"),n("b-dropdown-item",{on:{click:function(e){return t.downloadSvg()}}},[t._v("SVG")]),n("b-dropdown-item",{on:{click:function(e){return t.downloadPng()}}},[t._v("PNG")])],1)},Me=[],Ee=(n("2b3d"),n("bf19"),n("a282")),De=p["default"].component("DownloadChart",{props:{chartId:{type:String,required:!0},titleText:{type:String,default:""},filename:{type:String,default:"chart"},transparentPng:{type:Boolean,default:!0}},data:function(){return{}},computed:{isCanvas:function(){return 0===this.getSvgNodes().length&&null!==this.getCanvasNode()}},methods:{createSvgElement:function(t){return document.createElementNS("http://www.w3.org/2000/svg",t)},getTargetElement:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chartId;return document.getElementById(t)},getCanvasNode:function(){var t,e=this.getTargetElement();if(!e)return null;if("canvas"===(null===(t=e.tagName)||void 0===t?void 0:t.toLowerCase()))return e;var n=Array.from(e.querySelectorAll("canvas")),r=n.find((function(t){var e=window.getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility}));return r||n[0]||null},getSvgNodes:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chartId,n=this.getTargetElement(e);return n?"svg"===(null===(t=n.tagName)||void 0===t?void 0:t.toLowerCase())?[n]:Array.from(n.querySelectorAll("svg")):[]},getSvgSize:function(t){var e,n=null===(e=t.viewBox)||void 0===e?void 0:e.baseVal,r=parseFloat(t.getAttribute("width"))||t.clientWidth||(null===n||void 0===n?void 0:n.width)||0,a=parseFloat(t.getAttribute("height"))||t.clientHeight||(null===n||void 0===n?void 0:n.height)||0;return{width:r,height:a}},escapeXml:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},getTextMarkup:function(t,e){var n,r=null===(n=t.innerText)||void 0===n?void 0:n.trim();if(!r)return null;var a=window.getComputedStyle(t),i=t.getBoundingClientRect(),o=parseFloat(a.fontSize)||16,s=parseFloat(a.lineHeight)||i.height||1.2*o,l=a.fontWeight||"400",c=a.fontFamily||"Arial",u=a.color||"#000",d=a.opacity||"1",h=parseFloat(a.paddingLeft)||0;return{width:i.width,height:Math.max(i.height,s),x:h,y:e,text:r,fontSize:o,fontWeight:l,fontFamily:c,fill:u,opacity:d}},getTitleMarkup:function(t,e){return this.titleText?{width:e,height:32,x:0,y:t,text:this.titleText,fontSize:16,fontWeight:700,fontFamily:"Arial",fill:"#212529",opacity:1}:null},appendTextNode:function(t,e){var n=this.createSvgElement("text");n.setAttribute("x","".concat(e.x)),n.setAttribute("y","".concat(e.y)),n.setAttribute("font-size","".concat(e.fontSize)),n.setAttribute("font-weight","".concat(e.fontWeight)),n.setAttribute("font-family",e.fontFamily),n.setAttribute("fill",e.fill),n.setAttribute("op
1acity","".concat(e.opacity)),n.setAttribute("dominant-baseline","hanging"),n.textContent=e.text,t.appendChild(n)},appendSvgNode:function(t,e,n){var r=this.createSvgElement("g");r.setAttribute("transform","translate(0, ".concat(n,")")),Array.from(e.childNodes).forEach((function(t){r.appendChild(t.cloneNode(!0))})),t.appendChild(r)},collectContainerItems:function(t,e){var n,r,a=this,i=null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase();if("svg"!==i){var o=Array.from(t.children||[]);if(0!==o.length){var s=o.some((function(t){var e;return"svg"===(null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase())||t.querySelector("svg")}));s||null===(r=t.innerText)||void 0===r||!r.trim()?o.forEach((function(t){return a.collectContainerItems(t,e)})):e.push({type:"text",node:t})}else{var l;null!==(l=t.innerText)&&void 0!==l&&l.trim()&&e.push({type:"text",node:t})}}else e.push({type:"svg",node:t})},getContainerItems:function(t){var e=this,n=[];return Array.from(t.children).forEach((function(t){e.collectContainerItems(t,n)})),n},getCombinedSvgMarkup:function(){var t,e,n,r=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chartId,i=this.getTargetElement(a);if(!i)return null;var o=i.clientWidth||parseFloat(null===(t=i.getAttribute)||void 0===t?void 0:t.call(i,"width"))||0;if("svg"===(null===(e=i.tagName)||void 0===e?void 0:e.toLowerCase())&&!this.titleText)return(new XMLSerializer).serializeToString(i);var s="svg"===(null===(n=i.tagName)||void 0===n?void 0:n.toLowerCase())?[{type:"svg",node:i}]:this.getContainerItems(i);if(0===s.length&&!this.titleText)return null;var l=s.filter((function(t){return"svg"===t.type}));if(1===s.length&&1===l.length&&!this.titleText)return(new XMLSerializer).serializeToString(l[0].node);var c=0,u=o,d=this.getTitleMarkup(c,o),h=this.createSvgElement("svg");return h.setAttribute("xmlns","http://www.w3.org/2000/svg"),h.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),d&&(c+=d.height,u=Math.max(u,d.width),this.appendTextNode(h,d)),s.forEach((function(t){if("text"===t.type){var e=r.getTextMarkup(t.node,c);if(!e)return;return r.appendTextNode(h,e),c+=e.height,void(u=Math.max(u,e.width))}var n=r.getSvgSize(t.node),a=n.width,i=n.height;r.appendSvgNode(h,t.node,c),c+=i,u=Math.max(u,a)})),h.setAttribute("width","".concat(u)),h.setAttribute("height","".concat(c)),h.setAttribute("viewBox","0 0 ".concat(u," ").concat(c)),(new XMLSerializer).serializeToString(h)},svgUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=this.getCombinedSvgMarkup(t||this.chartId);if(!e)return null;var n=new Blob([e],{type:"image/svg+xml;charset=utf-8"});return URL.createObjectURL(n)},downloadSvg:function(){if(this.isCanvas)this.downloadCanvasToSvg();else{var t=this.svgUrl();t&&(Ee["a"].downloadChart(t,"".concat(this.filename,".svg")),setTimeout((function(){return URL.revokeObjectURL(t)}),0))}},downloadPng:function(){if(this.isCanvas)this.downloadCanvasToPng();else{var t=this.svgUrl();if(t){var e=new Image;e.src=t;var n="".concat(this.filename,".png"),r=this.transparentPng;e.onload=function(){var e=document.createElement("canvas");e.width=this.width,e.height=this.height;var a=e.getContext("2d");r||(a.fillStyle="white",a.fillRect(0,0,e.width,e.height)),a.drawImage(this,0,0);var i=e.toDataURL("image/png");Ee["a"].downloadChart(i,n),URL.revokeObjectURL(t)},e.onerror=function(){URL.revokeObjectURL(t)}}}},downloadCanvasToPng:function(){var t=this.getCanvasNode();if(t){var e=t.toDataURL("image/png");Ee["a"].downloadChart(e,"".concat(this.filename,".png"))}},downloadCanvasToSvg:function(){var t=this.getCanvasNode();if(t){var e=t.toDataURL("image/png"),n=t.height,r=t.width,a='<image height="'.concat(n,'" width="').concat(r,'" y="0" x="0" xlink:href="').concat(e,'" id="importedCanvas_0"/>'),i='<svg xmlns:xlink="http://www.w3.org/1999/xlink" height="'.concat(n,'" width="').concat(r,'" xmlns="http://www.w3.org/2000/svg" id="new-svg">').concat(a,"</svg>"),o=document.createElement("div");o.innerHTML=i,o.hidden=!0,document.body.appendChild(o);var s=this.svgUrl("new-svg");s&&(Ee["a"].downloadChart(s,"".concat(this.filename,".svg")),setTimeout((function(){return URL.revokeObjectURL(s)}),0)),document.body.removeChild(o)}}}}),Oe=De,Le=(n("34e5"),Object(C["a"])(Oe,ke,Me,!1,null,null,null)),je=Le.exports;function Se(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Se=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new j(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};u(x,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(S([])));C&&C!==n&&r.call(C,s)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 6,440 bytes, line 1
1function M(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),u(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),u(P,c,"Generator"),u(P,s,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var Ae=["#007bff","#048845","#8490C8","#BF61A5","#EE3124","#FCD700","#5555FF","#7aaa1c","#F88084","#9F78AC","#F5A4C7","#CEE6C1","#cccc00","#6FC7B6","#D5A768","#d4d4d4"],Ie=p["default"].component("research-single-cell-browser",{components:{ResearchUmapPlotGL:Bt,ResearchStackedBarPlot:qt,ResearchDotPlot:Qt,ResearchViolinPlot:ie,ResearchScatterPlot:he,ResearchSingleCellSelector:ve,ResearchSingleCellInfo:Pe,DownloadChart:je},props:{sectionId:{type:String,required:!1},renderConfig:{type:Object,required:!0},utils:{type:Object,required:!0},data:{type:Array,required:!0}},data:function(){var t=this;return{singleCellBI:[{name:"PanKbase",bioIndex:"https://skin.hugeampkpnbi.org"},{name:"CFDE",bioIndex:"https://cfde.hugeampkpnbi.org"},{name:"MATKP",bioIndex:"https://matkp.hugeampkpnbi.org"},{name:"FNIH",bioIndex:"https://bioindex-dev.hugeamp.org"}],BIendpoints:{metadata:"/api/raw/file/single_cell_all_metadata/dataset_metadata.json.gz",fields:"/api/raw/file/single_cell/$datasetId/fields.json.gz",co
1ordinates:"/api/raw/file/single_cell/$datasetId/coordinates.tsv.gz",expression:"/api/bio/query/single-cell-lognorm?q=$datasetId,$gene",markers:"/api/raw/file/single_cell/$datasetId/"},BImarkersDefaultFile:{output_file:"marker_genes.json.gz",marker_gene_level:"cell_type__kp",markerKey:"cell_type",markerKeyLabel:"Cell Type"},allMetadata:null,singleCellMetadata:null,metadata:null,fields:null,coordinates:null,markers:null,datasetId:null,totalCells:null,embeddingType:"UMAP",cellTypeField:null,donorsField:null,samplesField:null,aggregateField:null,aggregateType:null,activeGroup:null,stratifyPlotType:"violin",stratifyPlotTypeOptions:["violin","combined","dot"],expressionColorScale:"blue",expressionColorScaleOptions:["red","blue"],dotPlotColorScaleMode:null,displayFields:null,displayGroups:null,traitFields:null,colorByFields:null,contCountResults:null,contExprResults:null,viewType:1,baseTableColumns:[{key:"tissue",label:"Tissue",class:"capitalize"},{key:"depot",label:"Depot",class:"capitalize"},{key:"sourceDataset",label:"Source"},{key:"totalDonors",label:"Donors",formatter:function(t){return null===t||void 0===t?void 0:t.toLocaleString()},thClass:"text-right",tdClass:"text-right",thStyle:{width:"150px"}},{key:"totalBiosamples",label:"Biosamples",formatter:function(t){return null===t||void 0===t?void 0:t.toLocaleString()},thClass:"text-right",tdClass:"text-right",thStyle:{width:"150px"}},{key:"totalSamples",label:"Cells",formatter:function(t){return null===t||void 0===t?void 0:t.toLocaleString()},thClass:"text-right",tdClass:"text-right",thStyle:{width:"150px"}}],currentDatasetsPage:1,totalDatasets:null,datasetsPerPage:null,presetsConfig:null,showDatasetSelect:!1,colorscaleGreyBlue:h["scaleLinear"]().domain([0,1]).range(["lightgrey","blue"]),colorScalePlasma:h["scaleSequential"](h["interpolatePlasma"]),colorScalePlasmaColorsArray:[],colorScaleGreyBlueColorsArray:[],labelColors:null,fieldsDisplayList:null,isStacked:!1,isNormalized:!0,leftPanelWidth:50,minPanelWidthPercent:30,isResizingPanels:!1,geneNames:[],sortedGeneNames:[],expressionData:{},expressionStatsAll:[],geneToSearch:"",geneLoading:null,genesNotFound:[],markersList:null,markerCellTypes:null,markerGenes:null,markerGenesTable:null,markersByGene:null,markersByCellType:null,markerGenesMaxMean:3,dotPlotCellType:"",markerFileOptions:[],markerFile:null,markersHaveZscores:!1,markerTableColumns:null,markerDesiredColumns:[{key:"cell_type",label:"Cell Type"},{key:"Ganglion",label:"Ganglion"},{key:"gene",label:"Gene"},{key:"mean_expression",label:"Mean Expression",sortable:!0,formatter:function(t){return"number"===typeof t?t.toPrecision(3):""}},{key:"pct_cells_expression",label:"% Expressing",sortable:!0,formatter:function(e){return"number"===typeof e?(e*t.markersPctScaleAdjust).toFixed(1)+"%":""}},{key:"p_value_adj",label:"Adj. P-Value",sortable:!0,formatter:function(t){return"number"===typeof t?t.toPrecision(3):""}},{key:"log_fold_change",label:"Log Fold Change",sortable:!0,formatter:function(t){return"number"===typeof t?t.toPrecision(3):""}},{key:"z_score",label:"Z-score",sortable:!0,formatter:function(t){return"number"===typeof t?t.toPrecision(3):""}}],geneLists:Object(d["a"])(Object(d["a"])({},"searched genes",[]),"marker genes",[]),dataLoaded:!1,preloadItem:"",dataReady:!1,highlightHoverTimeout:null,layout:-1,layoutOptions:[{name:"option0",value:0},{name:"option1",value:1},{name:"option2",value:2}],cellCompositionVars:{},geneExpressionVars:{},testCellProportions:null,testCellStats:null}},watch:{expressionData:function(){var t=this,e=[];Object.keys(this.expressionData).forEach((function(n){e.push.apply(e,Object(u["a"])(X(t.fields,t.labelColors,t.expressionData[n],n,t.cellTypeField,null,!0)))})),this.expressionStatsAll=e},geneNames:function(){this.sortedGeneNames=Object(u["a"])(this.geneNames).sort(),this.geneLists["searched genes"]=this.geneNames},markersList:function(){this.geneLists["marker genes"]=this.markersList}},mounted:function(){m("renderConfig",this.renderConfig),m("portal",this.portalGroup),m("data",this.data),_["a"].$on("on-select",this.handleSelectEvent),this.init()},beforeDestroy:function(){_["a"].$off("on-select",this.handleSelectEvent),this.stopColumnResize()},computed:{isDev:function(){return 1===f["a"]["dev"]},portalGroup:function(){var t=window.location.hostname,e="hugeamp.org"===t||t.endsWith(".hugeamp.org"),n=t.includes("localhost"),r=t.split("."),a=null;return n?2===r.length&&"www"!==r[0]&&"dev"!==r[0]&&(a=r[0]):e&&r.length>2&&"www"!==r[0]&&"dev"!==r[0]&&(a=r[0]),a},isATACseq:function(){var t;return!(null===(t=this.metadata)||void 0===t||null===(t=t["method"])||void 0===t||!t.toLowerCase().includes("atac"))},selectedBI:function(){var t,e=window.location.hostname,n=window.location.port,r=e.includes("localhost")||e.includes("dev")||"8000"===n;return f["a"]["bioIndex"]?t=f["a"]["bioIndex"]:r&&this.renderConfig["bioIndexDev"]?t=this.renderConfig["bioIndexDev"]:this.renderConfig["bioIndex"]?t=this.renderConfig["bioIndex"]:m("No Bio
1Index provided."),m("index",{domain:e,isDev:r,biInUrlParam:f["a"]["bioIndex"],biInConfig:this.renderConfig["bioIndex"],biDevInConfig:this.renderConfig["bioIndexDev"],using:t}),t},markerGenesSizeKey:function(){return this.markerGenes?this.markerGenes[0].pct_nz_group?"pct_nz_group":this.markerGenes[0].pct_cells_expression?"pct_cells_expression":void 0:null},showDepotColumn:function(){return Array.isArray(this.singleCellMetadata)&&this.singleCellMetadata.some((function(t){return null!=t.depot&&""!==t.depot}))},tableColumns:function(){var t=this;return this.baseTableColumns.filter((function(e){return"depot"!==e.key||t.showDepotColumn}))},markersPctScaleAdjust:function(){if(this.markerGenes){var t=Math.max.apply(Math,Object(u["a"])(this.markerGenes.map((function(t){return t.pct_cells_expression}))))<=1?100:1;return t}},countDownloadChartId:function(){return this.contCountResults?"sc_count_scatter_group":"sc_stacked_bar_plot"},countSectionTitle:function(){var t="".concat(this.isATACseq?"Nuclei":"Cell"," ").concat(this.isNormalized?"Proportion":"Count");return this.displayFields&&this.cellCompositionVars.segmentByLabel&&"cat"===this.displayFields[this.cellCompositionVars.segmentByLabel].dataType?"".concat(t," by ").concat(this.displayLabel(this.cellCompositionVars.displayByLabel)," per ").concat(this.displayLabel(this.cellCompositionVars.segmentByLabel)):this.cellCompositionVars.segmentByLabel?"".concat(t," by ").concat(this.displayLabel(this.cellCompositionVars.segmentByLabel)," per ").concat(this.displayLabel(this.cellCompositionVars.displayByLabel)):"".concat(t," by ").concat(this.displayLabel(this.cellCompositionVars.displayByLabel))},countDownloadDisabled:function(){return!1},plotMetadataLabels:function(){var t=this;return this.fields?Object.keys(this.fields.metadata_labels).reduce((function(e,n){return e[n]=t.getPlotMetadataLabels(n),e}),{}):{}},useVerticalCellProportionPlot:function(){var t,e=this.cellCompositionVars.segmentByLabel;if(!e||!this.displayFields||"cat"!==(null===(t=this.displayFields[e])||void 0===t?void 0:t.dataType))return!1;var n=this.getPlotMetadataLabels(e);return n.length>40},markerDotPlotTitle:function(){var t;return"Top Marker Genes for ".concat(this.dotPlotCellType||"All"," (").concat((null===(t=this.markerFile)||void 0===t?void 0:t.markerKeyLabel)||"Cell Types",")")},expressionDownloadChartId:function(){return this.contExprResults?"sc_expression_scatter_group":this.cellCompositionVars.segmentByLabel?"dot"===this.stratifyPlotType?"sc_dot_plot":"combined"===this.stratifyPlotType?"sc_violin_plot":"sc_violin_plot_group":"sc_violin_plot"},expressionSectionTitle:function(){var t="".concat(this.geneExpressionVars.selectedGene||""," ").concat(this.isATACseq?"Chromatin Accessibility":"Expression").trim();return this.displayFields&&this.cellCompositionVars.segmentByLabel&&"cat"===this.displayFields[this.cellCompositionVars.segmentByLabel].dataType?"".concat(t," by ").concat(this.displayLabel(this.cellCompositionVars.displayByLabel)," per ").concat(this.displayLabel(this.cellCompositionVars.segmentByLabel)):this.cellCompositionVars.segmentByLabel?"".concat(t," by ").concat(this.displayLabel(this.cellCompositionVars.segmentByLabel)," per ").concat(this.displayLabel(this.cellCompositionVars.displayByLabel)):"".concat(t," by ").concat(this.displayLabel(this.cellCompositionVars.displayByLabel))},expressionDownloadDisabled:function(){return!1},showStratifyPlotTypeSelect:function(){var t;return Boolean(this.cellCompositionVars.segmentByLabel&&this.displayFields&&"cat"===(null===(t=this.displayFields[this.cellCompositionVars.segmentByLabel])||void 0===t?void 0:t.dataType)&&!this.contExprResults)},showExpressionPlotTypeSelect:function(){return!this.contExprResults&&(!!this.geneExpressionVars.expressionStats.length&&(""===this.cellCompositionVars.segmentByLabel||this.showStratifyPlotTypeSelect))},availableExpressionPlotTypes:function(){return""===this.cellCompositionVars.segmentByLabel?["violin","dot"]:this.showStratifyPlotTypeSelect?this.stratifyPlotTypeOptions:["violin"]},rightPanelWidth:function(){return 100-this.leftPanelWidth},resizeHandleStyle:function(){return{width:"20px",flex:"0 0 20px",cursor:"col-resize",position:"relative",background:"linear-gradient(to right, transparent 0, transparent 8px, #e3e3e3 8px, #e3e3e3 12px, transparent 12px)",touchAction:"none"}}},methods:{resizableColumnStyle:function(t){return{flex:"0 0 calc(".concat(t,"% - 10px)"),maxWidth:"calc(".concat(t,"% - 10px)")}},showTooltip:function(t){O.show(t)},hideTooltip:function(){O.hide()},startColumnResize:function(t){var e=this.$refs.expressionPanels;e&&(this.isResizingPanels=!0,this.updateColumnWidthsFromEvent(t),window.addEventListener("mousemove",this.handleColumnResize),window.addEventListener("mouseup",this.stopColumnResize),window.addEventListener("touchmove",this.handleColumnResize,{passive:!1}),window.addEventListener("touchend",this.stopColumnResize))},handleColumnResize:function(t){this.isResizingPanels&&(t.cancelable&&t.preventDefault(),this.updateColumnWidthsFromEvent(t))},stopColumnResize:function(){this.isResizingPanels=!1,window.removeEventListener("mousemove",this.handleColumnResize),window.removeEventListener("mouseup",this.stopColumnResize),window.removeEventListener("touchmove",this.handleColumnResize),window.removeEventListener("touchend",this.stopColumnResize)},updateColumnWidthsFromEvent:function(t){var e,n,r=this.$refs.expressionPanels;if(r){var a=r.getBoundingClientRect(),i=null!==(e=null===(n=t.touches)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.clientX)&&void 0!==e?e:t.clientX;if("number"===typeof i){var o=(i-a.left)/a.width*100,s=this.minPanelWidthPercent,l=100-s;this.leftPanelWidth=Math.min(l,Math.max(s,o))}}},datasetsRowClass:function(t){return t?t.datasetId===this.datasetId?"selected-dataset-row":"dataset-row":""},preprocessBoxPlotData:function(t,e){return H(this.fields.metadata,this.fields.metadata_labels,t,e)},parseCellCountScatterData:function(t,e,n){return $(this.fields.metadata,this.fields.metadata_labels,t,e,n)},parseFacetedScatterData:function(t,e,n,r){return Z(this.fields.metadata,this.fields.metadata_labels,t,e,this.expressionData[n],n,r)},calcCellCounts:function(t,e,n){return z(this.fields,this.labelColors,t,e,n)},clean:function(){this.allMetadata=null,this.metadata=null,this.fields=null,this.coordinates=null,this.markers=null,this.markersList=null,this.markerCellTypes=null,this.markerGenes=null,this.markerGenesTable=null,this.markersByGene=null,this.markersByCellType=null,this.dataLoaded=!1,this.dataReady=!1,this.expressionData={},this.geneNames=[],this.expressionStatsAll=[],this.genesNotFound=[],this.dotPlotCellType="",this.markerFileOptions=[],this.markerFile=null,this.cellCompositionVars={colorByField:null,highlightLabel:"",highlightLabels:[],segmentByCounts2:null,displayByLabel:null,subsetLabel:"",segmentByLabel:null,facetByLabel:null},this.geneExpressionVars={selectedGene:null,expressionStats:[],selectedLabel:null,subsetLabel:""},this.cellTypeField=null,this.donorsField=null,this.samplesField=null,this.aggregateField=null,this.aggregateType=null,this.displayFields=null,this.displayGroups=null,this.traitFields=null,this.colorByFields=null,this.contCountResults=null,this.contExprResults=null},init:function(){var t=this;return Object(c["a"])(Se().mark((function e(){var n,r,a,i,o,s,c,d,_,g,v,y,b,x,w,C,P,k,M,E,D,O,L,j,S,A,T,R,G,W,U,q,N,V,z,$,H;return Se().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.presetsConfig=t.renderConfig["presets"],m("presets",t.presetsConfig),t.showDatasetSelect=(null===(n=t.presetsConfig)||void 0===n?void 0:n["showDatasetSelect"])||!1,t.layout=f["a"]["layout"]||(null===(r=t.presetsConfig)||void 0===r?void 0:r["layout"])||0,m("LAYOUT",t.layout),t.datasetId&&""!==t.datasetId){e.next=16;break}if(!f["a"][null===(_=t.renderConfig["parameters"])||void 0===_?void 0:_.datasetId]){e.next=10;break}t.datasetId=f["a"][t.renderConfig["parameters"].datasetId],e.next=16;break;case 10:if(null===(g=t.presetsConfig)||void 0===g||!g.datasetId){e.next=14;break}t.datasetId=t.presetsConfig.datasetId,e.next=16;break;case 14:return m("select a dataset"),e.abrupt("return");case 16:return m("requested dataset: ".concat(t.datasetId)),t.clean(),m("++++++++++++ PREPARING"),t.dataLoaded=!1,t.preloadItem="metadata",v=t.selectedBI+t.BIendpoints.metadata,e.next=24,I(v);case 24:if(t.allMetadata=e.sent,t.allMetadata){e.next=28;break}return m("there was an error getting metadata"),e.abrupt("return");case 28:if(m("allMetadata",t.allMetadata),y=function(){var e,n=t.allMetadata;return null!==(e=t.allMetadata[0])&&void 0!==e&&e.data_type&&(n=t.allMetadata.filter((function(t){return"single_cell"===t.data_type}))),t.portalGroup&&(n=n.filter((function(e){if(e.portals)return e.portals.includes(t.portalGroup)}))),n},t.singleCellMetadata=y(),m("singleCellMetadata",t.singleCellMetadata),t.metadata=t.singleCellMetadata.find((function(e){return e.datasetId===t.datasetId})),t.metadata){e.next=42;break}if(m(t.datasetId,"not available in this collection"),!(t.singleCellMetadata.length>0)){e.next=41;break}t.datasetId=t.singleCellMetadata[0].datasetId,m("loading first dataset",t.datasetId),t.metadata=t.singleCellMetadata.find((function(e){return e.datasetId===t.datasetId})),e.next=42;break;case 41:return e.abrupt("return");case 42:return m("datasetMetadata",t.metadata),t.totalDatasets=t.singleCellMetadata.length,t.totalCells=t.metadata.totalCells,t.embeddingType=null!==(a=t.metadata.embedding_method)&&void 0!==a?a:t.embeddingType,b=t.renderConfig.format,x=null===b||void 0===b?void 0:b[t.datasetId],w=null===b||void 0===b?void 0:b.default,null!==x&&void 0!==x&&x.stratifyPlotType&&t.stratifyPlotTypeOptions.includes(x.stratifyPlotType)&&(t.stratifyPlotType=x.stratifyPlotType),null!==x&&void 0!==x&&x.expressionColorScale&&t.expressionColorScaleOptions.includes(x.expressionColorScale)&&(t.expressionColorScale=x.expressionColorScale),null!==x&&void 0!==x&&x.dotPlotColorScaleMode&&(t.dotPlotColorScaleMode=x.dotPlotColorScaleMode),x?(t.displayFields=x.displayMap||null,t.displayGroups=x.groups||null):w&&(t.displayFields=w.displayMap||null,t.displayGroups=w.groups||null),m("display config",{displayFields:t.displayFields,displayGroups:t.displayGroups}),C=function(t,e){if(t.length!==e.length)return!1;var n=Object(u["a"])(t).sort(),r=Object(u["a"])(e).sort();return n.every((function(t,e){return t===r[e]}))},t.preloadItem="fields",P=t.selectedBI+t.BIendpoints.fields,e.next=59,B(P,t.datasetId);case 59:if(t.fields=e.sent,t.fields?(t.fields.metadata_labels_sorted={}
1,Object.keys(t.fields.metadata_labels).forEach((function(e){var n,r=null===(n=t.displayFields)||void 0===n||null===(n=n[e])||void 0===n?void 0:n.customSortOrder,a=t.fields.metadata_labels[e];r&&C(r,a)?t.fields.metadata_labels_sorted[e]=Object(u["a"])(r):t.fields.metadata_labels_sorted[e]=Object(u["a"])(a).sort((function(t,e){return t.localeCompare(e,void 0,{numeric:!0})}))})),t.totalCells||(t.totalCells=(null===(k=t.fields.NAME)||void 0===k?void 0:k.length)|(null===(M=t.fields.ID)||void 0===M?void 0:M.length)),m("fields",t.fields)):m("there was an error getting fields"),3===t.layout){e.next=68;break}return t.preloadItem="coordinates",E=t.selectedBI+t.BIendpoints.coordinates,e.next=66,F(E,t.datasetId);case 66:t.coordinates=e.sent,t.coordinates?m("coordinates",t.coordinates):m("there was an error getting coordinates");case 68:return t.preloadItem="markers",t.markerFile=t.BImarkersDefaultFile,(null===(i=t.metadata)||void 0===i||null===(i=i.marker_gene_files)||void 0===i?void 0:i.length)>1&&(t.markerFileOptions=t.metadata.marker_gene_files,t.markerFileOptions.forEach((function(t){var e=t.marker_gene_level.toLowerCase(),n=e.includes("cell")&&e.includes("type")&&!e.includes("sub");t.markerKey=n?"cell_type":t.marker_gene_level,t.markerKeyLabel=n?"Cell Type":t.marker_gene_level})),t.markerFile=t.markerFileOptions[0]),e.next=73,t.initMarkers(t.markerFile);case 73:return t.preloadItem="",t.dataLoaded=!0,e.next=77,p["default"].nextTick();case 77:return t.traitFields=t.filterDisplayFields(),t.colorByFields=t.filterDisplayFields(),m("display lists",{colorByFields:t.colorByFields,traitFields:t.traitFields}),t.labelColors=K(t.fields,Ae),t.colorScalePlasmaColorsArray=h["range"](0,1.01,.1).map((function(e){return t.colorscaleGreyBlue(e)})).join(", "),D=Object.keys(t.fields.metadata_labels),O=null===(o=t.displayGroups)||void 0===o||null===(o=o.cellType)||void 0===o?void 0:o[0],O&&D.includes(O)?t.cellTypeField=O:t.cellTypeField=t.findCellTypeField(D),t.activeGroup=t.cellTypeField,m("cellTypeField:",t.cellTypeField),L=null===(s=t.displayGroups)||void 0===s?void 0:s.samples,L&&D.includes(L)?(t.samplesField=L,t.aggregateField=t.samplesField,t.aggregateType="sample"):t.samplesField=t.findSamplesField(D),m("samplesField:",t.samplesField),j=null===(c=t.displayGroups)||void 0===c?void 0:c.donors,j&&D.includes(j)?(t.donorsField=j,t.fields.metadata_labels[t.donorsField].length>1&&(t.aggregateField=t.donorsField,t.aggregateType="donor")):t.donorsField=t.findDonorsField(D),m("donorsField:",t.donorsField),m("aggregates",{field:t.aggregateField,type:t.aggregateType}),m("++++++++++++ PLOTTING"),t.selectColorBy(t.cellTypeField),t.selectSegmentBy(t.cellTypeField,""),t.geneExpressionVars.selectedLabel=t.cellTypeField,t.dataReady=!0,e.next=101,p["default"].nextTick();case 101:if(S=!1,null===(d=t.renderConfig["parameters"])||void 0===d||!d.gene){e.next=151;break}if(T=decodeURIComponent(f["a"][t.renderConfig["parameters"].gene]),!T||"undefined"===T){e.next=129;break}m("loading param genes"),R=T.split(","),G=Object(l["a"])(R),e.prev=108,G.s();case 110:if((W=G.n()).done){e.next=119;break}return U=W.value,e.next=114,t.getGeneExpression(U.toUpperCase(),!1);case 114:return e.next=116,p["default"].nextTick();case 116:S=!0;case 117:e.next=110;break;case 119:e.next=124;break;case 121:e.prev=121,e.t0=e["catch"](108),G.e(e.t0);case 124:return e.prev=124,G.f(),e.finish(124);case 127:e.next=151;break;case 129:if(null===(A=t.presetsConfig)||void 0===A||!A["genes"]){e.next=151;break}m("loading config genes"),q=Object(l["a"])(t.presetsConfig["genes"]),e.prev=132,q.s();case 134:if((N=q.n()).done){e.next=143;break}return V=N.value,e.next=138,t.getGeneExpression(V.toUpperCase(),!1);case 138:return e.next=140,p["default"].nextTick();case 140:S=!0;case 141:e.next=134;break;case 143:e.next=148;break;case 145:e.prev=145,e.t1=e["catch"](132),q.e(e.t1);case 148:return e.prev=148,q.f(),e.finish(148);case 151:if(S){e.next=178;break}if(!t.markerGenes){e.next=157;break}return e.next=155,t.getGeneExpression(t.markerGenes[0].gene.toUpperCase(),!1);case 155:e.next=178;break;case 157:if(!t.markersList){e.next=178;break}m("loading marker genes"),z=Object(l["a"])(t.markersList),e.prev=160,z.s();case 162:if(($=z.n()).done){e.next=170;break}return H=$.value,e.next=166,t.getGeneExpression(H.toUpperCase(),!1);case 166:return e.next=168,p["default"].nextTick();case 168:e.next=162;break;case 170:e.next=175;break;case 172:e.prev=172,e.t2=e["catch"](160),z.e(e.t2);case 175:return e.prev=175,z.f(),e.finish(175);case 178:case"end":return e.stop()}}
1),e,null,[[108,121,124,127],[132,145,148,151],[160,172,175,178]])})))()},initMarkers:function(t){var e=this;return Object(c["a"])(Se().mark((function n(){var r,a,i,o,l,c,d,p,f,_,g;return Se().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.selectedBI+e.BIendpoints.markers+t.output_file,!r){n.next=11;break}return a=r,n.next=5,W(a,e.datasetId);case 5:i=n.sent,o=i.filter((function(t){return null!==t})),l=o.map((function(t){var e,n,r,a;return Object(s["a"])(Object(s["a"])({},t),{},{mean_expression:null!==(e=null!==(n=t.mean_expression)&&void 0!==n?n:t.mean_expression_raw)&&void 0!==e?e:0,pct_cells_expression:null!==(r=null!==(a=t.pct_cells_expression)&&void 0!==a?a:t.pct_nz_group)&&void 0!==r?r:0})})),e.markers=l,m("markers",e.markers),e.markers?Array.isArray(e.markers)?(e.markersList=Object(u["a"])(new Set(e.markers.map((function(t){return t.gene.toUpperCase()})))),e.markerCellTypes=(null===(c=e.fields.metadata_labels_sorted)||void 0===c?void 0:c[t.marker_gene_level])||e.fields.metadata_labels[t.marker_gene_level],e.markersByGene=tt(e.markers,"gene"),e.markersByCellType=tt(e.markers,t.markerKey),d=80/e.markerCellTypes.length,p=e.topNmarkersByCellType(d),f=p.markersMatrix,_=p.markersTable,e.geneNames=e.markersList,e.markerGenes=f,e.markerGenesTable=_,e.markerGenesMaxMean=h["max"](e.markerGenes.map((function(t){return t.mean_expression}))).toFixed(1),e.markerTableColumns=e.markerDesiredColumns.filter((function(t){return e.markerGenes.some((function(e){return null!==e[t.key]&&void 0!==e[t.key]}))})),e.markersHaveZscores=e.markerGenes.some((function(t){return null!==t.z_score&&void 0!==t.z_score})),m("markers",{markersByGene:e.markersByGene,markersByCellType:e.markersByCellType,markerGenes:e.markerGenes,markersList:e.markersList})):(g=Object.values(e.markers).flat(),e.markersList=g,m({markersList:g})):m("no markers returned");case 11:case"end":return n.stop()}}),n)})))()},getGeneExpression:function(t){var e=arguments,n=this;return Object(c["a"])(Se().mark((function r(){var a,i,o,s,l;return Se().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=!(e.length>1&&void 0!==e[1])||e[1],i=e.length>2&&void 0!==e[2]&&e[2],!n.geneNames.includes(t)){r.next=8;break}if(m("".concat(t," already listed")),!n.expressionData[t]){r.next=8;break}return m("".concat(t," already loaded")),i&&n.geneClick(t),r.abrupt("return");case 8:return n.geneLoading="gene",o=n.selectedBI+n.BIendpoints.expression,r.next=12,q(o,t,n.datasetId);case 12:if(s=r.sent,n.geneLoading=null,!s){r.next=24;break}return(n.markerGenes&&!n.markersList.includes(t)||!n.markerGenes)&&n.geneNames.push(t),p["default"].set(n.expressionData,t,s),m("getGeneExpression",t),a&&null!==(l=n.renderConfig["parameters"])&&void 0!==l&&l.gene&&f["a"].set(Object(d["a"])({},n.renderConfig["parameters"].gene,t)),r.next=21,p["default"].nextTick();case 21:n.geneExpressionVars.selectedGene&&!i||n.geneClick(t),r.next=27;break;case 24:return n.genesNotFound.includes(t)||n.genesNotFound.push(t),r.next=27,p["default"].nextTick();case 27:case"end":return r.stop()}}),r)})))()},maxCountValue:function(){var t=h["max"](this.cellCompositionVars.segmentByCounts2,(function(t){return t.count}));return t},minExpressionValue:function(t){return h["min"](this.expressionData[t])},maxExpressionValue:function(t){return h["max"](this.expressionData[t])},getPlotMetadataLabels:function(t){var e,n;if(!t||!this.fields)return[];var r=(null===(e=this.fields["metadata_labels_sorted"])||void 0===e?void 0:e[t])||(null===(n=this.fields["metadata_labels"])||void 0===n?void 0:n[t])||[];return r.filter((function(t){return!A(t)}))},getStatsByPropValue:function(t,e,n){return t.filter((function(t){return t[e]===n}))},getAllStats:function(){var t,e=[],n=this.getPlotMetadataLabels(this.cellCompositionVars.segmentByLabel),r=Object(l["a"])(n);try{for(r.s();!(t=r.n()).done;){var a=t.value,i=this.getStatsByPropValue(this.geneExpressionVars.expressionStats,this.cellCompositionVars.segmentByLabel,a);e.push.apply(e,Object(u["a"])(i))}}catch(o){r.e(o)}finally{r.f()}return e},stratifyPlotTypeLabel:function(t){var e={violin:"Violin list",comb
1ined:"Combined violin",dot:"Dot plot"};return e[t]||t},swapCountLabels:function(){var t=this.cellCompositionVars.displayByLabel,e=this.cellCompositionVars.segmentByLabel;this.cellCompositionVars.displayByLabel=e,this.cellCompositionVars.segmentByLabel=t},swapExpressionLabels:function(){var t=this.geneExpressionVars.selectedLabel,e=this.geneExpressionVars.subsetLabel;this.geneExpressionVars.selectedLabel=e,this.geneExpressionVars.subsetLabel=t},findCellTypeField:function(t){return t.reduce((function(t,e){var n=e.toLowerCase(),r=(n.includes("cell")?1:0)+(n.includes("type")?1:0)+(n.includes("cluster")?1:0);return r>t.score?{string:e,score:r}:t}),{string:null,score:0}).string},findDonorsField:function(t){return t.reduce((function(t,e){var n=e.toLowerCase(),r=(n.includes("donor")?2:0)+(n.includes("subject")?1:0)+(n.includes("individual")?1:0)+(n.includes("participant")?1:0)+(n.includes("patient")?1:0)+(n.includes("library")?1:0)+(n.includes("id")?.5:0);return r>t.score?{string:e,score:r}:t}),{string:null,score:0}).str
1ing},findSamplesField:function(t){return t.reduce((function(t,e){var n=e.toLowerCase(),r=(n.includes("sample")?2:0)+(n.includes("specimen")?1:0)+(n.includes("id")?.5:0);return r>t.score?{string:e,score:r}:t}),{string:null,score:0}).string},displayLabel:function(t){var e;return null!==(e=this.displayFields)&&void 0!==e&&e[t]?this.displayFields[t].displayName:t},topNmarkersByCellType:function(t){var e,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=[],i=[],o=[],c=this.markerCellTypes,u=Object(l["a"])(c);try{for(u.s();!(e=u.n()).done;){var h=e.value,p=h,f=this.markersByCellType[h];if(!r||r&&p===r){f&&(o=f.every((function(t){return null!=t.z_score}))?f.sort((function(t,e){return e.z_score-t.z_score})).filter((function(t){return t.z_score>0})):f.sort((function(t,e){return e.mean_expression-t.mean_expression})).filter((function(t){return t.mean_expression>0}))),t&&(o=o.slice(0,t));var _,g=Object(l["a"])(o);try{for(g.s();!(_=g.n()).done;){var m,v=_.value,y=[],b=Object(l["a"])(c);try{var x=function(){var t=m.value,e=n.markersByGene[v.gene].find((function(e){return e[n.markerFile.markerKey]===t}));e?y.push(e):y.push(Object(d["a"])(Object(d["a"])(Object(d["a"])(Object(d["a"])({},n.markerFile.markerKey,t),"gene",v.gene),n.markerGenesSizeKey,"0"),"mean_expression",0))};for(b.s();!(m=b.n()).done;)x()}catch(w){b.e(w)}finally{b.f()}a.push.apply(a,y),i.push(Object(s["a"])({},v))}}catch(w){g.e(w)}finally{g.f()}}}}catch(w){u.e(w)}finally{u.f()}return{markersMatrix:a,markersTable:i}},filterRawFields:function(t){},filterDisplayFields:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.displayFields){var e={};Object.entries(this.fields.metadata_labels).forEach((function(t){var n=Object(o["a"])(t,2),r=n[0],a=n[1];a.length<2?e[r]={displayName:r,dataType:"cat",display:!1,excludeReason:"1value"}:r.toLowerCase().includes("ontology")?e[r]={displayName:r,dataType:"cat",display:!1,excludeReason:"ontologyID"}:e[r]={displayName:r,dataType:et(a),display:!0,excludeReason:null}})),this.displayFields=e}var n,r=Object.entries(this.displayFields).sort((function(t,e){var n,r=Object(o["a"])(t,2),a=r[1],i=Object(o["a"])(e,2),s=i[1];return null===(n=a.displayName)||void 0===n?void 0:n.localeCompare(s.displayName)})),a={},i={},s=Object(l["a"])(r);try{for(s.s();!(n=s.n()).done;){var c=Object(o["a"])(n.value,2),u=c[0],d=c[1];if(t){var h,p,f;if(null!==(h=this.displayGroups)&&void 0!==h&&null!==(h=h.cellType)&&void 0!==h&&h.includes(u)){i[u]=d;continue}if(null!==(p=this.displayGroups)&&void 0!==p&&null!==(p=p.donors)&&void 0!==p&&p.includes(u)){i[u]=d;continue}if(null!==(f=this.displayGroups)&&void 0!==f&&null!==(f=f.samples)&&void 0!==f&&f.includes(u)){i[u]=d;continue}}!1===d.display||d.excludeReason&&void 0!==d.excludeReason?i[u]=d:a[u]=d}}catch(g){s.e(g)}finally{s.f()}var _={show:a,hide:i};return _},handleSampleChange:function(){this.cellTypeField=this.activeGroup,this.selectSegmentBy(this.cellTypeField,this.cellCompositionVars.segmentByLabel)},handleMarkerFileChange:function(){m("changing markers file",this.markerFile),this.dotPlotCellType="",this.initMarkers(this.markerFile)},showMarkersByCellType:function(t){if(""!=t){var e=this.topNmarkersByCellType(80,t),n=e.markersMatrix,r=e.markersTable;this.markerGenes=n,this.markerGenesTable=r}else{var a=this.topNmarkersByCellType(80/this.markerCellTypes.length),i=a.markersMatrix,o=a.markersTable;this.markerGenes=i,this.markerGenesTable=o}},selectBioIndex:function(t){var e;this.datasetId=null,f["a"].set(Object(d["a"])({},null===(e=this.renderConfig["parameters"])||void 0===e?void 0:e.datasetId,null)),this.dataLoaded=!1,this.dataReade=!1,this.allMetadata=null,this.metadata=null,this.fields=null,this.coordinates=null,this.layout=-1,this.selecedBI=t,f["a"].set({bioIndex:t}),this.getBImetadata()},selectDataset:function(t){this.handleSelectEvent({id:this.sectionId,value:t})},handleSelectEvent:function(t){if(t.id===this.sectionId){var e,n;if(m(this.sectionId,"Received on-select event:",t),this.datasetId=t.value,null!==(e=this.renderConfig["parameters"])&&void 0!==e&&e.datasetId)f["a"].set(Object(d["a"])({},null===(n=this.renderConfig["parameters"])||void 0===n?void 0:n.datasetId,this.datasetId));this.init()}},selectLayout:function(t){this.layout=Number(t),f["a"].set({layout:this.layout})},selectColorBy:function(t){m("color by:",t),this.cellCompositionVars.colorByField=t},selectSegmentBy:function(t,e){var n=this.cellCompositionVars;this.contExprResults=null,this.contCountResults=null,m("segment by:",{display:t,segment:e,gene:this.geneExpressionVars.selectedGene}),n.displayByLabel=t,n.segmentByLabel=e,""!==e||["violin","dot"].includes(this.stratifyPlotType)||(this.stratifyPlotType="violin"),""===e?n.segmentByCounts2=V(this.fields,this.labelColors,n.displayByLabel,n.segmentByLabel):this.displayFields&&"cat"===this.displayFields[n.segmentByLabel].dataType?n.segmentByCounts2=V(this.fields,this.labelColors,n.segmentByLabel,n.displayByLabel):this.displayFields&&"cont"===this.displayFields[n.segmentByLabel].dataType&&(this.contCountResults=this.parseCellCountScatterData(n.displayByLabel,n.segmentByLabel,this.donorsField),m("contCountResults",this.contCountResults)),""===e?this.geneExpressionVars.selectedGene&&this.selectExpressionBy(n.displayByLabel,n.segmentByLabel):this.displayFields&&this.geneExpressionVars.selectedGene&&"cont"===this.displayFields[n.segmentByLabel].dataType?this.contExprResults=this.parseFacetedScatterData(n.displayByLabel,n.segmentByLabel,this.geneExpressionVars.selectedGene,this.donorsField):this.selectExpressionBy(n.displayByLabel,n.segmentByLabel)},selectSegmentBy2:function(t,e,n){var r=this.cellCompositionVars;m("segment by:",{display:t,segment:e,facet:n}),r.displayByLabel=t,r.segmentByLabel=e,r.facetByLabel=n,r.segmentByCounts2=z(this.fields,this.labelColors,r.displayByLabel,r.segmentByLabel,r.facetByLabel)},selectExpressionBy:function(t,e){var n=this.geneExpressionVars;m("expression by:",{display:t,segment:e}),n.selectedLabel=t,n.subsetLabel=e,n.expressionStats=X(this.fields,this.labelColors,this.expressionData[n.selectedGene],n.selectedGene,n.selectedLabel,n.subsetLabel)},searchGene:function(t){var e=this,n=t.split(/[,\s]+/);
1n.forEach(function(){var t=Object(c["a"])(Se().mark((function t(n){return Se().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getGeneExpression(n.toUpperCase(),!0,!0);case 2:return t.next=4,p["default"].nextTick();case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},geneListClick:function(t){m("geneListClick",t)},geneClick:function(t){if(m("geneClick",t),this.expressionData[t]){var e=this.geneExpressionVars;e.expressionStats=X(this.fields,this.labelColors,this.expressionData[t],t,e.selectedLabel,e.subsetLabel),e.selectedGene=t,""===this.cellCompositionVars.segmentByLabel?this.geneExpressionVars.selectedGene&&this.selectExpressionBy(this.cellCompositionVars.displayByLabel,this.cellCompositionVars.segmentByLabel):this.displayFields&&this.geneExpressionVars.selectedGene&&"cont"===this.displayFields[this.cellCompositionVars.segmentByLabel].dataType?this.contExprResults=this.parseFacetedScatterData(this.cellCompositionVars.displayByLabel,this.cellCompositionVars.segmentByLabel,this.geneExpressionVars.selectedGene,this.donorsField):this.selectExpressionBy(this.cellCompositionVars.displayByLabel,this.cellCompositionVars.segmentByLabel)}else this.getGeneExpression(t,!1,!0)},clearGeneNotFound:function(t){this.genesNotFound.splice(this.genesNotFound.indexOf(t),1)},handleSelectorUpdate:function(t){m("selector updated",t),this.cellCompositionVars.highlightLabels=t.coloredLabels,this.selectColorBy(t.coloredField)},handleSelectorHover:function(t){m("selector hovered",t),this.cellCompositionVars.highlightLabel=t.hoveredLabel}}}),Te=Ie,Be=(n("f392"),Object(C["a"])(Te,r,a,!1,null,"21faac0f",null));e["a"]=Be.exports},aae0:function(t,e,n){"use strict";n("abd7")},abd7:function(t,e,n){},ace5:function(t,e,n){"use strict";n("edb2")},ad1d:function(t,e,n){"use strict";n("06eb")},ae39:function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("3835"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("53ca"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("5530"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("ade3"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("4f96"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("a4d3"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("e01a"),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("caad"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("a15b"),core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("14d9"),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("13d5"),core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("fb6a"),core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_13__),
1core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("e9c4"),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("6b93"),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("4fad"),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("4d63"),core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("c607"),core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_es_regexp_dot_all_js__WEBPACK_IMPORTED_MODULE_21__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_22__),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("2c3e"),core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(core_js_modules_es_regexp_sticky_js__WEBPACK_IMPORTED_MODULE_23__),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("00b4"),core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_24___default=__webpack_require__.n(core_js_modules_es_regexp_test_js__WEBPACK_IMPORTED_MODULE_24__),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("25f0"),core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_25__),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("2532"),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_26__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_27___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_27__),core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__("5b81"),core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(core_js_modules_es_string_replace_all_js__WEBPACK_IMPORTED_MODULE_28__),core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__("1276"),core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(core_js_modules_es_string_split_js__WEBPACK_IMPORTED_MODULE_29__),core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__("498a"),core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_30___default=__webpack_require__.n(core_js_modules_es_string_trim_js__WEBPACK_IMPORTED_MODULE_30__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__("0643"),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_31__),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__("2382"),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_32__),
1core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__("4e3e"),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_33___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_33__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__("a573"),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_34___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_34__),core_js_modules_esnext_iterator_reduce_js__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__("9d4a"),core_js_modules_esnext_iterator_reduce_js__WEBPACK_IMPORTED_MODULE_35___default=__webpack_require__.n(core_js_modules_esnext_iterator_reduce_js__WEBPACK_IMPORTED_MODULE_35__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_36___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_36__),convertData=function convertData(CONVERT,DATA,PHENOTYPE_MAP,SHARED_RESOURCE){var convertedData=[],joinValues=function(t,e,n){for(var r="",a=t.length,i=0;i<a;i++)r+=i<a-1?n[t[i]]+e:n[t[i]];return r},joinMultiValues=function(t,e,n){for(var r="",a=t.length,i=0;i<a;i++)r+=i<a-1?n[t[i]]+e[i]:n[t[i]];if(e.length>=t.length)for(var o=e.length-(e.length-t.length+1),s=o;s<e.length;s++)r+=e[s];return r},scoreColumns=function(t,e,n){var r=0,a=t.length;return t.map((function(t){var a=e[t].type;switch(a){case"boolean":var i=e[t]["value to score"][n[t]];r+=i;break}})),r/a},formatLocus=function(t,e,n,r){var a=r[t]+":";return a+=Math.ceil((r[e]+r[n])/2),a},array2String=function(t,e){var n="";return t.map((function(t){n+=t+e})),n.slice(0,-1)},getParameterByName=function(t,e){e||(e=window.location.href),t=t.replace(/[\[\]]/g,"\\$&");var n=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)"),r=n.exec(e);return r?r[2]?decodeURIComponent(r[2].replace(/\+/g," ")):"":null},applyConvert=function applyConvert(d,CONVERT,PHENOTYPE_MAP,SHARED_RESOURCE){var tempObj={};return CONVERT.map((function(c){var cType=c.type,rawValue=d[c["raw field"]]?d[c["raw field"]]:c["if no value"]?c["if no value"]:null;switch(0===d[c["raw field"]]&&(rawValue="0"),cType){case"from parameter":var param=c["parameter"];tempObj[c["field name"]]=getParameterByName(param),d[c["field name"]]=tempObj[c["field name"]];break;case"sub to top":var subList=d;if(c["sub path"]&&c["sub path"].map((function(t){subList=subList[t]})),subList){var subRow;if(c["copy by"])switch(c["copy by"]){case"condition":"equal to"==c["condition"]["type"]&&subList.map((function(t){t[c["condition"]["field"]]==c["condition"]["value"]&&(subRow=t)}));break}tempObj[c["field name"]]=subRow[c["raw field"]]}break;case"join":tempObj[c["field name"]]=joinValues(c["fields to join"],c["join by"],d),d[c["field name"]]=tempObj[c["field name"]];break;case"join multi":tempObj[c["field name"]]=joinMultiValues(c["fields to join"],c["join by"],d),d[c["field name"]]=tempObj[c["field name"]];break;case"split":var newFields=c["field name"],newFieldValues=[],string2Split=tempObj[c["field to split"]]?tempObj[c["field to split"]]:d[c["field to split"]];if(string2Split){var loopIndex=1;c["split by"].map((function(t){var e=string2Split.split(t),n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_4__["a"])(e),r=n[0],a=n.slice(1);string2Split=a.join(t),loopIndex<c["split by"].length?newFieldValues.push(r):(loopIndex=c["split by"].length)&&(newFieldValues.push(r),newFieldValues.push(a.join(t))),loopIndex++})),loopIndex=0,newFields.map((function(t){tempObj[t]=newFieldValues[loopIndex],d[t]=tempObj[t],loopIndex++}))}break;case"get locus":tempObj[c["field name"]]=formatLocus(c["chromosome"],c["start"],c["end"],d),d[c["field name"]]=tempObj[c["field name"]];break;case"calculate":var calType=c["calculation type"];switch(calType){case"-log10":tempObj[c["field name"]]=-Math.log10(d[c["raw field"]]),d[c["field name"]]=tempObj[c["field name"]];break;case"math":var calcString="";c["expression"].map((function(t){var e=["+","-","*","/","(",")"].includes(t)||"number"===typeof t?t:tempObj[t]||0===tempObj[t]?0===tempObj[t]?0:tempObj[t]:0===d[t]?0:d[t];calcString+=e})),tempObj[c["field name"]]=eval(calcString),(c["min number"]||0===c["min number"])&&tempObj[c["field name"]]<c["min number"]&&(tempObj[c["field name"]]=c["min number"]),(c["max number"]||0===c["max number"])&&tempObj[c["field name"]]>c["max number"]&&(tempObj[c["field name"]]=c["max number"]),d[c["field name"]]=tempObj[c["field name"]]}break;case"js math":var calFunc=c["method"];tempObj[c["field name"]]=Math[calFunc](d[c["raw field"]]),d[c["field name"]]=tempObj[c["field name"]];break;case"raw":rawValue&&(tempObj[c["field name"]]=rawValue,d[c["field name"]]=tempObj[c["field name"]]);break;case"map name":var map="shared resource"==c["map"]?SHARED_RESOURCE[c["map name"]]:c["map"];tempObj[c["field name"]]=map[rawValue];break;
1case"string to number":tempObj[c["field name"]]=Number(d[c["raw field"]]),d[c["field name"]]=tempObj[c["field name"]];break;case"score columns":tempObj[c["field name"]]=scoreColumns(c["fields to score"],c["score by"],d),d[c["field name"]]=tempObj[c["field name"]];break;case"array to string":tempObj[c["field name"]]=array2String(d[c["raw field"]],c["separate by"]),d[c["field name"]]=tempObj[c["field name"]];break;case"string to array":var sArray=d[c["raw field"]].split(c["separate by"]),takeIndex=0===c["take index"]||c["take index"]?sArray[c["take index"]]:null;tempObj[c["field name"]]=takeIndex?sArray[c["take index"]]:sArray,d[c["field name"]]=tempObj[c["field name"]];break;case"replace characters":var replaceArr=c["replace"],rawString=d[c["raw field"]],newString="",sIndex=0;replaceArr.map((function(t){newString=0==sIndex?rawString:newString,rawString&&(newString=newString.replaceAll(t.from,t.to)),sIndex++})),tempObj[c["field name"]]=newString,d[c["field name"]]=tempObj[c["field name"]];break;case"kp phenotype name":var pID=d[c["raw field"]];tempObj[c["field name"]]=PHENOTYPE_MAP[pID]?PHENOTYPE_MAP[pID].description:pID,d[c["field name"]]=tempObj[c["field name"]];break;case"boolean to string":var value=!0===d[c["raw field"]]||1==d[c["raw field"]]?"true":!1===d[c["raw field"]]||0===d[c["raw field"]]?"false":"";tempObj[c["field name"]]=value;break;case"phenotype probability":var background=c["rare"].includes(d[c["group"]])?.005:c["common"].includes(d[c["group"]])?.05:0,beta=d[c["beta"]],probability=Math.exp(beta+Math.log(background/(1-background)))/(1+Math.exp(beta+Math.log(background/(1-background))));tempObj[c["field name"]]=probability;break}})),tempObj},_flatten=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t instanceof Object?Object.keys(t).reduce((function(n,r){return t instanceof Array?Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])({},n),_flatten(t[r],e+"["+r+"].")):Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])({},n),_flatten(t[r],e+r+"."))}),{}):Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_3__["a"])({},e.replace(/\.$/g,""),t)};if("no convert"!=CONVERT){var data2Rows=CONVERT.filter((function(t){return"data to rows"==t.type}));if(data2Rows.length>0){var rowsData=[];data2Rows.map((function(t){DATA.map((function(e){var n=e[t["raw field"]],r=t["group by"];if(n){var a={};r.map((function(t,e){a[t]=[],a["_key"+e]=[]}));var i=_flatten(n),o=Object.keys(i);o.map((function(t){r.map((function(e,n){t.includes(e)&&(a[e].push(i[t]),a["_key"+n].push(t))}))}));for(var s=a[r[0]].length,l=function(t){var e={};r.map((function(n,r){e[n]=a[n][t],e["_key"+r]=a["_key"+r][t]})),rowsData.push(e)},c=0;c<s;c++)l(c)}}))})),DATA=rowsData}DATA.map((function(t){var e=applyConvert(t,CONVERT,PHENOTYPE_MAP,SHARED_RESOURCE),n=Object.keys(e),r={};n.map((function(t){if("object"==Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__["a"])(e[t])&&1==Array.isArray(e[t])&&e[t].length>0){var n=[];e[t].map((function(t){if("object"==Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__["a"])(t)&&0==Array.isArray(t)){var e=applyConvert(t,CONVERT,PHENOTYPE_MAP,SHARED_RESOURCE);n.push(e)}})),r[t]=n}else r[t]=e[t]})),convertedData.push(e)}))}else convertedData=DATA;return convertedData},csv2Json=function(t){var e=CSVToArray(t,","),n=e[0];e.shift();var r=[];return e.map((function(t){if(t.length>1){for(var e={},a=0;a<t.length;a++)e[n[a]]=1==testNumber(t[a])?Number(t[a]):breakLines(t[a]);r.push(e)}})),r},tsv2Json=function(t){var e=t.split("\n"),n=e.shift().split("\t"),r=[],a=function(t){return isNaN(t)||""===t.trim()?t:Number(t)};return e.forEach((function(t){var e=t.split("\t"),i={};
1n.forEach((function(t,n){i[t]=a(e[n])})),r.push(i)})),r},flatJson=function(t){var e=[];t.map((function(t){for(var n={},r=0,a=Object.entries(t);r<a.length;r++){var i=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(a[r],2),o=i[0],s=i[1];if("string"==typeof s&&s.includes(","))n[o]='"'+s+'"';else if("object"==Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_1__["a"])(s)){var l=JSON.stringify(s);l=l.replaceAll('"',""),l.includes(",")&&(l='"'+l+'"'),n[o]=l}else n[o]=s}e.push(n)}));var n=[];return e.map((function(t){var e=_flatten2(t);n.push(e)})),n},_flatten2=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t instanceof Object?Object.keys(t).reduce((function(n,r){return t instanceof Array?Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])({},n),_flatten2(t[r],e+"["+r+"].")):Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])(Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_2__["a"])({},n),_flatten2(t[r],e+r+"."))}),{}):Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_3__["a"])({},e.replace(/\.$/g,""),t)},testNumber=function(t){var e=/^-?[\d.]+(?:e-?\d+)?$/;return e.test(t)},breakLines=function(t){if(t){var e=t.replaceAll("\n","<br>");return e}},CSVToArray=function(t,e){e=e||",";var n=new RegExp("(\\"+e+'|\\r?\\n|\\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^"\\'+e+"\\r\\n]*))","gi"),r=[[]],a=null;while(a=n.exec(t)){var i,o=a[1];o.length&&o!==e&&r.push([]),i=a[2]?a[2].replace(new RegExp('""',"g"),'"'):a[3],r[r.length-1].push(i)}return r},object2Array=function(t,e,n){for(var r=[],a=e["fields to compare"][0],i=e["fields to compare"],o=function(){var t=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(l[s],2),e=(t[0],t[1]),n=Object.keys(e[a]);n.map((function(t){for(var n={},a=0,o=Object.entries(e);a<o.length;a++){var s=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(o[a],2),l=s[0],c=s[1];i.includes(l)?n[l]=c[t]:n[l]=c}r.push(n)}))},s=0,l=Object.entries(t);s<l.length;s++)o();return r};__webpack_exports__["a"]={convertData:convertData,csv2Json:csv2Json,tsv2Json:tsv2Json,object2Array:object2Array,flatJson:flatJson}},af7f:function(t,e,n){"use strict";n("82e0")},b11e:function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("3835"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("2909"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("a4d3"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("e01a"),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("99af"),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("cb29"),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("a630"),core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("caad"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("14d9"),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("fb6a"),core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("4e82"),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("a434"),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_13__),
1core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("e9c4"),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("6b93"),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_math_sign_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("2af1"),core_js_modules_es_math_sign_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_math_sign_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("4fad"),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_21__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_22__),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("6062"),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_23__),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("1e70"),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_24___default=__webpack_require__.n(core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_24__),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("79a4"),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_25__),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("c1a1"),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_26__),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__("8b00"),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_27___default=__webpack_require__.n(core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_27__),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__("a4e7"),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_28__),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__("1e5a"),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_29__),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__("72c3"),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_30___default=__webpack_require__.n(core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_30__),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__("2532"),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_31__),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_32__),
1core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__("466d"),core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_33___default=__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_33__),core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__("2ca0"),core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_34___default=__webpack_require__.n(core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_34__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__("0643"),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_35___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_35__),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__("2382"),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_36___default=__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_36__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__("4e3e"),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_37___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_37__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__("a573"),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_38___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_38__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_39___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_39__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_40___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_40__),vue__WEBPACK_IMPORTED_MODULE_41__=__webpack_require__("2b0e"),lodash__WEBPACK_IMPORTED_MODULE_42__=__webpack_require__("2ef0"),lodash__WEBPACK_IMPORTED_MODULE_42___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_42__),bootstrap_vue__WEBPACK_IMPORTED_MODULE_43__=__webpack_require__("b1e0"),_utils_bioIndexUtils__WEBPACK_IMPORTED_MODULE_44__=__webpack_require__("e60d"),_components_researchPortal_vectorPlots_ResearchPheWasPlotVector_vue__WEBPACK_IMPORTED_MODULE_45__=__webpack_require__("cf0e");vue__WEBPACK_IMPORTED_MODULE_41__["default"].use(bootstrap_vue__WEBPACK_IMPORTED_MODULE_43__["a"]),__webpack_exports__["a"]=vue__WEBPACK_IMPORTED_MODULE_41__["default"].component("ResearchPigeanPhewasPlot",{components:{pheWasPlotVector:_components_researchPortal_vectorPlots_ResearchPheWasPlotVector_vue__WEBPACK_IMPORTED_MODULE_45__["a"]},props:["canvasId","phenotypeMap","phenotypesData","renderConfig","pkgData","pkgDataSelected","colors","plotMargin","filter","options","sectionId","utils","plotName","top1500","linkPhenotypes","isPigean","matchingHoverDots"],data:function(){return{pheWasData:null,pheWasPosData:{},spaceBy:7,trigger:0,hoverItems:{},showCanvas:!0,selectedYAxisFields:[],filterByThreshold:!0,selectedGroups:[],showGroupDropdown:!1}},modules:{},computed:{hasMultipleYAxisFields:function(){return!!(this.renderConfig["y axis fields"]&&Array.isArray(this.renderConfig["y axis fields"])&&this.renderConfig["y axis fields"].length>0)},yAxisFields:function(){return this.hasMultipleYAxisFields?this.renderConfig["y axis fields"]:[]},primaryYAxisField:function(){return this.hasMultipleYAxisFields&&this.renderConfig["primary y axis field"]?this.renderConfig["primary y axis field"]:this.renderConfig["y axis field"]||null},currentYAxisField:function(){return 0===this.selectedYAxisFields.length?this.primaryYAxisField:this.selectedYAxisFields[0]},greaterThan:function(){return!!this.renderConfig["label in black"]&&"greater than"===this.renderConfig["label in black"]},phenotypeMapConfig:function(){return"null"==this.renderConfig["phenotype map"]?null:"kp phenotype map"==this.renderConfig["phenotype map"]?"kpPhenotypeMap":null},renderData:function(){var t=this;this.showCanvas=!0;var e={data:[]};if(this.phenotypesData){var n=Object(lodash__WEBPACK_IMPORTED_MODULE_42__["cloneDeep"])(this.phenotypesData),r=this.hasMultipleYAxisFields?this.primaryYAxisField:this.renderConfig["y axis field"]||null;
1n.forEach((function(e){e["rawPValue"]=t.getPValue(e,r)})),n=n.sort((function(t,e){return t.rawPValue-e.rawPValue})),this.top1500&&(n=n.slice(0,1500)),this.greaterThan&&n.reverse(),n.map((function(n){if(t.hasMultipleYAxisFields){var r=t.yAxisFields;1!=t.renderConfig["convert y -log10"]&&"true"!=t.renderConfig["convert y -log10"]||r.forEach((function(t){void 0!==n[t]&&null!==n[t]&&(n[t+"-log10"]=-Math.log10(Math.max(Number(n[t]),1e-300)))}))}else if(1==t.renderConfig["convert y -log10"]||"true"==t.renderConfig["convert y -log10"]){var a=t.renderConfig["y axis field"];a&&(n[a+"-log10"]=-Math.log10(n["rawPValue"]))}if("kpPhenotypeMap"==t.phenotypeMapConfig){var i=t.renderConfig["render by"];t.phenotypeMap[n[i]]&&e["data"].push(n)}else null==t.phenotypeMapConfig&&e["data"].push(n)}))}if(this.filter&&(e.data=e.data.filter(this.filter)),this.filterByThreshold&&this.renderConfig["thresholds"]&&this.renderConfig["thresholds"].length>0){var a=Number(this.renderConfig["thresholds"][0]),i=this.hasMultipleYAxisFields?this.selectedYAxisFields.length>0?this.selectedYAxisFields:this.yAxisFields:[this.renderConfig["y axis field"]];e.data=e.data.filter((function(e){var n=!1;return i.forEach((function(r){var i;if("true"==t.renderConfig["convert y -log10"]){var o=r+"-log10";i=void 0!==e[o]?Number(e[o]):null}else i=void 0!==e[r]&&null!==e[r]?Number(e[r]):null;null===i||isNaN(i)||(t.greaterThan?i>=a&&(n=!0):i<=a&&(n=!0))})),n}))}if(this.selectedGroups.length>0&&this.availableGroups.length>0){var o=this.renderConfig["group by"];e.data=e.data.filter((function(e){var n;if("kpPhenotypeMap"==t.phenotypeMapConfig){var r=e[t.renderConfig["render by"]];n=t.phenotypeMap[r]&&t.phenotypeMap[r].group?t.phenotypeMap[r].group:"N/A"}else null==t.phenotypeMapConfig&&o&&(n=null!=e[o]&&void 0!==e[o]&&""!==e[o]?e[o]:"N/A");return n&&t.selectedGroups.includes(n)}))}return e.data&&e.data.length>0?e:(this.showCanvas=!1,null)},adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e},availableGroups:function(){var t=this;if(!this.phenotypesData||0===this.phenotypesData.length)return[];var e=new Set,n=this.renderConfig["group by"],r=!1;return"kpPhenotypeMap"==this.phenotypeMapConfig?this.phenotypesData.forEach((function(n){var a=n[t.renderConfig["render by"]];t.phenotypeMap[a]&&t.phenotypeMap[a].group?e.add(t.phenotypeMap[a].group):r=!0})):null==this.phenotypeMapConfig&&n&&this.phenotypesData.forEach((function(t){null!=t[n]&&void 0!==t[n]&&""!==t[n]?e.add(t[n]):r=!0})),r&&e.add("N/A"),Array.from(e).sort()}},watch:{renderData:{handler:function(t){var e=this;t&&t.data&&t.data.length>0&&this.$nextTick((function(){e.renderPheWas()}))},immediate:!0},selectedYAxisFields:{handler:function(){var t=this;this.$nextTick((function(){t.renderPheWas()}))},deep:!0},selectedGroups:{handler:function(){var t=this;this.$nextTick((function(){t.renderPheWas()}))},deep:!0},phenotypesData:{handler:function(t,e){var n=this;this.$nextTick((function(){n.availableGroups.length>0&&0===n.selectedGroups.length&&(n.selectedGroups=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(n.availableGroups))})),this.$nextTick((function(){n.renderPheWas()}))},immediate:!0,deep:!0},filterByThreshold:function(){var t=this;this.$nextTick((function(){t.renderPheWas()}))},matchingHoverDots:function(t){}},created:function(){},mounted:function(){var t=this;window.addEventListener("resize",this.onResize),this.hasMultipleYAxisFields&&this.yAxisFields.length>0&&(this.selectedYAxisFields=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(this.yAxisFields)),document.addEventListener("click",this.handleClickOutside),this.$nextTick((function(){t.renderData&&t.renderData.data&&t.renderData.data.length>0&&t.renderPheWas()}))},beforeDestroy:function(){window.removeEventListener("resize",this.onResize),document.removeEventListener("click",this.handleClickOutside)},methods:{getPValue:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e||this.renderConfig["y axis field"]||this.primaryYAxisField;return n&&void 0!==t[n]&&null!==t[n]?"string"==typeof t[n]?Number(t[n]):t[n]:0},toggleYAxisField:function(t){var e=this,n=this.selectedYAxisFields.indexOf(t);n>-1?(this.selectedYAxisFields.splice(n,1),0===this.selectedYAxisFields.length&&this.primaryYAxisField&&this.selectedYAxisFields.push(this.primaryYAxisField)):this.selectedYAxisFields.push(t),this.$nextTick((function(){e.renderPheWas()}))},getFieldShape:function(t){var e=this;if(!this.hasMultipleYAxisFields)return"circle";var n=this.yAxisFields,r=n.indexOf(t);if(-1===r)return"circle";if(t===this.primaryYAxisField)return"circle";var a=n.filter((function(t){return t!==e.primaryYAxisField})),i=a.indexOf(t);return 0===i?"square":1===i?"diamond":"circle"},getFieldShapeLabel:function(t){var e=this.getFieldShape(t),n={circle:"â",square:"â ",diamond:"â"};return n[e]||"â"},getFieldDisplayLabel:function(t){if(this.hasMultipleYAxisFields&&this.renderConfig["y axis field labels"]&&Array.isArray(this.renderConfig["y axis field labels"])){var e=this.yAxisFields.indexOf(t);if(e>=0&&e<this.renderConfig["y axis field labels"].length)return this.renderConfig["y axis field labels"][e]}return t},toggleGroup:function(t){var e=this.selectedGroups.indexOf(t);e>-1?this.selectedGroups.splice(e,1):this.selectedGroups.push(t)},toggleAllGroups:function(t){t.target.checked?this.selectedGroups=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(this.availableGroups):this.selectedGroups=[]},handleClickOutside:function(t){var e=t.target.closest(".dropdown-wrapper");!e&&this.showGroupDropdown&&(this.showGroupDropdown=!1)},applyOpacityToColor:function(t,e){if(t.startsWith("#")){var n=t.slice(1),r=parseInt(n.substr(0,2),16),a=parseInt(n.substr(2,2),16),i=parseInt(n.substr(4,2),16);return"rgba(".concat(r,", ").concat(a,", ").concat(i,", ").concat(e,")")}if(t.startsWith("rgba")){var o=t.match(/\d+/g);if(o&&o.length>=3)return"rgba(".concat(o[0],", ").concat(o[1],", ").concat(o[2],", ").concat(e,")")}return t},downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.canvasId+"_pheWasPlot"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_pheWas_plot_"+this.canvasId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},openPage:function(t,e){this.utils.uiUtils.openPage(t,e)},addPhenotype:function(t){this.$parent.$parent.pushCriterionPhenotype(t),window.location.href="#associations-table"},groupData:function(t){var e=this,n=[],r={},a=this.renderConfig["group by"];
1if("kpPhenotypeMap"==this.phenotypeMapConfig){for(var i=0,o=Object.entries(this.phenotypeMap);i<o.length;i++){var s=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(o[i],2),l=(s[0],s[1]);n.push(l)}n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(n.map((function(t){return t.group})))).sort()}else null==this.phenotypeMapConfig&&a&&(n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(t.data.map((function(t){var e=t[a];return null!=e&&void 0!==e&&""!==e?e:"N/A"})))).sort());return"kpPhenotypeMap"!=this.phenotypeMapConfig||n.includes("N/A")||(n.push("N/A"),n.sort()),n.map((function(t){r[t]=[]})),t.data.map((function(t){var n;if("kpPhenotypeMap"==e.phenotypeMapConfig){var i=t[e.renderConfig["render by"]];n=e.phenotypeMap[i]&&e.phenotypeMap[i].group?e.phenotypeMap[i].group:"N/A"}else if(null==e.phenotypeMapConfig&&a){var o=t[a];n=null!=o&&void 0!==o&&""!==o?o:"N/A"}n&&r[n].push(t)})),r},onResize:function(){this.renderPheWas()},checkPosition:function(t,e){var n=this,r=t,a=r.target.getBoundingClientRect(),i=r.clientX-a.left,o=r.clientY-a.top,s=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,l=s?{left:s.left,right:s.right,top:s.top,bottom:s.bottom,bump:10}:{left:this.plotMargin.leftMargin/2,right:this.plotMargin.leftMargin/2*1.5,top:this.plotMargin.bottomMargin/2*3.5,bottom:this.plotMargin.bottomMargin/2*2.5,bump:10},c=Math.ceil(r.clientY-a.top),u=Math.ceil(r.clientX-a.left),d=document.querySelector("#"+this.canvasId+"pheWasInfoBox"),h=(document.querySelector("#"+this.canvasId+"pheWasInfoBoxContent"),document.querySelector("#"+this.canvasId+"info_box_close"));if(0==d.getAttribute("class").includes("fixed")){var p="";if(this.hoverItems={},u>=l.left/2&&u<=a.width-l.right/2)for(var f=0,_=Object.entries(this.pheWasPosData);f<_.length;f++){var g=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_[f],2),m=g[0],v=g[1],y=m.split("-");c>=y[0]&&c<=y[1]&&v.map((function(t){u>=t.start&&u<=t.end&&(n.hoverItems[t.id]=t,p+="<strong>".concat(t.name,"</strong><br />"),n.renderConfig["hover content"].map((function(e){p+=e+":"+t.data[e]+"<br />"})))}))}"hover"==e&&(Object.keys(this.hoverItems).length>0&&this.isPigean&&this.$emit("dotsHovered",JSON.stringify(this.hoverItems)),""==p?0==d.getAttribute("class").includes("fixed")&&(d.setAttribute("class","hidden"),h.setAttribute("class","hidden")):0==d.getAttribute("class").includes("fixed")&&(d.setAttribute("class","phe-was-info-box"),h.setAttribute("class","hidden"),u<a.width-300?(d.style.left=i+25+"px",d.style.top=o+this.spaceBy+"px"):(d.style.left=i-325+"px",d.style.width="300px !important",d.style.top=o+this.spaceBy+"px"))),"click"==e&&(h.setAttribute("class","fixed-info-box-close"),""==p?d.setAttribute("class","hidden"):(d.setAttribute("class","phe-was-info-box fixed"),u<a.width-300?(d.style.left=i+25+"px",d.style.top=o+this.spaceBy+"px"):(d.style.left=i-325+"px",d.style.width="300px !important",d.style.top=o+this.spaceBy+"px")))}},renderPheWas:function renderPheWas(){var _this13=this;if(this.renderData&&this.renderData.data&&0!==this.renderData.data.length){if(this.renderConfig["thresholds"]&&"calculate"==this.renderConfig["thresholds"]){var threshholds=[];this.renderConfig["thresholds calculate"].map((function(expression){var calcString="";expression.map((function(t){var e=["+","-","*","/","(",")"].includes(t)||"number"===typeof t?t:"string"===typeof t&&"data length"==t?_this13.renderData.data.length:null;calcString+=e}));var threshold=eval(calcString);threshholds.push(threshold)})),this.renderConfig["thresholds"]=threshholds}var wrapper=document.querySelector("#"+this.canvasId+"pheWasPlotWrapper"),canvas=document.querySelector("#"+this.canvasId+"pheWasPlot");if(canvas&&wrapper){var canvasWidth=this.renderConfig.width?2*this.renderConfig.width:2*wrapper.clientWidth,canvasHeight=2*Number(this.renderConfig["height"]),c,ctx;c=document.querySelector("#"+this.canvasId+"pheWasPlot"),c.setAttribute("width",canvasWidth),c.setAttribute("height",canvasHeight),c.setAttribute("style","width:"+canvasWidth/2+"px;
1height:"+canvasHeight/2+"px;"),ctx=c.getContext("2d"),ctx.clearRect(0,0,canvasWidth,canvasHeight),this.pheWasPosData={};for(var renderData=this.groupData(this.renderData),groups={},totalNum=0,minY=null,maxY=null,fieldsForMinMax=this.hasMultipleYAxisFields?this.yAxisFields:[this.renderConfig["y axis field"]],_i3=0,_Object$entries3=Object.entries(renderData);_i3<_Object$entries3.length;_i3++){var _Object$entries3$_i=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries3[_i3],2),key=_Object$entries3$_i[0],value=_Object$entries3$_i[1];groups[key]=value.length,totalNum+=value.length,value.map((function(t){fieldsForMinMax.forEach((function(e){var n;if("true"==_this13.renderConfig["convert y -log10"]){var r=e+"-log10";n=void 0!==t[r]?Number(t[r]):null}else n=void 0!==t[e]&&null!==t[e]?Number(t[e]):null;null===n||isNaN(n)||(minY=null==minY||n<minY?n:minY,maxY=null==maxY||n>maxY?n:maxY)}))}))}minY=Math.floor(minY),maxY=Math.ceil(maxY),minY==maxY&&(minY-=.5,maxY+=.5),ctx.stroke();var customPlotMargin=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,plotMargin=customPlotMargin?{left:customPlotMargin.left,right:customPlotMargin.right,top:customPlotMargin.top,bottom:customPlotMargin.bottom,bump:10}:{left:this.plotMargin.leftMargin/2,right:this.plotMargin.leftMargin/2*1.5,top:this.plotMargin.bottomMargin/2*3.5,bottom:this.plotMargin.bottomMargin/2*2.5,bump:10};this.renderData.data.length>1&&this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"y",5,minY,maxY,this.renderConfig["y axis label"]),this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"x",null,null,null,this.renderConfig["x axis label"]),this.renderTicksByGroup(ctx,canvasWidth,canvasHeight,plotMargin,"x",groups);var xStep=(canvasWidth-plotMargin.left-plotMargin.right)/totalNum,yMax=maxY,yMin=minY,yStep=(canvasHeight-(plotMargin.top+plotMargin.bottom))/(yMax-yMin);this.renderConfig["thresholds"].map((function(t){ctx.beginPath();var e="true"==_this13.renderConfig["convert y -log10"]?-Math.log10(Number(t)):Number(t),n=-minY+e,r=canvasHeight-plotMargin.bottom-n*yStep;ctx.setLineDash([20,10]),ctx.moveTo(plotMargin.left-plotMargin.bump,r),ctx.lineTo(canvasWidth+plotMargin.bump-plotMargin.right,r),ctx.strokeStyle="#FFAA00",ctx.lineWidth=2,ctx.stroke(),ctx.closePath()})),ctx.setLineDash([]);var groupsArr=Object.keys(groups).sort(),dotIndex=0,pigeanColors={};if(totalNum>1)for(var _loop=function(){var t=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries4[_i4],2),e=t[0],n=t[1],r=groupsArr.indexOf(e)%_this13.colors.length,a=_this13.colors[r],i="#00000075";pigeanColors[e]=a;var o=0,s=0,l=plotMargin.left+xStep*dotIndex+xStep*n.length-24;n.map((function(t){var e=_this13.renderConfig["render by"],n=null==_this13.phenotypeMapConfig||"kpPhenotypeMap"==_this13.phenotypeMapConfig&&!!_this13.phenotypeMap[t[e]];if(n){var r,c=plotMargin.left+xStep*(dotIndex+.5),u=t[_this13.renderConfig["render by"]];"kpPhenotypeMap"==_this13.phenotypeMapConfig?r=_this13.phenotypeMap[u]&&_this13.phenotypeMap[u]["description"]?_this13.phenotypeMap[u]["description"]:u:null==_this13.phenotypeMapConfig&&(r=u);var d=_this13.hasMultipleYAxisFields?_this13.yAxisFields:[_this13.renderConfig["y axis field"]],h=d.length>1;if(d.forEach((function(e,n){if(!(_this13.hasMultipleYAxisFields&&_this13.selectedYAxisFields.length>0)||_this13.selectedYAxisFields.includes(e)){var o,s=_this13.getFieldShape(e);if("true"==_this13.renderConfig["convert y -log10"]){var l=e+"-log10";o=void 0!==t[l]?Number(t[l]):null}else o=void 0!==t[e]&&null!==t[e]&&0!=t[e]?Number(t[e]):null;if(null!==o&&!isNaN(o)){var u=-minY+o,d=canvasHeight-plotMargin.bottom-u*yStep,p=1;h&&(p=e===_this13.primaryYAxisField?1:.5);var f=_this13.applyOpacityToColor(a,p),_=_this13.applyOpacityToColor(i,p);if(e!==_this13.primaryYAxisField&&_this13.hasMultipleYAxisFields||(_this13.greaterThan?t.rawPValue>=Number(_this13.renderConfig["thresholds"][0]):t.rawPValue<=Number(_this13.renderConfig["thresholds"][0])),"null"!=_this13.renderConfig["beta field"]&&_this13.renderConfig["beta field"]&&t[_this13.renderConfig["beta field"]]&&0!=t[_this13.renderConfig["beta field"]]?_this13.renderTriangle(ctx,c,d,f,_,Math.sign(t[_this13.renderConfig["beta field"]])):_this13.renderShape(ctx,c,d,f,_,s),e===_this13.primaryYAxisField||!_this13.hasMultipleYAxisFields&&0===n){var g=Math.round(d/2)-5,m=
1Math.round(d/2)+5,v=g+"-"+m,y={};_this13.renderConfig["hover content"].map((function(e){y[e]=t[e]}));var b={start:Math.round(c/2)-5,end:Math.round(c/2)+5,data:y,name:r,id:t[_this13.renderConfig["render by"]]};_this13.pheWasPosData[v]||(_this13.pheWasPosData[v]=[]),_this13.pheWasPosData[v].push(b)}}}})),d.length>0){var p,f=_this13.hasMultipleYAxisFields?_this13.primaryYAxisField:d[0];if("true"==_this13.renderConfig["convert y -log10"]){var _=f+"-log10";p=void 0!==t[_]?Number(t[_]):null}else p=void 0!==t[f]&&null!==t[f]&&0!=t[f]?Number(t[f]):null;if(null!==p&&!isNaN(p)){var g=-minY+p,m=canvasHeight-plotMargin.bottom-g*yStep,v=_this13.greaterThan?t.rawPValue>=Number(_this13.renderConfig["thresholds"][0]):t.rawPValue<=Number(_this13.renderConfig["thresholds"][0]);0==o&&(s=c);var y=s+24*o;y=c>y?c:y,(0==o||y<l)&&(ctx.font="22px Arial",ctx.fillStyle=v?"#000000":"#00000050",ctx.save(),ctx.translate(y+10,m-24),ctx.rotate(90*-Math.PI/180),ctx.textAlign="start",ctx.fillText(r,0,0),ctx.restore(),ctx.lineWidth=1,ctx.moveTo(c,m),ctx.lineTo(y,m-20),ctx.strokeStyle="#00000080",ctx.stroke()),o++}}dotIndex++}})),r++},_i4=0,_Object$entries4=Object.entries(renderData);_i4<_Object$entries4.length;_i4++)_loop();else for(var _loop2=function(){var t=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries5[_i5],2),e=t[0],n=t[1],r=groupsArr.indexOf(e)%_this13.colors.length,a=_this13.colors[r];pigeanColors[e]=a;var i="#00000075";n.map((function(t){var e=canvasWidth/2,n=canvasHeight/2,r=_this13.renderConfig["render by"],o=null==_this13.phenotypeMapConfig||"kpPhenotypeMap"==_this13.phenotypeMapConfig&&!!_this13.phenotypeMap[t[r]];if(o){t[_this13.renderConfig["beta field"]]&&0!=t[_this13.renderConfig["beta field"]]?_this13.renderTriangle(ctx,e,n,a,i,Math.sign(t[_this13.renderConfig["beta field"]])):_this13.renderDot(ctx,e,n,a,i);var s,l=t[r];"kpPhenotypeMap"==_this13.phenotypeMapConfig?s=_this13.phenotypeMap[l]&&_this13.phenotypeMap[l]["description"]?_this13.phenotypeMap[l]["description"]:l:null==_this13.phenotypeMapConfig&&(s=l);var c=Math.round(n)-5,u=Math.round(n)+5,d=c+"-"+u,h={};_this13.renderConfig["hover content"].map((function(e){h[e]=t[e]}));var p={start:Math.round(e)-5,end:Math.round(e)+5,data:h,name:s};_this13.pheWasPosData[d]||(_this13.pheWasPosData[d]=[]),_this13.pheWasPosData[d].push(p),ctx.font="26px Arial",ctx.fillStyle="#000000",ctx.textAlign="start",ctx.fillText(s,e+15,n);var f=1;_this13.renderConfig["hover content"].map((function(r){ctx.fillText(r+": "+t[r],e+15,n+40*f),f++}))}}))},_i5=0,_Object$entries5=Object.entries(renderData);_i5<_Object$entries5.length;_i5++)_loop2();this.$emit("pigeanColors",pigeanColors)}}},renderDot:function(t,e,n,r,a){t.beginPath(),t.arc(e,n,10,0,2*Math.PI),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderShape:function(t,e,n,r,a,i){t.beginPath();var o=10;"circle"===i?t.arc(e,n,o,0,2*Math.PI):"square"===i?t.rect(e-o,n-o,2*o,2*o):"diamond"===i?(t.moveTo(e,n-o),t.lineTo(e+o,n),t.lineTo(e,n+o),t.lineTo(e-o,n),t.closePath()):t.arc(e,n,o,0,2*Math.PI),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTriangle:function(t,e,n,r,a,i){t.beginPath(),1==i&&(t.moveTo(e-10,n+10),t.lineTo(e+10,n+10),t.lineTo(e,n-10)),-1==i&&(t.moveTo(e-10,n-10),t.lineTo(e,n+10),t.lineTo(e+10,n-10)),t.closePath(),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTicksByGroup:function(t,e,n,r,a,i){for(var o=Object.keys(i).sort(),s=0,l=0,c=Object.entries(i);l<c.length;l++){var u=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(c[l],2),d=(u[0],u[1]);s+=d}switch(t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="22px Arial",t.fillStyle="#000000",t.setLineDash([]),a){case"x":for(var h=(e-r.left-r.right)/s,p=0,f=0,_=Object.entries(i);f<_.length;f++){var g=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_[f],2),m=g[0],v=g[1];if(v>0){var y=r.left+(p+.5)*h,b=Math.floor(y);t.moveTo(b,n-r.bottom+r.bump),t.lineTo(b,n-r.bottom+2*r.bump),t.stroke();var x=o.indexOf(m)%this.colors.length;t.fillStyle=this.colors[x],t.save(),t.translate(b,n-r.bottom+2*r.bump),t.rotate(45*Math.PI/180),t.textAlign="start",t.fillText(m,0,15),t.restore(
1),p+=v}}break;case"y":break}},checkStared:function(t){var e=this,n=this.pkgDataSelected.filter((function(t){return t.type==e.renderConfig["star key"]})).map((function(t){return t.id}));return!!n.includes(t)},addStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"add"})},removeStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"remove"})},phenotypeLink:function(t){var e="/phenotype.html?phenotype=".concat(t);if(this.isPigean){var n="&genesetSize=".concat(this.$store.state.genesetSize||_utils_bioIndexUtils__WEBPACK_IMPORTED_MODULE_44__["d"].DEFAULT_GENESET_SIZE,"&traitGroup=").concat(this.$store.state.traitGroup||_utils_bioIndexUtils__WEBPACK_IMPORTED_MODULE_44__["d"].DEFAULT_TRAIT_GROUP);e="/pigean".concat(e).concat(n)}return e}}})},b1f0:function(t,e,n){},b2da:function(t,e,n){},b300:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},a=[],i=n("2909"),o=n("3835"),s=(n("a4d3"),n("e01a"),n("d81d"),n("14d9"),n("13d5"),n("b0c0"),n("6b93"),n("4fad"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("3ca3"),n("5319"),n("5b81"),n("0643"),n("a573"),n("9d4a"),n("ddb0"),n("2b0e")),l=n("1157"),c=n.n(l),u=n("5698"),d=(n("2ef0"),n("b1e0"));s["default"].use(d["a"]);var h=s["default"].component("research-bar-plot-vector",{props:["renderData","renderConfig","colors","margin","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{canvasId:function(t){}},methods:{renderPlot:function(){for(var t=this,e=".vector-wrapper-".concat(this.canvasId),n=document.querySelector("#"+this.sectionId+"barPlotWrapper"),r={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},a=this.renderConfig["width"]?this.renderConfig["width"]:n.clientWidth-(r.left+r.right),s=this.renderConfig["height"]?this.renderConfig["height"]-(r.top+r.bottom):150,l=u["select"](e).append("svg").attr("id","vector_bar_plot_"+this.sectionId).attr("width",a+r.left+r.right).attr("height",s+r.top+r.bottom).append("g").attr("transform","translate("+r.left+","+r.top+")"),c=[],d=this.renderConfig["y axis field"],h=(this.renderConfig["group by"],this.renderConfig["render by"]),p=0,f=function(){var e=Object(o["a"])(g[_],2),n=e[0],r=e[1];r.map((function(e){var r={key:p,value:{}};r.value["value"]=1==t.renderConfig["convert y -log10"]||"true"==t.renderConfig["convert y -log10"]?-Math.log10(e[d]):e[d],r.value["name"]=t.renderConfig["phenotype map"]&&"kp phenotype map"==t.renderConfig["phenotype map"]?t.phenotypeMap[e[h]]["description"]:e[h],r.value["group"]=n,c.push(r),p++}))},_=0,g=Object.entries(this.renderData);_<g.length;_++)f();var m=Object(i["a"])(new Set(c.map((function(t){return t.value.value})))),v=Object(i["a"])(new Set(c.map((function(t){return t.value.group})))),y=this.colors,b=Math.ceil(m.reduce((function(t,e){return t>e?t:e}))),x=Math.floor(m.reduce((function(t,e){return t<e?t:e})));l.append("text").attr("x",r.left+a/2).attr("y",s+r.top+r.bottom-20).style("font-family","Arial").style("font-size",12).style("text-anchor","middle").text(this.renderConfig["x axis label"]),l.append("text").attr("transform",(function(t){return"translate(20,"+(r.top+s/2)+")rotate(-90)"})).attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",12).style("text-anchor","middle").text(this.renderConfig["y axis label"]);var w=u["scaleBand"]().range([r.left,r.left+a]).domain(c.map((function(t){return t.key}))).paddingInner(1).paddingOuter(.5),C=u["scaleLinear"]().domain([x,b]).range([+r.top+s,r.top]);l.attr("transform","translate(0,0)").append("g").attr("id","axisGroup"),l.select("#axisGroup").append("g").attr("transform",(function(t){return"translate("+(r.left-r.bump)+",0)"})).call(u["axisLeft"](C).ticks(5)),l.select("#axisGroup").append("line").attr("x1",r.left-r.bump).attr("x2",r.left+a).attr("y1",r.top+s+r.bump).attr("y2",r.top+s+r.bump).attr("stroke","#000000").style("stroke-width",1);var P="";c.map((function(t){var e=v.indexOf(t.value.group)%y.length,n=y[e];t.value.group!=P&&(P=t.value.group,l.select("#axisGroup").append("line").attr("x1",w(t.key)).attr("x2",w(t.key)).attr("y1",r.top+s+r.bump).attr("y2",r.top+s+2*r.bump).attr("stroke","#000000").style("stroke-width",1),l.select("#axisGroup").append("text").attr("transform","translate("+(w(t.key)-6)+","+(C(x)+18)+")rotate(45)").attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",11).style("fill",n).text(P))}));var k=C(x<0?0:x);l.select("#axisGroup").append("line").attr("x1",r.left-r.bump).attr("x2",r.left+a).attr("y1",k).attr("y2",k).attr("stroke","#999999").style("stroke-width",1);var M=a/c.length-6;M=M<=4?4:M>=40?40:M,c.map((function(t){var e=v.indexOf(t.value.group)%y.length,n=y[e],r=x<0?C(t.value.value)-C(0):C(t.value.value)-C(x),a=r<0?k+r:k;r<0?(r*=-1,l.select("#axisGroup").append("rect").attr("x",w(t.key)-M/2).attr("y",k-r).attr("height",r).attr("width",M).style("fill",n)):l.select("#axisGroup").append("rect").attr("x",w(t.key)-M/2).attr("y",k).attr("height",r).attr("width",M).style("fill",n),l.select("#axisGroup").append("line").attr("x1",w(t.key)).attr("x2",w(t.key)).attr("y1",a-3).attr("y2",a-8).attr("stroke","#999999").style("stroke-width",1),l.select("#axisGroup").append("text").attr("transform","translate("+(w(t.key)+3)+","+(a-11)+")rotate(-90)").attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",11).text(t.value.name)}))}}});c()((function(){}));var p=h,f=n("2877"),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},b371:function(t,e,n){},b3e2:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.associations?n("div",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showPlot,expression:"showPlot"}]},[t.plotData.length>0?n("research-m-plot",{attrs:{plotData:t.plotData,renderConfig:t.assocPlotConfig}}):t._e(),n("center",{staticStyle:{"margin-bottom":"30px"}},[n("b",{directives:[{name:"show",rawName:"v-show",value:!!t.showChiSquared,expression:"!!showChiSquared"}]},[t._v(" Combined P-Value(Χ²) across "),t._l(t.phenotypes,(function(e){return n("a",{staticClass:"item",attrs:{href:"/phenotype.html?phenotype="+e}},[t._v(t._s(t.phenotypeMap[e].description))])}))],2)])],1),t.tableData.length>0?n("div",[n("div",{staticClass:"text-right mb-2"},[n("data-download",{attrs:{data:t.groupedAssociations,filename:"gene_table"}})],1),n("b-table",{attrs:{hover:"",small:"",responsive:"",items:t.groupedAssociations,fields:t.fields,"per-page":t.rowsPerPage,"current-page":t.currentPage},scopedSlots:t._u([{key:"thead-top",fn:function(e){return[n("b-th",{attrs:{colspan:t.showChiSquared?2:1}},[n("span",[t._v(" Matching genes: "+t._s(t.groupedAssociations.length)+" ")])]),t._l(t.phenotypes,(function(e,r){return n("b-th",{key:e,staticClass:"reference",class:"color-"+(r+1),attrs:{colspan:"1"}},[t.phenotypeMap[e]?n("span",{staticStyle:{color:"white"}},[t._v(" "+t._s(t.phenotypeMap[e].description)+t._s(": "+t.genesPerPhenotypes[e])+" ")]):t._e()])}))]}},{key:"cell(geneName)",fn:function(e){return[n("a",{attrs:{href:"/gene.html?gene="+e.item.gene}},[t._v(" "+t._s(e.item.gene)+" ")])]}},t._l(t.phenotypes,(function(e){return{key:t.phenotypePValueColumn(e),fn:function(n){return[t._v(t._s(t.pValueFormatter(n.item[e+":pValue"])))]}}}))],null,!0)}),n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.groupedAssociations.length,"per-page":t.rowsPerPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1):n("div",[t.associations.length>0?n("h4",[t._v("No overlapping associations")]):n("h4",[t._v("No associations")])])]):t._e()},a=[],i=(n("99af"),n("4de4"),n("d81d"),n("14d9"),n("4e82"),n("6b93"),n("d3b7"),n("0643"),n("76d6"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("2b0e")),o=n("5f5b"),s=n("b1e0"),l=n("999d"),c=n.n(l),u=n("529c"),d=(n("f9e3"),n("2dd8"),n("f529"));i["default"].use(o["a"]),i["default"].use(s["b"]);var h=i["default"].component("GeneFinderTable",{components:{DataDownload:d["a"]},props:["associations","phenotypes","phenotypeMap","filter","exclusive","showPlot","showChiSquared","rowsPerPage"],data:function(){return{currentPage:1,baseFields:[{key:"geneName",label:"Gene"}],assocPlotConfig:{type:"manhattan plot","x axis field":"position","y axis field":"minusLogP","render by":"gene","x axis label":"Position","y axis label":"-log10(p-value)",height:300,"link to":"/region.html","hover content":["p"]}}},computed:{tableData:function(){return this.filter?this.associations.filter(this.filter):this.associations},plotData:function(){return this.formatAssocData(this.tableData)||[]},fields:function(){var t=this.baseFields;for(var e in this.showChiSquared&&t.push({key:"chiSquared",label:"P-Value(Χ²)",formatter:this.pValueFormatter}),this.phenotypes){var n=this.phenotypes[e];t=t.concat([{key:"".concat(n,":pValue"),label:"P-Value",tdClass:function(t){return t&&t<1e-5?"variant-table-cell high":""},sortable:!0}])}return t},groupedAssociations:function(){var t=this,e=[],n={},r=this.tableData;for(var a in r){var i=r[a],o=n[i.gene];i.gene in n||(o=e.length,n[i.gene]=o,e.push({phenotypes:[],gene:i.gene,chromosome:i.chromosome,start:i.start,end:i.end,minP:1}
1)),e[o].phenotypes.push(i.phenotype),e[o]["".concat(i.phenotype,":pValue")]=i.pValue,e[o]["".concat(i.phenotype,":zStat")]=i.zStat,i.pValue&&i.pValue<e[o].minP&&(e[o].minP=i.pValue)}if(this.exclusive){var s=this.phenotypes;e=e.filter((function(t){return s.every((function(e){return!!t["".concat(e,":pValue")]}))}))}return e.forEach((function(e){return e.chiSquared=t.chiSquared(e)})),e.sort((function(t,e){return t.chiSquared-e.chiSquared})),e},genesPerPhenotypes:function(){var t={},e=this.tableData,n=this.phenotypes;return n.map((function(e){t[e]=0})),e.map((function(e){t[e.phenotype]++})),t}},methods:{intFormatter:u["a"].intFormatter,floatFormatter:u["a"].floatFormatter,pValueFormatter:u["a"].pValueFormatter,formatAssocData:function(t){var e=this;return t.forEach((function(t){t.position="".concat(t.chromosome," : ").concat(t.start," - ").concat(t.end),t.minusLogP=-Math.log10(t.pValue),t.p=e.pValueFormatter(t.pValue)})),t},phenotypePValueColumn:function(t){return"cell(".concat(t,":pValue)")},chiSquared:function(t){var e=0;for(var n in this.phenotypes){var r=t["".concat(this.phenotypes[n],":pValue")];r&&(e+=-2*Math.log(r))}var a=c.a.pdf(e,2*this.phenotypes.length);return 2*a}}}),p=h,f=(n("1acf1"),n("2877")),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},b404:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("filter-control-template",{staticClass:"filter-col-sm",attrs:{field:t.field,type:"string",predicate:t.predicate,labelFormatter:t.labelFormatter,pillFormatter:t.pillFormatter,options:t.options,multiple:!1,computedField:t.computedField,color:t.color,placeholder:t.placeholder},on:{"input-change":function(e){return t.$emit("input-change",e)}}},[t._t("default")],2)},a=[],i=(n("2af1"),n("2b0e")),o=n("27d5"),s=i["default"].component("filter-effect-direction-control",{props:{field:String,placeholder:String,computedField:Function,color:{type:String,default:"#007bff"},options:{type:Array,default:function(){return["positive","negative"]}},labelFormatter:{type:Function},pillFormatter:{type:Function,default:function(t){return"".concat(t.labelFormatter?"effect size ".concat(t.threshold):t.threshold)}},predicate:{type:Function,default:function(t,e){return"positive"===e?1===Math.sign(t):"negative"===e?-1===Math.sign(t):void 0}}},components:{FilterControlTemplate:o["a"]}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},b463:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[null!=t.searchingRegion?n("div",{staticClass:"col-md-12 gene-links-plot-wrapper"},[n("div",{staticClass:"col-md-12"},[n("div",{attrs:{id:"geneLinksUIWrapper"}},[n("strong",[t._v("Filter associated variants by links to genes. ")]),n("div",{staticClass:"filtering-ui-wrapper add-content",staticStyle:{width:"100%",padding:"0 10px","text-align":"left"}},[n("div",{staticClass:"filtering-ui-content"},[n("div",{staticClass:"col",staticStyle:{padding:"2px"}},[n("div",{staticClass:"label",staticStyle:{display:"inline-block","margin-right":"10px"}},[t._v(" Select Tissue ")]),n("select",{staticClass:"custom-select",on:{change:function(e){return t.getGeneLinks(e)}}},[n("option",{attrs:{value:""}},[t._v(" "+t._s("Select Tissue")+" ")]),t._l(t.GLTissues,(function(e){return[n("option",{key:e.tissue,domProps:{value:e.tissue,innerHTML:t._s(t.getTissueLabel(e))}})]}))],2)]),n("div",{staticClass:"col",staticStyle:{padding:"2px","margin-left":"15px"}},[n("div",{staticClass:"label",staticStyle:{display:"inline-block","margin-right":"10px"}},[t._v(" Select SNP 2 Gene ")]),n("select",{staticClass:"custom-select",on:{change:function(e){return t.getS2GeneLinks(e)}}},[n("option",{attrs:{value:""}},[t._v(" "+t._s("Select one")+" ")]),n("option",{attrs:{value:"s2g"},domProps:{innerHTML:t._s("SNP to Gene")}})])])]),null==t.GLData||t.renderConfig["no search key bubbles"]?t._e():n("div",{staticStyle:{position:"absolute",right:"10px",top:"7px"}},[t._l(Object.keys(t.GLData),(function(e){return[n("span",{key:e,class:"btn GL-search-bubble ",domProps:{innerHTML:t._s(e+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeGLTissue(e)}}})]}))],2)])])]),n("div",{staticClass:"col-md-9 gene-link-plot-wrapper"},[n("div",{class:0==t.pkgDataSelected.filter((function(t){return"GLTissue"==t.type})).length?"height-1px":"height-auto",attrs:{id:"geneLinksPlotWrapper"}},[n("div",{staticClass:"hidden",attrs:{id:"GLInfoBox"}},[n("div",{staticClass:"fixed-info-box-close",attrs:{id:"info_box_close"},on:{click:function(e){return t.utils.uiUtils.removeOnMouseOut("GLInfoBox",100)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}}
1)],1),n("span",{attrs:{id:"GLInfoBoxContent"}})]),n("canvas",{attrs:{id:"geneLinksPlot",width:"",height:""},on:{resize:t.onResize,mousemove:function(e){return t.checkPosition(e,"hover")},click:function(e){return t.checkPosition(e,"click")},mouseout:function(e){!t.utils.uiUtils.isIdFixed("#GLInfoBox")&&t.utils.uiUtils.removeOnMouseOut("GLInfoBox",1e3)}}})])]),null!=t.GLData?n("div",{staticClass:"col-md-3 GL-plot-ui-wrapper reference-area"},[n("div",[n("button",{staticClass:"btn btn-sm btn-outline-secondary",staticStyle:{"margin-right":"5px","margin-bottom":"10px"},on:{click:function(e){return t.checkUncheckAll("check")}}},[t._v(" Select all ")]),n("button",{staticClass:"btn btn-sm btn-outline-secondary",staticStyle:{"margin-bottom":"10px"},on:{click:function(e){return t.checkUncheckAll("uncheck")}}},[t._v(" Unselect all ")]),t._m(0),t._l(t.getMethodsArr(t.GLData),(function(e,r){return n("div",{key:e,staticStyle:{display:"inline-block"}},[n("label",{style:"padding-right: 5px; margin-right: 5px; border-bottom: solid 3px "+t.methodsColors[r]+";"},[n("input",{class:e.replace(/ /g,"_"),attrs:{type:"checkbox"},domProps:{value:e,checked:!t.pkgDataSelected.filter((function(t){return"GL-Method"==t.type})).map((function(t){return t.id})).includes(e)},on:{click:function(n){return t.addRemoveParameter(e,"GL-Method")}}}),t._v(t._s(" "+e+" ")+" ")])])})),t._m(1),t._l(t.getGenesArr(t.GLData),(function(e){return n("div",{key:e,staticStyle:{display:"inline-block"}},[n("label",{staticStyle:{"padding-right":"10px"}},[n("input",{class:e.replace(/ /g,"_"),attrs:{type:"checkbox"},domProps:{value:e,checked:!t.pkgDataSelected.filter((function(t){return"GL-Gene"==t.type})).map((function(t){return t.id})).includes(e)},on:{click:function(n){return t.addRemoveParameter(e,"GL-Gene")}}}),t._v(t._s(" "+e+" ")+" ")])])}))],2)]):t._e()]):t._e()])},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Methods")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("h6",[n("strong",[t._v("Genes")])])}],i=n("53ca"),o=n("1da1"),s=n("2909"),l=n("3835"),c=(n("d9e2"),n("99af"),n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("4de4"),n("a15b"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("4fad"),n("b64b"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("3ca3"),n("5319"),n("5b81"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),u=n("1157"),d=n.n(u),h=n("b1e0");function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}c["default"].use(h["a"]);var f=c["default"].component("research-gene-links-plot",{props:["region","phenotype","renderConfig","plotMargin","methodsColors","dataComparison","plotData","pkgData","pkgDataSelected","regionZoom","regionViewArea","utils"],data:function(){return{spaceBy:20,GEData:{},trigger:0,GLPosData:{},GLData:null}},modules:{},components:{},mounted:function(){window.addEventListener("resize",this.onResize),this.getGlobalEnrichment(this.searchingRegion)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{GLTissues:function(){if(this.trigger--,0==Object.keys(this.GEData).length)return null;for(var t={},e=function(){var e=Object(l["a"])(r[n],2),a=e[0],i=e[1];i.map((function(e){t[e.tissue]?t[e.tissue].indexOf(a)<=-1&&t[e.tissue].push(a):(t[e.tissue]=[],t[e.tissue].push(a))}))},n=0,r=Object.entries(this.GEData);n<r.length;n++)e();for(var a=[],i=0,o=Object.entries(t);i<o.length;i++){var s=Object(l["a"])(o[i],2),c=s[0],u=s[1],d={};d["tissue"]=c,d["phenotypes"]=u,a.push(d)}return a.sort((function(t,e){return t.tissue>e.tissue?1:-1})),a},renderData:function(){var t=this;this.trigger--;for(var e={},n=function(){var n=Object(l["a"])(a[r],2),i=n[0],o=n[1];e[i]||(e[i]={}),o.map((function(n){var r=t.$store.state.pkgDataSelected.filter((function(t){return"GL-Gene"==t.type})).map((function(t){return t.id})),a=t.$store.state.pkgDataSelected.filter((function(t){return"GL-Method"==t.type})).map((function(t){return t.id}));-1==r.indexOf(n.targetGene)&&-1==a.indexOf(n.method)&&(e[i][n.targetGene]||(e[i][n.targetGene]={}),e[i][n.targetGene][n.method]||(e[i][n.targetGene][n.method]=[]),e[i][n.targetGene][n.method].push({start:n.start,end:n.end,method:n.method,biosample:n.biosample,targetGene:n.targetGene,targetGeneStart:n.targetGeneStart,targetGeneEnd:n.targetGeneEnd}))}))},r=0,a=Object.entries(this.pkgData.GLData);r<a.length;r++)n();return e},methodsArr:function(){if(this.trigger--,this.pkgData.GLData){for(var t=[],e=0,n=Object.entries(this.pkgData.GLData);e<n.length;e++){var r=Object(l["a"])(n[e],2),a=(r[0],r[1]);a.map((function(e){t.push(e.method)}))}return t=Object(s["a"])(new Set(t)).sort(),t}return null},genesArr:function(){if(this.trigger--,this.pkgData.GLData){for(var t=[],e=0,n=Object.entries(this.pkgData.GLData);e<n.length;e++){var r=Object(l["a"])(n[e],2),a=(r[0],r[1]);a.map((function(e){t.push(e.targetGene)}))}return t=Object(s["a"])(new Set(t)).sort(),t}return null},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},searchingParameters:function(){if(null!=this.searchingRegion&&null!=this.searchingPhenotype)return this.searchingRegion+","+this.searchingPhenotype},searchingRegion:function(){var t={},e=this.region.split(":");
1return t["chr"]=e[0],t["start"]=e[1].split("-")[0],t["end"]=e[1].split("-")[1],t},searchingPhenotype:function(){if(null!=this.phenotype){var t=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][this.phenotype]:this.phenotype;return t}if(null==this.phenotype){var e=this.utils.keyParams[this.renderConfig["phenotype parameter"]];return e?(e=this.renderConfig["phenotype match"]?this.renderConfig["phenotype match"][e]:e,e):null}}},watch:{searchingParameters:function(t){},phenotype:function(t){null!=t&&this.getGlobalEnrichment(this.searchingRegion)},pkgDataSelected:{handler:function(t){0==t.length?this.resetAll():this.renderGLPlot()},deep:!0,immediate:!0},viewingRegion:{handler:function(t,e){this.renderGLPlot()},deep:!0,immediate:!0}},methods:{resetAll:function(){this.trigger=0,this.GLPosData={},this.GLData=null,this.renderGLPlot()},checkUncheckAll:function(t){var e=this;switch(t){case"check":[{type:"GL-Method",items:this.getMethodsArr(this.GLData)},{type:"GL-Gene",items:this.getGenesArr(this.GLData)}].map((function(t){t.items.map((function(n){e.removeParameter(n,t.type)}))}));break;case"uncheck":[{type:"GL-Method",items:this.getMethodsArr(this.GLData)},{type:"GL-Gene",items:this.getGenesArr(this.GLData)}].map((function(t){t.items.map((function(n){e.addParameter(n,t.type)}))}));break}this.trigger++},getMethodsArr:function(t){for(var e=[],n=0,r=Object.entries(t);n<r.length;n++){var a=Object(l["a"])(r[n],2),i=(a[0],a[1]);i.map((function(t){e.push(t.method)}))}return e=Object(s["a"])(new Set(e)).sort(),e},getGenesArr:function(t){for(var e=[],n=0,r=Object.entries(t);n<r.length;n++){var a=Object(l["a"])(r[n],2),i=(a[0],a[1]);i.map((function(t){e.push(t.targetGene)}))}return e=Object(s["a"])(new Set(e)).sort(),e},checkPosition:function(t,e){var n=t,r=n.target.getBoundingClientRect(),a=Math.ceil(n.clientX-r.left),i=n.clientX-r.left,o=n.clientY-r.top,s=Math.ceil(n.clientY-r.top),c=document.querySelector("#GLInfoBox"),u=document.querySelector("#GLInfoBoxContent"),d=document.querySelector("#info_box_close"),h="";if(a>=this.plotMargin.leftMargin/2&&a<=r.width-this.plotMargin.leftMargin/2)for(var p=0,f=Object.entries(this.GLPosData);p<f.length;p++){var _=Object(l["a"])(f[p],2),g=_[0],m=_[1],v=g.split("-");if(s>=v[0]&&s<=v[1]){h+="<strong>"+m.targetGene+" / "+m.method+"</strong>";for(var y=0,b=Object.entries(this.GLPosData[g].region);y<b.length;y++){var x=Object(l["a"])(b[y],2),w=x[0],C=x[1],P=w.split("-");a>=P[0]&&a<=P[1]&&C.map((function(t){h+="<br /><strong>Biosample</strong> <br />"+t.biosample,h+="<br /><strong>Regulatory element</strong> <br />"+t.start+"-"+t.end,h+="<br /><strong>Promoter</strong><br /> "+t.targetGeneStart+"-"+t.targetGeneEnd+"<br />"}))}}}"hover"==e&&(""==h?"fixed"!=c.getAttribute("class")&&(u.innerHTML="",c.setAttribute("class","hidden"),d.setAttribute("class","hidden")):"fixed"!=c.getAttribute("class")&&(u.innerHTML=h,c.setAttribute("class",""),c.style.left=i+25+"px",c.style.top=o+this.spaceBy/2+"px",d.setAttribute("class","hidden"))),"click"==e&&(d.setAttribute("class","fixed-info-box-close"),""==h?(u.innerHTML="",c.setAttribute("class","hidden")):(u.innerHTML=h,c.setAttribute("class","fixed"),c.style.left=i+25+"px",c.style.top=o+this.spaceBy/2+"px"))},addParameter:function(t,e){0==this.pkgDataSelected.filter((function(n){return n.id==t&&n.type==e})).length&&this.$store.dispatch("pkgDataSelected",{type:e,id:t,action:"add"}),this.trigger++,this.renderGLPlot()},removeParameter:function(t,e){this.pkgDataSelected.filter((function(n){return n.id==t&&n.type==e})).length>0&&this.$store.dispatch("pkgDataSelected",{type:e,id:t,action:"remove"}),this.trigger++,this.renderGLPlot()},addRemoveParameter:function(t,e){this.pkgDataSelected.filter((function(n){return n.id==t&&n.type==e})).length>0?this.$store.dispatch("pkgDataSelected",{type:e,id:t,action:"remove"}):this.$store.dispatch("pkgDataSelected",{type:e,id:t,action:"add"}),this.trigger++,this.renderGLPlot()},onResize:function(t){this.utils.uiUtils.showElement("geneLinksPlotWrapper"),this.renderGLPlot()},renderStaredPositions:function(t,e,n,r,a,i,o,s,l){var c=this;t.beginPath(),t.lineWidth=2,t.strokeStyle="#FFAA00",t.setLineDash([6,6]),r.map((function(e){var r=(e-o)*a+c.plotMargin.leftMargin;t.moveTo(r,s-l),t.lineTo(r,s+n+l),t.stroke()}))},array2Object:function(t,e){var n={};return e.map((function(e){var r=e[t];n[r]=e})),n},renderGLPlot:function(){var t=this;if(this.pkgData.GLData&&Object.keys(this.pkgData.GLData).length>0){var e=[];
1if(this.GLPosData={},this.renderConfig["star key"]){var n=Array.isArray(this.plotData)?this.array2Object(this.renderConfig["star key"]["key"],this.plotData):this.plotData,r=this.renderConfig["star key"]["key"],a=this.renderConfig["star key"]["position"];this.pkgDataSelected.filter((function(t){return t.type==r})).map((function(t){return t.id})).map((function(t){e.push(n[t][a])}))}for(var i=0,o=2*this.spaceBy,s=5*this.spaceBy,c=this.spaceBy,u=0*this.spaceBy,d=2*this.spaceBy,h=2*this.spaceBy,p=this.viewingRegion.start,f=this.viewingRegion.end,_=0,g=Object.entries(this.renderData);_<g.length;_++){var m=Object(l["a"])(g[_],2),v=(m[0],m[1]);i+=o;for(var y=0,b=Object.entries(v);y<b.length;y++){var x=Object(l["a"])(b[y],2),w=(x[0],x[1]);i+=u+Object.keys(w).length*c}i+=s}i-=s;var C=document.querySelector("#geneLinksPlotWrapper"),P=document.querySelector("#geneLinksPlot");if(P&&C){var k,M,E=2*document.querySelector("#geneLinksPlotWrapper").clientWidth,D=i+d+h,O=E-2*this.plotMargin.leftMargin,L=11,j=O/(f-p);k=document.querySelector("#geneLinksPlot"),k.setAttribute("width",E),k.setAttribute("height",D),k.setAttribute("style","width:"+E/2+"px;height:"+D/2+"px;"),M=k.getContext("2d"),M.clearRect(0,0,E,D);var S=o,A=Object.keys(this.renderData).sort();A.map((function(n){var r=t.renderData[n];M.font="28px Arial",M.textAlign="left",M.fillStyle="#00000075",M.fillText(n,L,S);var a=0,i=S+c;S=i;var o=0;t.genesArr.map((function(e){if(r[e]){var n=r[e];M.font="24px Arial",M.textAlign="left",M.fillStyle="#000000",M.fillText(e,L,S+c),o%2==0&&(M.fillStyle="#00000010",M.fillRect(t.plotMargin.leftMargin,S,O,c*Object.keys(n).length)),t.methodsArr.map((function(e){if(n[e]){var r=n[e],i=t.methodsArr.indexOf(e),o=t.methodsColors[i];r.map((function(e){var n=Math.ceil(S/2)+"-"+Math.ceil((S+c)/2);if(t.GLPosData[n]||(t.GLPosData[n]={region:{}}),t.GLPosData[n]["targetGene"]=e.targetGene,t.GLPosData[n]["method"]=e.method,e.start<=f&&e.end>=p){var r=(e.start-p)*j+t.plotMargin.leftMargin;r=r<=t.plotMargin.leftMargin?t.plotMargin.leftMargin:r;var a=(e.end-p)*j+t.plotMargin.leftMargin;a=a>t.plotMargin.leftMargin+O?t.plotMargin.leftMargin+O:a;var i=a-r<1?2:a-r;M.fillStyle=o,M.fillRect(r,S,i,c-2);var s=Math.ceil(r/2)+"-"+Math.ceil((r+i)/2);t.GLPosData[n].region[s]||(t.GLPosData[n].region[s]=[]),t.GLPosData[n].region[s].push({start:e.start,end:e.end,biosample:e.biosample,targetGene:e.targetGene,targetGeneStart:e.targetGeneStart,targetGeneEnd:e.targetGeneEnd})}})),S+=c,a+=c}})),a+=u,S+=u,o++}})),t.renderConfig["star key"]&&e.length>0&&t.renderStaredPositions(M,O,a,e,j,Number(f),Number(p),i,L),t.renderGLAxis(M,O,a,Number(f),Number(p),i,L),S+=s}))}}else{var I,T;if(document.querySelector("#geneLinksPlot"))I=document.querySelector("#geneLinksPlot"),I.setAttribute("width",1),I.setAttribute("height",1),T=I.getContext("2d"),T.clearRect(0,0,1,1)}},renderGLAxis:function(t,e,n,r,a,i,o){t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.setLineDash([]),t.moveTo(this.plotMargin.leftMargin-o,i),t.lineTo(this.plotMargin.leftMargin-o,i+n+o),t.stroke();var s=Math.round(this.plotMargin.leftMargin+e+o)+.5;t.moveTo(s,i),t.lineTo(s,i+n+o),t.stroke(),t.moveTo(this.plotMargin.leftMargin-o,i+n+o),t.lineTo(s,i+n+o),t.stroke();for(var l=Math.ceil((r-a)/5),c=e/5,u=0;u<6;u++){var d=this.plotMargin.leftMargin+u*c,h=Math.floor(d)+.5;t.moveTo(h,i+n+o),t.lineTo(h,i+n+2*o),t.stroke(),t.textAlign="center",t.font="24px Arial",t.fillStyle="#000000";var p=r-a,f=p<=1?2:p<=50?1:0,_=this.utils.Formatters.decimalFormatter(a+u*l,f);_=_>=1e5?Math.round(.001*_)+"k":_,t.fillText(_,h,i+n+4*o)}},removeGLTissue:function(t){delete this.pkgData["GLData"][t],delete this.GLData[t],0==Object.keys(this.pkgData["GLData"]).length&&(delete this.pkgData["GLData"],this.GLData=null),this.$store.dispatch("pkgDataSelected",{type:"GLTissue",id:t,action:"remove"}),this.trigger--,this.renderGLPlot()},getTissueLabel:function(t){var e=t.phenotypes.length>0?t.tissue+" ("+t.phenotypes.join()+")":t.tissue;return e},getGeneLinks:function(t){var e=this;return Object(o["a"])(p().mark((function n(){var r,a,i,o,s;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(""==t.target.value){n.next=9;break}return r="KP BioIndex"==e.renderConfig["gene links server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["gene links server"],a=t.target.value.replaceAll(" ","_"),i=e.searchingRegion,o=r+"/query/gene-links?q="+a+","+i.chr+":"+i.start+"-"+i.end,n.next=7,fetch(o).then((function(t){return t.json()}));case 7:s=n.sent,null==s.error&&(0==s.data.length?e.utils.alertUtils.popAlert(a+" has no linked genes."):null==s.continuation?e.runAfterGLDataLoad(s.data,a):e.loadContinue(s,a));case 9:case"end":return n.stop()}}),n)})))()},loadContinue:function(t,e){var n=this;return Object(o["a"])(p().mark((function r(){var a,i,o,s,l;return p().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return a="KP BioIndex"==n.renderConfig["gene links server"]?n.utils.uiUtils.biDomain()+"/api/bio":n.renderConfig["gene links server"],i=a+"/cont?token="+t.continuation,r.next=4,fetch(i).then((function(t){return t.json()}));case 4:o=r.sent,null==o.error&&(s=t.data,l=s.concat(o.data),o.data=l,null==o.continuation?n.runAfterGLDataLoad(o.data,e):n.loadContinue(o,e));case 6:case"end":return r.stop()}}),r)})))()},runAfterGLDataLoad:function(t,e){this.$store.dispatch("pkgDataSelected",{type:"GLTissue",id:e,action:"add"}),this.pkgData["GLData"]||(this.pkgData["GLData"]={},this.GLData={}),this.pkgData["GLData"][e]=t,this.GLData[e]=t,this.trigger++,this.renderGLPlot()},getS2GeneLinks:function(t){var e=this;return Object(o["a"])(p().mark((function n(){var r,a,i,o,s;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!t.target.value||""==t.target.value){n.next=9;break}return r="KP BioIndex"==e.renderConfig["gene links server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["gene links server"],a=e.searchingRegion,i=r+"/query/variant-links?q="+a.chr+":"+a.start+"-"+a.end,n.next=6,fetch(i).then((function(t){return t.json()}));case 6:o=n.sent,s="SNP to gene",null==o.error&&(0==o.data.length?e.utils.alertUtils.popAlert("No SNP to gene data found in the region."):(o.data.map((function(t){t["targetGene"]=t.gene})),e.$store.dispatch("pkgDataSelected",{type:"GLTissue",id:s,action:"add"}),e.pkgData["GLData"]||(e.pkgData["GLData"]={},e.GLData={}),e.pkgData["GLData"][s]=o.data,e.GLData[s]=o.data),e.trigger++,e.renderGLPlot());case 9:case"end":return n.stop()}}),n)})))()},getGlobalEnrichment:function(t){var e=this;return Object(o["a"])(p().mark((function t(){var n,r,a,i;return p().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n="KP BioIndex"==e.renderConfig["gene links server"]?e.utils.uiUtils.biDomain()+"/api/bio":e.renderConfig["gene links server"],r=e.searchingPhenotype,a=n+"/query/global-enrichment?q="+r,t.next=5,fetch(a).then((function(t){return t.json()}));case 5:i=t.sent,null==i.error&&("newSearch"==e.dataComparison&&(e.GEData={}),e.GEData[e.searchingPhenotype]=i.data,e.trigger++);case 7:case"end":return t.stop()}}),t)})))()}}});d()((function(){}));var _=f,g=(n("a6f5"),n("2877")),m=Object(g["a"])(_,r,a,!1,null,null,null);e["a"]=m.exports},b4bc4:function(t,e,n){"use strict";n("5f97")},b544:function(t,e,n){},b54b:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"img"},[n("img",{directives:[{name:"show",rawName:"v-show",value:t.loaded&&!t.loading,expression:"loaded && !loading"}],ref:"im",staticClass:"card-img-top"}),n("b-skeleton-wrapper",{attrs:{loading:t.loading},scopedSlots:t._u([{key:"loading",fn:function(){return[n("b-skeleton-img",{attrs:{"no-aspect":"",height:"300px"}})]},proxy:!0}])},[t.documentation&&t.loaded?n("p",{staticClass:"card-text"},[n("documentation",{attrs:{name:t.documentation,"content-fill":t.contentFill,contentMap:t.$store.state.bioPortal.documentations}})],1):t.unauthorized&&!t.user?n("b-alert",{staticClass:"unauthorized",attrs:{show:"",variant:"warning"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v("Please "),n("a",{attrs:{href:"/login"},on:{click:t.saveCurrentPage}},[t._v("log in")]),t._v(" with an authorized Google account to see this content. ")
1],1):t.unauthorized&&t.user?n("b-alert",{staticClass:"unauthorized",attrs:{show:"",variant:"warning"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v("You don't have permission to view this content. "),n("br"),t._v("Please contact us if you believe you should've given access. ")],1):t.customFailureMsg?n("b-alert",{staticClass:"unauthorized",attrs:{show:"",variant:"warning"}},[t._v(" "+t._s(this.customFailureMsg)+" ")]):t.failed?n("b-alert",{staticClass:"failed",attrs:{show:"",variant:"danger"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" Failed to load ")],1):t._e()],1)],1)},a=[],i=(n("d3b7"),n("3ca3"),n("ddb0"),n("2b3d"),n("bf19"),n("9861"),n("88a7"),n("271a"),n("5494"),n("2b0e")),o=(n("1157"),n("5f5b")),s=n("b1e0"),l=(n("f9e3"),n("2dd8"),n("4a13")),c=n("e60d"),u=n("8d29");i["default"].use(o["a"]),i["default"].use(s["b"]);var d=i["default"].component("raw-img",{props:["src","documentation","contentFill","customFailureMsg"],mixins:[u["a"]],components:{Documentation:l["a"]},data:function(){return{status:null,loading:!1}},mounted:function(){this.$store.state.manhattanPlotAvailable=!0,this.getImage()},computed:{loaded:function(){return 200===this.status},unauthorized:function(){return 401===this.status},failed:function(){var t=!!this.status&&!this.loaded&&!this.unauthorized;return t}},methods:{getImage:function(){var t=this,e=this,n=this.$refs.im;this.loading=!0,Object(c["h"])(this.src).then((function(n){if(e.status=n.status,200===n.status)return t.$store.state.manhattanPlotAvailable=!0,n.blob()})).then((function(e){e?(t.$store.state.manhattanPlotAvailable=!0,n.src=URL.createObjectURL(e)):t.$store.state.manhattanPlotAvailable=!1,t.loading=!1}))}},watch:{src:{handler:"getImage"}}}),h=d,p=n("2877"),f=Object(p["a"])(h,r,a,!1,null,null,null);e["a"]=f.exports},b57e:function(t,e,n){},b6bf:function(t,e,n){},b77e:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("vue-typeahead-bootstrap",{ref:"datasetSelect",attrs:{placeholder:"Type in a dataset name ...",data:t.datasetOptions,serializer:function(t){return t.description},maxMatches:1e3,minMatchingChars:0,showOnFocus:!0},on:{hit:function(e){return t.onDatasetSelected(e)}},model:{value:t.userText,callback:function(e){t.userText=e},expression:"userText"}})},a=[],i=(n("a4d3"),n("e01a"),n("4e82"),n("2b0e")),o=i["default"].component("dataset-selectpicker",{props:["datasets"],data:function(){return{userText:null}},computed:{datasetOptions:function(){return this.datasets?this.datasets.sort((function(t,e){return t.description<e.description?-1:e.description<t.description?1:0})):[]}},methods:{onDatasetSelected:function(t){this.$store.dispatch("onDatasetChange",t),this.clearOnSelected&&(this.userText=null)},setFocus:function(){var t=this;this.$nextTick((function(){t.$refs.datasetSelect.$refs.input.focus()}))}}}),s=o,l=n("2877"),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},b832:function(t,e,n){"use strict";n("5744")},b8dc:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"heatmap-wrapper"},[n("div",{staticClass:"clicked-cell-value hidden",attrs:{id:"clicked_cell_value"+t.sectionId}},[n("div",{attrs:{id:"clicked_cell_value_content"+t.sectionId}})]),n("div",{staticClass:"heatmap-content",attrs:{id:"heatmapContent"+t.sectionId}},[n("div",{staticClass:"heatmap-scale-legend",attrs:{id:"heatmap_scale_legend"+t.sectionId}}),n("div",{staticClass:"heatmap-canvas-wrapper",attrs:{id:"heatmapPlotWrapper"+t.sectionId}},[n("div",{staticClass:"heatmap-columns-wrapper",attrs:{id:"heatmapColumnsWrapper"+t.sectionId}}),n("div",{staticClass:"heatmap-rows-wrapper",attrs:{id:"heatmapRowsWrapper"+t.sectionId}}),n("div",{staticClass:"heatmap-canvas-wrapper",attrs:{id:"heatmapCanvasWrapper"+t.sectionId}},[t.renderConfig?n("canvas",{attrs:{id:"heatmap"+t.sectionId,width:"",height:""},on:{mouseleave:t.hidePanel,mousemove:t.checkPosition}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_heatmap","svg")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.downloadImage("heatmap"+t.sectionId,t.sectionId+"_heatmap","png")}}},[t._v("Download PNG")])])])]),t.renderData?n("research-heatmap-vector",{ref:t.sectionId+"_heatmap",attrs:{renderData:t.renderData,renderConfig:t.renderConfig,sectionId:t.sectionId,utils:t.utils},on:{mousemove:function(e){return t.checkPosition(e)}}}):t._e()],1)])])])},a=[],i=(n("cb29"),n("4de4"),n("d81d"),n("14d9"),n("4e82"),n("d3b7"),n("25f0"),n("4c53"),n("0643"),n("2382"),n("a573"),n("2b0e")),o=n("1157"),s=n.n(o),l=n("b1e0"),c=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},u=[],d=(n("ac1f"),n("5319"),n("5b81"),n("5698"));n("2ef0");i["default"].use(l["a"]);var h=i["default"].component("research-heatmap-vector",{props:["renderData","renderConfig","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{canvasId:function(t){}}
1,methods:{renderPlot:function(){var t=this,e=document.createElement("canvas"),n=e.getContext("2d"),r=function(t,e,r){return n.font=e+"px "+r,n.measureText(t).width},a=function(t,e,n,r){var a,i,o;a=t>=n?255:255-255*((n-t)/n-r),i=t>=n?255-(t-n)/(e-n)*255:255-255*((n-t)/n-r),o=t<n?255:255-(t-n)/(e-n)*255,a=a>255?255:a<0?0:a,i=i>255?255:i<0?0:i,o=o>255?255:o<0?0:o;var s="rgba("+Math.floor(a)+","+Math.floor(i)+","+Math.floor(o)+",1)";return s},i=function(t,e,n,r,a){var i,o=0;if("steps"==t){var s=a/e.length;if("positive"==n)for(var l=0;l<=e.length-1;l++)o+=r>=e[l]?1:0;else for(var c=e.length-1;c>=0;c--)o+=r<=e[c]?1:0;i=s*o}else if("scale"==t){var u=e[1]-e[0];"positive"==n?(r-=e[0],o=r<=e[0]?0:r>=e[1]?1:r/u):(r-=e[0],o=r>=e[1]?0:r<=e[0]?1:(e[1]-r)/u),i=a*o}return i},o=".vector-wrapper-".concat(this.canvasId),s=this.renderConfig["font size"],l={left:[],top:[]};l.left=this.renderData.rows.map((function(t){return Math.ceil(r(t,s,"Arial"))})).sort((function(t,e){return e-t})),l.top=this.renderData.columns.map((function(t){return Math.ceil(r(t,s,"Arial"))})).sort((function(t,e){return e-t}));var c={top:l.top[0]+20,bottom:30,left:l.left[0],right:20,bump:5},u=1.5*this.renderConfig["font size"],h=u*this.renderData.columns.length+c.left+c.right+4*c.bump,p=u*this.renderData.rows.length+c.top+c.bottom+4*c.bump,f=d["select"](o).append("svg").attr("id","vector_heatmap_"+this.sectionId).attr("width",h).attr("height",p).append("g").attr("transform","translate(0,0)");f.append("g").attr("id","heatmapGroup").attr("transform","translate(0,0)");var _,g,m,v,y=this.renderConfig.main.label+": ",b=this.renderConfig.sub.label+": ",x=[y],w=[b];if(this.renderConfig.main.low==this.renderConfig.main.middle){_=this.renderConfig.main.middle,g=this.renderConfig.main.middle,m=this.renderConfig.main.high,v=(m-_)/5;for(var C=0;C<6;C++){var P=Math.round(1e3*(_+v*C))/1e3;x.push(P)}}else{_=this.renderConfig.main.low,g=this.renderConfig.main.middle,m=this.renderConfig.main.high,(g-_)/3,(m-g)/3;for(var k=0;k<6;k++){var M=Math.round(1e3*(_+v*k))/1e3;x.push(M)}}var E=c.bump;x.map((function(t){var e=r(t,s,"Arial");if("string"!=typeof t){e+=c.bump,E+=c.bump/2;var n=a(t,m,g,_);f.select("#heatmapGroup").append("rect").attr("x",E).attr("y",c.bump-2).attr("height",s+4).attr("width",e).style("fill",n)}f.select("#heatmapGroup").append("text").attr("x",E+2).attr("y",c.bump+s-2).style("font-family","Arial").style("font-size",s).style("text-anchor","start").text(t),E+=e+2})),this.renderConfig.sub["value range"].map((function(t){w.push(t)}));this.renderConfig.sub["value range"];var D=this.renderConfig.sub.direction,O=.75*u/2;E+=c.bump,w.map((function(e,n){var a=e.toString();"string"!=typeof e&&(a="positive"==D?" >= "+a+": ":" <= "+a+": ");var o=r(a,s,"Arial");if(f.select("#heatmapGroup").append("text").attr("x",E+2).attr("y",c.bump+s-2).style("font-family","Arial").style("font-size",s).style("text-anchor","start").text(a),E+=o+2,"string"!=typeof e){var l=t.renderConfig.sub["value range"],u=i(t.renderConfig.sub.type,l,D,e,O);f.select("#heatmapGroup").append("circle").attr("cx",E+u/2).attr("cy",c.bump+s/2).attr("r",u).style("fill","rgba(10,10,10, 0.5)"),E+=2*u}})),this.renderData.rows.map((function(t,e){f.select("#heatmapGroup").append("text").attr("x",c.left+c.bump).attr("y",c.top+c.bump+u*(e+1)).style("font-family","Arial").style("font-size",s).style("text-anchor","end").text(t)})),this.renderData.columns.map((function(t,e){f.select("#heatmapGroup").append("text").attr("transform","translate("+(c.left+c.bump+u*(e+1))+","+(c.top+c.bump)+")rotate(-90)").attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",s).style("text-anchor","start").text(t)})),f.select("#heatmapGroup").append("text").attr("x",h/2).attr("y",p-2*c.bump).style("font-family","Arial").style("font-weight",700).style("font-size",1.25*s).style("text-anchor","middle").text(this.renderConfig["label"]),f.select("#heatmapGroup").append("rect").attr("x",c.left+2*c.bump).attr("y",c.top+2*c.bump).attr("height",this.renderData.rows.length*u).attr("width",this.renderData.columns.length*u).attr("stroke","#aaaaaa").style("stroke-width",.7
15).style("fill","#ffffff");var L=this.renderConfig.main.high,j=this.renderConfig.main.middle,S=this.renderConfig.main.low;this.renderData.rows.map((function(e,n){t.renderData.columns.map((function(r,o){var s=t.renderData[e][r].main,l=c.left+2*c.bump+u*o,d=c.top+2*c.bump+u*n,h=a(s,L,j,S);if(f.select("#heatmapGroup").append("rect").attr("x",l).attr("y",d).attr("height",u).attr("width",u).style("fill",h),t.renderConfig.sub){var p=t.renderConfig.sub.type,_=t.renderConfig.sub["value range"],g=t.renderConfig.sub.direction,m=t.renderData[e][r].sub,v=i(p,_,g,m,O);f.select("#heatmapGroup").append("circle").attr("cx",l+u/2).attr("cy",d+u/2).attr("r",v).style("fill","rgba(10,10,10, 0.5)")}}))}))}}});s()((function(){}));var p=h,f=n("2877"),_=Object(f["a"])(p,c,u,!1,null,null,null);_.exports;i["default"].use(l["a"]);var g=i["default"].component("research-heatmap",{props:["heatmapData","renderConfig","utils","sectionId"],data:function(){return{squareData:{},canvasHover:!1,margin:{}}},modules:{},mounted:function(){this.renderHeatmap()},beforeDestroy:function(){},computed:{renderData:function(){var t=this,e={},n=this.heatmapData.map((function(e){return e[t.renderConfig["row field"]]})).filter((function(t,e,n){return n.indexOf(t)==e})).filter((function(t,e,n){return""!=t})),r=this.heatmapData.map((function(e){return e[t.renderConfig["column field"]]})).filter((function(t,e,n){return n.indexOf(t)==e})).filter((function(t,e,n){return""!=t}));return e["rows"]=n.sort((function(t,e){return t.localeCompare(e,void 0,{sensitivity:"base"})})),e["columns"]=r.sort((function(t,e){return t.localeCompare(e,void 0,{sensitivity:"base"})})),n.map((function(t){e[t]={},r.map((function(n){e[t][n]={}}))})),this.heatmapData.map((function(n){var r=t.renderConfig["row field"],a=t.renderConfig["column field"];e[n[r]][n[a]]["main"]=n[t.renderConfig.main.field],t.renderConfig.sub&&(e[n[r]][n[a]]["sub"]=n[t.renderConfig.sub.field])})),e},boxSize:function(){return 1.5*this.renderConfig["font size"]}},watch:{renderData:function(){this.renderHeatmap()}},methods:{downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.sectionId+"_heatmap"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_heatmap_"+this.sectionId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},hidePanel:function(){this.utils.uiUtils.hideElement("clicked_cell_value"+this.sectionId),this.renderHeatmap()},checkPosition:function(t){var e=t,n=e.target.getBoundingClientRect(),r=Math.floor(e.clientX-n.left),a=Math.floor(e.clientY-n.top),i=Math.floor((e.clientX-n.left-(this.margin.left+2*this.margin.bump))/this.boxSize),o=Math.floor((e.clientY-n.top-(this.margin.top+2*this.margin.bump))/this.boxSize),s="";i>=0&&o>=0&&this.squareData[o]&&this.squareData[o][i]&&(s+='<span class="field-on-clicked-cell">'+this.renderData.rows[o]+"</sub>",s+='<span class="field-on-clicked-cell">'+this.renderData.columns[i]+"</sub>",s+='<span class="content-on-clicked-cell"><b>'+this.renderConfig.main.label+": </b>"+this.squareData[o][i].main.value+"</span>",this.squareData[o][i].sub&&(s+='<span class="content-on-clicked-cell"><b>'+this.renderConfig.sub.label+": </b>"+this.squareData[o][i].sub.value+"</span>"));var l=document.getElementById("clicked_cell_value"+this.sectionId),c=document.getElementById("clicked_cell_value_content"+this.sectionId),u=document.getElementById("heatmapCanvasWrapper"+this.sectionId).getBoundingClientRect(),d=u.left,h=document.getElementById("heatmapContent"+this.sectionId).offsetHeight-document.getElementById("heatmapPlotWrapper"+this.sectionId).offsetHeight+document.getElementById("heatmapColumnsWrapper"+this.sectionId).offsetWidth;""!=s?(c.innerHTML=s,l.classList.remove("hidden"),l.style.top=h+a+"px",l.style.left=d-30+r+"px"):l.classList.add("hidden"),this.renderHeatmap(i,o)},getWidth:function(t,e,n,r){return t.font=n+"px "+r,t.measureText(e).width},getColor:function(t,e,n,r){var a,i,o;a=t>=n?255:255-255*((n-t)/n-r),i=t>=n?255-(t-n)/(e-n)*255:255-255*((n-t)/n-r),o=t<n?255:255-(t-n)/(e-n)*255,a=a>255?255:a<0?0:a,i=i>255?255:i<0?0:i,o=o>255?255:o<0?0:o;var s="rgba("+Math.floor(a)+","+Math.floor(i)+","+Math.floor(o)+",1)";return s},getDotR:function(t,e,n,r,a){var i,o=0;if("steps"==t){var s=a/e.length;if("positive"==n)for(var l=0;l<=e.length-1;l++)o+=r>=e[l]?1:0;else for(var c=e.length-1;c>=0;c--)o+=r<=e[c]?1:0;i=s*o}else if("scale"==t){var u=e[1]-e[0];"positive"==n?(r-=e[0],o=r<=e[0]?0:r>=e[1]?1:r/u):(r-=e[0],o=r>=e[1]?0:r<=e[0]?1:(e[1]-r)/u),i=a*o}return i},renderHeatmap:function(t,e){var n=this,r=document.getElementById("heatmap"+this.sectionId),a=r.getContext("2d"),i=this.renderConfig["font size"],o={left:[],top:[]};o.left=this.renderData.rows.map((function(t){return Math.ceil(n.getWidth(a,t,i,"Arial"))})).sort((function(t,e){return e-t})),o.top=this.renderData.columns.map((function(t){return Math.ceil(n.getWidth(a,t,i,"Arial"))})).sort((function(t,e){return e-t})),this.margin={top:o.top[0]+40,bottom:30,left:o.left[0],right:20,bump:5},i=2*this.renderConfig["font size"];var s={top:2*o.top[0]+80,bottom:30,left:2*o.left[0],right:40,bump:10},l=1.5*i,c=l*this.renderData.columns.length+s.left+s.right+4*s.bump*2,u=l*this.renderData.rows.length+s.top+s.bottom+4*s.bump*2;r.setAttribute("width",c),r.setAttribute("height",u),r.setAttribute("style","width:"+c/2+"px;
1height:"+u/2+"px;");var d,h,p,f,_=this.renderConfig.main.label+": ",g=this.renderConfig.sub.label+": ",m=[_],v=[g];if(this.renderConfig.main.low==this.renderConfig.main.middle){d=this.renderConfig.main.middle,h=this.renderConfig.main.middle,p=this.renderConfig.main.high,f=(p-d)/5;for(var y=0;y<6;y++){var b=Math.round(1e3*(d+f*y))/1e3;m.push(b)}}else{d=this.renderConfig.main.low,h=this.renderConfig.main.middle,p=this.renderConfig.main.high,(h-d)/3,(p-h)/3;for(var x=0;x<6;x++){var w=Math.round(1e3*(d+f*x))/1e3;m.push(w)}}var C=s.bump;m.map((function(t){var e=n.getWidth(a,t,i,"Arial");if("string"!=typeof t){e+=s.bump,C+=s.bump/2;var r=n.getColor(t,p,h,d);a.beginPath(),a.rect(C,s.bump-4,e,i+8),a.fillStyle=r,a.fill()}a.font="24px Arial",a.textAlign="start",a.fillStyle="#000000",a.fillText(t,C+4,s.bump+i-4),C+=e+2})),this.renderConfig.sub["value range"].map((function(t){v.push(t)}));this.renderConfig.sub["value range"];var P=this.renderConfig.sub.direction,k=.75*l/2;C+=s.bump,v.map((function(t,e){var r=t.toString();"string"!=typeof t&&(r="positive"==P?" >= "+r+": ":" <= "+r+": ");var o=n.getWidth(a,r,i,"Arial");if(a.font="24px Arial",a.textAlign="start",a.fillStyle="#000000",a.fillText(r,C+4,s.bump+i-4),C+=o+4,"string"!=typeof t){var l=n.renderConfig.sub["value range"],c=n.getDotR(n.renderConfig.sub.type,l,P,t,k);a.fillStyle="#00000075",a.lineWidth=0,a.beginPath(),a.arc(C+c,s.bump+i/2,c,0,2*Math.PI),a.fill(),C+=2*c}})),a.font="Bold 30px Arial",a.textAlign="center",a.fillStyle="#000000",a.fillText(this.renderConfig["label"],c/2,u-2*s.bump);var M=2*this.boxSize;a.beginPath(),a.fillStyle="#ffffff",a.strokeStyle="#666666";var E=!1;a.rect(s.left+2*s.bump,s.top+2*s.bump,this.renderData.columns.length*l,this.renderData.rows.length*l),E&&a.fill(),a.stroke(),a.closePath(),this.renderData.rows.map((function(t,e){n.squareData[e]={};var r=s.top+2*s.bump+M*e;a.font="24px Arial",a.textAlign="end",a.fillStyle="#000000",a.fillText(t,s.left+s.bump,r+i)})),this.renderData.columns.map((function(t,e){var n=s.left+2*s.bump+M*e;a.save(),a.translate(n+i,s.top+s.bump+.5),a.rotate(90*-Math.PI/180),a.font="24px Arial",a.fillStyle="#000000",a.textAlign="start",a.fillText(t,0,0),a.restore()})),this.renderData.rows.map((function(r,i){n.squareData[i]={};var o=s.top+2*s.bump+M*i;n.renderData.columns.map((function(l,c){var u=n.renderData[r][l].main,d=s.left+2*s.bump+M*c;n.squareData[i][c]={},n.squareData[i][c]["main"]={field:n.renderConfig.main.field,value:n.renderData[r][l].main},n.renderConfig.sub&&(n.squareData[i][c]["sub"]={field:n.renderConfig.sub.field,value:n.renderData[r][l].sub});n.renderConfig.main.direction;var h=n.renderConfig.main.high,p=n.renderConfig.main.middle,f=n.renderConfig.main.low,_=n.getColor(u,h,p,f);if(t==c&&e==i?(a.beginPath(),a.rect(d,o,M,M),a.fillStyle="black",a.fill(),a.beginPath(),a.rect(d+2,o+2,M-4,M-4),a.fillStyle=_,a.fill()):(a.beginPath(),a.rect(d,o,M,M),a.fillStyle=_,a.fill()),n.renderConfig.sub){var g=n.renderConfig.sub["value range"],m=n.renderConfig.sub.direction,v=.75*M/2,y=n.renderConfig.sub.type,b=M/2,x=n.renderData[r][l].sub,w=n.getDotR(y,g,m,x,v);a.fillStyle="#00000075",a.lineWidth=0,a.beginPath(),a.arc(d+b,o+b,w,0,2*Math.PI),a.fill()}c++})),i++}))}}});s()((function(){}));var m=g,v=(n("20ed"),Object(f["a"])(m,r,a,!1,null,null,null));e["a"]=v.exports},b9ca:function(t,e,n){"use strict";n("3bb9")},b9f0:function(t,e,n){},ba87:function(t,e,n){},baba:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("filter-control-template",{staticClass:"filter-col-md",attrs:{field:t.field,placeholder:t.placeholder,type:"string",predicate:t.predicate,pillFormatter:t.pillFormatter,labelFormatter:t.labelFormatter,options:t.selectionOptions,color:t.color,label:t.label,multiple:!!t.multiple,inclusive:!!t.inclusive||!!t.multiple,disabled:t.disabled,computedField:t.computedField},on:{"input-change":function(e){return t.$emit("input-change",e)}}},[t._t("default")],2)},a=[],i=(n("99af"),n("4de4"),n("4e82"),n("d3b7"),n("0643"),n("2382"),n("2b0e")),o=n("27d5"),s=n("529c"),l=i["default"].component("filter-enumeration-control",{props:{field:String,placeholder:String,options:Array,color:String,label:String,multiple:{type:Boolean,default:!1},inclusive:{type:Boolean,default:!1},predicate:{type:Function,default:function(t,e){return t===e}},labelFormatter:{type:Function,default:s["a"].capitalizedFormatter},pillFormatter:{type:Function,default:function(t){return"".concat(t.field," = ").concat(t.labelFormatter?t.labelFormatter(t.threshold):t.threshold)}},disableSort:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},computedField:Function},components:{FilterControlTemplate:o["a"]},computed:{selectionOptions:function(){if(null!==this.options){var t=this.options.filter((function(t,e,n){return n.indexOf(t)==e})).filter((function(t){return void 0!=t}));return this.disableSort||(t=t.sort()),t}return[]}}}),c=l,u=n("2877"),d=Object(u["a"])(c,r,a,!1,null,null,null);e["a"]=d.exports},bacd:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:this.panelId}})},a=[],i=n("2b0e"),o=i["default"].component("lz-panel",{props:{panelClass:Object,layout:Object,source:Object,filter:Function},data:function(){return{panelId:null}},mounted:function(){var t=this;this.updatePanel(),this.$parent.plot.on("panel_removed",(function(e){e.data,t.panelId}))},beforeDestroy:function(){this.$parent.plot.removePanel(this.panelId)},methods:{updatePanel:function(){this.panelId=this.$parent.addPanels(this.panelClass),this.$emit("updated",{panelId:this.panelId,panelClass:this.panelClass})}}}),s=o,l=n("2877"),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},bb0b:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("vue-typeahead-bootstrap",{ref:"autocomplete",attrs:{data:t.lookupOptions,disabled:t.disabled,placeholder:t.placeholder,serializer:t.labelFormatter,showOnFocus:!0,maxMatches:1e3},on:{hit:function(e){return t.onAutoCompleteItemSelected(e)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onUserEnterNonAutoCompleteItem.apply(null,arguments)}},scopedSlots:t._u([{key:"suggestion",fn:function(e){var r=e.data,a=e.htmlText;return[n("span",{domProps:{innerHTML:t._s(a)}}),t._v("Â "),t.secondaryKey?n("small",{staticClass:"text-secondary"},[t._v(t._s(r[t.secondaryKey]))]):t._e()]}}
1]),model:{value:t.userInput,callback:function(e){t.userInput=e},expression:"userInput"}})},a=[],i=n("2b0e"),o=n("2ef0"),s=n("5f5b"),l=n("b1e0"),c=n("d726");n("f9e3"),n("2dd8");i["default"].use(s["a"]),i["default"].use(l["b"]),i["default"].component("vue-typeahead-bootstrap",c["a"]);var u=i["default"].component("autocomplete",{props:{matches:Array,placeholder:String,secondaryKey:String,labelFormatter:{type:Function,default:function(t){return t}},disabled:Boolean},data:function(){return{userInput:this.initialText||"",selectedItem:""}},computed:{lookupOptions:function(){return this.matches?this.matches:[]}},methods:{tap:function(){},formatHTML:function(t){return this.labelFormatter(Object(o["cloneDeep"])(t))},serializer:function(t){return this.matchkey?this.matchkey:t},onAutoCompleteItemSelected:function(t){this.$emit("item-select",t),this.userInput="",this.$refs.autocomplete.inputValue=""},onUserEnterNonAutoCompleteItem:function(){this.$emit("keyup-enter",this.userInput),this.userInput="",this.$refs.autocomplete.inputValue=""}},watch:{userInput:function(t){this.$emit("input-change",t)}}}),d=u,h=n("2877"),p=Object(h["a"])(d,r,a,!1,null,null,null);e["a"]=p.exports},bc8f:function(t,e,n){"use strict";e["a"]=["#048845","#8490C8","#BF61A5","#EE3124","#FCD700","#5555FF","#9ACA3C","#9F78AC","#F88084","#F5A4C7","#CEE6C1","#FFFF00","#6FC7B6","#D5A768","#D4D4D4"]},be00:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-modal",{staticClass:"modal fade",attrs:{"header-class":"my-header-class",id:"exampleModal",tabindex:"-1",role:"dialog","aria-labelledby":"exampleModalLabel","aria-hidden":"true"},scopedSlots:t._u([{key:"modal-header",fn:function(){return[n("div",{staticClass:"w-100"},[n("p",{staticStyle:{}},[t._v("Rare Variation")])])]},proxy:!0},{key:"modal-footer",fn:function(){return[n("div",{staticClass:"w-100"},[n("b-button",{staticClass:"float-right",attrs:{variant:"primary",size:"sm"},on:{click:function(e){t.show=!1}}},[t._v("Submit")])],1)]},proxy:!0}]),model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[n("b-table-simple",{attrs:{borderless:"",fixed:"",small:"",responsive:""}},[n("b-tbody",[n("b-tr",[n("b-th",{staticStyle:{width:"100px"}}),n("b-td",{staticClass:"text-center",staticStyle:{width:"150px","background-color":"#fef8dc"}},[t._v("3.36")]),n("b-td",{staticClass:"text-left",staticStyle:{width:"200px",color:"gray"}},[t._v("<--Burden Association Summary Statistics")])],1),n("b-tr",[n("b-th",{staticClass:"text-right",staticStyle:{width:"100px"},attrs:{rowspan:"1"}},[t._v("X")]),n("b-td",{staticClass:"text-center",staticStyle:{width:"150px"}},[n("input",{directives:[{name:"model",rawName:"v-model.number",value:t.$store.state.prior,expression:"$store.state.prior",modifiers:{number:!0}}],staticStyle:{"background-color":"#fef8dc",width:"100%"},attrs:{type:"number",placeholder:"Prior Variance",id:"prior_variance_input"},domProps:{value:t.$store.state.prior},on:{input:function(e){e.target.composing||t.$set(t.$store.state,"prior",t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),n("b-td",{staticClass:"text-left",staticStyle:{width:"200px",color:"gray"}},[t._v("<--Prior Allelic Variance")])],1)],1),n("b-tfoot",[n("b-tr",[n("b-th",{staticClass:"text-right",staticStyle:{width:"100px"},attrs:{rowspan:"1"}},[t._v("Bayes Factor:")]),n("b-td",{staticClass:"text-center",staticStyle:{width:"100px","border-top":"0.25px solid","border-color":"#D0D0D0","border-width":"thin","background-color":"#fef8dc"},attrs:{colspan:"1"}},[n("b",[t._v(t._s(t.rareBF))])])],1)],1)],1)],1)},a=[],i=(n("14d9"),n("b0c0"),n("a9e3"),n("2b0e")),o=n("5f5b"),s=n("b1e0"),l=n("d726"),c=n("bb0b");n("f9e3"),n("2dd8"),n("e60d"),n("529c");i["default"].use(o["a"]),i["default"].use(s["b"]),i["default"].component("vue-typeahead-bootstrap",l["a"]),i["default"].component("autocomplete",c["a"]);var u=i["default"].component("reset-prior-widget",{props:{beta:{type:Number,required:!0,default:1},rareBF:{type:Number,required:!0,default:1}},data:function(){return{show:!1,variants:["primary","secondary","success","warning","danger","info","light","dark"],headerBgVariant:"dark",headerTextVariant:"light",bodyBgVariant:"light",bodyTextVariant:"dark",footerBgVariant:"warning",footerTextVariant:"dark",submittedNames:[],name:"",nameState:null}},computed:{},methods:{checkFormValidity:function(){var t=this.$refs.form.checkValidity();return this.nameState=t,t},resetPriorAllelicVariance:function(){},handleSubmit:function(){var t=this;this.checkFormValidity()&&(this.submittedNames.push(this.name),this.$nextTick((function(){t.$bvMod
1al.hide("modal-prevent-closing")})))}}}),d=u,h=(n("1fb1"),n("2877")),p=Object(h["a"])(d,r,a,!1,null,"1f3e8c1f",null);e["a"]=p.exports},c1fa:function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("3835"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("2909"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("a4d3"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("e01a"),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("cb29"),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("caad"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("14d9"),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("4e82"),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("6b93"),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("4fad"),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_13__),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("6062"),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("1e70"),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("79a4"),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("c1a1"),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("8b00"),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("a4e7"),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_21__),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("1e5a"),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_22__),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("72c3"),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_23__),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("2532"),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_24___default=__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_24__),
1core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_25__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("0643"),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_26__),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__("2382"),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_27___default=__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_27__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__("a573"),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_28__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29__),vue__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__("2b0e"),jquery__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__("1157"),jquery__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_31__),lodash__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__("2ef0"),lodash__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_32__),bootstrap_vue__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__("b1e0"),_components_researchPortal_vectorPlots_ResearchBoxPlotVector_vue__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__("81a9");vue__WEBPACK_IMPORTED_MODULE_30__["default"].use(bootstrap_vue__WEBPACK_IMPORTED_MODULE_33__["a"]),__webpack_exports__["a"]=vue__WEBPACK_IMPORTED_MODULE_30__["default"].component("research-box-plot",{props:["phenotypeMap","phenotypesData","renderConfig","pkgData","pkgDataSelected","colors","plotMargin","filter","options","canvasId","utils"],data:function(){return{boxData:null,boxPosData:{},spaceBy:7,trigger:0,hoverItems:{},showCanvas:!0}},modules:{},components:{boxPlotVector:_components_researchPortal_vectorPlots_ResearchBoxPlotVector_vue__WEBPACK_IMPORTED_MODULE_34__["a"]},created:function(){this.renderBoxPlot()},mounted:function(){window.addEventListener("resize",this.onResize),this.renderBoxPlot()},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{phenotypeMapConfig:function(){return"null"==this.renderConfig["phenotype map"]?null:"kp phenotype map"==this.renderConfig["phenotype map"]?"kpPhenotypeMap":void 0},renderData:function(){var t=this;this.showCanvas=!0;var e={data:[]};if(this.phenotypesData){var n=Object(lodash__WEBPACK_IMPORTED_MODULE_32__["cloneDeep"])(this.phenotypesData);n.map((function(n){var r="string"==typeof n[t.renderConfig["y axis field"]]?Number(n[t.renderConfig["y axis field"]]):n[t.renderConfig["y axis field"]];n["rawPValue"]=r,"true"==t.renderConfig["convert y -log10"]&&(n[t.renderConfig["y axis field"]+"-log10"]=-Math.log10(r)),("kpPhenotypeMap"==t.phenotypeMapConfig&&t.phenotypeMap[n[t.renderConfig["render by"]]]||null==t.phenotypeMapConfig)&&e["data"].push(n)}))}return this.filter&&(e.data=e.data.filter(this.filter)),e.data&&e.data.length>0?e:(this.showCanvas=!1,null)},adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e}},watch:{renderData:function(t){this.renderBoxPlot()}},methods:{downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.canvasId+"_boxPlot"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_box_plot_"+this.canvasId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},openPage:function(t,e){this.utils.uiUtils.openPage(t,e)},addPhenotype:function(t){this.$parent.$parent.pushCriterionPhenotype(t),window.location.href="#associations-table"},groupData:function(t){var e=this,n=[],r={};if(null==this.phenotypeMapConfig)n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(t.data.map((function(t){return t[e.renderConfig["group by"]]})))).sort();else{for(var a=0,i=Object.entries(this.phenotypeMap);a<i.length;a++){var o=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(i[a],2),s=(o[0],o[1]);n.push(s)}n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(n.map((function(t){return t.group})))).sort()}return n.map((function(t){r[t]=[]})),t.data.map((function(t){var n="kpPhenotypeMap"==e.phenotypeMapConfig&&e.phenotypeMap[t[e.renderConfig["render by"]]]?e.phenotypeMap[t[e.renderConfig["render by"]]].group:t[e.renderConfig["group by"]];r[n].push(t)})),r},onResize:function(){this.renderBoxPlot()},checkPosition:function(t,e){var n=this,r=t,a=r.target.getBoundingClientRect(),i=r.clientX-a.left,o=r.clientY-a.top,s=(this.renderConfig["plot margin"]&&this.renderConfig["plot margin"],this.adjPlotMargin),l=Math.ceil(r.clientY-a.top),c=Math.ceil(r.clientX-a.left),u=document.querySelector("#"+this.canvasId+"boxInfoBox"),d=(document.querySelector("#"+this.canvasId+"boxInfoBoxContent"),document.querySelector("#"+this.canvasId+"info_box_close"));if(0==u.getAttribute("class").includes("fixed")){var h="";if(this.hoverItems={},c>=s.left/2&&c<=a.width-s.right/2)for(var p=0,f=Object.entries(this.boxPosData);p<f.length;p++){var _=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(f[p],2),g=_[0],m=_[1],v=g.split("-");c>=v[0]&&c<=v[1]&&m.map((function(t){l>
1=t.start&&l<=t.end&&(n.hoverItems[t.name]=t,h+="<strong>"+t.name+"</strong><br />",n.renderConfig["hover content"].map((function(e){h+=e+":"+t.data[e]+"<br />"})))}))}"hover"==e&&(""==h?0==u.getAttribute("class").includes("fixed")&&(u.setAttribute("class","hidden"),d.setAttribute("class","hidden")):0==u.getAttribute("class").includes("fixed")&&(u.setAttribute("class","boxplot-info-box"),d.setAttribute("class","hidden"),c<a.width-300?(u.style.left=i+25+"px",u.style.top=o+this.spaceBy+"px"):(u.style.left=i-325+"px",u.style.width="300px !important",u.style.top=o+this.spaceBy+"px"))),"click"==e&&(d.setAttribute("class","fixed-info-box-close"),""==h?u.setAttribute("class","hidden"):(u.setAttribute("class","boxplot-info-box fixed"),c<a.width-300?(u.style.left=i+25+"px",u.style.top=o+this.spaceBy+"px"):(u.style.left=i-325+"px",u.style.width="300px !important",u.style.top=o+this.spaceBy+"px")))}},renderBoxPlot:function renderBoxPlot(){var _this4=this;if(this.renderConfig["thresholds"]&&"calculate"==this.renderConfig["thresholds"]){var threshholds=[];this.renderConfig["thresholds calculate"].map((function(expression){var calcString="";expression.map((function(t){var e=["+","-","*","/","(",")"].includes(t)||"number"===typeof t?t:"string"===typeof t&&"data length"==t?_this4.renderData.data.length:null;calcString+=e}));var threshold=eval(calcString);threshholds.push(threshold)})),this.renderConfig["thresholds"]=threshholds}var wrapper=document.querySelector("#"+this.canvasId+"boxPlotWrapper"),canvas=document.querySelector("#"+this.canvasId+"boxPlot");if(canvas&&wrapper){var canvasWidth=2*wrapper.clientWidth,canvasHeight=2*Number(this.renderConfig["height"]),c,ctx;c=document.querySelector("#"+this.canvasId+"boxPlot"),c.setAttribute("width",canvasWidth),c.setAttribute("height",canvasHeight),c.setAttribute("style","width:"+canvasWidth/2+"px;height:"+canvasHeight/2+"px;"),ctx=c.getContext("2d"),ctx.clearRect(0,0,canvasWidth,canvasHeight),this.boxPosData={};for(var renderData=this.groupData(this.renderData),groups={},totalNum=0,minY=null,maxY=null,_i3=0,_Object$entries3=Object.entries(renderData);_i3<_Object$entries3.length;_i3++){var _Object$entries3$_i=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries3[_i3],2),key=_Object$entries3$_i[0],value=_Object$entries3$_i[1];groups[key]=value.length,totalNum+=value.length,value.map((function(t){var e=t;minY=null==minY||e[_this4.renderConfig["y axis field"].min]<minY?e[_this4.renderConfig["y axis field"].min]:minY,maxY=null==maxY||e[_this4.renderConfig["y axis field"].max]>maxY?e[_this4.renderConfig["y axis field"].max]:maxY}))}minY=Math.floor(minY),maxY=Math.ceil(maxY),ctx.stroke();var customPlotMargin=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,plotMargin=customPlotMargin?{left:customPlotMargin.left,right:customPlotMargin.right,top:customPlotMargin.top,bottom:customPlotMargin.bottom,bump:10}:{left:this.plotMargin.leftMargin/2,right:this.plotMargin.leftMargin/2*1.5,top:this.plotMargin.bottomMargin/2*3.5,bottom:this.plotMargin.bottomMargin/2*2.5,bump:10};this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"y",5,minY,maxY,this.renderConfig["y axis label"]),this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"x",null,null,null,this.renderConfig["x axis label"]),this.renderTicksByGroup(ctx,canvasWidth,canvasHeight,plotMargin,"x",groups);var xStep=(canvasWidth-plotMargin.left-plotMargin.right)/totalNum,yMax=maxY,yMin=minY,yStep=(canvasHeight-(plotMargin.top+plotMargin.bottom))/(yMax-yMin);ctx.setLineDash([]);var groupsArr=Object.keys(groups).sort(),dotIndex=0,boxWidth=(canvasWidth-(plotMargin.left+plotMargin.right))/totalNum-40;if(boxWidth=boxWidth<=20?20:boxWidth>=80?80:boxWidth,totalNum>0)for(var _loop=function(){var t=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries4[_i4],2),e=t[0],n=t[1],r=groupsArr.indexOf(e)%_this4.colors.length,a=_this4.colors[r],i=0,o=0;plotMargin.left,n.length,plotMargin.bottom;n.map((function(t){if(null==_this4.phenotypeMapConfig||"kpPhenotypeMap"==_this4.phenotypeMapConfig&&_this4.phenotypeMap[t[_this4.renderConfig["render by"]]]){var e,n,r,s,l,c=plotMargin.left+xStep*(dotIndex+.5),u={min:t[_this4.renderConfig["y axis field"].min],max:t[_this4.renderConfig["y axis field"].max],median:t[_this4.renderConfig["y axis field"].median],q1:t[_this4.renderConfig["y axis field"].q1],q3:t[_this4.renderConfig["y axis field"].q3]};e=canvasHeight-plotMargin.bottom-u.min*yStep,n=canvasHeight-plotMargin.bottom-u.max*yStep,r=canvasHeight-plotMargin.bottom-u.median*yStep,s=canvasHeight-plotMargin.bottom-u.q1*yStep,l=canvasHeight-plotMargin.bottom-u.q3*yStep,ctx.strokeStyle=a,ctx.lineWidth=1,ctx.beginPath(),ctx.moveTo(c+boxWidth/2,e),ctx.lineTo(c+boxWidth/2,n),ctx.stroke(),ctx.strokeStyle=a,ctx.lineWidth=2,ctx.fillStyle="#ffffff",ctx.fillRect(c,s,boxWidth,l-s),ctx.beginPath(),ctx.rect(c,s,boxWidth,l-s),ctx.stroke(),ctx.strokeStyle=a,ctx.lineWidth=3,ctx.beginPath(),ctx.moveTo(c,r),ctx.lineTo(c+boxWidth,r),ctx.stroke();var d=null==_this4.phenotypeMapConfig?t[_this4.renderConfig["render by"]]:_this4.phenotypeMap[t[_this4.renderConfig["render by"]]]["description"],h=Math.round(c/2),p=Math.round((c+boxWidth)/2),f=h+"-"+p,_=Math.round(l/2),g=Math.round(s/2),m={};_this4.renderConfig["hover content"].map((function(e){m[e]=t[e]}));var v={start:_,end:g,data:m,name:d,id:t[_this4.renderConfig["render by"]]};_this4.boxPosData[f]||(_this4.boxPosData[f]=[]),_this4.boxPosData[f].push(v),0==i&&(o=c);var y=o+24*i;y=c>y?c:y,ctx.font="22px Arial",ctx.fillStyle="#000000";ctx.save(),ctx.translate(y+boxWidth/2+10,n-24),ctx.rotate(90*-Math.PI/180),ctx.textAlign="start",ctx.fillText(d,0,0),ctx.restore(
1),ctx.lineWidth=1,ctx.moveTo(c+boxWidth/2,n-5),ctx.lineTo(y+boxWidth/2,n-20),ctx.strokeStyle="#00000080",ctx.stroke(),i++,dotIndex++}})),r++},_i4=0,_Object$entries4=Object.entries(renderData);_i4<_Object$entries4.length;_i4++)_loop()}},renderDot:function(t,e,n,r,a){t.beginPath(),t.arc(e,n,10,0,2*Math.PI),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTriangle:function(t,e,n,r,a,i){t.beginPath(),1==i&&(t.moveTo(e-10,n+10),t.lineTo(e+10,n+10),t.lineTo(e,n-10)),-1==i&&(t.moveTo(e-10,n-10),t.lineTo(e,n+10),t.lineTo(e+10,n-10)),t.closePath(),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTicksByGroup:function(t,e,n,r,a,i){for(var o=Object.keys(i).sort(),s=0,l=0,c=Object.entries(i);l<c.length;l++){var u=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(c[l],2),d=(u[0],u[1]);s+=d}switch(t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="22px Arial",t.fillStyle="#000000",t.setLineDash([]),a){case"x":for(var h=(e-r.left-r.right)/s,p=0,f=0,_=Object.entries(i);f<_.length;f++){var g=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_[f],2),m=g[0],v=g[1];if(v>0){var y=r.left+(p+.5)*h,b=Math.floor(y);t.moveTo(b,n-r.bottom+r.bump),t.lineTo(b,n-r.bottom+2*r.bump),t.stroke();var x=o.indexOf(m)%this.colors.length;t.fillStyle=this.colors[x],t.save(),t.translate(b,n-r.bottom+2*r.bump),t.rotate(45*Math.PI/180),t.textAlign="start",t.fillText(m,0,15),t.restore(),p+=v}}break;case"y":break}},checkStared:function(t){var e=this,n=this.pkgDataSelected.filter((function(t){return t.type==e.renderConfig["star key"]})).map((function(t){return t.id}));return!!n.includes(t)},addStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"add"})},removeStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"remove"})}}}),jquery__WEBPACK_IMPORTED_MODULE_31___default()((function(){}))},c3c6:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"forest-plot-simple"},[n("div",{staticClass:"forest-plot-html-row"},[n("div",{staticClass:"plot"},[n("div",{staticClass:"forest-plot-html-item",style:"width:"+t.width+"%; left:"+t.startPos+"%;"}),n("div",{staticClass:"beta-box",style:(t.effect>100?"display:none; ":"")+"left:calc("+t.effectPos+"% - 6px);"},[t._v(" Â ")])]),n("div",{staticClass:"beta-0",staticStyle:{left:"50%"}},[n("label",[t._v(t._s(t.dichotomous?"1":"0"))])])])])},a=[],i=(n("a9e3"),n("2b0e")),o=i["default"].component("forest-plot-simple",{props:{effect:{type:Number,required:!0},se:{type:Number,required:!0},dichotomous:{type:Boolean,required:!1,default:!1}},mounted:function(){},methods:{},computed:{start:function(){return this.dichotomous?Math.exp(this.effect-1.96*this.se):this.effect-1.96*this.se},end:function(){return this.dichotomous?Math.exp(this.effect+1.96*this.se):this.effect+1.96*this.se},width:function(){return(this.end-this.start)/2*100},startPos:function(){return this.dichotomous?this.start/2*100:(1+this.start)/2*100},effectPos:function(){return this.dichotomous?Math.exp(this.effect)/2*100:(1+this.effect)/2*100}}}),s=o,l=(n("cab1"),n("2877")),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},c566:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticStyle:{width:"100%",height:"300px"},attrs:{id:"manhattan"}})])}],i=(n("a4d3"),n("e01a"),n("99af"),n("7db0"),n("d81d"),n("14d9"),n("b0c0"),n("6b93"),n("d3b7"),n("0643"),n("fffc"),n("4e3e"),n("a573"),n("159b"),n("2b0e")),o=n("2d5f"),s=n.n(o),l=n("bc8f"),c=n("529c"),u=(n("2ef0"),i["default"].component("ManhattanPlot",{props:["associations","colorByPhenotype","phenotypes","phenotypeMap"],data:function(){return{chart:null}},computed:{columns:function(){var t=this,e=(this.associations||[]).length;if(!this.phenotypes){var n=new Array(e+1),r=new Array(e+1);return n[0]="pValue_x",r[0]="pValue",this.associations.forEach((function(t,e){n[e+1]=p[t.chromosome]+t.position,r[e+1]=-Math.log10(t.pValue)})),[n,r]}var a=[];
1return this.phenotypes.forEach((function(e,n){var r=["".concat(e,"_x")],i=[e];t.associations.forEach((function(t){t.phenotype==e&&(r.push(p[t.chromosome]+t.position),i.push(-Math.log10(t.pValue)))})),a.push(r),a.push(i)})),a},columnKeys:function(){var t={};this.phenotypeMap;return this.phenotypes?(this.phenotypes.forEach((function(e){t[e]="".concat(e,"_x")})),t):{pValue:"pValue_x"}}},watch:{columns:function(t){var e=t,n=this.columnKeys;this.build_chart(n,e)}},mounted:function(){this.build_chart({},[])},methods:{build_chart:function(t,e){var n=this,r={};for(var a in t){var i;r[a]=null===(i=this.phenotypeMap[a])||void 0===i?void 0:i.description}this.chart=s.a.generate({bindto:"#manhattan",size:{height:300},interaction:{enabled:!0},data:{xs:t,columns:e,names:r,type:"scatter",order:null,color:function(t,e){if(!n.phenotypes||!n.colorByPhenotype)return g.find((function(t){return e.x<t[0]}))[1];var r=n.phenotypes.indexOf(e.id);return r>=0?l["a"][r]:"#000"}},legend:{show:!1},zoom:{enabled:!1,rescale:!1},point:{r:4,focus:{expand:{enabled:!0,r:7}}},tooltip:{show:!0,grouped:!0,contents:function(t,e,n,r){var a='<div class="manhattan-tooltip">',i=t.find((function(t){return!!t.gene})),o=i?i.gene:"P-value";return a+='<table cellspacing="4">\n <thead><tr>\n <th colspan="2" class="p-value">'.concat(o,"</th>\n </tr></thead>"),t.forEach((function(t){a+='<tr>\n <td class="tooltip-id">\n <span style="color:'.concat(r(t),'">◼</span>\n <span>').concat(t.name,'</span>\n </td>\n <td class="p-value">\n <span>').concat(c["a"].pValueFormatter(Math.pow(10,-t.value)),"</span>\n </td>\n </tr>")})),a+"</table></div>"}},axis:{x:{label:"Chromosome",min:0,max:p.Y+d.Y,tick:{values:h.map((function(t){return p[t]+Math.floor(d[t]/2)})),format:function(t){return f[t]},fit:!1}},y:{label:"-log10(p)"}}})}}})),d={1:247249719,2:242951149,3:199501827,4:191273063,5:180857866,6:170899992,7:158821424,8:146274826,9:140273252,10:135374737,11:134452384,12:132349534,13:114142980,14:106368585,15:100338915,16:88827254,17:78774742,18:76117153,19:63811651,20:62435964,21:46944323,22:49691432,X:154913754,Y:57772954},h=["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","X","Y"],p={},f={},_=["#08306b","#41ab5d","#000000","#f16913","#3f007d","#cb181d"],g=[],m=0;for(var v in h){var y=h[v],b=d[y];p[y]=m,f[m]=y,f[m+Math.floor(b/2)]=y,m+=b,g.push([m,_[v%_.length]])}var x=u,w=(n("cd0b"),n("2877")),C=Object(w["a"])(x,r,a,!1,null,null,null);e["a"]=C.exports},c5eb:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"row"},t._l(t.recentNews,(function(e,r){return n("div",{key:e.nid,staticClass:"news"},[r<5?[n("div",{class:"thumbnail "+(""===e.field_image?"no-image":"has-image")},[""!=e.field_image?n("img",{attrs:{src:e.field_image}}):t._e()]),n("h5",[t._v(t._s(e.title))]),n("div",{staticClass:"news-body"},[t._v(t._s(e.body))]),n("span",[t._v(" ... "),n("a",{attrs:{href:"news.html?nid="+e.nid,target:"_blank"}},[t._v("Read more")])])]:t._e()],2)})),0)},a=[],i=(n("d81d"),n("14d9"),n("a573"),n("2b0e")),o=(n("1157"),i["default"].component("news-feed-section",{props:["diseaseGroup","newsFeed"],data:function(){return{}},methods:{},computed:{recentNews:function(){var t=[],e=0;return this.newsFeed.map((function(n){e<5&&t.push(n),e++})),t}}})),s=o,l=(n("f14c"),n("2877")),c=Object(l["a"])(s,r,a,!1,null,"1a5bc985",null);e["a"]=c.exports},c706:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"row"},[n("div",{staticClass:"m-plot-content col-md-6",attrs:{id:"mPlotWrapper"+t.sectionId}},[n("div",{staticClass:"m-clicked-dot-value hidden",attrs:{id:"m_clicked_dot_value"+t.sectionId}},[n("div",{attrs:{id:"m_clicked_dot_value_content"+t.sectionId}})]),n("div",{staticClass:"m-dot-value-full-list hidden",attrs:{id:"m_dot_value_full_list"+t.sectionId}},[n("div",{staticClass:"m-clicked-dot-value-close",on:{click:function(e){return t.hidePanel("m_dot_value_full_list"+t.sectionId)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}}
1)],1),n("div",{attrs:{id:"m_dot_value_full_list_content"+t.sectionId}})]),t.renderConfig.legend?n("div",{staticClass:"m-plot-legend",domProps:{innerHTML:t._s(t.renderConfig.legend)}}):t._e(),t._l(t.plotsList,(function(e){return n("div",{key:e,attrs:{id:t.sectionId+"mPlotWrapper"}},["default"!=e?n("h4",[t._v(t._s(e))]):t._e(),t.renderConfig?n("canvas",{attrs:{id:"mPlot"+t.sectionId+e,width:"",height:""},on:{mouseleave:t.hidePanel,mousemove:function(n){return t.checkPosition(n,e,"m")},resize:t.onResize,click:function(n){return t.getFullList(n,e,"m")}}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_mPlot","svg","vector_m_plot_"+t.sectionId,e,t.sectionId+"_mPlot")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.downloadImage("mPlot"+t.sectionId+e,t.sectionId+e+"_mPlot","png")}}},[t._v("Download PNG")])])])])])})),t.renderData?n("research-m-bitmap-plot-vector",{ref:t.sectionId+"_mPlot",attrs:{renderData:t.renderData,renderConfig:t.mPlotRenderConfig,colors:t.chromosomeColors,margin:t.adjPlotMargin,chrLengths:t.chromosomeLength,sectionId:t.sectionId,utils:t.utils}}):t._e(),t.renderConfig.label?n("div",{staticClass:"m-plot-label",domProps:{innerHTML:t._s(t.renderConfig.label)}}):t._e()],2),n("div",{staticClass:"qq-plot-content col-md-6",attrs:{id:"qqPlotWrapper"+t.sectionId}},[n("div",{staticClass:"qq-clicked-dot-value hidden",attrs:{id:"qq_clicked_dot_value"+t.sectionId}},[n("div",{attrs:{id:"qq_clicked_dot_value_content"+t.sectionId}})]),n("div",{staticClass:"qq-dot-value-full-list hidden",attrs:{id:"qq_dot_value_full_list"+t.sectionId}},[n("div",{staticClass:"qq-clicked-dot-value-close",on:{click:function(e){return t.hidePanel("qq_dot_value_full_list"+t.sectionId)}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1),n("div",{attrs:{id:"qq_dot_value_full_list_content"+t.sectionId}})]),t.renderConfig.legend?n("div",{staticClass:"qq-plot-legend",domProps:{innerHTML:t._s(t.renderConfig.legend)}}):t._e(),t._l(t.plotsList,(function(e){return n("div",{key:e,attrs:{id:t.sectionId+"qqPlotWrapper"}},["default"!=e?n("h4",[t._v(t._s(e))]):t._e(),t.renderConfig?n("canvas",{attrs:{id:"qqPlot"+t.sectionId+e,width:"",height:""},on:{mouseleave:t.hidePanel,mousemove:function(n){return t.checkPosition(n,e,"qq")},resize:t.onResize,click:function(n){return t.getFullList(n,e,"qq")}}}):t._e(),n("div",{staticClass:"download-images-setting"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Download "),n("b-icon",{attrs:{icon:"download"}})],1),n("ul",{staticClass:"options"},[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.downloadImage("vector_wrapper_"+t.sectionId,t.sectionId+"_qqPlot","svg","vector_qq_plot_"+t.sectionId,e,t.sectionId+"_qqPlot")}}},[t._v("Download SVG")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.downloadImage("qqPlot"+t.sectionId+e,t.sectionId+e+"_qqPlot","png")}}},[t._v("Download PNG")])])])])])})),t.renderData?n("research-qq-plot-vector",{ref:t.sectionId+"_qqPlot",attrs:{renderData:t.renderData,renderConfig:t.mqQPlotRenderConfig,colors:t.chromosomeColors,margin:t.adjPlotMargin,chrLengths:t.chromosomeLength,sectionId:t.sectionId,utils:t.utils}}):t._e(),t.renderConfig.label?n("div",{staticClass:"qq-plot-label",domProps:{innerHTML:t._s(t.renderConfig.label)}}):t._e()],2)])},a=[],i=n("2909"),o=n("3835"),s=(n("cb29"),n("4de4"),n("d81d"),n("14d9"),n("e9c4"),n("6b93"),n("a9e3"),n("b680"),n("4fad"),n("b64b"),n("d3b7"),n("25f0"),n("498a"),n("0643"),n("2382"),n("a573"),n("2b0e")),l=n("1157"),c=n.n(l),u=n("b1e0"),d=n("fc3b"),h=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},p=[],f=(n("ac1f"),n("5319"),n("5b81"),n("5698"));n("2ef0");s["default"].use(u["a"]);var _=s["default"].component("research-qq-plot-vector",{props:["renderData","renderConfig","colors","margin","chrLengths","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{},methods:{renderPlot:function(t){var e=".vector-wrapper-".concat(this.canvasId),n=("vector_wrapper_".concat(this.sectionId),document.querySelector("#"+this.sectionId+"qqPlotWrapper")),r={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},a=this.renderConfig["width"]?this.renderConfig["width"]:n.clientWidth-(r.left+r.right),i=this.renderConfig["height"]?this.renderConfig["height"]:300,o=f["select"](e).append("svg").attr("id","vector_qq_plot_"+this.sectionId).attr("width",a+r.left+r.right).attr("height",i+r.top+r.bottom);o.append("g").attr("id","plot").attr("transform","translate(0,0)"),o.select("#plot").style("font-family","Arial").style("font-size",12).style("text-anchor","middle"),o.select("#plot").append("text").attr("x",r.left+a/2).attr("y",i+r.top+r.bottom-10).text(this.renderConfig["x axis label"]),o.select("#plot").append("text").attr("transform","translate("+(r.bump+20)+","+(r.top+i/2)+")rotate(-90)").attr("x",0).attr("y",0).text(this.renderConfig["y axis label"]);var s,l,c=this.renderConfig["y axis field"],u=(this.renderConfig["render by"],this.utils.sortUtils.sortArrOfObjects(this.renderData[t].unsorted,c,"number","desc")),d=8,h=0;u.map((function(t){var e=t[c];null==l&&(l=e),null==s&&(s=e),e<l&&(l=e),e>s&&(s=e)}));for(var p=[],_=1;_<=u.length;_++)p.push(Math.log10(_+1/u.length));var g=f["scaleLinear"]().domain([l,s]).range([i+r.top,r.top]);o.select("#plot").append("g").attr("transform","translate("+(r.left-r.bump)+",0)").call(f["axisLeft"](g).ticks(5));var m=f["scaleLinear"]().domain([h,d]).range([r.left,a]);f["scaleLinear"]().domain([d,h]).range([r.left,a]);o.select("#plot").append("g").attr("transform",(function(t){return"translate(0, "+(r.top+i+r.bump)+")"})).call(f["axisBottom"](m));var v=i/(s-l);o.select("#plot").append("line").attr("x1",m(0)).attr("x2",m(8)).attr("y1",g(l)).attr("y2",r.top+i-8*v).attr("stroke","#FF0000").style("stroke-width",.7
15),u.map((function(t,e){var n=m(p[p.length-1]-p[e]),r=g(t[c]);o.select("#plot").append("circle").attr("cx",n).attr("cy",r).attr("r",2).style("fill","#0066FF")})),this.renderData[t].lambda&&(o.select("#plot").style("font-family","Arial").style("font-size",12).style("text-anchor","end"),o.select("#plot").append("text").attr("x",m(8)).attr("y",g(l)).text("lambda(0.95): "+this.renderData[t].lambda.toFixed(4)))}}});c()((function(){}));var g=_,m=n("2877"),v=Object(m["a"])(g,h,p,!1,null,null,null),y=v.exports;s["default"].use(u["a"]);var b=s["default"].component("research-m-qq-plot",{props:["plotData","renderConfig","dataComparisonConfig","compareGroupColors","utils","sectionId"],data:function(){return{plotRendered:0,chromosomeLength:{1:248956422,2:242193529,3:198295559,4:190214555,5:181538259,6:170805979,7:159345973,8:145138636,9:138394717,10:133797422,11:135086622,12:133275309,13:114364328,14:107043718,15:101991189,16:90338345,17:83257441,18:80373285,19:58617616,20:64444167,21:46709983,22:50818468,23:156040895,24:57227415,X:156040895,Y:57227415},chromosomeColors:["#08306b","#41ab5d","#000000","#f16913","#3f007d","#cb181d"],leftMargin:150,rightMargin:1,topMargin:20,bottomMargin:100,mDotPosData:{},qqDotPosData:{},compareGroups:null}},modules:{},components:{ResearchMPlotBitmapVector:d["a"],ResearchQQPlotVector:y},mounted:function(){this.renderPlot(this.renderData),window.addEventListener("resize",this.onResize)},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},computed:{adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.leftMargin,right:this.rightMargin,top:this.topMargin,bottom:this.bottomMargin,bump:10};return e},mPlotRenderConfig:function(){var t=JSON.parse(JSON.stringify(this.renderConfig));return t["y axis label"]=this.renderConfig["m-plot y axis label"],t["x axis label"]=this.renderConfig["m-plot x axis label"],t["thresholds"]=this.renderConfig["m-plot thresholds"],t},mqQPlotRenderConfig:function(){var t=JSON.parse(JSON.stringify(this.renderConfig));return t["y axis label"]=this.renderConfig["qq-plot y axis label"],t["x axis label"]=this.renderConfig["qq-plot x axis label"],t},plotsList:function(){var t=this.plotData,e=[];if(t){if(null!=this.dataComparisonConfig)for(var n=this.dataComparisonConfig["fields to compare"][0],r=0,a=Object.entries(t);r<a.length;r++){var i=Object(o["a"])(a[r],2),s=(i[0],i[1]);Object.keys(s[n]).map((function(t){e.indexOf(t)<0&&e.push(t)}))}else e=["default"];return e}return null},renderData:function(){var t=this,e=this.plotData,n={},r=Object(i["a"])(this.plotsList),a=this.plotData[0][this.renderConfig["lambda"]]?this.plotData[0][this.renderConfig["lambda"]]:null;for(var s in r.map((function(t){var e={lambda:a,sorted:{},unsorted:[]};n[t]=e})),this.chromosomeLength)for(var l=0,c=Object.entries(n);l<c.length;l++){var u=Object(o["a"])(c[l],2),d=(u[0],u[1]);d.sorted[s]=[]}if(null!=this.dataComparisonConfig)for(var h=function(){var e=Object(o["a"])(f[p],2),a=(e[0],e[1]);r.map((function(e){var r=a[t.renderConfig["x axis field"]];if(void 0!=r&&""!=r&&null!=r){var i={};if(i[t.renderConfig["render by"]]=a[t.renderConfig["render by"]],t.renderConfig["hover content"]){var o=t.renderConfig["hover content"];o.map((function(n){var r=t.dataComparisonConfig["fields to compare"].indexOf(n);i[n]=r<0?a[n]:a[n][e]}))}var s=a[t.renderConfig["x axis field"]].split(":"),l=s[0].trim(),c=s[1].split("-");i["locus"]=c.length>1?(Number(c[0].trim())+Number(c[1].trim()))/2:Number(c[0].trim()),i[t.renderConfig["y axis field"]]=a[t.renderConfig["y axis field"]][e],n[e].sorted[l].push(i),n[e].unsorted.push(i)}}))},p=0,f=Object.entries(e);p<f.length;p++)h();else e.map((function(e){var r=e[t.renderConfig["x axis field"]];if(void 0!=r&&""!=r&&null!=r){var a={};if(a[t.renderConfig["render by"]]=e[t.renderConfig["render by"]],t.renderConfig["hover content"]){var i=t.renderConfig["hover content"];i.map((function(t){a[t]=e[t]}))}var o=e[t.renderConfig["x axis field"]].split(":"),s=o[0].trim(),l=o[1].split("-");a["locus"]=l.length>1?(Number(l[0].trim())+Number(l[1].trim()))/2:Number(l[0].trim()),a[t.renderConfig["y axis field"]]=e[t.renderConfig["y axis field"]],n["default"].sorted[s].push(a),n["default"].unsorted.push(a)}}));return n}},watch:{renderData:function(t){setTimeout((function(){window.dispatchEvent(new Event("resize"))}),100)}}
1,methods:{downloadImage:function(t,e,n,r,a,i){if("svg"==n){var o=i;this.$refs[o].renderPlot(a),this.utils.uiUtils.downloadImg(t,e,n,r)}else"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},hidePanel:function(t){this.utils.uiUtils.hideElement(t)},onResize:function(t){this.renderPlot(this.renderData)},getFullList:function(t,e,n){var r=this,a=document.getElementById(n+"_dot_value_full_list"+this.sectionId);document.getElementById(n+"Plot"+this.sectionId+e);a.classList.remove("hidden");for(var i=t,o=i.target.getBoundingClientRect(),s=Math.floor(i.clientX-o.left),l=Math.floor(i.clientY-o.top),c="",u=-5;u<=5;u++)for(var d=function(){if(void 0!=r[n+"DotPosData"][e][s+u]&&void 0!=r[n+"DotPosData"][e][s+u][l+h]){var t=r[n+"DotPosData"][e][s+u][l+h];if(c+='<span class="gene-on-clicked-dot-mplot"><b>'+t[r.renderConfig["render by"]]+"</b></span>",r.renderConfig["hover content"]){var a=r.renderConfig["hover content"];a.map((function(e){c+='<span class="content-on-clicked-dot">'+e+": "+t[e]+"</span>"}))}}},h=-5;h<=5;h++)d();var p=document.getElementById(n+"_dot_value_full_list_content"+this.sectionId);""!=c?(p.innerHTML=c,document.getElementById(n+"Plot"+this.sectionId+e).classList.add("hover"),document.getElementById(n+"_clicked_dot_value"+this.sectionId).classList.add("hidden")):(a.classList.add("hidden"),document.getElementById(n+"Plot"+this.sectionId+e).classList.remove("hover"))},checkPosition:function(t,e,n){var r=this,a=document.getElementById(n+"_clicked_dot_value"+this.sectionId),i=document.getElementById(n+"Plot"+this.sectionId+e);a.classList.remove("hidden");var o=t,s=o.target.getBoundingClientRect(),l=Math.floor(o.clientX-s.left),c=Math.floor(o.clientY-s.top);a.style.top=c+i.offsetTop+"px",a.style.left=l+i.offsetLeft+15+"px";for(var u="",d=0,h=-5;h<=5;h++)for(var p=function(){if(void 0!=r[n+"DotPosData"][e][l+h]&&void 0!=r[n+"DotPosData"][e][l+h][c+f]){if(d<6){var t=r[n+"DotPosData"][e][l+h][c+f];if(u+='<span class="gene-on-clicked-dot-mplot"><b>'+t[r.renderConfig["render by"]]+"</b></span>",r.renderConfig["hover content"]){var a=r.renderConfig["hover content"];a.map((function(e){u+='<span class="content-on-clicked-dot">'+e+": "+t[e]+"</span>"}))}}d+=1}},f=-5;f<=5;f++)p();d>5&&(u+='<span class="gene-on-clicked-dot-mplot" style="color: #36c;"><b>Viewing 5 of '+d+" items. Click to view full list.<b><span>");var _=document.getElementById(n+"_clicked_dot_value_content"+this.sectionId);""!=u?(_.innerHTML=u,document.getElementById(n+"Plot"+this.sectionId+e).classList.add("hover")):(a.classList.add("hidden"),document.getElementById(n+"Plot"+this.sectionId+e).classList.remove("hover"))},renderPlot:function(t){this.renderMPlot(t),this.renderQQPlot(t)},renderQQPlot:function(t){var e=this;this.qqDotPosData={};var n=document.getElementById("qq_clicked_dot_value"+this.sectionId);n.classList.add("hidden");for(var r=document.getElementById("qqPlotWrapper"+this.sectionId),a=this.renderConfig.width?2*this.renderConfig.width+this.leftMargin+this.rightMargin:2*r.clientWidth-60,i=this.renderConfig.height?2*this.renderConfig.height+this.topMargin+this.bottomMargin:800,s=.02*a,l=.02*i,c=10,u=a-(this.leftMargin+this.rightMargin+s),d=i-(this.topMargin+l+this.bottomMargin),h=function(){var t=Object(o["a"])(f[p],2),n=t[0],r=t[1],s=document.getElementById("qqPlot"+e.sectionId+n);if(s){s.setAttribute("width",a),s.setAttribute("height",i),s.setAttribute("style","margin-left: -15px; width:"+a/2+"px;height:"+i/2+"px;");var h=s.getContext("2d");h.clearRect(0,0,a,i),h.beginPath(),h.lineWidth=1,h.strokeStyle="#000000",h.setLineDash([]),h.moveTo(e.leftMargin-c,e.topMargin),h.lineTo(e.leftMargin-c,d+e.topMargin+l+c),h.moveTo(e.leftMargin-c,d+e.topMargin+l+c),h.lineTo(u+e.leftMargin+c,d+e.topMargin+l+c);var _=null,g=null,m=e.utils.sortUtils.sortArrOfObjects(r.unsorted,e.renderConfig["y axis field"],"number","desc");r.lambda&&(h.font="26px Arial",h.textAlign="end",h.fillText("lambda(0.95): "+r.lambda.toFixed(4),u+e.leftMargin+c,d+e.topMargin+l)),m.map((function(t){var n=t[e.renderConfig["y axis field"]];n,null==_&&(_=n),null==g&&(g=n),n<_&&(_=n),n>g&&(g=n)}));for(var v=(g-_)/4,y=d/4,b=0;b<5;b++){var x=e.topMargin+b*y,w=Math.floor(x);h.moveTo(e.leftMargin-2*c,w),h.lineTo(e.leftMargin-c,w),h.stroke(),h.font="22px Arial",h.textAlign="right",h.fillStyle="#000000";var C=e.utils.Formatters.floatFormatter(_+b*v);
1C="-"==C?0:C,h.fillText(C,e.leftMargin-3*c,e.topMargin+d+10-b*y)}h.stroke(),h.font="24px Arial",h.textAlign="center",h.fillStyle="#000000",h.rotate(-2*Math.PI/4),h.fillText(e.renderConfig["qq-plot y axis label"],-(e.topMargin+d/2),e.leftMargin-e.leftMargin/2-28);var P=u/8,k=e.leftMargin;h.textAlign="center",h.rotate(2*Math.PI/4);for(var M=0;M<9;M++){var E=k+P*M;h.fillText(M,E,e.topMargin+d+l+28+c)}h.fillText(e.renderConfig["qq-plot x axis label"],u/2+e.leftMargin,e.topMargin+d+l+88);for(var D=[],O=1;O<=m.length;O++)D.push(Math.log10(O+1/m.length));var L=u*((D[D.length-1]-D[0])/8),j=d/(g-_),S=L/(D[D.length-1]-D[0]);h.beginPath(),h.strokeStyle="#ff0000",h.moveTo(e.leftMargin,e.topMargin+d),h.lineTo(e.leftMargin+u,e.topMargin+d-8*j),h.stroke(),m.map((function(t,r){var a=t[e.renderConfig["y axis field"]]-_,i=e.topMargin+d-a*j,o=e.leftMargin+L-(D[r]*S+D[0]*S),s="#0066FF";h.fillStyle=s,h.lineWidth=0,h.beginPath(),h.arc(o,i,4,0,2*Math.PI),h.fill();var l,c=Math.round(o.toString().split(".")[0]/2),u=Math.round(i.toString().split(".")[0]/2);e.renderConfig["hover content"]&&(l=e.renderConfig["hover content"]),e.qqDotPosData[n]||(e.qqDotPosData[n]={}),e.qqDotPosData[n][c]||(e.qqDotPosData[n][c]={}),e.qqDotPosData[n][c][u]={},e.qqDotPosData[n][c][u][e.renderConfig["render by"]]=t[e.renderConfig["render by"]],e.renderConfig["hover content"]&&l.map((function(r){e.qqDotPosData[n][c][u][r]=t[r]}))}))}},p=0,f=Object.entries(t);p<f.length;p++)h()},renderMPlot:function(t){var e=this;this.mDotPosData={};var n=document.getElementById("m_clicked_dot_value"+this.sectionId);n.classList.add("hidden");for(var r=document.getElementById("mPlotWrapper"+this.sectionId),a=this.renderConfig.width?2*this.renderConfig.width+this.leftMargin+this.rightMargin:2*r.clientWidth-60,i=this.renderConfig.height?2*this.renderConfig.height+this.topMargin+this.bottomMargin:800,s=.02*a,l=.02*i,c=10,u=a-(this.leftMargin+this.rightMargin+s),d=i-(this.topMargin+l+this.bottomMargin),h=function(){var t=Object(o["a"])(f[p],2),n=t[0],r=t[1],s=document.getElementById("mPlot"+e.sectionId+n);if(s){s.setAttribute("width",a),s.setAttribute("height",i),s.setAttribute("style","margin-left: -15px; width:"+a/2+"px;height:"+i/2+"px;");var h=s.getContext("2d");h.clearRect(0,0,a,i),h.beginPath(),h.lineWidth=1,h.strokeStyle="#000000",h.setLineDash([]),h.moveTo(e.leftMargin-c,e.topMargin),h.lineTo(e.leftMargin-c,d+e.topMargin+l+c),h.moveTo(e.leftMargin-c,d+e.topMargin+l+c),h.lineTo(u+e.leftMargin+c,d+e.topMargin+l+c);var _=null,g=null;r.unsorted.map((function(t){var n=t[e.renderConfig["y axis field"]];null==_&&(_=n),null==g&&(g=n),n<_&&(_=n),n>g&&(g=n)}));for(var m=(g-_)/4,v=d/4,y=0;y<5;y++){var b=e.topMargin+y*v,x=Math.floor(b);h.moveTo(e.leftMargin-2*c,x),h.lineTo(e.leftMargin-c,x),h.stroke(),h.font="22px Arial",h.textAlign="right",h.fillStyle="#000000";var w=e.utils.Formatters.floatFormatter(_+y*m);w="-"==w?0:w,h.fillText(w,e.leftMargin-3*c,e.topMargin+d+5-y*v)}h.stroke(),h.font="24px Arial",h.textAlign="center",h.fillStyle="#000000",h.rotate(-2*Math.PI/4),h.fillText(e.renderConfig["m-plot y axis label"],-(e.topMargin+d/2),e.leftMargin-e.leftMargin/2-28);var C=0,P=Object.keys(r.sorted).filter((function(t){return r.sorted[t].length>0}));P.map((function(t){var n=0;r.sorted[t].map((function(t){n=t.locus>n?t.locus:n})),e.chromosomeLength[t]=n>e.chromosomeLength[t]?n:e.chromosomeLength[t]})),P.map((function(t){C+=e.chromosomeLength[t]}));var k=u/C,M=e.leftMargin;h.textAlign="center",h.rotate(2*Math.PI/4),P.map((function(t){var n=e.chromosomeLength[t]*k;M+=n;var r=M-n/2;h.fillText(t,r,e.topMargin+d+l+28+c)})),h.fillText(e.renderConfig["m-plot x axis label"],u/2+e.leftMargin,e.topMargin+d+l+88),M=0;var E=1;P.map((function(t){r.sorted[t].map((function(t){var r=(M+t.locus)*k+e.leftMargin,a=d/(g-_),i=e.topMargin+d-(t[e.renderConfig["y axis field"]]-_)*a,o=e.chromosomeColors[E%e.chromosomeColors.length];h.fillStyle=o+"75",h.lineWidth=0,h.beginPath(),h.arc(r,i,6,0,2*Math.PI),h.fill();var s,l=Math.round(r.toString().split(".")[0]/2),c=Math.round(i.toString().split(".")[0]/2);e.renderConfig["hover content"]&&(s=e.renderConfig["hover content"]),e.mDotPosData[n]||(e.mDotPosData[n]={}),e.mDotPosData[n][l]||(e.mDotPosData[n][l]={}),e.mDotPosData[n][l][c]={},e.mDotPosData[n][l][c][e.renderConfig["render by"]]=t[e.renderConfig["render by"]],e.renderConfig["hover content"]&&s.map((function(r){e.mDotPosData[n][l][c][r]=t[r]}))})),M+=e.chromosomeLength[t],E++})),e.renderConfig["m-plot thresholds"]&&e.renderConfig["m-plot thresholds"].map((function(t){var n=-Math.log10(Number(t)),r=d/(g-_),i=e.topMargin+d-(n-_)*r;h.beginPath(),h.setLineDash([10,5]),h.lineWidth=2,h.moveTo(e.leftMargin-l,i),h.lineTo(a+l-e.rightMargin,i),h.strokeStyle="#FFAA00",h.stroke(),h.closePath()}))}},p=0,f=Object.entries(t);p<f.length;p++)h()}}});c()((function(){}));var x=b,w=(n("7b60"),Object(m["a"])(x,r,a,!1,null,null,null));e["a"]=w.exports},c75b:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("select",{directives:[{name:"model",rawName:"v-model",value:t.size,expression:"size"}],staticClass:"form-control",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,
1(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.size=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"small"}},[t._v("Small")]),n("option",{attrs:{value:"large"}},[t._v("Large")])])},a=[],i=n("2b0e"),o=n("5f5b"),s=n("b1e0"),l=n("fd66");n("f9e3"),n("2dd8");i["default"].use(o["a"]),i["default"].use(s["b"]);var c=i["default"].component("geneset-size-selectpicker",{props:[],data:function(){return{size:l["a"].genesetSize}},computed:{keyParamsSize:function(){return l["a"].genesetSize}},watch:{size:function(t){this.$store.state.genesetSizeToQuery=t,this.$emit("onGenesetSizeChange",t)},keyParamsSize:function(t){null===this.size&&(this.size=t)}}}),u=c,d=n("2877"),h=Object(d["a"])(u,r,a,!1,null,null,null);e["a"]=h.exports},c7e1:function(t,e,n){},c80e:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"no-access"},[t.restricted?n("b-alert",{attrs:{show:"",variant:"warning"}},[t.count?n("span",[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" There were "),n("strong",[t._v(t._s(t.count))]),t._v(" records hidden because you do not have required permission to view them. ")],1):n("span",[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" There was hidden data because you do not have required permission to view them. ")],1),t.user?n("span",[t._v(" Please contact us if you believe you should've given access. ")]):n("span",[t._v(" Please "),n("a",{attrs:{href:"/login"},on:{click:function(e){return e.preventDefault(),t.loginUser.apply(null,arguments)}}},[t._v("log in")]),t._v(" with an authorized Google account to see them. ")])]):t.failed?n("b-alert",{attrs:{show:"",variant:"danger"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" There was an error loading the data: "+t._s(t.failed)+" ")],1):t._e()],1)},a=[],i=n("2b0e"),o=n("8d29"),s=i["default"].component("unauthorized-message",{mixins:[o["a"]],data:function(){return{}},props:{restricted:{required:!1,default:!1},failed:{required:!1,default:!1}},computed:{count:function(){return"number"===typeof this.restricted?this.restricted:null}}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},c8cc:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.diseaseGroup?n("div",[n("div",{class:"container-fluid "+t.diseaseGroup.name+"kp-footer"},[t._m(0)])]):t._e()},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("a",{staticStyle:{color:"#fff !important"},attrs:{href:"https://kp4cd.org/"}},[t._v(" Powered by the "),n("span",{staticStyle:{"font-weight":"500","font-size":"1.2em","vertical-align":"-.1em"}},[t._v("HuGeAMP")]),n("span",{staticClass:"registered-mark"},[t._v(" Â Â |Â Â ACCELERATING MEDICINES PARTNERSHIP and AMP are registered service marks of the U.S. Department of Health and Human Services. ")])])])}],i=n("2b0e"),o=i["default"].component("page-footer",{props:["diseaseGroup"],data:function(){return{}}}),s=o,l=n("2877"),c=Object(l["a"])(s,r,a,!1,null,null,null);e["a"]=c.exports},ca4a:function(t,e,n){},cab1:function(t,e,n){"use strict";n("948d")},cb2d8:function(t,e,n){"use strict";n("2243")},cb48:function(t,e,n){"use strict";var r=n("53ca"),a=n("1da1"),i=(n("d9e2"),n("99af"),n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("4de4"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("3ca3"),n("5319"),n("0643"),n("2382"),n("4e3e"),n("159b"),n("ddb0"),n("72bf")),o=n.n(i),s=n("de86"),l=n("e60d");function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;
vendor: 7,198 bytes, line 1
1return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}e["a"]={namespaced:!0,state:function(){return{host:s["a"],diseaseSystems:[],diseaseGroups:[],phenotypes:[],ancestries:[],complications:[],datasets:[],phenotypeMap:{},complicationsMap:{},datasetMap:{},documentations:{},user:"",links:[],defaultPortal:""}},mutations:{setDiseaseSystems:function(t,e){t.diseaseSystems=e},setDiseaseGroups:function(t,e){t.diseaseGroups=e},setPhenotypes:function(t,e){for(var n in t.phenotypes=e,t.phenotypeMap={},t.phenotypes)t.phenotypeMap[t.phenotypes[n].name]=t.phenotypes[n]},setDocumentations:function(t,e){for(var n in t.documentations={},e)t.documentations[e[n].name]=e[n]},setAncestries:function(t,e){for(var n in t.ancestries=e,t.ancestryMap={},t.ancestries)t.ancestryMap[t.ancestries[n].name]=t.ancestries[n]},setComplications:function(t,e){for(var n in t.complications=e,t.complicationsMap={},t.complications)t.complicationsMap[t.complications[n].name]=t.complications[n]},setDatasets:function(t,e){for(var n in t.datasets=e,t.datasetMap={},t.datasets)t.datasetMap[t.datasets[n].name]=t.datasets[n]},setDocumentation:function(t,e){t.documentation=e},setUser:function(t,e){t.user=e},setLinks:function(t,e){t.links=e},setDefaultPortal:function(t,e){t.defaultPortal=e}},getters:{defaultGroup:function(t){if(t.diseaseGroups.length>0){if(!t.defaultPortal&&!Object({VUE_APP_GA4_ID:"G-B7R7YKFCZL",NODE_ENV:"production",BASE_URL:"/"}).VUE_APP_DEFAULT_PORTAL)return t.diseaseGroups.filter((function(t){return t.default}))[0];var e=t.defaultPortal||Object({VUE_APP_GA4_ID:"G-B7R7YKFCZL",NODE_ENV:"production",BASE_URL:"/"}).VUE_APP_DEFAULT_PORTAL;for(var n in t.diseaseGroups){var r=t.diseaseGroups[n];if(r.name==e)return r}}},diseaseGroup:function(t,e){for(var n in t.diseaseGroups){var r,a=t.diseaseGroups[n];if(a.name==(null===(r=t.host.subDomain)||void 0===r?void 0:r.replace(/\.?dev/,"")))return a}return e.defaultGroup}
1,isRootPortal:function(t,e){var n;return null===(n=t.host.subDomain)||void 0===n||!n.replace(/\.?dev/,"")||t.host.subDomain===e.diseaseGroup.portalGroup}},actions:{getDiseaseSystems:function(t){return Object(a["a"])(c().mark((function e(){var n,r;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.commit,e.next=3,fetch("".concat(l["a"],"/api/portal/systems")).then((function(t){return t.json()}));case 3:r=e.sent,n("setDiseaseSystems",r.data);case 5:case"end":return e.stop()}}),e)})))()},getDiseaseGroups:function(t){return Object(a["a"])(c().mark((function e(){var n,r;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.commit,e.next=3,fetch("".concat(l["a"],"/api/portal/groups")).then((function(t){return t.json()}));case 3:r=e.sent,n("setDiseaseGroups",r.data);case 5:case"end":return e.stop()}}),e)})))()},getPhenotypes:function(t){return Object(a["a"])(c().mark((function e(){var n,r,a,i,s;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.state,a=t.commit,i=o.a.stringify({q:r.defaultPortal||Object({VUE_APP_GA4_ID:"G-B7R7YKFCZL",NODE_ENV:"production",BASE_URL:"/"}).VUE_APP_DEFAULT_PORTAL||(null===(n=r.host.subDomain)||void 0===n?void 0:n.replace(/\.?dev/,""))||"md"},{skipNull:!0}),e.next=4,fetch("".concat(l["a"],"/api/portal/phenotypes?").concat(i)).then((function(t){return t.json()}));case 4:s=e.sent,a("setPhenotypes",s.data);case 6:case"end":return e.stop()}}),e)})))()},getDocumentations:function(t){return Object(a["a"])(c().mark((function e(){var n,r,a,i,s;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.state,a=t.commit,i=o.a.stringify({q:r.defaultPortal||Object({VUE_APP_GA4_ID:"G-B7R7YKFCZL",NODE_ENV:"production",BASE_URL:"/"}).VUE_APP_DEFAULT_PORTAL||(null===(n=r.host.subDomain)||void 0===n?void 0:n.replace(/\.?dev/,""))||"md"},{skipNull:!0}),e.next=4,fetch("".concat(l["a"],"/api/portal/documentations?").concat(i)).then((function(t){return t.json()}));case 4:s=e.sent,a("setDocumentations",s.data);case 6:case"end":return e.stop()}}),e)})))()},getAncestries:function(t){return Object(a["a"])(c().mark((function e(){var n,r,a,i,s;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.state,a=t.commit,i=o.a.stringify({q:r.defaultPortal||Object({VUE_APP_GA4_ID:"G-B7R7YKFCZL",NODE_ENV:"production",BASE_URL:"/"}).VUE_APP_DEFAULT_PORTAL||(null===(n=r.host.subDomain)||void 0===n?void 0:n.replace(/\.?dev/,""))||"md"},{skipNull:!0}),e.next=4,fetch("".concat(l["a"],"/api/portal/ancestries?").concat(i)).then((function(t){return t.json()}));case 4:s=e.sent,a("setAncestries",s.data);case 6:case"end":return e.stop()}}),e)})))()},getComplications:function(t){return Object(a["a"])(c().mark((function e(){var n,r,a,i;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.state,a=t.commit,o.a.stringify({q:r.defaultPortal||Object({VUE_APP_GA4_ID:"G-B7R7YKFCZL",NODE_ENV:"production",BASE_URL:"/"}).VUE_APP_DEFAULT_PORTAL||(null===(n=r.host.subDomain)||void 0===n?void 0:n.replace(/\.?dev/,""))||"md"},{skipNull:!0}),e.next=4,fetch("".concat(l["a"],"/api/portal/complications")).then((function(t){return t.json()}));case 4:i=e.sent,a("setComplications",i.data);case 6:case"end":return e.stop()}}),e)})))()},getDatasets:function(t){return Object(a["a"])(c().mark((function e(){var n,r,a,i,s;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=t.state,a=t.commit,i=o.a.stringify({q:r.defaultPortal||Object({VUE_APP_GA4_ID:"G-B7R7YKFCZL",NODE_ENV:"production",BASE_URL:"/"}).VUE_APP_DEFAULT_PORTAL||(null===(n=r.host.subDomain)||void 0===n?void 0:n.replace(/\.?dev/,""))||"md"},{skipNull:!0}),e.next=4,fetch("".concat(l["a"],"/api/portal/datasets?").concat(i)).then((function(t){return t.json()}));case 4:s=e.sent,a("setDatasets",s.data);case 6:case"end":return e.stop()}}),e)})))()},getUser:function(t,e){return Object(a["a"])(c().mark((function n(){var r;return c().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,fetch("https://oauth2.googleapis.com/tokeninfo?access_token="+e).then((function(t){return t.json()}));case 2:r=n.sent,t.commit("setUser",r.email);case 4:case"end":return n.stop()}}),n)})))()},getLinks:function(t){return Object(a["a"])(c().mark((function e(){var n,r;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.state,n=t.commit,e.next=3,fetch("".concat(l["a"],"/api/portal/links")).then((function(t){return t.json()}));case 3:r=e.sent,n("setLinks",r.data);case 5:case"end":return e.stop()}}),e)})))()}}}},cb74:function(t,e,n){},cce6:function(t,e,n){"use strict";n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("c19f"),n("ace4"),n("2c66"),n("249d"),n("40e9"),n("b0c0"),n("d3b7"),n("25f0"),n("2532"),n("84c3"),n("907a"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("986a"),n("1d02"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("6ce5"),n("2834"),n("72f7"),n("4ea1"),n("a573");var r=function(){var t=a((new Date).getTime()%65536)+a(window.crypto.getRandomValues(new Uint16Array(1))[0]);return t},a=function(t){return("000"+t.toString(16)).slice(-4)},i=function(t,e,n){var r=e.map((function(t){return t.name})),a=[];return t.map((function(t){r.includes(t[n])&&a.push(t)})),a};e["a"]={generate:r,getInSession:i}},cd0b:function(t,e,n){"use strict";n("ce82")},cda2:function(t,e,n){"use strict";n("9aba")},ce82:function(t,e,n){},cf0e:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},a=[],i=n("2909"),o=n("3835"),s=(n("a4d3"),n("e01a"),n("4de4"),n("d81d"),n("14d9"),n("13d5"),n("b0c0"),n("6b93"),n("a9e3"),n("4fad"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("3ca3"),n("5319"),n("5b81"),n("0643"),n("a573"),n("9d4a"),n("ddb0"),n("2b0e")),l=n("1157"),c=n.n(l),u=n("5698"),d=(n("2ef0"),n("b1e0"));s["default"].use(d["a"]);var h=s["default"].component("research-phewas-plot-vector",{props:["renderData","renderConfig","phenotypeMap","colors","margin","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{canvasId:function(t){}}
1,methods:{renderPlot:function(){for(var t=this,e=".vector-wrapper-".concat(this.canvasId),n=("vector_wrapper_".concat(this.sectionId),document.querySelector("#"+this.sectionId+"pheWasPlotWrapper")),r={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},a=this.renderConfig["width"]?this.renderConfig["width"]:n.clientWidth-(r.left+r.right),s=this.renderConfig["height"]?this.renderConfig["height"]-(r.top+r.bottom):150,l=u["select"](e).append("svg").attr("id","vector_pheWas_plot_"+this.sectionId).attr("width",a+r.left+r.right).attr("height",s+r.top+r.bottom),c=this.renderConfig["y axis field"],d=this.renderConfig["beta field"],h=this.renderConfig["render by"],p=[],f=0,_=function(){var e=Object(o["a"])(m[g],2),n=e[0],r=e[1];r.map((function(e){var r={key:f,value:{}};r.value["value"]=1==t.renderConfig["convert y -log10"]||"true"==t.renderConfig["convert y -log10"]?-Math.log10(e[c]):e[c],r.value["beta"]=e[d],r.value["name"]=t.renderConfig["phenotype map"]&&"kp phenotype map"==t.renderConfig["phenotype map"]?t.phenotypeMap[e[h]]["description"]:e[h],r.value["group"]=n,p.push(r),f++}))},g=0,m=Object.entries(this.renderData);g<m.length;g++)_();l.append("g").attr("id","axisLabelsGroup").attr("transform","translate(0,0)"),l.select("#axisLabelsGroup").style("font-family","Arial").style("font-size",12).style("text-anchor","middle"),l.select("#axisLabelsGroup").append("text").attr("x",r.left+a/2).attr("y",s+r.top+r.bottom-20).text(this.renderConfig["x axis label"]),l.select("#axisLabelsGroup").append("text").attr("transform",(function(t){return"translate("+(r.bump+20)+","+(r.top+s/2)+")rotate(-90)"})).attr("x",0).attr("y",0).text(this.renderConfig["y axis label"]);var v=[],y=0;p.map((function(t){v.push(t.key+y),y++}));var b=Object(i["a"])(new Set(p.map((function(t){return t.value.value})))),x=Object(i["a"])(new Set(p.map((function(t){return t.value.group})))),w=this.colors,C=Math.ceil(b.reduce((function(t,e){return t>e?t:e}))),P=Math.floor(b.reduce((function(t,e){return t<e?t:e}))),k=u["scaleBand"]().range([r.left,a+r.left]).domain(p.map((function(t){return t.key}))).paddingInner(1).paddingOuter(.5),M=u["scaleLinear"]().domain([P,C]).range([s+r.top,r.top]);l.attr("transform","translate(0,0)").append("g").attr("id","axisGroup"),l.select("#axisGroup").append("g").attr("transform",(function(t){return"translate("+(r.left-r.bump)+",0)"})).call(u["axisLeft"](M)),l.select("#axisGroup").append("line").attr("x1",r.left-r.bump).attr("x2",r.left+a).attr("y1",r.top+s+r.bump).attr("y2",r.top+s+r.bump).attr("stroke","#000000").style("stroke-width",1);var E,D="";if(p.map((function(t){var e=x.indexOf(t.value.group)%w.length,n=w[e];t.value.group!=D&&(D=t.value.group,l.select("#axisGroup").append("line").attr("x1",k(t.key)).attr("x2",k(t.key)).attr("y1",r.top+s+r.bump).attr("y2",r.top+s+2*r.bump).attr("stroke","#000000").style("stroke-width",1),l.select("#axisGroup").append("text").attr("transform","translate("+(k(t.key)-6)+","+(M(0)+18)+")rotate(45)").attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",11).style("fill",n).text(D))})),this.renderConfig["beta field"]&&null!=this.renderConfig["beta field"]&&"null"!=this.renderConfig["beta field"]){var O=u["symbol"]().type(u["symbolTriangle"]).size(50);l.selectAll("triangles").data(p).enter().append("path").attr("d",O).attr("fill",(function(t){var e=x.indexOf(t.value.group)%w.length,n=w[e];return n})).attr("transform",(function(t){var e=t.value.beta>0?0:180,n=t.value.beta>0?M(t.value.value)+2:M(t.value.value)-2;return"translate("+k(t.key)+","+n+")rotate("+e+")"})).attr("stroke","#000000").style("stroke-width",.5)}else l.selectAll("circle").data(p).enter().append("circle").attr("cx",(function(t){return k(t.key)})).attr("cy",(function(t){return M(t.value.value)})).attr("r",5).style("fill",(function(t){var e=x.indexOf(t.value.group)%w.length,n=w[e];return n})).attr("stroke","#000000").style("stroke-width",.5);this.renderConfig["thresholds"].map((function(e){E="string"==typeof e?Number(e):e,1!=t.renderConfig["convert y -log10"]&&"true"!=t.renderConfig["convert y -log10"]||(E=-Math.log10(e)),l.select("#axisGroup").append("line").attr("style","stroke-dasharray: 5,2").attr("x1",r.left).attr("y1",M(E)).attr("x2",a+r.left).attr("y2",M(E)).attr("stroke","#FFAA00").style("stroke-width",1)}));var L=Object(i["a"])(new Set(p.map((function(t){return t.value.group})))),j=a/p.length;L.map((function(t){var e=Object(i["a"])(new Set(p.filter((function(e){return e.value.group==t})))),n=k(e[e.length-1].key)+j,r=M(E);e.map((function(t,e){var a=k(t.key),i=a+j,o=k(t.key)+11*e;if(o=i>o?a:o,0==e||o<n){var s=M(t.value.value)<r?"#000000":"#cccccc";l.select("#axisGroup").append("line").attr("x1",a).attr("x2",o).attr("y1",M(t.value.value)).attr("y2",M(t.value.value)-10).attr("stroke","#999999").style("stroke-width",.5),l.select("#axisGroup").append("text").attr("transform","translate("+(o+3)+","+(M(t.value.value)-12)+")rotate(-90)").attr("x",0).attr("y",0).style("font-family","Arial").style("font-size",11).style("fill",s).text(t.value.name)}}))}))}}});c()((function(){}));var p=h,f=n("2877"),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},cfa6:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{position:"relative"}}
1,[n("div",{staticClass:"text-right mt-2 mb-2"},[n("data-download",{attrs:{data:t.tableData,filename:"gene_associations"}})],1),t._m(0),t.pageKey&&t.rows>0?n("b-table",{attrs:{hover:"",small:"",responsive:"",items:t.tableDataWithDetails,fields:"phenotype"!==t.leadTableField?t.fields.filter((function(t){return"group"!==t.key})):t.fields,"per-page":t.perPage,"current-page":t.currentPage,"detail-key":"_rowKey","show-empty":""},scopedSlots:t._u([{key:"cell(phenotype)",fn:function(e){return[n("a",{staticClass:"phenotype-gene-association",attrs:{href:"javascript:;"}},[t._v(" "+t._s(t.phenotypeFormatter(t.phenotypeMap[e.item.phenotype]))+" "),n("div",{staticClass:"options-4-actions"},[n("div",[t.phenotypeMap?n("a",{attrs:{href:"/phenotype.html?phenotype="+e.item.phenotype}},[t._v("Open phenotype page")]):t._e()]),n("div",[t.phenotypeMap?n("a",{attrs:{href:"/region.html?phenotype="+e.item.phenotype+"&chr="+e.item.chromosome+"&start="+e.item.start+"&end="+e.item.end}},[t._v("Open region page with selected phenotype")]):t._e()])])]),t._v(" Â ")]}},{key:"cell(gene)",fn:function(e){return[n("a",{attrs:{href:"/gene.html?gene="+e.item.gene}},[t._v(" "+t._s(e.item.gene)+" ")])]}},{key:"cell(link)",fn:function(e){return[n("a",{staticClass:"btn view-features-btn btn-secondary",staticStyle:{color:"#ffffff !important"},attrs:{href:"/hugecalculator.html?gene="+e.item.gene+"&phenotype="+e.item.phenotype+"&prior=0.3696"}},[t._v("Open")])]}},{key:"cell(cfde_gene_set)",fn:function(e){return[n("button",{staticClass:"btn view-features-btn btn-secondary",on:{click:function(n){return t.toggleGeneSetDetails(e.item)}}},[t._v(" View Gene Sets ")])]}},{key:"row-details",fn:function(e){return[n("div",{staticClass:"p-3",staticStyle:{"background-color":"#eeeeee","border-left":"5px solid #cccccc"}},[t.getGeneSetSubtableLoading(e.item)?n("div",{staticClass:"text-muted"},[t._v(" Loading gene sets... ")]):t.getGeneSetSubtableError(e.item)?n("div",{staticClass:"text-danger"},[t._v(" "+t._s(t.getGeneSetSubtableError(e.item))+" ")]):[n("div",{staticClass:"kc-logo-container",staticStyle:{position:"relative",height:"70px","margin-top":"-20px"}},[n("kc-cfde-logo")],1),n("b-table",{attrs:{small:"",responsive:"",items:t.getGeneSetSubtableData(e.item),fields:t.geneSetSubtableFields,"per-page":t.geneSetSubtablePerPage,"current-page":t.getGeneSetSubtablePage(e.item),"show-empty":"","empty-text":"No gene set data."},scopedSlots:t._u([{key:t.geneSetCellSlot,fn:function(e){return[n("a",{attrs:{href:"https://cfdeknowledge.org/r/kc_gsb?geneSet="+encodeURIComponent(e.value||""),title:e.value}},[t._v(t._s(t.formatGeneSetCell(e.value)))])]}},{key:"cell(Source)",fn:function(e){return[n("a",{attrs:{href:"https://cfdeknowledge.org/r/kc_gsb?source="+encodeURIComponent(e.value||"")}},[t._v(t._s(e.value))])]}}],null,!0)}),t.getGeneSetSubtableData(e.item).length>t.geneSetSubtablePerPage?n("b-pagination",{staticClass:"pagination-sm justify-content-center mt-2",attrs:{value:t.getGeneSetSubtablePage(e.item),"total-rows":t.getGeneSetSubtableData(e.item).length,"per-page":t.geneSetSubtablePerPage},on:{input:function(n){return t.setGeneSetSubtablePage(e.item,n)}}}):t._e()]],2)]}}],null,!1,3262428783)}):n("div",[n("b-alert",{staticClass:"text-center",attrs:{show:"",variant:"warning"}},[n("b-icon",{attrs:{icon:"exclamation-triangle"}}),t._v(" No data available for this query. ")],1)],1),n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.rows,"per-page":t.perPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1)},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticStyle:{"font-size":"12px","white-space":"nowrap",position:"absolute",top:"15px"}},[n("span",{staticClass:"compelling"},[t._v("Compelling")]),t._v(" HuGE Score >= 350 | "),n("span",{staticClass:"extreme"},[t._v("Extreme")]),t._v(" >=100 | "),n("span",{staticClass:"very-strong"},[t._v("Very Strong")]),t._v(": >=30 | "),n("span",{staticClass:"strong"},[t._v("Strong")]),t._v(": >=10 | "),n("span",{staticClass:"moderate"},[t._v("Moderate")]),t._v(": >=3 |"),n("span",{staticClass:"anecdotal"},[t._v(" Anecdotal")]),t._v(": >1 | "),n("span",{staticClass:"no-evidence"},[t._v("No Evidence")]),t._v(": <=1")])}],i=n("53ca"),o=n("1da1"),s=n("b85c"),l=n("5530"),c=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("4de4"),n("7db0"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("b0c0"),n("a9e3"),n("0c47"),n("23dc"),n("9129"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("2532"),n("3ca3"),n("5319"),n("0643"),n("2382"),n("fffc"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),u=n("5f5b"),d=n("b1e0"),h=n("529c"),p=(n("f9e3"),n("2dd8"),n("f529"));n("57d2");function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}c["default"].use(u["a"]),c["default"].use(d["b"]);var _={"data convert":[{type:"raw","field name":"Phenotype","raw field":"phenotype"},{type:"raw","field name":"Gene set","raw field":"gene_set"},{type:"raw","field name":"Description","raw field":"gene_set_description"},{type:"raw","field name":"Model","raw field":"gene_set_size"},{type:"raw","field name":"Joint effect","raw field":"beta","if no value":"0"},{type:"translate to categories","field name":"Evidence range (Joint effect)","raw field":"Joint effect",categories:[{name:"Not Significant",condition:"less than",range:.01},{name:"Significant",condition:"and",range:[.01,.1]},{name:"Strongly Significant",condition:"and",range:[.1,1]},{name:"Extremely Significant",condition:"greater than",range:1}]},{type:"raw","field name":"Marginal effect","raw field":"beta_uncorrected","if no value":"0"},{type:"translate to categories","field name":"Evidence range (Marginal effect)","raw field":"Marginal effect",categories:[{name:"Not Significant",condition:"less than",range:.01},{name:"Significant",condition:"and",range:[.01,.1]},{name:"Strongly Significant",condition:"and",range:[.1,1]},{name:"Extremely Significant",condition:"greater than",range:1}]},{type:"raw","field name":"Number of genes in gene set","raw field":"n"},{type:"raw","field name":"Source","raw field":"source"},{type:"join multi","field name":"Genes in gene set","fields to join":["phenotype","gene_set"],"join by":[","]},{type:"join multi","field name":"Hypothesis","fields to join":["phenotype","gene_set"],"join by":[","]},{type:"join multi","field name":"BYOGL","fields to join":["phenotype","gene_set"],"join by":[","]}],"top rows":["Gene set","Description","Joint effect","Evidence range (Joint effect)","Marginal effect","Evidence range (Marginal effect)","Number of genes in gene set","Source"]};function g(t,e){var n=e.range,r=e.condition;return"less than"===r?t<n:"greater than"===r?t>n:!("and"!==r||!Array.isArray(n))&&(t>=n[0]&&t<=n[1])}function m(t,e){var n=Number(t);if(Number.isNaN(n))return"";var r=e.find((function(t){return g(n,t)}));return r?r.name:""}var v=["gene_set_list_mouse","gene_set_list_msigdb"];function y(t){var e=String(t||"");return v.some((function(t){return e.includes(t)}))}function b(t,e,n){for(var r="",a=t.length,i=0;i<a;i++)r+=null!=n[t[i]]?String(n[t[i]]):"",i<a-1&&null!=e[i]&&(r+=e[i]);return r}var x=c["default"].component("HugeScoresTable",{components:{DataDownload:p["a"]},props:["leadTableField","pageKey","hugeScores","phenotypeMap","filter"],data:function(){return{perPage:10,currentPage:1,geneSetsApi:"https://cfde-dev.hugeampkpnbi.org/api/bio/query/pigean-gene-set-phenotype?q=$phenotype,cfde&limit=10000",expandedRowKey:null,geneSetDataByRow:{},geneSetSubtablePerPage:10,geneSetSubtablePageByRow:{},fields:[{key:"".concat(this.$props.leadTableField),label:"".concat(this.capitalizedFormatter(this.$props.leadTableField))},{key:"group",label:"Group"},{key:"bf_common",label:"Common Variation Bayes Factor",formatter:h["a"].floatFormatter},{key:"bf_rare",label:"Rare Variation Bayes Factor",formatter:h["a"].floatFormatter},{key:"huge",label:"HuGE Score",formatter:h["a"].floatFormatter,tdClass:function(t){return t?t>=350?"compelling":t>=100?"extreme":t>=30?"very-strong":t>=10?"strong":t>=3?"moderate":t>1?"anecdotal":"no-evidence":""}},{key:"range",label:"Evidence Range"},{key:"link",label:"HuGE Calculator"},{key:"cfde_gene_set",label:"CFDE Gene Sets"}]}},computed:{rows:function(){return this.tableData.length},tableDataWithDetails:function(){var t=this,e=this.expandedRowKey;return(this.tableData||[]).map((function(n){return Object(l["a"])(Object(l["a"])({},n),{}
1,{_rowKey:t.getRowKey(n),_showDetails:null!==e&&e===t.getRowKey(n)})}))},geneSetCellSlot:function(){return"cell(Gene set)"},geneSetSubtableFields:function(){var t=_["top rows"]||[];return t.map((function(t){return{key:t,label:t}}))},tableData:function(){var t=this,e=this.hugeScores,n=this.phenotypeMap;return n?(e.forEach((function(e){e.range||(e.range=t.getRange(e.huge))})),e=e.filter((function(t){return n[t.phenotype]})),this.filter?e.filter(this.filter):e):[]}},watch:{tableData:function(t){this.$store.dispatch("commonVariantsLength",t.length)}},methods:{phenotypeFormatter:h["a"].phenotypeFormatter,floatFormatter:h["a"].floatFormatter,capitalizedFormatter:h["a"].capitalizedFormatter,getRange:function(t){return t?t>=350?"Compelling":t>=100?"Extreme":t>=30?"Very strong":t>=10?"Strong":t>=3?"Moderate":t>1?"Anecdotal":"No evidence":""},getRowKey:function(t){return"".concat(t.phenotype||"","|").concat(t.gene||"")},applyGeneSetDataConvert:function(t){var e,n=_["data convert"],r=[],a=Object(s["a"])(t);try{for(a.s();!(e=a.n()).done;){var i,o=e.value,l={},c=Object(s["a"])(n);try{for(c.s();!(i=c.n()).done;){var u=i.value,d=u["field name"];if("raw"===u.type){var h=o[u["raw field"]];void 0!==h&&null!==h||(h=void 0!==u["if no value"]?u["if no value"]:""),0===h&&(h="0"),l[d]=h}else if("translate to categories"===u.type){var p,f=void 0!==l[u["raw field"]]?l[u["raw field"]]:null!==(p=o[u["raw field"]])&&void 0!==p?p:0;l[d]=m(f,u.categories)}else"join multi"===u.type&&(l[d]=b(u["fields to join"],u["join by"],o))}}catch(g){c.e(g)}finally{c.f()}r.push(l)}}catch(g){a.e(g)}finally{a.f()}return r},getGeneSetSubtableData:function(t){var e=this.getRowKey(t),n=this.geneSetDataByRow[e],r=n&&n.data?n.data:[];return r.filter((function(t){return!y(t.Source)}))},getGeneSetSubtablePage:function(t){var e=this.getRowKey(t);return this.geneSetSubtablePageByRow[e]||1},setGeneSetSubtablePage:function(t,e){var n=this.getRowKey(t);this.$set(this.geneSetSubtablePageByRow,n,e)},formatGeneSetCell:function(t){if(null==t)return"";var e=String(t);return e.length>25?e.slice(0,25)+"â¦":e},getGeneSetSubtableLoading:function(t){var e=this.getRowKey(t),n=this.geneSetDataByRow[e];return!!n&&n.loading},getGeneSetSubtableError:function(t){var e=this.getRowKey(t),n=this.geneSetDataByRow[e];return n&&n.error?n.error:null},toggleGeneSetDetails:function(t){var e=this.getRowKey(t);if(this.expandedRowKey!==e){this.expandedRowKey=e;var n=this.geneSetDataByRow[e];n&&(n.loading||n.data&&n.data.length)||this.fetchGeneSetForRow(t)}else this.expandedRowKey=null},fetchGeneSetForRow:function(t){var e=this;return Object(o["a"])(f().mark((function n(){var r,a,i,o,s,l,c;return f().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(r=e.getRowKey(t),a=t.phenotype,a){n.next=4;break}return n.abrupt("return");case 4:return e.$set(e.geneSetDataByRow,r,{loading:!0,data:[],error:null}),i=e.geneSetsApi.replace("$phenotype",encodeURIComponent(a)),n.prev=6,n.next=9,fetch(i);case 9:if(o=n.sent,o.ok){n.next=12;break}throw new Error("HTTP ".concat(o.status,": ").concat(o.statusText));case 12:return n.next=14,o.json();case 14:s=n.sent,l=s.data||s||[],c=e.applyGeneSetDataConvert(l),e.$set(e.geneSetDataByRow,r,{loading:!1,data:c,error:null}),n.next=23;break;case 20:n.prev=20,n.t0=n["catch"](6),e.$set(e.geneSetDataByRow,r,{loading:!1,data:[],error:n.t0.message||"Failed to load gene sets."});case 23:case"end":return n.stop()}}),n,null,[[6,20]])})))()}}}),w=x,C=(n("ad1d"),n("2877")),P=Object(C["a"])(w,r,a,!1,null,null,null);e["a"]=P.exports},d06c:function(t,e,n){},d083:function(t,e,n){"use strict";n("b9f0")},d14c:function(t,e,n){},d1be:function(t,e,n){},d1ca:function(t,e,n){"use strict";n("155a")},d3f6:function(t,e,n){},d602:function(t,e,n){"use strict";n("821b")},d8ef:function(t,e,n){"use strict";n("99af");var r=1;e["a"]={getUniqueId:function(t){var e="".concat(t||"","_").concat(Date.now(),"_").concat(r);return r+=1,e}}},d959:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[null!=this.apiParameters?n("div",{staticClass:"filtering-ui-wrapper search-criteria",attrs:{id:"searchCriteria"}},[n("h4",{staticClass:"card-title"},[t._v("Build search criteria test")]),n("div",{staticClass:"filtering-ui-content row"},[t._l(this.apiParameters.parameters,(function(e){return n("div",{key:e.parameter,staticClass:"col"},[n("div",{staticClass:"label"},[n("span",{domProps:{innerHTML:t._s(e.label)}})]),"list"==e.type&&e.values.length<=10?["list"==e.type?n("select",{staticClass:"custom-select custom-select-search",attrs:{id:"search_param_"+e.parameter}},[t._l(e.values,(function(r){return[n("option",{key:r.trim(),domProps:{value:r.trim(),innerHTML:t._s(t.getFileLabel(r.trim(),e.parameter))}})]}))],2):t._e()]:t._e(),"list"==e.type&&e.values.length>10?[n("input",{directives:[{name:"model",rawName:"v-model",value:t.paramSearch,expression:"paramSearch"}],staticClass:"form-control",domProps:{value:t.paramSearch},on:{input:function(e){e.target.composing||(t.paramSearch=e.target.value)}}}),"list"==e.type?n("select",{class:"custom-select custom-select-search long-list "+t.getVisibleValues(e.values,t.paramSearch,e.parameter),style:e.values.length>10&&t.paramSearch.length<=2?"display:none !important;":"",attrs:{id:"search_param_"+e.parameter,size:e.values.length>10?t.paramSearch.length>2?5:1:"auto"},on:{change:function(n){return t.updateSearchInputByEvent(n,e.parameter)}}},t._l(e.values,(function(r){return n("option",{key:r.trim(),class:e.values.length>10&&t.paramSearch.length>2&&!t.getFileLabel(r.trim(),e.parameter).toLowerCase().includes(t.paramSearch.toLowerCase())?"hidden":"",domProps:{value:r.trim(),innerHTML:t._s(t.getFileLabel(r.trim(),e.parameter))}})}
1)),0):t._e()]:t._e(),n("div",["input"==e.type&&"kp genes"==e.values?n("div",{style:e["expand region"]?"display: inline-block;":"",attrs:{id:"kp_gene_search_wrapper"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.geneSearch,expression:"geneSearch"}],staticClass:"form-control",attrs:{id:"search_param_"+e.parameter},domProps:{value:t.geneSearch},on:{keyup:function(e){return t.getGenes(e)},input:function(e){e.target.composing||(t.geneSearch=e.target.value)}}}),n("div",{staticClass:"custom-select custom-select-search",style:0==t.kpGenes.length?"display:none !important;":"",attrs:{size:t.kpGenes.length>=5?5:"auto"}},[t._l(t.kpGenes,(function(r){return[n("a",{key:r,staticClass:"custom-select-a-option",attrs:{href:"javascript:;"},domProps:{innerHTML:t._s(r)},on:{click:function(n){e["convert to region"]&&"true"==e["convert to region"]?t.getRegion(r,e.parameter,e["expand region by"]):t.setGene(r)}}})]}))],2)]):t._e(),"input"==e.type&&"kp variant"==e.values?n("div",[n("input",{directives:[{name:"model",rawName:"v-model",value:t.variantSearch,expression:"variantSearch"}],staticClass:"form-control",attrs:{id:"search_param_"+e.parameter},domProps:{value:t.variantSearch},on:{input:function(e){e.target.composing||(t.variantSearch=e.target.value)}}})]):t._e(),e["expand region"]&&"kp variant"!=e.values?n("div",{staticClass:"expand-region"},[n("select",{staticClass:"expand-region-select-byor",attrs:{id:"region_expander"},on:{change:function(n){return t.expandRegion(n,e)}}},[n("option",{attrs:{selected:"selected",value:"null"}}
1,[t._v(" Expand region by: ")]),n("option",{attrs:{value:"50000"}},[t._v("± 50 kb")]),n("option",{attrs:{value:"100000"}},[t._v("± 100 kb")]),n("option",{attrs:{value:"150000"}},[t._v("± 150 kb")])]),n("span",{staticClass:"tip-wrapper"},[n("b-icon",{staticClass:"tip-bigger warning",attrs:{icon:"exclamation-circle-fill"}}),n("div",{staticClass:"tip-content"},[t._v(" This feature is in test! Expanding region will refresh the page as a new search with the last search parameters and the expanded region. All filters and previously loaded data will be removed. ")])],1)]):t._e()]),"input"==e.type&&"kp genes"!=e.values&&"kp variant"!=e.values?n("input",{staticClass:"form-control",attrs:{type:"text",id:"search_param_"+e.parameter}}):t._e(),"string to array"==e.type?n("textarea",{staticClass:"form-control",attrs:{rows:"4",cols:"50",id:"search_param_"+e.parameter}}):t._e()],2)})),this.dataset&&null!=t.dataComparisonConfig?n("div",{staticClass:"col"},[n("div",{staticClass:"label",domProps:{innerHTML:t._s("Compare data")}}),t._m(0)]):t._e(),n("div",{staticClass:"col"},[n("div",{staticClass:"btn btn-sm btn-primary",on:{click:function(e){return t.queryAPI()}}},[t._v(" Search ")])])],2)]):t._e(),this.dataFiles&&this.dataFiles.length>1?n("div",{staticClass:"filtering-ui-wrapper search-criteria",attrs:{id:"searchCriteria"}},[n("h4",{staticClass:"card-title"},[t._v("Select data")]),n("div",{staticClass:"filtering-ui-content row"},[n("div",{staticClass:"col"},[n("select",{staticClass:"custom-select",attrs:{id:"dataFiles"},on:{change:function(e){return t.switchData(e)}}},t._l(this.dataFiles,(function(e){return n("option",{key:e.trim(),domProps:{value:e.trim(),innerHTML:t._s(t.getFileLabel(e.trim()))}})})),0)])])]):t._e(),this.dataset&&this.filters&&this.filters.length>0||this.dataFiles&&this.dataFiles.length>1?n("div",{staticClass:"filtering-ui-wrapper"},[n("h4",{staticClass:"card-title filter"},[t._v("Filter data")]),n("div",{staticClass:"filtering-ui-content row"},t._l(this.filters,(function(e){return n("div",{key:e.field,class:t.getFilterWidthClasses()},[n("div",{staticClass:"label",domProps:{innerHTML:t._s(e.label)}}),"search"==e.type?[e.features&&e.features.includes("autocomplete")?n("input",{staticClass:"form-control",attrs:{type:"text",id:"filter_"+t.getColumnId(e.field)},on:{input:function(n){return t.buildSuggestions(n,e.field)}}}):t._e(),!e.features||e.features&&!e.features.includes("autocomplete")?n("input",{staticClass:"form-control",attrs:{type:"text",id:"filter_"+t.getColumnId(e.field)},on:{change:function(n){return t.filterData(n,e.field,e.type)}}}):t._e(),e.features&&e.features.includes("autocomplete")?n("div",{staticClass:"autocomplete-options"},[n("ul",[t._l(t.suggestions.suggestions,(function(r){return t.suggestions.field==e.field&&t.suggestions.suggestions.length>0?[n("li",{attrs:{title:r},domProps:{innerHTML:t._s(r)},on:{click:function(n){return t.filterData(n,e.field,e.type,"",r)}}})]:t._e()}))],2)]):t._e()]:t._e(),"search exact"==e.type||"search greater than"==e.type||"search lower than"==e.type||"search or"==e.type||"search and"==e.type?[n("input",{staticClass:"form-control",attrs:{type:"text",id:"filter_"+t.getColumnId(e.field)},on:{change:function(n){return t.filterData(n,e.field,e.type)}}})]:t._e(),"search change direction"==e.type?[n("select",{staticClass:"egl-filter-direction",attrs:{id:"filter_"+t.getColumnId(e.field)+"_direction"}},[n("option",{attrs:{value:"lt",selected:"selected"}},[t._v(" <= ")]),n("option",{attrs:{value:"gt"}},[t._v(">=")])]),n("input",{staticClass:"form-control egl-filter-cd-input",attrs:{type:"text",id:"filter_"+t.getColumnId(e.field)},on:{change:function(n){return t.filterData(n,e.field,e.type)}}})]:"dropdown"==e.type?[n("select",{staticClass:"custom-select",attrs:{id:"filter_"+t.getColumnId(e.field)},on:{change:function(n){return t.filterData(n,e.field,e.type,e.dataType)}}},[n("option"),t._l(t.buildOptions(e.field),(function(e){return n("option",{key:e,domProps:{value:e}},[t._v(" "+t._s(e)+" ")])}))],2)]:t._e()],2)})),0)]):t._e(),null!=this.dataset?n("b-container",{staticClass:"search-fields-wrapper"},[t._l(this.filtersIndex,(function(e,r,a){return n("div",{key:r,class:"search-field f-"+a},t._l(e.search.filter((function(t,e,n){return n.indexOf(t)==e})),(function(r,a){return e.search.length>0?n("b-badge",{key:r,class:"btn search-bubble "+a,attrs:{pill:""},domProps:{innerHTML:t._s(1==e["label in bubble"]?e.field+": "+r+" <span class='remove'>X</span>":r+" <span class='remove'>X</span>")},on:{click:function(n){return t.removeFilter(e.field,a)}}}):t._e()})),1)})),this.numberOfSearches()>1?n("b-badge",{staticClass:"badge badge-secondary badge-pill btn search-bubble clear-all-filters-bubble",on:{click:function(e){return t.removeAllFilters()}}},[t._v(" Clear all search ")]):t._e()],2):t._e()],1)},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("select",{staticClass:"custom-select",attrs:{id:"ifMergeData"}},[n("option",{attrs:{value:"newSearch",selected:""}},[t._v("New search")]),n("option",{attrs:{value:"overlapping"}},[t._v("Only overlapping")]),n("option",{attrs:{value:"all"}},[t._v("All")])])}],i=n("53ca"),o=n("3835"),s=n("1da1"),l=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("a434"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("4fad"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("00b4"),n("25f0"),n("2532"),n("3ca3"),n("5319"),n("841c"),n("498a"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b3d"),n("bf19"),n("9861"),n("88a7"),n("271a"),n("5494"),n("2b0e"));function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 6,615 bytes, line 1
1function E(t,e){function n(a,o,s,l){var c=p(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var u=l["default"].component("research-page-filters",{props:["apiParameters","dataComparisonConfig","dataFiles","dataType","isAPI","filesListLabels","uid","filters","filterWidth","dataset","unfilteredDataset","utils"],data:function(){return{filtersIndex:{},searchParamsIndex:{},paramSearch:"",geneSearch:"",variantSearch:"",kpGenes:[],lastFilter:{field:null,value:null},suggestions:{field:null,suggestions:[]},searchBySuggest:!1}},created:function(){var t=this,e=this.filters;void 0!=e&&e.map((function(e){var n={};n["type"]=e.type,n["field"]=e.field,n["search"]=[],n["label in bubble"]=!(!e["label in bubble"]||"true"!=e["label in bubble"]),t.filtersIndex[e.field]=n}));var n=this.apiParameters;if(null!=n&&n.parameters.map((function(e){var n={};n["type"]=e.type,n["field"]=e.parameter,n["search"]=[],t.searchParamsIndex[e.parameter]=n})),this.dataFiles&&this.dataFiles.length>1){var r={type:"list",field:"dataFiles",search:[]};this.searchParamsIndex["dataFiles"]=r}this.$store.dispatch("searchParameters",this.searchParamsIndex)},mounted:function(){var t=this;if(null!=this.apiParameters&&"array"==this.apiParameters.query.type){var e=this.apiParameters.query.format,n={};
1e.map((function(e,r){if(void 0!=t.utils.keyParams[e]){var a=t.apiParameters.parameters.filter((function(t){return t.parameter==e}))[0].type,i=!!t.apiParameters.rawConfig.parameters.filter((function(t){return t.parameter==e}))[0].values,o=i?t.apiParameters.rawConfig.parameters.filter((function(t){return t.parameter==e}))[0].values.includes("kp"):null;if("list"!=a&&o)t.geneSearch=t.utils.keyParams[e];else if("list"==a&&o){var s;s=t.filesListLabels[t.utils.keyParams[e].trim()]?t.filesListLabels[t.utils.keyParams[e].trim()]:t.filesListLabels[e][t.utils.keyParams[e].trim()]?t.filesListLabels[e][t.utils.keyParams[e].trim()]:t.utils.keyParams[e].trim();var l=s+"("+t.utils.keyParams[e]+")";t.paramSearch=l,document.getElementById("search_param_"+e).value=t.utils.keyParams[e]}else document.getElementById("search_param_"+e).value=t.utils.keyParams[e];t.searchParamsIndex[e].search.push(t.utils.keyParams[e]),t.$store.dispatch("searchParameters",t.searchParamsIndex),n[e]=t.utils.keyParams[e]}})),Object.keys(n).length>0&&this.$store.dispatch("searchParametersArr",{data:n,action:"add"})}},computed:{isRegionExpanded:function(){var t=null;return this.apiParameters.parameters.forEach((function(e){"region"===e.parameter&&e["expand region by"]&&(t=e["expand region by"])})),t}},watch:{},methods:{buildSuggestions:function(t,e){var n=t.target.value,r=[];if(n.length>=2){var a=n.split(" "),i=null!=this.dataComparisonConfig?this.dataComparisonConfig["fields to compare"]:null,o=this.unfilteredDataset;if(null==i)o.map((function(t){var n=0;t[e]&&(a.map((function(r){n+=t[e].toLowerCase().includes(r.toLowerCase())?1:0})),n!=a.length||r.includes(t[e])||r.push(t[e]))}));else{var s=function(){var t=o[l];if(t[e]&&void 0!=t[e]){var n=function(n){if(t[e]&&t[e][n]){var i=0;a.map((function(r){i+=t[e][n].toLowerCase().includes(r.toLowerCase())?1:0})),i!=a.length||r.includes(t[e][n])||r.push(t[e][n])}};for(var i in t[e])n(i)}};for(var l in o)s()}}r.length>0?(this.suggestions.field=e,this.suggestions.suggestions=r.sort()):(this.suggestions.field=null,this.suggestions.suggestions=[])},getColumnId:function(t){return t.replace(/\W/g,"").toLowerCase()},resetAll:function(){this.$store.state.pkgData={},this.$store.state.pkgDataSelected=[]},expandRegion:function(t,e){var n=t.target.value;if("null"!=t.target.value){var r=document.getElementById("search_param_"+e.parameter).value.split(":"),a=r[0],i=r[1].split("-"),o=Number(i[0])-Number(n)<=0?0:Number(i[0])-Number(n),s=Number(i[1])+Number(n),l=a+":"+o+"-"+s,c=new URL(window.location);c.searchParams.set(e.parameter,l),window.history.pushState(null,"",c.toString());var u=new URL(window.location);window.location.href=u}},showHideElement:function(t){this.utils.uiUtils.showHideElement(t)},getVisibleValues:function(t,e,n){var r=this,a=0;return t.map((function(t){r.getFileLabel(t.trim(),n).toLowerCase().includes(e.toLowerCase())&&a++})),a=0==a?"hidden":"",a},setGene:function(t){this.geneSearch=t,this.kpGenes=[]},getRegion:function(t,e,n){var r=this;return Object(s["a"])(c().mark((function e(){var a,i,o,s;return c().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=r.utils.uiUtils.biDomain()+"/api/bio/query/gene?q="+t,i=n?n/2:0,e.next=4,fetch(a).then((function(t){return t.json()}));case 4:o=e.sent,null==o.error&&(s=o.data[0].chromosome+":"+(Number(o.data[0].start)-i)+"-"+(Number(o.data[0].end)+i),r.geneSearch=s,r.kpGenes=[]);case 6:case"end":return e.stop()}}),e)})))()},getGenes:function(t){var e=this;return Object(s["a"])(c().mark((function n(){var r,a;return c().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(!(t.target.value.length>2)){n.next=6;break}return r=e.utils.uiUtils.biDomain()+"/api/bio/match/gene?q="+t.target.value,n.next=4,fetch(r).then((function(t){return t.json()}));case 4:a=n.sent,null==a.error&&(e.kpGenes=a.data);case 6:case"end":return n.stop()}}),n)})))()},emptySearchInput:function(t){},showHideSearch:function(){var t=document.getElementById("searchCriteria"),e=document.getElementById("openCloseSearch");t.classList.contains("closed")?(t.classList.remove("closed"),e.innerText="Close search"):(t.classList.add("closed"),e.innerText="Open search")},getLength:function(t){return Number(t.length)}
1,getFilterWidthClasses:function(){var t=this.filterWidth&&null!=this.filterWidth?"col filter-col-"+this.filterWidth:"col";return t},getFileLabel:function(t,e){return this.filesListLabels[e]&&this.filesListLabels[e][t]?this.filesListLabels[e][t]:this.filesListLabels[t]?this.filesListLabels[t]:t},setDataComparison:function(){var t=document.getElementById("ifMergeData")?document.getElementById("ifMergeData").value:"newSearch";this.$store.dispatch("dataComparison",t)},queryAPI:function(){var t=this;for(var e in this.utils.uiUtils.showElement("data-loading-indicator"),this.filtersIndex)this.filtersIndex[e].search=[];this.$store.state.initialSearch=0,this.$store.state.bioIndexContinue=[],this.$store.dispatch("hugeampkpncms/cancelResearchData"),this.setDataComparison();var n=null;if("bioindex"==this.dataType){if(1==this.apiParameters.query.format.includes("phenotype")){var r=document.getElementById("search_param_phenotype").value;this.$store.dispatch("searchingPhenotype",r)}if(1==this.apiParameters.query.format.includes("region")&&this.testLetters(document.getElementById("search_param_region").value)){var a=document.getElementById("search_param_region").value.split(":"),i=a[0],s=a[1].replace(/\D/g,""),l=this.isRegionExpanded?this.isRegionExpanded/2:1,c=Number(s)-l,u=Number(s)+l,d=i+":"+c+"-"+u;n=d,document.getElementById("search_param_region").value=d}}var h={},p="";if("array"==this.apiParameters.query.type){var f=this.apiParameters.query.format,_={};if(f.map((function(e,n){var r=document.getElementById("search_param_"+e).value;if("noValue"!=r)p+=r,n+1<f.length&&(p+=",");else if(","==p[p.length-1]){var a=p.slice(0,-1);p=a}if("newSearch"==t.$store.state.dataComparison){t.resetAll(),t.searchParamsIndex[e].search=[];var i=document.getElementById("search_param_"+e).value;t.searchParamsIndex[e].search.push(i),_[e]=i,!!t.$store.state.pkgDataSelected.length>0&&(t.$store.state.pkgDataSelected=[],t.$store.state.pkgData={})}else t.searchParamsIndex[e].search.push(document.getElementById("search_param_"+e).value);h[e]=document.getElementById("search_param_"+e).value,t.$store.dispatch("searchParameters",t.searchParamsIndex)})),Object.keys(_).length>0){for(var g=new URL(window.location),m=0,v=Object.entries(_);m<v.length;m++){var y=Object(o["a"])(v[m],2),b=y[0],x=y[1];g.searchParams.set(b,x)}window.history.pushState(null,"",g.toString())}}else if("parameters"==this.apiParameters.query.type){p+="?";var w=this.apiParameters.parameters;w.map((function(t){var e=document.getElementById("search_param_"+t.parameter).value;p+=t.parameter+"="+e+"&"}))}if(Object.keys(h).length>0&&("newSearch"==this.$store.state.dataComparison?this.$store.dispatch("searchParametersArr",{data:h,action:"reset"}):this.$store.dispatch("searchParametersArr",{data:h,action:"add"})),n){var C=new URL(window.location);window.location.href=C}var P=this.dataFiles[0];"bioindex"==this.dataType&&this.isAPI?P+="query/"+this.apiParameters.query.index+"?q="+p:"bioindex"!=this.dataType&&this.isAPI&&(P+=p);var k={dataPoint:P,domain:"external"};this.$store.dispatch("hugeampkpncms/getResearchData",k)},testLetters:function(t){return/[a-zA-Z]/.test(t)},updateSearchInputByEvent:function(t,e){var n=this.getFileLabel(t.target.value.trim(),e);this.paramSearch=n+"("+t.target.value+")"},updateSearchInput:function(t){var e=this.getFileLabel(t.trim());this.paramSearch=e+"("+t+")"},switchData:function(t){for(var e in this.utils.uiUtils.showElement("data-loading-indicator"),this.filtersIndex)this.filtersIndex[e].search=[];var n=t.target.value,r=n.includes("http://")||n.includes("https://")?n:"https://hugeampkpncms.org/sites/default/files/users/user"+this.uid+"/"+n,a=n.includes("http://")||n.includes("https://")?"external":"hugeampkpn",i={dataPoint:r,domain:a};this.$store.dispatch("hugeampkpncms/getResearchData",i)},numberOfSearches:function(){var t=0;for(var e in this.filtersIndex)t+=this.filtersIndex[e].search.length;return t},numberOfSearchParams:function(){},buildOptions:function(t){if(null==this.dataComparisonConfig){var e=this.dataset.map((function(e){return e[t]})).filter((function(t,e,n){return n.indexOf(t)==e})).filter((function(t,e,n){return""!=t}));return e.sort()}for(var n=[],r=0,a=Object.entries(this.dataset);r<a.length;r++){var s=Object(o["a"])(a[r],2),l=(s[0],s[1]);if("object"!==Object(i["a"])(l[t])||null===l[t]||Array.isArray(l[t]))n.push(l[t]);else for(var c=0,u=Object.entries(l[t]);c<u.length;c++){var d=Object(o["a"])(u[c],2),h=(d[0],d[1]);n.push(h)}}var p=n.filter((function(t,e,n){return n.indexOf(t)==e})).filter((function(t,e,n){return""!=t}));return p.sort()},filterData:function(t,e,n,r,a){var i=this,o=a||document.getElementById("filter_"+this.getColumnId(e)).value,s="#filter_"+this.getColumnId(e),l=document.querySelector(s);if(l.blur(),l.value="",o&&""!=o){if(this.lastFilter={field:e,value:o},"search"==n||"search exact"==n){var c=o.split(",");c.map((function(t){i.filtersIndex[e]["search"].push(t.trim()),i.filtersIndex[e]["search"]=i.filtersIndex[e]["search"].filter((function(t,e,n){return n.indexOf(t)==e}))})),a&&(this.suggestions={field:null,suggestions:[]})}else"search greater than"==n||"search lower than"==n||"search or"==n||"search and"==n?this.filtersIndex[e]["search"]=[o]:"number"==r?this.filtersIndex[e]["search"].push(Number(o)):this.filtersIndex[e]["search"].push(o);this.applyFilters()}},applyFilters:function(){var t=this,e=null!=this.dataComparisonConfig?this.dataComparisonConfig["fields to compare"]:null,n=this.unfilteredDataset,r=null==e?[]:{},a=function(){var a=t.filtersIndex[o];a.search.length>0&&(a.search.filter((function(t,e,n){return n.indexOf(t)==e})).map((function(o){var s,l=n,c=o;if(null==e)l.filter((function(e){var n,o,l,u;if(e[a.field]&&void 0!=e[a.field])switch(n=Object(i["a"])(e[a.field]),o=t.utils.uiUtils.checkIfNumeric(e[a.field]),"search greater than"==a.type||"search lower than"==a.type||"search or"==a.type||"search and"==a.type?l="string"==n&&o?Number(e[a.field]):"number"==n?e[a.field]:"wrong value":(c="number"==typeof c?c.toString():c,u="number"==n&&o?e[a.field].toString():"string"==n?e[a.field]:"wrong value"),a.type){case"dropdown":c===u&&r.push(e);break;case"search":u.toLowerCase().includes(c.toLowerCase())&&r.push(e);break;case"search exact":c.toLowerCase()===u.toString().toLowerCase()&&r.push(e);break;case"dropdown word":u.toLowerCase().includes(c.toLowerCase())&&r.push(e);break;case"search greater than":"wrong value"!=l&&l>=c&&r.push(e);break;case"search lower than":"wrong value"!=l&&l<=c&&r.push(e);break;case"search or":s=c.split(","),"wrong value"!=l&&(l<=Number(s[0].trim())||l>=Number(s[1].trim()))&&r.push(e);break;case"search change direction":var d=document.getElementById("filter_"+t.getColumnId(a.field)+"_direction").value;
1"lt"==d?e[a.field]<=c&&r.push(e):"gt"==d&&(e[a.field]>=c&&r.push(e));break;case"search and":s=c.split(","),"wrong value"!=l&&l>=Number(s[0].trim())&&l<=Number(s[1].trim())&&r.push(e);break}}));else for(var u in l){var d=l[u];if(d[a.field]&&void 0!=d[a.field])if("dropdown"==a.type||"search exact"==a.type)if(1==e.includes(a.field)){var h=!1;for(var p in d[a.field])c.toLowerCase()===d[a.field][p].toString().toLowerCase()&&(h=!0);1==h&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else c===d[a.field].toString()&&(r[d[t.dataComparisonConfig["key field"]]]=d);else if("search"==a.type||"dropdown word"==a.type)if(1==e.includes(a.field)){var f=!1;for(var _ in d[a.field])d[a.field][_]&&d[a.field][_].toLowerCase().includes(c.toLowerCase())&&(f=!0);1==f&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else d[a.field]&&d[a.field].toLowerCase().includes(c.toLowerCase())&&(r[d[t.dataComparisonConfig["key field"]]]=d);else if("search greater than"==a.type)if(1==e.includes(a.field)){var g=!1;for(var _ in d[a.field])"number"==typeof d[a.field][_]&&d[a.field][_]>=c&&(g=!0);1==g&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else"number"==typeof d[a.field]&&d[a.field]>=c&&(r[d[t.dataComparisonConfig["key field"]]]=d);else if("search lower than"==a.type)if(1==e.includes(a.field)){var m=!1;for(var _ in d[a.field])"number"==typeof d[a.field][_]&&d[a.field][_]<=c&&(m=!0);1==m&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else"number"==typeof d[a.field]&&d[a.field]<=c&&(r[d[t.dataComparisonConfig["key field"]]]=d);else if("search or"==a.type){var v=c.split(",");if(1==e.includes(a.field)){var y=!1;for(var _ in d[a.field])"number"==typeof d[a.field][_]&&(d[a.field][_]<=v[0].trim()||d[a.field][_]>=v[1].trim())&&(y=!0);1==y&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else"number"==typeof d[a.field]&&(d[a.field]<=v[0].trim()||d[a.field]>=v[1].trim())&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else if("search change direction"==a.type){var b=document.getElementById("filter_"+t.getColumnId(a.field)+"_direction").value;if("lt"==b)if(1==e.includes(a.field)){var x=!1;for(var _ in d[a.field])d[a.field][_]<=c&&(x=!0);1==x&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else d[a.field]<=c&&(r[d[t.dataComparisonConfig["key field"]]]=d);else if("gt"==b)if(1==e.includes(a.field)){var w=!1;for(var _ in d[a.field])d[a.field][_]>=c&&(w=!0);1==w&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else d[a.field]>=c&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else if("search and"==a.type){var C=c.split(",");if(1==e.includes(a.field)){var P=!1;for(var _ in d[a.field])"number"==typeof d[a.field][_]&&d[a.field][_]>=C[0].trim()&&d[a.field][_]<=C[1].trim()&&(P=!0);1==P&&(r[d[t.dataComparisonConfig["key field"]]]=d)}else"number"==typeof d[a.field]&&(d[a.field]<=C[0].trim()||d[a.field]>=C[1].trim())&&(r[d[t.dataComparisonConfig["key field"]]]=d)}}})),n=r,r=null==e?[]:{})};for(var o in this.filtersIndex)a();var s=void 0!=n.length?n.length:Object.keys(n).length;if(0==s||null==s){this.utils.alertUtils.popAlert("The last filtering item returns no data therefore removed.");var l=this.filtersIndex[this.lastFilter.field].search.filter((function(e){return e!=t.lastFilter.value}));this.filtersIndex[this.lastFilter.field].search=l,this.applyFilters()}else this.$store.dispatch("filteredData",n)},removeAllFilters:function(){for(var t in this.filtersIndex)this.filtersIndex[t].search=[];this.applyFilters()},removeAllSearchParams:function(){},removeFilter:function(t,e){this.filtersIndex[t].search.splice(e,1),this.applyFilters()},removeSearch:function(t,e){}}}),d=u,h=(n("7c5b"),n("2877")),p=Object(h["a"])(d,r,a,!1,null,null,null);e["a"]=p.exports},da18:function(t,e,n){"use strict";n("b2da")},ddbe:function(t,e,n){"use strict";n("3547")},de86:function(t,e,n){"use strict";n("99af"),n("a15b");var r=n("1816"),a=n.n(r),i=a()(window.location.href),o=i.hostname.split("."),s=o.pop();"localhost"!==s&&(s="".concat(o.pop(),".").concat(s)),e["a"]={url:i,domain:s,subDomain:o.length>0?o.join("."):null,urlWithSubdomain:function(t){return t?i.set("hostname","".concat(t,".").concat(s)):i.set("hostname",s),i}}},dfc6:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:this.wrapperClass+" "+t.contentID},[0==this.isHover?n("span",{class:"help-content-caller no-icon-"+this.noIcon,on:{click:function(e){return t.showHideHelpContent(t.contentID)}}},[n("b-icon-plus-circle-fill")],1):t._e(),1==this.isHover?n("span",{class:"help-content-caller hover no-icon-"+this.noIcon,on:{mouseover:function(e){return t.getToolTipPosition(t.contentID)}}},[n("b-icon-info-circle-fill")],1):t._e(),0==this.isHover?n("div",{staticClass:"help-content-modal hidden",attrs:{id:t.contentID}},[n("span",{staticClass:"help-content-close",on:{click:function(e){return t.showHideHelpContent(t.contentID)}}},[t._v("+")]),n("div",{staticClass:"help-content-wrapper",domProps:{innerHTML:t._s(t.tooltipDocumentationContent)}})]):t._e(),1==this.isHover?n("div",{class:"help-hover-content-modal no-icon-"+this.noIcon,attrs:{id:t.contentID}},[n("div",{staticClass:"help-content-wrapper",domProps:{innerHTML:t._s(t.supplyText?t.supplyText:t.tooltipDocumentationContent)}})]):t._e()])},a=[],i=n("5530"),o=(n("a15b"),n("b0c0"),n("498a"),n("2b0e")),s=n("06df"),l=n("4a13"),c=n("a282"),u=n("5f5b"),d=n("b1e0");o["default"].use(u["a"]),o["default"].use(d["a"]);var h=o["default"].component("tooltip-documentation",{props:["name","group","contentFill","contentMap","isHover","noIcon","supplyText","defaultContent"],
1components:{Documentation:l["a"]},data:function(t){return{content:null,converter:null,show:!1}},computed:{tooltipDocumentationContent:function(){var t=null;if(this.contentMap&&this.contentMap[this.name]&&(t=this.contentMap[this.name].content),"string"===typeof t&&(t=t.trim()),!t&&this.defaultContent&&(t=this.defaultContent),!t)return"";var e=this.contentFill||{},n=s["a"].makeConverter(t,e,this.name);return n.makeHtml(t)},contentID:function(){if(this.name){var t=this.name+"_"+Math.random();return t.split(".").join("_")}},wrapperClass:function(){var t=1==this.isHover?"help-content hover ":"help-content ";return t+=1==this.noIcon?"no-icon-true":"no-icon-false",t}},methods:Object(i["a"])(Object(i["a"])({},c["a"]),{},{showHideHelpContent:function(t){c["a"].showHideHelpContent(t)},getToolTipPosition:function(t){c["a"].getToolTipPosition(t)}})}),p=h,f=(n("3bd8"),n("2877")),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},e0a9:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"byor-single-search-wrapper"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.singleSearchParam,expression:"singleSearchParam"}],staticClass:"form-control byor-single-search",attrs:{type:"text",id:"byor_single_search",placeholder:t.singleSearchConfig&&t.singleSearchConfig["search instruction"]?t.singleSearchConfig["search instruction"]:"Search gene, variant, region, phenotype, or tissue"},domProps:{value:t.singleSearchParam},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.onSearch.apply(null,arguments)},input:function(e){e.target.composing||(t.singleSearchParam=e.target.value)}}}),t.singleSearchParam?n("span",{staticClass:"btn btn-default reset-search",on:{click:function(e){return t.resetSearch()}}},[n("b-icon",{attrs:{icon:"x-circle-fill"}})],1):t._e(),t.singleSearchConfig?n("div",{staticClass:"byor-single-search-results-wrapper"},[t.anyResults()>0?n("div",{staticClass:"byor-single-search-results",attrs:{id:"byor_single_search_results"}},[t._l(t.singleSearchResult.genes,(function(e){return n("div",{key:e,staticClass:"single-search-option"},[t._v(" "+t._s(e)),n("span",{staticClass:"search-word-group"},[t.isParameterActive("kp genes").active?n("a",{staticClass:"search-gene-link",attrs:{href:"javascript:;"},on:{click:function(n){return t.searchGene(e)}}},[t._v(t._s("Search gene")),n("span",{staticClass:"gene-link-tip"},[t._v("Alias names are converted to gene symbols")])]):t._e(),t.isParameterActive("kp region").active?n("span",[t._v("|")]):t._e(),t.isParameterActive("kp region").active?n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.searchRegion(e)}}},[t._v(t._s("Search region"))]):t._e()])])})),t.isParameterActive("kp phenotypes").active?t._l(t.singleSearchResult.phenotypes,(function(e){return n("div",{key:e.name,staticClass:"single-search-option",attrs:{value:e.name}},[n("a",{attrs:{href:t.isParameterActive("kp phenotypes").url+e.name}},[t._v(t._s(e.description))]),n("span",{staticClass:"search-word-group"},[t._v(t._s(e.group))])])})):t._e(),t._l(t.singleSearchConfig["search parameters"],(function(e){return[!e.values||e.values&&"kp genes"!=e.values&&"kp phenotypes"!=e.values?[t.isParameterActive(e["parameter"]).active?t._l(t.singleSearchResult[e["parameter"]],(function(r){return n("div",{key:r.value,staticClass:"single-search-option",attrs:{value:r.value}},[t._v(t._s(r.label)+" "),n("a",{staticClass:"search-word-group",attrs:{href:t.isParameterActive(e["parameter"]).url+r.value}},[t._v(t._s("Search "+e["parameter"]))])])})):t._e()]:t._e()]}))],2):t._e()]):t._e(),t.singleSearchConfig?t._e():n("div",{staticClass:"byor-single-search-results-wrapper"},[t.singleSearchResult.genes.length>0||t.singleSearchResult.phenotypes.length>0||t.singleSearchResult.tissues.length>0?n("div",{staticClass:"byor-single-search-results",attrs:{id:"byor_single_search_results"}},[t._l(t.singleSearchResult.genes,(function(e){return n("div",{key:e,staticClass:"single-search-option"},[t._v(" "+t._s(e)),n("span",{staticClass:"search-word-group"},[n("a",{staticClass:"search-gene-link",attrs:{href:"javascript:;"},on:{click:function(n){return t.searchGene(e)}}},[t._v(t._s("Search gene")),n("span",{staticClass:"gene-link-tip"},[t._v("Alias names are converted to gene symbols")])]),t._v(" | "),n("a",{attrs:{href:"javascript:;"},on:{click:function(n){return t.searchRegion(e)}}},[t._v(t._s("Search region"))])])])})),t._l(t.singleSearchResult.tissues,(function(e){return n("div",{key:e.value,staticClass:"single-search-option",attrs:{value:e.value}},[n("a",{attrs:{href:"/tissue.html?tissue="+e.value}},[t._v(t._s(e.label))]),n("span",{staticClass:"search-word-group"},[t._v(t._s("Tissue"))])])})),t._l(t.singleSearchResult.phenotypes,(function(e){return n("div",{key:e.name,staticClass:"single-search-option",attrs:{value:e.name}},[n("a",{attrs:{href:"/phenotype.html?phenotype="+e.name}},[t._v(t._s(e.description))]),n("span",{staticClass:"search-word-group"},[t._v(t._s(e.group))])])}))],2):t._e()])])},a=[],i=n("53ca"),o=n("3835"),s=n("2909"),l=n("1da1"),c=n("5530"),u=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("4e82"),n("b0c0"),n("4fad"),n("0c47"),n("23dc"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("5319"),n("5b81"),n("498a"),n("0643"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),d=n("e60d"),h=n("1f3b");function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};u(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
1function E(t,e){function n(a,o,s,l){var c=h(t[a],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(i["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(i["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=u(x,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u(t,c,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),u(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),u(k,c,"Generator"),u(k,s,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var f=u["default"].component("research-single-search",{props:["singleSearchConfig","phenotypes","utils"],modules:{},data:function(){return{singleSearchParam:null,singleSearchResult:{genes:[],phenotypes:[],tissues:[],diseases:[]},customList:{}}},created:function(){var t=this;this.singleSearchConfig&&this.singleSearchConfig["search parameters"]?this.singleSearchConfig["search parameters"].map((function(e){if(e["data point"]){var n=e["data point"];t.getList(e["parameter"],n["url"],n["data type"],n["data wrapper"])}})):this.getTissues()},mounted:function(){},computed:{},watch:{singleSearchParam:function(t){var e=this;if(t&&t.length>=2){if(this.singleSearchConfig&&this.singleSearchConfig["search parameters"]){var n=null;this.singleSearchConfig["search parameters"].map((function(t){t["values"]&&"kp genes"==t["values"]&&(n=!0)})),n&&this.lookupGenes(t)}else this.lookupGenes(t);var r=t.split(" "),a=[];this.phenotypes.map((function(t){var e=0;r.map((function(n){t.description.toLowerCase().includes(n.toLowerCase())&&e++})),e==r.length&&a.push(t)}));var i=a.sort((function(t,e){return t.name.length-e.name.length}));this.singleSearchResult.phenotypes=i;var o=Object.keys(this.customList);o.map((function(t){var n=[];e.customList[t].map((function(t){var e=0;r.map((function(n){t.label.toLowerCase().includes(n.toLowerCase())&&e++})),e==r.length&&n.push(t)})),e.singleSearchResult[t]=n}))}else{this.singleSearchResult.genes=[],this.singleSearchResult.phenotypes=[];var s=Object.keys(this.customList);s.map((function(t){e.singleSearchResult[t]=[]}))}}},methods:Object(c["a"])(Object(c["a"])({},h["a"]),{},{resetSearch:function(){var t=this;this.singleSearchParam=null;var e=Object.keys(this.singleSearchResult);e.map((function(e){t.singleSearchResult[e]=[]}))},getTissues:function(){var t=this;return Object(l["a"])(p().mark((function e(){var n,r,a,i,o;return p().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(d["a"],"/api/bio/keys/gene-expression-tissue/1")).then((function(t){return t.json()})).then((function(t){if(0==t.count)return null;var e=t.keys.map((function(t){return t[0].replaceAll("_"," ")}));return e}));case 2:return n=e.sent,e.next=5,fetch("".concat(d["a"],"/api/bio/keys/partitioned-heritability-top-tissue/2")).then((function(t){return t.json()})).then((function(t){if(0==t.count)return null;var e=t.keys.map((function(t){return t[0].replaceAll("_"," ")}));return e}));
1case 5:r=e.sent,n&&r&&(a=n.concat(r),i=Object(s["a"])(new Set(a)),o=[],i.map((function(t){var e=t.charAt(0).toUpperCase()+t.slice(1),n={label:e,value:t.replaceAll(" ","_")};o.push(n)})),t.customList["tissues"]=o);case 7:case"end":return e.stop()}}),e)})))()},anyResults:function(){var t=this,e=Object.keys(this.singleSearchResult),n=0;return e.map((function(e){n+=t.singleSearchResult[e].length})),n},onSearch:function(){var t=this.singleSearchParam.replace(/,/g,"").trim();if(this.singleSearchParam.includes("rs")||this.singleSearchParam.includes(":"))if(this.singleSearchParam.includes("-")){var e=t.split(":")[0],n=t.split(":")[1].split("-"),r="/region.html?chr="+e+"&end="+n[1]+"&start="+n[0];this.singleSearchParam="",location.href=r}else location.href="/variant.html?variant="+t;else if(this.singleSearchParam.includes("_")&&this.singleSearchParam.includes("-"))location.href="/variant.html?variant="+t;else{var a=this.anyResults();if(0===a)h["a"].popAlert("Your search term was not found. Please try again.");else if(1===a){var i;if(!this.singleSearchConfig){for(var s=0,l=Object.entries(this.singleSearchResult);s<l.length;s++){var c=Object(o["a"])(l[s],2),u=c[0],d=c[1];if(1==d.length)switch(u){case"phenotypes":i="/phenotype.html?phenotype="+d[0].name;break;case"genes":i="/gene.html?gene="+d[0];break;case"tissues":i="/tissue.html?tissue="+d[0].value;break;case"diseases":i="/disease.html?disease="+d[0].value;break}}location.href=i}}else a>1&&h["a"].popAlert("Multiple search options are available. Please select one from the list.")}},isParameterActive:function(t){var e={active:null,url:""};return this.singleSearchConfig&&this.singleSearchConfig["search parameters"].map((function(n){(n.values==t||n.parameter==t)&&(e.active=!0,n["target page"]["page id"]?e.url="/research.html?pageid="+n["target page"]["page id"]:n["target page"]["url"]&&(e.url=n["target page"]["url"]),e.url+=n["target page"]["entity"]?"&"+n["target page"]["entity parameter"]+"="+n["target page"]["entity"]:"",n["target page"]["page id"]?e.url+="&"+n["parameter"]+"=":n["target page"]["url"]&&(e.url+=n["parameter"]+"="))})),e},getList:function(t,e,n,r){var a=this;return Object(l["a"])(p().mark((function o(){var s,l,c,u;return p().wrap((function(o){while(1)switch(o.prev=o.next){case 0:if(!e){o.next=5;break}return o.next=3,fetch(e).then((function(t){return t.json()}));case 3:s=o.sent,null==s.error&&("string"==typeof s&&(s="json"==n?JSON.parse(s):"csv"==n?a.utils.dataConvert.csv2Json(s):s),r?(c=s,r.map((function(t){c=c[t]})),"string"==typeof c&&(c="json"==n?JSON.parse(c):"csv"==n?a.utils.dataConvert.csv2Json(c):c),u=[],c.length>0&&c.map((function(t){"string"==typeof t||"number"==typeof t?u.push({label:t,value:t}):"object"==Object(i["a"])(t)&&Array.isArray(t)?u.push({label:t[0],value:t[0]}):"object"!=Object(i["a"])(t)||Array.isArray(t)||u.push(t)})),l=u):l=s,a.customList[t]=l);case 5:case"end":return o.stop()}}),o)})))()},searchGene:function(t){var e=this;return Object(l["a"])(p().mark((function n(){var r,a,i;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.utils.regionUtils.geneSymbol(t);case 2:r=n.sent,a=e.isParameterActive("kp genes"),r&&(a.active?a.active&&(i=a.url+r):i="/gene.html?gene="+r,location.href=i);case 5:case"end":return n.stop()}}),n)})))()},searchRegion:function(t){var e=this;return Object(l["a"])(p().mark((function n(){var r,a,i;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.utils.regionUtils.parseRegion(t,!0,5e4);case 2:r=n.sent,a=e.isParameterActive("kp region"),r&&(a.active?a.active&&(i=a.url+=r.chr+":"+r.start+"-"+r.end):i="/region.html?chr="+r.chr+"&end="+r.end+"&start="+r.start,location.href=i);case 5:case"end":return n.stop()}}),n)})))()},lookupGenes:function(t){var e=this;return Object(l["a"])(p().mark((function n(){var r;return p().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(d["e"])("gene",t,{limit:10});case 2:r=n.sent,e.singleSearchResult.genes=r;case 4:case"end":return n.stop()}}),n)})))()}})}),_=f,g=(n("1411"),n("2877")),m=Object(g["a"])(_,r,a,!1,null,"182fdce8",null);e["a"]=m.exports},e0b2:function(t,e,n){},e176:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.datasetsListNew.length>0?n("h3",{staticStyle:{"margin-top":"30px"}},[t._v(" New Datasets "),n("small",{staticClass:"datasets-list-header-small"},[t._v("(Click datasets for description)")])]):t._e(),t.datasetsListNew.length>0?n("div",{staticClass:"new datasets-list-table"},[n("table",{staticClass:"table table-hover table-sm"},[n("thead",[n("tr",[n("th",{staticClass:"column name",on:{click:function(e){return t.setSortKey("description")}}},[t._v(" Dataset ")]),n("th",{staticClass:"column access",on:{click:function(e){return t.setSortKey("access")}}},[t._v(" Access ")]),n("th",{staticClass:"column samples",on:{click:function(e){return t.setSortKey("subjects")}}},[t._v(" Samples ")]),n("th",{staticClass:"column ancestry",on:{click:function(e){return t.setSortKey("ancestry_n
1ame")}}},[t._v(" Ancestry ")]),n("th",{staticClass:"column type",on:{click:function(e){return t.setSortKey("data_type")}}},[t._v(" Technology ")]),"md"==t.diseaseGroup.name||"a2f"==t.diseaseGroup.name?n("th",{staticClass:"column disease-group"},[t._v(" Contributing community ")]):t._e()])]),n("tbody",t._l(t.datasetsListNew,(function(e,r){return n("tr",[n("td",{staticClass:"column name"},[n("a",{attrs:{href:"/dinspector.html?dataset="+e.name}},[t._v(t._s(e.description))])]),n("td",{staticClass:"column access"},[n("span",{class:e.access},[t._v(t._s(e.access))])]),n("td",{staticClass:"column samples"},[t._v(t._s(e.subjects))]),n("td",{staticClass:"column ancestry"},[t._v(" "+t._s(e.ancestry_name)+" ")]),n("td",{staticClass:"column type"},[t._v(t._s(e.data_type))]),"md"==t.diseaseGroup.name||"a2f"==t.diseaseGroup.name?n("td",{staticClass:"column disease-group"},[n("span",{staticClass:"community-icon",class:e.community,attrs:{title:e.community}},[t._v("Â ")])]):t._e()])})),0)])]):t._e(),t.datasetsListNotNew.length>0?n("h3",[t._v(" Datasets "),n("small",{staticClass:"datasets-list-header-small"},[t._v("(Click datasets for description)")])]):t._e(),t.datasetsListNotNew.length>0?n("div",{staticClass:"datasets-list-table"},[n("table",{staticClass:"table table-hover table-sm"},[n("thead",[n("tr",[n("th",{staticClass:"column name",on:{click:function(e){return t.setSortKey("description")}}},[t._v(" Dataset ")]),n("th",{staticClass:"column access",on:{click:function(e){return t.setSortKey("access")}}},[t._v(" Access ")]),n("th",{staticClass:"column samples",on:{click:function(e){return t.setSortKey("subjects")}}},[t._v(" Samples ")]),n("th",{staticClass:"column ancestry",on:{click:function(e){return t.setSortKey("ancestry_name")}}},[t._v(" Ancestry ")]),n("th",{staticClass:"column type",on:{click:function(e){return t.setSortKey("data_type")}}},[t._v(" Technology ")]),"md"==t.diseaseGroup.name||"a2f"==t.diseaseGroup.name?n("th",{staticClass:"column disease-group"},[t._v(" Contributing community ")]):t._e()])]),n("tbody",t._l(t.datasetsListNotNew,(function(e,r){return n("tr",[n("td",{staticClass:"column name"},[n("a",{attrs:{href:"/dinspector.html?dataset="+e.name}},[t._v(t._s(e.description))])]),n("td",{staticClass:"column access"},[n("span",{class:e.access},[t._v(t._s(e.access))])]),n("td",{staticClass:"column samples"},[t._v(t._s(e.subjects))]),n("td",{staticClass:"column ancestry"},[t._v(" "+t._s(e.ancestry_name)+" ")]),n("td",{staticClass:"column type"},[t._v(t._s(e.data_type))]),"md"==t.diseaseGroup.name||"a2f"==t.diseaseGroup.name?n("td",{staticClass:"column disease-group"},[n("span",{staticClass:"community-icon",class:e.community,attrs:{title:e.community}},[t._v("Â ")])]):t._e()])})),0)])]):t._e()])},a=[],i=n("5530"),o=(n("4de4"),n("4e82"),n("d3b7"),n("0643"),n("2382"),n("2b0e")),s=n("5f5b"),l=n("b1e0"),c=n("a708");n("f9e3"),n("2dd8");o["default"].use(s["a"]),o["default"].use(l["b"]);var u=o["default"].component("portal-datasets-list-table",{props:["diseaseGroups","phenotypes","diseaseGroup","datasetsList","filter"],modules:Object(i["a"])({},c["a"]),data:function(){return{isAtive:!1,selectedPhenotypeGroup:null,selectedPhenotype:null,selectedDatatype:null,selectedDiseaseGroup:null,sortKey:"subjects",ascending:!1}},computed:{datasetsListNew:function(){return this.getDatasetsList(!0)},datasetsListNotNew:function(){return this.getDatasetsList(!1)}},methods:{getDatasetsList:function(t){var e=this.datasetsList.filter((function(e){return e.new==t})),n="subjects"==this.sortKey;return c["a"].sort(e,this.sortKey,n,this.ascending)},setSeletedDiseaseGroup:function(t){this.selectedDiseaseGroup="md"==t?null:t},setSeletedDatatype:function(t){this.selectedDatatype="Show all"==t?null:t},setSeletedPhenotypeGroup:function(t){this.selectedPhenotypeGroup="Show all"==t?null:t,this.selectedPhenotype=null},setSeletedPhenotype:function(t){this.selectedPhenotype=t},setSortKey:function(t){this.sortKey=t,this.ascending=1!=this.ascending}}}),d=u,h=(n("01db"),n("2877")),p=Object(h["a"])(d,r,a,!1,null,null,null);e["a"]=p.exports},e1d2:function(t,e,n){"use strict";n("89e4")},e360:function(t,e,n){},e4b6:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",["huge calculator"==t.currentPage?[n("div",{staticClass:"row",attrs:{id:"suggestionBox"}},[n("div",{staticClass:"col-md-6"},[t._v(" HuGE Score (Combined Evidence) "),n("tooltip-documentation",{attrs:{name:"hugecal.combined.tooltip.hover",contentFill:t.docDetails,contentMap:t.$store.state.bioPortal.documentations,isHover:!0,noIcon:!1}})],1),n("div",{staticClass:"col-md-6",staticStyle:{"text-align":"right","white-space":"nowrap"}}
1,[t._v(" "+t._s(t.commonVarBF)+"(Common variation BF) * "+t._s(t.rareVarBF.rareBF)+"(Rare variation BF) = "+t._s(t.hugeScore)+" ")])]),n("div",{staticClass:"lead block-end"},[t._v(" *BF=Bayes Factor   *HuGE Score(combined evidence) = BF of common variation X BF of rare variation ")]),n("hugescore-table",{attrs:{commonBF:t.commonVarBF,rareBF:t.rareVarBF.rareBF,hugeScore:t.hugeScore,exomeSignificant:t.isExomeWideSignificant(t.rareAssociations)}})]:t._e(),"huge calculator"!=t.currentPage?[n("div",{staticClass:"container"},[n("div",{staticClass:"center"},[n("b-table-simple",{attrs:{borderless:"",fixed:"",small:""}},[n("b-tbody",[n("b-tr",[n("b-td",{staticClass:"text-center",staticStyle:{width:"30px","background-color":"#e7edf7"}},[t._v(t._s(t.commonVarBF))]),n("b-td",{staticClass:"text-center",staticStyle:{width:"15px"}},[t._v("X")]),n("b-td",{staticClass:"text-center",staticStyle:{width:"30px","background-color":"#fef8dc"}},[t._v(t._s(t.rareVarBF.rareBF))]),n("b-td",{staticClass:"text-center",staticStyle:{width:"15px"}},[t._v("=")]),n("b-td",{staticClass:"text-center",staticStyle:{width:"30px","background-color":"#c4edc8"}},[t._v(t._s(t.hugeScore))]),n("b-td",{staticClass:"text-left",staticStyle:{width:"20px"}},[t._v("<-- HuGE Score")])],1)],1)],1)],1)]),n("div",{staticClass:"container",staticStyle:{"margin-bottom":"25px"}},[n("ul",{staticClass:"legend center",staticStyle:{"white-space":"nowrap"}},[t._m(0),t._m(1),n("li",[n("a",{attrs:{href:"/hugecalculator.html?gene="+t.selectedGene+"&phenotype="+t.selectedPhenotype}},[t._v("View evidence in HuGE calculator >>")])])]),n("br")])]:t._e(),n("div",{staticClass:"container color-bar"},[n("div",{staticClass:"center"},[t.rareVarBF.rareBF?n("color-bar-plot",{staticClass:"block-end",attrs:{category:t.getCategory(t.hugeScore),elementid:"combinedVariation",score:t.hugeScore}}):t._e()],1)])],2)},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",[n("span",{staticClass:"superawesome"}),t._v(" Common Variation Bayes Factor ")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("li",[n("span",{staticClass:"awesome"}),t._v(" Rare Variation Bayes Factor ")])}],i=(n("4de4"),n("d81d"),n("4e82"),n("b0c0"),n("b680"),n("d3b7"),n("0643"),n("2382"),n("a573"),n("2b0e")),o=(n("f9e3"),n("529c")),s=n("dfc6"),l=n("2100"),c=n("06b0"),u=i["default"].component("hugecal-score-section",{props:["currentPage","docDetails","commonAssociations","geneData","genesInARegion","rareAssociations","selectedGene","selectedPhenotype","prior"],data:function(){return{}},components:{TooltipDocumentation:s["a"],ColorBarPlot:l["a"],Hugescoretable:c["a"]},computed:{commonVarBF:function(){var t=this,e=1,n={transcript_ablation:"HIGH",splice_acceptor_variant:"HIGH",splice_donor_variant:"HIGH",stop_gained:"HIGH",frameshift_variant:"HIGH",stop_lost:"HIGH",start_lost:"HIGH",transcript_amplification:"HIGH",inframe_insertion:"MODERATE",inframe_deletion:"MODERATE",missense_variant:"MODERATE",protein_altering_variant:"MODERATE"},r=this.commonAssociations,a=r[0];r.map((function(t){a=t.pValue<a.pValue?t:a}));var i=this.genesInARegion.filter((function(t){return"symbol"==t.source})),o=null;i.map((function(t){var e=a.position-t.start,n=a.position-t.end;t["distance"]=e*n>0?Math.min(Math.abs(e),Math.abs(n)):0,o=null==o?t:o.distance<=t.distance?o:t})),r.map((function(t){if(n.hasOwnProperty(t.consequence)&&t.pValue<5e-8)return e=20,e}));var s=!1;r.map((function(e){0==s&&e.phenotype==t.selectedPhenotype&&e.pValue<=5e-8&&(s=!0)}));var l=!!(n.hasOwnProperty(a.consequence)&&a.position>=this.geneData[0].start&&a.position<=this.geneData[0].end),c=(n[a.consequence],!0);return e=s?l&&c?360:o.name==this.selectedGene?45:3:1,"huge calculator"==this.currentPage&&this.$store.dispatch("commonVarBF",parseFloat(e)),parseFloat(e)},rareVarBF:function(){var t=this,e={},n=[],r=1,a=1,i=this.rareAssociations,o=this.isExomeWideSignificant(i);return o?(r=348,a=1):i.length>0&&i.map((function(e){if(e.phenotype&&e.phenotype==t.selectedPhenotype){var i,o,s,l,c,u,d,h,p;if(n=e.masks,n&&n.length>0){var f=n.sort((function(t,e){return t.pValue-e.pValue}));i=f[0].stdErr,o=f[0].beta,s=t.prior,l=Math.pow(i,2),c=l/(l+s),u=Math.sqrt(c),d=s*Math.pow(o,2),h=2*l*(l+s),p=d/h,r=u*Math.exp(p)}r=r<1?1:r,a=o}})),e["rareBF"]=parseFloat(r.toFixed(2)),e["beta"]=parseFloat(a.toFixed(2)),"huge calculator"==this.currentPage&&this.$store.dispatch("rareVarBF",e),e},hugeScore:function(){var t=parseFloat(o["a"].floatFormatter(this.commonVarB
1F*this.rareVarBF.rareBF));return"huge calculator"==this.currentPage&&this.$store.dispatch("hugeScore",t),t}},methods:{getCategory:function(t){var e=t>=350?"Compelling":t>=100?"Extreme":t>=30?"Very Strong":t>=10?"Strong":t>=3?"Moderate":t>1?"Anecdotal":"No";return e},isExomeWideSignificant:function(t){var e=this,n=!1;return t.map((function(t){0==n&&t.phenotype==e.selectedPhenotype&&t.pValue<=25e-7&&(n=!0)})),n}}}),d=u,h=(n("0d6a"),n("2877")),p=Object(h["a"])(d,r,a,!1,null,"1751e1be",null);e["a"]=p.exports},e535:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{key:"features_"+t.index,staticClass:"feature-content-wrapper",class:["feature-headers-"+t.index,t.isHidden?"hidden":""]},[n("b-row",{staticClass:"feature-header"},[t._l(t.colNames,(function(e){return n("b-col",{key:e,staticClass:"feature-header-item"},[t._v(t._s(e))])})),t.dichotomous?n("b-col",{staticClass:"feature-header-item"},[t._v("Odds Ratio")]):n("b-col",{staticClass:"feature-header-item"},[t._v("Beta")]),t.showStudy?n("b-col",{staticClass:"feature-header-item"},[t._v("Study")]):t._e(),t.showPmid?n("b-col",{staticClass:"feature-header-item"},[t._v("PMID")]):t._e()],2),t._l(t.formattedMasks,(function(e,r){return[n("b-row",{key:"features_"+t.index+"_"+r,staticClass:"features",class:"features_"+t.index+"_"+r},[n("b-col",{staticClass:"feature-content-item"},[t._v(t._s(e.mask))]),n("b-col",{staticClass:"feature-content-item"},[t._v(t._s(t.pValueFormatter(e.pValue)))]),n("b-col",{staticClass:"feature-content-item"},[t._v(t._s(Number.parseFloat(e.combinedAF).toFixed(7)))]),n("b-col",{staticClass:"feature-content-item"},[t._v(t._s(e.passingVariants))]),n("b-col",{staticClass:"feature-content-item"},[t._v(t._s(e.singleVariants))]),n("b-col",{staticClass:"feature-content-item"},[t._v(t._s(Number.parseFloat(e.stdErr).toFixed(5)))]),n("b-col",{staticClass:"feature-content-item"},[t._v(t._s(t.intFormatter(e.n)))]),t.dichotomous?n("b-col",{staticClass:"feature-content-item"},[n("span",{class:Math.exp(e.beta)<1?"effect negative":"effect positive"},[t._v(t._s(Math.exp(e.beta)<1?"â¼":"â²"))]),t._v(" "+t._s(t.effectFormatter(Math.exp(e.beta)))+" ")]):n("b-col",{staticClass:"feature-content-item"},[n("span",{class:e.beta<0?"effect negative":"effect positive"},[t._v(t._s(e.beta<0?"â¼":"â²"))]),t._v(" "+t._s(t.effectFormatter(e.beta))+" ")]),t.showStudy?n("b-col",{staticClass:"feature-content-item"},[t._v(" "+t._s(e.study)+" ")]):t._e(),t.showPmid?n("b-col",{staticClass:"feature-content-item"},[t._v(" "+t._s(e.pmid)+" ")]):t._e()],1)]}))],2),n("div",{key:"plot_"+t.index,staticClass:"feature-plot-wrapper",class:["feature-plot-"+t.index,t.isHidden?"hidden":""]},[n("b-col",[t._v("Forest Plot")]),n("forest-plot",{ref:"fplot_"+t.index,attrs:{id:"fplot_"+t.index,data:t.formattedMasks,element:"fplot_"+t.index,dichotomous:t.dichotomous}})],1)])},a=[],i=n("5530"),o=(n("a4d3"),n("e01a"),n("d81d"),n("fb6a"),n("4e82"),n("a9e3"),n("a573"),n("2b0e")),s=n("529c"),l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"plots",style:t.height,attrs:{id:t.element}})},c=[],u=(n("cb29"),n("14d9"),n("71c9")),d=n("c497"),h=n("5a54");u["e"](h["a"]),u["d"].autoDispose=!0;var p=o["default"].component("ForestPlot",{props:{data:{type:Array,required:!0},element:{type:String,required:!1,default:"forest-plot"},dichotomous:{type:Boolean,required:!1,default:!1}},data:function(){return{chart:null}},computed:{height:function(){return"height: ".concat(this.data.length?50*this.data.length+40:300,"px")}},watch:{data:{handler:function(t){var e=this;this.chart&&t&&t.length>0?this.updateChart(t):t&&t.length>0&&this.$nextTick((function(){e.createChart(t,e.element,e.dichotomous)}))},deep:!0},dichotomous:function(t){var e=this;this.$nextTick((function(){e.createChart(e.data,e.element,t)}))}},mounted:function(){var t=this;this.$nextTick((function(){t.data&&t.data.length>0&&t.createChart(t.data,t.element,t.dichotomous)}))},beforeDestroy:function(){this.chart&&(this.chart.dispose(),this.chart=null)},methods:{createChart:function(t,e,n){var r=document.getElementById(e);
1if(r&&(this.chart&&(this.chart.dispose(),this.chart=null),t&&0!==t.length))try{this.chart=u["c"](e,d["e"]),this.chart.data=t.map((function(t){return"Infinity"==t.stdErr&&(t.stdErr=2*Math.abs(t.beta)),{category:t.mask,high:n?Math.exp(t.beta+1.96*t.stdErr):t.beta+1.96*t.stdErr,low:n?Math.exp(t.beta-1.96*t.stdErr):t.beta-1.96*t.stdErr,measure:n?Math.exp(t.beta):t.beta,bulletSize:5}})),this.chart.logo.disabled=!0;var a=this.chart.yAxes.push(new d["a"]);a.dataFields.category="category",a.renderer.grid.template.location=0,a.renderer.inversed=!0;var i=this.chart.xAxes.push(new d["d"]),o=this.chart.series.push(new d["b"]);o.dataFields.openValueX="low",o.dataFields.valueX="high",o.dataFields.categoryY="category",o.columns.template.height=1,o.columns.template.strokeWidth=0,o.columns.template.fill=this.chart.colors.getIndex(0);var s=this.chart.series.push(new d["c"]);s.dataFields.customValue="bulletSize",s.dataFields.valueX="measure",s.dataFields.categoryY="category",s.strokeWidth=0;var l=s.bullets.push(new u["b"]);l.width=5,l.height=5,l.strokeWidth=0,l.fill=this.chart.colors.getIndex(0),l.stroke=this.chart.colors.getIndex(0),l.propertyFields.rotation="rotation",l.propertyFields.fill="fill",l.nonScalingStroke=!0,l.verticalCenter="middle",l.horizontalCenter="middle";var c=s.bullets.push(new u["a"]);c.propertyFields.text="label",c.strokeWidth=0,c.verticalCenter="middle",c.horizontalCenter="middle",c.interactionsEnabled=!1,s.heatRules.push({target:l,property:"scale",min:1,max:4,dataField:"customValue"}),a.renderer.grid.template.disabled=!0,i.renderer.grid.template.disabled=!0;var h=i.axisRanges.create();h.value=n?1:0,h.grid.strokeWidth=2,h.grid.strokeDasharray="7,7"}catch(p){}},updateChart:function(t){var e=this;if(this.chart&&t&&0!==t.length)try{var n=t.map((function(t){return"Infinity"==t.stdErr&&(t.stdErr=2*Math.abs(t.beta)),{category:t.mask,high:e.dichotomous?Math.exp(t.beta+1.96*t.stdErr):t.beta+1.96*t.stdErr,low:e.dichotomous?Math.exp(t.beta-1.96*t.stdErr):t.beta-1.96*t.stdErr,measure:e.dichotomous?Math.exp(t.beta):t.beta,bulletSize:5}}));this.chart.data=n}catch(r){}}}}),f=p,_=n("2877"),g=Object(_["a"])(f,l,c,!1,null,null,null),m=g.exports,v=o["default"].component("MaskTable",{props:{maskData:Array,index:[String,Number],dichotomous:Boolean,isHidden:{type:Boolean,default:!1}},component:m,data:function(){return{showStudy:!1,showPmid:!1,colNames:["Mask","P-Value","Combined AF","Passing Variants","Singleton Variants","Standard Error","Sample Size"]}},computed:{formattedMasks:function(){var t=this,e=this.maskData.slice().sort((function(e,n){return t.maskFormatter(e.mask).sort-t.maskFormatter(n.mask).sort}));return e.map((function(e){return Object(i["a"])(Object(i["a"])({},e),{},{mask:t.maskFormatter(e.mask).description})}))}},created:function(){},watch:{formattedMasks:function(t){for(var e=0;e<t.length;e++)if(t[e].study&&(this.showStudy=!0),t[e].pmid&&(this.showPmid=!0),this.showStudy&&this.showPmid)return}},methods:{pValueFormatter:s["a"].pValueFormatter,effectFormatter:s["a"].effectFormatter,intFormatter:s["a"].intFormatter,maskFormatter:s["a"].maskFormatter}}),y=v,b=(n("1734"),Object(_["a"])(y,r,a,!1,null,null,null));e["a"]=b.exports},e60d:function(t,e,n){"use strict";n.d(e,"a",(function(){return d})),n.d(e,"c",(function(){return p})),n.d(e,"g",(function(){return f})),n.d(e,"h",(function(){return _})),n.d(e,"f",(function(){return m})),n.d(e,"e",(function(){return y})),n.d(e,"b",(function(){return P}));var r=n("53ca"),a=n("1da1"),i=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("4de4"),n("14d9"),n("fb6a"),n("b0c0"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("2ca0"),n("3ca3"),n("0643"),n("2382"),n("4e3e"),n("159b"),n("ddb0"),n("72bf")),o=n.n(i),s=n("8958"),l=n.n(s);function c(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */c=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(t){d=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var a=e&&e.prototype instanceof y?e:y,o=Object.create(a.prototype),s=new S(r||[]);return i(o,"_invoke",{value:D(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};d(w,s,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&a.call(P,s)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){d(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(i,o,s,l){var c=p(t[i],t,o);if("throw"!==c.type){var u=c.arg,d=u.value;
vendor: 5,600 bytes, line 1
1return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return o=o?o.then(a,a):a()}})}function D(e,n,r){var a=f;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===f)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=p(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=p(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(a.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(Object(r["a"])(e)+" is not iterable")}return b.prototype=x,i(k,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),d(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(h(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),d(k,u,"Generator"),d(k,s,(function(){return this})),d(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}var u=void 0;document.cookie&&(u=l.a.parse(document.cookie).session);var d="https://bioindex.hugeamp.org",h="https://bioindex.hugeamp.org";function p(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;
1t.startsWith("/")&&(t=t.substr(1));var r=n||(e?h:d);return"".concat(r,"/").concat(t)}function f(t,e,n){var r=o.a.stringify(e,{skipNull:!0});return"".concat(p(t,!1,n)).concat(r?"?"+r:"")}function _(t,e,n){return g.apply(this,arguments)}function g(){return g=Object(a["a"])(c().mark((function t(e,n,r){return c().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.abrupt("return",fetch(f(e,n,r),{headers:{"x-bioindex-access-token":u}}));case 1:case"end":return t.stop()}}),t)}))),g.apply(this,arguments)}function m(t,e){return v.apply(this,arguments)}function v(){return v=Object(a["a"])(c().mark((function t(e,n){var r,a,i,o,s,l,u,d,h=arguments;return c().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=h.length>2&&void 0!==h[2]?h[2]:{},a=r.limit,i=r.onResolve,o=r.onError,s=r.onLoad,l=r.limitWhile,u=r.host,d=_("/api/bio/query/".concat(e),{q:n,limit:a},u),t.next=5,w(d,i,o,s,l,u);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),v.apply(this,arguments)}function y(t,e){return b.apply(this,arguments)}function b(){return b=Object(a["a"])(c().mark((function t(e,n){var r,a,i,o,s,l,u,d=arguments;return c().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=d.length>2&&void 0!==d[2]?d[2]:{},a=r.limit,i=r.onLoad,o=r.onResolve,s=r.onError,l=r.host,u=_("/api/bio/match/".concat(e),{q:n,limit:a},l),t.next=5,w(u,o,s,i,void 0,l);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),b.apply(this,arguments)}function x(t,e){var n=t.data;return e&&(n=t.data.filter(e),n.length<t.count&&(t.continuation=null)),n}function w(t,e,n,r,a,i){return C.apply(this,arguments)}function C(){return C=Object(a["a"])(c().mark((function t(e,n,r,a,i,o){var s,l,u,d;return c().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return s=t.sent,t.next=5,s.json();case 5:if(l=t.sent,u=[],200!==s.status){t.next=22;break}u=x(l,i),n&&n(l);case 10:if(!l.continuation){t.next=21;break}return d=_("/api/bio/cont",{token:l.continuation},o),t.next=14,d;case 14:return s=t.sent,t.next=17,s.json();case 17:l=t.sent,200===s.status&&(u=u.concat(x(l,i)),n&&n(l)),t.next=10;break;case 21:a&&a(l);case 22:return 200!==s.status&&r&&r(l),t.abrupt("return",u);case 24:case"end":return t.stop()}}),t)}))),C.apply(this,arguments)}var P=2,k="small",M="all_but_hpo",E={portal:"A2F",gcat_trait:"GWAS Catalog",rare_v2:"Orphanet",hpo:"HPO",portal_exomes:"Exomes"};e["d"]={query:m,match:y,apiUrl:p,request:_,rawUrl:f,BIO_INDEX_HOST:d,BIO_INDEX_HOST_PRIVATE:h,DEFAULT_SIGMA:P,DEFAULT_GENESET_SIZE:k,DEFAULT_TRAIT_GROUP:M,TRAIT_GROUPS:E}},e861:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",[n("EventListener",{on:{change:t.filterControlChange,"filter-mounted":t.onInitialFilterDefinition}},[t._t("header"),n("b-container",{directives:[{name:"show",rawName:"v-show",value:!t.hide,expression:"!hide"}],staticClass:"filtering-ui-wrapper",attrs:{fluid:""}},[n("b-row",{staticClass:"filtering-ui-content"},[t._t("default"),t.inlinePills&&!t.noPills?t._t("pills",(function(){return[null!=t.filterListInternal&&t.filterListInternal.length>0?n("criterion-pills",{attrs:{header:t.header,fitlerList:t.filterListInternal,clearable:t.clearable},on:{unset:t.unsetFilter}}):t._e()]})):t._e()],2)],1),t.inlinePills||t.noPills?t._e():t._t("pills",(function(){return[null!=t.filterListInternal&&t.filterListInternal.length>0?n("criterion-pills",{attrs:{header:t.header,filterList:t.filterListInternal,clearable:t.clearable},on:{unset:t.unsetFilter}}):t._e()]}))],2),t._t("filtered",null,{filter:t.criterion})],2)},a=[],i=n("ade3"),o=n("5530"),s=(n("99af"),n("caad"),n("d81d"),n("14d9"),n("b64b"),n("2532"),n("a573"),n("2b0e")),l=n("5f5b"),c=n("b1e0"),u=(n("f9e3"),n("2dd8"),n("2ef0")),d=n("f73e"),h=n("7644");s["default"].use(l["a"]),s["default"].use(c["b"]);var p={render:function(t){return t("div",this.$scopedSlots.default())}},f=s["default"].component("criterion-group-template",Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])(Object(i["a"])({components:{CriterionPills:h["a"]},props:{value:[Function,Array],filterType:{type:String},filterList:Array,filterFunction:Function,inclusive:Boolean,strictCase:Boolean,looseMatch:Boolean,hide:Boolean,header:{type:String,default:"Selected Filters:\t"},filterMaker:{type:Function,default:d["c"]},predicateMaker:{type:Function,default:d["d"]},noPills:{type:Boolean,default:!1},inlinePills:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0}}},"components",{EventListener:p}),"data",(function(){return{filterListInternal:null,filterFunctionInternal:null,makeFilter:this.filterMaker,makePredicate:this.predicateMaker,initialFilterDefinitions:[],initialFilterDefinitionMap:{}}})),"created",(function(){"undefined"!==typeof this.filterList?this.filterListInternal=this.filterList:this.value&&Array.isArray(this.value)?this.filterListInternal=this.value:this.filterListInternal=[],"undefined"!==typeof this.filterFunction?this.filterFunctionInternal=this.filterFunction:this.value&&"function"===typeof this.value?this.filterFunctionInternal=this.value:this.filterFunctionInternal=function(t){return!0}})),"mounted",(function(){this.initialFilterDefinitions.length>0&&(this.initialFilterDefinitionMap=Object(u["groupBy"])(this.initialFilterDefinitions,"field"))})),"computed",{criterion:function(){var t=this;return"function"===this.filterType?this.filterFunctionInternal:"list"===this.filterType?(null!=this.filterListInternal&&Object.keys(this.initialFilterDefinitionMap).length>0&&(this.filterListInternal=this.filterListInternal.map((function(e){return Object.assign(e,t.initialFilterDefinitionMap[e.field][0])}))),this.filterListInternal):void 0},combinedCriterion:function(){return{filter:this.criterion,filterList:this.filterListInternal,filterFunction:this.filterFunctionInternal}}}),"methods",{onInitialFilterDefinition:function(t){this.initialFilterDefinitions.push(t)},filterControlChange:function(t,e){var n=Object(u["cloneDeep"])(this.filterListInternal);null===t||this.filterListInternal.map((function(t){return t.field})).includes(e.field)?e.multiple?null===t||this.filterListInternal.map((function(t){return t.threshold})).includes(t)||(this.filterListInternal=n.concat(Object(o["a"])({threshold:t},e))):e.multiple||(this.filterListInternal=n.map((function(n){if(n.field===e.field){var r=n;return r.threshold=t,r}return n}))):this.filterListInternal=n.concat(Object(o["a"])({threshold:t},e))},unsetFilter:function(t){this.filterListInternal=Object(d["e"])(this.filterListInternal,t)}}),"watch",{initialFilterDefinitions:{handler:function(){this.initialFilterDefinitions.length>0&&(this.initialFilterDefinitionMap=Object(u["groupBy"])(this.initialFilterDefinitions,"field"))},deep:!0},value:{handler:function(t){"function"===this.filterType?(this.filterFunctionInternal=t,Object(u["isEqual"])(t,this.filterFunctionInternal)||(this.filterFunctionInternal=t)):"list"===this.filterType&&(Object(u["isEqual"])(t,this.filterListInternal)||(this.filterListInternal=t))},deep:!0},filterList:{handler:function(t){this.filterListInternal=t},deep:!0},filterFunction:{handler:function(t){this.newFilterFunction=t},deep:!0},filterListInternal:{handler:function(t,e){var n=this;if(this.$emit("update:filter-list",t),t.length>0){var r=t.map((function(t){return n.makePredicate(t,{strictCase:n.strictCase,notStrictMatch:n.looseMatch})}));this.filterFunctionInternal=this.makeFilter(r,!!this.inclusive)}else this.filterFunctionInternal=function(t){return!0}},deep:!0},filterFunctionInternal:{handler:function(t){this.$emit("update:filter-function",t)},deep:!0},criterion:{handler:function(t,e){Object(u["isEqual"])(t,e)||this.$emit("input",t)},deep:!0}})),_=f,g=n("2877"),m=Object(g["a"])(_,r,a,!1,null,null,null);e["a"]=m.exports},e9e3:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("vue-typeahead-bootstrap",{ref:"phenotypeSelect",attrs:{placeholder:"Type in a phenotype ...",data:t.phenotypeOptions,seri
1alizer:function(t){return t.description},maxMatches:1e3,minMatchingChars:0,showOnFocus:!0},on:{hit:function(e){return t.onSecondaryPhenotypeSelected(e)}},scopedSlots:t._u([{key:"suggestion",fn:function(e){var r=e.data,a=e.htmlText;return[n("span",{domProps:{innerHTML:t._s(a)}}),t._v("Â "),n("small",{staticClass:"text-secondary"},[t._v(t._s(r.group))])]}}]),model:{value:t.userText,callback:function(e){t.userText=e},expression:"userText"}})],1)},a=[],i=(n("a4d3"),n("e01a"),n("14d9"),n("4e82"),n("2b0e")),o=n("5f5b"),s=n("b1e0"),l=n("d726");n("f9e3"),n("2dd8");i["default"].use(o["a"]),i["default"].use(s["b"]),i["default"].component("vue-typeahead-bootstrap",l["a"]);var c=i["default"].component("phenotype-picker",{props:{phenotypes:{type:Array,required:!0},clearOnSelected:{type:Boolean,required:!1},defaultSet:{type:String,required:!1},multipleselect:{type:Boolean,required:!1,default:!1},filterbadges:{type:Boolean,required:!1,default:!1}},data:function(){return{userText:this.defaultPhenotype||null}},computed:{phenotypeOptions:function(){return this.phenotypes?this.phenotypes.sort((function(t,e){return t.group<e.group?-1:e.group<t.group?1:t.description<e.description?-1:e.description<t.description?1:0})):[]}},methods:{onSecondaryPhenotypeSelected:function(t){this.$emit("secphenotypeAssociationGeneData",t),this.filterbadges=!0,this.clearOnSelected&&(this.userText="")},onSecondaryPhenotypeRemoved:function(t){this.$emit("updatePhenotypeList",t),this.clearOnSelected&&(this.userText="")},setFocus:function(){var t=this;this.$nextTick((function(){t.$refs.phenotypeSelect.$refs.input.focus()}))},addTag:function(t){var e={name:t,code:t.substring(0,2)+Math.floor(1e7*Math.random())};this.options.push(e),this.value.push(e)}}}),u=c,d=(n("966c"),n("2877")),h=Object(d["a"])(u,r,a,!1,null,null,null);e["a"]=h.exports},ea6f:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n(t.currentComponent,{tag:"component",attrs:{phenotypesInUse:t.phenotypesInUse,utilsBox:t.utilsBox,sectionConfigs:t.sectionConfigs}})],1)},a=[],i=n("2b0e"),o=n("1157"),s=n.n(o),l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"kc-hero"},[t._m(0),n("div",{staticClass:"overlay-window context-info"},[n("div",{staticClass:"overlay-window-close",attrs:{"data-info-el":"context-info"},on:{click:function(e){return t.hideInfoContent(e)}}},[t._v("â")]),t._v(" We defined "),n("a",{attrs:{href:"/research.html?pageid=KC_research_contexts"}},[t._v("four research contexts")]),t._v(" and then used a combination of Large Language Models (LLM) and manual curation to weight the relevance of the knowledge produced by each CFDE program to each context (for details, "),n("a",{attrs:{href:"/research.html?pageid=kc_documentation"}},[t._v("see here")]),t._v("). "),n("br"),t._v("Â Â Setting a research context will change the ordering of DCCs on each of the KC pages and also modify the text describing and contextualizing the results shown. "),n("br"),t._v("Â Â You can change or remove a research context on any page. ")]),n("div",{staticClass:"map-bg"},[t._m(1),n("div",{staticClass:"map-title2"},[n("span",[t._v("SET RESEARCH CONTEXT "),n("span",{staticClass:"btn-icon",attrs:{"data-info-el":"context-info"},on:{click:function(e){return t.showInfoContent(e)}}},[t._v(" ? ")])]),t._v(" To tailor information shown throughout the KC to a selected research area. ")]),n("div",{staticClass:"map-pov-message"},[t._v("Click to set context")]),this.parsedData?n("div",{staticClass:"map"},[n("div",{staticClass:"povs"},[t._m(2),t._l(this.parsedData[Object.keys(this.parsedData)[0]]["povs"],(function(e,r){return n("div",{staticClass:"pov",attrs:{"data-group":"povs","data-value":r},on:{mouseover:function(e){return t.hoverHandler2(e)},mousemove:function(e){return t.povMoveHandler(e)},mouseout:function(e){return t.outHandler(e)},click:function(e){return t.povHandler(e)}}},[n("div",{staticClass:"img"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/"+r+".svg"}})]),n("span",[t._v(t._s(r.replace("-"," ")))])])}))],2),t._m(3),n("div",{staticClass:"dccs"},[t._m(4),t._l(this.parsedData,(function(e,r,a){return[n("div",{staticClass:"dcc",attrs:{"data-group":"dccs","data-value":r},on:{mouseover:function(e){return t.hoverHandler(e)},mouseout:function(e){return t.outHandler(e)}}},[n("img",{attrs:{src:e["logo"]}})]),n("div",{staticClass:"dcc-separator"})]}))],2),n("div",{staticClass:"omics"},[t._m(5),t._l(this.parsedData[Object.keys(this.parsedData)[0]]["omics"],(function(e,r){return n("div",{staticClass:"omic",attrs:{"data-group":"omics","data-value":r},on:{mouseover:function(e){return t.hoverHandler2(e)},mouseout:function(e){return t.outHandler(e)}}},[n("span",[t._v(t._s(r))])])}))],2),n("div",{staticClass:"entities"},[t._m(6),t._l(this.parsedData[Object.keys(this.parsedData)[0]]["entities"],(function(e,r){return n("div",{staticClass:"entity",attrs:{"data-group":"entities","data-value":r},on:{mouseover:function(e){return t.hoverHandler2(e)},mouseout:function(e){return t.outHandler(e)}}},[n("span",[t._v(t._s(r))])])}))],2)]):t._e()]),t._m(7),n("div",{staticClass:"section section-search-kc"},[n("div",{staticClass:"map-title2 v2"},[n("span",[t._v("SEARCH THE KC")]),n("div",{staticClass:"search-context notset"},[t._v("Set "),n("span",{staticClass:"search-context-label"}
1,[t._v("genetics")]),t._v(" context?"),n("button",{on:{click:function(e){return t.setContext()}}},[t._v("yes")])]),t._m(8)]),n("research-single-search",{attrs:{"single-search-config":t.sectionConfigs["content"],phenotypes:t.phenotypesInUse,utils:t.utilsBox}}),t._m(9)],1)]),n("div",{staticClass:"section",attrs:{id:"kc-section-a"}},[n("div",{staticClass:"section-title"},[t._v("See curated summaries of knowledge from CFDE programs")]),n("div",{staticClass:"section-wrap"},[n("div",{staticClass:"section-col"},[n("div",{staticClass:"section-subtitle"},[t._v("Genes")]),n("div",{staticClass:"placeholder"},[n("div",{staticClass:"mini-card-video"},[n("video",{attrs:{"data-loop-max":"1","data-loop-count":"0",src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_tools/KC_gene_page_480.mp4",poster:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_tools/KC_gene_page.jpg",autoplay:"",muted:"",playsinline:""},domProps:{muted:!0},on:{ended:function(e){return t.minVidEnd(e)},mouseover:function(e){return t.minVidHover(e)},mouseout:function(e){return t.minVidHoverOut(e)}}})])])]),n("div",{staticClass:"section-col"},[n("div",{staticClass:"section-subtitle"},[t._v("Diseases")]),n("div",{staticClass:"placeholder"},[n("div",{staticClass:"mini-card-video"},[n("video",{attrs:{"data-loop-max":"1","data-loop-count":"0",src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_tools/KC_disease_page_480.mp4",poster:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_tools/KC_disease_page.jpg",autoplay:"",muted:"",playsinline:""},domProps:{muted:!0},on:{ended:function(e){return t.minVidEnd(e)},mouseover:function(e){return t.minVidHover(e)},mouseout:function(e){return t.minVidHoverOut(e)}}})])])])])]),n("div",{staticClass:"section",attrs:{id:"kc-section-b"}},[n("div",{staticClass:"section-title"},[t._v("Knowledge about CFDE programs and partnerships")]),n("div",{staticClass:"section-wrap"},[n("div",{staticClass:"section-col"},[n("div",{staticClass:"section-subtitle"},[t._v("CFDE programs")]),n("div",{staticClass:"placeholder"},[n("div",{staticClass:"mini-card-video"},[n("a",{attrs:{href:"/research.html?pageid=kc_dccs"}},[n("video",{attrs:{"data-loop-max":"1","data-loop-count":"0",src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_tools/Landing_DCCs_480.mp4",poster:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_tools/Landing_DCCs.jpg",autoplay:"",muted:"",playsinline:""},domProps:{muted:!0},on:{ended:function(e){return t.minVidEnd(e)},mouseover:function(e){return t.minVidHover(e)},mouseout:function(e){return t.minVidHoverOut(e)}}})])])])]),t._m(10)])]),t._m(11)])},c=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"kc-wrap"},[n("div",{staticClass:"blurb"},[n("div",{staticClass:"logo"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/cfde_kc_logo_c.svg"}})]),n("div",[n("span",{staticClass:"highlight"},[t._v("The Knowledge Center")]),t._v(" integrates data and knowledge generated by ground-breaking research programs in the NIH Common Fund Data Ecosystem. "),n("span",[t._v("Use the KC to see curated and precomputed analyses of data within and across Common Fund projects.")])])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"map-title boxed",staticStyle:{display:"none"}},[n("span",[t._v("> ")]),t._v("Explore the diagram with your mouse to see connections between research programs, their omics data types and biological entities, with relevance to different research contexts. "),n("div",{staticClass:"how"},[t._v("Source"),n("span",{staticClass:"btn-icon"},[t._v("?")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"map-label hideable"},[n("div",[t._v("Research Context")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"line2"},[n("div",{staticClass:"map-label hideable"},[n("div",[n("div",[t._v("Relevance")]),n("div",{staticClass:"relevance-legend"},[n("div",{staticClass:"relevance-hi"},[t._v("high")]),n("div",{staticClass:"relevance-md"},[t._v("med")]),n("div",{staticClass:"relevance-lo"},[t._v("low")])])])]),n("div",{staticClass:"line2info"}),n("div",{staticClass:"line2note"})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"map-label hideable"},[n("div",[t._v("Common Fund Programs")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"map-label hideable"},[n("div",[t._v("Omics Data")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"map-label hideable"},[n("div",[t._v("Searchable Entities")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"section section-search-drc"},[n("div",{staticClass:"section-title"},[n("div",{staticClass:"drc-logo"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/DRC_logo.png"}})]),t._v("CFDE WORKBENCH")]),n("div",{staticClass:"section-wrap"},[n("div",{staticClass:"section-col"},[n("div",{staticClass:"section-subtitle"},[t._v("Visit our sister resource to query, access, and compute Common Fund datasets.")]),n("a",{attrs:{href:"https://data.cfde.cloud/",target:"_blank"}},[t._v("Visit CFDE WORKBENCH")])])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"search-context set"},[t._v("Help text and results order will be tailored to a "),n("span",{staticClass:"search-context-label"}
vendor: 4,366 bytes, line 1
1,[t._v("genetics")]),t._v(" use case.")])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"search-extras"},[n("div",{staticClass:"search-try"},[n("span",[t._v("Try")]),n("a",{attrs:{href:"/research.html?entity=gene&gene=BDH2&pageid=kc_entity&tissue=blood"}},[t._v("BDH2")]),n("a",{attrs:{href:"/research.html?disease=MONDO%3A0004985&entity=disease&pageid=kc_entity&tissue=blood"}},[t._v("Bipolar disorder")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"section-col"},[n("div",{staticClass:"section-subtitle"},[t._v("Partnerships")]),n("div",{staticClass:"placeholder"},[t._v("(coming soon)")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"section",attrs:{id:"kc-section-c"}},[n("div",{staticClass:"section-title"},[n("div",{staticClass:"drc-logo"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/DRC_logo.png"}})]),t._v("CFDE WORKBENCH")]),n("div",{staticClass:"section-wrap"},[n("div",{staticClass:"section-col"},[n("div",{staticClass:"section-subtitle"},[t._v("Visit our sister resource to query, access, and compute Common Fund datasets.")]),n("ul",[n("li",[t._v("Search across all Common Fund metadata and processed data.")]),n("li",[t._v("Cloud tools to interrogate data sets from various Common Fund programs.")]),n("li",[t._v("Training and outreach to highlight Common Fund data and how to use it effectively.")])]),n("a",{attrs:{href:"https://data.cfde.cloud/",target:"_blank"}},[t._v("Visit CFDE WORKBENCH")])])])])}],u=n("53ca"),d=n("3835"),h=n("1da1"),p=(n("d9e2"),n("99af"),n("14d9"),n("fb6a"),n("b0c0"),n("4fad"),n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("0c47"),n("23dc"),n("3410"),n("1f68"),n("131a"),n("d3b7"),n("ac1f"),n("3ca3"),n("466d"),n("5319"),n("841c"),n("498a"),n("0643"),n("4e3e"),n("159b"),n("ddb0"),n("9861"),n("88a7"),n("271a"),n("5494"),n("e0a9"),n("b1e0"));function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",_="suspendedYield",g="executing",m="completed",v={};function y(){}function b(){}function x(){}var w={};c(w,o,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,o)&&(w=P);var k=x.prototype=y.prototype=Object.create(w);function M(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,i,o,s){var l=h(t[a],t,i);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==Object(u["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(d).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===g)throw Error("Generator is already running");if(a===m){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?m:_,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=m,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(u["a"])(e)+" is not iterable")}return b.prototype=x,a(k,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=c(x,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),c(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),c(k,l,"Generator"),c(k,o,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}i["default"].use(p["a"]);var _=i["default"].component("cfde-eco-system",{props:["sectionConfigs","phenotypesInUse","utilsBox","keyParams"],data:function(){return{parsedData:null,currPov:null,currHoverGroup:null,freezeSelection:!1}},mounted:function(){var t=this;this.loadScript("https://cdn.jsdelivr.net/npm/[email protected]/leader-line.min.js",Object(h["a"])(f().mark((function e(){var n;return f().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.loadFile(t.sectionConfigs["content"]["custom"]["viz data"]);case 2:return n=e.sent,e.next=5,t.parseEntities(n);case 5:t.parsedData=e.sent,setTimeout((function(){var t=new URLSearchParams(document.location.search),e=t.get("context"),n=e?e.replace("_","-"):"genetics",r=document.querySelector('[data-value="'.concat(n,'"]'));r&&(r.dispatchEvent(new Event("mouseover")),r.dispatchEvent(new Event("click")),r.dispatchEvent(new Event("mouseout")))}),100);case 7:case"end":return e.stop()}}),e)}))))},computed:{},watch:{},updated:function(){},methods:{loadScript:function(t,e){return new Promise((function(n,r){var a=document.createElement("script");a.src=t,a.async=!0,a.onload=function(){e&&e(),n()},a.onerror=r,document.head.appendChild(a)}))},loadFile:function(t){return Object(h["a"])(f().mark((function e(){var n,r;return f().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n="https://hugeampkpncms.org/servedata/dataset?dataset="+t,e.next=3,fetch(n).then((function(t){return t.text(n)}));case 3:return r=e.sent,r=r.replace(/\\u0022/g,'"'),r=r.replace(/\\\//g,"/"),r=r.replace(/\\n
1/g,"\n"),r=r.replace(/\\r/g,"\r"),r=r.substring(1,r.length-1),e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)})))()},parseEntities:function(t){return Object(h["a"])(f().mark((function e(){var n,r,a,i,o,s,l,c,u,h,p,_;return f().wrap((function(e){while(1)switch(e.prev=e.next){case 0:n=t.split("\n"),r=n[0].split(","),a={},i=1;case 4:if(!(i<n.length)){e.next=42;break}o=n[i].match(/(".*?"|[^",\r\n]+|(?<=,)(?=,))/g),s=o[0],a[s]={entities:{},omics:{},povs:{},logo:"",info:{}},l=1;case 9:if(!(l<r.length)){e.next=39;break}if(c=r[l].split("_"),u=Object(d["a"])(c,2),h=u[0],p=u[1],!h||!p){e.next=36;break}if(_=void 0,"a"!==h){e.next=17;break}_="entities",e.next=35;break;case 17:if("b"!==h){e.next=21;break}_="omics",e.next=35;break;case 21:if("c"!==h){e.next=25;break}_="povs",e.next=35;break;case 25:if("d"!==h){e.next=31;break}return _="logo",a[s][_]=o[l],e.abrupt("continue",36);case 31:if("r"!==h){e.next=35;break}return _="info",a[s][_][p.trim()]=o[l],e.abrupt("continue",36);case 35:a[s][_][p.trim()]=o[l]?parseInt(o[l]):null;case 36:l++,e.next=9;break;case 39:i++,e.next=4;break;case 42:return e.abrupt("return",a);case 43:case"end":return e.stop()}}),e)})))()},outHandler:function(t){if(this.freezeSelection){document.querySelectorAll("[data-group]").forEach((function(t){return t.classList.remove("on","on2","on3")}));var e=document.querySelector('[data-value="'.concat(this.currPov,'"]'));e&&e.dispatchEvent(new Event("mouseover"))}else document.querySelectorAll("[data-group]").forEach((function(t){return t.classList.remove("on","on2","on3","onA","on2A","on3A")})),document.querySelectorAll(".leader-line").forEach((function(t){return t.remove()})),document.querySelector(".dccs").classList.remove("active");document.querySelector(".omics").classList.remove("active"),this.currHoverGroup=null,document.querySelector(".line2info").innerHTML="",document.querySelector(".line2note").classList.remove("hidden"),document.querySelector(".map-pov-message").style.display="none"},hoverHandler:function(t){var e=t.target.dataset.value;if(document.querySelector(".line2note").classList.add("hidden"),this.currPov&&(document.querySelector(".line2info").innerHTML='<div><span style="font-weight:bold">'.concat(e,"</span> ").concat(this.parsedData[e]["info"][this.currPov].replace(/['"]+/g,""),"</div>")),"entities"!==this.currHoverGroup)for(var n=0,r=Object.entries(this.parsedData[e]["entities"]);n<r.length;n++){var a=Object(d["a"])(r[n],2),i=a[0],o=a[1];o&&document.querySelector('[data-value="'.concat(i,'"]')).classList.add("on")}if("omics"!==this.currHoverGroup){document.querySelector(".omics").classList.add("active");for(var s=0,l=Object.entries(this.parsedData[e]["omics"]);s<l.length;s++){var c=Object(d["a"])(l[s],2),u=c[0],h=c[1];h&&document.querySelector('[data-value="'.concat(u,'"]')).classList.add("on")}}if("povs"!==this.currHoverGroup)for(var p=0,f=Object.entries(this.parsedData[e]["povs"]);p<f.length;p++){var _=Object(d["a"])(f[p],2),g=_[0],m=_[1];if(m){document.querySelector('[data-value="'.concat(g,'"]'));if(1===m&&!this.freezeSelection)new LeaderLine(t.target,document.querySelector('[data-value="'.concat(g,'"]')),{startSocket:"top",endSocket:"bottom",startPlug:"behind",endPlug:"behind",endSocketGravity:100,path:"fluid",gradient:{endColor:"#ff7f5090",startColor:"#ff7f5090"},dash:{len:2,gap:1,animation:!1},size:1});if(2===m&&!this.freezeSelection)new LeaderLine(t.target,document.querySelector('[data-value="'.concat(g,'"]')),{startSocket:"top",endSocket:"bottom",startPlug:"behind",endPlug:"behind",endSocketGravity:80,path:"fluid",gradient:{endColor:"#ff7f5090",startColor:"#ff7f5090"},dash:{len:4,gap:2,animation:!1},size:2});if(3===m&&!this.freezeSelection)new LeaderLine(t.target,document.querySelector('[data-value="'.concat(g,'"]')),{startSocket:"top",endSocket:"bottom",startPlug:"behind",endPlug:"behind",endSocketGravity:60,path:"fluid",gradient:{endColor:"#ff7f5090",startColor:"#ff7f5090"},dash:{len:6,gap:3,animation:!1},size:3})}}},hoverHandler2:function(t){var e=t.target.dataset.group,n=t.target.dataset.value;this.currHoverGroup=e,"povs"===e&&(document.querySelector(".dccs").classList.add("active"),document.querySelector(".line2note").classList.add("hidden"),this.freezeSelection&&document.querySelectorAll(".leader-line").forEach((function(t){return t.remove()})),t.target.classList.contains("selected")||(document.querySelector(".map-pov-message").style.display="block"));for(var r=0,a=Object.entries(this.parsedData);r<a.length;r++){var i=Object(d["a"])(a[r],2),o=i[0],s=i[1],l=document.querySelector('[data-value="'.concat(o,'"]'));if(1===s[e][n])if("povs"===e){l.classList.add("onA");new LeaderLine(document.querySelector('[data-value="'.concat(o,'"]')),t.target,{startSocket:"top",endSocket:"bottom",startPlug:"behind",startPlugColor:"#34679a",endPlug:"behind",endSocketGravity:100,path:"fluid",gradient:{startColor:"#ff7f5090",endColor:"#ff7f5090"},dash:{len:2,gap:1,animation:!1},size:1})}else l.classList.add("on");if(2===s[e][n])if("povs"===e){l.classList.add("on2A");new LeaderLine(document.querySelector('[data-value="'.concat(o,'"]')),t.target,{startSocket:"top",endSocket:"bottom",startPlug:"behind",startPlugColor:"#34679a",endPlug:"behind",endSocketGravity:80,path:"fluid",gradient:{startColor:"#ff7f5090",endColor:"#ff7f5090"},dash:{len:4,gap:2,animation:!1},size:2})}else l.classList.add("on2");if(3===s[e][n])if("povs"===e){l.classList.add("on3A");new LeaderLine(document.querySelector('[data-value="'.concat(o,'"]')),t.target,{startSocket:"top",endSocket:"bottom",startPlug:"behind",startPlugColor:"#34679a",endPlug:"behind",endSocketGravity:60,path:"fluid",gradient:{startColor:"#ff7f5090",endColor:"#ff7f5090"},dash:{len:6,gap:3,animation:!1},size:3})}else l.classList.add("on3")}},povMoveHandler:function(t){var e=document.querySelector(".map-pov-message");e.style.top=t.clientY-90+"px",e.style.left=t.clientX+10+"px"},povHandler:function(t){t.target.dataset.group;var e=t.target.dataset.value;if(t.target.classList.contains("selected"))t.target.classList.remove("selected"),document.querySelector(".line2").classList.remove("open"),document.querySelector(".dccs").classList.remove("active"),document.querySelectorAll(".search-context-label").forEach((function(t){return t.innerHTML="none"})),"computational-biology"===e&&(document.querySelector(".section-search-drc").style.display="none",document.querySelector(".section-search-kc").style.display="flex"),this.currPov=null,this.freezeSelection=!1,this.utilsBox.userUtils.clearContext("_context_cfde"),this.utilsBox.keyParams.set({context:""});else{document.querySelectorAll('[data-group="povs"]').forEach((function(t){t.classList.remove("selected")})),t.target.classList.add("selected"),document.querySelector(".line2").classList.add("open"),document.querySelector(".dccs").classList.add("active"),document.querySelectorAll(".search-context-label").forEach((function(t){return t.innerHTML=e}));var n=this.utilsBox.userUtils.getContext("_context_cfde")?this.utilsBox.userUtils.getContext("_context_cfde").replace("_","-"):null;n&&n===e?(document.querySelector(".search-context.set").style.display="block",document.querySelector(".search-context.notset").style.display="none"):(document.querySelector(".search-context.set").style.display="none",document.querySelector(".search-context.notset").style.display="block"),"computational-biology"===e?(document.querySelector(".section-search-drc").style.display="flex",document.querySelector(".section-search-kc").style.display="none"):(document.querySelector(".section-search-drc").style.display="none",document.querySelector(".section-search-kc").style.display="flex"),this.currPov=e,this.freezeSelection=!0}
1},setContext:function(t){if(this.currPov&&"computational-biology"!==this.currPov){var e=this.currPov.toLowerCase().replace("-","_");this.utilsBox.userUtils.saveContext("_context_cfde",e),this.utilsBox.keyParams.set({context:e}),document.querySelector(".search-context.set").style.display="block",document.querySelector(".search-context.notset").style.display="none"}},loadCSV:function(t){return Object(h["a"])(f().mark((function e(){return f().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,fetch(t).then((function(t){if(!t.ok)throw new Error("Network response was not ok")})).catch((function(t){}));case 2:case"end":return e.stop()}}),e)})))()},minVidEnd:function(t){t.target.dataset.loopCount++,t.target.dataset.loopCount<t.target.dataset.loopMax?t.target.play():t.target.classList.add("paused")},minVidHover:function(t){t.target.classList.contains("paused")&&t.target.play()},minVidHoverOut:function(t){t.target.classList.contains("paused")&&t.target.pause()},showInfoContent:function(t){var e=document.querySelector(".".concat(t.target.dataset.infoEl));e.style.top=t.clientY-90+"px",e.style.left=t.clientX+10+"px",e.style.display="block"},hideInfoContent:function(t){var e=document.querySelector(".".concat(t.target.dataset.infoEl));e.style.top=t.clientY-90+"px",e.style.left=t.clientX+10+"px",e.style.display="none"}}});s()((function(){}));var g=_,m=n("2877"),v=Object(m["a"])(g,l,c,!1,null,null,null),y=v.exports,b=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"kc-home flex-layout-styles"},[t._m(0),n("div",{staticClass:"search-wrapper f-col align-h-center"},[n("h1",{staticClass:"kc"},[t._v("Search Common Fund Knowledge")]),n("div",{staticClass:"f-col fill-width"},[n("research-single-search-cfde",{attrs:{"single-search-config":t.sectionConfigs["content"],phenotypes:t.phenotypesInUse,utils:t.utilsBox}}),t.sectionConfigs["content"]["search examples"]?n("div",{staticClass:"search-extras f-row"},[n("div",{staticClass:"f-row",staticStyle:{gap:"5px"}},[t._v(" Try "),t._l(t.sectionConfigs["content"]["search examples"],(function(e){return[n("a",{attrs:{href:e.url}},[t._v(t._s(e.value))])]}))],2)]):t._e()],1),t._m(1)]),n("div",{staticClass:"home-section-container",staticStyle:{"padding-top":"40px"}},[this.parsedData?n("div",{staticClass:"hero-wrapper f-col"},[n("div",{staticClass:"hero-q",staticStyle:{top:"0px"},on:{click:this.toggleCFinfo}},[t._v(" What is the Common Fund? ")]),n("div",{staticClass:"cf-intro f-col align-h-center"},[n("h2",{staticClass:"kc"},[t._v(" "+t._s(Object.keys(this.parsedData.map).length)+" Common Fund Programs ")]),n("div",[t._v(" Conducting groundbreaking research across diverse fields ")])]),t._m(2),n("div",{staticClass:"cfp-info f-col fill-width"},[t._m(3),n("div",{staticClass:"dcc-icons-contain"},[n("div",{staticClass:"dcc-icons f-row"},[t._l(this.parsedData.map,(function(e,r,a){return[n("div",{staticClass:"dcc-icon",attrs:{"data-group":"dccs","data-value":r},on:{mouseover:function(e){return t.hoverHandler(e)},mouseout:function(e){return t.outHandler(e)},click:function(e){return t.clickDcc(e)}}},[n("img",{attrs:{src:e["logo"]}})])]}))],2)])]),n("div",{staticClass:"cfde-info f-col fill-width align-h-center"},[n("div",{staticClass:"arrw"},[t._v("â¤")]),n("div",{staticClass:"hero-q",on:{click:this.toggleCFDEinfo}},[t._v(" What is the CDFE? ")]),t._m(4),t._m(5),n("div",{staticClass:"f-col",staticStyle:{gap:"20px",width:"100%"}},[n("div",{staticClass:"eco-row f-col"},[n("div",{staticClass:"eco-title"},[t._v("Omics")]),n("div",{staticClass:"omics f-row fill-width spread-out",staticStyle:{gap:"5px"}},t._l(this.parsedData.sets["omics"],(function(e,r){return n("div",{staticClass:"omic",attrs:{"data-group":"omics","data-value":e},on:{mouseover:function(e){return t.hoverHandler2(e)},mouseout:function(e){return t.outHandler(e)}}},[n("span",[t._v(t._s(e))])])})),0)]),n("div",{staticClass:"eco-row f-col"},[n("div",{staticClass:"eco-title"},[t._v("Entities")]),n("div",{staticClass:"entities f-row fill-width spread-out",staticStyle:{gap:"5px"}},t._l(this.parsedData.sets["entities"],(function(e,r){return n("div",{staticClass:"entity",attrs:{"data-group":"entities","data-value":e},on:{mouseover:function(e){return t.hoverHandler2(e)},mouseout:function(e){return t.outHandler(e)}}},[n("span",[t._v(t._s(e))])])})),0)])])])]):t._e()]),n("div",{staticClass:"home-section-container"},[n("h3",{staticClass:"section-title"},[t._v("Browse")]),n("div",{staticClass:"home-section-wrap"},[n("h3",{staticClass:"kc"},[t._v("Examples of CFDE Knowledge")]),n("div",[t._v(" Secondary analyses created by The Knowledge Center using Common Fund data ")]),n("div",{staticClass:"home-section"},[t._l(this.examplesData,(function(e){return[n("div",{staticClass:"example-item f-col",staticStyle:{gap:"20px"}},[n("div",{staticClass:"f-row",staticStyle:{gap:"20px"}},[n("div",{staticClass:"f-col",staticStyle:{width:"40%",gap:"20px"}},[n("div",[n("div",{staticClass:"example-item-type"},[t._v(" Program ")]),n("div",{staticClass:"f-row align-v-center",staticStyle:{gap:"10px"}},[n("div",{staticClass:"example-item-logo"},[n("img",{attrs:{src:e.logo}})]),n("div",{staticClass:"example-item-name"},[t._v(" "+t._s(e.name)+" ")])])]),n("div",[n("div",{staticClass:"example-item-type"},[t._v(" Analysis ")]),n("div",{staticClass:"example-item-analysis"},[t._v(" "+t._s(e.analysis)+" ")])]),n("div",{staticClass:"f-row"},[n("div",{staticClass:"example-item-analysis"},[t._v(" See on "),n("a",{attrs:{href:"/r/kc_entity_"+e.type.toLowerCase()+"?entity="+e.type.toLowerCase()+"&"+e.type.toLowerCase()+"="+e.entity}},[t._v(t._s(e.type))]),t._v(" page ")])])]),n("div",{staticClass:"f-col",staticStyle:{width:"calc(60% - 20px)"}},[n("div",{staticClass:"example-item-image f-col align-v-center"},[n("img",{attrs:{src:e.example}})])])])])]})),n("div",{staticClass:"spotlight-prev",attrs:{"data-dir":"prev"},on:{click:this.changeExample}},[n("svg",{attrs:{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"#7c7c7c","stroke-width":"1.2"}},[n("path",{attrs:{d:"M5.707 9.71a1 1 0 0 0 0 1.415l4.892 4.887a2 2 0 0 0 2.828 0l4.89-4.89a1 1 0 1 0-1.414-1.415l-4.185 4.186a1 1 0 0 1-1.415 0L7.121 9.71a1 1 0 0 0-1.414 0Z",fill:"#7c7c7c"}})])]),n("div",{staticClass:"spotlight-next",attrs:{"data-dir":"next"},on:{click:this.changeExample}},[n("svg",{attrs:{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"#7c7c7c","stroke-width":"1.2"}},[n("path",{attrs:{d:"M5.707 9.71a1 1 0 0 0 0 1.415l4.892 4.887a2 2 0 0 0 2.828 0l4.89-4.89a1 1 0 1 0-1.414-1.415l-4.185 4.186a1 1 0 0 1-1.415 0L7.121 9.71a1 1 0 0 0-1.414 0Z",fill:"#7c7c7c"}})])])],2)])]),t._m(6),n("div",{staticClass:"home-section-container",staticStyle:{gap:"40px"}},[n("h3",{staticClass:"section-title"},[t._v("More")]),n("div",{staticClass:"f-row grow-children",staticStyle:{gap:"60px"}},[n("div",{staticClass:"f-col",staticStyle:{gap:"40px"}},[this.parsedData?n("div",{staticClass:"home-section-wrap"},[n("h3",{staticClass:"kc"},[t._v("Common Fund Program Spotlight")]),n("div",{staticClass:"home-section"},[t._l(this.parsedData.map,(function(e,r){return[n("div",{staticClass:"spotlight-item"},[n("div",{staticClass:"spotlight-logo f-row"},[n("img",{attrs:{src:e.logo}})]),n("div",{staticClass:"f-col fill-width"},[n("div",{staticClass:"spotlight-text f-col fill-height"},[n("h3",[t._v(t._s(e.name))]),n("div",{domProps:{innerHTML:t._s(e.spotlight)}})]),n("a",{staticStyle:{"align-self":"flex-end"},attrs:{href:"/r/kc_programs?DCC="+r}},[t._v("Learn More")])])])]})),n("div",{staticClass:"spotlight-prev",attrs:{"data-dir":"prev"},on:{click:this.changeSpotlight}},[n("svg",{attrs:{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"#7c7c7c","stroke-width":"1.2"}},[n("path",{attrs:{d:"M5.707 9.71a1 1 0 0 0 0 1.415l4.892 4.887a2 2 0 0 0 2.828 0l4.89-4.89a1 1 0 1 0-1.414-1.415l-4.185 4.186a1 1 0 0 1-1.415 0L7.121 9.71a1 1 0 0 0-1.414 0Z",fill:"#7c7c7c"}})])]),n("div",{staticClass:"spotlight-next",attrs:{"data-dir":"next"},on:{click:this.changeSpotlight}},[n("svg",{attrs:{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"#7c7c7c","stroke-width":"1.2"}},[n("path",{attrs:{d:"M5.707 9.71a1 1 0 0 0 0 1.415l4.892 4.887a2 2 0 0 0 2.828 0l4.89-4.89a1 1 0 1 0-1.414-1.415l-4.185 4.186a1 1 0 0 1-1.415 0L7.121 9.71a1 1 0 0 0-1.414 0Z",fill:"#7c7c7c"}})])])],2)]):t._e(),this.parsedData?n("div",{staticClass:"home-section-wrap"},[n("h3",{staticClass:"kc"},[t._v("CFDE Workbench")]),t._m(7)]):t._e()]),this.newsFeed?n("div",{staticClass:"home-section-wrap"},[n("h3",{staticClass:"kc"},[t._v("Knowledge Center News")]),n("div",{staticClass:"home-section f-col",staticStyle:{"padding-top":"30px"}},[t._l(this.newsFeed,(function(e){return n("div",{staticClass:"news-item f-row"},[n("div",{staticClass:"thumbnail",domProps:{innerHTML:t._s(e.field_thumbnail_image)}}),n("div",{staticClass:"f-col"},[n("a",{attrs:{href:"/r/kc_news_item?id="+e.nid}},[n("h3",{},[t._v(t._s(e.title))])]),n("div",{domProps:{innerHTML:t._s(e.body)}})])])})),n("a",{staticStyle:{"align-self":"flex-end"},attrs:{href:"/r/kc_news"}},[t._v("See All News")])],2)]):t._e()])]),n("div",{staticClass:"f-tooltip top",staticStyle:{to
1p:"0",left:"50px",width:"200px",height:"100px"}}),n("div",{staticClass:"f-tooltip right",staticStyle:{top:"0",left:"300px",width:"200px",height:"100px"}}),n("div",{staticClass:"f-tooltip bottom",staticStyle:{top:"0",left:"550px",width:"200px",height:"100px"}}),n("div",{staticClass:"f-tooltip left",staticStyle:{top:"0",left:"800px",width:"200px",height:"100px"}})])},x=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"logo f-row"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/cfde_kc_logo_c.svg"}}),n("span",{staticStyle:{"font-size":"16px"}},[n("strong",[n("span",{staticStyle:{color:"#f26822"}},[t._v("The Knowledge Center ")]),t._v(" (KC) integrates data and knowledge generated by ground-breaking research programs in the NIH Common Fund Data Ecosystem.")]),t._v(" Use the KC to see curated and precomputed analyses of data within and across Common Fund projects. ")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"map-info"},[n("div",{staticClass:"f-col"},[n("div",{staticClass:"map-info-title"}),n("div",{staticClass:"map-info-subtitle"}),n("div",{staticClass:"map-info-body"})])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cf-info",staticStyle:{display:"none"}},[n("h2",{staticClass:"kc"},[t._v("The Common Fund")]),n("div",[n("b",[t._v("The Common Fund (CF)")]),t._v(" is a program within the National Institutes of Health (NIH) designed to support innovative, high-impact research that transcends the mission of any single NIH institute or center. "),n("a",{attrs:{href:"https://commonfund.nih.gov/",target:"_blank"}},[t._v("Learn more.")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"dcc-info",staticStyle:{display:"none"}},[n("h3",{staticClass:"kc"},[t._v(" Common Fund Programs ")]),n("div",[n("b",[t._v("CF Programs")]),t._v(" are large-scale, trans-NIH research initiatives designed to address significant biomedical challenges that no single NIH institute or center can tackle alone. ")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cfde-title f-col align-h-center"},[n("h2",{staticClass:"kc"},[t._v("1 Data Ecosystem")]),n("div",[t._v(" Allowing researchers to easily find, access, and integrate Common Fund datasets ")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"what-cfde-info",staticStyle:{display:"none"}},[n("h3",{staticClass:"kc"},[t._v("Common Fund Data Ecosystem")]),n("div",[n("b",[t._v("The Common Fund Data Ecosystem (CFDE)")]),t._v(" is an initiative under the NIH Common Fund that aims to enhance the accessibility, interoperability, and usability of data generated by Common Fund programs."),n("br"),n("a",{attrs:{href:"https://info.cfde.cloud",target:"_blank"}},[t._v("Learn more about the data within the CFDE.")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home-section-container"},[n("h3",{staticClass:"section-title"},[t._v("Analyze")]),n("div",{staticClass:"home-section-wrap"},[n("h3",{staticClass:"kc"},[t._v("Knowledge Center Workflows")]),n("div",{staticClass:"f-row grow-children",staticStyle:{gap:"20px"}},[n("div",{staticClass:"home-section f-col"},[n("div",{staticClass:"analysis-figure"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/m2h.png"}})]),n("h2",[t._v("Mouse Phenotypes to Human Phenotypes Analysis")]),n("div",{staticStyle:{flex:"1"}},[t._v(" Discover mouse phenotypes genetically linked to human traits â using statistical enrichment, not just similarity. ")]),n("div",{staticClass:"f-row spread-out"},[n("a",{staticStyle:{"align-self":"flex-start"},attrs:{href:"/r/kc_phenotype_x_mouse2hs"}},[t._v("Explore Mouse")]),n("a",{staticStyle:{"align-self":"flex-end"},attrs:{href:"/r/kc_phenotype_x_hs2mouse"}},[t._v("Explore Human")])])]),n("div",{staticClass:"home-section f-col"},[n("div",{staticClass:"analysis-figure"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/gene_set.png"}})]),n("h2",[t._v("Gene Set Analysis")]),n("div",{staticStyle:{flex:"1"}},[t._v(" Uncover gene set patterns across integrated Common Fund programsâdesigned for advanced cross-dataset exploration. ")]),n("a",{staticStyle:{"align-self":"flex-end"},attrs:{href:"/r/kc_gene_set_browser_source?source=all&model=cfde"}},[t._v("Start here")])]),n("div",{staticClass:"home-section f-col"},[n("div",{staticClass:"analysis-figure"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/dge.png"}})]),n("h2",[t._v("Differential Expression Analysis")]),n("div",{staticStyle:{flex:"1"}},[t._v(" Compare differentially expressed genes across tissues and diseases, driving insights into gene regulation and disease mechanisms. ")]),n("a",{staticStyle:{"align-self":"flex-end"},attrs:{href:"/r/kc_dge_top_20?q=1&source=kc_diffexp"}},[t._v("Start here")])])])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home-section"},[n("div",{staticClass:"f-row",staticStyle:{gap:"20px"}},[n("div",{staticClass:"drc-logo"},[n("img",{attrs:{src:"https://hugeampkpncms.org/sites/default/files/users/user32/kc_icons/DRC_logo.png"}})]),n("div",{staticClass:"f-col"},[n("div",[t._v(" Visit our sister resource to query, access, and compute Common Fund datasets. ")]),n("ul",[n("li",[t._v(" Search across all Common Fund metadata and processed data. ")]),n("li",[t._v(" Cloud tools to interrogate data sets from various Common Fund programs. ")]),n("li",[t._v(" Training and outreach to highlight Common Fund data and how to use it effectively. ")])]),n("div",{staticClass:"drc-link"},[n("a",{attrs:{href:"https://data.cfde.cloud/",target:"_blank"}},[t._v("Visit CFDE Workbench")])])])])])}];n("7db0"),n("a630"),n("caad"),n("d81d"),n("4e82"),n("b64b"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("fffc"),n("a573");function w(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */w=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:D(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};c(x,o,(function(){return this}));var C=Object.getPrototypeOf,P=C&&C(C(A([])));P&&P!==n&&r.call(P,o)&&(x=P);var k=b.prototype=v.prototype=Object.create(x);function M(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(a,i,o,s){var l=h(t[a],t,i);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==Object(u["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(d).then((function(t){c.value=t,o(c)}),(function(t){return n("throw",t,o,s)}))}s(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function D(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
vendor: 4,295 bytes, line 1
1(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(u["a"])(e)+" is not iterable")}return y.prototype=b,a(k,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},M(E.prototype),c(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new E(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},M(k),c(k,l,"Generator"),c(k,o,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}i["default"].use(p["a"]);
1var C=i["default"].component("cfde-landing",{props:["sectionConfigs","phenotypesInUse","utilsBox","keyParams"],data:function(){return{parsedData:null,examplesData:null,currPov:null,currHoverGroup:null,freezeSelection:!1,cfInfoToggle:!1,cfdeInfoToggle:!1,lines:[],sectionTitles:[],spotlightInterval:null,examplesInterval:null,currSpotlight:-1,currExample:-1,dccsSorted:[],newsFeed:null,domObserver:null,headerLoaded:!1}},mounted:function(){var t=this;this.domObserver=new MutationObserver((function(e){e.forEach((function(e){t.headerLoaded||t.onDomChange()}))})),this.domObserver.observe(document.querySelector(".research-header-menu-wrapper"),{childList:!0,subtree:!1}),window.addEventListener("resize",this.handleResize),window.addEventListener("scroll",this.highlightTopmostTitle),this.init()},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize),window.addEventListener("scroll",this.highlightTopmostTitle)},computed:{},watch:{},updated:function(){},methods:{onDomChange:function(){this.headerLoaded=!0,this.parsedData&&this.drawArrows(),this.domObserver.disconnect()},init:function(){var t=this;return Object(h["a"])(w().mark((function e(){var n,r,a,i,o,s;return w().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n="https://hugeampkpncms.org/servedata/dataset?dataset=",r=t.sectionConfigs["content"]["custom"]["viz data"],e.next=4,t.loadFile(n+r);case 4:return a=e.sent,e.next=7,JSON.parse(a);case 7:if(i=e.sent,t.parsedData=t.parseData(i),t.examplesData=t.parseExamples(i),t.headerLoaded&&t.drawArrows(),t.sectionTitles=document.querySelectorAll(".section-title"),t.highlightTopmostTitle(),o=t.sectionConfigs["content"]["custom"]["news feed"],!o){e.next=21;break}return e.next=17,t.loadFile(o);case 17:s=e.sent,s.length>5&&(s.length=5),s.forEach((function(t){var e;t.field_thumbnail_image=(null===(e=(new DOMParser).parseFromString(t.field_thumbnail_image,"text/html").querySelector("img"))||void 0===e?void 0:e.outerHTML)||""})),t.newsFeed=s;case 21:case"end":return e.stop()}}),e)})))()},loadFile:function(t){return Object(h["a"])(w().mark((function e(){var n,r;return w().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t,e.next=3,fetch(n).then((function(t){return t.json()}));case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})))()},parseData:function(t){var e={},n={programs:new Set,resources:new Set,omics:new Set,entities:new Set};t.forEach((function(t){var r=t["dcc"];e[r]={logo:t["logo"]||"",name:t["name"]||"",omics:t["omics"]||[],entities:t["entities"]||[],info:t["short description"]||"",spotlight:t["spotlight"]||""},n.programs.add(r),(t["omics"]||[]).forEach((function(t){return n.omics.add(t)})),(t["entities"]||[]).forEach((function(t){return n.entities.add(t)}))}));var r={programs:Array.from(n.programs),omics:Array.from(n.omics).sort(),entities:Array.from(n.entities).sort()};return{map:e,sets:r}},parseExamples:function(t){var e=[];return t.forEach((function(t){t["dcc"];""!=t["examples"]["gene_analysis"]&&""!=t["examples"]["gene_example"]&&e.push({type:"gene",logo:t["logo"]||"",name:t["name"]||"",analysis:t["examples"]["gene_analysis"],example:t["examples"]["gene_example"],entity:t["examples"]["example_gene"]}),""!=t["examples"]["disease_analysis"]&&""!=t["examples"]["disease_example"]&&e.push({type:"disease",logo:t["logo"]||"",name:t["name"]||"",analysis:t["examples"]["disease_analysis"],example:t["examples"]["disease_example"],entity:t["examples"]["example_disease"]})})),this.shuffleArray(e)},shuffleArray:function(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(Math.random()*(e+1)),r=[t[n],t[e]];t[e]=r[0],t[n]=r[1]}return t},drawArrows:function(){var t=this;setTimeout((function(){var e=t.getNodePoints();t.renderEdges(e),t.changeExample(null),t.changeSpotlight(null),t.spotlightInterval=setInterval((function(){t.changeSpotlight(null)}),1e4),t.examplesInterval=setInterval((function(){t.changeExample(null)}),1e4),setTimeout((function(){t.simulateMouseOverSequence()}),200)}),100)},drawEdge:function(t,e,n,r){var a=20,i=t.x,o=e.x,s=t.y,l=e.y,c=i<o?-1:1,u=s<l?-1:1,d=i===o?0:a;e.x<t.x&&(i=e.x,o=t.x,c=o<i?-1:1),i-=n,o+=n;var h=document.createElementNS("http://www.w3.org/2000/svg","svg"),p=Math.abs(i-o),f=Math.abs(s-l);h.style.position="absolute",h.style.left=i+"px",h.style.top=s+"px",h.style.width=p+"px",h.style.height=f+"px",h.setAttribute("viewBox","0 0 ".concat(p," ").concat(f)),h.classList.add("line-svg"),document.body.append(h);var _=document.createElementNS("http://www.w3.org/2000/svg","path"),g=n,m=o-i-n,v=0,y=l-s,b=(y-v)/2;e.x<t.x&&(g=o-i-n,m=n);var x="M ".concat(g," ").concat(v);x+=" V ".concat(b-d),x+=" Q ".concat(g," ").concat(b,", ").concat(g-d*c," ").concat(b),x+=" H ".concat(m+d*c),x+=" Q ".concat(m," ").concat(b,", ").concat(m," ").concat(b-d*u),x+=" V ".concat(y),_.setAttribute("data-value",r),_.setAttribute("d",x),_.setAttribute("stroke","#f26822"),_.setAttribute("fill","transparent"),_.setAttribute("stroke-width",n),h.appendChild(_),this.lines.push(_)},renderEdges:function(t){var e=this;document.querySelectorAll(".line-svg").forEach((function(t){t.remove()})),t.forEach((function(t){e.drawEdge(t.from_point,t.to_point,1,t.value)})),document.querySelector(".arrw").style.display="block"},getNodePoints:function(){var t=document.querySelectorAll(".dcc-icon"),e=document.querySelector(".cfde-info");function n(t){var e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.bottom+window.scrollY}}function r(t){var e=t.getBoundingClientRect();return{x:e.left+e.width/2,y:e.top+window.scrollY}}var a=r(e),i=Array.from(t).map((function(t){return{value:t.dataset.value,from_point:n(t),to_point:a}}));return i},handleResize:function(){var t=this.getNodePoints();this.renderEdges(t)},toggleCFinfo:function(t){this.cfInfoToggle?(t.target.innerHTML="What is the Common Fund?",document.querySelector(".cf-intro").style.display="flex",document.querySelector(".cf-info").style.display="none",document.querySelector(".dcc-info").style.display="none",this.cfInfoToggle=!1):(t.target.innerHTML="close â",document.querySelector(".cf-intro").style.display="none",document.querySelector(".cf-info").style.display="block",document.querySelector(".dcc-info").style.display="block",this.cfInfoToggle=!0),this.handleResize()},toggleCFDEinfo:function(t){this.cfdeInfoToggle?(t.target.innerHTML="What is the CFDE?",document.querySelector(".cfde-title").style.display="flex",document.querySelector(".what-cfde-info").style.display="none",this.cfdeInfoToggle=!1):(t.target.innerHTML="close â",document.querySelector(".cfde-title").style.display="none",document.querySelector(".what-cfde-info").style.display="block",this.cfdeInfoToggle=!0),this.handleResize()},clickDcc:function(t){var e=t.target.dataset.value;window.location.href="/r/kc_programs?DCC=".concat(e)},outHandler:function(t){if(this.freezeSelection){document.querySelectorAll("[data-group]").forEach((function(t){return t.classList.remove("on","on2","on3")}));var e=document.querySelector('[data-value="'.concat(this.currPov,'"]'));e&&e.dispatchEvent(new Event("mouseover"))}else document.querySelectorAll("[data-group]").forEach((function(t){return t.classList.remove("on","on2","on3","onA","on2A","on3A")}
1)),this.lines.forEach((function(t){t.setAttribute("stroke","#f26822"),t.parentNode.style.zIndex=0})),document.querySelector(".map-info").style.opacity=0;this.currHoverGroup=null},hoverHandler:function(t){var e=t.target.dataset.value;this.lines.forEach((function(t){t.dataset.value!==e?t.setAttribute("stroke","#ddd"):t.parentNode.style.zIndex=1})),"omics"!==this.currHoverGroup&&this.parsedData.map[e]["omics"].forEach((function(t){t&&document.querySelector('.omics [data-value="'.concat(t,'"]')).classList.add("on")})),"entities"!==this.currHoverGroup&&this.parsedData.map[e]["entities"].forEach((function(t){t&&document.querySelector('.entities [data-value="'.concat(t,'"]')).classList.add("on")})),t.isTrusted&&(document.querySelector(".map-info").style.opacity=1,this.mapTooltip("Program",this.parsedData.map[e].name,this.parsedData.map[e].info))},hoverHandler2:function(t){var e=this;clearTimeout(this.mapInfoTimeout);var n=t.target.dataset.group,r=t.target.dataset.value;this.currHoverGroup=n,this.lines.forEach((function(t){t.setAttribute("stroke","#ddd")}));for(var a=function(){var t=Object(d["a"])(o[i],2),a=t[0],s=t[1],l=document.querySelector('[data-value="'.concat(a,'"]'));if(s[n].includes(r)){l.classList.add("on");var c=e.lines.find((function(t){return t.dataset.value===a}));c.setAttribute("stroke","#f26822"),c.parentNode.style.zIndex=1}2===s[n][r]&&l.classList.add("on2"),3===s[n][r]&&l.classList.add("on3")},i=0,o=Object.entries(this.parsedData.map);i<o.length;i++)a()},mapTooltip:function(t,e,n){document.querySelector(".map-info-title").innerHTML=t,document.querySelector(".map-info-subtitle").innerHTML=e,document.querySelector(".map-info-body").innerHTML=n},triggerMouseEvent:function(t,e){var n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(n)},simulateMouseOverSequence:function(){var t=this,e=150,n=document.querySelectorAll(".dcc-icon"),r=null;
1n.forEach((function(a,i){setTimeout((function(){r&&(t.triggerMouseEvent(a,"mouseout"),a.classList.remove("on")),t.triggerMouseEvent(a,"mouseover"),a.classList.add("on"),r=a,i===n.length-1&&setTimeout((function(){t.triggerMouseEvent(a,"mouseout"),a.classList.remove("on")}),e)}),i*e)}))},changeSpotlight:function(t){var e=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},n=this.currSpotlight,r=Object.keys(this.parsedData.map).length,a="next";null!==t&&void 0!==t&&t.target&&(clearInterval(this.spotlightInterval),a=t.target.dataset.dir),n>0?document.querySelector(".spotlight-item:nth-of-type(".concat(this.currSpotlight,")")).classList.remove("active"):n=e(1,r),n="next"===a?n>=r?1:n+1:n<=1?r:n-1,this.currSpotlight=n,document.querySelector(".spotlight-item:nth-child(".concat(this.currSpotlight,")")).classList.add("active")},changeExample:function(t){var e=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},n=this.currExample,r=this.examplesData.length,a="next";null!==t&&void 0!==t&&t.target&&(clearInterval(this.examplesInterval),a=t.target.dataset.dir),n>0?document.querySelector(".example-item:nth-of-type(".concat(this.currExample,")")).classList.remove("active"):n=e(1,r),n="next"===a?n>=r?1:n+1:n<=1?r:n-1,this.currExample=n,document.querySelector(".example-item:nth-child(".concat(this.currExample,")")).classList.add("active")},highlightSections:function(){var t=document.querySelectorAll(".section-title"),e={root:null,rootMargin:"-45% 0px -55% 0px",threshold:0},n=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&(t.forEach((function(t){return t.classList.remove("active")})),e.target.classList.add("active"))}))}),e);t.forEach((function(t){return n.observe(t)}))},highlightTopmostTitle:function(){var t=null,e=1/0;
1this.sectionTitles.forEach((function(n){var r=n.getBoundingClientRect(),a=Math.abs(r.top);r.top>=0&&a<e&&(e=a,t=n)})),t&&(this.sectionTitles.forEach((function(t){return t.classList.remove("active")})),t.classList.add("active"))}}}),P=C,k=(n("0fd5"),Object(m["a"])(P,b,x,!1,null,"2f977061",null)),M=k.exports,E=n("7c4d"),D=i["default"].component("research-section-components",{props:["component","phenotypesInUse","utilsBox","sectionConfigs"],components:{cfdeEcoSystem:y,cfdeLanding:M,GiantGemPkg:E["a"]},data:function(){return{currentComponent:null}},modules:{},mounted:function(){switch(this.component){case"cfdeEcoSystem":this.currentComponent=y;break;case"cfdeLanding":this.currentComponent=M;break;case"GiantGemPkg":this.currentComponent=E["a"];break}},computed:{},watch:{},methods:{}});s()((function(){}));var O=D,L=Object(m["a"])(O,r,a,!1,null,null,null);e["a"]=L.exports},eabe:function(t,e,n){},eba1:function(t,e,n){},ecb1:function(t,e,n){"use strict";n("93ba")},ecb6:function(t,e,n){"use strict";n("1343")},edb2:function(t,e,n){},efd6:function(t,e,n){"use strict";n("01d3")},f080:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"filtering-ui-wrapper container-fluid search-header"},[n("div",{staticClass:"row filtering-ui-content search-header-content",attrs:{id:"pageSearchHeaderContent"}},[t._t("default")],2)])},a=[],i=n("5530"),o=n("2b0e"),s=n("a282"),l=o["default"].component("search-header-wrapper",{props:["datasetInfo"],mounted:function(){window.addEventListener("scroll",this.onScroll)},beforeDestroy:function(){window.removeEventListener("scroll",this.onScroll)},computed:{tableTop:function(){var t=document.getElementsByClassName("search-header")[0],e=t.getBoundingClientRect(),n=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop,r=e.top+n;return r}},methods:Object(i["a"])(Object(i["a"])({},s["a"]),{},{onScroll:function(t){var e=window.top.scrollY,n=document.getElementsByClassName("search-header")[0];e>this.tableTop?n.classList.contains("fixed-header")||n.classList.add("fixed-header"):n.classList.contains("fixed-header")&&n.classList.remove("fixed-header")}})}),c=l,u=n("2877"),d=Object(u["a"])(c,r,a,!1,null,null,null);e["a"]=d.exports},f0da:function(t,e,n){"use strict";n("cb74")},f124:function(module,__webpack_exports__,__webpack_require__){"use strict";var _home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("3835"),_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("2909"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("a4d3"),core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("e01a"),core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("99af"),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("cb29"),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("4de4"),core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("caad"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("14d9"),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("fb6a"),core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("4e82"),core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_es_array_sort_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_12__),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("e9c4"),core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_13___default=__webpack_require__.n(core_js_modules_es_json_stringify_js__WEBPACK_IMPORTED_MODULE_13__),
1core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("6b93"),core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(core_js_modules_es_math_log10_js__WEBPACK_IMPORTED_MODULE_14__),core_js_modules_es_math_sign_js__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("2af1"),core_js_modules_es_math_sign_js__WEBPACK_IMPORTED_MODULE_15___default=__webpack_require__.n(core_js_modules_es_math_sign_js__WEBPACK_IMPORTED_MODULE_15__),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("a9e3"),core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_16__),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("4fad"),core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_17__),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("b64b"),core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_18__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_19___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_19__),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("6062"),core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_20___default=__webpack_require__.n(core_js_modules_es_set_js__WEBPACK_IMPORTED_MODULE_20__),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("1e70"),core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_21___default=__webpack_require__.n(core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_21__),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("79a4"),core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_22__),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("c1a1"),core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_23___default=__webpack_require__.n(core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_23__),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_24__=__webpack_require__("8b00"),core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_24___default=__webpack_require__.n(core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_24__),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_25__=__webpack_require__("a4e7"),core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_25___default=__webpack_require__.n(core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_25__),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_26__=__webpack_require__("1e5a"),core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_26___default=__webpack_require__.n(core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_26__),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_27__=__webpack_require__("72c3"),core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_27___default=__webpack_require__.n(core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_27__),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_28__=__webpack_require__("2532"),core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_28___default=__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_28__),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_29__=__webpack_require__("3ca3"),core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_29___default=__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_29__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_30__=__webpack_require__("0643"),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_30___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_30__),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_31__=__webpack_require__("2382"),core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_31___default=__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_31__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_32__=__webpack_require__("4e3e"),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_32___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_32__),
1core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_33__=__webpack_require__("a573"),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_33___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_33__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_34__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_34___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_34__),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_35__=__webpack_require__("ddb0"),core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_35___default=__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_35__),vue__WEBPACK_IMPORTED_MODULE_36__=__webpack_require__("2b0e"),lodash__WEBPACK_IMPORTED_MODULE_37__=__webpack_require__("2ef0"),lodash__WEBPACK_IMPORTED_MODULE_37___default=__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_37__),bootstrap_vue__WEBPACK_IMPORTED_MODULE_38__=__webpack_require__("b1e0"),_utils_bioIndexUtils__WEBPACK_IMPORTED_MODULE_39__=__webpack_require__("e60d"),_components_researchPortal_vectorPlots_ResearchPheWasPlotVector_vue__WEBPACK_IMPORTED_MODULE_40__=__webpack_require__("cf0e");vue__WEBPACK_IMPORTED_MODULE_36__["default"].use(bootstrap_vue__WEBPACK_IMPORTED_MODULE_38__["a"]),__webpack_exports__["a"]=vue__WEBPACK_IMPORTED_MODULE_36__["default"].component("ResearchPhewasPlot",{components:{pheWasPlotVector:_components_researchPortal_vectorPlots_ResearchPheWasPlotVector_vue__WEBPACK_IMPORTED_MODULE_40__["a"]},props:["canvasId","phenotypeMap","phenotypesData","renderConfig","pkgData","pkgDataSelected","colors","plotMargin","filter","options","sectionId","sectionId","utils","plotName","top1500","linkPhenotypes","isPigean","matchingHoverDots"],data:function(){return{pheWasData:null,pheWasPosData:{},spaceBy:7,trigger:0,hoverItems:{},showCanvas:!0}},modules:{},computed:{greaterThan:function(){return!!this.renderConfig["label in black"]&&"greater than"===this.renderConfig["label in black"]},phenotypeMapConfig:function(){return"null"==this.renderConfig["phenotype map"]?null:"kp phenotype map"==this.renderConfig["phenotype map"]?"kpPhenotypeMap":null},renderData:function(){var t=this;this.showCanvas=!0;var e={data:[]};if(this.phenotypesData){var n=Object(lodash__WEBPACK_IMPORTED_MODULE_37__["cloneDeep"])(this.phenotypesData);n.forEach((function(e){e["rawPValue"]=t.getPValue(e)})),n=n.sort((function(t,e){return t.rawPValue-e.rawPValue})),this.top1500&&(n=n.slice(0,1500)),this.greaterThan&&n.reverse(),n.map((function(n){1!=t.renderConfig["convert y -log10"]&&"true"!=t.renderConfig["convert y -log10"]||(n[t.renderConfig["y axis field"]+"-log10"]=-Math.log10(n["rawPValue"])),("kpPhenotypeMap"==t.phenotypeMapConfig&&t.phenotypeMap[n[t.renderConfig["render by"]]]||null==t.phenotypeMapConfig)&&e["data"].push(n)}))}return this.filter&&(e.data=e.data.filter(this.filter)),e.data&&e.data.length>0?e:(this.showCanvas=!1,null)},adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:10}:{left:this.plotMargin.leftMargin,right:this.plotMargin.rightMargin,top:this.plotMargin.topMargin,bottom:this.plotMargin.bottomMargin,bump:this.plotMargin.bump};return e}},watch:{renderData:function(t){this.renderPheWas()}},created:function(){this.renderPheWas()},mounted:function(){window.addEventListener("resize",this.onResize),this.renderPheWas()},beforeDestroy:function(){window.removeEventListener("resize",this.onResize)},methods:{getPValue:function(t){return"string"==typeof t[this.renderConfig["y axis field"]]?Number(t[this.renderConfig["y axis field"]]):t[this.renderConfig["y axis field"]]},downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.canvasId+"_pheWasPlot"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_pheWas_plot_"+this.canvasId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},openPage:function(t,e){this.utils.uiUtils.openPage(t,e)},addPhenotype:function(t){this.$parent.$parent.pushCriterionPhenotype(t),window.location.href="#associations-table"},groupData:function(t){var e=this,n=[],r={};if(null==this.phenotypeMapConfig)n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(t.data.map((function(t){return t[e.renderConfig["group by"]]})))).sort();else{for(var a=0,i=Object.entries(this.phenotypeMap);a<i.length;a++){var o=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(i[a],2),s=(o[0],o[1]);n.push(s)}n=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__["a"])(new Set(n.map((function(t){return t.group})))).sort()}return n.map((function(t){r[t]=[]})),t.data.map((function(t){var n="kpPhenotypeMap"==e.phenotypeMapConfig&&e.phenotypeMap[t[e.renderConfig["render by"]]]?e.phenotypeMap[t[e.renderConfig["render by"]]].group:t[e.renderConfig["group by"]];r[n].push(t)})),r},onResize:function(){this.renderPheWas()},checkPosition:function(t,e){var n=this,r=t,a=r.target.getBoundingClientRect(),i=r.clientX-a.left,o=r.clientY-a.top,s=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,l=s?{left:s.left,right:s.right,top:s.top,bottom:s.bottom,bump:10}:{left:this.plotMargin.leftMargin/2,right:this.plotMargin.leftMargin/2*1.5,top:this.plotMargin.bottomMargin/2*3.5,bottom:this.plotMargin.bottomMargin/2*2.5,bump:10},c=Math.ceil(r.clientY-a.top),u=Math.ceil(r.clientX-a.left),d=document.querySelector("#"+this.canvasId+"pheWasInfoBox"),h=(document.querySelector("#"+this.canvasId+"pheWasInfoBoxContent"),document.querySelector("#"+this.canvasId+"info_box_close"));if(0==d.getAttribute("class").includes("fixed")){var p="";if(this.hoverItems={},u>=l.left/2&&u<=a.width-l.right/2)for(var f=0,_=Object.entries(this.pheWasPosData);f<_.length;f++){var g=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_[f],2),m=g[0],v=g[1],y=m.split("-");c>=y[0]&&c<=y[1]&&v.map((function(t){u>=t.start&&u<=t.end&&(n.hoverItems[t.id]=t,p+="<strong>".concat(t.name,"</strong><br />"),n.renderConfig["hover content"].map((function(e){p+=e+":"+t.data[e]+"<br />"})))}))}"hover"==e&&(Object.keys(this.hoverItems).length>0&&this.isPigean&&this.$emit("dotsHovered",JSON.stringify(this.hoverItems)),""==p?0==d.getAttribute("class").includes("fixed")&&(
1d.setAttribute("class","hidden"),h.setAttribute("class","hidden")):0==d.getAttribute("class").includes("fixed")&&(d.setAttribute("class","phe-was-info-box"),h.setAttribute("class","hidden"),u<a.width-300?(d.style.left=i+25+"px",d.style.top=o+this.spaceBy+"px"):(d.style.left=i-325+"px",d.style.width="300px !important",d.style.top=o+this.spaceBy+"px"))),"click"==e&&(h.setAttribute("class","fixed-info-box-close"),""==p?d.setAttribute("class","hidden"):(d.setAttribute("class","phe-was-info-box fixed"),u<a.width-300?(d.style.left=i+25+"px",d.style.top=o+this.spaceBy+"px"):(d.style.left=i-325+"px",d.style.width="300px !important",d.style.top=o+this.spaceBy+"px")))}},renderPheWas:function renderPheWas(){var _this4=this;if(this.renderConfig["thresholds"]&&"calculate"==this.renderConfig["thresholds"]){var threshholds=[];this.renderConfig["thresholds calculate"].map((function(expression){var calcString="";expression.map((function(t){var e=["+","-","*","/","(",")"].includes(t)||"number"===typeof t?t:"string"===typeof t&&"data length"==t?_this4.renderData.data.length:null;calcString+=e}));var threshold=eval(calcString);threshholds.push(threshold)})),this.renderConfig["thresholds"]=threshholds}var wrapper=document.querySelector("#"+this.canvasId+"pheWasPlotWrapper"),canvas=document.querySelector("#"+this.canvasId+"pheWasPlot");if(canvas&&wrapper){var canvasWidth=this.renderConfig.width?2*this.renderConfig.width:2*wrapper.clientWidth,canvasHeight=2*Number(this.renderConfig["height"]),c,ctx;c=document.querySelector("#"+this.canvasId+"pheWasPlot"),c.setAttribute("width",canvasWidth),c.setAttribute("height",canvasHeight),c.setAttribute("style","width:"+canvasWidth/2+"px;height:"+canvasHeight/2+"px;"),ctx=c.getContext("2d"),ctx.clearRect(0,0,canvasWidth,canvasHeight),this.pheWasPosData={};for(var renderData=this.groupData(this.renderData),groups={},totalNum=0,minY=null,maxY=null,_i3=0,_Object$entries3=Object.entries(renderData);_i3<_Object$entries3.length;_i3++){var _Object$entries3$_i=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries3[_i3],2),key=_Object$entries3$_i[0],value=_Object$entries3$_i[1];groups[key]=value.length,totalNum+=value.length,value.map((function(t){var e="true"==_this4.renderConfig["convert y -log10"]?t[_this4.renderConfig["y axis field"]+"-log10"]:Number(t[_this4.renderConfig["y axis field"]]);minY=null==minY||e<minY?e:minY,maxY=null==maxY||e>maxY?e:maxY}))}minY=Math.floor(minY),maxY=Math.ceil(maxY),minY==maxY&&(minY-=.5,maxY+=.5),ctx.stroke();var customPlotMargin=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,plotMargin=customPlotMargin?{left:customPlotMargin.left,right:customPlotMargin.right,top:customPlotMargin.top,bottom:customPlotMargin.bottom,bump:10}:{left:this.plotMargin.leftMargin/2,right:this.plotMargin.leftMargin/2*1.5,top:this.plotMargin.bottomMargin/2*3.5,bottom:this.plotMargin.bottomMargin/2*2.5,bump:10};this.renderData.data.length>1&&this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"y",5,minY,maxY,this.renderConfig["y axis label"]),this.utils.plotUtils.renderAxisWBump(ctx,canvasWidth,canvasHeight,plotMargin,"x",null,null,null,this.renderConfig["x axis label"]),this.renderTicksByGroup(ctx,canvasWidth,canvasHeight,plotMargin,"x",groups);var xStep=(canvasWidth-plotMargin.left-plotMargin.right)/totalNum,yMax=maxY,yMin=minY,yStep=(canvasHeight-(plotMargin.top+plotMargin.bottom))/(yMax-yMin);this.renderConfig["thresholds"].map((function(t){ctx.beginPath();var e="true"==_this4.renderConfig["convert y -log10"]?-Math.log10(Number(t)):Number(t),n=-minY+e,r=canvasHeight-plotMargin.bottom-n*yStep;ctx.setLineDash([20,10]),ctx.moveTo(plotMargin.left-plotMargin.bump,r),ctx.lineTo(canvasWidth+plotMargin.bump-plotMargin.right,r),ctx.strokeStyle="#FFAA00",ctx.lineWidth=2,ctx.stroke(),ctx.closePath()})),ctx.setLineDash([]);var groupsArr=Object.keys(groups).sort(),dotIndex=0,pigeanColors={};if(totalNum>1)for(var _loop=function(){var t=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries4[_i4],2),e=t[0],n=t[1],r=groupsArr.indexOf(e)%_this4.colors.length,a=_this4.colors[r],i="#00000075";pigeanColors[e]=a;var o=0,s=0,l=plotMargin.left+xStep*dotIndex+xStep*n.length-24;n.map((function(t){if(null==_this4.phenotypeMapConfig||"kpPhenotypeMap"==_this4.phenotypeMapConfig&&_this4.phenotypeMap[t[_this4.renderConfig["render by"]]]){var e=plotMargin.left+xStep*(dotIndex+.5),n="true"==_this4.renderConfig["convert y -log10"]?t[_this4.renderConfig["y axis field"]+"-log10"]:t[_this4.renderConfig["y axis field"]]&&0!=t[_this4.renderConfig["y axis field"]]?t[_this4.renderConfig["y axis field"]]:0,r=-minY+n,c=canvasHeight-plotMargin.bottom-r*yStep,u=t[_this4.renderConfig["render by"]],d=null==_this4.phenotypeMapConfig?u:_this4.phenotypeMap[u]["description"],h=_this4.greaterThan?t.rawPValue>=Number(_this4.renderConfig["thresholds"][0]):t.rawPValue<=Number(_this4.renderConfig["thresholds"][0]);"null"!=_this4.renderConfig["beta field"]&&_this4.renderConfig["beta field"]&&t[_this4.renderConfig["beta field"]]&&0!=t[_this4.renderConfig["beta field"]]?_this4.renderTriangle(ctx,e,c,a,i,Math.sign(t[_this4.renderConfig["beta field"]])):_this4.renderDot(ctx,e,c,a,i);var p=Math.round(c/2)-5,f=Math.round(c/2)+5,_=p+"-"+f,g={};_this4.renderConfig["hover content"].map((function(e){g[e]=t[e]}));
1var m={start:Math.round(e/2)-5,end:Math.round(e/2)+5,data:g,name:d,id:t[_this4.renderConfig["render by"]]};_this4.pheWasPosData[_]||(_this4.pheWasPosData[_]=[]),_this4.pheWasPosData[_].push(m),0==o&&(s=e);var v=s+24*o;v=e>v?e:v,(0==o||v<l)&&(ctx.font="22px Arial",ctx.fillStyle=h?"#000000":"#00000050",ctx.save(),ctx.translate(v+10,c-24),ctx.rotate(90*-Math.PI/180),ctx.textAlign="start",ctx.fillText(d,0,0),ctx.restore(),ctx.lineWidth=1,ctx.moveTo(e,c),ctx.lineTo(v,c-20),ctx.strokeStyle="#00000080",ctx.stroke()),o++,dotIndex++}})),r++},_i4=0,_Object$entries4=Object.entries(renderData);_i4<_Object$entries4.length;_i4++)_loop();else for(var _loop2=function(){var t=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_Object$entries5[_i5],2),e=t[0],n=t[1],r=groupsArr.indexOf(e)%_this4.colors.length,a=_this4.colors[r];pigeanColors[e]=a;var i="#00000075";n.map((function(t){var e=canvasWidth/2,n=canvasHeight/2;if(null==_this4.phenotypeMapConfig||"kpPhenotypeMap"==_this4.phenotypeMapConfig&&_this4.phenotypeMap[t[_this4.renderConfig["render by"]]]){t[_this4.renderConfig["beta field"]]&&0!=t[_this4.renderConfig["beta field"]]?_this4.renderTriangle(ctx,e,n,a,i,Math.sign(t[_this4.renderConfig["beta field"]])):_this4.renderDot(ctx,e,n,a,i);var r=null==_this4.phenotypeMapConfig?t[_this4.renderConfig["render by"]]:_this4.phenotypeMap[t[_this4.renderConfig["render by"]]]["description"],o=Math.round(n)-5,s=Math.round(n)+5,l=o+"-"+s,c={};_this4.renderConfig["hover content"].map((function(e){c[e]=t[e]}));var u={start:Math.round(e)-5,end:Math.round(e)+5,data:c,name:r};_this4.pheWasPosData[l]||(_this4.pheWasPosData[l]=[]),_this4.pheWasPosData[l].push(u),ctx.font="26px Arial",ctx.fillStyle="#000000",ctx.textAlign="start",ctx.fillText(r,e+15,n);var d=1;_this4.renderConfig["hover content"].map((function(r){ctx.fillText(r+": "+t[r],e+15,n+40*d),d++}))}}))},_i5=0,_Object$entries5=Object.entries(renderData);_i5<_Object$entries5.length;_i5++)_loop2();this.$emit("pigeanColors",pigeanColors)}},renderDot:function(t,e,n,r,a){t.beginPath(),t.arc(e,n,10,0,2*Math.PI),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTriangle:function(t,e,n,r,a,i){t.beginPath(),1==i&&(t.moveTo(e-10,n+10),t.lineTo(e+10,n+10),t.lineTo(e,n-10)),-1==i&&(t.moveTo(e-10,n-10),t.lineTo(e,n+10),t.lineTo(e+10,n-10)),t.closePath(),t.fillStyle=r,t.fill(),t.lineWidth=1,t.strokeStyle=a,t.stroke()},renderTicksByGroup:function(t,e,n,r,a,i){for(var o=Object.keys(i).sort(),s=0,l=0,c=Object.entries(i);l<c.length;l++){var u=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(c[l],2),d=(u[0],u[1]);s+=d}switch(t.beginPath(),t.lineWidth=1,t.strokeStyle="#000000",t.font="22px Arial",t.fillStyle="#000000",t.setLineDash([]),a){case"x":for(var h=(e-r.left-r.right)/s,p=0,f=0,_=Object.entries(i);f<_.length;f++){var g=Object(_home_ec2_user_jenkins_workspace_Portal_Release_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["a"])(_[f],2),m=g[0],v=g[1];if(v>0){var y=r.left+(p+.5)*h,b=Math.floor(y);t.moveTo(b,n-r.bottom+r.bump),t.lineTo(b,n-r.bottom+2*r.bump),t.stroke();var x=o.indexOf(m)%this.colors.length;t.fillStyle=this.colors[x],t.save(),t.translate(b,n-r.bottom+2*r.bump),t.rotate(45*Math.PI/180),t.textAlign="start",t.fillText(m,0,15),t.restore(),p+=v}}break;case"y":break}},checkStared:function(t){var e=this,n=this.pkgDataSelected.filter((function(t){return t.type==e.renderConfig["star key"]})).map((function(t){return t.id}));return!!n.includes(t)},addStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"add"})},removeStarItem:function(t){this.$store.dispatch("pkgDataSelected",{type:this.renderConfig["star key"],id:t,action:"remove"})},phenotypeLink:function(t){var e="/phenotype.html?phenotype=".concat(t);if(this.isPigean){var n="&genesetSize=".concat(this.$store.state.genesetSize||_utils_bioIndexUtils__WEBPACK_IMPORTED_MODULE_39__["d"].DEFAULT_GENESET_SIZE,"&traitGroup=").concat(this.$store.state.traitGroup||_utils_bioIndexUtils__WEBPACK_IMPORTED_MODULE_39__["d"].DEFAULT_TRAIT_GROUP);e="/pigean".concat(e).concat(n)}return e}}})},f14c:function(t,e,n){"use strict";n("6d76")},f1d1:function(t,e,n){"use strict";n("c7e1")},f278:function(t,e,n){"use strict";n("b544")},f2fd:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("span",{staticClass:"greater-less-filter"},[n("select",{directives:[{name:"model",rawName:"v-model",value:t.filterGreater,expression:"filterGreater"}],staticClass:"form-control form-control-sm",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,
1(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.filterGreater=e.target.multiple?n:n[0]}}},[n("option",{domProps:{value:!0}},[t._v("â¥")]),n("option",{domProps:{value:!1}},[t._v("â¤")])]),n("filter-control-template",{attrs:{field:t.field,type:"number",predicate:function(e,n){return t.filterGreater?e>=n:e<=n},pillFormatter:function(e){return t.filterGreater?t.label+" ⥠"+e.threshold:t.label+" ⤠"+e.threshold},placeholder:t.label+" "+(t.filterGreater?"â¥":"â¤"),color:t.color,computedField:t.computedField,multiple:!1}},[t._t("default",(function(){return[t._v(t._s(t.field))]}))],2)],1)},a=[],i=(n("99af"),n("2b0e")),o=n("27d5"),s=i["default"].component("filter-greater-less",{props:{field:String,label:String,computedField:Function,predicate:{type:Function,default:function(t,e){return t>=e}},pillFormatter:{type:Function,default:function(t){return"".concat(t.field," ⥠").concat(t.threshold)}},color:{type:String},placeholder:String},components:{FilterControlTemplate:o["a"]},data:function(){return{filterGreater:!0}}}),l=s,c=(n("7927"),n("2877")),u=Object(c["a"])(l,r,a,!1,null,"68ff145d",null);e["a"]=u.exports},f31a:function(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("99af"),core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("cb29"),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("caad"),core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("a15b"),core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("d81d"),core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("14d9"),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("ac1f"),core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_7__),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("5319"),core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_8__),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("0643"),core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_9__),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("4e3e"),core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_10__),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("a573"),core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_11__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_12___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_12__),vue__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("2b0e"),jquery__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("1157"),jquery__WEBPACK_IMPORTED_MODULE_14___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_14__),bootstrap_vue__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("b1e0"),_components_researchPortal_vectorPlots_ResearchVolcanoPlotVector_vue__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("5d63");vue__WEBPACK_IMPORTED_MODULE_13__["default"].use(bootstrap_vue__WEBPACK_IMPORTED_MODULE_15__["a"]),__webpack_exports__["a"]=vue__WEBPACK_IMPORTED_MODULE_13__["default"].component("research-volcano-plot",{props:["plotData","renderConfig","geneOfInterest","utils","sectionId","colors"],data:function(){return{posData:{}}},modules:{},components:{volcanoPlotVector:_components_researchPortal_vectorPlots_ResearchVolcanoPlotVector_vue__WEBPACK_IMPORTED_MODULE_16__["a"]}
1,mounted:function(){this.renderPlot()},computed:{adjPlotMargin:function(){var t=this.renderConfig["plot margin"]?this.renderConfig["plot margin"]:null,e=t?{left:t.left,right:t.right,top:t.top,bottom:t.bottom,bump:t.bump?t.bump:5}:{left:80,right:20,top:20,bottom:60,bump:5};return e},renderingGene:function(){return this.geneOfInterest},renderData:function(){var t=this,e=this.plotData,n=[];return e.map((function(e){var r,a={};a[t.renderConfig["render by"]]=e[t.renderConfig["render by"]],a[t.renderConfig["x axis field"]]=e[t.renderConfig["x axis field"]],a[t.renderConfig["y axis field"]]=e[t.renderConfig["y axis field"]],null===(r=t.renderConfig["on hover"])||void 0===r||r.forEach((function(t){a[t]=e[t]})),n.push(a)})),n}},watch:{renderData:function(){this.clearPlot(),this.renderPlot()},renderingGene:function(){this.clearPlot(),this.renderPlot()}},methods:{downloadImage:function(t,e,n){"svg"==n?(this.$refs[this.sectionId+"_volcanoPlot"].renderPlot(),this.utils.uiUtils.downloadImg(t,e,n,"vector_volcano_plot_"+this.sectionId)):"png"==n&&this.utils.uiUtils.downloadImg(t,e,n)},hidePanel:function(){this.utils.uiUtils.hideElement("clicked_dot_value"+this.sectionId)},filterTable:function(){var t=document.getElementById("clicked_dot_value"+this.sectionId);if(""!=t.innerText){var e=t.innerText.split("\n"),n=document.getElementById("filter_"+this.renderConfig["render by"].replace(/ /g,""));n&&(n.value=e.join(", "))}},checkPosition:function(t){var e=this,n=document.getElementById("clicked_dot_value"+this.sectionId);n.classList.remove("hidden");var r=t,a=document.getElementById("volcanoPlot"+this.sectionId).getBoundingClientRect(),i=Math.floor(r.clientX-a.left),o=Math.floor(r.clientY-a.top),s=document.getElementById("volcanoPlot"+this.sectionId);n.style.top=o+s.offsetTop+"px",n.style.left=i+s.offsetLeft+15+"px";for(var l="",c=[],u=-3;u<=3;u++)if(this.posData[i+u])for(var d=-3;d<=3;d++)if(this.posData[i+u][o+d]){var h={};h["x"]=i+u,h["y"]=o+d,c.push(h),this.posData[i+u][o+d].map((function(t,n){var r=e.renderConfig["on hover"][n],a=r?"<b>".concat(r,":</b> "):"";l+='<span class="gene-on-clicked-dot-volcano">\n\t\t\t\t\t\t\t\t\t'.concat(a,"\n\t\t\t\t\t\t\t\t\t").concat(t,"\n\t\t\t\t\t\t\t\t\t</span><br>")})),l+=this.renderConfig["on hover"]?"<hr>":""}""!=l?(n.innerHTML=l,document.getElementById("volcanoPlot"+this.sectionId).classList.add("hover")):(n.innerHTML=l,n.classList.add("hidden"),document.getElementById("volcanoPlot"+this.sectionId).classList.remove("hover"))},clearPlot:function(){var t=document.getElementById("volcanoPlot"+this.sectionId),e=t.getContext("2d");e.clearRect(0,0,2*this.renderConfig.width+240,2*this.renderConfig.height+240)},renderPlot:function renderPlot(REDDOTS){var _this3=this,calculateCondition=function calculateCondition(EXP,LENGTH){var calcString="";EXP.map((function(t){var e=["+","-","*","/","(",")"].includes(t)||"number"===typeof t?t:"string"===typeof t?"data length"==t?LENGTH:t:null;calcString+=e}));var threshold=eval(calcString);return threshold},conditions=[["x condition","lower than"],["x condition","greater than"],["y condition","lower than"],["y condition","greater than"]];conditions.map((function(t){if(_this3.renderConfig[t[0]][t[1]]&&"calculate"==_this3.renderConfig[t[0]][t[1]]){var e=_this3.renderConfig[t[0]]["condition calculate"][t[1]];_this3.renderConfig[t[0]][t[1]]=calculateCondition(e,_this3.renderData.length)}}));var xAxisData=[],yAxisData=[],expData=[],canvasWidth=2*this.renderConfig.width,canvasHeight=2*this.renderConfig.height,leftMargin=149,topMargin=89,xBump=.04*canvasWidth,yBump=.04*canvasHeight,c=document.getElementById("volcanoPlot"+this.sectionId),ctx=c.getContext("2d");ctx.clearRect(0,0,canvasWidth+240,canvasHeight+240),ctx.beginPath(),ctx.lineWidth=1,ctx.strokeStyle="#000000",ctx.setLineDash([]),this.renderData.map((function(t){xAxisData.push(t[_this3.renderConfig["x axis field"]]),yAxisData.push(t[_this3.renderConfig["y axis field"]]),_this3.renderConfig["dot scale"]&&expData.push(t[_this3.renderConfig["dot scale"]])}));var dotSizeMin=8,dotSizeMax=16,dotScaleMin=8,dotScaleMax=16;this.renderConfig["dot scale"]&&(dotScaleMin=Math.min.apply(Math,expData),dotScaleMax=Math.max.apply(Math,expData));var xMin=Math.min.apply(Math,xAxisData),xMax=Math.max.apply(Math,xAxisData),yMin=Math.min.apply(Math,yAxisData),yMax=Math.max.apply(Math,yAxisData),xAbsMax=Math.abs(xMin)>Math.abs(xMax)?Math.abs(xMin):Math.abs(xMax),xAxisTicks=this.utils.uiUtils.getAxisTicks(xMin,xMax),yAxisTicks=this.utils.uiUtils.getAxisTicks(yMin,yMax);ctx.moveTo(leftMargin,canvasHeight+topMargin+yBump),ctx.lineTo(canvasWidth+leftMargin+xBump,canvasHeight+topMargin+yBump),ctx.stroke();for(var xTickDistance=canvasWidth/5,i=0;i<6;i++)ctx.moveTo(leftMargin+i*xTickDistance+xBump,topMargin+canvasHeight+yBump),ctx.lineTo(leftMargin+i*xTickDistance+xBump,canvasHeight+topMargin+10+yBump),ctx.stroke(),ctx.font="24px Arial",ctx.textAlign="center",ctx.fillStyle="#000000",xAxisTicks.lo+i*xAxisTicks.step==0?ctx.fillText(0,leftMargin+i*xTickDistance+xBump,topMargin+canvasHeight+34+yBump):ctx.fillText(this.utils.Formatters.floatFormatter(xAxisTicks.lo+i*xAxisTicks.step),leftMargin+i*xTickDistance+xBump,topMargin+canvasHeight+34+yBump);ctx.font="28px Arial",ctx.textAlign="center",ctx.fillStyle="#000000",ctx.fillText(this.renderConfig["x axis label"],leftMargin+canvasWidth/2,topMargin+canvasHeight+70+yBump),ctx.moveTo(leftMargin,topMargin),ctx.lineTo(leftMargin,canvasHeight+topMargin+yBump),ctx.stroke();for(var yTickDistance=canvasHeight/5,_i2=0;_i2<6;_i2++)ctx.moveTo(leftMargin-5,topMargin+_i2*yTickDistance),ctx.lineTo(leftMargin,topMargin+_i2*yTickDistance),ctx.stroke(),ctx.font="24px Arial",ctx.textAlign="right",ctx.fillStyle="#000000",yAxisTicks.lo+yAxisTicks.step*_i2==0?ctx.fillText(0,leftMargin-14,topMargin+(5-_i2)*yTickDistance+3):ctx.fillText(this.utils.Formatters.floatFormatter(yAxisTicks.lo+yAxisTicks.step*_i2),leftMargin-14,topMargin+(5-_i2)*yTickDistance+3);ctx.font="28px Arial",ctx.textAlign="center",ctx.fillStyle="#000000",ctx.rotate(-90*Math.PI/180),ctx.fillText(this.renderConfig["y axis label"],-(topMargin+canvasHeight/2),leftMargin-110),ctx.rotate(90*Math.PI/180);var xPosMax=xAxisTicks.lo+5*xAxisTicks.step,yPosMax=yAxisTicks.lo+5*yAxisTicks.step,xCondition=this.renderConfig["x condition"];if(this.renderData.map((function(t,e){var n=leftMargin+xBump+canvasWidth*((t[_this3.renderConfig["x axis field"]]-xAxisTicks.lo)/(xPosMax-xAxisTicks.lo)),r=topMargin+canvasHeight-canvasHeight*((t[_this3.renderConfig["y axis field"]]-yAxisTicks.lo)/(yPosMax-yAxisTicks.lo));_this3.posData[Math.round(n/2)]||(_this3.posData[Math.round(n/2)]={}),_this3.posData[Math.round(n/2)][Math.round(r/2)]=[],_this3.renderConfig["on hover"]?_this3.renderConfig["on hover"].forEach((function(e){_this3.posData[Math.round(n/2)][Math.round(r/2)].push(t[e])})):_this3.posData[Math.round(n/2)][Math.round(r/2)].push(t[_this3.renderConfig["render by"]]);var a=0;if(_this3.renderConfig["x condition"]){var i=_this3.renderConfig["x condition"].combination,o=t[_this3.renderConfig["x axis field"]];"greater than"==i&&o>_this3.renderConfig["x condition"]["greater than"]&&a++,"lower than"==i&&o<_this3.renderConfig["x condition"]["lower than"]&&a++,"and"==i&&o>_this3.renderConfig["x condition"]["greater than"]&&o<_this3.renderConfig["x condition"]["lower than"]&&a++,("or"==i&&o>_this3.renderConfig["x condition"]["greater than"]||o<_this3.renderConfig["x condition"]["lower than"])&&a++}if(_this3.renderConfig["y condition"]){var s=_this3.renderConfig["y condition"].combination,l=t[_this3.renderConfig["y axis field"]];"greater than"==s&&l>_this3.renderConfig["y condition"]["greater than"]&&a++,"lower than"==s&&l<_this3.renderConfig["y condition"]["lower than"]&&a++,"and"==s&&l>_this3.renderConfig["y condition"]["greater than"]&&l<_this3.renderConfig["y condition"]["lower than"]&&a++,("or"==s&&l>_this3.renderConfig["y condition"]["greater than"]||l<_this3.renderConfig["y condition"]["lower than"])&&a++}switch(a){case 0:ctx.fillStyle="#00000050";break;case 1:ctx.fillStyle="#09910980";break;case 2:ctx.fillStyle="#ff003780";break}function c(t,e,n,r,a){return(t-e)/(n-e)*(a-r)+r}var u=_this3.renderConfig["dot scale"]?c(t[_this3.renderConfig["dot scale"]],dotScaleMin,dotScaleMax,dotSizeMin,dotSizeMax):dotScaleMin;ctx.lineWidth=0,ctx.beginPath(),ctx.arc(n,r,u,0,2*Math.PI),ctx.fill(),_this3.renderConfig["dot label score"]&&a>=_this3.renderConfig["dot label score"]&&(ctx.font="24px Arial",ctx.textAlign="center",ctx.fillStyle="#000000",ctx.fillText(t[_this3.renderConfig["render by"]],n,r-16))})),void 0!=REDDOTS&&REDDOTS.map((function(t){var e=t.x,n=t.y;ctx.fillStyle="#ff0000",ctx.lineWidth=0,ctx.beginPath(),ctx.arc(e,n,8,0,2*Math.PI),ctx.fill()})),void 0!=this.geneOfInterest){var targetGene=this.$parent.convert2Re
1nderBy(this.geneOfInterest);this.renderData.map((function(t){if(t[_this3.renderConfig["render by"]].toLowerCase()==targetGene.toLowerCase()){var e=leftMargin+xBump+canvasWidth*((t[_this3.renderConfig["x axis field"]]-xAxisTicks.lo)/(xPosMax-xAxisTicks.lo)),n=topMargin+canvasHeight-canvasHeight*((t[_this3.renderConfig["y axis field"]]-yAxisTicks.lo)/(yPosMax-yAxisTicks.lo));ctx.fillStyle="#ff0000",ctx.lineWidth=0,ctx.beginPath(),ctx.arc(e,n,5,0,2*Math.PI),ctx.fill(),ctx.font="24px Arial",ctx.textAlign="center",ctx.fillStyle="#FF0000",ctx.fillText(t[_this3.renderConfig["render by"]],e,n-12)}}))}if(this.renderConfig["x condition"]){var xCondiCombi=this.renderConfig["x condition"].combination,xGTPos=null,xLTPos=null;"greater than"!=xCondiCombi&&"or"!=xCondiCombi&&"and"!=xCondiCombi||(xGTPos=leftMargin+xBump+canvasWidth*((this.renderConfig["x condition"]["greater than"]-xAxisTicks.lo)/(xPosMax-xAxisTicks.lo))),"lower than"!=xCondiCombi&&"or"!=xCondiCombi&&"and"!=xCondiCombi||(xLTPos=leftMargin+xBump+canvasWidth*((this.renderConfig["x condition"]["lower than"]-xAxisTicks.lo)/(xPosMax-xAxisTicks.lo))),null!=xGTPos&&this.renderDash(xGTPos,xGTPos,topMargin,canvasHeight+topMargin+yBump,"#999999",1,[5,5]),null!=xLTPos&&this.renderDash(xLTPos,xLTPos,topMargin,canvasHeight+topMargin+yBump,"#999999",1,[5,5])}if(this.renderConfig["y condition"]){var yCondiCombi=this.renderConfig["y condition"].combination,yGTPos=null,yLTPos=null;"greater than"!=yCondiCombi&&"or"!=yCondiCombi&&"and"!=yCondiCombi||(yGTPos=topMargin+canvasHeight-canvasHeight*((this.renderConfig["y condition"]["greater than"]-yAxisTicks.lo)/(yPosMax-yAxisTicks.lo))),"lower than"!=yCondiCombi&&"or"!=yCondiCombi&&"and"!=yCondiCombi||(yLTPos=topMargin+canvasHeight-canvasHeight*((this.renderConfig["y condition"]["lower than"]-yAxisTicks.lo)/(yPosMax-yAxisTicks.lo))),null!=yGTPos&&this.renderDash(leftMargin,leftMargin+canvasWidth+xBump,yGTPos,yGTPos,"#999999",1,[5,5]),null!=yLTPos&&this.renderDash(leftMargin,leftMargin+canvasWidth+xBump,yLTPos,yLTPos,"#999999",1,[5,5])}},renderDash:function(t,e,n,r,a,i,o){var s=document.getElementById("volcanoPlot"+this.sectionId),l=s.getContext("2d");l.strokeStyle=a,l.lineWidth=i,l.setLineDash(o),l.moveTo(t,n),l.lineTo(e,r),l.stroke()}}}),jquery__WEBPACK_IMPORTED_MODULE_14___default()((function(){}))},f392:function(t,e,n){"use strict";n("0fe9")},f4df:function(t,e,n){"use strict";n("4d09")},f521:function(t,e,n){},f529:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-dropdown",{attrs:{variant:"secondary",right:"",size:"sm",text:"Download data"}},[n("b-dropdown-text",[t._v("Save file as")]),n("b-dropdown-divider"),n("b-dropdown-item",{on:{click:function(e){return t.downloadCsv()}}},[t._v("CSV")]),n("b-dropdown-item",{on:{click:function(e){return t.downloadTsv()}}},[t._v("TSV")]),n("b-dropdown-item",{on:{click:function(e){return t.downloadJson()}}},[t._v("JSON")])],1)},a=[],i=(n("d81d"),n("a573"),n("2b0e")),o=n("a282"),s=n("1149"),l=n.n(s),c=i["default"].component("DataDownload",{props:{data:{type:Array,required:!0},filename:{type:String,required:!1,default:"data"},flatten:{type:Boolean,default:!1}},data:function(){return{}},methods:{downloadCsv:function(){if(this.flatten&&this.data){var t=this.flattenCsv(this.data,this.flatten);o["a"].convertJson2Csv(t,this.filename)}else o["a"].convertJson2Csv(this.data,this.filename)}, 2//! Don't flatten unless necessary; 3flattenCsv:function(t,e){return t.map((function(t){return t[e]=l()(t[e]),t}))},downloadJson:function(){o["a"].saveJson(this.data,this.filename)},downloadTsv:function(){o["a"].convertJson2Tsv(this.data,this.filename)}}}),u=c,d=n("2877"),h=Object(d["a"])(u,r,a,!1,null,null,null);e["a"]=h.exports},f558:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"mbm-plot-content row"},[n("div",{staticClass:"col-md-12"},[n("download-chart",{attrs:{filename:"PIGEAN_plot",chartId:t.plotId}}),n("div",{attrs:{id:t.plotId}},[n("p",[t._v("Loading...")])])],1)])},a=[],i=(n("99af"),n("4de4"),n("caad"),n("14d9"),n("e9c4"),n("4ec9"),n("9129"),n("b64b"),n("d3b7"),n("ac1f"),n("6062"),n("5319"),n("5b81"),n("0643"),n("2382"),n("4e3e"),n("159b"),n("0eb6"),n("b7ef"),n("8bd4"),n("ad1f"),n("2b0e")),o=n("5698"),s=(n("4995"),n("1812"),n("e60d")),l=n("529c"),c=n("b1e0");i["default"].use(c["a"]);var u=i["default"].component("pigean-plot",{components:{},props:["pigeanData","config","phenotypeMap","filter","genesetSize","traitGroup","matchingHoverDots","pigeanColors"],data:function(){return{plotId:"pigean-plot-".concat(Math.floor(1e10*Math.random())),chart:null,chartWidth:null,chartHeight:this.config.plotHeight?this.config.plotHeight:400,svg:null,xScale:null,yScale:null,xMedian:0,tooltip:null,tooltipElement:null,tooltipPinned:!1,allHoverFields:this.getHoverFields(),hoverBo
3xPosition:this.config.hoverBoxPosition||"left",dotOutlineColor:"#00000075"}},mounted:function(){var t=this;this.chart=document.getElementById(this.plotId),this.chartWidth=this.chart.clientWidth,addEventListener("resize",(function(e){t.chartWidth=t.chart.clientWidth,t.drawChart()})),this.drawChart()},computed:{chartData:function(){var t=structuredClone(this.pigeanData);return this.filter&&(t=t.filter(this.filter)),t},linkSuffix:function(){return"&genesetSize=".concat(this.$store.state.genesetSize||s["d"].DEFAULT_GENESET_SIZE,"&traitGroup=").concat(this.$store.state.traitGroup||s["d"].DEFAULT_TRAIT_GROUP)}},methods:{dotClassId:function(t){return"dot_".concat(String(null!==t&&void 0!==t?t:"").replaceAll(".","point"))},drawChart:function(){var t=this;this.tooltipPinned=!1;var e={top:10,right:30,bottom:35,left:60},n=this.chartWidth-e.left-e.right,r=this.chartHeight-e.top-e.bottom;this.chart.innerHTML="",this.svg=o["select"]("#".concat(this.plotId)).append("svg").attr("width",n+e.left+e.right).attr("height",r+e.top+e.bottom).append("g").attr("transform","translate(".concat(e.left,",").concat(e.top,")")),this.tooltip=o["select"]("#".concat(this.plotId)).append("div").style("opacity",0).attr("class","tooltip").style("background-color","white").style("border","2px solid gray").style("padding","5px").style("border-radius","5px").style("font-size","smaller"),this.tooltipElement=this.chart.getElementsByClassName("tooltip")[0];var a=this.extremeVal(this.config.xField),i=this.extremeVal(this.config.yField),s=this.extremeVal(this.config.xField,!1),l=this.extremeVal(this.config.yField,!1),c=s-a,u=l-i;a=a>0?0:a,i=i>0?0:i,this.xMedian=(a+s)/2,this.xScale=o["scaleLinear"]().domain([a-.01*c,s]).range([0,n]),this.svg.append("g").attr("transform","translate(0,".concat(r,")")).call(o["axisBottom"](this.xScale)),this.svg.append("text").attr("text-anchor","middle").attr("font-size","smaller").attr("y",r+e.top+22).attr("x",n/2).text(this.config.xAxisLabel||this.config.xField),this.yScale=o["scaleLinear"]().domain([i-.05*u,l]).range([r,0]),this.svg.append("g").call(o["axisLeft"](this.yScale)),this.svg.append("text").attr("text-anchor","middle").attr("transform","rotate(-90)").attr("font-size","smaller").attr("y",20-e.left).attr("x",-r/2-e.top).text(this.config.yAxisLabel||this.config.yField),this.svg.append("g").selectAll("dot").data(this.chartData).enter().append("circle").attr("class",(function(e){return t.dotClassId(e[t.config.dotKey])})).attr("cx",(function(e){return void 0===e[t.config.xField]?t.xScale(0):t.xScale(e[t.config.xField])})).attr("cy",(function(e){return void 0===e[t.config.yField]?t.yScale(0):t.yScale(e[t.config.yField])})).attr("r",5).attr("fill",(function(e){return"".concat(t.dotColor(e.phenotype),"aa")})).attr("stroke",this.dotOutlineColor).on("mouseover",(function(e){return t.hoverDot(JSON.stringify(e))})),this.svg.selectAll("circle").on("click",(function(e){t.tooltipPinned||(t.tooltipPinned=!0)}))},extremeVal:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.pigeanData.filter((function(e){return void 0!==e[t]&&!Number.isNaN(e[t])})),r=n[0][t];return n.forEach((function(n){(e&&n[t]<r||!e&&n[t]>r)&&(r=n[t])})),r},hoverDot:function(t){var e=this;if(!this.tooltipPinned){this.unHoverDot(),this.$emit("dotsHovered",t);var n=o["event"].layerX,r=o["event"].layerY;this.tooltip.style("opacity",1).html(this.getTooltipContent(t)),this.tooltip.selectAll("a").on("click",(function(){e.tooltipPinned=!1,e.hideTooltip()}));var a=this.tooltipElement.clientWidth,i=this.dotHoverLeft(t);i?n=n-a-20:n+=20,this.tooltip.style("left","".concat(n,"px")).style("top","".concat(r,"px"))}},dotHoverLeft:function(t){var e=JSON.parse(t);return"both"===this.hoverBoxPosition?e[this.config.xField]>this.xMedian:"left"===this.hoverBoxPosition},getTooltipContent:function(t){var e=JSON.parse(t),n=this.config.dotKey,r=e[n];e.phenotype=this.phDesc(e.phenotype);var a=this.config.linkRoot||"/pigean",i="".concat(a,"/").concat(n,".html?").concat(n,"=").concat(r).concat(this.linkSuffix),o='<p class="close-tooltip"><a>';return o=o.concat("x</a><p>"),o=o.concat("".concat(l["a"].tissueFormatter(n),': <a href="').concat(i,'">').concat(e[n],"</a>")),o=o.concat("<span>".concat(this.config.xAxisLabel,": ").concat(e[this.config.xField],"</span>")),o=o.concat("<span>".concat(this.config.yAxisLabel,": ").concat(e[this.config.yField],"</span>")),this.config.hoverFields&&this.config.hoverFields.forEach((function(t){o=o.concat("<span>".concat(l["a"].tissueFormatter(t),": ").concat(e[t],"</span>"))})),o},unHoverDot:function(){this.hideTooltip},hideTooltip:function(){this.tooltip&&this.tooltip.style("opacity",0)},dotColor:function(t){return this.phenotypeMap[t]?null===this.pigeanColors?"lightgray":this.pigeanColors[this.phenotypeMap[t].group]:this.dotOutlineColor},phDesc:function(t){return this.phenotypeMap[t]?l["a"].phenotypeFormatter(this.phenotypeMap[t]):t},getHoverFields:function(){var t=[];return t.push(this.config.dotKey),t.push(this.config.xField),t.push(this.config.yField),this.config.hoverFields&&this.config.hoverFields.forEach((function(e){t.includes(e)||t.push(e)})),t},highlightDot:function(t){var e=this.svg.select("circle.".concat(this.dotClassId(t)));e.attr("r",7).attr("stroke","black")},unHighlightDots:function(){this.svg.selectAll("circle").attr("r",5).attr("stroke",this.dotOutlineColor)}},watch:{chartData:function(){this.drawChart()},matchingHoverDots:function(t){var e=this;this.unHighlightDots();var n=Object.keys(JSON.parse(t));
3n.forEach((function(t){return e.highlightDot(t)}))},pigeanColors:function(t){this.drawChart()}}}),d=u,h=(n("da18"),n("2877")),p=Object(h["a"])(d,r,a,!1,null,null,null);e["a"]=p.exports},f643:function(t,e,n){"use strict";n.d(e,"b",(function(){return h}));var r=function(){var t=this,e=this,n=e.$createElement,r=e._self._c||n;return r("lz-panel",{ref:"panel",attrs:{panelClass:e.panelClass},on:{updated:function(e){return t.panelId=e.panelId}}})},a=[],i=(n("99af"),n("d81d"),n("a573"),n("2b0e")),o=n("bacd"),s=n("ef2a"),l=n("06a9"),c=n("d8ef"),u=n("529c"),d=(n("67a3"),i["default"].component("lz-coaccessibility-panel",{components:{LzPanel:o["a"]},props:{title:String,tissue:String},created:function(){var t=this;this.panelClass=h(this.tissue,this.title,(function(e){return t.$emit("input",e)}),(function(e){return t.$emit("resolve",e)}),(function(e){return t.$emit("error",e)})),this.addPanels=this.$parent.addPanels,this.plot=this.$parent.plot}}));function h(t,e,n,r,a){var i="access_".concat(c["a"].getUniqueId());return{layouts:[s["a"].Layouts.get("panel","coaccessibility",{id:i,namespace:{access:i},title:{text:e||"".concat(u["a"].snakeFormatter(t)," Gene Links"),style:{"font-size":"18px"}},y_index:2})],sources:[[i,new l["b"]({index:"gene-links",queryStringMaker:function(e,n,r){return"".concat(t,",").concat(e,":").concat(n,"-").concat(r)},translator:function(t){return t.map((function(t){return{id:t.tissueId,chrom:t.chromosome,start1:t.start,end1:t.end,start2:t.targetGeneStart,end2:t.targetGeneEnd,target:t.targetGene,score:1}}))},onLoad:n,onError:a,onResolve:r})]]}}var p=d,f=n("2877"),_=Object(f["a"])(p,r,a,!1,null,null,null);e["a"]=_.exports},f69e:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("filter-control-template",{staticClass:"filter-col-sm",attrs:{field:t.field,type:"number",predicate:t.predicate,pillFormatter:t.pillFormatter,color:t.color,computedField:t.computedField,multiple:!1}},[t._t("default",(function(){return[t._v(t._s(t.field))]}))],2)},a=[],i=(n("99af"),n("2b0e")),o=n("27d5"),s=i["default"].component("filter-less-control",{props:{field:String,computedField:Function,predicate:{type:Function,default:function(t,e){return t<=e}},pillFormatter:{type:Function,default:function(t){return"".concat(t.field," <= ").concat(t.threshold)}},color:{type:String}},components:{FilterControlTemplate:o["a"]}}),l=s,c=n("2877"),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},f6af:function(t,e,n){},f73e:function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"a",(function(){return l})),n.d(e,"e",(function(){return c}));var r=n("3835"),a=(n("99af"),n("4de4"),n("b0c0"),n("4fad"),n("d3b7"),n("ac1f"),n("5319"),n("0643"),n("2382"),n("4e3e"),n("9a9a"),n("159b"),n("2ef0"));function i(t,e){var n=t.filter((function(t){return t.inclusive})),r=t.filter((function(t){return!t.inclusive}));return function(a){var i=!0,o=!0;if(n.length>0){o=!1;for(var s=0;s<n.length;s++)if(o=n[s].func(a),!0===o)break}if(t.length>0)if(e){i=!1;for(var l=0;l<r.length;l++)if(i=r[l].func(a),!0===i)break}else for(var c=0;c<r.length;c++)if(i=r[c].func(a),!1===i)break;return o&&i}}function o(t,e){var n=t.field,r=t.computedField,i=t.predicate,o=t.threshold,s=t.inclusive,l=void 0!==s&&s,c=e.notStrictMatch,u=void 0!==c&&c;e.strictCase;return{inclusive:l,func:function(t){var e=r||function(t){return Object(a["get"])(t,n)},s=e(t),l=!!s;return l?"Array"===s.constructor.name?s.some((function(t){return i(t,o)})):i(s,o):u}}}function s(t,e){var n=e.prefix,a=void 0===n?"":n,i=e.suffix,o=void 0===i?"":i,s=e.pDelimiter,l=void 0===s?"":s,c=e.sDelimiter,u=void 0===c?"":c,d={};return Object.entries(t).forEach((function(t){var e=Object(r["a"])(t,2),n=e[0],i=e[1],s="".concat(a).concat(l).concat(n).concat(u).concat(o);d[s]=i})),d}function l(t,e){var n=e.prefix,a=void 0===n?"":n,i=e.suffix,o=void 0===i?"":i,s=e.pDelimiter,l=void 0===s?"":s,c=e.sDelimiter,u=void 0===c?"":c,d={};return Object.entries(t).forEach((function(t){var e=Object(r["a"])(t,2),n=e[0],i=e[1],s=n.replace(a,"").replace(o,"").replace(l,"").replace(u,"");d[s]=i})),d}function c(t,e){var n=_.filter(t,(function(t){return!(t.field===e.field&&t.threshold===e.threshold)}));return n}function u(t){return function(e){t=c(t,e)}}e["b"]={filterFromPredicates:i,predicateFromSpec:o,decodeNamespace:l,encodeNamespace:s,unsetFilter:c,unsetFilterFromList:u}},f7f7:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"research-data-table-wrapper",class:t.tableFormat.display&&"false"==t.tableFormat.display?"hidden":""},[t.dataset?n("div",{staticClass:"data-table-legend",domProps:{innerHTML:t._s(t.tableLegend)}}):t._e(),t.searchParameters&&null!=t.dataComparisonConfig&&t.compareGroups.length>1?n("div",{staticClass:"table-total-rows"}
3,t._l(t.compareGroups,(function(e,r){return n("span",{key:e,class:"group-item-bubble reference bg-color-"+r,domProps:{innerHTML:t._s(e)}})})),0):t._e(),t.tableFormat["summary plot"]&&t.tableFormat["summary plot"]["plots"].includes("table")?n("research-summary-plot",{attrs:{summaryPlot:t.tableFormat["summary plot"],rawData:t.dataset,isPlotByRow:!1}}):t._e(),t.dataset?n("div",{staticClass:"table-ui-wrapper"},[n("div",{staticClass:"convert-2-csv table-settings-opener btn-sm"},[n("span",{staticClass:"btn btn-default options-gear"},[t._v("Save data / set table "),n("b-icon",{attrs:{icon:"gear-fill"}})],1)]),t.tableFormat?n("div",{staticClass:"table-options-box",attrs:{id:"showHideColumnsBox"+t.sectionId}},[n("div",{staticClass:"table-wrapper"},[n("table",{staticClass:"table table-sm"},[n("tbody",[n("tr",[n("td",[n("label",[n("strong",[t._v("Rows per page: ")]),n("select",{directives:[{name:"model",rawName:"v-model",value:t.perPageNumber,expression:"perPageNumber"}],staticClass:"number-per-page",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.perPageNumber=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"10"}},[t._v("10")]),n("option",{attrs:{value:"20"}},[t._v("20")]),n("option",{attrs:{value:"40"}},[t._v("40")]),n("option",{attrs:{value:"100"}},[t._v("100")]),t._m(0)])])])]),n("tr",[n("td",[n("strong",[t._v("Save data in section: ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.convertJson2Csv(t.filteredData,t.pageID+t.sectionId+"_filtered")}}},[t._v(" CSV ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.convertJson2Tsv(t.filteredData,t.pageID+t.sectionId+"_filtered")}}},[t._v(" TSV ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.saveJson(t.filteredData,t.pageID+t.sectionId+"_filtered")}}},[t._v(" JSON ")])])]),n("tr",[n("td",[n("Strong",[t._v("Hide table: ")]),n("input",{staticClass:"chkbox",attrs:{type:"checkbox"},on:{click:function(e){return t.utils.uiUtils.showHideElement(t.sectionId+"_table_wrapper")}}})],1)]),t._m(1),t._l(t.tableFormat["top rows"],(function(e){return n("tr",{key:e},[n("td",[n("input",{attrs:{type:"checkbox",name:"visible_top_rows",id:t.getColumnId(e),checked:""},domProps:{value:e},on:{click:function(e){return t.addRemoveColumn(e)}}}),t._v(" "+t._s(" "+e)+" ")])])}))],2)]),t.summarySection?n("div",[n("h4",{staticStyle:{"text-align":"center"}},[t._v("Number of rows in evidence tables")]),n("label",[t._v("Set rows: "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.featureRowsNumber,expression:"featureRowsNumber"}],staticClass:"number-per-page",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){var e="_value"in t?t._value:t.value;return e}));t.featureRowsNumber=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"10",selected:""}},[t._v("10")]),n("option",{attrs:{value:"15"}},[t._v("15")]),n("option",{attrs:{value:"20"}},[t._v("20")]),n("option",{attrs:{value:"25"}},[t._v("25")]),n("option",{attrs:{value:"30"}},[t._v("30")]),n("option",{attrs:{value:"35"}},[t._v("35")]),n("option",{attrs:{value:"40"}},[t._v("40")]),n("option",{attrs:{value:"45"}},[t._v("45")]),n("option",{attrs:{value:"50"}},[t._v("50")])])]),n("div",{staticStyle:{color:"red"}},[t._v("*Updating this value requires rebuilding of the summary table, which may take long time depends on the number of the evidence groups and their data rows.")])]):t._e()])]):t._e()]):t._e(),n("span",{attrs:{id:t.sectionId+"_table_wrapper"}},[t.dataset?n("div",{staticClass:"table-total-rows",domProps:{innerHTML:t._s("Total rows: "+this.rows)}}):t._e(),n("div",{staticClass:"table-wrapper"},[t.dataset&&t.tableFormat?n("table",{class:"table table-sm research-data-table "+t.pageID,attrs:{cellpadding:"0",cellspacing:"0"}},[n("thead",{},[n("tr",[t.tableFormat["star column"]?n("th",{staticClass:"star-items-control"},[n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer"},attrs:{icon:t.stared?"star-fill":"star"}}),n("span",{staticClass:"star-items-options"},[n("ul",[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.showHideStared()}}},[t._v("Show stard only")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.starAll()}}}
3,[t._v("Star / unstar all")])])])])],1):t._e(),t.tableFormat["select column"]?n("th",{staticClass:"select-items-control"}):t._e(),t._l(t.topRows,(function(e,r){return[1==t.getIfChecked(e)&&e!==t.tableFormat["select column"]?n("th",{key:r,staticClass:"byor-tooltip",class:"sortable-th "+e+" "+t.getColumnId(e),on:{click:function(n){t.multiSectionPage?t.callFilter(e):t.applySorting(e)}}},[n("span",{domProps:{innerHTML:t._s(e)}}),t.tableFormat["tool tips"]&&t.tableFormat["tool tips"][e]?n("span",{staticClass:"tooltiptext",domProps:{innerHTML:t._s(t.tableFormat["tool tips"][e])}}):t._e()]):t._e()]})),void 0!=t.tableFormat["features"]?n("th",{staticClass:"th-evidence"},[t._v(" "+t._s(t.tableFormat["features header"]?t.tableFormat["features header"]:"Evidence")+" ")]):t._e()],2)]),n("tbody",{},[t._l(t.pagedData,(function(e,r){return[n("tr",[t.tableFormat["star column"]?n("td",[0==t.checkStared("1",e)?n("span",[n("b-icon",{staticStyle:{color:"#aaaaaa",cursor:"pointer"},attrs:{icon:"star"},on:{click:function(n){return t.addStar(e)}}})],1):t._e(),1==t.checkStared("2",e)?n("span",[n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer"},attrs:{icon:"star-fill"},on:{click:function(n){return t.removeStar(e)}}})],1):t._e()]):t._e(),t.tableFormat["select column"]?n("td",[n("button",{attrs:{disabled:t.isSelected(e)},on:{click:function(n){return t.selectRow(e)}}},[t._v("Select")])]):t._e(),t._l(e,(function(a,i){return t.topRows.includes(i)&&1==t.getIfChecked(i)&&i!==t.tableFormat["select column"]?[0==t.ifDataObject(a)?n("td",{key:i,class:t.getColumnId(i)},[t.ifSetParameterColumn(i)?n("span",{staticClass:"set-parameter-options"},[t._v(" "+t._s(t.getParameterColumnLabel(i)?t.getParameterColumnLabel(i):a)+" "),n("span",{staticClass:"btns-wrapper"},t._l(t.getParameterTargets(i),(function(e){return n("button",{staticClass:"btn btn-sm show-evidence-btn set-search-btn",domProps:{innerHTML:t._s(e.label)},on:{click:function(n){return t.setParameter(a,i,e.section,e.parameter,e.compare)}}})})),0)]):t.ifSubsectionColumn(i)||t.ifByoglSectionColumn(i)?n("span",{staticClass:"dynamic-subsection-options"},[n("span",{staticClass:"btns-wrapper"},[n("button",{staticClass:"btn btn-sm show-evidence-btn set-search-btn",class:{"loaded-subsection":!!t.ifSubsectionData(t.sanitizeKey(i+a+r)),"loading-subsection":!!t.ifSubsectionLoading(t.sanitizeKey(i+a+r))},attrs:{"data-id":t.getRowID(i+a+r)},on:{click:function(e){return t.getSubsectionData(a,i,r)}}},[n("span",[t._v(t._s(t.getParameterColumnLabel(i)?t.getParameterColumnLabel(i):a))])])])]):n("span","View gene splicing model"===i?[n("button",{on:{click:function(e){return t.selectSplice(a)}}},[t._v(" View ")])]:{domProps:{innerHTML:t._s(t.formatValue(a,i,e))}}),t.tableFormat["column formatting"]&&t.tableFormat["column formatting"][i]&&t.tableFormat["column formatting"][i].type.includes("copy to clipboard")?n("b-btn",{staticClass:"copy-to-cl
3ipboard",on:{click:function(e){return t.utils.uiUtils.copy2Clipboard(a)}}},[t._v("Copy")]):t._e()],1):t._e(),1==t.ifDataObject(a)?n("td",{key:i,staticClass:"multi-value-td",class:t.getColumnId(i)},t._l(a,(function(e,o,s){return n("span",{key:o,class:o+" reference bg-color-"+t.getColorIndex(o)},[t.ifSetParameterColumn(i)?n("span",{staticClass:"set-parameter-options"},[t._v(" "+t._s(t.getParameterColumnLabel(i)?t.getParameterColumnLabel(i):e)+" "),n("span",{staticClass:"btns-wrapper"},t._l(t.getParameterTargets(i),(function(r){return n("button",{staticClass:"btn btn-sm show-evidence-btn set-search-btn",domProps:{innerHTML:t._s(r.label)},on:{click:function(n){return t.setParameter(e,i,r.section,r.parameter,r.compare)}}})})),0)]):t.ifSubsectionColumn(i)||t.ifByoglSectionColumn(i)?n("span",{staticClass:"dynamic-subsection-options"},[n("span",{staticClass:"btns-wrapper"},[n("button",{staticClass:"btn btn-sm show-evidence-btn set-search-btn",class:t.ifSubsectionData(t.sanitizeKey(i+a+r))?"loaded-subsection":"",on:{click:function(e){return t.getSubsectionData(a,i,r)}}},[t._v(" "+t._s(t.getParameterColumnLabel(i)?t.getParameterColumnLabel(i):a))])])]):n("span",{domProps:{innerHTML:t._s(t.formatValue(e,i))}})])})),0):t._e()]:t._e()})),void 0!=t.tableFormat["features"]?n("td",[t.tableFormat["features required column"]?t.checkFeatureExist(e,t.tableFormat["features required column"])?n("span",{staticClass:"show-evidence-btn btn",attrs:{href:"javascript:;"},on:{click:function(e){return t.showHideFeature("feature_"+t.sectionId+r)}}},[t._v("View")]):t._e():n("span",{staticClass:"show-evidence-btn btn",attrs:{href:"javascript:;"},on:{click:function(e){return t.showHideFeature("feature_"+t.sectionId+r)}}},[t._v("View")])]):t._e()],2),t.tableFormat["features"]?n("tr",{class:"hidden",attrs:{id:"feature_"+t.sectionId+r}},[n("td",{staticClass:"features-td",attrs:{colspan:t.topRowNumber}},[n("research-data-table-features",{attrs:{featureRowsNumber:t.featureRowsNumber,featuresData:e.features,featuresFormat:t.tableFormat,utils:t.utils,summarySection:t.summarySection}})],1)]):t._e(),t._l(t.tableFormat["column formatting"],(function(a,i){return t.tableFormat["column formatting"]?[a.type.includes("dynamic subsection")&&t.ifSubsectionData(t.sanitizeKey(i+e[i]+r))?n("tr",{key:e[i],staticClass:"dynamic-sub-section",class:t.getRowID(i+e[i]+r)+" "+t.ifHidden(t.sanitizeKey(i+e[i]+r))},[n("td",{attrs:{colspan:t.topRowNumber}},[n("research-sub-section",{attrs:{sectionId:t.sectionId,rowId:t.getRowID(i+e[i]+r),colors:t.colors,starItems:t.starItems,multiSectionPage:t.multiSectionPage,plotMargin:t.plotMargin,subSectionConfig:a["subsection"],subSectionData:t.collectSubsectionData(t.sanitizeKey(i+e[i]+r)),phenotypeMap:t.phenotypeMap,utils:t.utils}})],1)]):t._e(),a.type.includes("byogl section")&&t.ifSubsectionData(t.sanitizeKey(i+e[i]+r))?n("tr",{key:e[i],staticClass:"dynamic-sub-section",class:t.getRowID(i+e[i]+r)+" "+t.ifHidden(t.sanitizeKey(i+e[i]+r))},[n("td",{attrs:{colspan:t.topRowNumber}},[n("research-byogl-section",{attrs:{sectionId:t.sectionId,rowId:t.getRowID(i+e[i]+r),colors:t.colors,starItems:t.starItems,multiSectionPage:t.multiSectionPage,plotMargin:t.plotMargin,subSectionConfig:a["subsection"],subSectionData:t.collectSubsectionData(t.sanitizeKey(i+e[i]+r)),phenotypeMap:t.phenotypeMap,utils:t.utils}})],1)]):t._e()]:t._e()}))]}))],2)]):t._e()]),t.dataset&&t.perPageNumber&&null!=t.perPageNumber&&0!=t.perPageNumber?n("b-container",{staticClass:"egl-table-page-ui-wrapper"},[n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.rows,"per-page":t.perPageNumber,phenotypeMap:t.phenotypeMap},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1):t._e()],1)],1)},a=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("option",{attrs:{value:"0"}},[n("span",{staticStyle:{color:"#f00"}},[t._v("All")])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("tr",[n("td",[n("strong",[t._v("Show / hide columns")])])])}],i=n("1da1"),o=n("53ca"),s=n("3835"),l=n("5530"),c=n("2909"),u=(n("a4d3"),n("e01a"),n("b636"),n("d28b"),n("944a"),n("d9e2"),n("99af"),n("4de4"),n("caad"),n("d81d"),n("14d9"),n("fb6a"),n("a434"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("4fad"),n("3410"),n("b64b"),n("1f68"),n("131a"),n("d3b7"),n("07ac"),n("ac1f"),n("25f0"),n("6062"),n("1e70"),n("79a4"),n("c1a1"),n("8b00"),n("a4e7"),n("1e5a"),n("72c3"),n("2532"),n("3ca3"),n("5319"),n("841c"),n("498a"),n("0643"),n("2382"),n("4e3e"),n("a573"),n("159b"),n("ddb0"),n("2b0e")),h=n("986e"),p=n("0e28"),f=n("0e37"),_=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"sub-section-header"},[t.subSectionConfig["label"]?n("strong",[t._v(t._s(t.subSectionConfig["label"]))]):t._e()]),!t.subSectionConfig["visualizers"]||"tabs"!=t.subSectionConfig["visualizers"]["wrapper type"]&&"divs"!=t.subSectionConfig["visualizers"]["wrapper type"]?t._e():n("div",{staticClass:"sub-plot-wrapper"},[n("div",{staticClass:"sub-tab-ui-wrapper",attrs:{id:"tabUiGroup"+t.rowId}},t._l(t.subSectionConfig["visualizers"]["visualizers"],(function(e,r){return n("div",{staticClass:"tab-ui-tab",class:0==r?"active":"",attrs:{id:"tabUi"+t.rowId+r},on:{click:function(e){return t.utils.uiUtils.setTabActive("tabUi"+t.rowId+r,"tabUiGroup"+t.rowId,"tabContent"+t.rowId+r,"tabContentGroup"+t.rowId,!0)}}},[t._v(" "+t._s(e.label)+" ")])})),0),n("div",{attrs:{id:"tabs"==t.subSectionConfig["visualizers"]["wrapper type"]?"tabContentGroup"+t.rowId:""}},t._l(t.subSectionConfig["visualizers"]["visualizers"],(function(e,r){return n("div",{staticClass:"plot-tab-content-wrapper",class:"tabs"==t.subSectionConfig["visualizers"]["wrapper type"]?0==r?"":"hidden-content":"",attrs:{id:"tabs"==t.subSectionConfig["visualizers"]["wrapper type"]?"tabContent"+t.rowId+r:""}},["tabs"!=t.subSectionConfig["visualizers"]["wrapper type"]?n("h6",{domProps:{innerHTML:t._s(e.label)}}):t._e(),n("research-section-visualizers",{attrs:{plotConfig:e,plotData:t.currentData,phenotypeMap:t.phenotypeMap,colors:t.colors,plotMargin:t.plotMargin,sectionId:(t.rowId+r).replaceAll(",",""),utils:t.utils,searchParameters:t.rowId}})],1)})),0)]),t.subSectionConfig["visualizer"]?n("div",{staticClass:"sub-plot-wrapper"},[n("research-section-visualizers",{attrs:{plotConfig:t.subSectionConfig["visualizer"],plotData:t.currentData,phenotypeMap:t.phenotypeMap,colors:t.colors,plotMargin:t.plotMargin,sectionId:t.rowId.replaceAll(",",""),utils:t.utils,searchParameters:t.rowId}})],1):t._e(),n("table",{staticClass:"table table-sm table-striped research-data-table subsection-table"},[n("thead",[n("tr",[t.tableFormat["star column"]?n("th",{staticClass:"star-items-control"},[n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer"},attrs:{icon:t.stared?"star-fill":"star"}}),n("span",{staticClass:"star-items-options"},[n("ul",[n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.showHideStared()}}},[t._v("Show stard only")])]),n("li",[n("a",{attrs:{href:"javascript:;"},on:{click:function(e){return t.starAll()}}}
3,[t._v("Star / unstar all")])])])])],1):t._e(),t._l(t.getTopRows(),(function(e){return n("th",[n("span",[t._v(t._s(e))])])}))],2)]),n("tbody",[t._l(t.subPageData,(function(e,r){return n("tr",[t.tableFormat["star column"]?n("td",[0==t.checkStared("1",e)?n("span",[n("b-icon",{staticStyle:{color:"#aaaaaa",cursor:"pointer"},attrs:{icon:"star"},on:{click:function(n){return t.addStar(e)}}})],1):t._e(),1==t.checkStared("2",e)?n("span",[n("b-icon",{staticStyle:{color:"#ffcc00",cursor:"pointer"},attrs:{icon:"star-fill"},on:{click:function(n){return t.removeStar(e)}}})],1):t._e()]):t._e(),t._l(t.getTopRows(),(function(r){return n("td",[n("span",{domProps:{innerHTML:t._s(t.formatValue(e[r],r,e))}}),t.tableFormat["column formatting"]&&t.tableFormat["column formatting"][r]&&t.tableFormat["column formatting"][r].type.includes("copy to clipboard")?n("b-btn",{staticClass:"copy-to-clipboard",on:{click:function(n){return t.utils.uiUtils.copy2Clipboard(e[r])}}},[t._v("Copy")]):t._e()],1)}))],2)})),n("tr",[n("td",{attrs:{colspan:t.getTopRows().length}},[n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-left"},[n("span",[t._v(t._s("Total rows: "+t.currentData.length))])]),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-center"},[n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.currentData.length,"per-page":t.numberOfRows,phenotypeMap:t.phenotypeMap},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}})],1),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-right"},[n("div",[n("strong",[t._v("Save data in section: ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.convertJson2Csv(t.currentData,t.rowId+"_subsection")}}},[t._v(" CSV ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.saveJson(t.currentData,t.rowId+"_subsection")}}},[t._v(" JSON ")])])])],1)])],2)])])},g=[],m=n("1157"),v=n.n(m),y=n("a661"),b=n("ea6f"),x=u["default"].component("research-sub-section",{props:["sectionId","rowId","subSectionConfig","subSectionData","phenotypeMap","utils","colors","starItems","plotMargin","multiSectionPage"],components:{ResearchSectionVisualizers:y["a"],ResearchSectionComponents:b["a"]},data:function(){return{currentData:null,currentPage:1,numberOfRows:10,stared:!1,staredAll:!1}},modules:{},created:function(){this.currentData=this.subSectionData,this.subSectionConfig["share parent filters"]&&this.filterData()},mounted:function(){},computed:{subPageData:function(){for(var t=[],e=this.currentData.length,n=(this.currentPage-1)*this.numberOfRows,r=e-this.currentPage*this.numberOfRows>0?this.currentPage*this.numberOfRows:e,a=n;a<r;a++)this.currentData[a]&&t.push(this.currentData[a]);return t},tableFormat:function(){return this.subSectionConfig["table format"]?this.subSectionConfig["table format"]:null}},watch:{"$parent.$parent.filterValues":function(t){this.currentData=this.subSectionData,this.subSectionConfig["share parent filters"]&&this.filterData()}},methods:{getColumns:function(t){var e,n=this;return e=this.currentData.filter((function(e){return e[n.tableFormat["star column"]]==t}))[0],e},starAll:function(){var t=this;if(1==this.staredAll){if(this.staredAll=!1,this.multiSectionPage){var e=Object(c["a"])(new Set(this.starItems));e=e.filter((function(e){return e.section!=t.sectionId+"_"+t.rowId})),this.$parent.$emit("on-star",e)}}else if(this.staredAll=!0,this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems));this.subSectionData.map((function(e){var r=e[t.tableFormat["star column"]],a={type:t.tableFormat["star column"],id:r,columns:t.getColumns(r),section:t.sectionId+"_"+t.rowId};n.push(a)})),this.$parent.$emit("on-star",n)}},addStar:function(t){var e=t[this.tableFormat["star column"]];if(this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems)),r={type:this.tableFormat["star column"],id:e,columns:this.getColumns(e),section:this.sectionId+"_"+this.rowId};n.push(r),this.$parent.$emit("on-star",n)}},removeStar:function(t){var e=t[this.tableFormat["star column"]];if(this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems)).filter((function(t){return t.id!=e}));this.$parent.$emit("on-star",n)}},checkStared:function(t,e){var n=this;if(e){var r;this.multiSectionPage&&(r=this.starItems.filter((function(t){return t.type==n.tableFormat["star column"]})).map((function(t){return t.id})));var a=e[this.tableFormat["star column"]];return!!r.includes(a)}return!1},showHideStared:function(){0==this.stared?this.stared=!0:this.stared=!1},filterData:function(){var t=this,e=(this.$parent.$parent.sectionConfig["pre filters"],this.$parent.$parent.sectionConfig.filters),n=this.$parent.$parent.filtersIndex,r=this.$parent.$parent.filterValues,a=this.subSectionData;r.length<1?(this.currentData=[],a.map((function(n){e.map((function(e){"checkbox"==e.type&&e.uncheck&&(e.uncheck.includes(n[e.field])||t.currentData.push(n))}))}))):(this.currentData=[],a.map((function(a){var i=!0;e.map((function(t){var e="checkbox"==t.type?r:n[t.field].search;if(a[t.field]&&void 0!=a[t.field]&&e&&e.length>0){var o=a[t.field];switch(t.type){case"checkbox":e.includes(o)||(i=!1);break;case"search greater than":"number"==typeof o&&o<e[0]&&(i=!1);break;case"search lower than":"number"==typeof o&&o>e[0]&&(i=!1);break;case"dropdown":o.toString()!=e[0]&&(i=!1);break;case"dropdown word":!o.toLowerCase().includes(e[0].toLowerCase())&&(i=!1);break;case"search":!o.toLowerCase().includes(e[0].toLowerCase())&&(i=!1);break;case"search exact":e[0].toLowerCase()!==o.toString().toLowerCase()&&(i=!1);break;case"search or":searchVals=e[0].split(","),("number"!=typeof o||!(o<=searchVals[0].trim()||o>=searchVals[1].trim()))&&(i=!1);break;case"search and":searchVals=e[0].split(","),!("number"==typeof o&&o>=searchVals[0].trim()&&o<=searchVals[1].trim())&&(i=!1);break;case"slider":searchVals=e[0].split(","),!("number"==typeof o&&o>=searchVals[0].trim()&&o<=searchVals[1].trim())&&(i=!1);break}}})),1==i&&t.currentData.push(a)})))},convertJson2Csv:function(t,e){var n=this.utils.dataConvert.flatJson(t);this.utils.uiUtils.saveByorCsv(n,e)},saveJson:function(t,e){this.utils.uiUtils.saveJson(t,e)},getTopRows:function(){var t=[];return t=this.subSectionConfig["table format"]&&this.subSectionConfig["table format"]["top rows"]?this.subSectionConfig["table format"]["top rows"]:Object.keys(this.subSectionData[0]),t},formatValue:function(t,e,n){var r,a=this.subSectionConfig["table format"];if(a&&a["column formatting"]&&a["column formatting"][e]){var i=a["column formatting"][e].type;r=i.includes("kp phenotype link")?this.utils.Formatters.BYORColumnFormatter(t,e,a,this.phenotypeMap,null):this.utils.Formatters.BYORColumnFormatter(t,e,a,null,null,n)}else r=t;return r},receiveLDData:function(t){this.$emit("ld-data-loaded",t)}}});v()((function(){}));var w=x,C=(n("0241"),n("2877")),P=Object(C["a"])(w,_,g,!1,null,"4be57a3c",null),k=P.exports,M=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"sub-tab-ui-wrapper",attrs:{id:"byoglTabUiGroup"+t.sectionId+t.rowId}},[t.tableFormat.features.includes("genes in list")?n("div",{staticClass:"tab-ui-tab active",attrs:{id:"byoglTabUi"+t.sectionId+t.rowId+"0"},on:{click:function(e){return t.utils.uiUtils.setTabActive("byoglTabUi"+t.sectionId+t.rowId+"0","byoglTabUiGroup"+t.sectionId+t.rowId,"byoglTabContent"+t.sectionId+t.rowId+"0","byoglTabContentGroup"+t.sectionId+t.rowId)}}},[t._v(" Genes predicted to be in your gene list")]):t._e(),t.tableFormat.features.includes("cfde gene set")?n("div",{staticClass:"tab-ui-tab",attrs:{id:"byoglTabUi"+t.sectionId+t.rowId+"1"},on:{click:function(e){return t.utils.uiUtils.setTabActive("byoglTabUi"+t.sectionId+t.rowId+"1","byoglTabUiGroup"+t.sectionId+t.rowId,"byoglTabContent"+t.sectionId+t.rowId+"1","byoglTabContentGroup"+t.sectionId+t.rowId)}}},[t._v(" CFDE gene sets that predict membership in your gene list")]):t._e(),t.tableFormat.features.includes("human traits")?n("div",{staticClass:"tab-ui-tab",attrs:{id:"byoglTabUi"+t.sectionId+t.rowId+"2"},on:{click:function(e){return t.utils.uiUtils.setTabActive("byoglTabUi"+t.sectionId+t.rowId+"2","byoglTabUiGroup"+t.sectionId+t.rowId,"byoglTabContent"+t.sectionId+t.rowId+"2","byoglTabContentGroup"+t.sectionId+t.rowId)}}},[t._v(" Human traits that share genes with your input list")]):t._e()]),n("div",{attrs:{id:"byoglTabContentGroup"+t.sectionId+t.rowId}},[t.geneScores?n("div",{staticClass:"tab-content-wrapper",attrs:{id:"byoglTabContent"+t.sectionId+t.rowId+"0"}},[n("table",{staticClass:"table table-sm table-striped research-data-table subsection-table"},[t._m(0),n("tbody",[t._l(t.getSubPageData(t.geneScores,t.tab0Page),(function(e,r){return n("tr",[n("td",[t._v(t._s(e["gene"]))]),n("td",[t._v(t._s(t.utils.Formatters.pValueFormatter(e["score"])))])])})),n("tr",[n("td",{attrs:{colspan:"2"}},[n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-left"},[n("span",[t._v(t._s("Total rows: "+t.geneScores.length))])]),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-center"},[n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.geneScores.length,"per-page":t.numberOfRows,phenotypeMap:t.phenotypeMap},model:{value:t.tab0Page,callback:function(e){t.tab0Page=e},expression:"tab0Page"}})],1),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-right"},[n("div",[n("strong",[t._v("Save data in section: ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.convertJson2Csv(t.geneScores,t.rowId+"_geneScores")}}},[t._v(" CSV ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.saveJson(t.geneScores,t.rowId+"_geneScores")}}}
3,[t._v(" JSON ")])])])],1)])],2)])]):t._e(),t.geneSetScores?n("div",{staticClass:"tab-content-wrapper hidden-content",attrs:{id:"byoglTabContent"+t.sectionId+t.rowId+"1"}},[n("table",{staticClass:"table table-sm table-striped research-data-table subsection-table"},[t._m(1),n("tbody",[t._l(t.getSubPageData(t.geneSetScores,t.tab1Page),(function(e,r){return n("tr",[n("td",[t._v(t._s(e["geneSet"]))]),n("td",[t._v(t._s(t.utils.Formatters.pValueFormatter(e["score"])))])])})),n("tr",[n("td",{attrs:{colspan:"2"}},[n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-left"},[n("span",[t._v(t._s("Total rows: "+t.geneSetScores.length))])]),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-center"},[n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.geneSetScores.length,"per-page":t.numberOfRows,phenotypeMap:t.phenotypeMap},model:{value:t.tab1Page,callback:function(e){t.tab1Page=e},expression:"tab1Page"}})],1),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-right"},[n("div",[n("strong",[t._v("Save data in section: ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.convertJson2Csv(t.geneSetScores,t.rowId+"_geneSetScores")}}},[t._v(" CSV ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.saveJson(t.geneSetScores,t.rowId+"_geneSetScores")}}},[t._v(" JSON ")])])])],1)])],2)])]):t._e(),t.humanTraits?n("div",{staticClass:"tab-content-wrapper hidden-content",attrs:{id:"byoglTabContent"+t.sectionId+t.rowId+"2"}},[n("table",{staticClass:"table table-sm table-striped research-data-table subsection-table"},[t._m(2),n("tbody",[t._l(t.getSubPageData(t.humanTraits,t.tab2Page),(function(e,r){return n("tr",[n("td",[t._v(t._s(e["phenotype"]))]),n("td",[t._v(t._s(t.utils.Formatters.pValueFormatter(e["p_value"])))])])})),n("tr",[n("td",{attrs:{colspan:"2"}},[n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-left"},[n("span",[t._v(t._s("Total rows: "+t.humanTraits.length))])]),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-center"},[n("b-pagination",{staticClass:"pagination-sm justify-content-center",attrs:{"total-rows":t.humanTraits.length,"per-page":t.numberOfRows,phenotypeMap:t.phenotypeMap},model:{value:t.tab2Page,callback:function(e){t.tab2Page=e},expression:"tab2Page"}})],1),n("b-container",{staticClass:"egl-table-page-ui-wrapper subsection-page-ui-right"},[n("div",[n("strong",[t._v("Save data in section: ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.convertJson2Csv(t.humanTraits,t.rowId+"_humanTraitsScores")}}},[t._v(" CSV ")]),n("div",{staticClass:"convert-2-csv btn-sm",on:{click:function(e){return t.saveJson(t.humanTraits,t.rowId+"_humanTraitsScores")}}},[t._v(" JSON ")])])])],1)])],2)])]):t._e()])])},E=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("thead",[n("tr",[n("th",[t._v(" Gene ")]),n("th",[t._v(" Predicted probability ")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("thead",[n("tr",[n("th",[t._v(" Gene set ")]),n("th",[t._v(" Marginal effect ")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("thead",[n("tr",[n("th",[t._v(" Phenotype ")]),n("th",[t._v(" P-value ")])])])}];n("e9c4");function D(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */D=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};u(x,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==n&&r.call(C,s)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
vendor: 7,250 bytes, line 3
3function M(t,e){function n(a,i,s,l){var c=h(t[a],t,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(o["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=O(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function O(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,O(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function j(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function A(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(o["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),u(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),u(P,c,"Generator"),u(P,s,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=A,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;j(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:A(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var O=u["default"].component("research-byogl-section",{props:["sectionId","rowId","subSectionConfig","subSectionData","phenotypeMap","utils","colors","starItems","plotMargin","multiSectionPage"],components:{},data:function(){return{currentData:null,tab0Page:1,tab1Page:1,tab2Page:1,numberOfRows:10,stared:!1,staredAll:!1,geneScores:null,geneSetScores:null,humanTraits:null}},modules:{},created:function(){this.currentData=this.subSectionData,this.subSectionConfig["share parent filters"]&&this.filterData()},mounted:function(){this.getByoglData(this.customGeneSet)},computed:{customGeneSet:function(){var t=this,e=Object(c["a"])(new Set(this.currentData.map((function(e){return e[t.tableFormat["genes"]]}))));return e},tableFormat:function(){return this.subSectionConfig["table format"]?this.subSectionConfig["table format"]:null}},watch:{"$parent.$parent.filterValues":function(t){this.currentData=this.subSectionData,this.subSectionConfig["share parent filters"]&&this.filterData()}},methods:{getSubPageData:function(t,e){for(var n=[],r=t.length,a=(e-1)*this.numberOfRows,i=r-e*this.numberOfRows>0?e*this.numberOfRows:r,o=a;o<i;o++)t[o]&&n.push(t[o]);return n},fetchApi:function(t,e,n){return Object(i["a"])(D().mark((function r(){var a;return D().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,fetch(n,{method:"POST",headers:t,body:JSON.stringify(e)});case 2:if(a=r.sent,a.ok){r.next=5;break}throw new Error("Request failed with status ".concat(a.status));case 5:return r.abrupt("return",a.json());case 6:case"end":return r.stop()}}),r)})))()},getByoglData:function(t){var e=this,n="https://translator.broadinstitute.org/genetics_provider/bayes_gene/gene_scores",r="https://translator.broadinstitute.org/genetics_provider/bayes_gene/phenotypes",a={"Content-Type":"application/json"}
3,i={p_value:"0.05",max_number_gene_sets:150,gene_sets:"cfde",genes:t},o={max_number_gene_sets:150,genes:t};this.fetchApi(a,i,n).then((function(t){var n=[];Object.keys(t["gene_scores"]).map((function(e){n.push({gene:e,score:t["gene_scores"][e]})})),e.geneScores=n;var r=[];Object.keys(t["gene_set_scores"]).map((function(e){r.push({geneSet:e,score:t["gene_set_scores"][e]})})),e.geneSetScores=r})).catch((function(t){})),this.fetchApi(a,o,r).then((function(t){e.humanTraits=t["phenotypes"]})).catch((function(t){}))},getColumns:function(t){var e=this,n=this.currentData.filter((function(n){return n[e.tableFormat["star column"]]==t}))[0];return n},starAll:function(){var t=this;if(1==this.staredAll){if(this.staredAll=!1,this.multiSectionPage){var e=Object(c["a"])(new Set(this.starItems));e=e.filter((function(e){return e.section!=t.sectionId+"_"+t.rowId})),this.$parent.$emit("on-star",e)}}else if(this.staredAll=!0,this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems));this.subSectionData.map((function(e){var r=e[t.tableFormat["star column"]],a={type:t.tableFormat["star column"],id:r,columns:t.getColumns(r),section:t.sectionId+"_"+t.rowId};n.push(a)})),this.$parent.$emit("on-star",n)}},addStar:function(t){var e=t[this.tableFormat["star column"]];if(this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems)),r={type:this.tableFormat["star column"],id:e,columns:this.getColumns(e),section:this.sectionId+"_"+this.rowId};n.push(r),this.$parent.$emit("on-star",n)}},removeStar:function(t){var e=t[this.tableFormat["star column"]];if(this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems)).filter((function(t){return t.id!=e}));this.$parent.$emit("on-star",n)}},checkStared:function(t,e){var n=this;if(e){var r;this.multiSectionPage&&(r=this.starItems.filter((function(t){return t.type==n.tableFormat["star column"]})).map((function(t){return t.id})));var a=e[this.tableFormat["star column"]];return!!r.includes(a)}return!1},showHideStared:function(){0==this.stared?this.stared=!0:this.stared=!1},filterData:function(){var t=this,e=(this.$parent.$parent.sectionConfig["pre filters"],this.$parent.$parent.sectionConfig.filters),n=this.$parent.$parent.filtersIndex,r=this.$parent.$parent.filterValues,a=this.subSectionData;r.length<1?(this.currentData=[],a.map((function(n){e.map((function(e){"checkbox"==e.type&&e.uncheck&&(e.uncheck.includes(n[e.field])||t.currentData.push(n))}))}))):(this.currentData=[],a.map((function(a){var i=!0;e.map((function(t){var e="checkbox"==t.type?r:n[t.field].search;if(a[t.field]&&void 0!=a[t.field]&&e&&e.length>0){var o=a[t.field];switch(t.type){case"checkbox":e.includes(o)||(i=!1);break;case"search greater than":"number"==typeof o&&o<e[0]&&(i=!1);break;case"search lower than":"number"==typeof o&&o>e[0]&&(i=!1);break;case"dropdown":o.toString()!=e[0]&&(i=!1);break;case"dropdown word":!o.toLowerCase().includes(e[0].toLowerCase())&&(i=!1);break;case"search":!o.toLowerCase().includes(e[0].toLowerCase())&&(i=!1);break;case"search exact":e[0].toLowerCase()!==o.toString().toLowerCase()&&(i=!1);break;case"search or":searchVals=e[0].split(","),("number"!=typeof o||!(o<=searchVals[0].trim()||o>=searchVals[1].trim()))&&(i=!1);break;case"search and":searchVals=e[0].split(","),!("number"==typeof o&&o>=searchVals[0].trim()&&o<=searchVals[1].trim())&&(i=!1);break;case"slider":searchVals=e[0].split(","),!("number"==typeof o&&o>=searchVals[0].trim()&&o<=searchVals[1].trim())&&(i=!1);break}}})),1==i&&t.currentData.push(a)})))},convertJson2Csv:function(t,e){var n=this.utils.dataConvert.flatJson(t);this.utils.uiUtils.saveByorCsv(n,e)},saveJson:function(t,e){this.utils.uiUtils.saveJson(t,e)},getTopRows:function(){var t=[];return t=this.subSectionConfig["table format"]&&this.subSectionConfig["table format"]["top rows"]?this.subSectionConfig["table format"]["top rows"]:Object.keys(this.subSectionData[0]),t},formatValue:function(t,e,n){var r,a=this.subSectionConfig["table format"];if(a&&a["column formatting"]&&a["column formatting"][e]){var i=a["column formatting"][e].type;r=i.includes("kp phenotype link")?this.utils.Formatters.BYORColumnFormatter(t,e,a,this.phenotypeMap,null):this.utils.Formatters.BYORColumnFormatter(t,e,a,null,null,n)}else r=t;return r}}});v()((function(){}));var L=O,j=(n("7b68"),Object(C["a"])(L,M,E,!1,null,"21e99b7e",null)),S=j.exports;function A(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */A=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,o=Object.create(i.prototype),s=new j(r||[]);return a(o,"_invoke",{value:E(t,n,s)}),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",f="suspendedYield",_="executing",g="completed",m={};function v(){}function y(){}function b(){}var x={};u(x,s,(function(){return this}));var w=Object.getPrototypeOf,C=w&&w(w(S([])));C&&C!==n&&r.call(C,s)&&(x=C);var P=b.prototype=v.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}
3function M(t,e){function n(a,i,s,l){var c=h(t[a],t,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(o["a"])(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,l)}))}l(c.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,a){n(t,r,e,a)}))}return i=i?i.then(a,a):a()}})}function E(e,n,r){var a=p;return function(i,o){if(a===_)throw Error("Generator is already running");if(a===g){if("throw"===i)throw o;return{value:t,done:!0}}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var l=D(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=_;var c=h(e,n,r);if("normal"===c.type){if(a=r.done?g:f,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a=g,r.method="throw",r.arg=c.arg)}}}function D(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,D(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=h(a,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function S(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Object(o["a"])(e)+" is not iterable")}return y.prototype=b,a(P,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:y,configurable:!0}),y.displayName=u(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},k(M.prototype),u(M.prototype,l,(function(){return this})),e.AsyncIterator=M,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new M(d(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},k(P),u(P,c,"Generator"),u(P,s,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=S,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}var I=u["default"].component("research-data-table",{props:["pageID","dataset","tableFormat","initPerPageNumber","tableLegend","dataComparisonConfig","searchParameters","pkgData","pkgDataSelected","phenotypeMap","multiSectionPage","summarySection","starItems","sectionId","utils","region","regionZoom","regionViewArea","colors","plotMargin"],data:function(){return{currentPage:1,perPageNumber:null,featureRowsNumber:10,compareGroups:[],stared:!1,staredAll:!1,selected:null,subSectionData:[],subSectionHidden:[],subSectionLoading:[]}},modules:{},components:{ResearchDataTableFeatures:p["a"],ResearchSummaryPlot:f["a"],ResearchSubSection:k,ResearchByoglSection:S},created:function(){},beforeMount:function(){},mounted:function(){this.perPageNumber=this.initPerPageNumber},updated:function(){},computed:{filteredData:function(){return this.multiSectionPage?this.dataset:this.$store.state.filteredData},dataScores:function(){if(this.dataset&&this.tableFormat&&void 0!=this.tableFormat["column formatting"]){var t={},e=this.tableFormat["column formatting"];for(var n in e){var r=null;if((e[n].type.includes("render background percent")||e[n].type.includes("render background percent negative"))&&(r=!0),r){for(var a in e)t[a]={high:null,low:null};this.dataset.map((function(n){for(var r in t){var a="number"!=typeof n[r]?e[r]["percent if empty"]:n[r];t[r].high=null==t[r].high||t[r].high<a?a:t[r].high,t[r].low=null==t[r].low||t[r].low>a?a:t[r].low}}))}}return Object.keys(t).length>0?t:null}return null},rows:function(){if(this.dataset)return null==this.dataComparisonConfig?this.rawData.length:Object.keys(this.rawData).length},viewingRegion:function(){if(null==this.region)return null;var t={};t["chr"]=parseInt(this.region.split(":")[0],10);var e=this.region.split(":")[1].split("-"),n=this.region.split(":")[0],r=parseInt(e[0],10),a=parseInt(e[1],10),i=a-r;if(this.regionZoom>0){var o=Math.round(i*(this.regionZoom/200)),s=Math.round(o*(this.regionViewArea/100));t["chr"]=n,t["start"]=r+o+s,t["end"]=a-o+s}else 0==this.regionZoom&&(t["chr"]=n,t["start"]=r,t["end"]=a);return t},rawData:function(){var t=this,e=this.tableFormat["data zoom"]?this.tableFormat["data zoom"].position:null,n=this.viewingRegion?this.viewingRegion.start:null,r=this.viewingRegion?this.viewingRegion.end:null,a=[];if(null==this.dataComparisonConfig){var i=Object(c["a"])(new Set(this.dataset));this.tableFormat["data zoom"]&&n&&r&&(i=i.filter((function(t){return t[e]>=n&&t[e]<=r}))),i.map((function(e){var n={};t.tableFormat["top rows"].map((function(t){n[t]=e[t]})),t.tableFormat["star column"]&&!n[t.tableFormat["star column"]]&&(n[t.tableFormat["star column"]]=e[t.tableFormat["star column"]]),void 0!=t.tableFormat["features"]&&(n["features"]={},t.tableFormat["features"].map((function(r){if(e[r])n["features"][r]=e[r];else{n["features"][r]=[];var a={};t.tableFormat[r].map((function(t){a[t]=e[t]})),n["features"][r].push(a)}}))),a.push(n)}))}else{var o=Object(l["a"])({},this.dataset);if(this.tableFormat["data zoom"]&&n&&r)for(var u=0,h=Object.entries(o);u<h.length;u++){var p=Object(s["a"])(h[u],2),f=p[0],_=p[1];(_[e]<n||_[e]>r)&&(delete o[f],deleteCount++)}for(var g=function(){var e=Object(s["a"])(v[m],2),n=(e[0],e[1]),r={};t.tableFormat["top rows"].map((function(t){r[t]=n[t]})),t.tableFormat["star column"]&&!r[t.tableFormat["star column"]]&&(r[t.tableFormat["star column"]]=d[t.tableFormat["star column"]]),void 0!=t.tableFormat["features"]&&(r["features"]={},t.tableFormat["features"].map((function(e){if(n[e])r["features"][e]=n[e];else{r["features"][e]=[];var a={};t.tableFormat[e].map((function(t){a[t]=n[t]})),r["features"][e].push(a)}}))),a.push(r)},m=0,v=Object.entries(o);m<v.length;m++)g()}if(1==this.stared){var y=[];a.map((function(e){1==t.checkStared("3",e)&&y.push(e)})),a=y}else a=a;return a},pagedData:function(){var t=this;if(this.perPageNumber&&null!=this.perPageNumber){for(var e=this.rawData,n=[],r=0!=Number(this.perPageNumber)?Number(this.perPageNumber):e.length,a=(this.currentPage-1)*r,i=this.rows-this.currentPage*r>0?this.currentPage*r:this.rows,o=a;o<i;o++)e[o]&&n.push(e[o]);return n}var s=this.rawData;if(1==this.stared){var l=[];s.map((function(e){1==t.checkStared("4",e)&&l.push(e)})),s=l}else s=s;return s},topRows:function(){return this.tableFormat["top rows"]},topRowNumber:function(){var t=void 0!=this.tableFormat["features"]?this.tableFormat["top rows"].length+1:this.tableFormat["top rows"].length;return t+=this.tableFormat["star column"]?1:0,t}},watch:{subSectionData:function(t){},featureRowsNumber:function(t){this.$emit("on-feature-rows-change",t)},dataset:function(t){var e=this;if(null!=this.dataComparisonConfig){this.compareGroups=[];for(var n=this.searchParameters[this.dataComparisonConfig["fields group data key"][0]].search.length,r=function(t){var n="";e.dataComparisonConfig["fields group data key"].map((function(r){n+=e.searchParameters[r].search[t]+" "})),e.compareGroups.push(n.slice(0,-1))},a=0;a<n;a++)r(a)}}},methods:{selectSplice:function(t){this.$emit("splice",t)},checkFeatureExist:function(t,e){var n=!0,r=t;return e.map((function(t){r=r[t],r&&""!=r&&void 0!=r||(n=!1)})),n},getRowID:function(t){var e=this.sanitizeKey(t);return e.replace(/[^a-zA-Z0-9]/g,"_")},ifHidden:function(t){var e=this.getRowID(t);return this.subSectionHidden.includes(e)?"hidden":""}
3,setParameter:function(t,e,n,r,a){var i=this,s="all"==n?"":[n];if("object"===Object(o["a"])(r)){var l=t.split(","),c={},u={};r.map((function(t,e){c[t]=document.getElementById("search_param_"+t).value})),r.map((function(t,e){u[t]=l[e]})),a&&Object.keys(a).map((function(t){var e=c[t],n=u[t],r=u[a[t]["parameter to compare"]];switch(a[t]["parameter type"]){case"region":var i,o=[],s=[],l=[e,n,r];switch(l.map((function(t){t&&""!=t&&t.split(":").map((function(t,e){if(0==e)i=t;else{var n=t.split("-");o.push(Number(n[0])),s.push(Number(n[1]))}}))})),a[t]["compare type"]){case"set wider":var d=i,h=Math.min.apply(Math,o),p=Math.max.apply(Math,s);u[t]=d+":"+h+"-"+p;break}break}})),r.map((function(t){document.getElementById("search_param_"+t).value=u[t],i.$root.$refs.multiSectionSearch.updateSearch(t,s)}))}else document.getElementById("search_param_"+r).value=t,this.$root.$refs.multiSectionSearch.updateSearch(r,s)},sanitizeKey:function(t){return t.split(",").filter((function(t){return"*"!=t})).toString()},ifSubsectionData:function(t){var e=this.getRowID(t),n=this.subSectionData.filter((function(t){return t.key==e}));return n.length>0},ifSubsectionLoading:function(t){var e=this.getRowID(t),n=this.subSectionLoading.indexOf(e);return n>-1},collectSubsectionData:function(t){var e=this.getRowID(t),n=this.subSectionData.filter((function(t){return t.key==e})),r=[];return n.length>0&&n.map((function(t){r=r.concat(t.data)})),r},getSubsectionData:function(t,e,n){var r=this.tableFormat["column formatting"][e]["subsection"]["data point"],a=this.tableFormat["column formatting"][e]["subsection"]["table format"],i=r["type"],o=r["parameters type"],s=r["parameters"],l=t.split(",").filter((function(t){return"*"!=t})).toString(),c=this.ifSubsectionData(this.sanitizeKey(e+l+n));if(1!=c){var u=l;switch(i){case"bioindex":this.queryBioindex(u,o,s,r,a,n,e);break;case"api":this.queryApi(u,o,s,r,a,n,e);break}}else{var d=this.getRowID(e+l+n);this.utils.uiUtils.showHideElement(d);var h=document.getElementsByClassName(d)[0].classList;h.contains("hidden")?this.subSectionHidden.push(d):this.subSectionHidden=this.subSectionHidden.filter((function(t){return t!=d}))}},queryBioindex:function(t,e,n,r,a,o,s){var l=this;return Object(i["a"])(A().mark((function i(){var c,u,d;return A().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return c=r.url,u=l.getRowID(s+t+o),"replace"==e?n.map((function(e,n){t.split(",")[n]?c=c.replace("$"+e,t.split(",")[n]):(c=c.replace("$"+e+",",""),c=c.replace(",$"+e,""),c=c.replace("$"+e,""))})):c=c+"query/"+r.index+"?q="+t,l.subSectionLoading.push(u),i.next=6,fetch(c).then((function(t){return t.json()}));case 6:d=i.sent,l.subSectionLoading.splice(l.subSectionLoading.indexOf(u),1),null==d.error&&Array.isArray(d.data)&&d.data.length>0&&l.processLoadedBI(d,t,r,a,o,s);case 9:case"end":return i.stop()}}),i)})))()},queryBiContinue:function(t,e,n,r,a,o){var s=this;return Object(i["a"])(A().mark((function i(){var l,c;return A().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n["parameters"],"replace"==n["parameters type"]?(l=n["continue url"],l+=t):l=n.url+"cont?token="+t,i.next=4,fetch(l).then((function(t){return t.json()}));case 4:c=i.sent,null==c.error&&Array.isArray(c.data)&&c.data.length>0&&s.processLoadedBI(c,e,n,r,a,o);case 6:case"end":return i.stop()}}),i)})))()},processLoadedBI:function(t,e,n,r,a,i){var o=this,s=t.data,l=r;if(l&&l["data convert"]){var u=l["data convert"];s=this.utils.dataConvert.convertData(u,s,this.phenotypeMap,this.$root.sharedResource)}if(l["pre filters"]){var d=Object(c["a"])(new Set(s)),h=l["pre filters"],p={};h.map((function(t){p[t.parameter]=o.utils.keyParams[t.parameter]}));var f=this.utils.filterUtils.applyFilters(h,d,p);s=f}var _={key:this.getRowID(i+e+a),data:s};this.subSectionData.push(_),t.continuation&&this.queryBiContinue(t.continuation,e,n,r,a,i)},queryApi:function(t,e,n,r,a,o,s){var l=this;return Object(i["a"])(A().mark((function i(){var c,u,d,h,p;return A().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return c=r.url,u=l.getRowID(s+t+o),"replace"==e&&n.map((function(e,n){t.split(",")[n]?c=c.replace("$"+e,t.split(",")[n]):(c=c.replace("$"+e+",",""),c=c.replace(",$"+e,""),c=c.replace("$"+e,""))})),l.subSectionLoading.push(u),i.prev=4,i.next=7,fetch(c).then((function(t){return t.json()}));case 7:d=i.sent,l.subSectionLoading.splice(l.subSectionLoading.indexOf(u),1),d&&(h={},r["data wrapper"]?(p=d,r["data wrapper"].map((function(t){p=p[t]}
3)),Array.isArray(p)||(p=[p]),h["data"]=p):h["data"]=CONTENT,l.processLoadedApi(h,t,r,a,o,s)),i.next=14;break;case 12:i.prev=12,i.t0=i["catch"](4);case 14:case"end":return i.stop()}}),i,null,[[4,12]])})))()},processLoadedApi:function(t,e,n,r,a,i){var o=t.data,s=r;if(s&&s["data convert"]){var l=s["data convert"];o=this.utils.dataConvert.convertData(l,o,this.phenotypeMap,this.$root.sharedResource)}if(s["pre filters"]){var u=Object(c["a"])(new Set(o));s["pre filters"].map((function(t){switch(t.type){case"filter out":t.values.map((function(e){u=u.filter((function(n){return n[t.field]!=e}))}));break}})),o=u}var d={key:this.getRowID(i+e+a),data:o};this.subSectionData.push(d),t.continuation&&this.queryBiContinue(t.continuation,e,n,r,a,i)},ifSetParameterColumn:function(t){return!!(this.tableFormat["column formatting"]&&this.tableFormat["column formatting"][t]&&this.tableFormat["column formatting"][t]["type"].includes("set parameter"))||null},ifSubsectionColumn:function(t){return!!(this.tableFormat["column formatting"]&&this.tableFormat["column formatting"][t]&&this.tableFormat["column formatting"][t]["type"].includes("dynamic subsection"))||null},ifByoglSectionColumn:function(t){return!!(this.tableFormat["column formatting"]&&this.tableFormat["column formatting"][t]&&this.tableFormat["column formatting"][t]["type"].includes("byogl section"))||null},getParameterColumnLabel:function(t){if(this.ifSetParameterColumn(t)||this.ifSubsectionColumn(t)||this.ifByoglSectionColumn(t)){var e=this.tableFormat["column formatting"][t].label?this.tableFormat["column formatting"][t].label:null;return e}return null},getParameterTargets:function(t){return this.tableFormat["column formatting"][t]["target sections"]},showHidePanel:function(t){var e=document.querySelector(t);e.classList.contains("hidden")?e.classList.remove("hidden"):e.classList.add("hidden")},getIfChecked:function(t){var e=this.getColumnId(t),n=!document.querySelector("#"+e)||document.querySelector("#"+e).checked;return n},getColumnId:function(t){return t.replace(/\W/g,"").toLowerCase()},addRemoveColumn:function(t){this.$forceUpdate()},getColumns:function(t){var e,n=this;if(null!=this.dataComparisonConfig)for(var r=0,a=Object.entries(this.dataset);r<a.length;r++){var i=Object(s["a"])(a[r],2),o=(i[0],i[1]);o[this.tableFormat["star column"]]==t&&(e=o)}else e=this.dataset.filter((function(e){return e[n.tableFormat["star column"]]==t}))[0];return e},starAll:function(){var t=this;if(1==this.staredAll)if(this.staredAll=!1,this.multiSectionPage){var e=Object(c["a"])(new Set(this.starItems));this.rawData.map((function(e){e[t.tableFormat["star column"]]})),e=e.filter((function(e){return e.section!=t.sectionId})),this.$emit("on-star",e)}else this.rawData.map((function(e){var n=e[t.tableFormat["star column"]];t.$store.dispatch("pkgDataSelected",{type:t.tableFormat["star column"],id:n,action:"remove"})}));else if(this.staredAll=!0,this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems));this.rawData.map((function(e){var r=e[t.tableFormat["star column"]],a={type:t.tableFormat["star column"],id:r,columns:t.getColumns(r),section:t.sectionId};n.push(a)})),this.$emit("on-star",n)}else this.rawData.map((function(e){var n=e[t.tableFormat["star column"]];t.$store.dispatch("pkgDataSelected",{type:t.tableFormat["star column"],id:n,action:"add"})}))},addStar:function(t){var e=t[this.tableFormat["star column"]];if(this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems)),r={type:this.tableFormat["star column"],id:e,columns:this.getColumns(e),section:this.sectionId};n.push(r),this.$emit("on-star",n)}else this.$store.dispatch("pkgDataSelected",{type:this.tableFormat["star column"],id:e,action:"add"})},removeStar:function(t){var e=t[this.tableFormat["star column"]];if(this.multiSectionPage){var n=Object(c["a"])(new Set(this.starItems)).filter((function(t){return t.id!=e}));this.$emit("on-star",n)}else this.$store.dispatch("pkgDataSelected",{type:this.tableFormat["star column"],id:e,action:"remove"})},checkStared:function(t,e){var n=this;if(e){var r;r=this.multiSectionPage?this.starItems.filter((function(t){return t.type==n.tableFormat["star column"]})).map((function(t){return t.id})):this.pkgDataSelected.filter((function(t){return t.type==n.tableFormat["star column"]})).map((function(t){return t.id}));var a=e[this.tableFormat["star column"]];return!!r.includes(a)}return!1},showHideStared:function(){0==this.stared?this.stared=!0:this.stared=!1},selectRow:function(t){var e=t[this.tableFormat["select column"]];this.selected=e,h["a"].$emit("on-select",{id:this.sectionId,value:e})},isSelected:function(t){var e=t[this.tableFormat["select column"]];return this.selected===e},getColorIndex:function(t){var e="",n=this.compareGroups;return n.length>1&&this.compareGroups.map((function(n,r){t==n&&(e=r)})),e},ifDataObject:function(t){return"object"===Object(o["a"])(t)&&null!==t&&!Array.isArray(t)},showHideFeature:function(t){this.utils.uiUtils.showHideElement(t)},convertJson2Csv:function(t,e){var n=this.utils.dataConvert.flatJson(t);this.utils.uiUtils.saveByorCsv(n,e)},convertJson2Tsv:function(t,e){this.utils.uiUtils.saveByorTsv(t,e)},saveJson:function(t,e){this.utils.uiUtils.saveJson(t,e)},formatValue:function(t,e,n){var r;if(this.tableFormat&&this.tableFormat["column formatting"]&&this.tableFormat["column formatting"][e]){var a=this.tableFormat["column formatting"][e].type;r=a.includes("render background percent")||a.includes("render background percent negative")?this.utils.Formatters.BYORColumnFormatter(t,e,this.tableFormat,null,this.dataScores):a.includes("kp phenotype link")?this.utils.Formatters.BYORColumnFormatter(t,e,this.tableFormat,this.phenotypeMap,null):a.includes("link with parameters")?this.utils.Formatters.BYORColumnFormatter(t,e,this.tableFormat,this.phenotypeMap,null,n):this.utils.Formatters.BYORColumnFormatter(t,e,this.tableFormat,null,null)}else r=t;return r},object2Array:function(t,e,n){for(var r=[],a=(t[Object.keys(t)[0]],!!this.dataComparisonConfig["fields to compare"].includes(e)),i=0,o=Object.entries(t);i<o.length;i++){var l=Object(s["a"])(o[i],2),c=(l[0],l[1]);if(1==a)for(var u={},d=0,h=Object.entries(c);d<h.length;d++){var p=Object(s["a"])(h[d],2),f=p[0],_=p[1];if(f==e){var g=Object.values(_);1==g.length?u[f]=g[0]:u[f]=0==n?Math.min.apply(Math,g):Math.max.apply(Math,g)}else u[f]=_;r.push(u)}else r.push(c)}return r},array2Object:function(t,e,n){var r=this,a={};return t.map((function(t){var n=t[r.dataComparisonConfig["key field"]];a[n]=e[n]})),a},checkIfNumeric:function(t,e){var n=["0","1","2","3","4","5","6","7","8","9",0,1,2,3,4,5,6,7,8,9,"e","E","-","."],r=!0;return t.map((function(t){for(var a in t[e])n.includes(t[e][a])||(r=!1)})),r},callFilter:function(t){var e="asc"!=this.sortDirection;
3this.sortDirection="asc"==this.sortDirection?"desc":"asc",this.$emit("clicked-sort",{key:t,direction:e})},applySorting:function(t){var e="asc"!=this.sortDirection;if(this.sortDirection="asc"==this.sortDirection?"desc":"asc",t!=this.tableFormat["locus field"]){var n=null==this.dataComparisonConfig?this.dataset:this.object2Array(this.dataset,t,e),r=[],a=[];n.map((function(e){e[t]||0===e[t]?r.push(e):a.push(e)}));var i=this.checkIfNumeric(n,t),o=this.utils.sortUtils.sortEGLTableData(r,t,i,e).concat(a),s=null==this.dataComparisonConfig?o:this.array2Object(o,this.dataset,t);this.$store.dispatch("filteredData",s)}else if(t==this.tableFormat["locus field"]){var l=this.tableFormat["locus field"],c=this.dataset;c.map((function(t){var e,n=t[l].split(":"),r=n[0].trim();e=n[1]?1==n[1].includes("-")?(Number(n[1].split("-")[0].trim())+Number(n[1].split("-")[1].trim()))/2:Number(n[1]):0,t["chr"]="X"!=r&&"Y"!=r?Number(r):"X"==r?23:24,t["bp"]=e})),this.utils.sortUtils.sortEGLTableData(c,"bp",!0,e),this.utils.sortUtils.sortEGLTableData(c,"chr",!0,e),this.multiSectionPage?this.$emit("clicked-sort",c):this.$store.dispatch("filteredData",c)}}}}),T=I,B=(n("145e2"),Object(C["a"])(T,r,a,!1,null,"55ca816e",null));e["a"]=B.exports},f9f0:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return this.pageInfo[0]?n("div",{staticClass:"page-info-wrapper row",domProps:{innerHTML:t._s(this.pageInfo[0].body[0].value)}}):t._e()},a=[],i=n("2b0e"),o=n("b1e0");i["default"].use(o["a"]);var s=i["default"].component("static-page-info-section",{props:["pageInfo"],mounted:function(){}}),l=s,c=(n("60ef"),n("2877")),u=Object(c["a"])(l,r,a,!1,null,null,null);e["a"]=u.exports},fc02:function(t,e,n){"use strict";n("d3f6")},fc3b:function(t,e,n){"use strict";var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:"vector-wrapper-"+t.canvasId,attrs:{id:"vector_wrapper_"+t.sectionId}})])},a=[],i=(n("d81d"),n("13d5"),n("6b93"),n("a9e3"),n("b64b"),n("d3b7"),n("07ac"),n("ac1f"),n("5319"),n("5b81"),n("0643"),n("a573"),n("9d4a"),n("2b0e")),o=n("1157"),s=n.n(o),l=n("5698"),c=(n("2ef0"),n("b1e0"));i["default"].use(c["a"]);var u=i["default"].component("research-m-bitmap-plot-vector",{props:["renderData","renderConfig","colors","margin","chrLengths","sectionId","utils"],data:function(){return{}},modules:{},components:{},created:function(){},mounted:function(){},beforeDestroy:function(){},computed:{canvasId:function(){var t=this.sectionId.replaceAll("_","-").toLowerCase();return t}},watch:{},methods:{renderPlot:function(t){var e=this,n=".vector-wrapper-".concat(this.canvasId),r=("vector_wrapper_".concat(this.sectionId),document.querySelector("#"+this.sectionId+"mPlotWrapper")),a={left:this.margin.left/2,right:this.margin.right/2,top:this.margin.top/2,bottom:this.margin.bottom/2,bump:this.margin.bump/2},i=this.renderConfig["width"]?this.renderConfig["width"]:r.clientWidth-(a.left+a.right),o=this.renderConfig["height"]?this.renderConfig["height"]:300,s=l["select"](n).append("svg").attr("id","vector_m_plot_"+this.sectionId).attr("width",i+a.left+a.right).attr("height",o+a.top+a.bottom).attr("style","border:solid 1px #dddddd");s.append("g").attr("id","plot").attr("transform","translate(0,0)"),s.select("#plot").style("font-family","Arial").style("font-size",12).style("text-anchor","middle"),s.select("#plot").append("text").attr("x",a.left+i/2).attr("y",o+a.top+a.bottom-10).text(this.renderConfig["x axis label"]),s.select("#plot").append("text").attr("transform","translate("+(a.bump+20)+","+(a.top+o/2)+")rotate(-90)").attr("x",0).attr("y",0).text(this.renderConfig["y axis label"]);var c=this.renderConfig["y axis field"],u=(this.renderConfig["x axis field"],this.renderConfig["render by"],0);Object.values(this.chrLengths).map((function(t){u+=t}));var d=l["scaleLinear"]().domain([0,u]).range([a.left,a.left+i]);s.select("#plot").append("line").attr("x1",d(0)-a.bump).attr("x2",d(u)).attr("y1",a.top+o+a.bump).attr("y2",a.top+o+a.bump).attr("stroke","#000000").style("stroke-width",.75),u=0,Object.keys(this.chrLengths).map((function(t){var n=e.chrLengths[t];u+=n,s.select("#plot").append("line").attr("x1",d(u-n/2)).attr("x2",d(u-n/2)).attr("y1",a.top+o+a.bump).attr("y2",a.top+o+2*a.bump).attr("stroke","#000000").style("stroke-width",.7
35),s.select("#plot").append("text").attr("x",d(u-n/2)).attr("y",a.top+o+2*a.bump+10).text(t)}));var h=this.renderData[t].unsorted.map((function(t){return t[c]})),p=Math.ceil(h.reduce((function(t,e){return t>e?t:e}))),f=Math.floor(h.reduce((function(t,e){return t<e?t:e}))),_=l["scaleLinear"]().domain([f,p]).range([o+a.top,a.top]);s.select("#plot").append("g").attr("transform",(function(t){return"translate("+(a.left-a.bump)+",0)"})).call(l["axisLeft"](_).ticks(5)),this.renderConfig["thresholds"]&&this.renderConfig["thresholds"].map((function(t){var n="string"==typeof t?Number(t):t;1!=e.renderConfig["convert y -log10"]&&"true"!=e.renderConfig["convert y -log10"]||(n=-Math.log10(t)),s.select("#plot").append("line").attr("style","stroke-dasharray: 5,2").attr("x1",a.left).attr("y1",_(n)).attr("x2",i+a.left).attr("y2",_(n)).attr("stroke","#FFAA00").style("stroke-width",1)}));var g=0,m=1;Object.keys(this.renderData[t].sorted).map((function(n){var r=e.colors[m%e.colors.length]+"75";e.renderData[t].sorted[n].map((function(t){var e=_(t[c]),n=d(t["locus"]+g);s.select("#plot").append("circle").attr("cx",n).attr("cy",e).attr("r",4).style("fill",r)})),m++,g+=e.chrLengths[n]}))}}});s()((function(){}));var d=u,h=n("2877"),p=Object(h["a"])(d,r,a,!1,null,null,null);e["a"]=p.exports},fcf8:function(t,e,n){"use strict";n("4cdc")},fd66:function(t,e,n){"use strict";n("b64b"),n("131a"),n("d3b7"),n("ac1f"),n("841c"),n("0643"),n("4e3e"),n("159b");var r=n("72bf"),a=n.n(r),i=n("1816"),o=n.n(i),s=n("1157"),l=n.n(s),c=window.location.search,u=a.a.parse(c,{parseNumbers:!0,parseBooleans:!0}),d={set:function(t){var e=o()(window.location.href);Object.assign(u,t),Object.keys(u).forEach((function(t){u[t]||delete u[t]})),e.set("query",a.a.stringify(u)),window.history&&window.history.pushState&&l()(window).on("popstate",(function(){var t=location.hash,e=t.split("#!/"),n=e[1];if(""!==n){var r=window.location.hash;""===r&&location.reload(!0)}})),window.history.pushState({path:e.href},"",e.href)}};Object.setPrototypeOf(d,u),e["a"]=d},fd6a:function(t,e,n){"use strict";n("01b3")},ffb8:function(t,e,n){}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.