view x/static/js/8301.877076ce.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
line wrap: on
line source

"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[8301],{682:(e,t,a)=>{a.r(t),a.d(t,{default:()=>L});var n=a(7552),o=a(48171),r=a(22679),s=a(56089),l=a(33371),i=a(33248),c=a(75653),m=a(67314),d=a(943),u=a(5401),p=a(75785),h=a(68446),b=a(99546),y=a(49823),A=a(36715);function f({radioOption:e,assembly1:t,assembly2:a,fileLocation:n,indexFileLocation:o,bed1Location:r,bed2Location:s}){if(".paf"===e)return{type:"PAFAdapter",pafLocation:n,queryAssembly:t,targetAssembly:a};if(".out"===e)return{type:"MashMapAdapter",outLocation:n,queryAssembly:t,targetAssembly:a};if(".delta"===e)return{type:"DeltaAdapter",deltaLocation:n,queryAssembly:t,targetAssembly:a};if(".chain"===e)return{type:"ChainAdapter",chainLocation:n,queryAssembly:t,targetAssembly:a};if(".anchors"===e)return{type:"MCScanAnchorsAdapter",mcscanAnchorsLocation:n,bed1Location:r,bed2Location:s,assemblyNames:[t,a]};if(".anchors.simple"===e)return{type:"MCScanSimpleAnchorsAdapter",mcscanSimpleAnchorsLocation:n,bed1Location:r,bed2Location:s,assemblyNames:[t,a]};if(".pif.gz"===e)return{type:"PairwiseIndexedPAFAdapter",pifGzLocation:n,index:{location:o},assemblyNames:[t,a]};throw new Error(`Unknown to detect type ${e} from filename (select radio button to clarify)`)}const v=(0,h.observer)((function({assembly1:e,assembly2:t,setSessionTrackData:a}){const[o,r]=(0,n.useState)(),[c,u]=(0,n.useState)(),[p,h]=(0,n.useState)(),[b,v]=(0,n.useState)(),[g,E]=(0,n.useState)(""),[S,k]=(0,n.useState)(),x=(w=p)?w.uri||w.localPath||w.name:void 0;var w;const C=g||(x?function(e){const t=e.split(".").pop();return t?`.${t}`:""}(function(e){return e.endsWith(".gz")?e.slice(0,-3):e}(x)):"");return(0,n.useEffect)((()=>{try{if(p){const n=x?x.split("#")[0].split("?")[0].split("/").pop():"MyTrack",r=`${n}-${Date.now()}`;k(void 0),a({trackId:r,name:n,assemblyNames:[t,e],type:"SyntenyTrack",adapter:f({radioOption:C,assembly1:e,assembly2:t,fileLocation:p,indexFileLocation:b,bed1Location:c,bed2Location:o})})}}catch(e){console.error(e),k(e)}}),[x,e,t,c,o,p,b,C,a]),n.createElement(d.A,{style:{padding:12}},S?n.createElement(y.ErrorMessage,{error:S}):null,n.createElement(A.A,{style:{textAlign:"center"}},"Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),n.createElement(s.A,{value:C,onChange:e=>{E(e.target.value)}},n.createElement(m.Ay,{container:!0,justifyContent:"center"},n.createElement(m.Ay,{item:!0},n.createElement(l.A,{value:".paf",control:n.createElement(i.A,null),label:".paf"})),n.createElement(m.Ay,{item:!0},n.createElement(l.A,{value:".out",control:n.createElement(i.A,null),label:".out"})),n.createElement(m.Ay,{item:!0},n.createElement(l.A,{value:".delta",control:n.createElement(i.A,null),label:".delta"})),n.createElement(m.Ay,{item:!0},n.createElement(l.A,{value:".chain",control:n.createElement(i.A,null),label:".chain"})),n.createElement(m.Ay,{item:!0},n.createElement(l.A,{value:".anchors",control:n.createElement(i.A,null),label:".anchors"})),n.createElement(m.Ay,{item:!0},n.createElement(l.A,{value:".anchors.simple",control:n.createElement(i.A,null),label:".anchors.simple"})),n.createElement(m.Ay,{item:!0},n.createElement(l.A,{value:".pif.gz",control:n.createElement(i.A,null),label:".pif.gz"})))),n.createElement(m.Ay,{container:!0,justifyContent:"center"},n.createElement(m.Ay,{item:!0},".anchors"===g||".anchors.simple"===g?n.createElement("div",null,n.createElement("div",{style:{margin:20}},"Open the ",g," and .bed files for both genome assemblies from the MCScan (Python version) pipeline"," ",n.createElement("a",{href:"https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)"},"(more info)")),n.createElement("div",{style:{display:"flex"}},n.createElement("div",null,n.createElement(y.FileSelector,{name:".anchors file",description:"",location:p,setLocation:e=>{h(e)}})),n.createElement("div",null,n.createElement(y.FileSelector,{name:"genome 1 .bed (left column of anchors file)",description:"",location:c,setLocation:e=>{u(e)}})),n.createElement("div",null,n.createElement(y.FileSelector,{name:"genome 2 .bed (right column of anchors file)",description:"",location:o,setLocation:e=>{r(e)}})))):".pif.gz"===g?n.createElement("div",{style:{display:"flex"}},n.createElement("div",null,n.createElement(y.FileSelector,{name:`${g} location`,description:"",location:p,setLocation:e=>{h(e)}})),n.createElement("div",null,n.createElement(y.FileSelector,{name:`${g} index location`,description:"",location:b,setLocation:e=>{v(e)}}))):n.createElement(y.FileSelector,{name:g?`${g} location`:"",description:"",location:p,setLocation:e=>{h(e)}}))))}));var g=a(98360),E=a(29629),S=a(91468),k=a(68584);const x=(0,h.observer)((({model:e,assembly1:t,assembly2:a,setShowTrackId:o})=>{const r=(0,b.getSession)(e),{tracks:s=[],sessionTracks:l=[]}=r,i=[...s,...l].filter((e=>function(e,t,a){const n=(0,k.readConfObject)(e,"assemblyNames");return n.includes(t)&&n.includes(a)&&e.type.includes("Synteny")}(e,a,t))),c=i[0]?.trackId||"",[m,u]=(0,n.useState)(c);return(0,n.useEffect)((()=>{u(c)}),[c]),(0,n.useEffect)((()=>{o(m)}),[m,o]),n.createElement(d.A,{style:{padding:12}},n.createElement(A.A,{paragraph:!0},'Select a track from the select box below, the track will be shown when you hit "Launch".'),i.length?n.createElement(g.A,{value:m,onChange:e=>{u(e.target.value)}},i.map((e=>n.createElement(E.A,{key:e.trackId,value:e.trackId},(0,S.getTrackName)(e,r))))):n.createElement(y.ErrorMessage,{error:`No synteny tracks found for ${t},${a}`}))})),w=(0,p.n9)()((e=>({importFormContainer:{padding:e.spacing(4),margin:"0 auto"},assemblySelector:{width:"75%",margin:"0 auto"}})));function C({setSessionTrackData:e,setShowTrackId:t,sessionTrackData:a,assembly1:c,assembly2:m,model:d}){const[u,p]=(0,n.useState)("tracklist");return(0,n.useEffect)((()=>{"none"===u&&(e(void 0),t(void 0))}),[u,e,t]),n.createElement(n.Fragment,null,n.createElement(o.A,null,n.createElement(r.A,{id:"group-label"},"(Optional) Select or add a synteny track"),n.createElement(s.A,{row:!0,value:u,onChange:e=>{p(e.target.value)},"aria-labelledby":"group-label"},n.createElement(l.A,{value:"none",control:n.createElement(i.A,null),label:"None"}),n.createElement(l.A,{value:"tracklist",control:n.createElement(i.A,null),label:"Existing track"}),n.createElement(l.A,{value:"custom",control:n.createElement(i.A,null),label:"New track"}))),"custom"===u?n.createElement(v,{setSessionTrackData:e,sessionTrackData:a,assembly2:m,assembly1:c}):null,"tracklist"===u?n.createElement(x,{model:d,assembly1:c,assembly2:m,setShowTrackId:t}):null)}const L=(0,h.observer)((function({model:e}){const{classes:t}=w(),a=(0,b.getSession)(e),{assemblyNames:r}=a,[s,l]=(0,n.useState)(r[0]||""),[i,p]=(0,n.useState)(r[0]||""),[h,A]=(0,n.useState)(),[f,v]=(0,n.useState)(),[g,E]=(0,n.useState)(),S=h;return n.createElement(c.A,{className:t.importFormContainer},S?n.createElement(y.ErrorMessage,{error:S}):null,n.createElement(m.Ay,{container:!0,spacing:1,justifyContent:"center",alignItems:"center",className:t.assemblySelector},n.createElement(m.Ay,{item:!0},n.createElement(d.A,{style:{padding:12}},n.createElement("p",{style:{textAlign:"center"}},"Select assemblies for linear synteny view"),n.createElement(m.Ay,{container:!0,spacing:1,justifyContent:"center",alignItems:"center"},n.createElement(m.Ay,{item:!0},n.createElement(y.AssemblySelector,{selected:i,onChange:e=>{p(e)},session:a})),n.createElement(m.Ay,{item:!0},n.createElement(y.AssemblySelector,{selected:s,onChange:e=>{l(e)},session:a})),n.createElement(m.Ay,{item:!0},n.createElement(o.A,null,n.createElement(u.A,{onClick:async function(){try{if(!(0,b.isSessionWithAddTracks)(a))return;A(void 0);const{assemblyManager:t}=a,n=[i,s];e.setViews(await Promise.all(n.map((async e=>{const a=await t.waitForAssembly(e);if(!a)throw new Error(`Assembly ${e} failed to load`);return{type:"LinearGenomeView",bpPerPx:1,offsetPx:0,hideHeader:!0,displayedRegions:a.regions}})))),e.views.forEach((t=>{t.setWidth(e.width)})),e.views.forEach((e=>{e.showAllRegions()})),f?(a.addTrackConf(f),e.toggleTrack(f.trackId)):g&&e.showTrack(g)}catch(e){console.error(e),A(e)}},variant:"contained",color:"primary"},"Launch"))))),n.createElement(C,{setShowTrackId:E,assembly2:s,assembly1:i,setSessionTrackData:v,sessionTrackData:f,model:e}))))}))},75653:(e,t,a)=>{a.d(t,{A:()=>v});var n=a(7552),o=a(93878),r=a(85693),s=a(70799),l=a(33283),i=a(82081),c=a(24959),m=a(72861),d=a(69500);const u=(0,m.A)(),p=(0,c.A)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${(0,l.A)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),h=e=>(0,i.A)({props:e,name:"MuiContainer",defaultTheme:u});var b=a(15622),y=a(51148),A=a(31049);const f=function(e={}){const{createStyledComponent:t=p,useThemeProps:a=h,componentName:i="MuiContainer"}=e,c=t((({theme:e,ownerState:t})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}})),(({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce(((t,a)=>{const n=a,o=e.breakpoints.values[n];return 0!==o&&(t[e.breakpoints.up(n)]={maxWidth:`${o}${e.breakpoints.unit}`}),t}),{})),(({theme:e,ownerState:t})=>({..."xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},...t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}}}))),m=n.forwardRef((function(e,t){const n=a(e),{className:m,component:u="div",disableGutters:p=!1,fixed:h=!1,maxWidth:b="lg",classes:y,...A}=n,f={...n,component:u,disableGutters:p,fixed:h,maxWidth:b},v=((e,t)=>{const{classes:a,fixed:n,disableGutters:o,maxWidth:i}=e,c={root:["root",i&&`maxWidth${(0,l.A)(String(i))}`,n&&"fixed",o&&"disableGutters"]};return(0,s.A)(c,(e=>(0,r.Ay)(t,e)),a)})(f,i);return(0,d.jsx)(c,{as:u,ownerState:f,className:(0,o.A)(v.root,m),ref:t,...A})}));return m}({createStyledComponent:(0,y.Ay)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${(0,b.A)(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,A.A)({props:e,name:"MuiContainer"})}),v=f},33248:(e,t,a)=>{a.d(t,{A:()=>R});var n=a(7552),o=a(93878),r=a(70799),s=a(72639),l=a(15110),i=a(74893),c=a(69500);const m=(0,i.A)((0,c.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),d=(0,i.A)((0,c.jsx)("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked");var u=a(55270),p=a(51148),h=a(60129);const b=(0,p.Ay)("span",{shouldForwardProp:u.A})({position:"relative",display:"flex"}),y=(0,p.Ay)(m)({transform:"scale(1)"}),A=(0,p.Ay)(d)((0,h.A)((({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})))),f=function(e){const{checked:t=!1,classes:a={},fontSize:n}=e,o={...e,checked:t};return(0,c.jsxs)(b,{className:a.root,ownerState:o,children:[(0,c.jsx)(y,{fontSize:n,className:a.background,ownerState:o}),(0,c.jsx)(A,{fontSize:n,className:a.dot,ownerState:o})]})};var v=a(15622),g=a(4402),E=a(33960),S=a(39006),k=a(38127),x=a(58520),w=a(4785);const C=(0,p.Ay)(l.A,{shouldForwardProp:e=>(0,u.A)(e)||"classes"===e,name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,"medium"!==a.size&&t[`size${(0,v.A)(a.size)}`],t[`color${(0,v.A)(a.color)}`]]}})((0,h.A)((({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${k.A.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,s.X4)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,x.A)()).map((([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,s.X4)(e.palette[t].main,e.palette.action.hoverOpacity)}}}))),...Object.entries(e.palette).filter((0,x.A)()).map((([t])=>({props:{color:t,disabled:!1},style:{[`&.${k.A.checked}`]:{color:(e.vars||e).palette[t].main}}}))),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})))),L=(0,c.jsx)(f,{checked:!0}),M=(0,c.jsx)(f,{}),R=n.forwardRef((function(e,t){const a=(0,w.b)({props:e,name:"MuiRadio"}),{checked:s,checkedIcon:l=L,color:i="primary",icon:m=M,name:d,onChange:u,size:p="medium",className:h,disabled:b,disableRipple:y=!1,...A}=a,f=(0,E.A)();let x=b;f&&void 0===x&&(x=f.disabled),x??=!1;const R={...a,disabled:x,disableRipple:y,color:i,size:p},$=(e=>{const{classes:t,color:a,size:n}=e,o={root:["root",`color${(0,v.A)(a)}`,"medium"!==n&&`size${(0,v.A)(n)}`]};return{...t,...(0,r.A)(o,k.q,t)}})(R),T=(0,S.A)();let z=s;const j=(0,g.A)(u,T&&T.onChange);let N=d;var W,F;return T&&(void 0===z&&(W=T.value,z="object"==typeof(F=a.value)&&null!==F?W===F:String(W)===String(F)),void 0===N&&(N=T.name)),(0,c.jsx)(C,{type:"radio",icon:n.cloneElement(m,{fontSize:M.props.fontSize??p}),checkedIcon:n.cloneElement(l,{fontSize:L.props.fontSize??p}),disabled:x,ownerState:R,classes:$,name:N,checked:z,onChange:j,ref:t,className:(0,o.A)($.root,h),...A})}))},38127:(e,t,a)=>{a.d(t,{A:()=>s,q:()=>r});var n=a(33761),o=a(85693);function r(e){return(0,o.Ay)("MuiRadio",e)}const s=(0,n.A)("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"])},56089:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(7552),o=a(93878),r=a(70799),s=a(83867),l=a(87625),i=a(51584),c=a(77259),m=a(76258),d=a(89456),u=a(69500);const p=n.forwardRef((function(e,t){const{actions:a,children:p,className:h,defaultValue:b,name:y,onChange:A,value:f,...v}=e,g=n.useRef(null),E=(e=>{const{classes:t,row:a,error:n}=e,o={root:["root",a&&"row",n&&"error"]};return(0,r.A)(o,l.B,t)})(e),[S,k]=(0,c.A)({controlled:f,default:b,name:"RadioGroup"});n.useImperativeHandle(a,(()=>({focus:()=>{let e=g.current.querySelector("input:not(:disabled):checked");e||(e=g.current.querySelector("input:not(:disabled)")),e&&e.focus()}})),[]);const x=(0,i.A)(t,g),w=(0,d.A)(y),C=n.useMemo((()=>({name:w,onChange(e){k(e.target.value),A&&A(e,e.target.value)},value:S})),[w,A,k,S]);return(0,u.jsx)(m.A.Provider,{value:C,children:(0,u.jsx)(s.A,{role:"radiogroup",ref:x,className:(0,o.A)(E.root,h),...v,children:p})})}))},76258:(e,t,a)=>{a.d(t,{A:()=>n});const n=a(7552).createContext(void 0)},87625:(e,t,a)=>{a.d(t,{A:()=>s,B:()=>r});var n=a(33761),o=a(85693);function r(e){return(0,o.Ay)("MuiRadioGroup",e)}const s=(0,n.A)("MuiRadioGroup",["root","row","error"])},39006:(e,t,a)=>{a.d(t,{A:()=>r});var n=a(7552),o=a(76258);function r(){return n.useContext(o.A)}},24959:(e,t,a)=>{a.d(t,{A:()=>n});const n=(0,a(15543).Ay)()}}]);
//# sourceMappingURL=8301.877076ce.chunk.js.map