PageSourceSearch

https://cov-spectrum.org/static/js/3183.7e32c645.chunk.js

js cov-spectrum.org collected 2026-09-24 18:35:22 UTC 9,966 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkcov_spectrum_website=self.webpackChunkcov_spectrum_website||[]).push([[3183],{3183:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var r=s(585),n=(s(6974),s(1599)),i=s(9062),a=s(2779),o=s(8311),l=s(2595),c=(0,i.aW)();class u extends n.B.BaseFeatureDataAdapter{async configurePre(e){const t=this.getConf("gffGzLocation"),s=this.getConf(["index","indexType"]),n=this.getConf(["index","location"]),a=this.getConf("dontRedispatch"),o=new r.T({filehandle:i.a4.openLocation(t,this.pluginManager),csiFilehandle:"CSI"===s?i.a4.openLocation(n,this.pluginManager):void 0,tbiFilehandle:"CSI"!==s?i.a4.openLocation(n,this.pluginManager):void 0,chunkCacheSize:52428800,renameRefSeqs:e=>e});return{gff:o,dontRedispatch:a,header:await o.getHeader()}}async configurePre2(){return this.configured||(this.configured=this.configurePre().catch((e=>{throw this.configured=void 0,e}))),this.configured}async configure(e){const{statusCallback:t=()=>{}}=e||{};return i.u.updateStatus("Downloading index",t,(()=>this.configurePre2()))}async getRefNames(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{gff:t}=await this.configure(e);return t.getReferenceSequenceNames(e)}async getHeader(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{gff:t}=await this.configure(e);return t.getHeader()}getFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.r.ObservableCreate((async s=>{const{gff:r}=await this.configure(t),n=await r.getMetadata();await this.getFeaturesHelper(e,t,n,s,!0)}),t.stopToken)}async getFeaturesHelper(e,t,s,r,n){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e;var u,h;const{statusCallback:d=()=>{}}=t;try{const f=[],{dontRedispatch:p,gff:_}=await this.configure(t);if(await i.u.updateStatus("Downloading features",d,(()=>_.getLines(e.refName,e.start,e.end,((e,t)=>{f.push(this.parseLine(s.columnNumbers,e,t))})))),n&&f.length){let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(const e of f){const t=e.fields[2];if(!p.includes(t)){const t=e.start-1;t<n&&(n=t),e.end>i&&(i=e.end)}}if(i>e.end||n<e.start)return void await this.getFeaturesHelper({...e,start:n,end:i},t,s,r,!1,e)}const v=f.map((e=>(e.fields[8]&&"."!==e.fields[8]?e.fields[8].includes("_lineHash")||(e.fields[8]+=`;_lineHash=${e.lineHash}`):e.fields[8]=`_lineHash=${e.lineHash}`,e.fields.join("\t")))).join("\n");for(const e of(0,l.p)(v))for(const t of e){const e=new o.S({data:(0,l.f)(t),id:`${this.id}-offset-${null===(h=null===(u=t.attributes)||void 0===u?void 0:u._lineHash)||void 0===h?void 0:h[0]}`});c.doesIntersect2(e.get("start"),e.get("end"),a.start,a.end)&&r.next(e)}r.complete()}catch(f){r.error(f)}}parseLine(e,t,s){const r=t.split("\t");return{start:+r[e.start-1],end:+r[e.end-1],lineHash:s,fields:r}}}},2595:(e,t,s)=>{function r(e){return e.replaceAll(/%([0-9A-Fa-f]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}function n(e){if(!e.length||"."===e)return{};const t={};return e.replace(/\r?\n$/,"").split(";").forEach((e=>{var s;const n=e.split("=",2);if(null===(s=n[1])||void 0===s||!s.length)return;n[0]=n[0].trim();let i=t[n[0].trim()];i||(i=[],t[n[0]]=i),i.push(...n[1].split(",").map((e=>e.trim())).map(r))})),t}function i(e){const t=e.split("\t").map((e=>"."===e||""===e?null:e));return{seq_id:t[0]&&r(t[0]),source:t[1]&&r(t[1]),type:t[2]&&r(t[2]),start:null===t[3]?null:parseInt(t[3],10),end:null===t[4]?null:parseInt(t[4],10),score:null===t[5]?null:parseFloat(t[5]),strand:t[6],phase:t[7],attributes:null===t[8]?null:n(t[8])}}s.d(t,{f:()=>h,p:()=>u});const a="child_features",o="derived_features";class l{constructor(e){this.seqCallback=e,this.currentSequence=void 0}addLine(e){const t=/^>\s*(\S+)\s*(.*)/.exec(e);t?(this._flush(),this.currentSequence={id:t[1],sequence:""},t[2]&&(this.currentSequence.description=t[2].trim())):this.currentSequence&&/\S/.test(e)&&(this.currentSequence.sequence+=e.replaceAll(/\s/g,""))}_flush(){this.currentSequence&&this.seqCallback(this.currentSequence)}finish(){this._flush()}}class c{constructor(e){this.fastaParser=void 0,this.eof=!1,this.lineNumber=0,this._underConstructionTopLevel=[],this._underConstructionById={},this._completedReferences={},this._underConstructionOrphans={};const t=()=>{};this.featureCallback=e.featureCallback||t,this.endCallback=e.endCallback||t,this.commentCallback=e.commentCallback||t,this.errorCallback=e.errorCallback||t,this.directiveCallback=e.directiveCallback||t,this.sequenceCallback=e.sequenceCallback||t,this.disableDerivesFromReferences=e.disableDerivesFromReferences||!1,this.bufferSize=void 0===e.bufferSize?1e3:e.bufferSize}addLine(e){if(this.fastaParser)return void this.fastaParser.addLine(e);if(this.eof)return;if(this.lineNumber+=1,/^\s*[^#\s>]/.test(e))return void this._bufferLine(e);const t=/^\s*(#+)(.*)/.exec(e);if(t){const[,s]=t;let[,,r]=t;if(3===s.length)this._emitAllUnderConstructionFeatures();else if(2===s.length){const t=function(e){var t,s;const r=/^\s*##\s*(\S+)\s*(.*)/.exec(e);if(!r)return null;const[,n]=r;let[,,i]=r;const a={directive:n};if(i.length&&(i=i.replace(/\r?\n$/,""),a.value=i),"sequence-region"===n){const e=i.split(/\s+/,3);return{...a,seq_id:e[0],start:null===(t=e[1])||void 0===t?void 0:t.replaceAll(/\D/g,""),end:null===(s=e[2])||void 0===s?void 0:s.replaceAll(/\D/g,"")}}if("genome-build"===n){const[e,t]=i.split(/\s+/,2);return{...a,source:e,buildName:t}}return a}(e);t&&("FASTA"===t.directive?(this._emitAllUnderConstructionFeatures(),this.eof=!0,this.fastaParser=new l(this.sequenceCallback)):this._emitItem(t))}else r=r.replace(/\s*/,""),this._emitItem({comment:r})}else if(!/^\s*$/.test(e)){if(!/^\s*>/.test(e)){const t=e.replaceAll(/\r?\n?$/g,"");throw new Error(`GFF3 parse error.  Cannot parse '${t}'.`)}this._emitAllUnderConstructionFeatures(),this.eof=!0,this.fastaParser=new l(this.sequenceCallback),this.fastaParser.addLine(e)}}finish(){this._emitAllUnderConstructionFeatures(),this.fastaParser&&this.fastaParser.finish(),this.endCallback()}_emitItem(e){Array.isArray(e)?this.featureCallback(e):"directive"in e?this.directiveCallback(e):"comment"in e&&this.commentCallback(e)}_enforceBufferSizeLimit(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=e=>{var s,r;e&&Array.isArray(e)&&null!==(r=null===(s=e[0].attributes)||void 0===s?void 0:s.ID)&&void 0!==r&&r[0]&&(e[0].attributes.ID.forEac
1h((e=>{delete this._underConstructionById[e],delete this._completedReferences[e]})),e.forEach((e=>{e.child_features&&e.child_features.forEach((e=>t(e))),e.derived_features&&e.derived_features.forEach((e=>t(e)))})))};for(;this._underConstructionTopLevel.length+e>this.bufferSize;){const e=this._underConstructionTopLevel.shift();e&&(this._emitItem(e),t(e))}}_emitAllUnderConstructionFeatures(){if(this._underConstructionTopLevel.forEach(this._emitItem.bind(this)),this._underConstructionTopLevel=[],this._underConstructionById={},this._completedReferences={},Array.from(Object.values(this._underConstructionOrphans)).length)throw new Error(`some features reference other features that do not exist in the file (or in the same '###' scope). ${Object.keys(this._underConstructionOrphans).join(",")}`)}_bufferLine(e){var t,s,r;const n={...i(e),child_features:[],derived_features:[]},a=(null===(t=n.attributes)||void 0===t?void 0:t.ID)||[],o=(null===(s=n.attributes)||void 0===s?void 0:s.Parent)||[],l=this.disableDerivesFromReferences?[]:(null===(r=n.attributes)||void 0===r?void 0:r.Derives_from)||[];if(!a.length&&!o.length&&!l.length)return void this._emitItem([n]);let c;a.forEach((e=>{const t=this._underConstructionById[e];t?(t[t.length-1].type!==n.type&&this._parseError(`multi-line feature "${e}" has inconsistent types: "${n.type}", "${t[t.length-1].type}"`),t.push(n),c=t):(c=[n],this._enforceBufferSizeLimit(1),!o.length&&!l.length&&this._underConstructionTopLevel.push(c),this._underConstructionById[e]=c,this._resolveReferencesTo(c,e))})),this._resolveReferencesFrom(c||[n],{Parent:o,Derives_from:l},a)}_resolveReferencesTo(e,t){const s=this._underConstructionOrphans[t];s&&(e.forEach((e=>{e.child_features.push(...s.Parent)})),e.forEach((e=>{e.derived_features.push(...s.Derives_from)})),delete this._underConstructionOrphans[t])}_parseError(e){this.eof=!0,this.errorCallback(`${this.lineNumber}: ${e}`)}_resolveReferencesFrom(e,t,s){function r(e,t,s){let r=e[t];r||(r={},e[t]=r);const n=r[s]||!1;return r[s]=!0,n}t.Parent.forEach((t=>{const n=this._underConstructionById[t];if(n){const i=a;s.filter((e=>r(this._completedReferences,e,`Parent,${t}`))).length||n.forEach((t=>{t[i].push(e)}))}else{let s=this._underConstructionOrphans[t];s||(s={Parent:[],Derives_from:[]},this._underConstructionOrphans[t]=s),s.Parent.push(e)}})),t.Derives_from.forEach((t=>{const n=this._underConstructionById[t];if(n){const i=o;s.filter((e=>r(this._completedReferences,e,`Derives_from,${t}`))).length||n.forEach((t=>{t[i].push(e)}))}else{let s=this._underConstructionOrphans[t];s||(s={Parent:[],Derives_from:[]},this._underConstructionOrphans[t]=s),s.Derives_from.push(e)}}))}}function u(e){const t=[],s=new c({featureCallback:e=>t.push(e),disableDerivesFromReferences:!0,errorCallback:e=>{throw e}});for(const r of e.split(/\r?\n/))s.addLine(r);return s.finish(),t}function h(e){const{end:t,start:s,child_features:r,derived_features:n,attributes:i,type:a,source:o,phase:l,seq_id:c,score:u,strand:d}=e;let f;"+"===d?f=1:"-"===d?f=-1:"."===d&&(f=0);const p=new Set(["start","end","seq_id","score","type","source","phase","strand"]),_=i||{},v={};for(const h of Object.keys(_)){let e=h.toLowerCase();if(p.has(e)&&(e+="2"),_[h]&&"_lineHash"!==h){let t=_[h];Array.isArray(t)&&1===t.length&&([t]=t),v[e]=t}}return{...v,start:s-1,end:t,strand:f,type:a,source:o,refName:c,derived_features:n,phase:null===l?void 0:Number(l),score:null===u?void 0:u,subfeatures:r.flatMap((e=>e.map((e=>h(e)))))}}},8311:(e,t,s)=>{s.d(t,{S:()=>i});var r=s(5817),n=(0,s(9062).a1)();const i=(0,r.g)(n)}}]);
2//# sourceMappingURL=3183.7e32c645.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.