jbrowse-plugin-msaview 5.4.0 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MsaViewPanel/afterCreateAutoruns.d.ts +1 -0
- package/dist/MsaViewPanel/afterCreateAutoruns.js +8 -0
- package/dist/MsaViewPanel/connectedDomains.d.ts +58 -0
- package/dist/MsaViewPanel/connectedDomains.js +101 -0
- package/dist/MsaViewPanel/connectedDomains.test.d.ts +1 -0
- package/dist/MsaViewPanel/connectedDomains.test.js +147 -0
- package/dist/MsaViewPanel/domainTrack.d.ts +84 -0
- package/dist/MsaViewPanel/domainTrack.js +51 -0
- package/dist/MsaViewPanel/domainTrack.test.d.ts +1 -0
- package/dist/MsaViewPanel/domainTrack.test.js +69 -0
- package/dist/MsaViewPanel/loadProteinDomains.js +2 -1
- package/dist/MsaViewPanel/loadProteinDomains.test.js +2 -0
- package/dist/MsaViewPanel/model.d.ts +22 -2
- package/dist/MsaViewPanel/model.js +71 -2
- package/dist/MsaViewPanel/model.test.js +94 -0
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.d.ts +11 -3
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js +21 -14
- package/dist/chunks/{LaunchMsaViewDialog-HGL6P4E4.js → LaunchMsaViewDialog-BG4MX2BW.js} +2 -2
- package/dist/chunks/{chunk-2XCUSA22.js → chunk-4TEPHD3L.js} +2 -2
- package/dist/chunks/{chunk-2XCUSA22.js.map → chunk-4TEPHD3L.js.map} +2 -2
- package/dist/chunks/model-SEEQQSQO.js +12 -0
- package/dist/chunks/model-SEEQQSQO.js.map +7 -0
- package/dist/jbrowse-plugin-msaview.esm.js +2 -2
- package/dist/jbrowse-plugin-msaview.esm.js.map +2 -2
- package/dist/utils/domainCache.js +24 -2
- package/dist/utils/ncbiDomains.d.ts +4 -1
- package/dist/utils/ncbiDomains.js +16 -25
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/LaunchMsaViewExtensionPoint/index.ts +5 -0
- package/src/MsaViewPanel/afterCreateAutoruns.ts +11 -0
- package/src/MsaViewPanel/connectedDomains.test.ts +196 -0
- package/src/MsaViewPanel/connectedDomains.ts +151 -0
- package/src/MsaViewPanel/domainTrack.test.ts +75 -0
- package/src/MsaViewPanel/domainTrack.ts +66 -0
- package/src/MsaViewPanel/loadProteinDomains.test.ts +2 -0
- package/src/MsaViewPanel/loadProteinDomains.ts +13 -11
- package/src/MsaViewPanel/model.test.ts +100 -0
- package/src/MsaViewPanel/model.ts +82 -1
- package/src/MsaViewPanel/msaCoordToGenomeCoord.ts +37 -25
- package/src/utils/domainCache.ts +27 -2
- package/src/utils/ncbiDomains.ts +20 -27
- package/src/version.ts +1 -1
- package/dist/chunks/model-36HCIOZJ.js +0 -12
- package/dist/chunks/model-36HCIOZJ.js.map +0 -7
- /package/dist/chunks/{LaunchMsaViewDialog-HGL6P4E4.js.map → LaunchMsaViewDialog-BG4MX2BW.js.map} +0 -0
|
@@ -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-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-
|
|
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-
|
|
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-BG4MX2BW.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-SEEQQSQO.js").then(t=>t.default()),ReactComponent:je}))}var pe="5.6.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
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
|
-
"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,EAAUC,EAEY,CACpC,OAAOA,EAAK,OAAS,SACvB,CCNA,IAAAC,EAAkB,OAElBC,EAAyB,OCFzB,IAAAC,EAAkB,OAElBC,EAA2B,OAC3BC,EAAyB,OCHzB,IAAAC,EAA2B,QAIdC,KAAY,cAAW,EAAE,CACpC,UA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AEO,SAASC,GAAiBC,EAA2B,CAC1D,OAAOA,EAAW,MAAOV,GAAuB,CAC9C,IAAMW,EAAwBX,EAAK,iBACnC,MAAO,CACL,kBAAmB,CACjB,IAAMC,EAASW,GAAaZ,CAAI,EAChC,MAAO,CAGL,GAAGW,EAAsB,KAAKX,CAAI,EAClC,GAAIC,EACA,CACE,CACE,MAAO,kBACP,KAAMY,GACN,QAAS,IAAM,CACbd,GAAWC,EAAMC,CAAM,CACzB,CACF,CACF,EACA,CAAC,CACP,CACF,CACF,CACF,CAAC,CACH,CAEe,SAARa,EAAgCC,EAA8B,CACnEA,EAAc,oBACZ,8BACCnB,IACKD,GAAUC,CAAG,IACfA,EAAI,WAAaa,GAAiBb,EAAI,UAAU,GAE3CA,EAEX,CACF,
|
|
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 /**\n * Add the query row's domains to the connected genome view as a track, once\n * they have loaded\n */\n domainsOnGenome?: boolean\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.6.0'\n"],
|
|
5
|
+
"mappings": "scAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,CAAAA,EAAO,QAAU,eAAe,sBAAsB,ICAtD,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAU,eAA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B,KAAM,UAGN,WAAY,IAAM,OAAO,4BAAS,EAAE,KAAKC,GAAKA,EAAE,QAAQ,CAAC,EACzD,eAAgBJ,EAClB,CAAC,CACF,CACH,CClBO,IAAMK,GAAU,QjBiBvB,IAAqBC,EAArB,cAA2C,GAAAC,OAAO,CAAlD,kCACE,UAAO,gBACP,aAAUC,GAoCV,6BAA2BC,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
|
}
|
|
@@ -1,12 +1,34 @@
|
|
|
1
|
+
import { deleteDB } from 'idb';
|
|
1
2
|
import { bestEffort, createDbOpener } from './idb';
|
|
2
|
-
|
|
3
|
+
// v2: a site's locations are its residues, where v1 stored one bounding span.
|
|
4
|
+
// v3: each match keeps its GenPept key, Region or Site, which a v2 entry lacks
|
|
5
|
+
// and which would otherwise class every cached site as a domain for good.
|
|
6
|
+
// A new name rather than a new version, so an older tab still open keeps its
|
|
7
|
+
// own database instead of blocking the upgrade.
|
|
8
|
+
const DB_NAME = 'jbrowse-msaview-domain-cache-v3';
|
|
9
|
+
const RETIRED_DB_NAMES = [
|
|
10
|
+
'jbrowse-msaview-domain-cache',
|
|
11
|
+
'jbrowse-msaview-domain-cache-v2',
|
|
12
|
+
];
|
|
3
13
|
const STORE_NAME = 'domains';
|
|
4
14
|
const DB_VERSION = 1;
|
|
5
|
-
const
|
|
15
|
+
const openDB = createDbOpener(DB_NAME, DB_VERSION, db => {
|
|
6
16
|
if (!db.objectStoreNames.contains(STORE_NAME)) {
|
|
7
17
|
db.createObjectStore(STORE_NAME, { keyPath: 'accession' });
|
|
8
18
|
}
|
|
9
19
|
});
|
|
20
|
+
let retiredDropped = false;
|
|
21
|
+
function getDB() {
|
|
22
|
+
if (!retiredDropped) {
|
|
23
|
+
retiredDropped = true;
|
|
24
|
+
for (const name of RETIRED_DB_NAMES) {
|
|
25
|
+
Promise.resolve()
|
|
26
|
+
.then(() => deleteDB(name))
|
|
27
|
+
.catch(() => { });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return openDB();
|
|
31
|
+
}
|
|
10
32
|
export function getCachedDomains(accessions) {
|
|
11
33
|
return bestEffort('domain cache read', async () => {
|
|
12
34
|
const db = await getDB();
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { InterProScanResults } from 'react-msaview';
|
|
2
|
-
|
|
2
|
+
/** a CDD match, under the GenPept feature key it came from */
|
|
3
|
+
export type DomainMatch = InterProScanResults['matches'][number] & {
|
|
4
|
+
featureType: 'Region' | 'Site';
|
|
5
|
+
};
|
|
3
6
|
/**
|
|
4
7
|
* Parse a GenPept (efetch db=protein&rettype=gp&retmode=xml) document into CDD
|
|
5
8
|
* domain and site annotations, keyed by both the versioned and primary
|
|
@@ -19,14 +19,12 @@ function parseQualifiers(featureXml) {
|
|
|
19
19
|
}
|
|
20
20
|
return quals;
|
|
21
21
|
}
|
|
22
|
-
// A
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const starts = [];
|
|
29
|
-
const ends = [];
|
|
22
|
+
// A domain is usually one GBInterval range, while a CDD Site is a set of
|
|
23
|
+
// scattered residues: several ranges plus single GBInterval_point residues.
|
|
24
|
+
// Each becomes its own location, 1-based inclusive, so a site draws on the
|
|
25
|
+
// residues it names.
|
|
26
|
+
function parseLocations(featureXml) {
|
|
27
|
+
const locations = [];
|
|
30
28
|
const re = /<GBInterval>([\s\S]*?)<\/GBInterval>/g;
|
|
31
29
|
let m;
|
|
32
30
|
while ((m = re.exec(featureXml)) !== null) {
|
|
@@ -35,34 +33,26 @@ function parseBoundingSpan(featureXml) {
|
|
|
35
33
|
const to = field(block, 'GBInterval_to');
|
|
36
34
|
const point = field(block, 'GBInterval_point');
|
|
37
35
|
if (from && to) {
|
|
38
|
-
|
|
39
|
-
ends.push(Number(to));
|
|
36
|
+
locations.push({ start: Number(from), end: Number(to) });
|
|
40
37
|
}
|
|
41
38
|
else if (point) {
|
|
42
|
-
|
|
43
|
-
ends.push(Number(point));
|
|
39
|
+
locations.push({ start: Number(point), end: Number(point) });
|
|
44
40
|
}
|
|
45
41
|
}
|
|
46
|
-
return
|
|
47
|
-
? { start: Math.min(...starts), end: Math.max(...ends) }
|
|
48
|
-
: undefined;
|
|
42
|
+
return locations;
|
|
49
43
|
}
|
|
50
|
-
// Drop single-residue specks (acetylation/phospho points) but keep every
|
|
51
|
-
// genuine domain and functional site; react-msaview draws longest-first, so
|
|
52
|
-
// smaller features (binding sites, loops) layer on top of the domain they sit
|
|
53
|
-
// inside.
|
|
54
|
-
const MIN_FEATURE_LENGTH = 2;
|
|
55
44
|
function parseFeature(featureXml) {
|
|
56
45
|
const key = field(featureXml, 'GBFeature_key');
|
|
57
46
|
const quals = parseQualifiers(featureXml);
|
|
58
47
|
const xref = quals.db_xref;
|
|
59
|
-
const
|
|
48
|
+
const locations = parseLocations(featureXml);
|
|
60
49
|
// only CDD-backed Regions/Sites are conserved-domain annotations; Regions and
|
|
61
|
-
// Sites without a CDD xref are UniProt-propagated point motifs we don't want
|
|
50
|
+
// Sites without a CDD xref are UniProt-propagated point motifs we don't want.
|
|
51
|
+
// A CDD site's single residues (a heme-binding histidine) are real, so no
|
|
52
|
+
// length rule drops them.
|
|
62
53
|
if ((key === 'Region' || key === 'Site') &&
|
|
63
54
|
xref?.startsWith('CDD:') &&
|
|
64
|
-
|
|
65
|
-
span.end - span.start + 1 >= MIN_FEATURE_LENGTH) {
|
|
55
|
+
locations.length > 0) {
|
|
66
56
|
const cddId = xref.replace('CDD:', '');
|
|
67
57
|
const isDomain = key === 'Region';
|
|
68
58
|
// a site's note (e.g. "ATP binding site [chemical binding]") is more
|
|
@@ -77,7 +67,8 @@ function parseFeature(featureXml) {
|
|
|
77
67
|
signature: {
|
|
78
68
|
entry: { name, description: quals.note ?? name, accession },
|
|
79
69
|
},
|
|
80
|
-
locations
|
|
70
|
+
locations,
|
|
71
|
+
featureType: key,
|
|
81
72
|
};
|
|
82
73
|
}
|
|
83
74
|
return undefined;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.
|
|
1
|
+
export declare const version = "5.6.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.
|
|
1
|
+
export const version = '5.6.0';
|
package/package.json
CHANGED
|
@@ -39,6 +39,11 @@ interface LaunchMsaViewArgs {
|
|
|
39
39
|
* no `proteinSequence` of its own.
|
|
40
40
|
*/
|
|
41
41
|
connectedTranscript?: string
|
|
42
|
+
/**
|
|
43
|
+
* Add the query row's domains to the connected genome view as a track, once
|
|
44
|
+
* they have loaded
|
|
45
|
+
*/
|
|
46
|
+
domainsOnGenome?: boolean
|
|
42
47
|
displayName?: string
|
|
43
48
|
colorSchemeName?: string
|
|
44
49
|
colWidth?: number
|
|
@@ -469,3 +469,14 @@ export function runCleanup() {
|
|
|
469
469
|
console.error('Failed to cleanup old MSA data:', e)
|
|
470
470
|
})
|
|
471
471
|
}
|
|
472
|
+
|
|
473
|
+
export function showDomainsOnGenomeIfAsked(self: JBrowsePluginMsaViewModel) {
|
|
474
|
+
if (
|
|
475
|
+
self.domainsOnGenome &&
|
|
476
|
+
self.connectedView &&
|
|
477
|
+
self.connectedDomains.features.length > 0
|
|
478
|
+
) {
|
|
479
|
+
self.showDomainsOnGenome()
|
|
480
|
+
self.setDomainsOnGenome(false)
|
|
481
|
+
}
|
|
482
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { genomeToTranscriptSeqMapping } from 'g2p_mapper'
|
|
2
|
+
import { describe, expect, test } from 'vitest'
|
|
3
|
+
|
|
4
|
+
import { annotationKind, connectedDomains } from './connectedDomains'
|
|
5
|
+
|
|
6
|
+
import type { DomainSource } from './connectedDomains'
|
|
7
|
+
import type { Annotation } from 'react-msaview'
|
|
8
|
+
|
|
9
|
+
// five codons read from 207 down: 207-205, 204-202, 201-200 then 106 across
|
|
10
|
+
// the intron, 105-103, 102-100
|
|
11
|
+
const reverseTranscript = genomeToTranscriptSeqMapping({
|
|
12
|
+
refName: 'chr1',
|
|
13
|
+
strand: -1,
|
|
14
|
+
start: 100,
|
|
15
|
+
end: 208,
|
|
16
|
+
subfeatures: [
|
|
17
|
+
{ refName: 'chr1', type: 'CDS', start: 100, end: 107, phase: 0 },
|
|
18
|
+
{ refName: 'chr1', type: 'CDS', start: 200, end: 208, phase: 0 },
|
|
19
|
+
],
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
function annotation(
|
|
23
|
+
accession: string,
|
|
24
|
+
start: number,
|
|
25
|
+
end: number,
|
|
26
|
+
id = 'QUERY',
|
|
27
|
+
): Annotation {
|
|
28
|
+
return {
|
|
29
|
+
id,
|
|
30
|
+
accession,
|
|
31
|
+
name: `name ${accession}`,
|
|
32
|
+
description: '',
|
|
33
|
+
start,
|
|
34
|
+
end,
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function source(
|
|
39
|
+
annotations: Annotation[],
|
|
40
|
+
overrides: Partial<DomainSource> = {},
|
|
41
|
+
): DomainSource {
|
|
42
|
+
return {
|
|
43
|
+
showDomains: true,
|
|
44
|
+
querySeqName: 'QUERY',
|
|
45
|
+
transcriptToMsaMap: reverseTranscript,
|
|
46
|
+
annotationsByRow: Object.groupBy(annotations, a => a.id) as Record<
|
|
47
|
+
string,
|
|
48
|
+
Annotation[]
|
|
49
|
+
>,
|
|
50
|
+
annotationTypes: new Map(
|
|
51
|
+
annotations.map(a => [
|
|
52
|
+
a.accession,
|
|
53
|
+
{ ...a, name: `legend ${a.accession}` },
|
|
54
|
+
]),
|
|
55
|
+
),
|
|
56
|
+
featureColors: new Map(
|
|
57
|
+
annotations.map(a => [a, { fill: `fill-${a.accession}` }]),
|
|
58
|
+
),
|
|
59
|
+
...overrides,
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
describe('connectedDomains on a reverse-strand transcript', () => {
|
|
64
|
+
test('a domain crossing the exon boundary is one region per exon piece', () => {
|
|
65
|
+
expect(connectedDomains(source([annotation('site', 2, 4)]))).toEqual({
|
|
66
|
+
features: [
|
|
67
|
+
{
|
|
68
|
+
name: 'legend site',
|
|
69
|
+
accession: 'site',
|
|
70
|
+
kind: 'domain',
|
|
71
|
+
regions: [
|
|
72
|
+
{ refName: 'chr1', start: 103, end: 107 },
|
|
73
|
+
{ refName: 'chr1', start: 200, end: 205 },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
color: {
|
|
78
|
+
field: 'accession',
|
|
79
|
+
domain: ['site'],
|
|
80
|
+
range: ['fill-site'],
|
|
81
|
+
labels: ['legend site'],
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
test('the longest comes first, in the features and the color domain alike', () => {
|
|
87
|
+
const { features, color } = connectedDomains(
|
|
88
|
+
source([annotation('site', 2, 4), annotation('domain', 1, 5)]),
|
|
89
|
+
)
|
|
90
|
+
expect(features.map(d => d.accession)).toEqual(['domain', 'site'])
|
|
91
|
+
expect(color.domain).toEqual(['domain', 'site'])
|
|
92
|
+
expect(color.range).toEqual(['fill-domain', 'fill-site'])
|
|
93
|
+
expect(features[0]!.regions).toEqual([
|
|
94
|
+
{ refName: 'chr1', start: 100, end: 107 },
|
|
95
|
+
{ refName: 'chr1', start: 200, end: 208 },
|
|
96
|
+
])
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
test('a scattered site is one entry, its residues merged where they touch', () => {
|
|
100
|
+
const { features } = connectedDomains(
|
|
101
|
+
source([
|
|
102
|
+
annotation('small', 4, 5),
|
|
103
|
+
annotation('heme', 1, 1),
|
|
104
|
+
annotation('heme', 3, 3),
|
|
105
|
+
annotation('heme', 4, 4),
|
|
106
|
+
]),
|
|
107
|
+
)
|
|
108
|
+
expect(features.map(d => d.accession)).toEqual(['heme', 'small'])
|
|
109
|
+
expect(features[0]).toEqual({
|
|
110
|
+
name: 'legend heme',
|
|
111
|
+
accession: 'heme',
|
|
112
|
+
kind: 'domain',
|
|
113
|
+
regions: [
|
|
114
|
+
{ refName: 'chr1', start: 103, end: 107 },
|
|
115
|
+
{ refName: 'chr1', start: 200, end: 202 },
|
|
116
|
+
{ refName: 'chr1', start: 205, end: 208 },
|
|
117
|
+
],
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
test('a trimmed query row shifts by querySeqOffset', () => {
|
|
122
|
+
const [domain] = connectedDomains(
|
|
123
|
+
source([annotation('site', 1, 2)], { querySeqOffset: 1 }),
|
|
124
|
+
).features
|
|
125
|
+
expect(domain!.regions).toEqual([
|
|
126
|
+
{ refName: 'chr1', start: 106, end: 107 },
|
|
127
|
+
{ refName: 'chr1', start: 200, end: 205 },
|
|
128
|
+
])
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
test('residues past the transcript drop out, and a domain with none left', () => {
|
|
132
|
+
expect(
|
|
133
|
+
connectedDomains(
|
|
134
|
+
source([annotation('tail', 5, 9), annotation('off', 7, 9)]),
|
|
135
|
+
).features,
|
|
136
|
+
).toEqual([
|
|
137
|
+
expect.objectContaining({
|
|
138
|
+
accession: 'tail',
|
|
139
|
+
regions: [{ refName: 'chr1', start: 100, end: 103 }],
|
|
140
|
+
}),
|
|
141
|
+
])
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
test('only the query row, and nothing while the overlay is off', () => {
|
|
145
|
+
const annotations = [annotation('other', 1, 5, 'Mouse')]
|
|
146
|
+
expect(connectedDomains(source(annotations)).features).toEqual([])
|
|
147
|
+
expect(
|
|
148
|
+
connectedDomains(
|
|
149
|
+
source([annotation('domain', 1, 5)], { showDomains: false }),
|
|
150
|
+
),
|
|
151
|
+
).toEqual({
|
|
152
|
+
features: [],
|
|
153
|
+
color: { field: 'accession', domain: [], range: [], labels: [] },
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
test('a MAF row maps one base per residue', () => {
|
|
159
|
+
const [domain] = connectedDomains(
|
|
160
|
+
source([annotation('d', 3, 6)], {
|
|
161
|
+
transcriptToMsaMap: undefined,
|
|
162
|
+
mafRegion: { refName: 'chr2', start: 50, end: 100, assemblyName: 'hg38' },
|
|
163
|
+
}),
|
|
164
|
+
).features
|
|
165
|
+
expect(domain!.regions).toEqual([{ refName: 'chr2', start: 52, end: 56 }])
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
test('an entry is a site when its featureType names one', () => {
|
|
169
|
+
const { features } = connectedDomains(
|
|
170
|
+
source([
|
|
171
|
+
{ ...annotation('heme', 2, 2), featureType: 'Site' },
|
|
172
|
+
{ ...annotation('globin', 1, 5), featureType: 'Region' },
|
|
173
|
+
annotation('gff', 1, 4),
|
|
174
|
+
]),
|
|
175
|
+
)
|
|
176
|
+
expect(features.map(d => [d.accession, d.kind])).toEqual([
|
|
177
|
+
['globin', 'domain'],
|
|
178
|
+
['gff', 'domain'],
|
|
179
|
+
['heme', 'site'],
|
|
180
|
+
])
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
test.each([
|
|
184
|
+
['Site', 'site'],
|
|
185
|
+
['binding_site', 'site'],
|
|
186
|
+
['Active_site', 'site'],
|
|
187
|
+
['Conserved_site', 'site'],
|
|
188
|
+
['Binding site', 'site'],
|
|
189
|
+
['Region', 'domain'],
|
|
190
|
+
['protein_match', 'domain'],
|
|
191
|
+
['Domain', 'domain'],
|
|
192
|
+
['siteless', 'domain'],
|
|
193
|
+
[undefined, 'domain'],
|
|
194
|
+
])('annotationKind(%s) is %s', (featureType, kind) => {
|
|
195
|
+
expect(annotationKind(featureType)).toBe(kind)
|
|
196
|
+
})
|