jbrowse-plugin-msaview 5.2.0 → 5.4.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.
Files changed (86) hide show
  1. package/dist/MsaViewPanel/model.d.ts +9 -11
  2. package/dist/MsaViewPanel/model.js +7 -0
  3. package/dist/MsaViewPanel/model.test.js +3 -0
  4. package/dist/chunks/AboutDialog-HCCCEJ6V.js +2 -0
  5. package/dist/chunks/{AboutDialog-IRBPUPJK.js.map → AboutDialog-HCCCEJ6V.js.map} +4 -4
  6. package/dist/chunks/AnnotationFileDialog-CPJ4X7XW.js +2 -0
  7. package/dist/chunks/AnnotationFileDialog-CPJ4X7XW.js.map +7 -0
  8. package/dist/chunks/ExportSVGDialog-YUFLYBYW.js +2 -0
  9. package/dist/chunks/ExportSVGDialog-YUFLYBYW.js.map +7 -0
  10. package/dist/chunks/{FeatureDialog-ZBX3XQZ5.js → FeatureDialog-NBDB5SWU.js} +1 -1
  11. package/dist/chunks/{FeatureDialog-ZBX3XQZ5.js.map → FeatureDialog-NBDB5SWU.js.map} +1 -1
  12. package/dist/chunks/HelpDialog-UCUYPCOI.js +2 -0
  13. package/dist/chunks/HelpDialog-UCUYPCOI.js.map +7 -0
  14. package/dist/chunks/{LaunchMsaViewDialog-GJAUPGFC.js → LaunchMsaViewDialog-HGL6P4E4.js} +2 -2
  15. package/dist/chunks/{LaunchMsaViewDialog-GJAUPGFC.js.map → LaunchMsaViewDialog-HGL6P4E4.js.map} +1 -1
  16. package/dist/chunks/{MetadataDialog-KZWQFRF7.js → MetadataDialog-DSA3545E.js} +2 -2
  17. package/dist/chunks/{MetadataDialog-KZWQFRF7.js.map → MetadataDialog-DSA3545E.js.map} +1 -1
  18. package/dist/chunks/MsaViewPanel-XSXFJWWY.js +2 -0
  19. package/dist/chunks/{MsaViewPanel-RUZAKFCB.js.map → MsaViewPanel-XSXFJWWY.js.map} +1 -1
  20. package/dist/chunks/{TrackInfoDialog-IFIG77WO.js → TrackInfoDialog-YXCIGFYM.js} +2 -2
  21. package/dist/chunks/{TrackInfoDialog-IFIG77WO.js.map → TrackInfoDialog-YXCIGFYM.js.map} +1 -1
  22. package/dist/chunks/{TreeNodeInfoDialog-VRCVIF26.js → TreeNodeInfoDialog-QCWDJTM4.js} +2 -2
  23. package/dist/chunks/{TreeNodeInfoDialog-VRCVIF26.js.map → TreeNodeInfoDialog-QCWDJTM4.js.map} +1 -1
  24. package/dist/chunks/{chunk-NI3VGKQP.js → chunk-2XCUSA22.js} +2 -2
  25. package/dist/chunks/{chunk-GIHMPOCO.js → chunk-35FWLG3N.js} +1 -1
  26. package/dist/chunks/{chunk-GIHMPOCO.js.map → chunk-35FWLG3N.js.map} +1 -1
  27. package/dist/chunks/{chunk-F3EC6OCO.js → chunk-5OSSOQH4.js} +1 -1
  28. package/dist/chunks/{chunk-F3EC6OCO.js.map → chunk-5OSSOQH4.js.map} +1 -1
  29. package/dist/chunks/{chunk-GDFVLZYX.js → chunk-666BV764.js} +2 -2
  30. package/dist/chunks/{chunk-GDFVLZYX.js.map → chunk-666BV764.js.map} +1 -1
  31. package/dist/chunks/{chunk-YUKJI2AH.js → chunk-AQ2THRTR.js} +2 -2
  32. package/dist/chunks/{chunk-YUKJI2AH.js.map → chunk-AQ2THRTR.js.map} +1 -1
  33. package/dist/chunks/chunk-ASUKJX5J.js +2 -0
  34. package/dist/chunks/chunk-ASUKJX5J.js.map +7 -0
  35. package/dist/chunks/chunk-FFHB7WP7.js +18 -0
  36. package/dist/chunks/chunk-FFHB7WP7.js.map +7 -0
  37. package/dist/chunks/{chunk-YOTSFJMU.js → chunk-GAY2PLS6.js} +1 -1
  38. package/dist/chunks/{chunk-YOTSFJMU.js.map → chunk-GAY2PLS6.js.map} +1 -1
  39. package/dist/chunks/chunk-JDQUBCHM.js +2 -0
  40. package/dist/chunks/chunk-JDQUBCHM.js.map +7 -0
  41. package/dist/chunks/{chunk-IBBQUV2I.js → chunk-KSCGTF4R.js} +1 -1
  42. package/dist/chunks/{chunk-IBBQUV2I.js.map → chunk-KSCGTF4R.js.map} +1 -1
  43. package/dist/chunks/{chunk-6YFCSBEE.js → chunk-NLAW2OYS.js} +2 -2
  44. package/dist/chunks/{chunk-6YFCSBEE.js.map → chunk-NLAW2OYS.js.map} +1 -1
  45. package/dist/chunks/{chunk-ZCT7RD24.js → chunk-QQKPT6EL.js} +2 -2
  46. package/dist/chunks/{chunk-H6IQBAW7.js → chunk-WMDOEOAH.js} +2 -2
  47. package/dist/chunks/{chunk-H6IQBAW7.js.map → chunk-WMDOEOAH.js.map} +1 -1
  48. package/dist/chunks/chunk-XTQQNBQ5.js +2 -0
  49. package/dist/chunks/chunk-XTQQNBQ5.js.map +7 -0
  50. package/dist/chunks/chunk-XXCNVFGP.js +11 -0
  51. package/dist/chunks/chunk-XXCNVFGP.js.map +7 -0
  52. package/dist/chunks/chunk-ZQSWX57C.js +2 -0
  53. package/dist/chunks/chunk-ZQSWX57C.js.map +7 -0
  54. package/dist/chunks/{dist-CMWKVHC7.js → dist-GXYZN4ZR.js} +2 -2
  55. package/dist/chunks/{dist-CMWKVHC7.js.map → dist-GXYZN4ZR.js.map} +3 -3
  56. package/dist/chunks/dist-GZKCGB2N.js +2 -0
  57. package/dist/chunks/{model-VE7IYWNU.js → model-36HCIOZJ.js} +3 -3
  58. package/dist/chunks/model-36HCIOZJ.js.map +7 -0
  59. package/dist/chunks/renderToSvg-5DMIQ72S.js +2 -0
  60. package/dist/jbrowse-plugin-msaview.esm.js +2 -2
  61. package/dist/jbrowse-plugin-msaview.esm.js.map +2 -2
  62. package/dist/version.d.ts +1 -1
  63. package/dist/version.js +1 -1
  64. package/package.json +18 -18
  65. package/src/MsaViewPanel/model.test.ts +4 -0
  66. package/src/MsaViewPanel/model.ts +8 -0
  67. package/src/version.ts +1 -1
  68. package/dist/chunks/AboutDialog-IRBPUPJK.js +0 -2
  69. package/dist/chunks/AnnotationFileDialog-FCYYZ4JN.js +0 -2
  70. package/dist/chunks/AnnotationFileDialog-FCYYZ4JN.js.map +0 -7
  71. package/dist/chunks/ExportSVGDialog-TYYPI6VB.js +0 -2
  72. package/dist/chunks/ExportSVGDialog-TYYPI6VB.js.map +0 -7
  73. package/dist/chunks/MsaViewPanel-RUZAKFCB.js +0 -2
  74. package/dist/chunks/chunk-NMYD2GWF.js +0 -18
  75. package/dist/chunks/chunk-NMYD2GWF.js.map +0 -7
  76. package/dist/chunks/chunk-QQ5LZUIO.js +0 -11
  77. package/dist/chunks/chunk-QQ5LZUIO.js.map +0 -7
  78. package/dist/chunks/chunk-QUWPHTZQ.js +0 -2
  79. package/dist/chunks/chunk-QUWPHTZQ.js.map +0 -7
  80. package/dist/chunks/dist-R73J3CC3.js +0 -2
  81. package/dist/chunks/model-VE7IYWNU.js.map +0 -7
  82. package/dist/chunks/renderToSvg-VDXAB7TT.js +0 -2
  83. /package/dist/chunks/{chunk-NI3VGKQP.js.map → chunk-2XCUSA22.js.map} +0 -0
  84. /package/dist/chunks/{chunk-ZCT7RD24.js.map → chunk-QQKPT6EL.js.map} +0 -0
  85. /package/dist/chunks/{dist-R73J3CC3.js.map → dist-GZKCGB2N.js.map} +0 -0
  86. /package/dist/chunks/{renderToSvg-VDXAB7TT.js.map → renderToSvg-5DMIQ72S.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{Z as a}from"./chunk-ASUKJX5J.js";import"./chunk-ZQSWX57C.js";import"./chunk-73KAPCJ2.js";import"./chunk-BX4Z274Q.js";import"./chunk-J6KYLXRD.js";import"./chunk-FY3BTKY4.js";export{a as renderToSvg};
2
+ //# sourceMappingURL=renderToSvg-5DMIQ72S.js.map
@@ -1,3 +1,3 @@
1
- import{g as p,i as ye}from"./chunks/chunk-JFL3LJPO.js";import{a as Me}from"./chunks/chunk-FCWXYIFC.js";import{d as h}from"./chunks/chunk-DECSTFAT.js";import{a as we}from"./chunks/chunk-NSASZ5FM.js";import{a as u,c as f,d as B}from"./chunks/chunk-IBBQUV2I.js";import{a as q}from"./chunks/chunk-2IWD4OO4.js";import{a as P}from"./chunks/chunk-CVLB4VFP.js";import{a as c}from"./chunks/chunk-J6KYLXRD.js";import{a as z,b as i}from"./chunks/chunk-FY3BTKY4.js";var R=z((Ge,D)=>{D.exports=JBrowseExports["@jbrowse/core/Plugin"]});var le=z((pt,me)=>{me.exports=JBrowseExports["@jbrowse/core/pluggableElementTypes/ViewType"]});var de=i(R()),j=i(q()),ge=i(u()),G=i(Me());var $=i(B(),1),O=(0,f.createSvgIcon)((0,$.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z"}),"GridOn");var Z=i(c()),ee=i(u());function M(e){return e.type==="MsaView"}var g=i(c()),X=i(P());var V=i(c()),J=i(u()),v=i(P());var _=i(we()),w=(0,_.makeStyles)()({highlight:{height:"100%",background:"rgba(255,255,0,0.2)",border:"1px solid rgba(50,50,0,0.2)",position:"absolute",zIndex:99,textAlign:"center",pointerEvents:"none",overflow:"hidden"}});var be=(0,v.observer)(function({model:e}){let{hovered:t,views:r}=(0,J.getSession)(e);return r.some(o=>M(o)&&o.connectedViewId===e.id)&&p(t)?V.default.createElement(xe,{model:e,hovered:t}):null}),xe=(0,v.observer)(function({model:e,hovered:t}){let{classes:r}=w(),{offsetPx:n}=e,{coord:o,refName:s}=t.hoverPosition,a=e.bpToPx({refName:s,coord:o-1}),m=e.bpToPx({refName:s,coord:o});if(a&&m){let l=Math.max(Math.abs(m.offsetPx-a.offsetPx),4),b=Math.min(a.offsetPx,m.offsetPx)-n;return V.default.createElement("div",{className:r.highlight,style:{left:b,width:l}})}return null}),W=be;var d=i(c()),K=i(u()),T=i(P());function U(e,t,r){let n=e.filter(Pe).filter(o=>o.connectedViewId===t).flatMap(o=>[...o.connectedClickHighlights,...r?[]:o.connectedHoverHighlights]);return[...new Map(n.map(o=>[`${o.refName}:${o.start}-${o.end}`,o])).values()]}function Pe(e){return e.type==="MsaView"}var Ve=(0,T.observer)(function({model:t}){let{views:r,hovered:n}=(0,K.getSession)(t),o=U(r,t.id,p(n));return o.length?d.default.createElement(ve,{model:t,highlights:o}):null}),ve=(0,T.observer)(function({model:e,highlights:t}){let{classes:r}=w(),{offsetPx:n}=e;return d.default.createElement(d.default.Fragment,null,t.map(o=>{let s=e.bpToPx({refName:o.refName,coord:o.start}),a=e.bpToPx({refName:o.refName,coord:o.end});if(s&&a){let m=Math.max(Math.abs(a.offsetPx-s.offsetPx),4),l=Math.min(s.offsetPx,a.offsetPx)-n;return d.default.createElement("div",{key:`${o.refName}-${o.start}-${o.end}`,className:r.highlight,style:{left:l,width:m}})}return null}))}),Q=Ve;var Te=(0,X.observer)(function({model:t}){return g.default.createElement(g.default.Fragment,null,g.default.createElement(Q,{model:t}),g.default.createElement(W,{model:t}))}),Y=Te;function S(e){e.contributeToExtensionPoint("LinearGenomeView-TracksContainerComponent",({model:t})=>{let{views:r}=(0,ee.getSession)(t);return r.some(n=>M(n)&&n.connectedViewId===t.id)?Z.default.createElement(Y,{key:"highlight_protein_viewer_msaview",model:t}):void 0})}var oe=i(ye());var te=i(q());function F(e){let t=e.getAdapterType("BgzipFastaAdapter");return(0,te.ConfigurationSchema)("BgzipFastaMsaAdapter",{msaRegex:{type:"string",defaultValue:"_"}},{baseConfiguration:t.configSchema})}function L(e){return e.addAdapterType(()=>new oe.AdapterType({name:"BgzipFastaMsaAdapter",configSchema:F(e),adapterMetadata:{hiddenFromGUI:!0},getAdapterClass:()=>import("./chunks/BgzipFastaMsaAdapter-WWIGI57O.js").then(t=>t.default)}))}var se=i(c()),y=i(u());var re=i(B(),1),ne=(0,f.createSvgIcon)((0,re.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");function Se(e){return e.get("type")?.toLowerCase()==="cds"}function I(e){return Se(e)||!!e.get("subfeatures")?.some(I)}var ie=i(u());function ae(e){let t=e.contextMenuInfo;return t&&(0,ie.isGeneLikeType)(t.item.type)?{fetchFeature:()=>e.fetchFullFeature(t.item.featureId,t.displayedRegionIndex),preferredTranscriptId:t.subfeature?.featureId}:void 0}var Fe=(0,se.lazy)(()=>import("./chunks/LaunchMsaViewDialog-GJAUPGFC.js"));function Le(e){return e.name==="LinearBasicDisplay"}function Ie(e){return e.get("name")??e.get("id")??"This feature"}function Ae(e,t){let r=(0,y.getContainingTrack)(e),n=(0,y.getSession)(r),{preferredTranscriptId:o}=t,s=a=>{n.queueDialog(m=>[Fe,{model:r,handleClose:m,feature:a,preferredTranscriptId:o}])};t.fetchFeature().then(a=>{a?I(a)?s(a):n.notify(`${Ie(a)} has no coding sequence, so there is no protein to align`,"info"):n.notify("Could not load feature for MSA view","warning")}).catch(a=>{n.notifyError(`${a}`,a)})}function Ce(e){return e.views(t=>{let r=t.contextMenuItems;return{contextMenuItems(){let n=ae(t);return[...r.call(t),...n?[{label:"Launch MSA view",icon:ne,onClick:()=>{Ae(t,n)}}]:[]]}}})}function A(e){e.addToExtensionPoint("Core-extendPluggableElement",t=>(Le(t)&&(t.stateModel=Ce(t.stateModel)),t))}function He({msa:e,tree:t,...r}){let n=e?.includes(`
2
- `)?e:void 0,o=t?.trimStart().startsWith("(")?t:void 0,s=n||o?{...r.data,...n?{msa:n}:{},...o?{tree:o}:{}}:r.data;return{...r,data:s,...e&&!n?{msaFileLocation:{uri:e}}:{},...t&&!o?{treeFileLocation:{uri:t}}:{},querySeqName:r.querySeqName??r.query}}function C(e){e.addToExtensionPoint("LaunchView-MsaView",async t=>{let{session:r,query:n,data:o,msaFileLocation:s,msaIndexedLocation:a,msaName:m,treeFileLocation:l,querySeqName:b,searchParams:x,...N}=He(t);if(!o&&!s&&!a&&!N.orthologParams&&!x)throw new Error("No MSA data, file location, orthologParams or searchParams provided when launching MSA view");let E={msaUrl:s?.uri,msaIndexedLocation:a,msaName:m,querySeqName:b},{expandSpec:fe}=await import("./chunks/dist-R73J3CC3.js");return await h(r,{...fe({...N,query:n}),...x?{blastParams:x}:{},data:o,...l?{treeFilehandle:{...l,locationType:"UriLocation"}}:{},...Object.values(E).some(he=>he!==void 0)?{init:E}:{}}),t})}var ue=i(c()),ce=i(le()),je=(0,ue.lazy)(()=>import("./chunks/MsaViewPanel-RUZAKFCB.js"));function H(e){e.addViewType(()=>new ce.default({name:"MsaView",stateModel:()=>import("./chunks/model-VE7IYWNU.js").then(t=>t.default()),ReactComponent:je}))}var pe="5.2.0";var k=class extends de.default{constructor(){super(...arguments);this.name="MsaViewPlugin";this.version=pe;this.rootConfigurationSchema=r=>({msa:(0,j.ConfigurationSchema)("MSA",{datasets:G.types.maybe(G.types.array((0,j.ConfigurationSchema)("MSAEntry",{datasetId:{type:"string",defaultValue:""},description:{type:"string",defaultValue:""},name:{type:"string",defaultValue:""},adapter:r.pluggableConfigSchemaType("adapter")})))})})}install(r){H(r),A(r),C(r),S(r),L(r)}configure(r){try{(0,ge.isAbstractMenuManager)(r.rootModel)&&r.rootModel.appendToSubMenu(["Add"],{label:"Multiple sequence alignment view",icon:O,onClick:n=>{h(n,{}).catch(o=>{console.error(o),n.notifyError(`${o}`,o)})}})}catch(n){console.error("jbrowse-plugin-msaview: could not add the Add menu item",n)}}};export{k as default};
1
+ import{g as p,i as ye}from"./chunks/chunk-JFL3LJPO.js";import{a as Me}from"./chunks/chunk-FCWXYIFC.js";import{d as h}from"./chunks/chunk-DECSTFAT.js";import{a as we}from"./chunks/chunk-NSASZ5FM.js";import{a as u,c as f,d as B}from"./chunks/chunk-KSCGTF4R.js";import{a as q}from"./chunks/chunk-2IWD4OO4.js";import{a as P}from"./chunks/chunk-CVLB4VFP.js";import{a as c}from"./chunks/chunk-J6KYLXRD.js";import{a as z,b as i}from"./chunks/chunk-FY3BTKY4.js";var R=z((Ge,D)=>{D.exports=JBrowseExports["@jbrowse/core/Plugin"]});var le=z((pt,me)=>{me.exports=JBrowseExports["@jbrowse/core/pluggableElementTypes/ViewType"]});var de=i(R()),j=i(q()),ge=i(u()),G=i(Me());var $=i(B(),1),O=(0,f.createSvgIcon)((0,$.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z"}),"GridOn");var Z=i(c()),ee=i(u());function M(e){return e.type==="MsaView"}var g=i(c()),X=i(P());var V=i(c()),J=i(u()),v=i(P());var _=i(we()),w=(0,_.makeStyles)()({highlight:{height:"100%",background:"rgba(255,255,0,0.2)",border:"1px solid rgba(50,50,0,0.2)",position:"absolute",zIndex:99,textAlign:"center",pointerEvents:"none",overflow:"hidden"}});var be=(0,v.observer)(function({model:e}){let{hovered:t,views:r}=(0,J.getSession)(e);return r.some(o=>M(o)&&o.connectedViewId===e.id)&&p(t)?V.default.createElement(xe,{model:e,hovered:t}):null}),xe=(0,v.observer)(function({model:e,hovered:t}){let{classes:r}=w(),{offsetPx:n}=e,{coord:o,refName:s}=t.hoverPosition,a=e.bpToPx({refName:s,coord:o-1}),m=e.bpToPx({refName:s,coord:o});if(a&&m){let l=Math.max(Math.abs(m.offsetPx-a.offsetPx),4),b=Math.min(a.offsetPx,m.offsetPx)-n;return V.default.createElement("div",{className:r.highlight,style:{left:b,width:l}})}return null}),W=be;var d=i(c()),K=i(u()),T=i(P());function U(e,t,r){let n=e.filter(Pe).filter(o=>o.connectedViewId===t).flatMap(o=>[...o.connectedClickHighlights,...r?[]:o.connectedHoverHighlights]);return[...new Map(n.map(o=>[`${o.refName}:${o.start}-${o.end}`,o])).values()]}function Pe(e){return e.type==="MsaView"}var Ve=(0,T.observer)(function({model:t}){let{views:r,hovered:n}=(0,K.getSession)(t),o=U(r,t.id,p(n));return o.length?d.default.createElement(ve,{model:t,highlights:o}):null}),ve=(0,T.observer)(function({model:e,highlights:t}){let{classes:r}=w(),{offsetPx:n}=e;return d.default.createElement(d.default.Fragment,null,t.map(o=>{let s=e.bpToPx({refName:o.refName,coord:o.start}),a=e.bpToPx({refName:o.refName,coord:o.end});if(s&&a){let m=Math.max(Math.abs(a.offsetPx-s.offsetPx),4),l=Math.min(s.offsetPx,a.offsetPx)-n;return d.default.createElement("div",{key:`${o.refName}-${o.start}-${o.end}`,className:r.highlight,style:{left:l,width:m}})}return null}))}),Q=Ve;var Te=(0,X.observer)(function({model:t}){return g.default.createElement(g.default.Fragment,null,g.default.createElement(Q,{model:t}),g.default.createElement(W,{model:t}))}),Y=Te;function S(e){e.contributeToExtensionPoint("LinearGenomeView-TracksContainerComponent",({model:t})=>{let{views:r}=(0,ee.getSession)(t);return r.some(n=>M(n)&&n.connectedViewId===t.id)?Z.default.createElement(Y,{key:"highlight_protein_viewer_msaview",model:t}):void 0})}var oe=i(ye());var te=i(q());function F(e){let t=e.getAdapterType("BgzipFastaAdapter");return(0,te.ConfigurationSchema)("BgzipFastaMsaAdapter",{msaRegex:{type:"string",defaultValue:"_"}},{baseConfiguration:t.configSchema})}function L(e){return e.addAdapterType(()=>new oe.AdapterType({name:"BgzipFastaMsaAdapter",configSchema:F(e),adapterMetadata:{hiddenFromGUI:!0},getAdapterClass:()=>import("./chunks/BgzipFastaMsaAdapter-WWIGI57O.js").then(t=>t.default)}))}var se=i(c()),y=i(u());var re=i(B(),1),ne=(0,f.createSvgIcon)((0,re.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");function Se(e){return e.get("type")?.toLowerCase()==="cds"}function I(e){return Se(e)||!!e.get("subfeatures")?.some(I)}var ie=i(u());function ae(e){let t=e.contextMenuInfo;return t&&(0,ie.isGeneLikeType)(t.item.type)?{fetchFeature:()=>e.fetchFullFeature(t.item.featureId,t.displayedRegionIndex),preferredTranscriptId:t.subfeature?.featureId}:void 0}var Fe=(0,se.lazy)(()=>import("./chunks/LaunchMsaViewDialog-HGL6P4E4.js"));function Le(e){return e.name==="LinearBasicDisplay"}function Ie(e){return e.get("name")??e.get("id")??"This feature"}function Ae(e,t){let r=(0,y.getContainingTrack)(e),n=(0,y.getSession)(r),{preferredTranscriptId:o}=t,s=a=>{n.queueDialog(m=>[Fe,{model:r,handleClose:m,feature:a,preferredTranscriptId:o}])};t.fetchFeature().then(a=>{a?I(a)?s(a):n.notify(`${Ie(a)} has no coding sequence, so there is no protein to align`,"info"):n.notify("Could not load feature for MSA view","warning")}).catch(a=>{n.notifyError(`${a}`,a)})}function Ce(e){return e.views(t=>{let r=t.contextMenuItems;return{contextMenuItems(){let n=ae(t);return[...r.call(t),...n?[{label:"Launch MSA view",icon:ne,onClick:()=>{Ae(t,n)}}]:[]]}}})}function A(e){e.addToExtensionPoint("Core-extendPluggableElement",t=>(Le(t)&&(t.stateModel=Ce(t.stateModel)),t))}function He({msa:e,tree:t,...r}){let n=e?.includes(`
2
+ `)?e:void 0,o=t?.trimStart().startsWith("(")?t:void 0,s=n||o?{...r.data,...n?{msa:n}:{},...o?{tree:o}:{}}:r.data;return{...r,data:s,...e&&!n?{msaFileLocation:{uri:e}}:{},...t&&!o?{treeFileLocation:{uri:t}}:{},querySeqName:r.querySeqName??r.query}}function C(e){e.addToExtensionPoint("LaunchView-MsaView",async t=>{let{session:r,query:n,data:o,msaFileLocation:s,msaIndexedLocation:a,msaName:m,treeFileLocation:l,querySeqName:b,searchParams:x,...N}=He(t);if(!o&&!s&&!a&&!N.orthologParams&&!x)throw new Error("No MSA data, file location, orthologParams or searchParams provided when launching MSA view");let E={msaUrl:s?.uri,msaIndexedLocation:a,msaName:m,querySeqName:b},{expandSpec:fe}=await import("./chunks/dist-GZKCGB2N.js");return await h(r,{...fe({...N,query:n}),...x?{blastParams:x}:{},data:o,...l?{treeFilehandle:{...l,locationType:"UriLocation"}}:{},...Object.values(E).some(he=>he!==void 0)?{init:E}:{}}),t})}var ue=i(c()),ce=i(le()),je=(0,ue.lazy)(()=>import("./chunks/MsaViewPanel-XSXFJWWY.js"));function H(e){e.addViewType(()=>new ce.default({name:"MsaView",stateModel:()=>import("./chunks/model-36HCIOZJ.js").then(t=>t.default()),ReactComponent:je}))}var pe="5.4.0";var k=class extends de.default{constructor(){super(...arguments);this.name="MsaViewPlugin";this.version=pe;this.rootConfigurationSchema=r=>({msa:(0,j.ConfigurationSchema)("MSA",{datasets:G.types.maybe(G.types.array((0,j.ConfigurationSchema)("MSAEntry",{datasetId:{type:"string",defaultValue:""},description:{type:"string",defaultValue:""},name:{type:"string",defaultValue:""},adapter:r.pluggableConfigSchemaType("adapter")})))})})}install(r){H(r),A(r),C(r),S(r),L(r)}configure(r){try{(0,ge.isAbstractMenuManager)(r.rootModel)&&r.rootModel.appendToSubMenu(["Add"],{label:"Multiple sequence alignment view",icon:O,onClick:n=>{h(n,{}).catch(o=>{console.error(o),n.notifyError(`${o}`,o)})}})}catch(n){console.error("jbrowse-plugin-msaview: could not add the Add menu item",n)}}};export{k as default};
3
3
  //# sourceMappingURL=jbrowse-plugin-msaview.esm.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["global-externals:@jbrowse/core/Plugin", "global-externals:@jbrowse/core/pluggableElementTypes/ViewType", "../src/index.ts", "../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/GridOn.mjs", "../src/AddHighlightModel/index.tsx", "../src/MsaViewPanel/isMsaView.ts", "../src/AddHighlightModel/HighlightComponents.tsx", "../src/AddHighlightModel/GenomeMouseoverHighlight.tsx", "../src/AddHighlightModel/util.ts", "../src/AddHighlightModel/MsaToGenomeHighlight.tsx", "../src/AddHighlightModel/connectedHighlights.ts", "../src/BgzipFastaMsaAdapter/index.ts", "../src/BgzipFastaMsaAdapter/configSchema.ts", "../src/LaunchMsaView/index.ts", "../node_modules/.pnpm/@mui+icons-material@9.4.0_@mui+material@9.4.0_@emotion+react@11.14.0_@types+react@19.3._3766ec55733e6b150ee672ad270cc236/node_modules/@mui/icons-material/Add.mjs", "../src/LaunchMsaView/codingFeature.ts", "../src/LaunchMsaView/launchTarget.ts", "../src/LaunchMsaViewExtensionPoint/index.ts", "../src/MsaViewPanel/index.ts", "../src/version.ts"],
4
- "sourcesContent": ["module.exports = JBrowseExports[\"@jbrowse/core/Plugin\"];", "module.exports = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/ViewType\"];", "import Plugin from '@jbrowse/core/Plugin'\nimport { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { isAbstractMenuManager } from '@jbrowse/core/util'\nimport { types } from '@jbrowse/mobx-state-tree'\nimport GridOn from '@mui/icons-material/GridOn'\n\nimport AddHighlightModelF from './AddHighlightModel'\nimport BgzipFastaMsaAdapterF from './BgzipFastaMsaAdapter'\nimport LaunchMsaViewF from './LaunchMsaView'\nimport LaunchMsaViewExtensionPointF from './LaunchMsaViewExtensionPoint'\nimport MsaViewF from './MsaViewPanel'\nimport { launchMsaView } from './utils/launchMsaView'\nimport { version } from './version'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\n\nexport default class MsaViewPlugin extends Plugin {\n name = 'MsaViewPlugin'\n version = version\n\n install(pluginManager: PluginManager) {\n MsaViewF(pluginManager)\n LaunchMsaViewF(pluginManager)\n LaunchMsaViewExtensionPointF(pluginManager)\n AddHighlightModelF(pluginManager)\n BgzipFastaMsaAdapterF(pluginManager)\n }\n\n configure(pluginManager: PluginManager) {\n // a throw here error-pages the whole app, and a menu entry is not worth a\n // session\n try {\n if (isAbstractMenuManager(pluginManager.rootModel)) {\n pluginManager.rootModel.appendToSubMenu(['Add'], {\n label: 'Multiple sequence alignment view',\n icon: GridOn,\n onClick: (session: AbstractSessionModel) => {\n // stacked, by default: nothing was launched from, so there is no\n // connected view for it to sit beside\n launchMsaView(session, {}).catch((e: unknown) => {\n console.error(e)\n session.notifyError(`${e}`, e)\n })\n },\n })\n }\n } catch (e) {\n console.error(\n 'jbrowse-plugin-msaview: could not add the Add menu item',\n e,\n )\n }\n }\n\n rootConfigurationSchema = (pluginManager: PluginManager) => {\n return {\n msa: ConfigurationSchema('MSA', {\n datasets: types.maybe(\n types.array(\n ConfigurationSchema('MSAEntry', {\n datasetId: {\n type: 'string',\n defaultValue: '',\n },\n description: {\n type: 'string',\n defaultValue: '',\n },\n name: {\n type: 'string',\n defaultValue: '',\n },\n adapter: pluginManager.pluggableConfigSchemaType('adapter'),\n }),\n ),\n ),\n }),\n }\n }\n}\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z\"\n}), 'GridOn');", "import React from 'react'\n\nimport { getSession } from '@jbrowse/core/util'\n\nimport { isMsaView } from '../MsaViewPanel/isMsaView'\nimport HighlightComponents from './HighlightComponents'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function AddHighlightComponentsModelF(\n pluginManager: PluginManager,\n) {\n pluginManager.contributeToExtensionPoint(\n 'LinearGenomeView-TracksContainerComponent',\n ({ model }) => {\n const { views } = getSession(model)\n return views.some(v => isMsaView(v) && v.connectedViewId === model.id) ? (\n <HighlightComponents\n key=\"highlight_protein_viewer_msaview\"\n model={model}\n />\n ) : undefined\n },\n )\n}\n", "import type { JBrowsePluginMsaViewModel } from './model'\n\nexport function isMsaView(view: {\n type: string\n}): view is JBrowsePluginMsaViewModel {\n return view.type === 'MsaView'\n}\n", "import React from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport GenomeMouseoverHighlight from './GenomeMouseoverHighlight'\nimport MsaToGenomeHighlight from './MsaToGenomeHighlight'\n\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\ntype LGV = LinearGenomeViewModel\n\nconst HighlightComponents = observer(function HighlightComponents2({\n model,\n}: {\n model: LGV\n}) {\n return (\n <>\n <MsaToGenomeHighlight model={model} />\n <GenomeMouseoverHighlight model={model} />\n </>\n )\n})\n\nexport default HighlightComponents\n", "import React from 'react'\n\nimport { getSession } from '@jbrowse/core/util'\nimport { observer } from 'mobx-react'\n\nimport { isMsaView } from '../MsaViewPanel/isMsaView'\nimport { hasHoverPosition, useStyles } from './util'\n\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\nconst GenomeMouseoverHighlight = observer(function ({\n model,\n}: {\n model: LinearGenomeViewModel\n}) {\n const { hovered, views } = getSession(model)\n const hasMsaView = views.some(\n s => isMsaView(s) && s.connectedViewId === model.id,\n )\n return hasMsaView && hasHoverPosition(hovered) ? (\n <GenomeMouseoverHighlightRenderer model={model} hovered={hovered} />\n ) : null\n})\n\nconst GenomeMouseoverHighlightRenderer = observer(function ({\n model,\n hovered,\n}: {\n model: LinearGenomeViewModel\n hovered: { hoverPosition: { coord: number; refName: string } }\n}) {\n const { classes } = useStyles()\n const { offsetPx } = model\n const { coord, refName } = hovered.hoverPosition\n\n const s = model.bpToPx({ refName, coord: coord - 1 })\n const e = model.bpToPx({ refName, coord })\n\n if (s && e) {\n const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4)\n const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx\n return <div className={classes.highlight} style={{ left, width }} />\n }\n\n return null\n})\n\nexport default GenomeMouseoverHighlight\n", "import { makeStyles } from 'tss-react/mui'\n\nexport { hasHoverPosition } from '../MsaViewPanel/util'\n\nexport const useStyles = makeStyles()({\n highlight: {\n height: '100%',\n background: 'rgba(255,255,0,0.2)',\n border: '1px solid rgba(50,50,0,0.2)',\n position: 'absolute',\n zIndex: 99,\n textAlign: 'center',\n pointerEvents: 'none',\n overflow: 'hidden',\n },\n})\n", "import React from 'react'\n\nimport { getSession } from '@jbrowse/core/util'\nimport { observer } from 'mobx-react'\n\nimport { connectedHighlights } from './connectedHighlights'\nimport { hasHoverPosition, useStyles } from './util'\n\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\ntype LGV = LinearGenomeViewModel\n\nconst MsaToGenomeHighlight = observer(function MsaToGenomeHighlight2({\n model,\n}: {\n model: LGV\n}) {\n const { views, hovered } = getSession(model)\n const highlights = connectedHighlights(\n views,\n model.id,\n hasHoverPosition(hovered),\n )\n\n return highlights.length ? (\n <MsaToGenomeHighlightRenderer model={model} highlights={highlights} />\n ) : null\n})\n\nconst MsaToGenomeHighlightRenderer = observer(function ({\n model,\n highlights,\n}: {\n model: LGV\n highlights: { refName: string; start: number; end: number }[]\n}) {\n const { classes } = useStyles()\n const { offsetPx } = model\n\n return (\n <>\n {highlights.map(r => {\n // bpToPx matches refNames exactly, so canonicalizing \"chr17\" to \"17\"\n // would miss a view whose regions say \"chr17\"\n const s = model.bpToPx({ refName: r.refName, coord: r.start })\n const e = model.bpToPx({ refName: r.refName, coord: r.end })\n if (s && e) {\n const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4)\n const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx\n return (\n <div\n key={`${r.refName}-${r.start}-${r.end}`}\n className={classes.highlight}\n style={{ left, width }}\n />\n )\n }\n return null\n })}\n </>\n )\n})\n\nexport default MsaToGenomeHighlight\n", "interface Region {\n refName: string\n start: number\n end: number\n}\n\ninterface LinkedView {\n type: string\n connectedViewId?: string\n connectedClickHighlights: Region[]\n connectedHoverHighlights: Region[]\n}\n\nexport function connectedHighlights(\n views: readonly { type: string }[],\n genomeViewId: string,\n genomeHovered: boolean,\n) {\n const regions = views\n .filter(isLinkedMsaView)\n .filter(v => v.connectedViewId === genomeViewId)\n .flatMap(v => [\n ...v.connectedClickHighlights,\n ...(genomeHovered ? [] : v.connectedHoverHighlights),\n ])\n return [\n ...new Map(\n regions.map(r => [`${r.refName}:${r.start}-${r.end}`, r]),\n ).values(),\n ]\n}\n\nfunction isLinkedMsaView(view: { type: string }): view is LinkedView {\n return view.type === 'MsaView'\n}\n", "import { AdapterType } from '@jbrowse/core/pluggableElementTypes'\n\nimport configSchemaF from './configSchema'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function BgzipFastaMsaAdapterF(pluginManager: PluginManager) {\n return pluginManager.addAdapterType(() => {\n return new AdapterType({\n name: 'BgzipFastaMsaAdapter',\n configSchema: configSchemaF(pluginManager),\n adapterMetadata: {\n hiddenFromGUI: true,\n },\n getAdapterClass: () =>\n import('./BgzipFastaMsaAdapter').then(t => t.default),\n })\n })\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function configSchemaF(pluginManager: PluginManager) {\n const base = pluginManager.getAdapterType('BgzipFastaAdapter')\n return ConfigurationSchema(\n 'BgzipFastaMsaAdapter',\n {\n msaRegex: {\n type: 'string',\n defaultValue: '_',\n },\n },\n {\n baseConfiguration: base.configSchema,\n },\n )\n}\n", "import { lazy } from 'react'\n\nimport { getContainingTrack, getSession } from '@jbrowse/core/util'\nimport AddIcon from '@mui/icons-material/Add'\n\nimport { isCodingFeature } from './codingFeature'\nimport { launchTarget } from './launchTarget'\n\nimport type { DisplayModel, MenuTarget } from './launchTarget'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { PluggableElementType } from '@jbrowse/core/pluggableElementTypes'\nimport type DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'\nimport type { Feature } from '@jbrowse/core/util'\nimport type { IAnyModelType } from '@jbrowse/mobx-state-tree'\n\nconst LaunchMsaViewDialog = lazy(\n () => import('./components/LaunchMsaViewDialog'),\n)\n\nfunction isDisplay(elt: { name: string }): elt is DisplayType {\n return elt.name === 'LinearBasicDisplay'\n}\n\n// Walking to the track and the session at click time, not while the menu is\n// built: contextMenuItems runs on every right-click and, on a host whose base\n// method reads `this`, is the one place a plugin can take the whole menu down.\n// Keeping it to a pure read of the display is also what lets a test call it.\nfunction featureName(feature: Feature) {\n return feature.get('name') ?? feature.get('id') ?? 'This feature'\n}\n\nfunction openDialog(self: DisplayModel, target: MenuTarget) {\n const track = getContainingTrack(self)\n const session = getSession(track)\n const { preferredTranscriptId } = target\n const open = (feature: Feature) => {\n session.queueDialog(handleClose => [\n LaunchMsaViewDialog,\n { model: track, handleClose, feature, preferredTranscriptId },\n ])\n }\n target\n .fetchFeature()\n .then(feature => {\n if (!feature) {\n session.notify('Could not load feature for MSA view', 'warning')\n } else if (!isCodingFeature(feature)) {\n // the canvas hit test carries a type and nothing else, so this is the\n // first point at which the CDS can be looked for. Saying so beats\n // opening a dialog whose Submit never leaves grey.\n session.notify(\n `${featureName(feature)} has no coding sequence, so there is no protein to align`,\n 'info',\n )\n } else {\n open(feature)\n }\n })\n .catch((e: unknown) => {\n session.notifyError(`${e}`, e)\n })\n}\n\nexport function extendStateModel(stateModel: IAnyModelType) {\n return stateModel.views((self: DisplayModel) => {\n const superContextMenuItems = self.contextMenuItems\n return {\n contextMenuItems() {\n const target = launchTarget(self)\n return [\n // a detached call leaves `this` undefined for a host method that\n // reads it, and the throw takes the host's own rows with it\n ...superContextMenuItems.call(self),\n ...(target\n ? [\n {\n label: 'Launch MSA view',\n icon: AddIcon,\n onClick: () => {\n openDialog(self, target)\n },\n },\n ]\n : []),\n ]\n },\n }\n })\n}\n\nexport default function LaunchMsaViewF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint(\n 'Core-extendPluggableElement',\n (elt: PluggableElementType) => {\n if (isDisplay(elt)) {\n elt.stateModel = extendStateModel(elt.stateModel)\n }\n return elt\n },\n )\n}\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z\"\n}), 'Add');", "import type { Feature } from '@jbrowse/core/util'\n\nfunction isCDS(feature: Feature) {\n return feature.get('type')?.toLowerCase() === 'cds'\n}\n\n// The feature itself counts: a viral polyprotein hangs its cleavage products\n// off its CDS rather than off further CDSs.\nexport function isCodingFeature(feature: Feature): boolean {\n return isCDS(feature) || !!feature.get('subfeatures')?.some(isCodingFeature)\n}\n", "import { isGeneLikeType } from '@jbrowse/core/util'\n\nimport type { MenuItem } from '@jbrowse/core/ui'\nimport type { Feature } from '@jbrowse/core/util'\n\nexport interface ContextMenuInfo {\n item: { featureId: string; type?: string }\n // the isoform under the pointer when the click landed on a gene's child\n subfeature?: { featureId: string }\n displayedRegionIndex: number\n}\n\nexport interface DisplayModel {\n contextMenuItems: () => MenuItem[]\n contextMenuInfo?: ContextMenuInfo\n fetchFullFeature: (\n featureId: string,\n displayedRegionIndex: number,\n ) => Promise<Feature | undefined>\n}\n\n/**\n * What the menu item launches on. The hit test carries a type and an id, so\n * whether the feature codes for anything can only be answered after the fetch,\n * and the caller answers it there.\n */\nexport interface MenuTarget {\n fetchFeature: () => Promise<Feature | undefined>\n /**\n * The isoform the click actually landed on, when the dialog opens on its\n * gene. Climbing to the gene is what puts every isoform in the picker, and it\n * threw away which one the user pointed at: the picker then opened on the\n * longest transcript.\n */\n preferredTranscriptId?: string\n}\n\n// Read off the clicked item rather than off the display: LinearBasicDisplay's\n// `isGeneLike` getter was inlined into its own `contextMenuItems`\n// (jbrowse-components 684142b3), and gating on it silently took the item off\n// every gene track.\nexport function launchTarget(self: DisplayModel): MenuTarget | undefined {\n const info = self.contextMenuInfo\n return info && isGeneLikeType(info.item.type)\n ? {\n fetchFeature: () =>\n self.fetchFullFeature(info.item.featureId, info.displayedRegionIndex),\n preferredTranscriptId: info.subfeature?.featureId,\n }\n : undefined\n}\n", "import { launchMsaView } from '../utils/launchMsaView'\n\nimport type { BlastParams, OrthologParams } from '../MsaViewPanel/model'\nimport type { MsaViewPlacement } from '../utils/workspaces'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\nimport type {\n Clade,\n ColumnTrackShorthand,\n Encoding,\n HighlightShorthand,\n RegionShorthand,\n ResidueMapping,\n RowPanelSpec,\n} from 'react-msaview'\n\ninterface LaunchMsaViewArgs {\n session: AbstractSessionModel\n /**\n * Shorthand, see react-msaview's docs/layers.md: `msa` and `tree` take a\n * url or the text itself, and `query` names the row the spec is about, the\n * `querySeqName` and the `row` of every highlight, region and column track\n * that names none\n */\n msa?: string\n tree?: string\n query?: string\n data?: { msa: string; tree?: string }\n msaFileLocation?: { uri: string }\n msaIndexedLocation?: { uri: string }\n msaName?: string\n treeFileLocation?: { uri: string }\n connectedViewId?: string\n connectedFeature?: Record<string, unknown>\n /**\n * The short form of `connectedFeature`: a transcript id looked up in the\n * connected genome view's open tracks at launch, and translated to become\n * the query row of a `searchParams` or `orthologParams` launch that names\n * no `proteinSequence` of its own.\n */\n connectedTranscript?: string\n displayName?: string\n colorSchemeName?: string\n colWidth?: number\n rowHeight?: number\n treeAreaWidth?: number\n treeWidth?: number\n drawNodeBubbles?: boolean\n labelsAlignRight?: boolean\n showBranchLen?: boolean\n querySeqName?: string\n /**\n * Transcript residues before the query row's first residue, for a row that\n * carries only part of the protein -- what BLAST reports when it trims the\n * query to the aligned region. Genome navigation is off by this much without\n * it.\n */\n querySeqOffset?: number\n highlightColumns?: number[]\n /**\n * Labeled highlights in 1-based inclusive coordinates: `{row, start, end}`\n * for residues of that row, `{start, end}` for alignment columns, `{rows}`\n * for whole rows. Prefer this over `highlightColumns`: a residue range stays\n * put when `allowedGappyness` changes the visible columns.\n */\n highlights?: HighlightShorthand[]\n /** per-column tracks supplied as data, see react-msaview's docs/layers.md */\n columnTracks?: ColumnTrackShorthand[]\n /**\n * Where the view opens, in `highlights` coordinates: `{row, start, end}`\n * zooms onto residues of that row, `{start, end}` onto alignment columns.\n * Applied once the alignment has loaded, then dropped from the session.\n */\n region?: RegionShorthand\n /**\n * Passed through untouched as react-msaview snapshot properties; see its\n * docs/layers.md. A bare `{ uri }` is enough for the two filehandles.\n */\n clades?: Clade[]\n encodings?: Encoding[]\n rowPanels?: RowPanelSpec[]\n relativeTo?: string\n residueMappings?: ResidueMapping[]\n trackHeights?: Record<string, number>\n turnedOffFeatures?: Record<string, boolean>\n gffFilehandle?: { uri: string }\n treeMetadataFilehandle?: { uri: string }\n /**\n * Build the alignment from NCBI orthologs at launch time instead of naming a\n * file: `{ taxId, geneCandidates }` is enough, and `taxa` and\n * `proteinSequence` both default (see OrthologParams). This is the launch\n * dialog's Orthologs tab, reachable from a session spec \u2014 so a link can say\n * \"NLRP1 across species\" and the view builds it.\n */\n orthologParams?: OrthologParams\n /**\n * Search for the alignment at launch: the dialog's BLAST tab reached\n * declaratively. `{ searchProgram: 'phmmer', blastDatabase: 'rp15',\n * accession: 'P04637' }` is a whole request. The query comes from\n * `proteinSequence`, else fetched for `accession`, else translated from the\n * view's `connectedTranscript`. Stored on the model as `blastParams`, the\n * name the dialog has always used.\n */\n searchParams?: BlastParams\n /**\n * Hide any column gappier than this percentage, 100 being \"hide nothing\".\n * A native react-msaview property, named here because it is the one setting\n * that decides WHICH columns a freshly launched view opens on: proteins that\n * differ in length put one row's private N-terminal extension at column 0,\n * and everything else is gap there. Anything else react-msaview takes as a\n * snapshot property passes through the same way.\n */\n allowedGappyness?: number\n /**\n * Where the view lands: `stack` (default), `splitRight` or `newTab`. The\n * declarative half of the launch \u2014 a link states the arrangement it wants\n * instead of the reader dragging the view into place.\n *\n * The default is `stack` and has to stay `stack`: it is what every link\n * written before this key existed already does, and the only thing an\n * embedded session can do. The launch DIALOG defaults to `splitRight`\n * instead (see `DEFAULT_LAUNCH_PLACEMENT`), because a launch from a gene\n * feature is a connected pair and reads as a split.\n *\n * A spec that arranges more than these two views should use the host's own\n * `layout` key instead, which states the whole tree and is applied after\n * every view in the spec has launched. Both may be given; `layout` wins,\n * being the later and more specific statement.\n */\n placement?: MsaViewPlacement\n}\n\n/**\n * `msa` and `tree` onto the plugin's own sources, so a url still goes through\n * `init.msaUrl` and its format sniffing, and `query` onto `querySeqName`\n */\nfunction withLongSources({ msa, tree, ...args }: LaunchMsaViewArgs) {\n const inlineMsa = msa?.includes('\\n') ? msa : undefined\n const inlineTree = tree?.trimStart().startsWith('(') ? tree : undefined\n const data =\n inlineMsa || inlineTree\n ? {\n ...args.data,\n ...(inlineMsa ? { msa: inlineMsa } : {}),\n ...(inlineTree ? { tree: inlineTree } : {}),\n }\n : args.data\n return {\n ...args,\n data: data as LaunchMsaViewArgs['data'],\n ...(msa && !inlineMsa ? { msaFileLocation: { uri: msa } } : {}),\n ...(tree && !inlineTree ? { treeFileLocation: { uri: tree } } : {}),\n querySeqName: args.querySeqName ?? args.query,\n }\n}\n\nexport default function LaunchMsaViewExtensionPointF(\n pluginManager: PluginManager,\n) {\n pluginManager.addToExtensionPoint(\n 'LaunchView-MsaView',\n async (args: LaunchMsaViewArgs) => {\n const {\n session,\n query,\n data,\n msaFileLocation,\n msaIndexedLocation,\n msaName,\n treeFileLocation,\n querySeqName,\n searchParams,\n ...rest\n } = withLongSources(args)\n\n // `orthologParams` and `searchParams` name no alignment at all \u2014 the\n // view builds one at launch, which is the dialog's Orthologs and BLAST\n // tabs reached declaratively.\n if (\n !data &&\n !msaFileLocation &&\n !msaIndexedLocation &&\n !rest.orthologParams &&\n !searchParams\n ) {\n throw new Error(\n 'No MSA data, file location, orthologParams or searchParams provided when launching MSA view',\n )\n }\n\n // inline data and the tree URL are native react-msaview snapshot props, set\n // directly, and so is orthologParams (the model's own autorun picks it up).\n // Only sources needing launch-time resolution go through `init`: msaUrl\n // (AlphaFold sniff) and the name-indexed bgzip block (no native loader).\n //\n // An init whose every field is undefined is still a truthy object, and\n // MsaViewPanel reads any init as a launch in flight, so an inline-data\n // launch flashed \"Loading alignment\" until processInit cleared it.\n const init = {\n msaUrl: msaFileLocation?.uri,\n msaIndexedLocation,\n msaName,\n querySeqName,\n }\n const { expandSpec } = await import('react-msaview')\n await launchMsaView(session, {\n ...expandSpec({ ...rest, query }),\n ...(searchParams ? { blastParams: searchParams } : {}),\n data,\n ...(treeFileLocation\n ? {\n treeFilehandle: {\n ...treeFileLocation,\n locationType: 'UriLocation',\n },\n }\n : {}),\n ...(Object.values(init).some(v => v !== undefined) ? { init } : {}),\n })\n\n return args\n },\n )\n}\n", "import { lazy } from 'react'\n\nimport ViewType from '@jbrowse/core/pluggableElementTypes/ViewType'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nconst MsaViewPanel = lazy(() => import('./components/MsaViewPanel'))\n\nexport default function MsaViewF(pluginManager: PluginManager) {\n pluginManager.addViewType(() => {\n return new ViewType({\n name: 'MsaView',\n // a thunk, so react-msaview loads with the first view rather than with\n // the plugin; addView refuses the type until then, hence launchView\n stateModel: () => import('./model').then(m => m.default()),\n ReactComponent: MsaViewPanel,\n })\n })\n}\n", "export const version = '5.2.0'\n"],
3
+ "sources": ["global-externals:@jbrowse/core/Plugin", "global-externals:@jbrowse/core/pluggableElementTypes/ViewType", "../src/index.ts", "../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/GridOn.mjs", "../src/AddHighlightModel/index.tsx", "../src/MsaViewPanel/isMsaView.ts", "../src/AddHighlightModel/HighlightComponents.tsx", "../src/AddHighlightModel/GenomeMouseoverHighlight.tsx", "../src/AddHighlightModel/util.ts", "../src/AddHighlightModel/MsaToGenomeHighlight.tsx", "../src/AddHighlightModel/connectedHighlights.ts", "../src/BgzipFastaMsaAdapter/index.ts", "../src/BgzipFastaMsaAdapter/configSchema.ts", "../src/LaunchMsaView/index.ts", "../node_modules/.pnpm/@mui+icons-material@9.5.0_@mui+material@9.5.0_@emotion+react@11.14.0_@types+react@19.3._abf953b0c56c79ebdc461ec953894a27/node_modules/@mui/icons-material/Add.mjs", "../src/LaunchMsaView/codingFeature.ts", "../src/LaunchMsaView/launchTarget.ts", "../src/LaunchMsaViewExtensionPoint/index.ts", "../src/MsaViewPanel/index.ts", "../src/version.ts"],
4
+ "sourcesContent": ["module.exports = JBrowseExports[\"@jbrowse/core/Plugin\"];", "module.exports = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/ViewType\"];", "import Plugin from '@jbrowse/core/Plugin'\nimport { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { isAbstractMenuManager } from '@jbrowse/core/util'\nimport { types } from '@jbrowse/mobx-state-tree'\nimport GridOn from '@mui/icons-material/GridOn'\n\nimport AddHighlightModelF from './AddHighlightModel'\nimport BgzipFastaMsaAdapterF from './BgzipFastaMsaAdapter'\nimport LaunchMsaViewF from './LaunchMsaView'\nimport LaunchMsaViewExtensionPointF from './LaunchMsaViewExtensionPoint'\nimport MsaViewF from './MsaViewPanel'\nimport { launchMsaView } from './utils/launchMsaView'\nimport { version } from './version'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\n\nexport default class MsaViewPlugin extends Plugin {\n name = 'MsaViewPlugin'\n version = version\n\n install(pluginManager: PluginManager) {\n MsaViewF(pluginManager)\n LaunchMsaViewF(pluginManager)\n LaunchMsaViewExtensionPointF(pluginManager)\n AddHighlightModelF(pluginManager)\n BgzipFastaMsaAdapterF(pluginManager)\n }\n\n configure(pluginManager: PluginManager) {\n // a throw here error-pages the whole app, and a menu entry is not worth a\n // session\n try {\n if (isAbstractMenuManager(pluginManager.rootModel)) {\n pluginManager.rootModel.appendToSubMenu(['Add'], {\n label: 'Multiple sequence alignment view',\n icon: GridOn,\n onClick: (session: AbstractSessionModel) => {\n // stacked, by default: nothing was launched from, so there is no\n // connected view for it to sit beside\n launchMsaView(session, {}).catch((e: unknown) => {\n console.error(e)\n session.notifyError(`${e}`, e)\n })\n },\n })\n }\n } catch (e) {\n console.error(\n 'jbrowse-plugin-msaview: could not add the Add menu item',\n e,\n )\n }\n }\n\n rootConfigurationSchema = (pluginManager: PluginManager) => {\n return {\n msa: ConfigurationSchema('MSA', {\n datasets: types.maybe(\n types.array(\n ConfigurationSchema('MSAEntry', {\n datasetId: {\n type: 'string',\n defaultValue: '',\n },\n description: {\n type: 'string',\n defaultValue: '',\n },\n name: {\n type: 'string',\n defaultValue: '',\n },\n adapter: pluginManager.pluggableConfigSchemaType('adapter'),\n }),\n ),\n ),\n }),\n }\n }\n}\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M8 20H4v-4h4zm0-6H4v-4h4zm0-6H4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4zm6 12h-4v-4h4zm0-6h-4v-4h4zm0-6h-4V4h4z\"\n}), 'GridOn');", "import React from 'react'\n\nimport { getSession } from '@jbrowse/core/util'\n\nimport { isMsaView } from '../MsaViewPanel/isMsaView'\nimport HighlightComponents from './HighlightComponents'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function AddHighlightComponentsModelF(\n pluginManager: PluginManager,\n) {\n pluginManager.contributeToExtensionPoint(\n 'LinearGenomeView-TracksContainerComponent',\n ({ model }) => {\n const { views } = getSession(model)\n return views.some(v => isMsaView(v) && v.connectedViewId === model.id) ? (\n <HighlightComponents\n key=\"highlight_protein_viewer_msaview\"\n model={model}\n />\n ) : undefined\n },\n )\n}\n", "import type { JBrowsePluginMsaViewModel } from './model'\n\nexport function isMsaView(view: {\n type: string\n}): view is JBrowsePluginMsaViewModel {\n return view.type === 'MsaView'\n}\n", "import React from 'react'\n\nimport { observer } from 'mobx-react'\n\nimport GenomeMouseoverHighlight from './GenomeMouseoverHighlight'\nimport MsaToGenomeHighlight from './MsaToGenomeHighlight'\n\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\ntype LGV = LinearGenomeViewModel\n\nconst HighlightComponents = observer(function HighlightComponents2({\n model,\n}: {\n model: LGV\n}) {\n return (\n <>\n <MsaToGenomeHighlight model={model} />\n <GenomeMouseoverHighlight model={model} />\n </>\n )\n})\n\nexport default HighlightComponents\n", "import React from 'react'\n\nimport { getSession } from '@jbrowse/core/util'\nimport { observer } from 'mobx-react'\n\nimport { isMsaView } from '../MsaViewPanel/isMsaView'\nimport { hasHoverPosition, useStyles } from './util'\n\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\nconst GenomeMouseoverHighlight = observer(function ({\n model,\n}: {\n model: LinearGenomeViewModel\n}) {\n const { hovered, views } = getSession(model)\n const hasMsaView = views.some(\n s => isMsaView(s) && s.connectedViewId === model.id,\n )\n return hasMsaView && hasHoverPosition(hovered) ? (\n <GenomeMouseoverHighlightRenderer model={model} hovered={hovered} />\n ) : null\n})\n\nconst GenomeMouseoverHighlightRenderer = observer(function ({\n model,\n hovered,\n}: {\n model: LinearGenomeViewModel\n hovered: { hoverPosition: { coord: number; refName: string } }\n}) {\n const { classes } = useStyles()\n const { offsetPx } = model\n const { coord, refName } = hovered.hoverPosition\n\n const s = model.bpToPx({ refName, coord: coord - 1 })\n const e = model.bpToPx({ refName, coord })\n\n if (s && e) {\n const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4)\n const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx\n return <div className={classes.highlight} style={{ left, width }} />\n }\n\n return null\n})\n\nexport default GenomeMouseoverHighlight\n", "import { makeStyles } from 'tss-react/mui'\n\nexport { hasHoverPosition } from '../MsaViewPanel/util'\n\nexport const useStyles = makeStyles()({\n highlight: {\n height: '100%',\n background: 'rgba(255,255,0,0.2)',\n border: '1px solid rgba(50,50,0,0.2)',\n position: 'absolute',\n zIndex: 99,\n textAlign: 'center',\n pointerEvents: 'none',\n overflow: 'hidden',\n },\n})\n", "import React from 'react'\n\nimport { getSession } from '@jbrowse/core/util'\nimport { observer } from 'mobx-react'\n\nimport { connectedHighlights } from './connectedHighlights'\nimport { hasHoverPosition, useStyles } from './util'\n\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\ntype LGV = LinearGenomeViewModel\n\nconst MsaToGenomeHighlight = observer(function MsaToGenomeHighlight2({\n model,\n}: {\n model: LGV\n}) {\n const { views, hovered } = getSession(model)\n const highlights = connectedHighlights(\n views,\n model.id,\n hasHoverPosition(hovered),\n )\n\n return highlights.length ? (\n <MsaToGenomeHighlightRenderer model={model} highlights={highlights} />\n ) : null\n})\n\nconst MsaToGenomeHighlightRenderer = observer(function ({\n model,\n highlights,\n}: {\n model: LGV\n highlights: { refName: string; start: number; end: number }[]\n}) {\n const { classes } = useStyles()\n const { offsetPx } = model\n\n return (\n <>\n {highlights.map(r => {\n // bpToPx matches refNames exactly, so canonicalizing \"chr17\" to \"17\"\n // would miss a view whose regions say \"chr17\"\n const s = model.bpToPx({ refName: r.refName, coord: r.start })\n const e = model.bpToPx({ refName: r.refName, coord: r.end })\n if (s && e) {\n const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4)\n const left = Math.min(s.offsetPx, e.offsetPx) - offsetPx\n return (\n <div\n key={`${r.refName}-${r.start}-${r.end}`}\n className={classes.highlight}\n style={{ left, width }}\n />\n )\n }\n return null\n })}\n </>\n )\n})\n\nexport default MsaToGenomeHighlight\n", "interface Region {\n refName: string\n start: number\n end: number\n}\n\ninterface LinkedView {\n type: string\n connectedViewId?: string\n connectedClickHighlights: Region[]\n connectedHoverHighlights: Region[]\n}\n\nexport function connectedHighlights(\n views: readonly { type: string }[],\n genomeViewId: string,\n genomeHovered: boolean,\n) {\n const regions = views\n .filter(isLinkedMsaView)\n .filter(v => v.connectedViewId === genomeViewId)\n .flatMap(v => [\n ...v.connectedClickHighlights,\n ...(genomeHovered ? [] : v.connectedHoverHighlights),\n ])\n return [\n ...new Map(\n regions.map(r => [`${r.refName}:${r.start}-${r.end}`, r]),\n ).values(),\n ]\n}\n\nfunction isLinkedMsaView(view: { type: string }): view is LinkedView {\n return view.type === 'MsaView'\n}\n", "import { AdapterType } from '@jbrowse/core/pluggableElementTypes'\n\nimport configSchemaF from './configSchema'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function BgzipFastaMsaAdapterF(pluginManager: PluginManager) {\n return pluginManager.addAdapterType(() => {\n return new AdapterType({\n name: 'BgzipFastaMsaAdapter',\n configSchema: configSchemaF(pluginManager),\n adapterMetadata: {\n hiddenFromGUI: true,\n },\n getAdapterClass: () =>\n import('./BgzipFastaMsaAdapter').then(t => t.default),\n })\n })\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function configSchemaF(pluginManager: PluginManager) {\n const base = pluginManager.getAdapterType('BgzipFastaAdapter')\n return ConfigurationSchema(\n 'BgzipFastaMsaAdapter',\n {\n msaRegex: {\n type: 'string',\n defaultValue: '_',\n },\n },\n {\n baseConfiguration: base.configSchema,\n },\n )\n}\n", "import { lazy } from 'react'\n\nimport { getContainingTrack, getSession } from '@jbrowse/core/util'\nimport AddIcon from '@mui/icons-material/Add'\n\nimport { isCodingFeature } from './codingFeature'\nimport { launchTarget } from './launchTarget'\n\nimport type { DisplayModel, MenuTarget } from './launchTarget'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { PluggableElementType } from '@jbrowse/core/pluggableElementTypes'\nimport type DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'\nimport type { Feature } from '@jbrowse/core/util'\nimport type { IAnyModelType } from '@jbrowse/mobx-state-tree'\n\nconst LaunchMsaViewDialog = lazy(\n () => import('./components/LaunchMsaViewDialog'),\n)\n\nfunction isDisplay(elt: { name: string }): elt is DisplayType {\n return elt.name === 'LinearBasicDisplay'\n}\n\n// Walking to the track and the session at click time, not while the menu is\n// built: contextMenuItems runs on every right-click and, on a host whose base\n// method reads `this`, is the one place a plugin can take the whole menu down.\n// Keeping it to a pure read of the display is also what lets a test call it.\nfunction featureName(feature: Feature) {\n return feature.get('name') ?? feature.get('id') ?? 'This feature'\n}\n\nfunction openDialog(self: DisplayModel, target: MenuTarget) {\n const track = getContainingTrack(self)\n const session = getSession(track)\n const { preferredTranscriptId } = target\n const open = (feature: Feature) => {\n session.queueDialog(handleClose => [\n LaunchMsaViewDialog,\n { model: track, handleClose, feature, preferredTranscriptId },\n ])\n }\n target\n .fetchFeature()\n .then(feature => {\n if (!feature) {\n session.notify('Could not load feature for MSA view', 'warning')\n } else if (!isCodingFeature(feature)) {\n // the canvas hit test carries a type and nothing else, so this is the\n // first point at which the CDS can be looked for. Saying so beats\n // opening a dialog whose Submit never leaves grey.\n session.notify(\n `${featureName(feature)} has no coding sequence, so there is no protein to align`,\n 'info',\n )\n } else {\n open(feature)\n }\n })\n .catch((e: unknown) => {\n session.notifyError(`${e}`, e)\n })\n}\n\nexport function extendStateModel(stateModel: IAnyModelType) {\n return stateModel.views((self: DisplayModel) => {\n const superContextMenuItems = self.contextMenuItems\n return {\n contextMenuItems() {\n const target = launchTarget(self)\n return [\n // a detached call leaves `this` undefined for a host method that\n // reads it, and the throw takes the host's own rows with it\n ...superContextMenuItems.call(self),\n ...(target\n ? [\n {\n label: 'Launch MSA view',\n icon: AddIcon,\n onClick: () => {\n openDialog(self, target)\n },\n },\n ]\n : []),\n ]\n },\n }\n })\n}\n\nexport default function LaunchMsaViewF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint(\n 'Core-extendPluggableElement',\n (elt: PluggableElementType) => {\n if (isDisplay(elt)) {\n elt.stateModel = extendStateModel(elt.stateModel)\n }\n return elt\n },\n )\n}\n", "\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z\"\n}), 'Add');", "import type { Feature } from '@jbrowse/core/util'\n\nfunction isCDS(feature: Feature) {\n return feature.get('type')?.toLowerCase() === 'cds'\n}\n\n// The feature itself counts: a viral polyprotein hangs its cleavage products\n// off its CDS rather than off further CDSs.\nexport function isCodingFeature(feature: Feature): boolean {\n return isCDS(feature) || !!feature.get('subfeatures')?.some(isCodingFeature)\n}\n", "import { isGeneLikeType } from '@jbrowse/core/util'\n\nimport type { MenuItem } from '@jbrowse/core/ui'\nimport type { Feature } from '@jbrowse/core/util'\n\nexport interface ContextMenuInfo {\n item: { featureId: string; type?: string }\n // the isoform under the pointer when the click landed on a gene's child\n subfeature?: { featureId: string }\n displayedRegionIndex: number\n}\n\nexport interface DisplayModel {\n contextMenuItems: () => MenuItem[]\n contextMenuInfo?: ContextMenuInfo\n fetchFullFeature: (\n featureId: string,\n displayedRegionIndex: number,\n ) => Promise<Feature | undefined>\n}\n\n/**\n * What the menu item launches on. The hit test carries a type and an id, so\n * whether the feature codes for anything can only be answered after the fetch,\n * and the caller answers it there.\n */\nexport interface MenuTarget {\n fetchFeature: () => Promise<Feature | undefined>\n /**\n * The isoform the click actually landed on, when the dialog opens on its\n * gene. Climbing to the gene is what puts every isoform in the picker, and it\n * threw away which one the user pointed at: the picker then opened on the\n * longest transcript.\n */\n preferredTranscriptId?: string\n}\n\n// Read off the clicked item rather than off the display: LinearBasicDisplay's\n// `isGeneLike` getter was inlined into its own `contextMenuItems`\n// (jbrowse-components 684142b3), and gating on it silently took the item off\n// every gene track.\nexport function launchTarget(self: DisplayModel): MenuTarget | undefined {\n const info = self.contextMenuInfo\n return info && isGeneLikeType(info.item.type)\n ? {\n fetchFeature: () =>\n self.fetchFullFeature(info.item.featureId, info.displayedRegionIndex),\n preferredTranscriptId: info.subfeature?.featureId,\n }\n : undefined\n}\n", "import { launchMsaView } from '../utils/launchMsaView'\n\nimport type { BlastParams, OrthologParams } from '../MsaViewPanel/model'\nimport type { MsaViewPlacement } from '../utils/workspaces'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\nimport type {\n Clade,\n ColumnTrackShorthand,\n Encoding,\n HighlightShorthand,\n RegionShorthand,\n ResidueMapping,\n RowPanelSpec,\n} from 'react-msaview'\n\ninterface LaunchMsaViewArgs {\n session: AbstractSessionModel\n /**\n * Shorthand, see react-msaview's docs/layers.md: `msa` and `tree` take a\n * url or the text itself, and `query` names the row the spec is about, the\n * `querySeqName` and the `row` of every highlight, region and column track\n * that names none\n */\n msa?: string\n tree?: string\n query?: string\n data?: { msa: string; tree?: string }\n msaFileLocation?: { uri: string }\n msaIndexedLocation?: { uri: string }\n msaName?: string\n treeFileLocation?: { uri: string }\n connectedViewId?: string\n connectedFeature?: Record<string, unknown>\n /**\n * The short form of `connectedFeature`: a transcript id looked up in the\n * connected genome view's open tracks at launch, and translated to become\n * the query row of a `searchParams` or `orthologParams` launch that names\n * no `proteinSequence` of its own.\n */\n connectedTranscript?: string\n displayName?: string\n colorSchemeName?: string\n colWidth?: number\n rowHeight?: number\n treeAreaWidth?: number\n treeWidth?: number\n drawNodeBubbles?: boolean\n labelsAlignRight?: boolean\n showBranchLen?: boolean\n querySeqName?: string\n /**\n * Transcript residues before the query row's first residue, for a row that\n * carries only part of the protein -- what BLAST reports when it trims the\n * query to the aligned region. Genome navigation is off by this much without\n * it.\n */\n querySeqOffset?: number\n highlightColumns?: number[]\n /**\n * Labeled highlights in 1-based inclusive coordinates: `{row, start, end}`\n * for residues of that row, `{start, end}` for alignment columns, `{rows}`\n * for whole rows. Prefer this over `highlightColumns`: a residue range stays\n * put when `allowedGappyness` changes the visible columns.\n */\n highlights?: HighlightShorthand[]\n /** per-column tracks supplied as data, see react-msaview's docs/layers.md */\n columnTracks?: ColumnTrackShorthand[]\n /**\n * Where the view opens, in `highlights` coordinates: `{row, start, end}`\n * zooms onto residues of that row, `{start, end}` onto alignment columns.\n * Applied once the alignment has loaded, then dropped from the session.\n */\n region?: RegionShorthand\n /**\n * Passed through untouched as react-msaview snapshot properties; see its\n * docs/layers.md. A bare `{ uri }` is enough for the two filehandles.\n */\n clades?: Clade[]\n encodings?: Encoding[]\n rowPanels?: RowPanelSpec[]\n relativeTo?: string\n residueMappings?: ResidueMapping[]\n trackHeights?: Record<string, number>\n turnedOffFeatures?: Record<string, boolean>\n gffFilehandle?: { uri: string }\n treeMetadataFilehandle?: { uri: string }\n /**\n * Build the alignment from NCBI orthologs at launch time instead of naming a\n * file: `{ taxId, geneCandidates }` is enough, and `taxa` and\n * `proteinSequence` both default (see OrthologParams). This is the launch\n * dialog's Orthologs tab, reachable from a session spec \u2014 so a link can say\n * \"NLRP1 across species\" and the view builds it.\n */\n orthologParams?: OrthologParams\n /**\n * Search for the alignment at launch: the dialog's BLAST tab reached\n * declaratively. `{ searchProgram: 'phmmer', blastDatabase: 'rp15',\n * accession: 'P04637' }` is a whole request. The query comes from\n * `proteinSequence`, else fetched for `accession`, else translated from the\n * view's `connectedTranscript`. Stored on the model as `blastParams`, the\n * name the dialog has always used.\n */\n searchParams?: BlastParams\n /**\n * Hide any column gappier than this percentage, 100 being \"hide nothing\".\n * A native react-msaview property, named here because it is the one setting\n * that decides WHICH columns a freshly launched view opens on: proteins that\n * differ in length put one row's private N-terminal extension at column 0,\n * and everything else is gap there. Anything else react-msaview takes as a\n * snapshot property passes through the same way.\n */\n allowedGappyness?: number\n /**\n * Where the view lands: `stack` (default), `splitRight` or `newTab`. The\n * declarative half of the launch \u2014 a link states the arrangement it wants\n * instead of the reader dragging the view into place.\n *\n * The default is `stack` and has to stay `stack`: it is what every link\n * written before this key existed already does, and the only thing an\n * embedded session can do. The launch DIALOG defaults to `splitRight`\n * instead (see `DEFAULT_LAUNCH_PLACEMENT`), because a launch from a gene\n * feature is a connected pair and reads as a split.\n *\n * A spec that arranges more than these two views should use the host's own\n * `layout` key instead, which states the whole tree and is applied after\n * every view in the spec has launched. Both may be given; `layout` wins,\n * being the later and more specific statement.\n */\n placement?: MsaViewPlacement\n}\n\n/**\n * `msa` and `tree` onto the plugin's own sources, so a url still goes through\n * `init.msaUrl` and its format sniffing, and `query` onto `querySeqName`\n */\nfunction withLongSources({ msa, tree, ...args }: LaunchMsaViewArgs) {\n const inlineMsa = msa?.includes('\\n') ? msa : undefined\n const inlineTree = tree?.trimStart().startsWith('(') ? tree : undefined\n const data =\n inlineMsa || inlineTree\n ? {\n ...args.data,\n ...(inlineMsa ? { msa: inlineMsa } : {}),\n ...(inlineTree ? { tree: inlineTree } : {}),\n }\n : args.data\n return {\n ...args,\n data: data as LaunchMsaViewArgs['data'],\n ...(msa && !inlineMsa ? { msaFileLocation: { uri: msa } } : {}),\n ...(tree && !inlineTree ? { treeFileLocation: { uri: tree } } : {}),\n querySeqName: args.querySeqName ?? args.query,\n }\n}\n\nexport default function LaunchMsaViewExtensionPointF(\n pluginManager: PluginManager,\n) {\n pluginManager.addToExtensionPoint(\n 'LaunchView-MsaView',\n async (args: LaunchMsaViewArgs) => {\n const {\n session,\n query,\n data,\n msaFileLocation,\n msaIndexedLocation,\n msaName,\n treeFileLocation,\n querySeqName,\n searchParams,\n ...rest\n } = withLongSources(args)\n\n // `orthologParams` and `searchParams` name no alignment at all \u2014 the\n // view builds one at launch, which is the dialog's Orthologs and BLAST\n // tabs reached declaratively.\n if (\n !data &&\n !msaFileLocation &&\n !msaIndexedLocation &&\n !rest.orthologParams &&\n !searchParams\n ) {\n throw new Error(\n 'No MSA data, file location, orthologParams or searchParams provided when launching MSA view',\n )\n }\n\n // inline data and the tree URL are native react-msaview snapshot props, set\n // directly, and so is orthologParams (the model's own autorun picks it up).\n // Only sources needing launch-time resolution go through `init`: msaUrl\n // (AlphaFold sniff) and the name-indexed bgzip block (no native loader).\n //\n // An init whose every field is undefined is still a truthy object, and\n // MsaViewPanel reads any init as a launch in flight, so an inline-data\n // launch flashed \"Loading alignment\" until processInit cleared it.\n const init = {\n msaUrl: msaFileLocation?.uri,\n msaIndexedLocation,\n msaName,\n querySeqName,\n }\n const { expandSpec } = await import('react-msaview')\n await launchMsaView(session, {\n ...expandSpec({ ...rest, query }),\n ...(searchParams ? { blastParams: searchParams } : {}),\n data,\n ...(treeFileLocation\n ? {\n treeFilehandle: {\n ...treeFileLocation,\n locationType: 'UriLocation',\n },\n }\n : {}),\n ...(Object.values(init).some(v => v !== undefined) ? { init } : {}),\n })\n\n return args\n },\n )\n}\n", "import { lazy } from 'react'\n\nimport ViewType from '@jbrowse/core/pluggableElementTypes/ViewType'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nconst MsaViewPanel = lazy(() => import('./components/MsaViewPanel'))\n\nexport default function MsaViewF(pluginManager: PluginManager) {\n pluginManager.addViewType(() => {\n return new ViewType({\n name: 'MsaView',\n // a thunk, so react-msaview loads with the first view rather than with\n // the plugin; addView refuses the type until then, hence launchView\n stateModel: () => import('./model').then(m => m.default()),\n ReactComponent: MsaViewPanel,\n })\n })\n}\n", "export const version = '5.4.0'\n"],
5
5
  "mappings": "scAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,CAAAA,EAAO,QAAU,eAAe,sBAAsB,ICAtD,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAU,eAAe,8CAA8C,ICA9E,IAAAC,GAAmB,OACnBC,EAAoC,OACpCC,GAAsC,OACtCC,EAAsB,QCAtB,IAAAC,EAA4B,SACrBC,KAAQ,oBAA2B,EAAAC,KAAK,OAAQ,CACrD,EAAG,+LACL,CAAC,EAAG,QAAQ,ECNZ,IAAAC,EAAkB,OAElBC,GAA2B,OCApB,SAASC,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BC,IAClB,CACL,OAAK,uBAAoB,MAAO,CAC9B,SAAU,QAAM,MACd,QAAM,SACJ,uBAAoB,WAAY,CAC9B,UAAW,CACT,KAAM,SACN,aAAc,EAChB,EACA,YAAa,CACX,KAAM,SACN,aAAc,EAChB,EACA,KAAM,CACJ,KAAM,SACN,aAAc,EAChB,EACA,QAASA,EAAc,0BAA0B,SAAS,CAC5D,CAAC,CACH,CACF,CACF,CAAC,CACH,GAzDF,QAAQA,EAA8B,CACpCC,EAASD,CAAa,EACtBE,EAAeF,CAAa,EAC5BG,EAA6BH,CAAa,EAC1CI,EAAmBJ,CAAa,EAChCK,EAAsBL,CAAa,CACrC,CAEA,UAAUA,EAA8B,CAGtC,GAAI,IACE,0BAAsBA,EAAc,SAAS,GAC/CA,EAAc,UAAU,gBAAgB,CAAC,KAAK,EAAG,CAC/C,MAAO,mCACP,KAAMM,EACN,QAAUC,GAAkC,CAG1CC,EAAcD,EAAS,CAAC,CAAC,EAAE,MAAOE,GAAe,CAC/C,QAAQ,MAAMA,CAAC,EACfF,EAAQ,YAAY,GAAGE,CAAC,GAAIA,CAAC,CAC/B,CAAC,CACH,CACF,CAAC,CAEL,OAASA,EAAG,CACV,QAAQ,MACN,0DACAA,CACF,CACF,CACF,CA2BF",
6
6
  "names": ["require_Plugin", "__commonJSMin", "exports", "module", "require_ViewType", "__commonJSMin", "exports", "module", "import_Plugin", "import_configuration", "import_util", "import_mobx_state_tree", "import_jsx_runtime", "GridOn_default", "_jsx", "import_react", "import_util", "isMsaView", "view", "import_react", "import_mobx_react", "import_react", "import_util", "import_mobx_react", "import_mui", "useStyles", "GenomeMouseoverHighlight", "model", "hovered", "views", "s", "isMsaView", "hasHoverPosition", "React", "GenomeMouseoverHighlightRenderer", "classes", "useStyles", "offsetPx", "coord", "refName", "e", "width", "left", "GenomeMouseoverHighlight_default", "import_react", "import_util", "import_mobx_react", "connectedHighlights", "views", "genomeViewId", "genomeHovered", "regions", "isLinkedMsaView", "v", "r", "view", "MsaToGenomeHighlight", "model", "views", "hovered", "highlights", "connectedHighlights", "hasHoverPosition", "React", "MsaToGenomeHighlightRenderer", "classes", "useStyles", "offsetPx", "r", "e", "width", "left", "MsaToGenomeHighlight_default", "HighlightComponents", "model", "React", "MsaToGenomeHighlight_default", "GenomeMouseoverHighlight_default", "HighlightComponents_default", "AddHighlightComponentsModelF", "pluginManager", "model", "views", "v", "isMsaView", "React", "HighlightComponents_default", "import_pluggableElementTypes", "import_configuration", "configSchemaF", "pluginManager", "base", "BgzipFastaMsaAdapterF", "pluginManager", "configSchemaF", "import_react", "import_util", "import_jsx_runtime", "Add_default", "_jsx", "isCDS", "feature", "isCodingFeature", "import_util", "launchTarget", "self", "info", "LaunchMsaViewDialog", "isDisplay", "elt", "featureName", "feature", "openDialog", "self", "target", "track", "session", "preferredTranscriptId", "open", "handleClose", "isCodingFeature", "e", "extendStateModel", "stateModel", "superContextMenuItems", "launchTarget", "Add_default", "LaunchMsaViewF", "pluginManager", "withLongSources", "msa", "tree", "args", "inlineMsa", "inlineTree", "data", "LaunchMsaViewExtensionPointF", "pluginManager", "session", "query", "msaFileLocation", "msaIndexedLocation", "msaName", "treeFileLocation", "querySeqName", "searchParams", "rest", "init", "expandSpec", "launchMsaView", "v", "import_react", "import_ViewType", "MsaViewPanel", "MsaViewF", "pluginManager", "ViewType", "m", "version", "MsaViewPlugin", "Plugin", "version", "pluginManager", "MsaViewF", "LaunchMsaViewF", "LaunchMsaViewExtensionPointF", "AddHighlightComponentsModelF", "BgzipFastaMsaAdapterF", "GridOn_default", "session", "launchMsaView", "e"]
7
7
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.2.0";
1
+ export declare const version = "5.4.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.2.0';
1
+ export const version = '5.4.0';
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.2.0",
2
+ "version": "5.4.0",
3
3
  "license": "MIT",
4
4
  "name": "jbrowse-plugin-msaview",
5
5
  "repository": {
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "dependencies": {
19
19
  "@gmod/bgzf-filehandle": "^6.7.0",
20
- "g2p_mapper": "^2.1.7",
20
+ "g2p_mapper": "^2.2.1",
21
21
  "idb": "^8.0.4"
22
22
  },
23
23
  "devDependencies": {
@@ -25,44 +25,44 @@
25
25
  "@eslint/js": "^10.0.1",
26
26
  "@fal-works/esbuild-plugin-global-externals": "^2.1.2",
27
27
  "@jbrowse/core": "5.0.0-beta.9",
28
- "@jbrowse/mobx-state-tree": "^6.7.0",
28
+ "@jbrowse/mobx-state-tree": "^6.9.0",
29
29
  "@jbrowse/plugin-linear-genome-view": "5.0.0-beta.9",
30
- "@mui/icons-material": "^9.4.0",
31
- "@mui/material": "^9.4.0",
32
- "@mui/system": "^9.4.0",
30
+ "@mui/icons-material": "^9.5.0",
31
+ "@mui/material": "^9.5.0",
32
+ "@mui/system": "^9.5.0",
33
33
  "@mui/x-data-grid": "^9.15.0",
34
34
  "@testing-library/dom": "^10.4.2",
35
35
  "@testing-library/react": "^16.3.3",
36
- "@types/node": "^26.6.4",
36
+ "@types/node": "^26.6.5",
37
37
  "@types/react": "^19.3.0",
38
38
  "esbuild": "^0.28.2",
39
39
  "eslint": "^10.12.0",
40
40
  "eslint-plugin-import-x": "^4.17.1",
41
41
  "eslint-plugin-react": "^7.37.5",
42
42
  "eslint-plugin-react-hooks": "^7.1.1",
43
- "eslint-plugin-unicorn": "^77.0.0",
43
+ "eslint-plugin-unicorn": "^78.0.0",
44
44
  "git-cliff": "^2.14.2",
45
45
  "jsdom": "^30.1.2",
46
46
  "mobx": "^7.0.6",
47
47
  "mobx-react": "^10.0.2",
48
- "msa-parsers": "^9.0.0",
49
- "oxfmt": "^0.72.0",
50
- "oxlint": "^1.87.0",
51
- "oxlint-tsgolint": "^7.0.2003",
48
+ "msa-parsers": "^9.1.0",
49
+ "oxfmt": "^0.73.0",
50
+ "oxlint": "^1.88.0",
51
+ "oxlint-tsgolint": "^7.0.2004",
52
52
  "pixelmatch": "^8.0.0",
53
53
  "pngjs": "^7.0.0",
54
54
  "pretty-bytes": "^7.2.0",
55
- "puppeteer": "^25.12.0",
56
- "react": "^19.3.0",
57
- "react-dom": "^19.3.0",
58
- "react-msaview": "^9.0.0",
55
+ "puppeteer": "^25.14.0",
56
+ "react": "^19.3.1",
57
+ "react-dom": "^19.3.1",
58
+ "react-msaview": "^9.1.0",
59
59
  "rimraf": "^6.1.3",
60
60
  "rxjs": "^7.8.2",
61
61
  "serve": "^14.2.6",
62
62
  "tss-react": "^4.9.21",
63
63
  "typescript": "^6.0.3",
64
- "typescript-eslint": "^8.71.1",
65
- "vitest": "^5.0.3"
64
+ "typescript-eslint": "^8.71.2",
65
+ "vitest": "^5.0.4"
66
66
  },
67
67
  "scripts": {
68
68
  "clean": "rimraf dist",
@@ -193,3 +193,7 @@ describe('returning to the import form', () => {
193
193
  expect(model.dataStoreId).toBeUndefined()
194
194
  })
195
195
  })
196
+
197
+ test('the view asks react-msaview for its icon toolbar', () => {
198
+ expect((view() as { embeddedMode?: boolean }).embeddedMode).toBe(true)
199
+ })
@@ -236,6 +236,14 @@ export default function stateModelFactory() {
236
236
  * #property
237
237
  */
238
238
  mafRegion: types.frozen<MafRegion | undefined>(),
239
+
240
+ /**
241
+ * #property
242
+ * react-msaview draws the toolbar's menus and Settings as icons, since
243
+ * a JBrowse view shares its row with other panels. A session spec sets
244
+ * it false for the labeled toolbar.
245
+ */
246
+ embeddedMode: true,
239
247
  }),
240
248
  )
241
249
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '5.2.0'
1
+ export const version = '5.4.0'
@@ -1,2 +0,0 @@
1
- import{a as i}from"./chunk-DNFD5II2.js";import{a as m}from"./chunk-BX4Z274Q.js";import{a}from"./chunk-J6KYLXRD.js";import{b as r}from"./chunk-FY3BTKY4.js";var e=r(a(),1),o=r(i(),1),t=r(m(),1);var l="9.0.0";function c({onClose:n}){return e.default.createElement(o.Dialog,{open:!0,title:"About",onClose:()=>{n()}},e.default.createElement(t.DialogContent,null,e.default.createElement(t.Typography,null,"MSAView ",l," (",e.default.createElement(t.Link,{target:"_blank",rel:"noopener",href:"https://github.com/gmod/react-msaview"},"Github"),")"),e.default.createElement("ul",null,e.default.createElement("li",null,e.default.createElement(t.Typography,null,"We use some color schemes from the"," ",e.default.createElement(t.Link,{target:"_blank",rel:"noopener",href:"https://github.com/biotite-dev/biotite"},"biotite")," ","project, and their license is reproduced"," ",e.default.createElement(t.Link,{target:"_blank",rel:"noopener",href:"https://github.com/biotite-dev/biotite/blob/master/LICENSE.rst"},"here"))),e.default.createElement("li",null,e.default.createElement(t.Typography,null,"See this page for some information on jalview colorings"," ",e.default.createElement(t.Link,{target:"_blank",rel:"noopener",href:"https://www.jalview.org/help/html/colourSchemes/"},"here"))),e.default.createElement("li",null,e.default.createElement(t.Typography,null,"See this page for some info on the clustal, cinema, maeditor, and lesk color schemes"," ",e.default.createElement(t.Link,{target:"_blank",rel:"noopener",href:"http://www.bioinformatics.nl/~berndb/aacolour.html"},"here"))),e.default.createElement("li",null,e.default.createElement(t.Typography,null,"See this paper about the flower color scheme"," ",e.default.createElement(t.Link,{target:"_blank",rel:"noopener",href:"https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7245768/"},"here"))))))}export{c as default};
2
- //# sourceMappingURL=AboutDialog-IRBPUPJK.js.map
@@ -1,2 +0,0 @@
1
- import{h as E,k as d}from"./chunk-QQ5LZUIO.js";import"./chunk-73KAPCJ2.js";import{a as x}from"./chunk-CVLB4VFP.js";import{a as w}from"./chunk-DNFD5II2.js";import{a as T}from"./chunk-BX4Z274Q.js";import{a as C}from"./chunk-J6KYLXRD.js";import{b as i}from"./chunk-FY3BTKY4.js";var e=i(C(),1),c=i(w(),1),t=i(T(),1),h=i(x(),1);function b(r){let n=r.trimStart();if(!n.startsWith("{"))return r;let a=JSON.parse(n);return d(E(a))}async function O(r){let n=await fetch(r);if(!n.ok)throw new Error(`HTTP ${n.status} fetching ${r} ${await n.text()}`);return n.text()}var R=(0,h.observer)(function({handleClose:r,model:n}){let[a,g]=(0,e.useState)(),[l,v]=(0,e.useState)("file"),[s,F]=(0,e.useState)(""),[m,u]=(0,e.useState)(),[y,f]=(0,e.useState)(!1);return e.default.createElement(c.Dialog,{maxWidth:"xl",title:"Open annotation file",onClose:()=>{r()},open:!0},e.default.createElement(t.DialogContent,null,m?e.default.createElement(c.ErrorMessage,{error:m}):null,e.default.createElement(t.Typography,null,"Open a GFF3 file of annotations, such as the one `react-msaview-cli interpro` writes, or the JSON an InterProScan run returns."),e.default.createElement("div",{style:{display:"flex",margin:30}},e.default.createElement(t.FormControl,{component:"fieldset"},e.default.createElement(t.RadioGroup,{value:l,onChange:o=>{v(o.target.value)}},e.default.createElement(t.FormControlLabel,{value:"url",control:e.default.createElement(t.Radio,null),label:"URL"}),e.default.createElement(t.FormControlLabel,{value:"file",control:e.default.createElement(t.Radio,null),label:"File"}))),l==="url"?e.default.createElement("div",null,e.default.createElement(t.Typography,null,"Open an annotation file from a URL"),e.default.createElement(t.TextField,{label:"URL",value:s,onChange:o=>{F(o.target.value)}})):e.default.createElement("div",{style:{paddingTop:20}},e.default.createElement(t.Typography,null,"Open an annotation file from your local drive"),e.default.createElement(t.Button,{variant:"outlined",component:"label"},"Choose File",e.default.createElement("input",{type:"file",hidden:!0,onChange:({target:o})=>{let p=o.files?.[0];p&&g(p)}})),a?e.default.createElement(t.Typography,null,a.name):null))),e.default.createElement(t.DialogActions,null,e.default.createElement(t.Button,{variant:"contained",color:"primary",disabled:y||(l==="file"?!a:!s.trim()),onClick:()=>{(async()=>{f(!0),u(void 0);try{let o=await(l==="file"&&a?a.text():O(s));n.setGFF(b(o)),n.setShowDomains(!0),r()}catch(o){console.error(o),u(o)}finally{f(!1)}})()}},"Open annotations"),e.default.createElement(t.Button,{variant:"contained",color:"secondary",onClick:()=>{r()}},"Cancel")))}),D=R;export{D as default};
2
- //# sourceMappingURL=AnnotationFileDialog-FCYYZ4JN.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../node_modules/.pnpm/react-msaview@9.0.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/components/dialogs/AnnotationFileDialog.tsx"],
4
- "sourcesContent": ["import React, { useState } from 'react'\n\nimport { Dialog, ErrorMessage } from '@jbrowse/core/ui'\nimport {\n Button,\n DialogActions,\n DialogContent,\n FormControl,\n FormControlLabel,\n Radio,\n RadioGroup,\n TextField,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport {\n annotationsToGFF,\n interProScanResponseToAnnotations,\n} from 'msa-parsers'\n\nimport type { MsaViewModel } from '../../model.ts'\nimport type { InterProScanResponse } from 'msa-parsers'\n\n// GFF3 as the CLI writes it, or the JSON an InterProScan run returns. Both\n// arrive as text and the model keeps GFF, so the JSON is converted on the way\n// in rather than given a second path through the model\nfunction toGFF(text: string) {\n const trimmed = text.trimStart()\n if (!trimmed.startsWith('{')) {\n return text\n }\n const response: InterProScanResponse = JSON.parse(trimmed)\n return annotationsToGFF(interProScanResponseToAnnotations(response))\n}\n\nasync function fetchText(url: string) {\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(\n `HTTP ${response.status} fetching ${url} ${await response.text()}`,\n )\n }\n return response.text()\n}\n\nconst AnnotationFileDialog = observer(function ({\n handleClose,\n model,\n}: {\n handleClose: () => void\n model: MsaViewModel\n}) {\n const [file, setFile] = useState<File>()\n const [choice, setChoice] = useState('file')\n const [url, setUrl] = useState('')\n const [error, setError] = useState<unknown>()\n const [loading, setLoading] = useState(false)\n\n // the error is shown here rather than notified: the standalone app and the\n // MSAViewer component have no jbrowse session to notify, and asking one for\n // its notify() threw out of the success path into the catch, which threw\n // again on the same missing session\n return (\n <Dialog\n maxWidth=\"xl\"\n title=\"Open annotation file\"\n onClose={() => {\n handleClose()\n }}\n open\n >\n <DialogContent>\n {error ? <ErrorMessage error={error} /> : null}\n <Typography>\n Open a GFF3 file of annotations, such as the one `react-msaview-cli\n interpro` writes, or the JSON an InterProScan run returns.\n </Typography>\n\n <div style={{ display: 'flex', margin: 30 }}>\n <FormControl component=\"fieldset\">\n <RadioGroup\n value={choice}\n onChange={event => {\n setChoice(event.target.value)\n }}\n >\n <FormControlLabel value=\"url\" control={<Radio />} label=\"URL\" />\n <FormControlLabel value=\"file\" control={<Radio />} label=\"File\" />\n </RadioGroup>\n </FormControl>\n {choice === 'url' ? (\n <div>\n <Typography>Open an annotation file from a URL</Typography>\n <TextField\n label=\"URL\"\n value={url}\n onChange={event => {\n setUrl(event.target.value)\n }}\n />\n </div>\n ) : (\n <div style={{ paddingTop: 20 }}>\n <Typography>\n Open an annotation file from your local drive\n </Typography>\n <Button variant=\"outlined\" component=\"label\">\n Choose File\n <input\n type=\"file\"\n hidden\n onChange={({ target }) => {\n const chosen = target.files?.[0]\n if (chosen) {\n setFile(chosen)\n }\n }}\n />\n </Button>\n {file ? <Typography>{file.name}</Typography> : null}\n </div>\n )}\n </div>\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={loading || (choice === 'file' ? !file : !url.trim())}\n onClick={() => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n ;(async () => {\n setLoading(true)\n setError(undefined)\n try {\n const text = await (choice === 'file' && file\n ? file.text()\n : fetchText(url))\n // through the model's own GFF text, so the annotations travel\n // in the snapshot and the shared URL like every other layer.\n // Setting them straight onto the volatile left a view whose\n // link opened without them\n model.setGFF(toGFF(text))\n model.setShowDomains(true)\n handleClose()\n } catch (e) {\n console.error(e)\n setError(e)\n } finally {\n setLoading(false)\n }\n })()\n }}\n >\n Open annotations\n </Button>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n onClick={() => {\n handleClose()\n }}\n >\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default AnnotationFileDialog\n"],
5
- "mappings": "mRAAA,IAAAA,EAAgC,SAEhCC,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OV,EAAMC,CAAI,CAAC,EACxBS,EAAM,eAAe,EAAI,EACzBD,EAAW,CACb,OAASe,EAAG,CACV,QAAQ,MAAMA,CAAC,EACfP,EAASO,CAAC,CACZ,SACEL,EAAW,EAAK,CAClB,CACF,GAAE,CACJ,CAAC,EAAA,kBAAA,EAIH,EAAAC,QAAA,cAAC,SAAM,CACL,QAAQ,YACR,MAAM,YACN,QAAS,IAAK,CACZX,EAAW,CACb,CAAC,EAAA,QAAA,CAGM,CACK,CAGtB,CAAC,EAEDgB,EAAejB",
6
- "names": ["import_react", "import_ui", "import_material", "import_mobx_react", "toGFF", "text", "trimmed", "response", "annotationsToGFF", "interProScanResponseToAnnotations", "fetchText", "url", "AnnotationFileDialog", "handleClose", "model", "file", "setFile", "choice", "setChoice", "setUrl", "error", "setError", "loading", "setLoading", "React", "event", "target", "chosen", "e", "AnnotationFileDialog_default"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as p}from"./chunk-YOTSFJMU.js";import{a as P}from"./chunk-CVLB4VFP.js";import{a as R}from"./chunk-DNFD5II2.js";import{a as q}from"./chunk-BX4Z274Q.js";import{a as W}from"./chunk-J6KYLXRD.js";import{b as a}from"./chunk-FY3BTKY4.js";var t=a(W(),1),i=a(R(),1),e=a(q(),1),v=a(P(),1);function z(r){requestAnimationFrame(()=>{requestAnimationFrame(r)})}var O=(0,v.observer)(function({model:r,onClose:c}){let[s,f]=(0,t.useState)(!0),[n,x]=(0,t.useState)(!0),[o,k]=(0,t.useState)("viewport"),[h,y]=(0,t.useState)(),[m,d]=(0,t.useState)(!1),T=(0,e.useTheme)(),{totalWidth:C,totalHeight:b,effectiveTreeAreaWidth:w,rowPanelsWidth:M,turnedOnTracks:A,totalTrackAreaHeight:S,numColumns:F,leaves:G,showMsaLetters:I,treeOverviewHeight:D}=r,E=A.length>0,H=C+w+M,L=b+(n?S:0)+D,g=I&&o==="entire"?F*G.length:0,V=g>1e5;return t.default.createElement(i.Dialog,{onClose:()=>{c()},open:!0,title:"Export SVG"},t.default.createElement(e.DialogContent,null,h?t.default.createElement(i.ErrorMessage,{error:h}):null,t.default.createElement(e.Typography,null,"Settings:"),t.default.createElement(p,{label:"Include minimap?",disabled:o==="entire",checked:s,onChange:()=>{f(!s)}}),E?t.default.createElement(p,{label:"Include tracks?",checked:n,onChange:()=>{x(!n)}}):null,t.default.createElement("div",null,t.default.createElement(e.FormControl,null,t.default.createElement(e.FormLabel,null,"Export type"),t.default.createElement(e.RadioGroup,{value:o,onChange:l=>{let{value:u}=l.target;(u==="entire"||u==="viewport")&&k(u)}},t.default.createElement(e.FormControlLabel,{value:"entire",control:t.default.createElement(e.Radio,null),label:"Entire MSA"}),t.default.createElement(e.FormControlLabel,{value:"viewport",control:t.default.createElement(e.Radio,null),label:"Current viewport only"})))),V?t.default.createElement(e.Alert,{severity:"warning",style:{marginTop:8}},"The entire MSA is ",Math.round(H),"x",Math.round(L)," pixels and draws"," ",Math.round(g/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),t.default.createElement(e.DialogActions,null,t.default.createElement(e.Button,{variant:"contained",color:"primary",disabled:m,startIcon:m?t.default.createElement(e.CircularProgress,{size:16,color:"inherit"}):null,onClick:()=>{d(!0),z(()=>{r.exportSVG({theme:T,includeMinimap:s,includeTracks:E&&n,exportType:o}).then(()=>{c()}).catch(l=>{console.error(l),y(l)}).finally(()=>{d(!1)})})}},m?"Exporting\u2026":"Export"),t.default.createElement(e.Button,{variant:"contained",color:"secondary",onClick:()=>{c()}},"Cancel")))}),_=O;export{_ as default};
2
- //# sourceMappingURL=ExportSVGDialog-TYYPI6VB.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../node_modules/.pnpm/react-msaview@9.0.0_3e54acfe76b6ad0d26e91cd532b7f775/node_modules/react-msaview/src/components/dialogs/ExportSVGDialog.tsx"],
4
- "sourcesContent": ["import React, { useState } from 'react'\n\nimport { Dialog, ErrorMessage } from '@jbrowse/core/ui'\nimport {\n Alert,\n Button,\n CircularProgress,\n DialogActions,\n DialogContent,\n FormControl,\n FormControlLabel,\n FormLabel,\n Radio,\n RadioGroup,\n Typography,\n useTheme,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport Checkbox2 from '../Checkbox2.tsx'\n\nimport type { MsaViewModel } from '../../model.ts'\n\n// Run after the browser has painted. A requestAnimationFrame callback still\n// runs *before* the frame it was queued for, so one alone hands the main thread\n// to the render with the spinner not yet on screen; the second fires once that\n// frame is out.\nfunction afterPaint(fn: () => void) {\n requestAnimationFrame(() => {\n requestAnimationFrame(fn)\n })\n}\n\nconst ExportSVGDialog = observer(function ({\n model,\n onClose,\n}: {\n model: MsaViewModel\n onClose: () => void\n}) {\n const [includeMinimap, setIncludeMinimap] = useState(true)\n const [includeTracks, setIncludeTracks] = useState(true)\n const [exportType, setExportType] = useState<'entire' | 'viewport'>(\n 'viewport',\n )\n const [error, setError] = useState<unknown>()\n const [exporting, setExporting] = useState(false)\n const theme = useTheme()\n const {\n totalWidth,\n totalHeight,\n effectiveTreeAreaWidth,\n rowPanelsWidth,\n turnedOnTracks,\n totalTrackAreaHeight,\n numColumns,\n leaves,\n showMsaLetters,\n treeOverviewHeight,\n } = model\n const hasTracks = turnedOnTracks.length > 0\n const entireWidth = totalWidth + effectiveTreeAreaWidth + rowPanelsWidth\n const entireHeight =\n totalHeight +\n (includeTracks ? totalTrackAreaHeight : 0) +\n treeOverviewHeight\n // the background is one raster image whatever its size, so what the figure\n // actually costs is its residue letters: each is an svg element of its own.\n // Past roughly this many the export runs to tens of seconds and can exhaust\n // the tab's memory outright\n const glyphs =\n showMsaLetters && exportType === 'entire' ? numColumns * leaves.length : 0\n const isLargeExport = glyphs > 100_000\n return (\n <Dialog\n onClose={() => {\n onClose()\n }}\n open\n title=\"Export SVG\"\n >\n <DialogContent>\n {error ? <ErrorMessage error={error} /> : null}\n <Typography>Settings:</Typography>\n <Checkbox2\n label=\"Include minimap?\"\n disabled={exportType === 'entire'}\n checked={includeMinimap}\n onChange={() => {\n setIncludeMinimap(!includeMinimap)\n }}\n />\n {hasTracks ? (\n <Checkbox2\n label=\"Include tracks?\"\n checked={includeTracks}\n onChange={() => {\n setIncludeTracks(!includeTracks)\n }}\n />\n ) : null}\n <div>\n <FormControl>\n <FormLabel>Export type</FormLabel>\n <RadioGroup\n value={exportType}\n onChange={event => {\n const { value } = event.target\n if (value === 'entire' || value === 'viewport') {\n setExportType(value)\n }\n }}\n >\n <FormControlLabel\n value=\"entire\"\n control={<Radio />}\n label=\"Entire MSA\"\n />\n <FormControlLabel\n value=\"viewport\"\n control={<Radio />}\n label=\"Current viewport only\"\n />\n </RadioGroup>\n </FormControl>\n </div>\n {isLargeExport ? (\n <Alert severity=\"warning\" style={{ marginTop: 8 }}>\n The entire MSA is {Math.round(entireWidth)}x\n {Math.round(entireHeight)} pixels and draws{' '}\n {Math.round(glyphs / 1000)}k residue letters, each its own SVG\n element. Export may be slow or fail \u2014 zooming out far enough to hide\n the letters exports the same alignment as an image instead.\n </Alert>\n ) : null}\n </DialogContent>\n <DialogActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n // rendering runs on the main thread and a large figure holds it for\n // seconds; without this the button stays live through the freeze and\n // a second click starts a second export\n disabled={exporting}\n startIcon={\n exporting ? <CircularProgress size={16} color=\"inherit\" /> : null\n }\n onClick={() => {\n setExporting(true)\n afterPaint(() => {\n void model\n .exportSVG({\n theme,\n includeMinimap,\n includeTracks: hasTracks && includeTracks,\n exportType,\n })\n .then(() => {\n onClose()\n })\n .catch((e: unknown) => {\n console.error(e)\n setError(e)\n })\n .finally(() => {\n setExporting(false)\n })\n })\n }}\n >\n {exporting ? 'Exporting\u2026' : 'Export'}\n </Button>\n <Button\n variant=\"contained\"\n color=\"secondary\"\n onClick={() => {\n onClose()\n }}\n >\n Cancel\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default ExportSVGDialog\n"],
5
- "mappings": "gPAAA,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AK,CACZrB,EAAa,EAAK,CACpB,CAAC,CACL,CAAC,CACH,CAAC,EAEAD,EAAY,kBAAe,QAAQ,EAEtC,EAAAkB,QAAA,cAAC,SAAM,CACL,QAAQ,YACR,MAAM,YACN,QAAS,IAAK,CACZ3B,EAAO,CACT,CAAC,EAAA,QAAA,CAGM,CACK,CAGtB,CAAC,EAEDgC,EAAelC",
6
- "names": ["import_react", "import_ui", "import_material", "import_mobx_react", "afterPaint", "fn", "ExportSVGDialog", "model", "onClose", "includeMinimap", "setIncludeMinimap", "includeTracks", "setIncludeTracks", "exportType", "setExportType", "error", "setError", "exporting", "setExporting", "theme", "totalWidth", "totalHeight", "effectiveTreeAreaWidth", "rowPanelsWidth", "turnedOnTracks", "totalTrackAreaHeight", "numColumns", "leaves", "showMsaLetters", "treeOverviewHeight", "hasTracks", "entireWidth", "entireHeight", "glyphs", "isLargeExport", "React", "Checkbox2", "event", "value", "e", "ExportSVGDialog_default"]
7
- }
@@ -1,2 +0,0 @@
1
- import{a as b,c as k,d as C}from"./chunk-ZCT7RD24.js";import{e as M}from"./chunk-NMYD2GWF.js";import"./chunk-F3EC6OCO.js";import"./chunk-FCWXYIFC.js";import{a as B}from"./chunk-6YFCSBEE.js";import"./chunk-F726IWCW.js";import"./chunk-YUKJI2AH.js";import"./chunk-QQ5LZUIO.js";import{a as L}from"./chunk-NSASZ5FM.js";import"./chunk-IBBQUV2I.js";import"./chunk-QUWPHTZQ.js";import"./chunk-73KAPCJ2.js";import"./chunk-GIHMPOCO.js";import{a as y}from"./chunk-CVLB4VFP.js";import{a as P}from"./chunk-DNFD5II2.js";import{a as w}from"./chunk-BX4Z274Q.js";import{a as h}from"./chunk-J6KYLXRD.js";import{b as i}from"./chunk-FY3BTKY4.js";var e=i(h()),z=i(P()),E=i(y());var I=i(L());var o=i(h()),d=i(P()),n=i(w()),S=i(y()),x=i(L());var c=i(h()),J=i(w());function N({jobId:s}){let r=C(s)?k(s):b(s);return c.default.createElement(J.Typography,null,"Job ",s," (",c.default.createElement(B,{href:r},"see status"),")")}var v=N;var U=(0,x.makeStyles)()({margin:{padding:20},progressRow:{display:"flex",alignItems:"center",gap:12}}),D=(0,S.observer)(function({model:r}){let{progress:u,rid:a,error:m}=r,{classes:t}=U(),f=!r.launchCompleted,{blastParams:l,orthologParams:g}=r,p=l?`Running EBI ${l.searchProgram==="phmmer"?"phmmer":"BLAST"}`:g?g.source==="uniref"?"Building UniRef homolog alignment":"Building ortholog alignment":"Loading alignment";return o.default.createElement("div",{className:t.margin},m?o.default.createElement(o.default.Fragment,null,o.default.createElement(n.Typography,{variant:"h5"},f?`${p} failed`:"Alignment no longer available"),a?o.default.createElement(v,{jobId:a}):null,o.default.createElement(d.ErrorMessage,{error:m}),o.default.createElement("div",{className:t.progressRow},o.default.createElement(n.Button,{variant:"outlined",size:"small",onClick:()=>{r.retryLaunch()}},"Retry"),o.default.createElement(n.Button,{variant:"outlined",size:"small",onClick:()=>{r.cancelLaunch()}},"Dismiss"))):o.default.createElement(o.default.Fragment,null,o.default.createElement(d.LoadingEllipses,{message:p,variant:"h5"}),a?o.default.createElement(v,{jobId:a}):null,o.default.createElement("div",{className:t.progressRow},o.default.createElement(n.Typography,null,u||"Initializing"),o.default.createElement(n.Button,{variant:"outlined",size:"small",onClick:()=>{r.cancelLaunch()}},"Cancel"))))}),V=D;var $=(0,I.makeStyles)()({loadingContainer:{padding:20}}),q=(0,E.observer)(function({model:r}){let{classes:u}=$(),{blastParams:a,orthologParams:m,init:t,loadingStoredData:f}=r,l=a??m,g=!!l&&!r.launchCompleted,p=!!(r.data.msa||r.data.tree),T=!!l&&!!r.error&&!p,A=g||T||!!t&&!r.dataInitialized;return e.default.createElement("div",null,A?e.default.createElement(V,{model:r}):f&&!r.dataInitialized?e.default.createElement("div",{className:u.loadingContainer},e.default.createElement(z.LoadingEllipses,{message:"Loading MSA data",variant:"h6"})):e.default.createElement(M,{model:r}))}),X=q;export{X as default};
2
- //# sourceMappingURL=MsaViewPanel-RUZAKFCB.js.map