comparison x/static/js/6746.8d3f75be.chunk.js @ 125:49f3d3878413 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author fubar
date Sat, 05 Oct 2024 23:58:05 +0000
parents
children
comparison
equal deleted inserted replaced
124:137e08517410 125:49f3d3878413
1 "use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[6746,6999],{66999:(e,t,r)=>{r.r(t),r.d(t,{default:()=>p});var n=r(7552),o=r(68446),s=r(99546),a=r(373);const l="rgb(220,220,180)",c="rgba(250,200,200)";function d({str:e,charactersPerRow:t,showCoordinates:r,currRemainder:n=0,splitSize:o=10}){const s=Math.ceil(e.length/t),a=new Array(s);let l=n%10,c=0,d=0;for(;c<s+1;++c){const s=0===c?t-n:t,m=e.slice(d,d+s);if(!m)break;if(r){let e="";for(let t=0,r=l;t<m.length;t++,r++)r%o==0&&(e+=" ",r=0),e+=m[t];e&&(a[c]=e)}else a[c]=m;l=0,d+=s}return{segments:a,remainder:((a.at(-1)?.replaceAll(" ","").length||0)+(c<2?n:0))%t}}const m=(0,o.observer)((function({chunks:e,start:t,color:r,strand:o=1,coordStart:s=t,model:a}){const{charactersPerRow:l,showCoordinates:c}=a;return e.map(((a,d)=>{const m=0===d&&t%l==0||d>0?`${(""+(s-t%l+d*o*l)).padStart(4)} `:"",u=d===e.length-1&&(e.at(-1)?.replaceAll(" ","").length||0)+(0===d?t%l:0)!==l?null:c?" \n":"";return n.createElement(n.Fragment,{key:`${a}-${d}`},c?m:null,n.createElement("span",{style:{background:r}},a),u)}))})),u=(0,o.observer)((function({utr:e,cds:t,exons:r,sequence:o,upstream:s,downstream:a,feature:u,includeIntrons:i,collapseIntron:h,model:g}){const{upperCaseCDS:w,intronBp:f,charactersPerRow:p,showCoordinates:E,showCoordinatesSetting:C}=g,b=t.length>0,k=(t.length?[...t,...e].sort(((e,t)=>e.start-t.start)):r).filter((e=>e.start!==e.end)),q=e=>w?e.toLowerCase():e,S=e=>w?e.toUpperCase():e,v=-1===u.strand?-1:1,R="genomic"===C&&i&&!h,y=R?v:1;let P=R?v>0?u.start+1-(s?.length||0):u.end+(s?.length||0):0,$=0,_=0,x=null;if(s){const{segments:e,remainder:t}=d({str:q(s),charactersPerRow:p,showCoordinates:E});x=n.createElement(m,{model:g,color:c,strand:y,start:$,coordStart:P,chunks:e}),_=t,$+=s.length*y,P+=s.length*y}const A=[];for(let e=0;e<k.length;e++){const t=k[e],r=o.slice(t.end,k[e+1]?.start),s=o.slice(t.start,t.end),{segments:a,remainder:c}=d({str:b?"CDS"===t.type?S(s):q(s):S(s),charactersPerRow:p,currRemainder:_,showCoordinates:E});if(A.push(n.createElement(m,{key:`${JSON.stringify(t)}-mid`,model:g,color:"CDS"===t.type?l:"rgb(200,240,240)",strand:y,start:$,coordStart:P,chunks:a})),_=c,$+=s.length*y,P+=s.length*y,r&&i&&e<k.length-1){const e=q(h&&r.length>2*f?`${r.slice(0,f)}...${r.slice(-f)}`:r),{segments:o,remainder:s}=d({str:e,charactersPerRow:p,currRemainder:_,showCoordinates:E});o.length&&(A.push(n.createElement(m,{key:`${JSON.stringify(t)}-intron`,model:g,strand:y,coordStart:P,start:$,chunks:o})),_=s,$+=e.length*y,P+=e.length*y)}}let D=null;if(a){const{segments:e}=d({str:q(a),charactersPerRow:p,currRemainder:_,showCoordinates:E});D=n.createElement(m,{start:$,model:g,strand:y,chunks:e,coordStart:P,color:c})}return n.createElement(n.Fragment,null,x,A,D)})),i=(0,o.observer)((function({cds:e,sequence:t,codonTable:r,model:o}){const{charactersPerRow:s,showCoordinates:l}=o,c=(0,a.o9)(e,t);let u="";for(let e=0;e<c.length;e+=3)u+=r[c.slice(e,e+3)]||"&";const{segments:i}=d({str:u,charactersPerRow:s,showCoordinates:l});return n.createElement(m,{model:o,color:"rgb(220,160,220)",chunks:i,start:0})})),h=(0,o.observer)((function({sequence:e,upstream:t,feature:r,downstream:o,model:s}){const{charactersPerRow:a,showCoordinatesSetting:l,showCoordinates:u}=s;let i=0,h=null,g=0;const w=-1===r.strand?-1:1,f="genomic"===l,p=f?w:1;let E=f?w>0?r.start+1-(t?.length||0):r.end+(t?.length||0):0;if(t){const{segments:e,remainder:r}=d({str:t,charactersPerRow:a,showCoordinates:u});h=n.createElement(m,{model:s,color:c,start:i,coordStart:E,chunks:e}),g=r,i+=t.length*p,E+=t.length*p}const{segments:C,remainder:b}=d({str:e,charactersPerRow:a,showCoordinates:u,currRemainder:g}),k=n.createElement(m,{model:s,color:"rgb(200,280,200)",start:i,coordStart:E,chunks:C});g=b,i+=e.length*p,E+=e.length*p;let q=null;if(o){const{segments:e}=d({str:o,charactersPerRow:a,currRemainder:g,showCoordinates:u});q=n.createElement(m,{start:i,model:s,chunks:e,coordStart:E,color:c})}return n.createElement(n.Fragment,null,h,k,q)})),g=(0,o.observer)((function({cds:e,sequence:t,model:r}){const{charactersPerRow:o,showCoordinates:s}=r,{segments:c}=d({str:(0,a.o9)(e,t),charactersPerRow:o,showCoordinates:s});return n.createElement(m,{model:r,color:l,chunks:c,start:0})}));function w({children:e}){return n.createElement("pre",{style:{fontFamily:"monospace",color:"black",fontSize:11}},e)}function f({children:e}){return n.createElement("div",{style:{fontFamily:"monospace",color:"black",fontSize:11,maxWidth:600,whiteSpace:"wrap",wordBreak:"break-all"}},e)}const p=(0,o.observer)(n.forwardRef((function(e,t){const{model:r,feature:o}=e,{showCoordinates:l,mode:c}=r;let{sequence:{seq:d,upstream:m="",downstream:p=""}}=e;const{subfeatures:E=[]}=o,C=E.sort(((e,t)=>e.start-t.start)).map((e=>({...e,start:e.start-o.start,end:e.end-o.start})));let b=(0,a.Qq)(C.filter((e=>"CDS"===e.type))),k=(0,a.Qq)(C.filter((e=>e.type?.match(/utr/i)))),q=(0,a.Qq)(C.filter((e=>"exon"===e.type)));!k.length&&b.length&&q.length&&(k=(0,a.h8)(b,q)),k.length||!b.length||q.length||(k=(0,a.V4)(b,{start:0,end:o.end-o.start,type:"gene"})),-1===o.strand&&([d,m,p]=[(0,s.revcom)(d),(0,s.revcom)(p),(0,s.revcom)(m)],b=(0,a.YC)(b,d.length),q=(0,a.YC)(q,d.length),k=(0,a.YC)(k,d.length));const S=(0,s.generateCodonTable)(s.defaultCodonTable),v=l?w:f;return n.createElement("div",{"data-testid":"sequence_panel",ref:t,style:{maxHeight:300,overflow:"auto"}},n.createElement(v,null,n.createElement("div",{style:{background:"white"}},`>${[`${o.name||o.id}-${c}`,`${o.refName}:${(0,s.toLocale)(o.start+1)}-${(0,s.toLocale)(o.end)}${R=o.strand,-1===R?"(-)":1===R?"(+)":""}`,c.endsWith("updownstream")?`+/- ${(0,s.toLocale)(r.upDownBp)} up/downstream bp`:""].filter((e=>!!e)).join(" ")}\n`),"genomic"===c?n.createElement(h,{feature:o,model:r,sequence:d}):"genomic_sequence_updownstream"===c?n.createElement(h,{model:r,feature:o,sequence:d,upstream:m,downstream:p}):"cds"===c?n.createElement(g,{model:r,cds:b,sequence:d}):"cdna"===c?n.createElement(u,{model:r,exons:q,feature:o,cds:b,utr:k,sequence:d}):"protein"===c?n.createElement(i,{model:r,cds:b,codonTable:S,sequence:d}):"gene"===c?n.createElement(u,{model:r,exons:q,feature:o,cds:b,utr:k,sequence:d,includeIntrons:!0}):"gene_collapsed_intron"===c?n.createElement(u,{model:r,exons:q,feature:o,cds:b,sequence:d,utr:k,includeIntrons:!0,collapseIntron:!0}):"gene_updownstream"===c?n.createElement(u,{model:r,exons:q,feature:o,cds:b,sequence:d,utr:k,upstream:m,downstream:p,includeIntrons:!0}):"gene_updownstream_collapsed_intron"===c?n.createElement(u,{model:r,exons:q,feature:o,cds:b,sequence:d,utr:k,upstream:m,downstream:p,includeIntrons:!0,collapseIntron:!0}):n.createElement("div",null,"Unknown type")));var R})))},76746:(e,t,r)=>{r.r(t),r.d(t,{default:()=>f});var n=r(7552),o=r(29499),s=r(36715),a=r(5401),l=r(58507),c=r(49823),d=r(75785),m=r(68446),u=r(78781),i=r(66999),h=r(54579),g=r(14465);const w=(0,d.n9)()({dialogContent:{width:"80em"},formControl:{margin:0,marginLeft:4}}),f=(0,m.observer)((function({handleClose:e,model:t,feature:r}){const{sequenceFeatureDetails:d}=t,{upDownBp:m}=d,{classes:f}=w(),p=(0,n.useRef)(null),[E,C]=(0,n.useState)(!1),{sequence:b,error:k}=(0,u.p)(t,r,m,E);return n.createElement(c.Dialog,{maxWidth:"xl",open:!0,onClose:()=>{e()},title:"Sequence view"},n.createElement(o.A,{className:f.dialogContent},n.createElement("div",null,n.createElement(g.A,{model:d}),n.createElement(h.A,{ref:p,model:d})),n.createElement("div",null,"gene"===r.type?n.createElement(s.A,null,"Note: inspect subfeature sequences for protein/CDS computations"):null,k?n.createElement(c.ErrorMessage,{error:k}):b?"error"in b?n.createElement(n.Fragment,null,n.createElement(s.A,{color:"error"},b.error),n.createElement(a.A,{variant:"contained",color:"inherit",onClick:()=>{C(!0)}},"Force load")):n.createElement(n.Suspense,{fallback:n.createElement(c.LoadingEllipses,null)},n.createElement(i.default,{ref:p,feature:r,sequence:b,model:d})):n.createElement(c.LoadingEllipses,null))),n.createElement(l.A,null,n.createElement(a.A,{onClick:()=>{e()},variant:"contained"},"Close")))}))}}]);
2 //# sourceMappingURL=6746.8d3f75be.chunk.js.map