1"use strict";(self.webpackChunkcov_spectrum_website=self.webpackChunkcov_spectrum_website||[]).push([[8165],{8165:(t,e,r)=>{r.r(e),r.d(e,{default:()=>o});var i=r(1016),l=r(1599),n=r(9062),s=r(2779);class o extends l.B.BaseFeatureDataAdapter{constructor(){super(...arguments),this.intervalTrees={}}async getNames(){const{header:t,columnNames:e}=await this.loadData();if(e.length)return e;const r=t.split(/\n|\r\n|\r/).filter((t=>!!t)).at(-1);return null!=r&&r.includes("\t")?r.slice(1).split("\t").map((t=>t.trim())):void 0}async loadFeatureIntervalTreeHelper(t){var e;const{features:r}=await this.loadData(),l=r[t];if(!l)return;const s=(null===(e=await this.getNames())||void 0===e?void 0:e.slice(3))||[],o=new i.I;for(let i=0;i<l.length;i++){const t=l[i],[e,r,a,...h]=t.split("\t");for(let l=0;l<h.length;l++){const t=`${this.id}-${e}-${i}-${l}`,u=+r,c=+a,_=+h[l],m=s[l]||`col${l}`;_&&o.insert([u,c],new n.u.SimpleFeature({id:t,data:{refName:e,start:u,end:c,score:_,source:m}}))}}return o}async getRefNames(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{features:e}=await this.loadData(t);return Object.keys(e)}async loadDataP(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.pluginManager,r=this.getConf("bedGraphLocation"),i=await n.u.fetchAndMaybeUnzip(n.a4.openLocation(r,e),t);if(i.length>536870888)throw new Error("Data exceeds maximum string length (512MB)");const l=new TextDecoder("utf8",{fatal:!0}).decode(i).split(/\n|\r\n|\r/).filter((t=>!!t)),s=[];let o=0;for(;o<l.length&&l[o].startsWith("#");o++)s.push(l[o]);const a=s.join("\n"),h={};for(;o<l.length;o++){const t=l[o],e=t.indexOf("\t"),r=t.slice(0,e);h[r]||(h[r]=[]),h[r].push(t)}return{header:a,features:h,columnNames:this.getConf("columnNames")}}async loadFeatureIntervalTree(t){return this.intervalTrees[t]||(this.intervalTrees[t]=this.loadFeatureIntervalTreeHelper(t).catch((e=>{throw this.intervalTrees[t]=void 0,e}))),this.intervalTrees[t]}async loadData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bedFeatures||(this.bedFeatures=this.loadDataP(t).catch((t=>{throw this.bedFeatures=void 0,t}))),this.bedFeatures}getFeatures(t){return s.r.ObservableCreate((async e=>{const{start:r,end:i,refName:l}=t,n=await this.loadFeatureIntervalTree(l);for(const t of(null==n?void 0:n.search([r,i]))||[])e.next(t);e.complete()}))}}},1599:(t,e,r)=>{r.d(e,{B:()=>i});var i=(0,r(9062).$)()},1016:(t,e,r)=>{r.d(e,{I:()=>n});const i=class t{constructor(t,e){this.low=t,this.high=e}clone(){return new t(this.low,this.high)}get max(){return this.clone()}less_than(t){return this.low<t.low||this.low===t.low&&this.high<t.high}equal_to(t){return this.low===t.low&&this.high===t.high}intersect(t){return!this.not_intersect(t)}not_intersect(t){return this.high<t.low||t.high<this.low}merge(e){return new t(void 0===this.low?e.low:this.low<e.low?this.low:e.low,void 0===this.high?e.high:this.high>e.high?this.high:e.high)}output(){return[this.low,this.high]}static comparable_max(t,e){return t.merge(e)}static comparable_less_than(t,e){return t<e}};class l{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;if(this.left=r,this.right=l,this.parent=n,this.color=s,this.item={key:t,value:e},t&&t instanceof Array&&2===t.length&&!Number.isNaN(t[0])&&!Number.isNaN(t[1])){let[e,r]=t;e>r&&([e,r]=[r,e]),this.item.key=new i(e,r)}this.max=this.item.key?this.item.key.max:void 0}isNil(){return void 0===this.item.key&&void 0===this.item.value&&null===this.left&&null===this.right&&1===this.color}_value_less_than(t){return this.item.value&&t.item.value&&this.item.value.less_than?this.item.value.less_than(t.item.value):this.item.value<t.item.value}less_than(t){return this.item.value===this.item.key&&t.item.value===t.item.key?this.item.key.less_than(t.item.key):this.item.key.less_than(t.item.key)||this.item.key.equal_to(t.item.key)&&this._value_less_than(t)}_value_equal(t){return this.item.value&&t.item.value&&this.item.value.equal_to?this.item.value.equal_to(t.item.value):this.item.value===t.item.value}equal_to(t){return this.item.value===this.item.key&&t.item.value===t.item.key?this.item.key.equal_to(t.item.key):this.item.key.equal_to(t.item.key)&&this._value_equal(t)}intersect(t){return this.item.key.intersect(t.item.key)}
1copy_data(t){this.item.key=t.item.key,this.item.value=t.item.value}update_max(){if(this.max=this.item.key?this.item.key.max:void 0,this.right&&this.right.max){const t=this.item.key.constructor.comparable_max;this.max=t(this.max,this.right.max)}if(this.left&&this.left.max){const t=this.item.key.constructor.comparable_max;this.max=t(this.max,this.left.max)}}not_intersect_left_subtree(t){return(0,this.item.key.constructor.comparable_less_than)(void 0!==this.left.max.high?this.left.max.high:this.left.max,t.item.key.low)}not_intersect_right_subtree(t){const e=this.item.key.constructor.comparable_less_than;let r=void 0!==this.right.max.low?this.right.max.low:this.right.item.key.low;return e(t.item.key.high,r)}}class n{constructor(){this.root=null,this.nil_node=new l}get size(){let t=0;return this.tree_walk(this.root,(()=>t++)),t}get keys(){let t=[];return this.tree_walk(this.root,(e=>t.push(e.item.key.output?e.item.key.output():e.item.key))),t}get values(){let t=[];return this.tree_walk(this.root,(e=>t.push(e.item.value))),t}get items(){let t=[];return this.tree_walk(this.root,(e=>t.push({key:e.item.key.output?e.item.key.output():e.item.key,value:e.item.value}))),t}isEmpty(){return null==this.root||this.root===this.nil_node}clear(){this.root=null}insert(t){if(void 0===t)return;let e=new l(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,this.nil_node,this.nil_node,null,0);return this.tree_insert(e),this.recalc_max(e),e}exist(t){let e=new l(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t);return!!this.tree_search(this.root,e)}remove(t){let e=new l(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t),r=this.tree_search(this.root,e);return r&&this.tree_delete(r),r}search(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e)=>t===e?e.output():t,r=new l(t),i=[];return this.tree_search_interval(this.root,r,i),i.map((t=>e(t.item.value,t.item.key)))}intersect_any(t){let e=new l(t);return this.tree_find_any_interval(this.root,e)}forEach(t){this.tree_walk(this.root,(e=>t(e.item.key,e.item.value)))}map(t){const e=new n;return this.tree_walk(this.root,(r=>e.insert(r.item.key,t(r.item.value,r.item.key)))),e}iterate(t){var e=this;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e)=>t===e?e.output():t;return function*(){let i;for(t?i=e.tree_search_nearest_forward(e.root,new l(t)):e.root&&(i=e.local_minimum(e.root));i;)yield r(i.item.value,i.item.key),i=e.tree_successor(i)}()}recalc_max(t){let e=t;for(;null!=e.parent;)e.parent.update_max(),e=e.parent}tree_insert(t){let e=this.root,r=null;if(null==this.root||this.root===this.nil_node)this.root=t;else{for(;e!==this.nil_node;)r=e,e=t.less_than(e)?e.left:e.right;t.parent=r,t.less_than(r)?r.left=t:r.right=t}this.insert_fixup(t)}insert_fixup(t){let e,r;for(e=t;e!==this.root&&0===e.parent.color;)e.parent===e.parent.parent.left?(r=e.parent.parent.right,0===r.color?(e.parent.color=1,r.color=1,e.parent.parent.color=0,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,this.rotate_left(e)),e.parent.color=1,e.parent.parent.color=0,this.rotate_right(e.parent.parent))):(r=e.parent.parent.left,0===r.color?(e.parent.color=1,r.color=1,e.parent.parent.color=0,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,this.rotate_right(e)),e.parent.color=1,e.parent.parent.color=0,this.rotate_left(e.parent.parent)));this.root.color=1}tree_delete(t){let e,r;e=t.left===this.nil_node||t.right===this.nil_node?t:this.tree_successor(t),r=e.left!==this.nil_node?e.left:e.right,r.parent=e.parent,e===this.root?this.root=r:(e===e.parent.left?e.parent.left=r:e.parent.right=r,e.parent.update_max()),this.recalc_max(r),e!==t&&(t.copy_data(e),t.update_max(),this.recalc_max(t)),1===e.color&&this.delete_fixup(r)}delete_fixup(t){let e,r=t;for(;r!==this.root&&null!=r.parent&&1===r.color;)r===r.parent.left?(e=r.parent.right,0===e.color&&(e.color=1,r.parent.color=0,this.rotate_left(r.parent),e=r.parent.right),1===e.left.color&&1===e.right.color?(e.color=0,r=r.parent):(1===e.right.color&&(e.color=0,e.left.color=1,this.rotate_right(e),e=r.parent.right),e.color=r.parent.color,r.parent.color=1,e.right.color=1,this.rotate_left(r.parent),r=this.root)):(e=r.parent.left,0===e.color&&(e.color=1,r.parent.color=0,this.rotate_right(r.parent),e=r.parent.left),1===e.left.color&&1===e.right.color?(e.color=0,r=r.parent):(1===e.left.color&&(e.color=0,e.right.color=1,this.rotate_left(e),e=r.parent.left),e.color=r.parent.color,r.parent.color=1,e.left.color=1,this.rotate_right(r.parent),r=this.root));r.color=1}tree_search(t,e){if(null!=t&&t!==this.nil_node)return e.equal_to(t)?t:e.less_than(t)?this.tree_search(t.left,e):this.tree_search(t.right,e)}tree_search_nearest_forward(t,e){let r,i=t;
1for(;i&&i!==this.nil_node;)i.less_than(e)?i.intersect(e)?(r=i,i=i.left):i=i.right:((!r||i.less_than(r))&&(r=i),i=i.left);return r||null}tree_search_interval(t,e,r){null!=t&&t!==this.nil_node&&(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e)&&this.tree_search_interval(t.left,e,r),t.intersect(e)&&r.push(t),t.right!==this.nil_node&&!t.not_intersect_right_subtree(e)&&this.tree_search_interval(t.right,e,r))}tree_find_any_interval(t,e){let r=!1;return null!=t&&t!==this.nil_node&&(t.left!==this.nil_node&&!t.not_intersect_left_subtree(e)&&(r=this.tree_find_any_interval(t.left,e)),r||(r=t.intersect(e)),!r&&t.right!==this.nil_node&&!t.not_intersect_right_subtree(e)&&(r=this.tree_find_any_interval(t.right,e))),r}local_minimum(t){let e=t;for(;null!=e.left&&e.left!==this.nil_node;)e=e.left;return e}local_maximum(t){let e=t;for(;null!=e.right&&e.right!==this.nil_node;)e=e.right;return e}tree_successor(t){let e,r,i;if(t.right!==this.nil_node)e=this.local_minimum(t.right);else{for(r=t,i=t.parent;null!=i&&i.right===r;)r=i,i=i.parent;e=i}return e}rotate_left(t){let e=t.right;t.right=e.left,e.left!==this.nil_node&&(e.left.parent=t),e.parent=t.parent,t===this.root?this.root=e:t===t.parent.left?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e,null!=t&&t!==this.nil_node&&t.update_max(),e=t.parent,null!=e&&e!==this.nil_node&&e.update_max()}rotate_right(t){let e=t.left;t.left=e.right,e.right!==this.nil_node&&(e.right.parent=t),e.parent=t.parent,t===this.root?this.root=e:t===t.parent.left?t.parent.left=e:t.parent.right=e,e.right=t,t.parent=e,null!==t&&t!==this.nil_node&&t.update_max(),e=t.parent,null!=e&&e!==this.nil_node&&e.update_max()}tree_walk(t,e){null!=t&&t!==this.nil_node&&(this.tree_walk(t.left,e),e(t),this.tree_walk(t.right,e))}testRedBlackProperty(){let t=!0;return this.tree_walk(this.root,(function(e){0===e.color&&(1===e.left.color&&1===e.right.color||(t=!1))})),t}testBlackHeightProperty(t){let e=0,r=0,i=0;if(1===t.color&&e++,r=t.left!==this.nil_node?this.testBlackHeightProperty(t.left):1,i=t.right!==this.nil_node?this.testBlackHeightProperty(t.right):1,r!==i)throw new Error("Red-black height property violated");return e+=r,e}}},2779:(t,e,r)=>{r.d(e,{r:()=>i});var i=(0,r(9062).a0)()}}]); 2//# sourceMappingURL=8165.4de81602.chunk.js.map
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.