jbrowse-plugin-msaview 5.18.0 → 5.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LaunchMsaView/extendStateModel.test.js +18 -9
- package/dist/LaunchMsaView/index.js +14 -16
- package/dist/chunks/{AboutDialog-QD4L7BYU.js → AboutDialog-ZTQP5WUH.js} +2 -2
- package/dist/chunks/{AnnotationFileDialog-IDJWWQDB.js → AnnotationFileDialog-WKK4E2F6.js} +2 -2
- package/dist/chunks/{ExportSVGDialog-R7ANUOII.js → ExportSVGDialog-HM75NXUI.js} +2 -2
- package/dist/chunks/{FeatureDialog-A7LFBVGM.js → FeatureDialog-N5ER7Y4P.js} +2 -2
- package/dist/chunks/{GapThresholdDialog-LP4UN3SB.js → GapThresholdDialog-2G3L5TUF.js} +2 -2
- package/dist/chunks/{GoToDialog-3HM7K5RZ.js → GoToDialog-BFFKXSJB.js} +2 -2
- package/dist/chunks/{HelpDialog-GJKUU5Z6.js → HelpDialog-EWRTWXZO.js} +2 -2
- package/dist/chunks/{HelpDialog-3IR65NL3.js → HelpDialog-NSGZYIN7.js} +2 -2
- package/dist/chunks/{LaunchMsaViewDialog-KQVGEMH7.js → LaunchMsaViewDialog-LRS3PIOC.js} +3 -3
- package/dist/chunks/{MetadataDialog-4YUN5FJL.js → MetadataDialog-UODKJFPM.js} +2 -2
- package/dist/chunks/{MsaViewPanel-3GZG5IYS.js → MsaViewPanel-AQWZ2N3P.js} +2 -2
- package/dist/chunks/{TrackInfoDialog-D423HM63.js → TrackInfoDialog-WAZUUZ27.js} +2 -2
- package/dist/chunks/{TreeNodeInfoDialog-IXNBDQYV.js → TreeNodeInfoDialog-QHA7LOXE.js} +2 -2
- package/dist/chunks/{chunk-SM4GL27T.js → chunk-3JFOLUP5.js} +5 -5
- package/dist/chunks/{chunk-YOLY6H5C.js → chunk-YX7QETL5.js} +2 -2
- package/dist/chunks/{chunk-YOLY6H5C.js.map → chunk-YX7QETL5.js.map} +2 -2
- package/dist/chunks/{dist-N36EMMBB.js → dist-PJQ65DMT.js} +2 -2
- package/dist/chunks/{model-M736UK5B.js → model-NYWHGBMI.js} +2 -2
- package/dist/jbrowse-plugin-msaview.esm.js +2 -2
- package/dist/jbrowse-plugin-msaview.esm.js.map +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/LaunchMsaView/extendStateModel.test.ts +30 -9
- package/src/LaunchMsaView/index.ts +14 -16
- package/src/version.ts +1 -1
- /package/dist/chunks/{AboutDialog-QD4L7BYU.js.map → AboutDialog-ZTQP5WUH.js.map} +0 -0
- /package/dist/chunks/{AnnotationFileDialog-IDJWWQDB.js.map → AnnotationFileDialog-WKK4E2F6.js.map} +0 -0
- /package/dist/chunks/{ExportSVGDialog-R7ANUOII.js.map → ExportSVGDialog-HM75NXUI.js.map} +0 -0
- /package/dist/chunks/{FeatureDialog-A7LFBVGM.js.map → FeatureDialog-N5ER7Y4P.js.map} +0 -0
- /package/dist/chunks/{GapThresholdDialog-LP4UN3SB.js.map → GapThresholdDialog-2G3L5TUF.js.map} +0 -0
- /package/dist/chunks/{GoToDialog-3HM7K5RZ.js.map → GoToDialog-BFFKXSJB.js.map} +0 -0
- /package/dist/chunks/{HelpDialog-GJKUU5Z6.js.map → HelpDialog-EWRTWXZO.js.map} +0 -0
- /package/dist/chunks/{HelpDialog-3IR65NL3.js.map → HelpDialog-NSGZYIN7.js.map} +0 -0
- /package/dist/chunks/{LaunchMsaViewDialog-KQVGEMH7.js.map → LaunchMsaViewDialog-LRS3PIOC.js.map} +0 -0
- /package/dist/chunks/{MetadataDialog-4YUN5FJL.js.map → MetadataDialog-UODKJFPM.js.map} +0 -0
- /package/dist/chunks/{MsaViewPanel-3GZG5IYS.js.map → MsaViewPanel-AQWZ2N3P.js.map} +0 -0
- /package/dist/chunks/{TrackInfoDialog-D423HM63.js.map → TrackInfoDialog-WAZUUZ27.js.map} +0 -0
- /package/dist/chunks/{TreeNodeInfoDialog-IXNBDQYV.js.map → TreeNodeInfoDialog-QHA7LOXE.js.map} +0 -0
- /package/dist/chunks/{chunk-SM4GL27T.js.map → chunk-3JFOLUP5.js.map} +0 -0
- /package/dist/chunks/{dist-N36EMMBB.js.map → dist-PJQ65DMT.js.map} +0 -0
- /package/dist/chunks/{model-M736UK5B.js.map → model-NYWHGBMI.js.map} +0 -0
|
@@ -30,16 +30,25 @@ function hostReadingThis(clickedType) {
|
|
|
30
30
|
},
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.
|
|
33
|
+
const rows = (stateModel) => stateModel.create().contextMenuItems();
|
|
34
|
+
const labels = (stateModel) => rows(stateModel).map(i => i.label);
|
|
35
|
+
const launchLabels = (stateModel) => rows(stateModel)
|
|
36
|
+
.find(i => i.label === 'Launch')
|
|
37
|
+
?.subMenu?.map(i => i.label);
|
|
37
38
|
describe('extendStateModel', () => {
|
|
38
39
|
test('calls the host contextMenuItems with a receiver', () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const model = extendStateModel(hostReadingThis('mRNA'));
|
|
41
|
+
expect(labels(model)).toEqual(['host item true', 'Launch']);
|
|
42
|
+
expect(launchLabels(model)).toEqual(['MSA view...']);
|
|
43
|
+
});
|
|
44
|
+
test('joins a Launch submenu another plugin built', () => {
|
|
45
|
+
const model = extendStateModel(hostReadingThis('mRNA').views(() => ({
|
|
46
|
+
contextMenuItems() {
|
|
47
|
+
return [{ label: 'Launch', subMenu: [{ label: 'Protein view...' }] }];
|
|
48
|
+
},
|
|
49
|
+
})));
|
|
50
|
+
expect(labels(model)).toEqual(['Launch']);
|
|
51
|
+
expect(launchLabels(model)).toEqual(['Protein view...', 'MSA view...']);
|
|
43
52
|
});
|
|
44
53
|
test('leaves the host menu alone when the click is not on a gene', () => {
|
|
45
54
|
expect(labels(extendStateModel(hostReadingThis('CDS')))).toEqual([
|
|
@@ -62,7 +71,7 @@ describe('extendStateModel', () => {
|
|
|
62
71
|
});
|
|
63
72
|
expect(labels(withOther)).toEqual([
|
|
64
73
|
'host item true',
|
|
65
|
-
'Launch
|
|
74
|
+
'Launch',
|
|
66
75
|
'other plugin',
|
|
67
76
|
]);
|
|
68
77
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
+
import { pushLaunchViewMenuItem } from '@jbrowse/core/ui';
|
|
2
3
|
import { getContainingTrack, getSession } from '@jbrowse/core/util';
|
|
3
4
|
import AddIcon from '@mui/icons-material/Add';
|
|
4
5
|
import { isCodingFeature } from './codingFeature';
|
|
@@ -50,22 +51,19 @@ export function extendStateModel(stateModel) {
|
|
|
50
51
|
return {
|
|
51
52
|
contextMenuItems() {
|
|
52
53
|
const target = launchTarget(self);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
]
|
|
67
|
-
: []),
|
|
68
|
-
];
|
|
54
|
+
// a detached call leaves `this` undefined for a host method that
|
|
55
|
+
// reads it, and the throw takes the host's own rows with it
|
|
56
|
+
const items = [...superContextMenuItems.call(self)];
|
|
57
|
+
if (target) {
|
|
58
|
+
pushLaunchViewMenuItem(items, {
|
|
59
|
+
label: 'MSA view...',
|
|
60
|
+
icon: AddIcon,
|
|
61
|
+
onClick: () => {
|
|
62
|
+
openDialog(self, target);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return items;
|
|
69
67
|
},
|
|
70
68
|
};
|
|
71
69
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-CKXVJK5K.js";import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=AboutDialog-
|
|
1
|
+
import{a as n}from"./chunk-CKXVJK5K.js";import{a as l}from"./chunk-YX7QETL5.js";import{S as r,n as o,u as t}from"./chunk-EXFKF6XR.js";import{r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";function i({onClose:a}){return e.createElement(l,{open:!0,title:"About",onClose:()=>{a()}},e.createElement(o,null,e.createElement(r,null,"MSAView ",n," (",e.createElement(t,{target:"_blank",rel:"noopener",href:"https://github.com/gmod/react-msaview"},"Github"),")"),e.createElement("ul",null,e.createElement("li",null,e.createElement(r,null,"We use some color schemes from the"," ",e.createElement(t,{target:"_blank",rel:"noopener",href:"https://github.com/biotite-dev/biotite"},"biotite")," ","project, and their license is reproduced"," ",e.createElement(t,{target:"_blank",rel:"noopener",href:"https://github.com/biotite-dev/biotite/blob/master/LICENSE.rst"},"here"))),e.createElement("li",null,e.createElement(r,null,"See this page for some information on jalview colorings"," ",e.createElement(t,{target:"_blank",rel:"noopener",href:"https://www.jalview.org/help/html/colourSchemes/"},"here"))),e.createElement("li",null,e.createElement(r,null,"See this page for some info on the clustal, cinema, maeditor, and lesk color schemes"," ",e.createElement(t,{target:"_blank",rel:"noopener",href:"http://www.bioinformatics.nl/~berndb/aacolour.html"},"here"))),e.createElement("li",null,e.createElement(r,null,"See this paper about the flower color scheme"," ",e.createElement(t,{target:"_blank",rel:"noopener",href:"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/"},"here"))))))}export{i as default};
|
|
2
|
+
//# sourceMappingURL=AboutDialog-ZTQP5WUH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as b}from"./chunk-JJ3VMN7J.js";import"./chunk-7763LQXU.js";import{a as
|
|
2
|
-
//# sourceMappingURL=AnnotationFileDialog-
|
|
1
|
+
import{h as b}from"./chunk-JJ3VMN7J.js";import"./chunk-7763LQXU.js";import{a as g}from"./chunk-PFO3G4CM.js";import{a as h,b as v}from"./chunk-YX7QETL5.js";import{D as u,E as w,N as T,S as a,g as c,m as y,n as F,q as x,r as m,u as C}from"./chunk-EXFKF6XR.js";import{p as l,r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var D="https://gmod.org/JBrowseMSA/tutorials/protein_family";async function S(o){let n=await fetch(o);if(!n.ok)throw new Error(`HTTP ${n.status} fetching ${o} ${await n.text()}`);return n.text()}var G=g(function({handleClose:o,model:n}){let[r,k]=l(),[i,L]=l("file"),[s,O]=l(""),[f,p]=l(),[R,E]=l(!1);return e.createElement(h,{maxWidth:"xl",title:"Open annotation file",onClose:()=>{o()},open:!0},e.createElement(F,null,f?e.createElement(v,{error:f}):null,e.createElement(a,null,"Open a GFF3 file of annotations, such as the one `react-msaview-cli interpro` writes, or the JSON an InterProScan run returns."," ",e.createElement(C,{href:D,target:"_blank",rel:"noopener noreferrer"},"How to make one")),e.createElement("div",{style:{display:"flex",margin:30}},e.createElement(x,{component:"fieldset"},e.createElement(w,{value:i,onChange:t=>{L(t.target.value)}},e.createElement(m,{value:"url",control:e.createElement(u,null),label:"URL"}),e.createElement(m,{value:"file",control:e.createElement(u,null),label:"File"}))),i==="url"?e.createElement("div",null,e.createElement(a,null,"Open an annotation file from a URL"),e.createElement(T,{label:"URL",value:s,onChange:t=>{O(t.target.value)}})):e.createElement("div",{style:{paddingTop:20}},e.createElement(a,null,"Open an annotation file from your local drive"),e.createElement(c,{variant:"outlined",component:"label"},"Choose File",e.createElement("input",{type:"file",hidden:!0,onChange:({target:t})=>{let d=t.files?.[0];d&&k(d)}})),r?e.createElement(a,null,r.name):null))),e.createElement(y,null,e.createElement(c,{variant:"contained",color:"primary",disabled:R||(i==="file"?!r:!s.trim()),onClick:()=>{(async()=>{E(!0),p(void 0);try{let t=await(i==="file"&&r?r.text():S(s));n.setGFF(b(t)),n.setShowDomains(!0),n.setCellFill("domain"),o()}catch(t){console.error(t),p(t)}finally{E(!1)}})()}},"Open annotations"),e.createElement(c,{variant:"contained",color:"secondary",onClick:()=>{o()}},"Cancel")))}),J=G;export{J as default};
|
|
2
|
+
//# sourceMappingURL=AnnotationFileDialog-WKK4E2F6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-DW5INM5K.js";import{ea as z,ga as P}from"./chunk-LNMEYTCN.js";import{a as
|
|
2
|
-
//# sourceMappingURL=ExportSVGDialog-
|
|
1
|
+
import{a as h}from"./chunk-DW5INM5K.js";import{ea as z,ga as P}from"./chunk-LNMEYTCN.js";import{a as b}from"./chunk-PFO3G4CM.js";import{a as k,b as C}from"./chunk-YX7QETL5.js";import{D as i,E as L,S as D,T as V,d as M,g as p,j as S,m as A,n as F,q as G,r as a,s as I}from"./chunk-EXFKF6XR.js";import{p as r,r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";function K(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}function N(t){return t==="entire"||t==="viewport"||t==="selection"}var Q=b(function({model:t,onClose:c}){let[s,R]=r(!0),[o,q]=r(!0),[E,H]=r("viewport"),[d,W]=r(),[u,g]=r(!1),x=V(),{turnedOnTracks:B,showMsaLetters:O,resolvedSelection:y}=t,{colWidth:_,rowHeight:j}=t,f=B.length>0,n=E==="selection"&&!y?"entire":E,m=z(t,{theme:x,exportType:n,includeTracks:o}),v=P(t,m),w=O&&n!=="viewport"?Math.round(m.msaAreaWidth/_)*Math.round(m.contentHeight/j):0,J=w>1e5;return e.createElement(k,{onClose:()=>{c()},open:!0,title:"Export SVG"},e.createElement(F,null,d?e.createElement(C,{error:d}):null,e.createElement(D,null,"Settings:"),e.createElement(h,{label:"Include minimap?",disabled:n!=="viewport",checked:s,onChange:()=>{R(!s)}}),f?e.createElement(h,{label:"Include tracks?",checked:o,onChange:()=>{q(!o)}}):null,e.createElement("div",null,e.createElement(G,null,e.createElement(I,null,"Export type"),e.createElement(L,{value:n,onChange:l=>{let{value:T}=l.target;N(T)&&H(T)}},e.createElement(a,{value:"entire",control:e.createElement(i,null),label:"Entire MSA"}),e.createElement(a,{value:"viewport",control:e.createElement(i,null),label:"Current viewport only"}),y?e.createElement(a,{value:"selection",control:e.createElement(i,null),label:"Selection only"}):null))),J?e.createElement(M,{severity:"warning",style:{marginTop:8}},"The ",n==="selection"?"selection":"entire MSA"," is"," ",Math.round(v.width),"x",Math.round(v.height)," pixels and draws"," ",Math.round(w/1e3),"k residue letters, each its own SVG element. Export may be slow or fail \u2014 zooming out far enough to hide the letters exports the same alignment as an image instead."):null),e.createElement(A,null,e.createElement(p,{variant:"contained",color:"primary",disabled:u,startIcon:u?e.createElement(S,{size:16,color:"inherit"}):null,onClick:()=>{g(!0),K(()=>{t.exportSVG({theme:x,includeMinimap:s,includeTracks:f&&o,exportType:n}).then(()=>{c()}).catch(l=>{console.error(l),W(l)}).finally(()=>{g(!1)})})}},u?"Exporting\u2026":"Export"),e.createElement(p,{variant:"contained",color:"secondary",onClick:()=>{c()}},"Cancel")))}),te=Q;export{te as default};
|
|
2
|
+
//# sourceMappingURL=ExportSVGDialog-HM75NXUI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=FeatureDialog-
|
|
1
|
+
import{a as c}from"./chunk-PFO3G4CM.js";import{a as b}from"./chunk-YX7QETL5.js";import{H as k,I as F,J as n,K as w,L as E,N as x,g as f,h as T,n as C}from"./chunk-EXFKF6XR.js";import{p as h,r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";function D(l,a){return[l.accession,l.name,l.description].some(o=>o.toLowerCase().includes(a))}var z=c(function({model:l,accessions:a}){let o=s=>{for(let m of a)l.setFilter(m,s)};return e.createElement("div",null,e.createElement(f,{onClick:()=>{o(!0)}},"Toggle all on"),e.createElement(f,{onClick:()=>{o(!1)}},"Toggle all off"))}),B=c(function({model:l}){let{annotationTypes:a,annotations:o,featureColors:s,fillPalette:m}=l,[g,v]=h(""),d=g.trim().toLowerCase(),p=[...a.values()].filter(t=>!d||D(t,d)),u=new Map,i=new Map;for(let t of o){let{accession:r}=t;u.set(r,(u.get(r)??0)+1),i.has(r)||i.set(r,s.get(t)?.fill??m[r])}return e.createElement(e.Fragment,null,e.createElement(x,{label:"Filter",size:"small",value:g,onChange:t=>{v(t.target.value)}}),e.createElement(z,{model:l,accessions:p.map(t=>t.accession)}),e.createElement(k,{size:"small"},e.createElement(w,null,e.createElement(E,null,e.createElement(n,{padding:"checkbox"}),e.createElement(n,null,"color"),e.createElement(n,null,"accession"),e.createElement(n,null,"name"),e.createElement(n,null,"count"),e.createElement(n,null,"description"))),e.createElement(F,null,p.map(({accession:t,name:r,description:y})=>e.createElement(E,{key:t},e.createElement(n,{padding:"checkbox"},e.createElement(T,{checked:!l.featureOff(t),onChange:()=>{l.setFilter(t,l.featureOff(t))}})),e.createElement(n,null,e.createElement("div",{style:{width:20,height:20,background:i.get(t)}})),e.createElement(n,null,t),e.createElement(n,null,r),e.createElement(n,null,u.get(t)),e.createElement(n,null,y))))))}),L=c(function({onClose:l,model:a}){return e.createElement(b,{onClose:()=>{l()},open:!0,title:"Feature filters",maxWidth:"xl"},e.createElement(C,null,e.createElement(B,{model:a})))}),A=L;export{A as default};
|
|
2
|
+
//# sourceMappingURL=FeatureDialog-N5ER7Y4P.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a
|
|
2
|
-
//# sourceMappingURL=GapThresholdDialog-
|
|
1
|
+
import{a}from"./chunk-PFO3G4CM.js";import{a as p}from"./chunk-YX7QETL5.js";import{F as u,S as r,g as m,m as c,n as d}from"./chunk-EXFKF6XR.js";import{p as s,r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var f=a(function({model:t}){let[h,l]=s(),i=h??t.allowedGappyness;return e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8}},e.createElement(r,{style:{whiteSpace:"nowrap"}},"\u2265",i,"% gaps"),e.createElement(u,{"data-testid":"gappyness_slider",style:{width:200,marginInline:10},min:1,max:100,value:i,onChange:(y,n)=>{l(n)},onChangeCommitted:(y,n)=>{t.setAllowedGappyness(n),l(void 0)}}))}),g=f;var E=a(function({model:o,onClose:t}){return e.createElement(p,{open:!0,onClose:t,title:"Hide gappy columns"},e.createElement(d,null,e.createElement(r,{variant:"body2",sx:{mb:2}},"The viewer hides each column where at least this share of the rows has a gap."),e.createElement(g,{model:o})),e.createElement(c,null,e.createElement(m,{variant:"contained",onClick:t},"Close")))}),_=E;export{_ as default};
|
|
2
|
+
//# sourceMappingURL=GapThresholdDialog-2G3L5TUF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as l}from"./chunk-X5QA4AF6.js";import
|
|
2
|
-
//# sourceMappingURL=GoToDialog-
|
|
1
|
+
import{b as l}from"./chunk-X5QA4AF6.js";import"./chunk-PFO3G4CM.js";import{a as e}from"./chunk-YX7QETL5.js";import{n as r}from"./chunk-EXFKF6XR.js";import{r as o}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";function n({model:m,onClose:t}){return o.createElement(e,{open:!0,onClose:t,title:"Go to row or column",maxWidth:"xs",fullWidth:!0},o.createElement(r,null,o.createElement(l,{model:m,onFound:t})))}export{n as default};
|
|
2
|
+
//# sourceMappingURL=GoToDialog-BFFKXSJB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f,b as g}from"./chunk-LFBMB523.js";import{a as b}from"./chunk-CKXVJK5K.js";import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=HelpDialog-
|
|
1
|
+
import{a as f,b as g}from"./chunk-LFBMB523.js";import{a as b}from"./chunk-CKXVJK5K.js";import{a as m}from"./chunk-YX7QETL5.js";import{H as s,I as p,J as a,L as E,S as n,g as r,m as c,n as u}from"./chunk-EXFKF6XR.js";import{g as i,r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var d=i(()=>import("./AboutDialog-ZTQP5WUH.js"));function y({title:l,rows:t}){return e.createElement(e.Fragment,null,e.createElement(n,{variant:"subtitle2",sx:{mt:1}},l),e.createElement(s,{size:"small","aria-label":l},e.createElement(p,null,t.map(({label:o,action:C})=>e.createElement(E,{key:o},e.createElement(a,{sx:{whiteSpace:"nowrap",fontWeight:500}},o),e.createElement(a,null,C))))))}function k({model:l,onClose:t}){return e.createElement(m,{open:!0,title:"Mouse & keyboard",onClose:t},e.createElement(u,null,e.createElement(y,{title:"Mouse",rows:g}),e.createElement(y,{title:"Keyboard (click the alignment first)",rows:f})),e.createElement(c,null,e.createElement(n,{variant:"caption",sx:{mr:"auto",pl:1}},"MSAView ",b),e.createElement(r,{onClick:()=>{l.queueDialog(o=>[d,{onClose:o}]),t()}},"About & credits"),e.createElement(r,{variant:"contained",onClick:t},"Close")))}export{k as default};
|
|
2
|
+
//# sourceMappingURL=HelpDialog-EWRTWXZO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=HelpDialog-
|
|
1
|
+
import{a as n}from"./chunk-PFO3G4CM.js";import{a as r}from"./chunk-YX7QETL5.js";import{S as t,g as a,m as i,n as s,p as h}from"./chunk-EXFKF6XR.js";import{r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var g=n(function({handleClose:o}){return e.createElement(r,{open:!0,maxWidth:"md",onClose:o,title:"Launching an MSA"},e.createElement(s,null,e.createElement(t,{gutterBottom:!0},"Every tab aligns the same thing: the protein the selected transcript translates to. That transcript is the query row, which is what ties alignment columns back to codons in the genome view \u2014 hovering one highlights the other, and clicking navigates."),e.createElement(t,{variant:"h6",gutterBottom:!0},"Orthologs"),e.createElement(t,{gutterBottom:!0},'Precomputed sets, looked up rather than searched for: NCBI and PANTHER give one gene per species, and a UniRef cluster gives every UniProtKB entry within 50% identity of the query, one per species, from any organism. Nothing is queued, so this is the quickest route to "this gene across species".'),e.createElement(t,{variant:"h6",gutterBottom:!0},"BLAST query"),e.createElement(t,{gutterBottom:!0},`Searches run at EBI's Job Dispatcher, which searches UniProtKB. Swiss-Prot returns curated sequences that align more cleanly than the many near-identical entries a TrEMBL search brings back. blastp finds the hits and the chosen aligner then aligns them \u2014 "in browser" needs no second EBI job. phmmer instead searches with a profile HMM built from the query and aligns as it goes, so its output is the alignment and nothing is realigned; a hit matching the query in more than one place appears once per matched region. The Representative Proteomes (15% to 75%) spread the hits across all of life.`),e.createElement(t,{gutterBottom:!0},"The EBI queue is the wait, and it runs from seconds to many minutes. Searching NCBI's nr needs the Manual option, which links out to NCBI's own site: NCBI no longer lets a browser read responses from Blast.cgi."),e.createElement(t,{variant:"h6",gutterBottom:!0},"Pre-loaded MSA datasets and Manual upload"),e.createElement(t,{gutterBottom:!0},"Both take an alignment that already exists \u2014 one a dataset the site configured, the other a file or pasted text. In each case the row matching the selected transcript is found by comparing residues, not by name, because aligners rename the query on the way through.")),e.createElement(h,null),e.createElement(i,null,e.createElement(a,{onClick:o,color:"primary"},"Close")))}),c=g;export{c as default};
|
|
2
|
+
//# sourceMappingURL=HelpDialog-NSGZYIN7.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as Ct}from"./chunk-ZWQTJTRR.js";import{F as Pt,a as B,c as ft,d as Y,e as Me,f as Ve,g as X,h as _,i as ht,j as Ae,k as Ce,l as Le,m as yt,n as vt,s as At,t as Qe,u as Ie,x as Be,z as Ft}from"./chunk-SIKAYSRK.js";import{g as K,h as dt,i as me,k as Ge,l as Ne,m as wt,n as ke,o as xt,p as Tt,r as Fe,s as Pe,t as Mt}from"./chunk-KHRURQPK.js";import{a as pt,b as kt}from"./chunk-CREQPIFJ.js";import{d as Lt,e as Nt}from"./chunk-JJ3VMN7J.js";import{a as gt,b as ce,c as St,d as bt}from"./chunk-DECSTFAT.js";import{a as y}from"./chunk-3KTCIF2L.js";import{a as pe,b as fe}from"./chunk-7ZEXFLSY.js";import{a as Ze}from"./chunk-YN7VVNZR.js";import{c as He}from"./chunk-QBRNXRNU.js";import"./chunk-7763LQXU.js";import{e as We,f as j,n as Je}from"./chunk-AISU7SRE.js";import{a as Re,b as Se,c as $e,d as te,e as et}from"./chunk-
|
|
2
|
-
${i}`:m==="missing"?"This transcript has no coding sequence, so there is nothing to translate.":m==="error"?"The sequence could not be fetched.":"Loading..."}):null)}),G=Co;var ae={drawNodeBubbles:!0,colWidth:10,rowHeight:12};function q({view:o,feature:t,placement:r,...n}){return bt(j(o),{placement:r,connectedViewId:o.id,connectedFeature:t?.toJSON(),...n})}function Q(o){let[t,r]=d(),n=ge(!1);return{launchError:t,submit:a=>{n.current||(n.current=!0,r(void 0),a().then(o,s=>{n.current=!1,console.error(s),r(s)}))}}}var Dt=o=>o==null||o===!1;function Lo(o){return Dt(o)||Array.isArray(o)&&o.some(Dt)?null:JSON.stringify(o)}function E(o,t,{onSuccess:r}={}){let n=Lo(o),[a,s]=d(0),[i,m]=d(),p=n===null?null:`${a}\0${n}`,l=i?.attempt===p,h=i?.question===n,g=ge({fetcher:t,onSuccess:r});return he(()=>{g.current={fetcher:t,onSuccess:r}}),he(()=>{if(p===null||n===null)return;let c=new AbortController;return g.current.fetcher(c.signal).then(f=>{c.signal.aborted||(m({attempt:p,question:n,data:f}),g.current.onSuccess?.(f))}).catch(f=>{c.signal.aborted||m({attempt:p,question:n,error:f})}),()=>{c.abort()}},[p,n]),{data:h?i.data:void 0,error:l?i.error:void 0,isLoading:p!==null&&!l,mutate:Ye(()=>{s(c=>c+1)},[])}}function Ee(o,t){let[r,n]=d(o);return he(()=>{let a=setTimeout(()=>{n(o)},t);return()=>{clearTimeout(a)}},[o,t]),r}function Ot({view:o,feature:t}){let r=o?.assemblyNames?.[0],{data:n,error:a,isLoading:s}=E(t&&r?[t.id(),r,"feature-sequence"]:null,async m=>{let{start:p,end:l,refName:h}=t.toJSON();return vt({start:p,end:l,refName:h,assemblyName:r,session:j(o),signal:m})});return{proteinSequence:I(()=>n&&t?yt({transcript:t,...n})?.protein??"":"",[n,t]),sequence:n,error:a,isLoading:s}}function No(o,t,r){if(!r)return o;let n=t.find(s=>Y(s)===o);if(n&&r(n))return o;let a=t.find(r);return a?Y(a):o}function ko({error:o,isLoading:t,proteinSequence:r}){return o?"error":t?"loading":r?"ready":"missing"}function H({feature:o,view:t,hasData:r,preferredTranscriptId:n}){let a=I(()=>Ae(o),[o]),[s,i]=d(()=>Y(a.find(c=>Me(c,n??""))??a[0])),m=No(s,a,r),p=a.find(c=>Y(c)===m),{proteinSequence:l,error:h,isLoading:g}=Ot({view:t,feature:p});return{options:a,selectedId:m,setSelectedId:i,selectedTranscript:p,proteinSequence:l,error:h,isLoading:g,sequenceStatus:ko({error:h,isLoading:g,proteinSequence:l}),hasData:r}}var jt=pe(fe("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");var Fo=y()({header:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},resultList:{maxHeight:300,overflow:"auto"}});function _t(o){let t=[o.geneName,o.transcriptName!==o.geneName?o.transcriptName:void 0].filter(r=>!!r);return t.length>0?t.join(" - "):o.geneId??o.transcriptId??"Unknown"}function Po(o){return[o.blastDatabase,o.searchProgram??o.blastProgram??"blastp",o.msaAlgorithm].filter(Boolean).join(" / ")}var Io=u(function({model:o,handleClose:t,feature:r,cached:{results:n,handleDelete:a,handleClearAll:s}}){let{classes:i}=Fo(),m=B(o),[p,l]=d(),[h]=qe(),g=c=>{let{transcriptId:f,msa:T,tree:S,treeMetadata:L}=c;q({view:m,feature:f?Ae(r).find(x=>Me(x,f)):void 0,placement:h?"splitRight":"stack",displayName:`BLAST - ${_t(c)}`,...ae,data:{msa:T,tree:S,treeMetadata:L}}).then(t,x=>{console.error(x),l(x)})};return e.createElement("div",null,p?e.createElement(Se,{error:p}):null,e.createElement("div",{className:i.header},e.createElement(M,{variant:"subtitle1"},"Cached BLAST Results (",n.length,")"),e.createElement(O,{size:"small",color:"error",onClick:async()=>{try{l(void 0),await s()}catch(c){l(c)}}},"Clear results for this gene")),e.createElement(it,{dense:!0,className:i.resultList},n.map(c=>e.createElement(lt,{key:c.id,disablePadding:!0,secondaryAction:e.createElement(re,{edge:"end",size:"small",onClick:async f=>{f.stopPropagation();try{l(void 0),await a(c.id)}catch(T){l(T)}}},e.createElement(jt,{fontSize:"small"}))},e.createElement(mt,{onClick:()=>{g(c)}},e.createElement(ct,{primary:`${_t(c)} - ${Po(c)}`,secondary:`${new Date(c.timestamp).toLocaleString()} - Seq: ${c.proteinSequence.slice(0,30)}...`}))))))}),$t=Io;var Bo=u(function({value:t,onChange:r,className:n}){return e.createElement(b,{variant:"outlined",label:"MSA Algorithm",className:n,select:!0,value:t,helperText:t==="browser"?"no EBI job; rows aligned to the query":void 0,onChange:a=>{r(a.target.value)}},Ne.map(a=>e.createElement(F,{value:a,key:a},wt[a])))}),De=Bo;var qo="msaView-blastSearch",Eo="msaView-msaAlgorithm",Vt=Fe("blastp"),Gt="clustalo";function Do(o){let{program:t,database:r}=o??{},n=ke.find(a=>a===t);return n&&Pe(n).some(a=>a===r)?{program:n,database:r}:Vt}function Oo(o){return Ne.find(t=>t===o)??Gt}function Qt(){let[o,t]=K(qo,Vt);return[Do(o),r=>{t(r)}]}function Oe(){let[o,t]=K(Eo,Gt);return[Oo(o),r=>{t(r)}]}function Ht(o){let{data:t,error:r,isLoading:n,mutate:a}=E(`cached-blast-${o.join(",")}`,async()=>(await At()).filter(i=>i.geneId&&o.includes(i.geneId)));return{results:t??[],error:r,isLoading:n,handleDelete:async s=>{await Qe(s),a()},handleClearAll:async()=>{await Promise.all((t??[]).map(s=>Qe(s.id))),a()}}}var jo=y()({selectField:{width:150},databaseField:{width:260},cachedResultsAccordion:{marginTop:20},infoText:{marginTop:20}}),_o=u(function({handleClose:o,feature:t,model:r,children:n,preferredTranscriptId:a}){let{classes:s}=jo(),i=B(r),{launchError:m,submit:p}=Q(o),[l,h]=Qt(),[g,c]=Oe(),[f,T]=d(String(Tt)),S=Number(f),L=Number.isInteger(S)&&S>=1,x=l.program==="phmmer",k=I(()=>Le(t),[t]),A=Ht(k),C=H({feature:t,view:i,preferredTranscriptId:a}),{selectedTranscript:v,proteinSequence:P,sequenceStatus:W}=C,N=C.error??m??A.error;return e.createElement(e.Fragment,null,e.createElement($,{error:N},n,e.createElement(b,{variant:"outlined",label:"Search program",className:s.selectField,select:!0,value:l.program,onChange:w=>{h(Fe(w.target.value))}},ke.map(w=>e.createElement(F,{value:w,key:w},xt[w]))),e.createElement(b,{variant:"outlined",label:"Database",className:s.databaseField,select:!0,value:l.database,onChange:w=>{h({program:l.program,database:w.target.value})}},Pe(l.program).map(w=>e.createElement(F,{value:w,key:w},Mt(w)))),x?null:e.createElement(De,{className:s.selectField,value:g,onChange:c}),e.createElement(b,{variant:"outlined",label:"Hits",className:s.selectField,type:"number",value:f,onChange:w=>{T(w.target.value)},error:!L,helperText:"best-scoring sequences to keep"}),e.createElement(G,{feature:t,...C}),e.createElement(M,{variant:"body2",className:s.infoText},x?"phmmer aligns the hits as it finds them, so nothing is realigned afterwards.":"The hits come back from EBI and are then run through the chosen aligner."," ","The EBI queue is the wait, and it runs from seconds to many minutes."),A.results.length>0?e.createElement(tt,{className:s.cachedResultsAccordion},e.createElement(rt,{expandIcon:e.createElement(pt,null)},e.createElement(M,null,"Previous BLAST Results")),e.createElement(ot,null,e.createElement($t,{model:r,handleClose:o,feature:t,cached:A}))):null),e.createElement(V,{model:r,hint:e.createElement(z,{status:W}),submitDisabled:!P||!L,onSubmit:w=>{if(v){let R=l.program==="phmmer"?{searchProgram:"phmmer",blastDatabase:l.database,maxHits:S,selectedTranscript:v.toJSON(),proteinSequence:P}:{searchProgram:"blastp",blastDatabase:l.database,msaAlgorithm:g,maxHits:S,selectedTranscript:v.toJSON(),proteinSequence:P};p(()=>q({view:i,feature:v,placement:w,displayName:ht(t,v),...ae,blastParams:R}))}},onCancel:o}))}),Wt=_o;function Ut(o){return Ce(o).toUpperCase()}function $o(o,t){let r=Math.min(o.length,t.length);if(r===0)return 0;let n=0;for(let a=0;a<r;a++)o[a]===t[a]&&n++;return n/r}var Vo=.9,Go=.5;function zt(o,t,r){if(!o.trim())return{names:[]};let n;try{n=Lt(o)}catch{return{names:[]}}let a=n.getNames(),s=Ut(t);return{names:a,match:s?Ho(n,a,s,r):void 0}}function Qo(o,t,r){let n=Ut(Nt(o.getRow(t)));if(n){if(n===r)return{name:t,quality:"exact",identity:1,offset:0};{let a=r.indexOf(n),s=n.indexOf(r);if(a!==-1||s!==-1){let i=Math.min(n.length,r.length)/Math.max(n.length,r.length);return i>=Go?{name:t,quality:"partial",identity:i,offset:a===-1?-s:a}:void 0}else{let i=$o(n,r);return i>=Vo?{name:t,quality:"similar",identity:i,offset:0}:void 0}}}else return}var Jt=["exact","partial","similar"];function Ho(o,t,r,n){return t.map(a=>Qo(o,a,r)).filter(a=>a!==void 0).sort((a,s)=>Jt.indexOf(a.quality)-Jt.indexOf(s.quality)||s.identity-a.identity||+(s.name===n)-+(a.name===n))[0]}function Kt(o,t){return o.querySeqName||(o.names.includes(t)?t:"")}function se(o,t,r){let[n,a]=d(),{names:s,match:i}=I(()=>zt(o,t,r),[o,t,r]),m=n!==void 0&&(s.length===0||s.includes(n))?n:void 0,p=m??i?.name??"";return{detected:i,names:s,querySeqName:p,querySeqOffset:p===i?.name?i.offset:0,setQuerySeqName:a,isAutoDetected:m===void 0&&!!i}}var Wo=y()({field:{marginTop:20},alert:{marginTop:10}});function Jo({identity:o,offset:t}){let r=`, covering ${Math.round(o*100)}% of it`;return t>0?`${r} from residue ${t+1}`:t<0?`${r} and running ${-t} residues past its start`:r}var Uo=u(function({names:t,detected:r,querySeqName:n,setQuerySeqName:a,isAutoDetected:s}){let{classes:i}=Wo();return e.createElement(e.Fragment,null,t.length>0?e.createElement(b,{variant:"outlined",label:"MSA row matching the selected transcript",select:!0,fullWidth:!0,className:i.field,value:t.includes(n)?n:"",onChange:m=>{a(m.target.value)}},t.map(m=>e.createElement(F,{value:m,key:m},m,r?.name===m?" \u2014 matches your protein":""))):e.createElement(b,{variant:"outlined",label:"MSA row matching the selected transcript",fullWidth:!0,className:i.field,helperText:"Paste an alignment above and this fills in on its own",value:n,onChange:m=>{a(m.target.value)}}),s&&r?r.quality==="similar"?e.createElement(oe,{severity:"warning",className:i.alert},e.createElement("strong",null,r.name)," is"," ",Math.round(r.identity*100),"% identical to your protein but is not the same sequence. Clicking the alignment navigates the genome view, approximately: wherever the two differ by an insertion or a deletion, every residue after it lands one codon off."):e.createElement(oe,{severity:"success",className:i.alert},"Matched ",e.createElement("strong",null,r.name)," to your protein sequence",r.quality==="exact"?"":Jo(r),". Clicking the alignment will navigate the genome view."):t.length>0&&!n?e.createElement(oe,{severity:"warning",className:i.alert},"No row matched your protein sequence \u2014 pick the one for your gene above. Without it the alignment still renders, but clicking it will not navigate the genome view."):null)}),ie=Uo;var zo=y()({ncbiLink:{wordBreak:"break-all"},textAreaFont:{fontFamily:"Courier New"},msaInput:{marginBottom:20},step:{marginTop:20},stepBody:{marginLeft:20,marginTop:8}}),Ko=u(function({handleClose:o,feature:t,model:r,children:n,preferredTranscriptId:a}){let{classes:s}=zo(),i=B(r),{launchError:m,submit:p}=Q(o),[l,h]=d(""),[g,c]=d(""),f=H({feature:t,view:i,preferredTranscriptId:a}),{proteinSequence:T,selectedTranscript:S,error:L}=f,x=se(l,T),k=Ce(T),A=`${Ge}?PAGE_TYPE=BlastSearch&PAGE=Proteins&PROGRAM=blastp&QUERY=${k}`,C=`${Ge}?PAGE_TYPE=BlastSearch&PAGE=Proteins&PROGRAM=blastp&QUERY=${Je(k,10)}`;return e.createElement(e.Fragment,null,e.createElement($,{error:m??L},n,e.createElement(G,{feature:t,...f}),e.createElement("div",{className:s.step},e.createElement(M,{variant:"subtitle2"},"1. Run the search at NCBI"),e.createElement("div",{className:s.stepBody},T?e.createElement("div",{className:s.ncbiLink},e.createElement(Ct,{href:A},C)):e.createElement(oe,{severity:"info"},"Pick a transcript above to get a link carrying its protein sequence."))),e.createElement("div",{className:s.step},e.createElement(M,{variant:"subtitle2"},"2. Align the hits"),e.createElement("div",{className:s.stepBody},e.createElement(M,null,`On the results page click "Multiple Alignment" to run COBALT, NCBI's aligner. Download the alignment (.aln) and, if you want the tree drawn, the Newick tree (.nh).`))),e.createElement("div",{className:s.step},e.createElement(M,{variant:"subtitle2"},"3. Paste the results back here"),e.createElement("div",{className:s.stepBody},e.createElement(b,{variant:"outlined",label:"Alignment",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,className:s.msaInput,slotProps:{input:{className:s.textAreaFont}},placeholder:"Paste the .aln contents here",value:l,onChange:v=>{h(v.target.value)}}),e.createElement(b,{variant:"outlined",label:"Tree (optional)",multiline:!0,minRows:3,maxRows:10,fullWidth:!0,slotProps:{input:{className:s.textAreaFont}},placeholder:"Paste the .nh Newick tree here",value:g,onChange:v=>{c(v.target.value)}}),e.createElement(ie,{...x})))),e.createElement(V,{model:r,submitDisabled:!S||!l.trim(),onSubmit:v=>{S&&p(()=>q({view:i,feature:S,placement:v,displayName:_(S),querySeqName:x.querySeqName,querySeqOffset:x.querySeqOffset,data:{msa:l,tree:g}}))},onCancel:o}))}),Yt=Ko;var Yo=u(function({lookupMethod:t,setLookupMethod:r}){return e.createElement(ve,{component:"fieldset"},e.createElement(we,{row:!0,value:t,onChange:n=>{r(n.target.value)}},e.createElement(U,{value:"automatic",control:e.createElement(ne,null),label:"Automatic"}),e.createElement(U,{value:"manual",control:e.createElement(ne,null),label:"Manual"})))}),Xt=Yo;var Xo=y()({field:{minWidth:300},help:{marginBottom:8}}),Zo=u(function({handleClose:t,ebiEmail:r}){let{classes:n}=Xo(),[a,s]=d(r);return e.createElement(at,{open:!0,maxWidth:"lg",onClose:()=>{t()}},e.createElement(st,null,"EBI settings"),e.createElement(ye,null,e.createElement(M,{variant:"subtitle2",className:n.help},"Every search this tab runs is submitted to EBI with this address, which is how they reach whoever is generating the load. If your site sends real volume, use your own."),e.createElement(b,{autoFocus:!0,margin:"dense",label:"EBI contact email",fullWidth:!0,variant:"outlined",value:a,className:n.field,onChange:i=>{s(i.target.value)}}),e.createElement(O,{variant:"contained",onClick:()=>{s(me)}},"Reset")),e.createElement(be,null,e.createElement(O,{variant:"contained",color:"secondary",onClick:()=>{t()}},"Cancel"),e.createElement(O,{color:"primary",variant:"contained",onClick:()=>{t({ebiEmail:a})}},"Save")))}),Zt=Zo;var Ro=y()({settingsButton:{float:"right"}}),er={automatic:Wt,manual:Yt},tr=u(function({handleClose:t,model:r,feature:n,preferredTranscriptId:a}){let[s,i]=d("automatic"),[m,p]=K(dt,me),[l,h]=d(!1),{classes:g}=Ro(),c=er[s];return e.createElement(e.Fragment,null,e.createElement(Te,{title:`EBI settings \u2014 jobs are submitted with ${m.trim()||me}`},e.createElement(re,{className:g.settingsButton,"aria-label":"EBI settings",size:"small",onClick:()=>{h(!0)}},e.createElement(It,null))),e.createElement(c,{model:r,feature:n,handleClose:t,preferredTranscriptId:a},e.createElement(Xt,{lookupMethod:s,setLookupMethod:i})),l?e.createElement(Zt,{ebiEmail:m,handleClose:f=>{f&&p(f.ebiEmail),h(!1)}}):null)}),Rt=tr;var or=Ke(()=>import("./HelpDialog-3IR65NL3.js")),rr=u(function(){let[t,r]=d(!1);return e.createElement(e.Fragment,null,e.createElement(Te,{title:"What each tab does"},e.createElement(re,{"aria-label":"Help",onClick:()=>{r(!0)}},e.createElement(kt,null))),t?e.createElement(Ue,{fallback:null},e.createElement(or,{handleClose:()=>{r(!1)}})):null)}),eo=rr;function nr(o){let t=Ee(o,500),{data:r,error:n,isLoading:a}=E(t?[JSON.stringify(t),"msa-file-text"]:null,()=>Ze(t).readFile("utf8"));return{text:r??"",error:n,isLoading:a||t!==o}}var ar=y()({inputContainer:{marginBottom:30},fileContainer:{maxWidth:500},msaInput:{marginBottom:20}}),sr=u(function({model:t,feature:r,handleClose:n,preferredTranscriptId:a}){let s=B(t),{classes:i}=ar(),{launchError:m,submit:p}=Q(n),[l,h]=d("file"),[g,c]=d(""),[f,T]=d(""),[S,L]=d(),[x,k]=d(),A=H({feature:r,view:s,preferredTranscriptId:a}),{selectedTranscript:C,proteinSequence:v,error:P,sequenceStatus:W}=A,N=nr(l==="file"?S:void 0),w=se(l==="file"?N.text:g,v),R=m??P??N.error;return e.createElement(e.Fragment,null,e.createElement($,{error:R},e.createElement(ve,{component:"fieldset"},e.createElement(we,{row:!0,value:l,onChange:J=>{h(J.target.value)}},e.createElement(U,{value:"file",control:e.createElement(ne,null),label:"Open files"}),e.createElement(U,{value:"text",control:e.createElement(ne,null),label:"Paste text"}))),e.createElement("div",{className:i.inputContainer},l==="file"?e.createElement("div",{className:i.fileContainer},e.createElement($e,{name:"MSA File .aln (Clustal), .fa/.mfa (aligned FASTA), .stock (Stockholm), etc)",inline:!0,location:S,setLocation:L}),e.createElement($e,{name:"Tree file .nh (Newick) or .asn (NCBI COBALT ASN.1)",inline:!0,location:x,setLocation:k})):e.createElement(e.Fragment,null,e.createElement(b,{variant:"outlined",name:"MSA",multiline:!0,minRows:5,className:i.msaInput,maxRows:10,fullWidth:!0,placeholder:"Paste MSA here",value:g,onChange:J=>{c(J.target.value)}}),e.createElement(b,{variant:"outlined",name:"Tree",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,placeholder:"Paste newick tree (optional)",value:f,onChange:J=>{T(J.target.value)}}))),e.createElement(G,{feature:r,...A}),e.createElement(ie,{...w})),e.createElement(V,{model:t,hint:e.createElement(z,{status:W}),submitDisabled:!C||l==="file"&&(!S||N.isLoading)||l==="text"&&!g.trim(),onSubmit:J=>{C&&p(()=>q({view:s,feature:C,placement:J,displayName:_(C),querySeqName:w.querySeqName,querySeqOffset:w.querySeqOffset,...l==="file"?{msaFilehandle:S,treeFilehandle:x}:{data:{msa:g,tree:f}}}))},onCancel:n}))}),to=sr;var ir="msaview-ortholog-source",oo={ncbi:"NCBI orthologs",panther:"PANTHER",uniref:"UniRef cluster"},ro=Object.keys(oo);function lr(o){return ro.find(t=>t===o)??"ncbi"}function no(){let[o,t]=K(ir,"ncbi");return[lr(o),r=>{t(r)}]}var mr={ncbi:"vertebrates and insects",panther:"also yeast, worm, fly and plants",uniref:"all of UniProtKB within 50% identity"},cr=u(function({value:t,onChange:r,className:n}){return e.createElement(b,{variant:"outlined",label:"Source",className:n,select:!0,value:t,helperText:mr[t],onChange:a=>{r(a.target.value)}},ro.map(a=>e.createElement(F,{value:a,key:a},oo[a])))}),ao=cr;async function so(o,t){let r=o.trim();if(!r)return;if(/^\d+$/.test(r))return Number(r);let a=(await Be(Ie("esearch",{db:"taxonomy",term:r,retmax:"1",retmode:"json"}),{signal:t})).esearchresult?.idlist?.[0];return a?Number(a):void 0}async function io(o,t){let r=o.trim();if(!r)return;let a=(await Be(Ie("esearch",{db:"assembly",term:r,retmax:"1",retmode:"json"}),{signal:t})).esearchresult?.idlist?.[0];if(!a)return;let i=(await Be(Ie("esummary",{db:"assembly",id:a,retmode:"json"}),{signal:t})).result?.[a],m=Number(i?.speciestaxid);return i?.speciesname&&m?{taxId:m,speciesName:i.speciesname}:void 0}async function ur(o,t){let r=await so(o,t);if(!r)throw new Error(`No NCBI taxon matches "${o}"`);let n=[],a=(await Pt([r],t,i=>{n.push(i)})).get(r);if(!a&&n.length>0)throw new Error(`NCBI did not answer for the name of taxon ${r}`,{cause:n[0]});let s=[a?.sciname,a?.commonName&&`(${a.commonName})`].filter(Boolean).join(" ");return{taxId:r,label:s||`taxon ${r}`}}var dr=u(function({value:t,assemblyName:r,onChange:n,className:a}){let[s,i]=d(),m=Ee(s,400),{data:p}=E(r&&s===void 0?[r,"assembly-species"]:null,f=>io(r,f),{onSuccess:f=>{f&&n(f.taxId)}}),{data:l,error:h}=E(m?.trim()?[m.trim(),"taxon"]:null,f=>ur(m,f),{onSuccess:({taxId:f})=>{n(f)}}),g=s??p?.speciesName??"human",c=s===void 0?p?.speciesName:l?.label;return e.createElement(b,{variant:"outlined",label:"Query species",className:a,value:g,onChange:f=>{i(f.target.value)},error:!!h,helperText:h?`${h}`:c??`the species this gene is from (taxon ${t})`})}),lo=dr;var pr=y()({selectField:{width:180}}),fr={ncbi:o=>`the ${o} closest species NCBI has`,panther:o=>`the ${o} closest species PANTHER has`,uniref:o=>`${o} rows, one per species, reviewed entries first`},hr=u(function({handleClose:o,feature:t,model:r,preferredTranscriptId:n}){let{classes:a}=pr(),s=B(r),{launchError:i,submit:m}=Q(o),[p,l]=d(9606),[h,g]=no(),[c,f]=Oe(),[T,S]=d(String(Ft)),L=I(()=>Le(t),[t]),x=H({feature:t,view:s,preferredTranscriptId:n}),{selectedTranscript:k,proteinSequence:A,sequenceStatus:C}=x,v=x.error??i,P=Number(T),W=Number.isInteger(P)&&P>=2;return e.createElement(e.Fragment,null,e.createElement($,{error:v},e.createElement(M,{variant:"body2"},"Precomputed orthologs, one gene per species, looked up rather than searched for. No BLAST job to queue, and with the in-browser aligner no job at all."),e.createElement("div",null,e.createElement(ao,{className:a.selectField,value:h,onChange:g}),e.createElement(lo,{className:a.selectField,value:p,assemblyName:s.assemblyNames[0],onChange:l}),e.createElement(De,{className:a.selectField,value:c,onChange:f}),e.createElement(b,{variant:"outlined",label:"Rows to align",className:a.selectField,type:"number",value:T,onChange:N=>{S(N.target.value)},error:!W,helperText:W?fr[h](P):"a whole number, 2 or more"})),e.createElement(G,{feature:t,...x})),e.createElement(V,{model:r,hint:e.createElement(z,{status:C}),submitDisabled:!A||!W,onSubmit:N=>{k&&m(()=>q({view:s,feature:k,placement:N,displayName:`Orthologs - ${_(t)} - ${X(k)}`,...ae,orthologParams:{taxId:p,source:h,maxSpecies:P,geneCandidates:L,msaAlgorithm:c,selectedTranscript:k.toJSON(),proteinSequence:A}}))},onCancel:o}))}),mo=hr;var Z=JBrowseExports["@jbrowse/core/data_adapters/dataAdapterCache"],gr=o=>Z!=null&&o in Object(Z)?Z[o]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+o+"' from '@jbrowse/core/data_adapters/dataAdapterCache' to plugins: MsaView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:o});var co=gr("getAdapter");var hi=Z&&Z.__esModule?Z.default:Z;async function uo(o,t){return(await co(o,"msa",t)).dataAdapter}async function po({config:o,pluginManager:t,assemblyName:r}){return(await uo(t,o)).getMSAList(r)}async function fo({config:o,pluginManager:t,msaId:r,assemblyName:n}){return(await uo(t,o)).getMSA(r,n)}function je(o){return o.msa?He(o.msa,"datasets"):void 0}var Sr=y()({selectedContainer:{marginTop:50}}),br=u(function({model:o,feature:t,handleClose:r,preferredTranscriptId:n}){let a=j(o),s=B(o),{classes:i}=Sr(),{pluginManager:m}=We(o),{assemblyNames:p}=s,l=p[0],{launchError:h,submit:g}=Q(r),c=je(a.jbrowse),[f,T]=d(c?.[0]?.datasetId),S=c?.find(D=>D.datasetId===f),{data:L,isLoading:x,error:k}=E(S?`${S.datasetId}-${l}-msa-list`:null,()=>po({config:S.adapter,pluginManager:m,assemblyName:l})),A=I(()=>L&&new Set(L),[L]),C=H({feature:t,view:s,hasData:A?D=>!!Ve(D,t,A):void 0,preferredTranscriptId:n}),{selectedTranscript:v,proteinSequence:P,sequenceStatus:W}=C,N=v&&A?Ve(v,t,A):void 0,{data:w,isLoading:R,error:J}=E(N&&S?`${S.datasetId}-${l}-${N}-msa`:null,()=>fo({msaId:N,assemblyName:l,config:S.adapter,pluginManager:m})),ee=w?.msa??"",_e=se(ee,P,w?.queryRowName),de=Kt(_e,`${N??""}_${l??""}`),go=k??J??C.error??h;return e.createElement(e.Fragment,null,e.createElement($,{error:go},e.createElement(b,{select:!0,label:"Select MSA dataset",value:f,onChange:D=>{T(D.target.value)}},c?.map(D=>e.createElement(F,{key:D.datasetId,value:D.datasetId},D.name))),S?e.createElement("div",{className:i.selectedContainer},!x&&R?e.createElement(te,{variant:"h6",message:`Loading MSA for ${X(v)||N}`}):null,x?e.createElement(te,{variant:"h6",message:`Loading available MSAs for (${S.name})`}):null,L?e.createElement("div",null,e.createElement(et,{html:S.description}),e.createElement(G,{feature:t,...C}),ee?e.createElement(ie,{..._e,querySeqName:de}):null):null):null),e.createElement(V,{model:o,hint:R?e.createElement(te,{message:"Loading alignment"}):ee&&!de?e.createElement(M,{color:"textSecondary",variant:"body2"},"no row matches this transcript"):e.createElement(z,{status:W}),submitDisabled:!v||!ee||!de,onSubmit:D=>{v&&ee&&g(()=>q({view:s,feature:v,placement:D,displayName:_(v),drawNodeBubbles:!1,labelsAlignRight:!0,showBranchLen:!1,colWidth:10,rowHeight:12,residueColor:{scale:{scheme:"percent_identity_dynamic"}},querySeqName:de,querySeqOffset:_e.querySeqOffset,data:{msa:ee,tree:w?.tree}}))},onCancel:r}))}),ho=br;var yr=u(function({children:t,value:r,index:n}){let a=r===n,[s,i]=d(a);return a&&!s&&i(!0),e.createElement("div",{role:"tabpanel",hidden:!a},s||a?t:null)}),ue=yr;var vr=u(function({handleClose:t,feature:r,model:n,preferredTranscriptId:a}){let s=j(n),m=!!je(s.jbrowse)?.length,[p,l]=d("orthologs");return e.createElement(Re,{maxWidth:"xl",title:"Launch MSA view",open:!0,onClose:t},e.createElement(qt,null,e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement(ut,{value:p,onChange:(h,g)=>{l(g)}},e.createElement(le,{label:"Orthologs",value:"orthologs"}),e.createElement(le,{label:"BLAST query",value:"ncbi_blast"}),m?e.createElement(le,{label:"Pre-loaded MSA datasets",value:"preloaded_msa"}):null,e.createElement(le,{label:"Manual upload",value:"manual_msa"})),e.createElement(eo,null)),e.createElement(ue,{value:p,index:"orthologs"},e.createElement(mo,{handleClose:t,feature:r,model:n,preferredTranscriptId:a})),e.createElement(ue,{value:p,index:"ncbi_blast"},e.createElement(Rt,{handleClose:t,feature:r,model:n,preferredTranscriptId:a})),m?e.createElement(ue,{value:p,index:"preloaded_msa"},e.createElement(ho,{model:n,feature:r,handleClose:t,preferredTranscriptId:a})):null,e.createElement(ue,{value:p,index:"manual_msa"},e.createElement(to,{model:n,feature:r,handleClose:t,preferredTranscriptId:a}))))}),rl=vr;export{rl as default};
|
|
3
|
-
//# sourceMappingURL=LaunchMsaViewDialog-
|
|
1
|
+
import{a as Ct}from"./chunk-ZWQTJTRR.js";import{F as Pt,a as B,c as ft,d as Y,e as Me,f as Ve,g as X,h as _,i as ht,j as Ae,k as Ce,l as Le,m as yt,n as vt,s as At,t as Qe,u as Ie,x as Be,z as Ft}from"./chunk-SIKAYSRK.js";import{g as K,h as dt,i as me,k as Ge,l as Ne,m as wt,n as ke,o as xt,p as Tt,r as Fe,s as Pe,t as Mt}from"./chunk-KHRURQPK.js";import{a as pt,b as kt}from"./chunk-CREQPIFJ.js";import{d as Lt,e as Nt}from"./chunk-JJ3VMN7J.js";import{a as gt,b as ce,c as St,d as bt}from"./chunk-DECSTFAT.js";import{a as y}from"./chunk-3KTCIF2L.js";import{a as pe,b as fe}from"./chunk-7ZEXFLSY.js";import{a as Ze}from"./chunk-YN7VVNZR.js";import{c as He}from"./chunk-QBRNXRNU.js";import"./chunk-7763LQXU.js";import{e as We,f as j,n as Je}from"./chunk-AISU7SRE.js";import{a as u}from"./chunk-PFO3G4CM.js";import{a as Re,b as Se,c as $e,d as te,e as et}from"./chunk-YX7QETL5.js";import{B as F,D as ne,E as we,G as le,M as ut,N as xe,R as Te,S as M,a as tt,b as ot,c as rt,d as oe,g as O,h as nt,l as at,m as be,n as ye,o as st,q as ve,r as U,t as re,v as it,w as lt,x as mt,z as ct}from"./chunk-EXFKF6XR.js";import{b as Ue,c as ze,g as Ke,h as Ye,i as Xe,j as he,n as I,o as ge,p as d,r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var It=pe(fe("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var So=u(function({children:t,...r}){return e.createElement("div",null,e.createElement(xe,{...r},t))}),b=So;var bo=y()({dialogContent:{width:"80em"}}),yo=u(function({error:t,children:r}){let{classes:n}=bo();return e.createElement(ye,{className:n.dialogContent},t?e.createElement(Se,{error:t}):null,r)}),$=yo;var vo=u(function({status:t}){return t==="loading"?e.createElement(te,{message:"Translating transcript"}):t==="missing"?e.createElement(M,{color:"textSecondary",variant:"body2"},"no coding sequence to align"):null}),z=vo;var Bt=ze(void 0),qt=u(function({children:t}){let r=d(()=>ce()==="splitRight");return e.createElement(Bt.Provider,{value:r},t)});function qe(){let o=Xe(Bt),t=d(()=>ce()==="splitRight");return o??t}var wo=u(function({checked:t,onChange:r}){return e.createElement(U,{label:"Open beside the genome view",control:e.createElement(nt,{checked:t,onChange:n=>{r(n.target.checked)}})})}),xo=u(function({onSubmit:t,onCancel:r,submitDisabled:n,hint:a,submitLabel:s="Submit",model:i}){let[m,p]=qe(),l=!!i&>(j(i));return e.createElement(be,{sx:{flexWrap:"wrap",rowGap:1}},l?e.createElement(wo,{checked:m,onChange:p}):null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginLeft:"auto"}},a,e.createElement(O,{sx:{flexShrink:0},color:"primary",variant:"contained",disabled:n,onClick:()=>{if(l){let h=m?"splitRight":"stack";St(h),t(h)}else t(ce())}},s),e.createElement(O,{sx:{flexShrink:0},color:"secondary",variant:"contained",onClick:()=>{r()}},"Cancel")))}),V=xo;var To=y()({textAreaFont:{fontFamily:"Courier New"}}),Mo=u(function({value:t}){let{classes:r}=To();return e.createElement(b,{variant:"outlined",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,value:t,slotProps:{input:{readOnly:!0,classes:{input:r.textAreaFont}}}})}),Et=Mo;var Ao=y()({flex:{display:"flex"},minWidth:{minWidth:300},centered:{alignContent:"center",marginLeft:20}}),Co=u(function({feature:t,options:r,selectedId:n,selectedTranscript:a,setSelectedId:s,proteinSequence:i,sequenceStatus:m="ready",hasData:p}){let{classes:l}=Ao(),[h,g]=d(!1);return e.createElement(e.Fragment,null,e.createElement("div",{className:l.flex},e.createElement(xe,{variant:"outlined",label:`Choose isoform of ${_(t)}`,helperText:"the query row, so the alignment stays linked to the genome view",select:!0,className:l.minWidth,value:n,onChange:c=>{s(c.target.value)}},r.map(c=>{let f=p?p(c):!0,{len:T,mod:S}=ft(c);return e.createElement(F,{value:Y(c),key:c.id(),disabled:!f},X(c)," (",T," aa)"," ",S?" (possible fragment)":"",p?f?" (has data)":" (no data)":"")})),e.createElement("div",{className:l.centered},e.createElement(O,{variant:"contained",color:"primary",onClick:()=>{g(!h)}},h?"Hide sequence":"Show sequence"))),h?e.createElement(Et,{value:i?`>${X(a)}
|
|
2
|
+
${i}`:m==="missing"?"This transcript has no coding sequence, so there is nothing to translate.":m==="error"?"The sequence could not be fetched.":"Loading..."}):null)}),G=Co;var ae={drawNodeBubbles:!0,colWidth:10,rowHeight:12};function q({view:o,feature:t,placement:r,...n}){return bt(j(o),{placement:r,connectedViewId:o.id,connectedFeature:t?.toJSON(),...n})}function Q(o){let[t,r]=d(),n=ge(!1);return{launchError:t,submit:a=>{n.current||(n.current=!0,r(void 0),a().then(o,s=>{n.current=!1,console.error(s),r(s)}))}}}var Dt=o=>o==null||o===!1;function Lo(o){return Dt(o)||Array.isArray(o)&&o.some(Dt)?null:JSON.stringify(o)}function E(o,t,{onSuccess:r}={}){let n=Lo(o),[a,s]=d(0),[i,m]=d(),p=n===null?null:`${a}\0${n}`,l=i?.attempt===p,h=i?.question===n,g=ge({fetcher:t,onSuccess:r});return he(()=>{g.current={fetcher:t,onSuccess:r}}),he(()=>{if(p===null||n===null)return;let c=new AbortController;return g.current.fetcher(c.signal).then(f=>{c.signal.aborted||(m({attempt:p,question:n,data:f}),g.current.onSuccess?.(f))}).catch(f=>{c.signal.aborted||m({attempt:p,question:n,error:f})}),()=>{c.abort()}},[p,n]),{data:h?i.data:void 0,error:l?i.error:void 0,isLoading:p!==null&&!l,mutate:Ye(()=>{s(c=>c+1)},[])}}function Ee(o,t){let[r,n]=d(o);return he(()=>{let a=setTimeout(()=>{n(o)},t);return()=>{clearTimeout(a)}},[o,t]),r}function Ot({view:o,feature:t}){let r=o?.assemblyNames?.[0],{data:n,error:a,isLoading:s}=E(t&&r?[t.id(),r,"feature-sequence"]:null,async m=>{let{start:p,end:l,refName:h}=t.toJSON();return vt({start:p,end:l,refName:h,assemblyName:r,session:j(o),signal:m})});return{proteinSequence:I(()=>n&&t?yt({transcript:t,...n})?.protein??"":"",[n,t]),sequence:n,error:a,isLoading:s}}function No(o,t,r){if(!r)return o;let n=t.find(s=>Y(s)===o);if(n&&r(n))return o;let a=t.find(r);return a?Y(a):o}function ko({error:o,isLoading:t,proteinSequence:r}){return o?"error":t?"loading":r?"ready":"missing"}function H({feature:o,view:t,hasData:r,preferredTranscriptId:n}){let a=I(()=>Ae(o),[o]),[s,i]=d(()=>Y(a.find(c=>Me(c,n??""))??a[0])),m=No(s,a,r),p=a.find(c=>Y(c)===m),{proteinSequence:l,error:h,isLoading:g}=Ot({view:t,feature:p});return{options:a,selectedId:m,setSelectedId:i,selectedTranscript:p,proteinSequence:l,error:h,isLoading:g,sequenceStatus:ko({error:h,isLoading:g,proteinSequence:l}),hasData:r}}var jt=pe(fe("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");var Fo=y()({header:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},resultList:{maxHeight:300,overflow:"auto"}});function _t(o){let t=[o.geneName,o.transcriptName!==o.geneName?o.transcriptName:void 0].filter(r=>!!r);return t.length>0?t.join(" - "):o.geneId??o.transcriptId??"Unknown"}function Po(o){return[o.blastDatabase,o.searchProgram??o.blastProgram??"blastp",o.msaAlgorithm].filter(Boolean).join(" / ")}var Io=u(function({model:o,handleClose:t,feature:r,cached:{results:n,handleDelete:a,handleClearAll:s}}){let{classes:i}=Fo(),m=B(o),[p,l]=d(),[h]=qe(),g=c=>{let{transcriptId:f,msa:T,tree:S,treeMetadata:L}=c;q({view:m,feature:f?Ae(r).find(x=>Me(x,f)):void 0,placement:h?"splitRight":"stack",displayName:`BLAST - ${_t(c)}`,...ae,data:{msa:T,tree:S,treeMetadata:L}}).then(t,x=>{console.error(x),l(x)})};return e.createElement("div",null,p?e.createElement(Se,{error:p}):null,e.createElement("div",{className:i.header},e.createElement(M,{variant:"subtitle1"},"Cached BLAST Results (",n.length,")"),e.createElement(O,{size:"small",color:"error",onClick:async()=>{try{l(void 0),await s()}catch(c){l(c)}}},"Clear results for this gene")),e.createElement(it,{dense:!0,className:i.resultList},n.map(c=>e.createElement(lt,{key:c.id,disablePadding:!0,secondaryAction:e.createElement(re,{edge:"end",size:"small",onClick:async f=>{f.stopPropagation();try{l(void 0),await a(c.id)}catch(T){l(T)}}},e.createElement(jt,{fontSize:"small"}))},e.createElement(mt,{onClick:()=>{g(c)}},e.createElement(ct,{primary:`${_t(c)} - ${Po(c)}`,secondary:`${new Date(c.timestamp).toLocaleString()} - Seq: ${c.proteinSequence.slice(0,30)}...`}))))))}),$t=Io;var Bo=u(function({value:t,onChange:r,className:n}){return e.createElement(b,{variant:"outlined",label:"MSA Algorithm",className:n,select:!0,value:t,helperText:t==="browser"?"no EBI job; rows aligned to the query":void 0,onChange:a=>{r(a.target.value)}},Ne.map(a=>e.createElement(F,{value:a,key:a},wt[a])))}),De=Bo;var qo="msaView-blastSearch",Eo="msaView-msaAlgorithm",Vt=Fe("blastp"),Gt="clustalo";function Do(o){let{program:t,database:r}=o??{},n=ke.find(a=>a===t);return n&&Pe(n).some(a=>a===r)?{program:n,database:r}:Vt}function Oo(o){return Ne.find(t=>t===o)??Gt}function Qt(){let[o,t]=K(qo,Vt);return[Do(o),r=>{t(r)}]}function Oe(){let[o,t]=K(Eo,Gt);return[Oo(o),r=>{t(r)}]}function Ht(o){let{data:t,error:r,isLoading:n,mutate:a}=E(`cached-blast-${o.join(",")}`,async()=>(await At()).filter(i=>i.geneId&&o.includes(i.geneId)));return{results:t??[],error:r,isLoading:n,handleDelete:async s=>{await Qe(s),a()},handleClearAll:async()=>{await Promise.all((t??[]).map(s=>Qe(s.id))),a()}}}var jo=y()({selectField:{width:150},databaseField:{width:260},cachedResultsAccordion:{marginTop:20},infoText:{marginTop:20}}),_o=u(function({handleClose:o,feature:t,model:r,children:n,preferredTranscriptId:a}){let{classes:s}=jo(),i=B(r),{launchError:m,submit:p}=Q(o),[l,h]=Qt(),[g,c]=Oe(),[f,T]=d(String(Tt)),S=Number(f),L=Number.isInteger(S)&&S>=1,x=l.program==="phmmer",k=I(()=>Le(t),[t]),A=Ht(k),C=H({feature:t,view:i,preferredTranscriptId:a}),{selectedTranscript:v,proteinSequence:P,sequenceStatus:W}=C,N=C.error??m??A.error;return e.createElement(e.Fragment,null,e.createElement($,{error:N},n,e.createElement(b,{variant:"outlined",label:"Search program",className:s.selectField,select:!0,value:l.program,onChange:w=>{h(Fe(w.target.value))}},ke.map(w=>e.createElement(F,{value:w,key:w},xt[w]))),e.createElement(b,{variant:"outlined",label:"Database",className:s.databaseField,select:!0,value:l.database,onChange:w=>{h({program:l.program,database:w.target.value})}},Pe(l.program).map(w=>e.createElement(F,{value:w,key:w},Mt(w)))),x?null:e.createElement(De,{className:s.selectField,value:g,onChange:c}),e.createElement(b,{variant:"outlined",label:"Hits",className:s.selectField,type:"number",value:f,onChange:w=>{T(w.target.value)},error:!L,helperText:"best-scoring sequences to keep"}),e.createElement(G,{feature:t,...C}),e.createElement(M,{variant:"body2",className:s.infoText},x?"phmmer aligns the hits as it finds them, so nothing is realigned afterwards.":"The hits come back from EBI and are then run through the chosen aligner."," ","The EBI queue is the wait, and it runs from seconds to many minutes."),A.results.length>0?e.createElement(tt,{className:s.cachedResultsAccordion},e.createElement(rt,{expandIcon:e.createElement(pt,null)},e.createElement(M,null,"Previous BLAST Results")),e.createElement(ot,null,e.createElement($t,{model:r,handleClose:o,feature:t,cached:A}))):null),e.createElement(V,{model:r,hint:e.createElement(z,{status:W}),submitDisabled:!P||!L,onSubmit:w=>{if(v){let R=l.program==="phmmer"?{searchProgram:"phmmer",blastDatabase:l.database,maxHits:S,selectedTranscript:v.toJSON(),proteinSequence:P}:{searchProgram:"blastp",blastDatabase:l.database,msaAlgorithm:g,maxHits:S,selectedTranscript:v.toJSON(),proteinSequence:P};p(()=>q({view:i,feature:v,placement:w,displayName:ht(t,v),...ae,blastParams:R}))}},onCancel:o}))}),Wt=_o;function Ut(o){return Ce(o).toUpperCase()}function $o(o,t){let r=Math.min(o.length,t.length);if(r===0)return 0;let n=0;for(let a=0;a<r;a++)o[a]===t[a]&&n++;return n/r}var Vo=.9,Go=.5;function zt(o,t,r){if(!o.trim())return{names:[]};let n;try{n=Lt(o)}catch{return{names:[]}}let a=n.getNames(),s=Ut(t);return{names:a,match:s?Ho(n,a,s,r):void 0}}function Qo(o,t,r){let n=Ut(Nt(o.getRow(t)));if(n){if(n===r)return{name:t,quality:"exact",identity:1,offset:0};{let a=r.indexOf(n),s=n.indexOf(r);if(a!==-1||s!==-1){let i=Math.min(n.length,r.length)/Math.max(n.length,r.length);return i>=Go?{name:t,quality:"partial",identity:i,offset:a===-1?-s:a}:void 0}else{let i=$o(n,r);return i>=Vo?{name:t,quality:"similar",identity:i,offset:0}:void 0}}}else return}var Jt=["exact","partial","similar"];function Ho(o,t,r,n){return t.map(a=>Qo(o,a,r)).filter(a=>a!==void 0).sort((a,s)=>Jt.indexOf(a.quality)-Jt.indexOf(s.quality)||s.identity-a.identity||+(s.name===n)-+(a.name===n))[0]}function Kt(o,t){return o.querySeqName||(o.names.includes(t)?t:"")}function se(o,t,r){let[n,a]=d(),{names:s,match:i}=I(()=>zt(o,t,r),[o,t,r]),m=n!==void 0&&(s.length===0||s.includes(n))?n:void 0,p=m??i?.name??"";return{detected:i,names:s,querySeqName:p,querySeqOffset:p===i?.name?i.offset:0,setQuerySeqName:a,isAutoDetected:m===void 0&&!!i}}var Wo=y()({field:{marginTop:20},alert:{marginTop:10}});function Jo({identity:o,offset:t}){let r=`, covering ${Math.round(o*100)}% of it`;return t>0?`${r} from residue ${t+1}`:t<0?`${r} and running ${-t} residues past its start`:r}var Uo=u(function({names:t,detected:r,querySeqName:n,setQuerySeqName:a,isAutoDetected:s}){let{classes:i}=Wo();return e.createElement(e.Fragment,null,t.length>0?e.createElement(b,{variant:"outlined",label:"MSA row matching the selected transcript",select:!0,fullWidth:!0,className:i.field,value:t.includes(n)?n:"",onChange:m=>{a(m.target.value)}},t.map(m=>e.createElement(F,{value:m,key:m},m,r?.name===m?" \u2014 matches your protein":""))):e.createElement(b,{variant:"outlined",label:"MSA row matching the selected transcript",fullWidth:!0,className:i.field,helperText:"Paste an alignment above and this fills in on its own",value:n,onChange:m=>{a(m.target.value)}}),s&&r?r.quality==="similar"?e.createElement(oe,{severity:"warning",className:i.alert},e.createElement("strong",null,r.name)," is"," ",Math.round(r.identity*100),"% identical to your protein but is not the same sequence. Clicking the alignment navigates the genome view, approximately: wherever the two differ by an insertion or a deletion, every residue after it lands one codon off."):e.createElement(oe,{severity:"success",className:i.alert},"Matched ",e.createElement("strong",null,r.name)," to your protein sequence",r.quality==="exact"?"":Jo(r),". Clicking the alignment will navigate the genome view."):t.length>0&&!n?e.createElement(oe,{severity:"warning",className:i.alert},"No row matched your protein sequence \u2014 pick the one for your gene above. Without it the alignment still renders, but clicking it will not navigate the genome view."):null)}),ie=Uo;var zo=y()({ncbiLink:{wordBreak:"break-all"},textAreaFont:{fontFamily:"Courier New"},msaInput:{marginBottom:20},step:{marginTop:20},stepBody:{marginLeft:20,marginTop:8}}),Ko=u(function({handleClose:o,feature:t,model:r,children:n,preferredTranscriptId:a}){let{classes:s}=zo(),i=B(r),{launchError:m,submit:p}=Q(o),[l,h]=d(""),[g,c]=d(""),f=H({feature:t,view:i,preferredTranscriptId:a}),{proteinSequence:T,selectedTranscript:S,error:L}=f,x=se(l,T),k=Ce(T),A=`${Ge}?PAGE_TYPE=BlastSearch&PAGE=Proteins&PROGRAM=blastp&QUERY=${k}`,C=`${Ge}?PAGE_TYPE=BlastSearch&PAGE=Proteins&PROGRAM=blastp&QUERY=${Je(k,10)}`;return e.createElement(e.Fragment,null,e.createElement($,{error:m??L},n,e.createElement(G,{feature:t,...f}),e.createElement("div",{className:s.step},e.createElement(M,{variant:"subtitle2"},"1. Run the search at NCBI"),e.createElement("div",{className:s.stepBody},T?e.createElement("div",{className:s.ncbiLink},e.createElement(Ct,{href:A},C)):e.createElement(oe,{severity:"info"},"Pick a transcript above to get a link carrying its protein sequence."))),e.createElement("div",{className:s.step},e.createElement(M,{variant:"subtitle2"},"2. Align the hits"),e.createElement("div",{className:s.stepBody},e.createElement(M,null,`On the results page click "Multiple Alignment" to run COBALT, NCBI's aligner. Download the alignment (.aln) and, if you want the tree drawn, the Newick tree (.nh).`))),e.createElement("div",{className:s.step},e.createElement(M,{variant:"subtitle2"},"3. Paste the results back here"),e.createElement("div",{className:s.stepBody},e.createElement(b,{variant:"outlined",label:"Alignment",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,className:s.msaInput,slotProps:{input:{className:s.textAreaFont}},placeholder:"Paste the .aln contents here",value:l,onChange:v=>{h(v.target.value)}}),e.createElement(b,{variant:"outlined",label:"Tree (optional)",multiline:!0,minRows:3,maxRows:10,fullWidth:!0,slotProps:{input:{className:s.textAreaFont}},placeholder:"Paste the .nh Newick tree here",value:g,onChange:v=>{c(v.target.value)}}),e.createElement(ie,{...x})))),e.createElement(V,{model:r,submitDisabled:!S||!l.trim(),onSubmit:v=>{S&&p(()=>q({view:i,feature:S,placement:v,displayName:_(S),querySeqName:x.querySeqName,querySeqOffset:x.querySeqOffset,data:{msa:l,tree:g}}))},onCancel:o}))}),Yt=Ko;var Yo=u(function({lookupMethod:t,setLookupMethod:r}){return e.createElement(ve,{component:"fieldset"},e.createElement(we,{row:!0,value:t,onChange:n=>{r(n.target.value)}},e.createElement(U,{value:"automatic",control:e.createElement(ne,null),label:"Automatic"}),e.createElement(U,{value:"manual",control:e.createElement(ne,null),label:"Manual"})))}),Xt=Yo;var Xo=y()({field:{minWidth:300},help:{marginBottom:8}}),Zo=u(function({handleClose:t,ebiEmail:r}){let{classes:n}=Xo(),[a,s]=d(r);return e.createElement(at,{open:!0,maxWidth:"lg",onClose:()=>{t()}},e.createElement(st,null,"EBI settings"),e.createElement(ye,null,e.createElement(M,{variant:"subtitle2",className:n.help},"Every search this tab runs is submitted to EBI with this address, which is how they reach whoever is generating the load. If your site sends real volume, use your own."),e.createElement(b,{autoFocus:!0,margin:"dense",label:"EBI contact email",fullWidth:!0,variant:"outlined",value:a,className:n.field,onChange:i=>{s(i.target.value)}}),e.createElement(O,{variant:"contained",onClick:()=>{s(me)}},"Reset")),e.createElement(be,null,e.createElement(O,{variant:"contained",color:"secondary",onClick:()=>{t()}},"Cancel"),e.createElement(O,{color:"primary",variant:"contained",onClick:()=>{t({ebiEmail:a})}},"Save")))}),Zt=Zo;var Ro=y()({settingsButton:{float:"right"}}),er={automatic:Wt,manual:Yt},tr=u(function({handleClose:t,model:r,feature:n,preferredTranscriptId:a}){let[s,i]=d("automatic"),[m,p]=K(dt,me),[l,h]=d(!1),{classes:g}=Ro(),c=er[s];return e.createElement(e.Fragment,null,e.createElement(Te,{title:`EBI settings \u2014 jobs are submitted with ${m.trim()||me}`},e.createElement(re,{className:g.settingsButton,"aria-label":"EBI settings",size:"small",onClick:()=>{h(!0)}},e.createElement(It,null))),e.createElement(c,{model:r,feature:n,handleClose:t,preferredTranscriptId:a},e.createElement(Xt,{lookupMethod:s,setLookupMethod:i})),l?e.createElement(Zt,{ebiEmail:m,handleClose:f=>{f&&p(f.ebiEmail),h(!1)}}):null)}),Rt=tr;var or=Ke(()=>import("./HelpDialog-NSGZYIN7.js")),rr=u(function(){let[t,r]=d(!1);return e.createElement(e.Fragment,null,e.createElement(Te,{title:"What each tab does"},e.createElement(re,{"aria-label":"Help",onClick:()=>{r(!0)}},e.createElement(kt,null))),t?e.createElement(Ue,{fallback:null},e.createElement(or,{handleClose:()=>{r(!1)}})):null)}),eo=rr;function nr(o){let t=Ee(o,500),{data:r,error:n,isLoading:a}=E(t?[JSON.stringify(t),"msa-file-text"]:null,()=>Ze(t).readFile("utf8"));return{text:r??"",error:n,isLoading:a||t!==o}}var ar=y()({inputContainer:{marginBottom:30},fileContainer:{maxWidth:500},msaInput:{marginBottom:20}}),sr=u(function({model:t,feature:r,handleClose:n,preferredTranscriptId:a}){let s=B(t),{classes:i}=ar(),{launchError:m,submit:p}=Q(n),[l,h]=d("file"),[g,c]=d(""),[f,T]=d(""),[S,L]=d(),[x,k]=d(),A=H({feature:r,view:s,preferredTranscriptId:a}),{selectedTranscript:C,proteinSequence:v,error:P,sequenceStatus:W}=A,N=nr(l==="file"?S:void 0),w=se(l==="file"?N.text:g,v),R=m??P??N.error;return e.createElement(e.Fragment,null,e.createElement($,{error:R},e.createElement(ve,{component:"fieldset"},e.createElement(we,{row:!0,value:l,onChange:J=>{h(J.target.value)}},e.createElement(U,{value:"file",control:e.createElement(ne,null),label:"Open files"}),e.createElement(U,{value:"text",control:e.createElement(ne,null),label:"Paste text"}))),e.createElement("div",{className:i.inputContainer},l==="file"?e.createElement("div",{className:i.fileContainer},e.createElement($e,{name:"MSA File .aln (Clustal), .fa/.mfa (aligned FASTA), .stock (Stockholm), etc)",inline:!0,location:S,setLocation:L}),e.createElement($e,{name:"Tree file .nh (Newick) or .asn (NCBI COBALT ASN.1)",inline:!0,location:x,setLocation:k})):e.createElement(e.Fragment,null,e.createElement(b,{variant:"outlined",name:"MSA",multiline:!0,minRows:5,className:i.msaInput,maxRows:10,fullWidth:!0,placeholder:"Paste MSA here",value:g,onChange:J=>{c(J.target.value)}}),e.createElement(b,{variant:"outlined",name:"Tree",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,placeholder:"Paste newick tree (optional)",value:f,onChange:J=>{T(J.target.value)}}))),e.createElement(G,{feature:r,...A}),e.createElement(ie,{...w})),e.createElement(V,{model:t,hint:e.createElement(z,{status:W}),submitDisabled:!C||l==="file"&&(!S||N.isLoading)||l==="text"&&!g.trim(),onSubmit:J=>{C&&p(()=>q({view:s,feature:C,placement:J,displayName:_(C),querySeqName:w.querySeqName,querySeqOffset:w.querySeqOffset,...l==="file"?{msaFilehandle:S,treeFilehandle:x}:{data:{msa:g,tree:f}}}))},onCancel:n}))}),to=sr;var ir="msaview-ortholog-source",oo={ncbi:"NCBI orthologs",panther:"PANTHER",uniref:"UniRef cluster"},ro=Object.keys(oo);function lr(o){return ro.find(t=>t===o)??"ncbi"}function no(){let[o,t]=K(ir,"ncbi");return[lr(o),r=>{t(r)}]}var mr={ncbi:"vertebrates and insects",panther:"also yeast, worm, fly and plants",uniref:"all of UniProtKB within 50% identity"},cr=u(function({value:t,onChange:r,className:n}){return e.createElement(b,{variant:"outlined",label:"Source",className:n,select:!0,value:t,helperText:mr[t],onChange:a=>{r(a.target.value)}},ro.map(a=>e.createElement(F,{value:a,key:a},oo[a])))}),ao=cr;async function so(o,t){let r=o.trim();if(!r)return;if(/^\d+$/.test(r))return Number(r);let a=(await Be(Ie("esearch",{db:"taxonomy",term:r,retmax:"1",retmode:"json"}),{signal:t})).esearchresult?.idlist?.[0];return a?Number(a):void 0}async function io(o,t){let r=o.trim();if(!r)return;let a=(await Be(Ie("esearch",{db:"assembly",term:r,retmax:"1",retmode:"json"}),{signal:t})).esearchresult?.idlist?.[0];if(!a)return;let i=(await Be(Ie("esummary",{db:"assembly",id:a,retmode:"json"}),{signal:t})).result?.[a],m=Number(i?.speciestaxid);return i?.speciesname&&m?{taxId:m,speciesName:i.speciesname}:void 0}async function ur(o,t){let r=await so(o,t);if(!r)throw new Error(`No NCBI taxon matches "${o}"`);let n=[],a=(await Pt([r],t,i=>{n.push(i)})).get(r);if(!a&&n.length>0)throw new Error(`NCBI did not answer for the name of taxon ${r}`,{cause:n[0]});let s=[a?.sciname,a?.commonName&&`(${a.commonName})`].filter(Boolean).join(" ");return{taxId:r,label:s||`taxon ${r}`}}var dr=u(function({value:t,assemblyName:r,onChange:n,className:a}){let[s,i]=d(),m=Ee(s,400),{data:p}=E(r&&s===void 0?[r,"assembly-species"]:null,f=>io(r,f),{onSuccess:f=>{f&&n(f.taxId)}}),{data:l,error:h}=E(m?.trim()?[m.trim(),"taxon"]:null,f=>ur(m,f),{onSuccess:({taxId:f})=>{n(f)}}),g=s??p?.speciesName??"human",c=s===void 0?p?.speciesName:l?.label;return e.createElement(b,{variant:"outlined",label:"Query species",className:a,value:g,onChange:f=>{i(f.target.value)},error:!!h,helperText:h?`${h}`:c??`the species this gene is from (taxon ${t})`})}),lo=dr;var pr=y()({selectField:{width:180}}),fr={ncbi:o=>`the ${o} closest species NCBI has`,panther:o=>`the ${o} closest species PANTHER has`,uniref:o=>`${o} rows, one per species, reviewed entries first`},hr=u(function({handleClose:o,feature:t,model:r,preferredTranscriptId:n}){let{classes:a}=pr(),s=B(r),{launchError:i,submit:m}=Q(o),[p,l]=d(9606),[h,g]=no(),[c,f]=Oe(),[T,S]=d(String(Ft)),L=I(()=>Le(t),[t]),x=H({feature:t,view:s,preferredTranscriptId:n}),{selectedTranscript:k,proteinSequence:A,sequenceStatus:C}=x,v=x.error??i,P=Number(T),W=Number.isInteger(P)&&P>=2;return e.createElement(e.Fragment,null,e.createElement($,{error:v},e.createElement(M,{variant:"body2"},"Precomputed orthologs, one gene per species, looked up rather than searched for. No BLAST job to queue, and with the in-browser aligner no job at all."),e.createElement("div",null,e.createElement(ao,{className:a.selectField,value:h,onChange:g}),e.createElement(lo,{className:a.selectField,value:p,assemblyName:s.assemblyNames[0],onChange:l}),e.createElement(De,{className:a.selectField,value:c,onChange:f}),e.createElement(b,{variant:"outlined",label:"Rows to align",className:a.selectField,type:"number",value:T,onChange:N=>{S(N.target.value)},error:!W,helperText:W?fr[h](P):"a whole number, 2 or more"})),e.createElement(G,{feature:t,...x})),e.createElement(V,{model:r,hint:e.createElement(z,{status:C}),submitDisabled:!A||!W,onSubmit:N=>{k&&m(()=>q({view:s,feature:k,placement:N,displayName:`Orthologs - ${_(t)} - ${X(k)}`,...ae,orthologParams:{taxId:p,source:h,maxSpecies:P,geneCandidates:L,msaAlgorithm:c,selectedTranscript:k.toJSON(),proteinSequence:A}}))},onCancel:o}))}),mo=hr;var Z=JBrowseExports["@jbrowse/core/data_adapters/dataAdapterCache"],gr=o=>Z!=null&&o in Object(Z)?Z[o]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+o+"' from '@jbrowse/core/data_adapters/dataAdapterCache' to plugins: MsaView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:o});var co=gr("getAdapter");var hi=Z&&Z.__esModule?Z.default:Z;async function uo(o,t){return(await co(o,"msa",t)).dataAdapter}async function po({config:o,pluginManager:t,assemblyName:r}){return(await uo(t,o)).getMSAList(r)}async function fo({config:o,pluginManager:t,msaId:r,assemblyName:n}){return(await uo(t,o)).getMSA(r,n)}function je(o){return o.msa?He(o.msa,"datasets"):void 0}var Sr=y()({selectedContainer:{marginTop:50}}),br=u(function({model:o,feature:t,handleClose:r,preferredTranscriptId:n}){let a=j(o),s=B(o),{classes:i}=Sr(),{pluginManager:m}=We(o),{assemblyNames:p}=s,l=p[0],{launchError:h,submit:g}=Q(r),c=je(a.jbrowse),[f,T]=d(c?.[0]?.datasetId),S=c?.find(D=>D.datasetId===f),{data:L,isLoading:x,error:k}=E(S?`${S.datasetId}-${l}-msa-list`:null,()=>po({config:S.adapter,pluginManager:m,assemblyName:l})),A=I(()=>L&&new Set(L),[L]),C=H({feature:t,view:s,hasData:A?D=>!!Ve(D,t,A):void 0,preferredTranscriptId:n}),{selectedTranscript:v,proteinSequence:P,sequenceStatus:W}=C,N=v&&A?Ve(v,t,A):void 0,{data:w,isLoading:R,error:J}=E(N&&S?`${S.datasetId}-${l}-${N}-msa`:null,()=>fo({msaId:N,assemblyName:l,config:S.adapter,pluginManager:m})),ee=w?.msa??"",_e=se(ee,P,w?.queryRowName),de=Kt(_e,`${N??""}_${l??""}`),go=k??J??C.error??h;return e.createElement(e.Fragment,null,e.createElement($,{error:go},e.createElement(b,{select:!0,label:"Select MSA dataset",value:f,onChange:D=>{T(D.target.value)}},c?.map(D=>e.createElement(F,{key:D.datasetId,value:D.datasetId},D.name))),S?e.createElement("div",{className:i.selectedContainer},!x&&R?e.createElement(te,{variant:"h6",message:`Loading MSA for ${X(v)||N}`}):null,x?e.createElement(te,{variant:"h6",message:`Loading available MSAs for (${S.name})`}):null,L?e.createElement("div",null,e.createElement(et,{html:S.description}),e.createElement(G,{feature:t,...C}),ee?e.createElement(ie,{..._e,querySeqName:de}):null):null):null),e.createElement(V,{model:o,hint:R?e.createElement(te,{message:"Loading alignment"}):ee&&!de?e.createElement(M,{color:"textSecondary",variant:"body2"},"no row matches this transcript"):e.createElement(z,{status:W}),submitDisabled:!v||!ee||!de,onSubmit:D=>{v&&ee&&g(()=>q({view:s,feature:v,placement:D,displayName:_(v),drawNodeBubbles:!1,labelsAlignRight:!0,showBranchLen:!1,colWidth:10,rowHeight:12,residueColor:{scale:{scheme:"percent_identity_dynamic"}},querySeqName:de,querySeqOffset:_e.querySeqOffset,data:{msa:ee,tree:w?.tree}}))},onCancel:r}))}),ho=br;var yr=u(function({children:t,value:r,index:n}){let a=r===n,[s,i]=d(a);return a&&!s&&i(!0),e.createElement("div",{role:"tabpanel",hidden:!a},s||a?t:null)}),ue=yr;var vr=u(function({handleClose:t,feature:r,model:n,preferredTranscriptId:a}){let s=j(n),m=!!je(s.jbrowse)?.length,[p,l]=d("orthologs");return e.createElement(Re,{maxWidth:"xl",title:"Launch MSA view",open:!0,onClose:t},e.createElement(qt,null,e.createElement("div",{style:{display:"flex",alignItems:"center"}},e.createElement(ut,{value:p,onChange:(h,g)=>{l(g)}},e.createElement(le,{label:"Orthologs",value:"orthologs"}),e.createElement(le,{label:"BLAST query",value:"ncbi_blast"}),m?e.createElement(le,{label:"Pre-loaded MSA datasets",value:"preloaded_msa"}):null,e.createElement(le,{label:"Manual upload",value:"manual_msa"})),e.createElement(eo,null)),e.createElement(ue,{value:p,index:"orthologs"},e.createElement(mo,{handleClose:t,feature:r,model:n,preferredTranscriptId:a})),e.createElement(ue,{value:p,index:"ncbi_blast"},e.createElement(Rt,{handleClose:t,feature:r,model:n,preferredTranscriptId:a})),m?e.createElement(ue,{value:p,index:"preloaded_msa"},e.createElement(ho,{model:n,feature:r,handleClose:t,preferredTranscriptId:a})):null,e.createElement(ue,{value:p,index:"manual_msa"},e.createElement(to,{model:n,feature:r,handleClose:t,preferredTranscriptId:a}))))}),rl=vr;export{rl as default};
|
|
3
|
+
//# sourceMappingURL=LaunchMsaViewDialog-LRS3PIOC.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,b as h,c as l,d as g}from"./chunk-ZJGFEUGM.js";import"./chunk-XNNIIXGD.js";import"./chunk-DW5INM5K.js";import"./chunk-JJ3VMN7J.js";import"./chunk-7763LQXU.js";import"./chunk-BD6Y2ERQ.js";import"./chunk-3MNW5BKS.js";import{a as
|
|
2
|
-
//# sourceMappingURL=MetadataDialog-
|
|
1
|
+
import{a as i,b as h,c as l,d as g}from"./chunk-ZJGFEUGM.js";import"./chunk-XNNIIXGD.js";import"./chunk-DW5INM5K.js";import"./chunk-JJ3VMN7J.js";import"./chunk-7763LQXU.js";import"./chunk-BD6Y2ERQ.js";import"./chunk-3MNW5BKS.js";import{a as R}from"./chunk-PFO3G4CM.js";import{a as b}from"./chunk-YX7QETL5.js";import{S as m,n as d}from"./chunk-EXFKF6XR.js";import{r as t}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var E={General:"Alignment",Accessions:"Row accessions",Dbxref:"Row cross-references"},C={ID:"Identifier",AC:"Accession",DE:"Description",AU:"Authors",SE:"Source of seed",SS:"Source of structure",BM:"Build method",SM:"Search method",GA:"Gathering threshold",TC:"Trusted cutoff",NC:"Noise cutoff",TP:"Family type",CL:"Clan",MB:"Clan members",PI:"Previous identifiers",DR:"Database references",CC:"Comment",WK:"Wikipedia",NE:"Pfam family nested in this one",NL:"Nesting location",NH:"Tree (Newick)",SQ:"Number of sequences",RC:"Reference comment",RN:"Reference number",RM:"PubMed ID",RT:"Reference title",RA:"Reference authors",RL:"Reference journal",CB:"Curation: build",DC:"Database comment",DW:"Database web link",OS:"Organism",OC:"Organism classification",AM:"Alignment method",FT:"Feature",SO:"Sequence Ontology term"},y={RT:"Title",RA:"Authors",RL:"Journal",RM:"PubMed",RC:"Comment"},A=new Set(["NH"]);var S=["RM","RT","RA","RL","RC"];function O(e){return/^\d+$/.test(e)?t.createElement("a",{href:`https://pubmed.ncbi.nlm.nih.gov/${e}/`,target:"_blank",rel:"noreferrer"},e):e}function D(e){return Array.isArray(e)&&e.every(o=>typeof o=="string")}function N(e){let o=e.RN;if(!D(o)||o.length===0)return e;let s=S.filter(n=>e[n]!=null),c=s.flatMap(n=>{let a=e[n];return D(a)&&a.length===o.length?[{tag:n,values:a}]:[]});if(c.length!==s.length)return e;let f=Object.fromEntries(Object.entries(e).filter(([n])=>n!=="RN"&&!S.includes(n))),r=Object.fromEntries(o.map((n,a)=>[n,Object.fromEntries(c.map(({tag:u,values:T})=>{let p=T[a];return[y[u],u==="RM"?O(p):p]}))]));return{...f,References:r}}function M(e){return i(e)?N(e):{}}var L=R(function({model:e,onClose:o}){let s=Object.entries(e.header).filter(([,r])=>r!=null&&!h(r)),c=Object.fromEntries(s.filter(([,r])=>!i(r))),f=s.filter(r=>i(r[1]));return t.createElement(b,{onClose:()=>{o()},open:!0,title:"Metadata",maxWidth:"xl"},t.createElement(d,null,s.length===0?t.createElement(m,null,"This alignment has no metadata."):t.createElement(t.Fragment,null,Object.keys(c).length>0?t.createElement(l,{record:c}):null,f.map(([r,n])=>t.createElement("div",{key:r},t.createElement(m,{variant:"h6"},E[r]??r),r==="General"?t.createElement(l,{record:M(n),labels:C,monospaceKeys:A}):t.createElement(l,{record:n})))),t.createElement(m,{variant:"h6"},"Sequences"),t.createElement(g,{str:e.rows})))}),H=L;export{H as default};
|
|
2
|
+
//# sourceMappingURL=MetadataDialog-UODKJFPM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as L,b as w,d as B,e as M}from"./chunk-PWNKL3ZK.js";import{d as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=MsaViewPanel-
|
|
1
|
+
import{a as L,b as w,d as B,e as M}from"./chunk-PWNKL3ZK.js";import{d as y}from"./chunk-3JFOLUP5.js";import"./chunk-X5QA4AF6.js";import"./chunk-LFBMB523.js";import"./chunk-XNNIIXGD.js";import"./chunk-FLY25MTG.js";import{a as v}from"./chunk-ZWQTJTRR.js";import"./chunk-KHRURQPK.js";import"./chunk-CREQPIFJ.js";import"./chunk-JJ3VMN7J.js";import{a as t}from"./chunk-3KTCIF2L.js";import"./chunk-7ZEXFLSY.js";import"./chunk-YN7VVNZR.js";import"./chunk-V47MJ4IY.js";import"./chunk-LNMEYTCN.js";import"./chunk-7763LQXU.js";import"./chunk-AISU7SRE.js";import"./chunk-3MNW5BKS.js";import{a as n}from"./chunk-PFO3G4CM.js";import{b as c,d as l}from"./chunk-YX7QETL5.js";import{S as e,g as m}from"./chunk-EXFKF6XR.js";import{r as o}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var k=n(function({jobId:r}){let s=M(r)?B(r):w(r);return o.createElement(e,null,"Job ",r," (",o.createElement(v,{href:s},"see status"),")")}),g=k;var J=t()({margin:{padding:20},progressRow:{display:"flex",alignItems:"center",gap:12}}),S=n(function({model:r}){let{progress:s,rid:i,error:a}=r,{classes:p}=J(),b=!r.launchCompleted,{blastParams:d,orthologParams:f}=r,h=d?`Running EBI ${d.searchProgram==="phmmer"?"phmmer":"BLAST"}`:f?f.source==="uniref"?"Building UniRef homolog alignment":"Building ortholog alignment":"Loading alignment";return o.createElement("div",{className:p.margin},a?o.createElement(o.Fragment,null,o.createElement(e,{variant:"h5"},b?`${h} failed`:"Alignment no longer available"),i?o.createElement(g,{jobId:i}):null,o.createElement(c,{error:a}),o.createElement("div",{className:p.progressRow},o.createElement(m,{variant:"outlined",size:"small",onClick:()=>{r.retryLaunch()}},"Retry"),o.createElement(m,{variant:"outlined",size:"small",onClick:()=>{r.cancelLaunch()}},"Dismiss"))):o.createElement(o.Fragment,null,o.createElement(l,{message:h,variant:"h5"}),i?o.createElement(g,{jobId:i}):null,o.createElement("div",{className:p.progressRow},o.createElement(e,null,s||"Initializing"),o.createElement(m,{variant:"outlined",size:"small",onClick:()=>{r.cancelLaunch()}},"Cancel"))))}),P=S;var C=t()({loadingContainer:{padding:20}}),V=n(function({model:r}){let{classes:s}=C(),{loadingStoredData:i}=r,a=L(r);return o.createElement("div",null,a?o.createElement(P,{model:r}):i&&!r.dataInitialized?o.createElement("div",{className:s.loadingContainer},o.createElement(l,{message:"Loading MSA data",variant:"h6"})):o.createElement(y,{model:r}))}),Z=V;export{Z as default};
|
|
2
|
+
//# sourceMappingURL=MsaViewPanel-AQWZ2N3P.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-BD6Y2ERQ.js";import{a as s}from"./chunk-3MNW5BKS.js";import{a as
|
|
2
|
-
//# sourceMappingURL=TrackInfoDialog-
|
|
1
|
+
import{a as u}from"./chunk-BD6Y2ERQ.js";import{a as s}from"./chunk-3MNW5BKS.js";import{a as r}from"./chunk-PFO3G4CM.js";import{a as n}from"./chunk-YX7QETL5.js";import{S as m,g as l,m as c,n as i}from"./chunk-EXFKF6XR.js";import{r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var f=s()(t=>({textArea:{padding:t.spacing(2),overflow:"auto",background:t.palette.action.selected,wordBreak:"break-word"}})),g=r(function({model:t,onClose:a}){let{name:d,data:o}=t,{classes:p}=f();return e.createElement(n,{open:!0,onClose:a,fullWidth:!0,maxWidth:"lg",title:`Track info - ${d}`},e.createElement(i,null,o===void 0?e.createElement(m,null,"This track has no text data."):e.createElement(e.Fragment,null,e.createElement(u,{text:o}),e.createElement("pre",{className:p.textArea},o))),e.createElement(c,null,e.createElement(l,{variant:"contained",onClick:a,color:"secondary"},"Close")))}),D=g;export{D as default};
|
|
2
|
+
//# sourceMappingURL=TrackInfoDialog-WAZUUZ27.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as a,d as f}from"./chunk-ZJGFEUGM.js";import"./chunk-XNNIIXGD.js";import"./chunk-DW5INM5K.js";import"./chunk-JJ3VMN7J.js";import"./chunk-7763LQXU.js";import"./chunk-BD6Y2ERQ.js";import"./chunk-3MNW5BKS.js";import{a as
|
|
2
|
-
//# sourceMappingURL=TreeNodeInfoDialog-
|
|
1
|
+
import{c as a,d as f}from"./chunk-ZJGFEUGM.js";import"./chunk-XNNIIXGD.js";import"./chunk-DW5INM5K.js";import"./chunk-JJ3VMN7J.js";import"./chunk-7763LQXU.js";import"./chunk-BD6Y2ERQ.js";import"./chunk-3MNW5BKS.js";import{a as m}from"./chunk-PFO3G4CM.js";import{a as c}from"./chunk-YX7QETL5.js";import{S as t,n as i}from"./chunk-EXFKF6XR.js";import{r as e}from"./chunk-TEYYBCMF.js";import"./chunk-KVMUXFPB.js";var d=m(function({info:u,model:n,nodeName:r,onClose:E}){let{rows:p}=n,o=n.rowDataOf(r),l=p.find(s=>s[0]===r);return e.createElement(c,{onClose:()=>{E()},open:!0,title:"Tree node info",maxWidth:"xl"},e.createElement(i,null,e.createElement(t,{variant:"h6"},"Attributes"),e.createElement(a,{record:{nodeName:r,...u}}),e.createElement(t,{variant:"h6"},"Sequence"),l?e.createElement(f,{str:[l]}):e.createElement(t,null,"Sequence not found"),o?e.createElement(e.Fragment,null,e.createElement(t,{variant:"h6"},"Extra metadata"),e.createElement(a,{record:o})):null))}),b=d;export{b as default};
|
|
2
|
+
//# sourceMappingURL=TreeNodeInfoDialog-QHA7LOXE.js.map
|