jbrowse-plugin-graphgenomeviewer 10.16.0 → 10.17.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/jbrowse-plugin-graphgenomeviewer.esm.js +1 -1
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +3 -3
- package/package.json +1 -1
- package/src/RgfaTabixAdapter/index.ts +9 -3
- package/src/WalkFormsAdapter/index.ts +9 -3
- package/src/WalkTabixSyntenyAdapter/index.ts +9 -3
- package/src/graphTrackDefaults/graphTrackDefaults.test.ts +20 -0
- package/src/version.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ee,b as ve,c as z,d as ot,e as nt,f as at}from"./chunks/chunk-OCCKXMPY.js";import"./chunks/chunk-IK5G3JHR.js";import{L as Ze,M as Qe,N as ee,Q as et,V as tt,W as te,d as V,h as Ke,i as Ye,q as m,s as Xe,v as Z,y as qe}from"./chunks/chunk-N4GLRGE7.js";import"./chunks/chunk-LNLF6ZIC.js";import{b as d,g as N,h as Ue,q as rt}from"./chunks/chunk-6G3NIOBS.js";import{Ia as j,Ja as Je,Ka as u,fb as q,g as Re,gb as v,i as M,j as P,k as Pe,l as Ne,m as Ve,n as je,ob as $e,p as _e}from"./chunks/chunk-PPCYV2PD.js";import"./chunks/chunk-52JB4KFJ.js";import"./chunks/chunk-65E2XCMW.js";import"./chunks/chunk-CWMXEILJ.js";import"./chunks/chunk-X4SAD7QA.js";import{a as Q,d as _}from"./chunks/chunk-ZQOMV674.js";import{a as A,b as C,c as Be,d as oe,e as it,f as H,g as st}from"./chunks/chunk-ZVMXECJA.js";import"./chunks/chunk-JM4W4PKP.js";import"./chunks/chunk-4CJUQYP2.js";import"./chunks/chunk-MPT3MHRY.js";import"./chunks/chunk-YBLNN5FU.js";import"./chunks/chunk-3TVYWWUY.js";import"./chunks/chunk-H5TOX62G.js";import"./chunks/chunk-MDCAIQ72.js";import{b as ze,g as He}from"./chunks/chunk-YROUE32O.js";import{a as De,c as We,h as Oe}from"./chunks/chunk-D3QZGLZ3.js";import{d as $,e as a}from"./chunks/chunk-WKD7ALOU.js";import{a as Ce}from"./chunks/chunk-TMM73K4C.js";import"./chunks/chunk-D6TY2QEG.js";import"./chunks/chunk-YBLNN5FU.js";import{b as K,c as x,d as Fe,g as B,h as Y,i as Ie}from"./chunks/chunk-EGZZ3ADM.js";import"./chunks/chunk-DNWOVS3L.js";import{f as Ae,g as Se,j as f,k as Le,m as Ge}from"./chunks/chunk-5L276I7O.js";import{c as S}from"./chunks/chunk-PCP5Y77D.js";import{J as R}from"./chunks/chunk-H42TSPVA.js";import{a as Me,b as T,d as X}from"./chunks/chunk-DUU6T2I5.js";var D=JBrowseExports["@jbrowse/core/Plugin"];var pt=D&&D.__esModule?D.default:D;var W=JBrowseExports["@jbrowse/core/pluggableElementTypes/AdapterType"];var g=W&&W.__esModule?W.default:W;var p=e=>({type:"fileLocation",defaultValue:{uri:e,locationType:"UriLocation"}}),l=(e,t="")=>d(e,{indexType:{model:a.enumeration("IndexType",["TBI","CSI"]),type:"stringEnum",defaultValue:"TBI"},location:p(t)});function L(e,t,o){return{indexType:o?"CSI":"TBI",location:{uri:`${e}.${o?"csi":"tbi"}`,baseUri:t}}}function G(e){let{walksUri:t,baseUri:o}=e;if(typeof t!="string")return e;let r=`${t}${x}`;return{...e,walksLocation:{uri:r,baseUri:o},walksIndex:{uri:`${r}.idx`,baseUri:o}}}var jt=d("GbzBaseSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},gbzDbLocation:p("/path/to/graph.gbz.db"),haplotypeIndexLocation:p(""),readsLocation:p(""),readsIndex:l("GbzBaseReadsIndex"),samplesTsvLocation:p(""),subgraphSnarls:{type:"stringEnum",model:a.enumeration("SnarlOutput",["none","contained","overlapping"]),defaultValue:C.snarls},referenceSample:{type:"string",defaultValue:""},assemblyNameToPanSN:{type:"frozen",defaultValue:{}},context:{type:"number",defaultValue:C.context,advanced:!0},nodeLimit:{type:"number",defaultValue:C.limit,advanced:!0}},{explicitlyTyped:!0,preProcessSnapshot:e=>{let{uri:t,baseUri:o,reads:r}=e;return{...e,...t?{gbzDbLocation:{uri:t,baseUri:o}}:{},...typeof r=="string"?{readsLocation:{uri:r,baseUri:o},...vt(r,o)}:{}}}});function vt(e,t){let{name:o,query:r}=B(e);return o.endsWith(".gz")?{readsIndex:{location:{uri:`${o}.tbi${r}`,baseUri:t}}}:{}}var dt=jt;function re(e){e.addAdapterType(()=>new g({name:"GbzBaseSyntenyAdapter",displayName:"gbz-base pangenome adapter",configSchema:dt,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:{category:"Synteny adapters"},getAdapterClass:()=>import("./chunks/GbzBaseSyntenyAdapter-PCORPW6Y.js").then(t=>t.default)}))}var E=class extends P{constructor(){super(...arguments);this.name="GetGraphHaplotypes"}async execute(o){let{adapter:r}=await je(this.pluginManager,o,"getHaplotypeNames");return r?.getHaplotypeNames({signal:o.signal})}};var _t=S(()=>import("./chunks/AddTrackWorkflow-4JWCC3U4.js"));function ne(e){e.addAddTrackWorkflowType(()=>new Re({name:"Pangenome graph track",displayName:"Add pangenome graph track",ReactComponent:_t,stateModel:a.model({})}))}var F=class extends P{constructor(){super(...arguments);this.name="GraphComputeLayout"}async execute(o){let{graph:r,options:n,signal:s,statusCallback:i}=o;return await new Promise(c=>setTimeout(c,0)),s?.throwIfAborted(),i?.("Computing layout"),Ue({graph:r,options:n})}};var O=JBrowseExports["@jbrowse/core/pluggableElementTypes/ViewType"];var ct=O&&O.__esModule?O.default:O;var h=JBrowseExports["@jbrowse/core/util/withLaunchInput"],zt=e=>h!=null&&e in Object(h)?h[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/util/withLaunchInput' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),mt=zt("defineLaunchKeys");var Oo=h&&h.__esModule?h.default:h;var y=JBrowseExports["@jbrowse/core/pluggableElementTypes/models"],Ht=e=>y!=null&&e in Object(y)?y[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/pluggableElementTypes/models' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var lt=Ht("BaseViewModel");var Jo=y&&y.__esModule?y.default:y;function ae(){return a.compose("GraphGenomeView",lt,ot,a.model({type:a.literal("GraphGenomeView"),gfaLocation:a.maybe(a.frozen()),loadedRegion:a.maybe(a.frozen()),loadedTrackId:a.optional(a.string,""),layoutMode:j(V),layoutEngine:Je(N,"fmmm"),color:a.maybe(a.frozen()),size:a.maybe(a.frozen()),layers:a.maybe(a.frozen()),facet:a.maybe(a.frozen()),rows:a.maybe(a.frozen()),hover:j(z),links:j(_),walks:a.maybe(a.frozen())})).views(e=>({get grammar(){return{layoutMode:e.layoutMode,layoutEngine:e.layoutEngine,encoding:{color:e.color},size:e.size,layers:e.layers,facet:e.facet,rows:e.rows,hover:e.hover,links:e.links,walks:e.walks}}})).actions(e=>({writeGrammar({encoding:t,...o}){Object.assign(e,t?{...o,color:t.color}:o)}})).volatile(()=>({widthMeasured:!1})).actions(e=>{let t=e.setWidth;return{setWidth(o){t(o),e.widthMeasured=!0}}}).views(e=>({get rpcSessionId(){return e.id},get paneWidth(){return e.width},get paneMeasured(){return e.widthMeasured},get sourceTrack(){return e.loadedTrackId?e.sessionTrack(e.loadedTrackId):void 0},get graphTracks(){return at(f(e).tracks)},get canRetryLoad(){return e.gfaLocation!==void 0||e.loadedTrackId!==""&&e.loadedRegion!==void 0}})).views(e=>({get hasPendingSource(){return e.canRetryLoad&&!e.graph&&!e.loadCanceled},menuItems(){return[...e.exportMenuItems(),...e.launchMenuItems()]}})).actions(e=>{let t=e.clearGraph;function o(r){if(e.gfaLocation)return e.displayName||e.setDisplayName(v(e.gfaLocation)),e.loadGFAFromLocation(e.gfaLocation,r);if(!e.loadedTrackId||!r)return;let n=e.sourceAdapter,s=r.end-r.start,i=e.offReference(r);if(!n)e.setError(new Error(`The track this graph was cut from, "${e.loadedTrackId}", is not in this session`));else if(i)e.setError(new Error(i));else if(s>e.maxRegionBp)e.setError(new Error(`Region too large (${q(s)}) \u2014 zoom in to view graph (max ${q(e.maxRegionBp)})`));else return e.markCut(),e.cutSubgraph(n,r,e.cutOptions)}return{clearGraph(){t(),e.gfaLocation&&e.displayName===v(e.gfaLocation)&&(e.displayName=void 0),e.gfaLocation=void 0,e.loadedRegion=void 0,e.loadedTrackId=""},load(){let r=e.loadedRegion,n=f(e),{assemblyManager:s}=n,i=r&&s.has(r.assemblyName)?s.get(r.assemblyName):void 0;return r&&i?.initialized===!1?s.waitForAssembly(r.assemblyName).catch(()=>{}).then(()=>$(e)&&e.loadedRegion===r?o(Z(n,r)):void 0):o(r&&Z(n,r))}}}).actions(e=>({retryLoad(){e.load()},setGfaLocation(t){e.gfaLocation=t},relayoutFrom(t){return e.loadedTrackId&&e.cutStale?e.load():e.recomputeLayout()},async openGfaLocation(t){await e.loadGFAFromLocation(t),$(e)&&e.hasGraph&&(this.setGfaLocation(t),e.displayName||e.setDisplayName(v(t)))},showTrackInLinearView(t,o,r){let n=f(e);qe({session:n,trackId:t,assembly:o,loc:r}),Ge(n)&&n.removeView(e)},afterAttach(){e.graph||e.load()}}))}var Dt=mt()({});function ie(e){e.addViewType(()=>new ct({name:"GraphGenomeView",displayName:"Graph genome view",stateModel:ae(),launchKeys:Dt,ReactComponent:S(()=>import("./chunks/GraphGenomeView-EPONVTPK.js"))}))}var se=["MultiWaySyntenyDisplay","LinearSyntenyDisplay","DotplotDisplay","ChordSyntenyDisplay"];function Wt(e){let t=e.getElementTypesInGroup("display"),o=n=>t.find(s=>s.name===n),r=(n,s)=>s&&Object.assign(Object.create(s),{adapterCapabilities:[n]});return[o("LinearGraphDisplay"),r("referenceSegments",o("LinearBasicDisplay")),...se.map(n=>r("headerLanes",o(n)))].filter(n=>n!==void 0)}function pe(e){e.addTrackType(()=>{let t=d("GraphTrack",{},{baseConfiguration:Ne(e),explicitIdentifier:"trackId"}),o=new Pe({name:"GraphTrack",displayName:"Pangenome graph track",configSchema:t,stateModel:Ve(e,"GraphTrack",t)});for(let r of Wt(e))o.addDisplayType(r);return o})}function de(e){e.addToExtensionPoint("LaunchView-GraphGenomeView",t=>{let{session:o,...r}=t;return o.addView("GraphGenomeView",r),t})}var U=JBrowseExports["@jbrowse/core/pluggableElementTypes/DisplayType"];var ut=U&&U.__esModule?U.default:U;var b=JBrowseExports["@jbrowse/display-kit/heightModeConfigSchemaFields"],Ot=e=>b!=null&&e in Object(b)?b[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/heightModeConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),gt=Ot("heightModeConfigSchemaFields"),hr=b&&b.__esModule?b.default:b;var w=JBrowseExports["@jbrowse/display-kit/trackHeightConfigSchemaFields"],Ut=e=>w!=null&&e in Object(w)?w[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/trackHeightConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),ft=Ut("trackHeightConfigSchemaFields"),br=w&&w.__esModule?w.default:w;var k=JBrowseExports["@jbrowse/display-kit/facetConfigSchema"],Jt=e=>k!=null&&e in Object(k)?k[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/facetConfigSchema' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),ht=Jt("facetConfigSchema");var kr=k&&k.__esModule?k.default:k;var yt=d("GraphFacet",{columns:{type:"maybeNumber",description:"panels per row of a node layout's grid; unset fits them"}},{baseConfiguration:ht});var bt=["fetched","view"],ce="fetched";function wt(){return d("LinearGraphDisplay",{layoutMode:{type:"stringEnum",model:u(V,"force"),defaultValue:"force"},layoutEngine:{type:"stringEnum",model:u(N,"fmmm"),defaultValue:"fmmm"},encoding:{type:"frozen",defaultValue:{},plot:!0},size:{type:"frozen",defaultValue:{field:"walks",value:6,links:"walks"},plot:!0},layers:{type:"frozen",defaultValue:{},plot:!0},facet:yt,rows:{type:"frozen",defaultValue:{},plot:!0},walks:{type:"frozen",defaultValue:[],plot:!0},hover:{type:"stringEnum",model:u(z,"nodes"),defaultValue:"nodes"},links:{type:"stringEnum",model:u(_,Q),defaultValue:Q},sites:{type:"stringEnum",model:u(et,ee),defaultValue:ee},key:{type:"stringEnum",model:u(tt,te),defaultValue:te},extent:{type:"stringEnum",model:u(bt,ce),defaultValue:ce},...ft({defaultHeight:520,height:"the height of the track the graph is drawn in"}),...gt({heightMode:"how a force drawing the view's window places meets the track's height: `fit` shrinks the cut to the track's height, less what hangs off the reference by one end, which may run past the top or bottom with a mark where it does; `grow` does the same into `growMaxHeight` and grows the track to hold it; `fixed` shrinks only the reference the window shows to the track's height, holds it whole and marks where what hangs off it runs past the top or bottom",growMaxHeight:"the tallest `grow` makes the track, in px",defaultHeightMode:$e})},{explicitlyTyped:!0,explicitIdentifier:"displayId",misnamed:{walkLayers:"walks"}})}function me(e){e.addDisplayType(()=>{let t=wt();return Object.assign(new ut({name:"LinearGraphDisplay",displayName:"Graph",configSchema:t,stateModel:nt(t),trackType:"GraphTrack",viewType:"LinearGenomeView",ReactComponent:S(()=>import("./chunks/LinearGraphDisplay-TMLQGUWA.js"))}),{adapterCapabilities:["getSubgraph"]})})}function $t(e){let{uri:t,baseUri:o,csi:r}=e;return typeof t=="string"?{...e,bubblesLocation:{uri:t,baseUri:o},index:L(t,o,r)}:e}var Kt=d("MinigraphBubbleAdapter",{bubblesLocation:p("/path/to/graph.bb.bed.gz"),index:l("MinigraphBubbleIndex","/path/to/graph.bb.bed.gz.tbi"),assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:$t}),kt=Kt;function le(e){e.addAdapterType(()=>new g({name:"MinigraphBubbleAdapter",displayName:"Minigraph bubble BED adapter",configSchema:kt,adapterMetadata:{category:"Graph adapters"},getAdapterClass:()=>import("./chunks/MinigraphBubbleAdapter-YKR73UEK.js").then(t=>t.default)}))}function Tt(e){let{uri:t,baseUri:o,csi:r,format:n}=e;return typeof t!="string"?e:n===2?{...e,graphLocation:{uri:`${t}${K}`,baseUri:o},graphIndex:L(`${t}${K}`,o,r)}:{...e,segmentsLocation:{uri:`${t}.segs.bed.gz`,baseUri:o},segmentsIndex:L(`${t}.segs.bed.gz`,o,r),linksLocation:{uri:`${t}.links.bed.gz`,baseUri:o},linksIndex:L(`${t}.links.bed.gz`,o,r)}}function Yt(e){let{coarse:t,baseUri:o,csi:r}=e;return G(Tt(typeof t=="object"&&t!==null?{...e,coarse:Tt({baseUri:o,csi:r,...t})}:e))}var Xt=d("RgfaTabixCoarseTier",{uri:{type:"maybeString"},format:{type:"maybeNumber"},aboveBpPerPx:{type:"maybeNumber"},foldBelowBp:{type:"maybeNumber"},segmentsLocation:p("/path/to/graph.tier.segs.bed.gz"),segmentsIndex:l("RgfaCoarseSegmentsIndex","/path/to/graph.tier.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.tier.links.bed.gz"),linksIndex:l("RgfaCoarseLinksIndex","/path/to/graph.tier.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaCoarseGraphIndex")}),qt=d("RgfaTabixAdapter",{segmentsLocation:p("/path/to/graph.segs.bed.gz"),segmentsIndex:l("RgfaSegmentsIndex","/path/to/graph.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.links.bed.gz"),linksIndex:l("RgfaLinksIndex","/path/to/graph.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaGraphIndex"),walksLocation:p(""),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:A.stepBudget},walkByteBudget:{type:"integer",defaultValue:A.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),assemblyNameToPanSN:{type:"frozen",defaultValue:{}},coarse:Xt},{explicitlyTyped:!0,preProcessSnapshot:Yt}),xt=qt;function ue(e){e.addAdapterType(()=>new g({name:"RgfaTabixAdapter",displayName:"Indexed rGFA adapter",configSchema:xt,adapterCapabilities:["getSubgraph","referenceSegments"],adapterMetadata:{category:"Graph adapters"},getAdapterClass:()=>import("./chunks/RgfaTabixAdapter-73X2JYWA.js").then(t=>t.default)}))}function At(e){return e.viewType==="LinearGenomeView"&&[e.trackType].flat().includes("VariantTrack")}var Zt=[{label:"Auto",value:"auto"},{label:"50 bp",value:50},{label:"1 kb",value:1e3},{label:"10 kb",value:1e4}];function Qt(e,t){return e?`Pinned to ${H(e)}${t===void 0?"":` \xB7 ${t} form${t===1?"":"s"}`}`:"Not pinned"}function eo(e,t){let o=f(e),r=t.flatMap(n=>n?[st(n)]:[]);for(let{message:n}of[...o.snackbarMessages??[]])r.some(s=>n.startsWith(s))&&o.removeSnackbarMessage?.(n)}function to(e){return e.props({formsPinned:a.maybe(a.frozen()),formsFloorBp:a.maybe(a.frozen())}).views(t=>({get configuredAdapter(){return Oe(t.parentTrack.configuration)},get walkForms(){return this.configuredAdapter.type==="WalkFormsAdapter"}})).views(t=>({get pinnedAliases(){let o=oe(t.formsPinned??t.configuredAdapter.pinned),[r]=Ce(t.parentTrack.configuration),n=o&&r?f(t).assemblyManager.get(r):void 0;return o&&n?n.getAliasesForRefName(o.refName):[]}})).views(t=>({get adapterConfig(){let o=t.configuredAdapter;return t.walkForms?{...o,...t.formsPinned?{pinned:t.formsPinned}:{},...t.pinnedAliases.length>0?{pinnedAliases:t.pinnedAliases}:{},...t.formsFloorBp===void 0?{}:{floorBp:t.formsFloorBp}}:o},get formsWindow(){return oe(this.adapterConfig.pinned)},get formsFloor(){return it(this.adapterConfig.floorBp)},get formsCount(){return t.sourcesBase?.reduce((o,r)=>o+(Number(r.forms)||1),0)},get visibleWindow(){let o=Se(t),r=Ke(o)?Ye(o):void 0;return r&&r.end>r.start?{refName:r.refName,start:Math.max(0,Math.floor(r.start)),end:Math.ceil(r.end)}:void 0}})).volatile(()=>({warnedWindow:void 0})).actions(t=>{let{setSources:o}=t,r=()=>{eo(t,[t.warnedWindow,t.formsWindow])};return{setFormsPinned(n){r(),t.formsPinned=n},setFormsFloorBp(n){r(),t.formsFloorBp=n},setSources(n,s){t.walkForms&&(r(),t.warnedWindow=t.formsWindow),o?.(n,s)}}}).views(t=>{let{trackMenuItems:o}=t;return{formsMenuItems(){let r=t.formsWindow,n=t.visibleWindow;return[{label:Qt(r,t.formsCount),disabled:!0,onClick:()=>{}},{label:"Re-pin to visible region",helpText:"Cut the forms from the region the view shows. Panning and zooming leave the forms alone",disabled:!n||r!==void 0&&H(n)===H(r),onClick:()=>{n&&t.setFormsPinned(n)}},{label:"Hide changes under",subMenu:Zt.map(({label:s,value:i})=>({label:s,type:"radio",checked:t.formsFloor===i,onClick:()=>{t.setFormsFloorBp(i)}}))}]},trackMenuItems(){return t.walkForms?[...o(),...this.formsMenuItems()]:o()}}})}function ge(e){e.addToExtensionPoint("Core-extendPluggableElement",t=>(t instanceof M&&At(t)&&t.extendStateModel(to),t))}function St(e){e.getElementTypesInGroup("display").some(o=>o instanceof M&&At(o))||console.warn("jbrowse-plugin-graphgenomeviewer: no linear VariantTrack display is registered, so WalkFormsAdapter tracks get no pin or floor menu")}var oo=d("WalkFormsAdapter",{walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),pinned:{type:"frozen",defaultValue:{}},pinnedAliases:{type:"stringArray",defaultValue:[]},floorBp:{type:"frozen",defaultValue:"auto"},exclude:{type:"stringArray",defaultValue:[]},maxForms:{type:"integer",defaultValue:Be},walkByteBudget:{type:"integer",defaultValue:15e5}},{explicitlyTyped:!0,preProcessSnapshot:G}),Lt=oo;function fe(e){e.addAdapterType(()=>new g({name:"WalkFormsAdapter",displayName:"Walk-file structural forms adapter",configSchema:Lt,adapterMetadata:{category:"Variant adapters"},getAdapterClass:()=>import("./chunks/WalkFormsAdapter-2YNBPRIT.js").then(t=>t.default)}))}var he="reference";var ro=[{value:"reference",label:"each lane against the reference"},{value:"neighbours",label:"each lane against the lane above"}],Gt=ro.map(e=>e.value);var no=d("WalkTabixSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:A.stepBudget},walkByteBudget:{type:"integer",defaultValue:A.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),laneRibbons:{type:"stringEnum",model:u(Gt,he),defaultValue:he},assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:G}),Mt=no;function ye(e){e.addAdapterType(()=>new g({name:"WalkTabixSyntenyAdapter",displayName:"Walk-indexed graph adapter",configSchema:Mt,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:{category:"Synteny adapters"},getAdapterClass:()=>import("./chunks/WalkTabixSyntenyAdapter-ROEBUUYN.js").then(t=>t.default)}))}var ao=".bubbles.bed.gz";function io(e){return Y(e).toLowerCase().endsWith(".gbz.db")}function so(e,t,o){let r=Y(e),n=i=>!o||o===i,s=t!==void 0||Ie(e);return io(e)?n("GbzBaseSyntenyAdapter")?"GbzBaseSyntenyAdapter":void 0:ze(e)?n("RgfaTabixAdapter")?"RgfaTabixAdapter":void 0:s?r.endsWith(x)?o==="RgfaTabixAdapter"?"RgfaTabixWalks":n("WalkTabixSyntenyAdapter")?"WalkTabixSyntenyAdapter":void 0:n("MinigraphBubbleAdapter")&&(r.endsWith(ao)||o!==void 0)?"MinigraphBubbleAdapter":void 0:void 0}function Et(e,t,o){let r=so(e,t,o);return r?He({choice:r,loc:e,indexLoc:t,assembly:"",sample:""}):void 0}function po(e){let t=e.adapter;return t?.type!==void 0&&Ze.has(t.type)&&!t.assemblyNames?.length&&Array.isArray(e.assemblyNames)&&e.assemblyNames.length>0?{...e,adapter:{...t,assemblyNames:e.assemblyNames}}:e}function co({walksUri:e,walksLocation:t}){let{uri:o,localPath:r,name:n}=m(t)?t:{};return typeof e=="string"&&e!==""?`${e}${x}`:typeof o=="string"?B(o).name:typeof r=="string"?r:typeof n=="string"?n:void 0}function mo(e){let t=m(e.adapter)?e.adapter:void 0,[o]=Array.isArray(e.assemblyNames)?e.assemblyNames:[],r=t&&We(t)?co(t):void 0,n=r?Fe(r):void 0;return t&&o&&n&&n!==o&&t.assemblyNameToPanSN===void 0?{...e,adapter:{...t,assemblyNameToPanSN:{[o]:n}}}:e}function be(e){e.addToExtensionPoint("Core-preProcessTrackConfig",po),e.addToExtensionPoint("Core-preProcessTrackConfig",mo),e.addToExtensionPoint("Core-guessAdapterForLocation",t=>(o,r,n)=>Et(o,r,n)??t(o,r,n)),e.addToExtensionPoint("Core-guessTrackTypeForLocation",t=>(o,r)=>De.has(o)?"GraphTrack":o==="MinigraphBubbleAdapter"?"FeatureTrack":t(o,r))}function we(e){let t;if(m(e)){let{refName:o,start:r,end:n,assemblyName:s}=e;typeof o=="string"&&typeof r=="number"&&typeof n=="number"&&(t={refName:o,start:r,end:n,assemblyName:typeof s=="string"?s:void 0})}return t}function lo(e,t,o){let r=e.connectedViewId;return r===void 0||r===t||!o.has(r)}function Ft(e,t){return e.assemblyName===void 0||t===void 0||t.includes(e.assemblyName)}function It(e){return(Array.isArray(e.tracks)?e.tracks:[]).flatMap(o=>m(o)&&Array.isArray(o.displays)?o.displays.filter(r=>m(r)&&r.type==="LinearGraphDisplay"):[])}function Bt(e,t,o){let r=[],n=Xe(e),s=new Set(n.map(i=>m(i)?i.id:void 0));for(let i of n){if(m(i)&&i.id===t)for(let c of It(i)){let I=we(c.hoverHighlight);I&&Ft(I,o)&&r.push({key:typeof c.id=="string"?c.id:"graph-track",region:I})}for(let c of m(i)?[...It(i),...i.type==="GraphGenomeView"?[i]:[]]:[])(Array.isArray(c.assemblyHoverHighlights)?c.assemblyHoverHighlights:[]).forEach((Nt,Vt)=>{let J=we(Nt);J?.assemblyName!==void 0&&o?.includes(J.assemblyName)&&r.push({key:`${typeof c.id=="string"?c.id:"graph"}-${Vt}`,region:J})});if(m(i)&&i.type==="GraphGenomeView"&&lo(i,t,s)){let c=we(i.hoverHighlight);c&&Ft(c,o)&&r.push({key:typeof i.id=="string"?i.id:"graph",region:c})}}return r}var uo=rt()(e=>({highlight:{height:"100%",position:"absolute",background:R(e.palette.primary.main,.08),borderLeft:`1px solid ${R(e.palette.primary.main,.4)}`,borderRight:`1px solid ${R(e.palette.primary.main,.4)}`,pointerEvents:"none",zIndex:10}})),go=X(function({model:t,region:o}){let{classes:r}=uo(),n=t.getHighlightCoords(o);return n?T("div",{"data-testid":"graph-node-highlight",className:r.highlight,style:{left:n.left,width:n.width}}):null}),fo=X(function({model:t}){let{views:o}=f(t);return T(Me,{children:Bt([...o],t.id,t.assemblyNames).map(({key:r,region:n})=>T(go,{model:t,region:n},`graph-hover-${r}`))})}),Ct=fo;var ho="LinearGenomeView-TracksContainerComponent";function ke(e){e.contributeToExtensionPoint(ho,({model:t})=>T(Ct,{model:t},"graphgenomeview-hover-highlight"))}function yo(e){return e.views(t=>({get adapterConfig(){return Qe(t,Ae(t).configuration)}}))}function Te(e){e.addToExtensionPoint("Core-extendPluggableElement",t=>(t instanceof M&&se.includes(t.name)&&t.extendStateModel(yo),t))}var Rt="GraphGenomeView";var Pt="10.16.0";var xe=class extends pt{constructor(){super(...arguments);this.name=Rt;this.version=Pt}install(o){ie(o),me(o),pe(o),de(o),ke(o),ue(o),le(o),re(o),ye(o),fe(o),ge(o),ne(o),be(o),Te(o),o.addRpcMethod(()=>new F(o)),o.addRpcMethod(()=>new _e(o)),o.addRpcMethod(()=>new ve(o)),o.addRpcMethod(()=>new E(o))}configure(o){St(o);try{Le(o.rootModel)&&o.rootModel.appendToSubMenu(["Add"],{label:"Graph genome view",icon:Ee,onClick:r=>{r.addView("GraphGenomeView",{})}})}catch(r){console.warn("[GraphGenomeView] could not add the Add menu entry",r)}}};export{xe as default};
|
|
1
|
+
import{a as Ee,b as ve,c as z,d as ot,e as nt,f as at}from"./chunks/chunk-OCCKXMPY.js";import"./chunks/chunk-IK5G3JHR.js";import{L as Ze,M as Qe,N as ee,Q as et,V as tt,W as te,d as V,h as Ke,i as Ye,q as m,s as Xe,v as Z,y as qe}from"./chunks/chunk-N4GLRGE7.js";import"./chunks/chunk-LNLF6ZIC.js";import{b as d,g as N,h as Ue,q as rt}from"./chunks/chunk-6G3NIOBS.js";import{Ia as j,Ja as Je,Ka as u,fb as q,g as Re,gb as v,i as M,j as P,k as Pe,l as Ne,m as Ve,n as je,ob as $e,p as _e}from"./chunks/chunk-PPCYV2PD.js";import"./chunks/chunk-52JB4KFJ.js";import"./chunks/chunk-65E2XCMW.js";import"./chunks/chunk-CWMXEILJ.js";import"./chunks/chunk-X4SAD7QA.js";import{a as Q,d as _}from"./chunks/chunk-ZQOMV674.js";import{a as S,b as C,c as Be,d as oe,e as it,f as H,g as st}from"./chunks/chunk-ZVMXECJA.js";import"./chunks/chunk-JM4W4PKP.js";import"./chunks/chunk-4CJUQYP2.js";import"./chunks/chunk-MPT3MHRY.js";import"./chunks/chunk-YBLNN5FU.js";import"./chunks/chunk-3TVYWWUY.js";import"./chunks/chunk-H5TOX62G.js";import"./chunks/chunk-MDCAIQ72.js";import{b as ze,g as He}from"./chunks/chunk-YROUE32O.js";import{a as De,c as We,h as Oe}from"./chunks/chunk-D3QZGLZ3.js";import{d as $,e as a}from"./chunks/chunk-WKD7ALOU.js";import{a as Ce}from"./chunks/chunk-TMM73K4C.js";import"./chunks/chunk-D6TY2QEG.js";import"./chunks/chunk-YBLNN5FU.js";import{b as K,c as x,d as Fe,g as B,h as Y,i as Ie}from"./chunks/chunk-EGZZ3ADM.js";import"./chunks/chunk-DNWOVS3L.js";import{f as Se,g as Ae,j as f,k as Le,m as Ge}from"./chunks/chunk-5L276I7O.js";import{c as A}from"./chunks/chunk-PCP5Y77D.js";import{J as R}from"./chunks/chunk-H42TSPVA.js";import{a as Me,b as T,d as X}from"./chunks/chunk-DUU6T2I5.js";var D=JBrowseExports["@jbrowse/core/Plugin"];var pt=D&&D.__esModule?D.default:D;var W=JBrowseExports["@jbrowse/core/pluggableElementTypes/AdapterType"];var g=W&&W.__esModule?W.default:W;var p=e=>({type:"fileLocation",defaultValue:{uri:e,locationType:"UriLocation"}}),l=(e,t="")=>d(e,{indexType:{model:a.enumeration("IndexType",["TBI","CSI"]),type:"stringEnum",defaultValue:"TBI"},location:p(t)});function L(e,t,o){return{indexType:o?"CSI":"TBI",location:{uri:`${e}.${o?"csi":"tbi"}`,baseUri:t}}}function G(e){let{walksUri:t,baseUri:o}=e;if(typeof t!="string")return e;let r=`${t}${x}`;return{...e,walksLocation:{uri:r,baseUri:o},walksIndex:{uri:`${r}.idx`,baseUri:o}}}var jt=d("GbzBaseSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},gbzDbLocation:p("/path/to/graph.gbz.db"),haplotypeIndexLocation:p(""),readsLocation:p(""),readsIndex:l("GbzBaseReadsIndex"),samplesTsvLocation:p(""),subgraphSnarls:{type:"stringEnum",model:a.enumeration("SnarlOutput",["none","contained","overlapping"]),defaultValue:C.snarls},referenceSample:{type:"string",defaultValue:""},assemblyNameToPanSN:{type:"frozen",defaultValue:{}},context:{type:"number",defaultValue:C.context,advanced:!0},nodeLimit:{type:"number",defaultValue:C.limit,advanced:!0}},{explicitlyTyped:!0,preProcessSnapshot:e=>{let{uri:t,baseUri:o,reads:r}=e;return{...e,...t?{gbzDbLocation:{uri:t,baseUri:o}}:{},...typeof r=="string"?{readsLocation:{uri:r,baseUri:o},...vt(r,o)}:{}}}});function vt(e,t){let{name:o,query:r}=B(e);return o.endsWith(".gz")?{readsIndex:{location:{uri:`${o}.tbi${r}`,baseUri:t}}}:{}}var dt=jt;function re(e){e.addAdapterType(()=>new g({name:"GbzBaseSyntenyAdapter",displayName:"gbz-base pangenome adapter",configSchema:dt,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:{category:"Synteny adapters"},getAdapterClass:()=>import("./chunks/GbzBaseSyntenyAdapter-PCORPW6Y.js").then(t=>t.default)}))}var E=class extends P{constructor(){super(...arguments);this.name="GetGraphHaplotypes"}async execute(o){let{adapter:r}=await je(this.pluginManager,o,"getHaplotypeNames");return r?.getHaplotypeNames({signal:o.signal})}};var _t=A(()=>import("./chunks/AddTrackWorkflow-4JWCC3U4.js"));function ne(e){e.addAddTrackWorkflowType(()=>new Re({name:"Pangenome graph track",displayName:"Add pangenome graph track",ReactComponent:_t,stateModel:a.model({})}))}var F=class extends P{constructor(){super(...arguments);this.name="GraphComputeLayout"}async execute(o){let{graph:r,options:n,signal:s,statusCallback:i}=o;return await new Promise(c=>setTimeout(c,0)),s?.throwIfAborted(),i?.("Computing layout"),Ue({graph:r,options:n})}};var O=JBrowseExports["@jbrowse/core/pluggableElementTypes/ViewType"];var ct=O&&O.__esModule?O.default:O;var h=JBrowseExports["@jbrowse/core/util/withLaunchInput"],zt=e=>h!=null&&e in Object(h)?h[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/util/withLaunchInput' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),mt=zt("defineLaunchKeys");var $o=h&&h.__esModule?h.default:h;var y=JBrowseExports["@jbrowse/core/pluggableElementTypes/models"],Ht=e=>y!=null&&e in Object(y)?y[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/core/pluggableElementTypes/models' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var lt=Ht("BaseViewModel");var Yo=y&&y.__esModule?y.default:y;function ae(){return a.compose("GraphGenomeView",lt,ot,a.model({type:a.literal("GraphGenomeView"),gfaLocation:a.maybe(a.frozen()),loadedRegion:a.maybe(a.frozen()),loadedTrackId:a.optional(a.string,""),layoutMode:j(V),layoutEngine:Je(N,"fmmm"),color:a.maybe(a.frozen()),size:a.maybe(a.frozen()),layers:a.maybe(a.frozen()),facet:a.maybe(a.frozen()),rows:a.maybe(a.frozen()),hover:j(z),links:j(_),walks:a.maybe(a.frozen())})).views(e=>({get grammar(){return{layoutMode:e.layoutMode,layoutEngine:e.layoutEngine,encoding:{color:e.color},size:e.size,layers:e.layers,facet:e.facet,rows:e.rows,hover:e.hover,links:e.links,walks:e.walks}}})).actions(e=>({writeGrammar({encoding:t,...o}){Object.assign(e,t?{...o,color:t.color}:o)}})).volatile(()=>({widthMeasured:!1})).actions(e=>{let t=e.setWidth;return{setWidth(o){t(o),e.widthMeasured=!0}}}).views(e=>({get rpcSessionId(){return e.id},get paneWidth(){return e.width},get paneMeasured(){return e.widthMeasured},get sourceTrack(){return e.loadedTrackId?e.sessionTrack(e.loadedTrackId):void 0},get graphTracks(){return at(f(e).tracks)},get canRetryLoad(){return e.gfaLocation!==void 0||e.loadedTrackId!==""&&e.loadedRegion!==void 0}})).views(e=>({get hasPendingSource(){return e.canRetryLoad&&!e.graph&&!e.loadCanceled},menuItems(){return[...e.exportMenuItems(),...e.launchMenuItems()]}})).actions(e=>{let t=e.clearGraph;function o(r){if(e.gfaLocation)return e.displayName||e.setDisplayName(v(e.gfaLocation)),e.loadGFAFromLocation(e.gfaLocation,r);if(!e.loadedTrackId||!r)return;let n=e.sourceAdapter,s=r.end-r.start,i=e.offReference(r);if(!n)e.setError(new Error(`The track this graph was cut from, "${e.loadedTrackId}", is not in this session`));else if(i)e.setError(new Error(i));else if(s>e.maxRegionBp)e.setError(new Error(`Region too large (${q(s)}) \u2014 zoom in to view graph (max ${q(e.maxRegionBp)})`));else return e.markCut(),e.cutSubgraph(n,r,e.cutOptions)}return{clearGraph(){t(),e.gfaLocation&&e.displayName===v(e.gfaLocation)&&(e.displayName=void 0),e.gfaLocation=void 0,e.loadedRegion=void 0,e.loadedTrackId=""},load(){let r=e.loadedRegion,n=f(e),{assemblyManager:s}=n,i=r&&s.has(r.assemblyName)?s.get(r.assemblyName):void 0;return r&&i?.initialized===!1?s.waitForAssembly(r.assemblyName).catch(()=>{}).then(()=>$(e)&&e.loadedRegion===r?o(Z(n,r)):void 0):o(r&&Z(n,r))}}}).actions(e=>({retryLoad(){e.load()},setGfaLocation(t){e.gfaLocation=t},relayoutFrom(t){return e.loadedTrackId&&e.cutStale?e.load():e.recomputeLayout()},async openGfaLocation(t){await e.loadGFAFromLocation(t),$(e)&&e.hasGraph&&(this.setGfaLocation(t),e.displayName||e.setDisplayName(v(t)))},showTrackInLinearView(t,o,r){let n=f(e);qe({session:n,trackId:t,assembly:o,loc:r}),Ge(n)&&n.removeView(e)},afterAttach(){e.graph||e.load()}}))}var Dt=mt()({});function ie(e){e.addViewType(()=>new ct({name:"GraphGenomeView",displayName:"Graph genome view",stateModel:ae(),launchKeys:Dt,ReactComponent:A(()=>import("./chunks/GraphGenomeView-EPONVTPK.js"))}))}var se=["MultiWaySyntenyDisplay","LinearSyntenyDisplay","DotplotDisplay","ChordSyntenyDisplay"];function Wt(e){let t=e.getElementTypesInGroup("display"),o=n=>t.find(s=>s.name===n),r=(n,s)=>s&&Object.assign(Object.create(s),{adapterCapabilities:[n]});return[o("LinearGraphDisplay"),r("referenceSegments",o("LinearBasicDisplay")),...se.map(n=>r("headerLanes",o(n)))].filter(n=>n!==void 0)}function pe(e){e.addTrackType(()=>{let t=d("GraphTrack",{},{baseConfiguration:Ne(e),explicitIdentifier:"trackId"}),o=new Pe({name:"GraphTrack",displayName:"Pangenome graph track",configSchema:t,stateModel:Ve(e,"GraphTrack",t)});for(let r of Wt(e))o.addDisplayType(r);return o})}function de(e){e.addToExtensionPoint("LaunchView-GraphGenomeView",t=>{let{session:o,...r}=t;return o.addView("GraphGenomeView",r),t})}var U=JBrowseExports["@jbrowse/core/pluggableElementTypes/DisplayType"];var ut=U&&U.__esModule?U.default:U;var b=JBrowseExports["@jbrowse/display-kit/heightModeConfigSchemaFields"],Ot=e=>b!=null&&e in Object(b)?b[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/heightModeConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),gt=Ot("heightModeConfigSchemaFields"),wr=b&&b.__esModule?b.default:b;var w=JBrowseExports["@jbrowse/display-kit/trackHeightConfigSchemaFields"],Ut=e=>w!=null&&e in Object(w)?w[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/trackHeightConfigSchemaFields' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),ft=Ut("trackHeightConfigSchemaFields"),Tr=w&&w.__esModule?w.default:w;var k=JBrowseExports["@jbrowse/display-kit/facetConfigSchema"],Jt=e=>k!=null&&e in Object(k)?k[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/display-kit/facetConfigSchema' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e}),ht=Jt("facetConfigSchema");var Sr=k&&k.__esModule?k.default:k;var yt=d("GraphFacet",{columns:{type:"maybeNumber",description:"panels per row of a node layout's grid; unset fits them"}},{baseConfiguration:ht});var bt=["fetched","view"],ce="fetched";function wt(){return d("LinearGraphDisplay",{layoutMode:{type:"stringEnum",model:u(V,"force"),defaultValue:"force"},layoutEngine:{type:"stringEnum",model:u(N,"fmmm"),defaultValue:"fmmm"},encoding:{type:"frozen",defaultValue:{},plot:!0},size:{type:"frozen",defaultValue:{field:"walks",value:6,links:"walks"},plot:!0},layers:{type:"frozen",defaultValue:{},plot:!0},facet:yt,rows:{type:"frozen",defaultValue:{},plot:!0},walks:{type:"frozen",defaultValue:[],plot:!0},hover:{type:"stringEnum",model:u(z,"nodes"),defaultValue:"nodes"},links:{type:"stringEnum",model:u(_,Q),defaultValue:Q},sites:{type:"stringEnum",model:u(et,ee),defaultValue:ee},key:{type:"stringEnum",model:u(tt,te),defaultValue:te},extent:{type:"stringEnum",model:u(bt,ce),defaultValue:ce},...ft({defaultHeight:520,height:"the height of the track the graph is drawn in"}),...gt({heightMode:"how a force drawing the view's window places meets the track's height: `fit` shrinks the cut to the track's height, less what hangs off the reference by one end, which may run past the top or bottom with a mark where it does; `grow` does the same into `growMaxHeight` and grows the track to hold it; `fixed` shrinks only the reference the window shows to the track's height, holds it whole and marks where what hangs off it runs past the top or bottom",growMaxHeight:"the tallest `grow` makes the track, in px",defaultHeightMode:$e})},{explicitlyTyped:!0,explicitIdentifier:"displayId",misnamed:{walkLayers:"walks"}})}function me(e){e.addDisplayType(()=>{let t=wt();return Object.assign(new ut({name:"LinearGraphDisplay",displayName:"Graph",configSchema:t,stateModel:nt(t),trackType:"GraphTrack",viewType:"LinearGenomeView",ReactComponent:A(()=>import("./chunks/LinearGraphDisplay-TMLQGUWA.js"))}),{adapterCapabilities:["getSubgraph"]})})}function $t(e){let{uri:t,baseUri:o,csi:r}=e;return typeof t=="string"?{...e,bubblesLocation:{uri:t,baseUri:o},index:L(t,o,r)}:e}var Kt=d("MinigraphBubbleAdapter",{bubblesLocation:p("/path/to/graph.bb.bed.gz"),index:l("MinigraphBubbleIndex","/path/to/graph.bb.bed.gz.tbi"),assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:$t}),kt=Kt;function le(e){e.addAdapterType(()=>new g({name:"MinigraphBubbleAdapter",displayName:"Minigraph bubble BED adapter",configSchema:kt,adapterMetadata:{category:"Graph adapters"},getAdapterClass:()=>import("./chunks/MinigraphBubbleAdapter-YKR73UEK.js").then(t=>t.default)}))}function Tt(e){let{uri:t,baseUri:o,csi:r,format:n}=e;return typeof t!="string"?e:n===2?{...e,graphLocation:{uri:`${t}${K}`,baseUri:o},graphIndex:L(`${t}${K}`,o,r)}:{...e,segmentsLocation:{uri:`${t}.segs.bed.gz`,baseUri:o},segmentsIndex:L(`${t}.segs.bed.gz`,o,r),linksLocation:{uri:`${t}.links.bed.gz`,baseUri:o},linksIndex:L(`${t}.links.bed.gz`,o,r)}}function Yt(e){let{coarse:t,baseUri:o,csi:r}=e;return G(Tt(typeof t=="object"&&t!==null?{...e,coarse:Tt({baseUri:o,csi:r,...t})}:e))}var Xt=d("RgfaTabixCoarseTier",{uri:{type:"maybeString"},format:{type:"maybeNumber"},aboveBpPerPx:{type:"maybeNumber"},foldBelowBp:{type:"maybeNumber"},segmentsLocation:p("/path/to/graph.tier.segs.bed.gz"),segmentsIndex:l("RgfaCoarseSegmentsIndex","/path/to/graph.tier.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.tier.links.bed.gz"),linksIndex:l("RgfaCoarseLinksIndex","/path/to/graph.tier.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaCoarseGraphIndex")}),qt=d("RgfaTabixAdapter",{segmentsLocation:p("/path/to/graph.segs.bed.gz"),segmentsIndex:l("RgfaSegmentsIndex","/path/to/graph.segs.bed.gz.tbi"),linksLocation:p("/path/to/graph.links.bed.gz"),linksIndex:l("RgfaLinksIndex","/path/to/graph.links.bed.gz.tbi"),graphLocation:p(""),graphIndex:l("RgfaGraphIndex"),walksLocation:p(""),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:S.stepBudget},walkByteBudget:{type:"integer",defaultValue:S.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),assemblyNameToPanSN:{type:"frozen",defaultValue:{}},coarse:Xt},{explicitlyTyped:!0,preProcessSnapshot:Yt}),xt=qt;var Zt={category:"Graph adapters",indexSuffixes:[".idx"]};function ue(e){e.addAdapterType(()=>new g({name:"RgfaTabixAdapter",displayName:"Indexed rGFA adapter",configSchema:xt,adapterCapabilities:["getSubgraph","referenceSegments"],adapterMetadata:Zt,getAdapterClass:()=>import("./chunks/RgfaTabixAdapter-73X2JYWA.js").then(t=>t.default)}))}function St(e){return e.viewType==="LinearGenomeView"&&[e.trackType].flat().includes("VariantTrack")}var Qt=[{label:"Auto",value:"auto"},{label:"50 bp",value:50},{label:"1 kb",value:1e3},{label:"10 kb",value:1e4}];function eo(e,t){return e?`Pinned to ${H(e)}${t===void 0?"":` \xB7 ${t} form${t===1?"":"s"}`}`:"Not pinned"}function to(e,t){let o=f(e),r=t.flatMap(n=>n?[st(n)]:[]);for(let{message:n}of[...o.snackbarMessages??[]])r.some(s=>n.startsWith(s))&&o.removeSnackbarMessage?.(n)}function oo(e){return e.props({formsPinned:a.maybe(a.frozen()),formsFloorBp:a.maybe(a.frozen())}).views(t=>({get configuredAdapter(){return Oe(t.parentTrack.configuration)},get walkForms(){return this.configuredAdapter.type==="WalkFormsAdapter"}})).views(t=>({get pinnedAliases(){let o=oe(t.formsPinned??t.configuredAdapter.pinned),[r]=Ce(t.parentTrack.configuration),n=o&&r?f(t).assemblyManager.get(r):void 0;return o&&n?n.getAliasesForRefName(o.refName):[]}})).views(t=>({get adapterConfig(){let o=t.configuredAdapter;return t.walkForms?{...o,...t.formsPinned?{pinned:t.formsPinned}:{},...t.pinnedAliases.length>0?{pinnedAliases:t.pinnedAliases}:{},...t.formsFloorBp===void 0?{}:{floorBp:t.formsFloorBp}}:o},get formsWindow(){return oe(this.adapterConfig.pinned)},get formsFloor(){return it(this.adapterConfig.floorBp)},get formsCount(){return t.sourcesBase?.reduce((o,r)=>o+(Number(r.forms)||1),0)},get visibleWindow(){let o=Ae(t),r=Ke(o)?Ye(o):void 0;return r&&r.end>r.start?{refName:r.refName,start:Math.max(0,Math.floor(r.start)),end:Math.ceil(r.end)}:void 0}})).volatile(()=>({warnedWindow:void 0})).actions(t=>{let{setSources:o}=t,r=()=>{to(t,[t.warnedWindow,t.formsWindow])};return{setFormsPinned(n){r(),t.formsPinned=n},setFormsFloorBp(n){r(),t.formsFloorBp=n},setSources(n,s){t.walkForms&&(r(),t.warnedWindow=t.formsWindow),o?.(n,s)}}}).views(t=>{let{trackMenuItems:o}=t;return{formsMenuItems(){let r=t.formsWindow,n=t.visibleWindow;return[{label:eo(r,t.formsCount),disabled:!0,onClick:()=>{}},{label:"Re-pin to visible region",helpText:"Cut the forms from the region the view shows. Panning and zooming leave the forms alone",disabled:!n||r!==void 0&&H(n)===H(r),onClick:()=>{n&&t.setFormsPinned(n)}},{label:"Hide changes under",subMenu:Qt.map(({label:s,value:i})=>({label:s,type:"radio",checked:t.formsFloor===i,onClick:()=>{t.setFormsFloorBp(i)}}))}]},trackMenuItems(){return t.walkForms?[...o(),...this.formsMenuItems()]:o()}}})}function ge(e){e.addToExtensionPoint("Core-extendPluggableElement",t=>(t instanceof M&&St(t)&&t.extendStateModel(oo),t))}function At(e){e.getElementTypesInGroup("display").some(o=>o instanceof M&&St(o))||console.warn("jbrowse-plugin-graphgenomeviewer: no linear VariantTrack display is registered, so WalkFormsAdapter tracks get no pin or floor menu")}var ro=d("WalkFormsAdapter",{walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),pinned:{type:"frozen",defaultValue:{}},pinnedAliases:{type:"stringArray",defaultValue:[]},floorBp:{type:"frozen",defaultValue:"auto"},exclude:{type:"stringArray",defaultValue:[]},maxForms:{type:"integer",defaultValue:Be},walkByteBudget:{type:"integer",defaultValue:15e5}},{explicitlyTyped:!0,preProcessSnapshot:G}),Lt=ro;var no={category:"Variant adapters",indexSuffixes:[".idx"]};function fe(e){e.addAdapterType(()=>new g({name:"WalkFormsAdapter",displayName:"Walk-file structural forms adapter",configSchema:Lt,adapterMetadata:no,getAdapterClass:()=>import("./chunks/WalkFormsAdapter-2YNBPRIT.js").then(t=>t.default)}))}var he="reference";var ao=[{value:"reference",label:"each lane against the reference"},{value:"neighbours",label:"each lane against the lane above"}],Gt=ao.map(e=>e.value);var io=d("WalkTabixSyntenyAdapter",{assemblyNames:{type:"stringArray",defaultValue:[]},walksLocation:p("/path/to/graph.walks.gz"),walksIndex:p(""),walkStepBudget:{type:"integer",defaultValue:S.stepBudget},walkByteBudget:{type:"integer",defaultValue:S.byteBudget},defaultHaplotypes:{type:"stringArray",defaultValue:[]},samplesTsvLocation:p(""),laneRibbons:{type:"stringEnum",model:u(Gt,he),defaultValue:he},assemblyNameToPanSN:{type:"frozen",defaultValue:{}}},{explicitlyTyped:!0,preProcessSnapshot:G}),Mt=io;var so={category:"Synteny adapters",indexSuffixes:[".idx"]};function ye(e){e.addAdapterType(()=>new g({name:"WalkTabixSyntenyAdapter",displayName:"Walk-indexed graph adapter",configSchema:Mt,adapterCapabilities:["getSubgraph","headerLanes","lanePairsOnAnchor","lanePairBatches"],adapterMetadata:so,getAdapterClass:()=>import("./chunks/WalkTabixSyntenyAdapter-ROEBUUYN.js").then(t=>t.default)}))}var po=".bubbles.bed.gz";function co(e){return Y(e).toLowerCase().endsWith(".gbz.db")}function mo(e,t,o){let r=Y(e),n=i=>!o||o===i,s=t!==void 0||Ie(e);return co(e)?n("GbzBaseSyntenyAdapter")?"GbzBaseSyntenyAdapter":void 0:ze(e)?n("RgfaTabixAdapter")?"RgfaTabixAdapter":void 0:s?r.endsWith(x)?o==="RgfaTabixAdapter"?"RgfaTabixWalks":n("WalkTabixSyntenyAdapter")?"WalkTabixSyntenyAdapter":void 0:n("MinigraphBubbleAdapter")&&(r.endsWith(po)||o!==void 0)?"MinigraphBubbleAdapter":void 0:void 0}function Et(e,t,o){let r=mo(e,t,o);return r?He({choice:r,loc:e,indexLoc:t,assembly:"",sample:""}):void 0}function lo(e){let t=e.adapter;return t?.type!==void 0&&Ze.has(t.type)&&!t.assemblyNames?.length&&Array.isArray(e.assemblyNames)&&e.assemblyNames.length>0?{...e,adapter:{...t,assemblyNames:e.assemblyNames}}:e}function uo({walksUri:e,walksLocation:t}){let{uri:o,localPath:r,name:n}=m(t)?t:{};return typeof e=="string"&&e!==""?`${e}${x}`:typeof o=="string"?B(o).name:typeof r=="string"?r:typeof n=="string"?n:void 0}function go(e){let t=m(e.adapter)?e.adapter:void 0,[o]=Array.isArray(e.assemblyNames)?e.assemblyNames:[],r=t&&We(t)?uo(t):void 0,n=r?Fe(r):void 0;return t&&o&&n&&n!==o&&t.assemblyNameToPanSN===void 0?{...e,adapter:{...t,assemblyNameToPanSN:{[o]:n}}}:e}function be(e){e.addToExtensionPoint("Core-preProcessTrackConfig",lo),e.addToExtensionPoint("Core-preProcessTrackConfig",go),e.addToExtensionPoint("Core-guessAdapterForLocation",t=>(o,r,n)=>Et(o,r,n)??t(o,r,n)),e.addToExtensionPoint("Core-guessTrackTypeForLocation",t=>(o,r)=>De.has(o)?"GraphTrack":o==="MinigraphBubbleAdapter"?"FeatureTrack":t(o,r))}function we(e){let t;if(m(e)){let{refName:o,start:r,end:n,assemblyName:s}=e;typeof o=="string"&&typeof r=="number"&&typeof n=="number"&&(t={refName:o,start:r,end:n,assemblyName:typeof s=="string"?s:void 0})}return t}function fo(e,t,o){let r=e.connectedViewId;return r===void 0||r===t||!o.has(r)}function Ft(e,t){return e.assemblyName===void 0||t===void 0||t.includes(e.assemblyName)}function It(e){return(Array.isArray(e.tracks)?e.tracks:[]).flatMap(o=>m(o)&&Array.isArray(o.displays)?o.displays.filter(r=>m(r)&&r.type==="LinearGraphDisplay"):[])}function Bt(e,t,o){let r=[],n=Xe(e),s=new Set(n.map(i=>m(i)?i.id:void 0));for(let i of n){if(m(i)&&i.id===t)for(let c of It(i)){let I=we(c.hoverHighlight);I&&Ft(I,o)&&r.push({key:typeof c.id=="string"?c.id:"graph-track",region:I})}for(let c of m(i)?[...It(i),...i.type==="GraphGenomeView"?[i]:[]]:[])(Array.isArray(c.assemblyHoverHighlights)?c.assemblyHoverHighlights:[]).forEach((Nt,Vt)=>{let J=we(Nt);J?.assemblyName!==void 0&&o?.includes(J.assemblyName)&&r.push({key:`${typeof c.id=="string"?c.id:"graph"}-${Vt}`,region:J})});if(m(i)&&i.type==="GraphGenomeView"&&fo(i,t,s)){let c=we(i.hoverHighlight);c&&Ft(c,o)&&r.push({key:typeof i.id=="string"?i.id:"graph",region:c})}}return r}var ho=rt()(e=>({highlight:{height:"100%",position:"absolute",background:R(e.palette.primary.main,.08),borderLeft:`1px solid ${R(e.palette.primary.main,.4)}`,borderRight:`1px solid ${R(e.palette.primary.main,.4)}`,pointerEvents:"none",zIndex:10}})),yo=X(function({model:t,region:o}){let{classes:r}=ho(),n=t.getHighlightCoords(o);return n?T("div",{"data-testid":"graph-node-highlight",className:r.highlight,style:{left:n.left,width:n.width}}):null}),bo=X(function({model:t}){let{views:o}=f(t);return T(Me,{children:Bt([...o],t.id,t.assemblyNames).map(({key:r,region:n})=>T(yo,{model:t,region:n},`graph-hover-${r}`))})}),Ct=bo;var wo="LinearGenomeView-TracksContainerComponent";function ke(e){e.contributeToExtensionPoint(wo,({model:t})=>T(Ct,{model:t},"graphgenomeview-hover-highlight"))}function ko(e){return e.views(t=>({get adapterConfig(){return Qe(t,Se(t).configuration)}}))}function Te(e){e.addToExtensionPoint("Core-extendPluggableElement",t=>(t instanceof M&&se.includes(t.name)&&t.extendStateModel(ko),t))}var Rt="GraphGenomeView";var Pt="10.17.0";var xe=class extends pt{constructor(){super(...arguments);this.name=Rt;this.version=Pt}install(o){ie(o),me(o),pe(o),de(o),ke(o),ue(o),le(o),re(o),ye(o),fe(o),ge(o),ne(o),be(o),Te(o),o.addRpcMethod(()=>new F(o)),o.addRpcMethod(()=>new _e(o)),o.addRpcMethod(()=>new ve(o)),o.addRpcMethod(()=>new E(o))}configure(o){At(o);try{Le(o.rootModel)&&o.rootModel.appendToSubMenu(["Add"],{label:"Graph genome view",icon:Ee,onClick:r=>{r.addView("GraphGenomeView",{})}})}catch(r){console.warn("[GraphGenomeView] could not add the Add menu entry",r)}}};export{xe as default};
|
|
2
2
|
//# sourceMappingURL=jbrowse-plugin-graphgenomeviewer.esm.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["jbrowse-host:@jbrowse/core/Plugin", "jbrowse-host:@jbrowse/core/pluggableElementTypes/AdapterType", "../src/tabixSlots.ts", "../src/GbzBaseSyntenyAdapter/configSchema.ts", "../src/GbzBaseSyntenyAdapter/index.ts", "../src/GetGraphHaplotypes.ts", "../src/GraphAddTrackWorkflow/index.ts", "../src/GraphComputeLayout.ts", "jbrowse-host:@jbrowse/core/pluggableElementTypes/ViewType", "jbrowse-host:@jbrowse/core/util/withLaunchInput", "jbrowse-host:@jbrowse/core/pluggableElementTypes/models", "../src/GraphGenomeView/viewModel.ts", "../src/GraphGenomeView/index.ts", "../src/GraphTrack/index.ts", "../src/LaunchGraphGenomeView.ts", "jbrowse-host:@jbrowse/core/pluggableElementTypes/DisplayType", "jbrowse-host:@jbrowse/display-kit/heightModeConfigSchemaFields", "jbrowse-host:@jbrowse/display-kit/trackHeightConfigSchemaFields", "jbrowse-host:@jbrowse/display-kit/facetConfigSchema", "../src/LinearGraphDisplay/graphFacetConfigSchema.ts", "../src/GraphGenomeView/extent.ts", "../src/LinearGraphDisplay/configSchema.ts", "../src/LinearGraphDisplay/index.ts", "../src/MinigraphBubbleAdapter/configSchema.ts", "../src/MinigraphBubbleAdapter/index.ts", "../src/RgfaTabixAdapter/configSchema.ts", "../src/RgfaTabixAdapter/index.ts", "../src/WalkFormsAdapter/formsMenu.ts", "../src/WalkFormsAdapter/configSchema.ts", "../src/WalkFormsAdapter/index.ts", "../src/laneRibbons.ts", "../src/WalkTabixSyntenyAdapter/configSchema.ts", "../src/WalkTabixSyntenyAdapter/index.ts", "../src/graphTrackDefaults/guessAdapter.ts", "../src/graphTrackDefaults/index.ts", "../src/hoverSync/graphViewHighlights.ts", "../src/hoverSync/GraphNodeHighlight.tsx", "../src/hoverSync/index.tsx", "../src/panSNAliases/index.ts", "../src/pluginName.ts", "../src/version.ts", "../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/core/Plugin\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/Plugin\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/AdapterType\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/AdapterType\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport { WALKS_SUFFIX } from './locationName.ts'\n\n// A file slot whose default is a url, '' for none\nexport const fileLocationSlot = (uri: string) => ({\n type: 'fileLocation' as const,\n defaultValue: { uri, locationType: 'UriLocation' },\n})\n\n/**\n * The index slot `openTabixSlot` reads: its own `location` and `indexType`\n */\nexport const tabixIndexSchema = (name: string, defaultUri = '') =>\n ConfigurationSchema(name, {\n /**\n * #slot\n */\n indexType: {\n model: types.enumeration('IndexType', ['TBI', 'CSI']),\n type: 'stringEnum',\n defaultValue: 'TBI',\n },\n /**\n * #slot\n */\n location: fileLocationSlot(defaultUri),\n })\n\n// The index slot's snapshot for a file whose `.tbi`, or `.csi`, sits beside it\nexport function tbiBeside(uri: string, baseUri: unknown, csi: unknown) {\n return {\n indexType: csi ? 'CSI' : 'TBI',\n location: { uri: `${uri}.${csi ? 'csi' : 'tbi'}`, baseUri },\n }\n}\n\n// The `walksUri` shorthand: `<walksUri>.walks.gz` and its directory beside it\nexport function walksLocations(snap: Record<string, unknown>) {\n const { walksUri, baseUri } = snap\n if (typeof walksUri !== 'string') {\n return snap\n }\n const walks = `${walksUri}${WALKS_SUFFIX}`\n return {\n ...snap,\n walksLocation: { uri: walks, baseUri },\n walksIndex: { uri: `${walks}.idx`, baseUri },\n }\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport { splitUri } from '../locationName'\nimport { GBZ_CUT_DEFAULTS } from '../slotDefaults.ts'\nimport { fileLocationSlot, tabixIndexSchema } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config GbzBaseSyntenyAdapter\n * #trackType GraphTrack\n * #fileFormat synteny | gbz-base pangenome database | Haplotype alignments read from the graph at query time, no PAF conversion\n * Serves a pangenome graph stored as a gbz-base SQLite database (`.gbz.db`) as\n * haplotype-versus-reference alignments, the shape `MultiWaySyntenyDisplay`\n * draws as one lane per haplotype. A window on the reference is located on the\n * graph's reference path, every haplotype's walk through the nodes it covers\n * is recovered and named, and each haplotype becomes one alignment record with\n * a CIGAR, so the graph is read through HTTP range requests with no offline\n * conversion. Naming the walks takes the companion haplotype index that\n * `gbz-haplotype-index` writes; without it the graph cannot say which\n * haplotype a walk belongs to.\n *\n * Only the fine tier exists: a whole-chromosome view stays on a PIF's coarse\n * tier. A window of the anchor answers any two lanes' alignment, so the\n * multi-way display fetches each adjacent lane pair directly.\n *\n * #example\n * ```js\n * {\n * type: 'GbzBaseSyntenyAdapter',\n * uri: 'hprc-v2.gbz.db',\n * assemblyNames: ['hg38'],\n * assemblyNameToPanSN: { hg38: 'GRCh38#0' },\n * }\n * ```\n */\nconst GbzBaseSyntenyAdapter = ConfigurationSchema(\n 'GbzBaseSyntenyAdapter',\n {\n /**\n * #slot\n * The first entry is the anchor: the JBrowse assembly the graph's reference\n * sample is loaded as. A haplotype needs no entry: its lane draws on the\n * session assembly named or aliased by its PanSN prefix (`HG002.1` with the\n * alias `HG002#1`), or the one `assemblyNameToPanSN` maps to it. A further\n * entry names an assembly by its sample (`HG002`), which takes both of the\n * sample's lanes. A haplotype with no assembly is still a lane, labelled by\n * its PanSN prefix.\n */\n assemblyNames: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * The `.gbz.db` written by `gbz-base construct`; read by HTTP range\n * requests, so it can be large.\n */\n gbzDbLocation: fileLocationSlot('/path/to/graph.gbz.db'),\n /**\n * #slot\n * The haplotype index `gbz-haplotype-index` writes beside the graph\n * database, which names its walks. One with stray rows (the tool from\n * 0.2.0) lets a fetch for a chosen set of lanes walk only those\n * haplotypes. Empty means `graph.haplotype-index.db` beside\n * `graph.gbz.db` if there is one; otherwise the walks go unnamed.\n */\n haplotypeIndexLocation: fileLocationSlot(''),\n /**\n * #slot\n * Reads aligned to the graph as GAF, which the tube map layouts draw under\n * the haplotypes. Its segment names have to be the cut's: numeric node ids,\n * or `vg giraffe --named-coordinates` on a graph whose segments were\n * renamed or chopped. Empty means no reads.\n */\n readsLocation: fileLocationSlot(''),\n /**\n * #slot\n * The `tabix -p gaf` index of a bgzipped `readsLocation`, which fetches the\n * reads over each window's node ids. Empty reads the GAF whole, up to 50 MB.\n */\n readsIndex: tabixIndexSchema('GbzBaseReadsIndex'),\n /**\n * #slot\n * A tab-separated table of per-sample metadata, which the graph view's\n * walk rows group by (\"Group by...\"). Its header row names the columns\n * (`population`, `superpopulation`, ...), and its first column is the\n * walk's sample (`HG00097`) or haplotype (`HG00097#1`). Empty means no\n * grouping. A `color` column (`#rgb` or `#rrggbb`) colours that\n * haplotype's lifted walk in the graph display.\n */\n samplesTsvLocation: fileLocationSlot(''),\n /**\n * #slot\n * How the graph view's subgraph is extended past the nodes the reference\n * window touches. `contained` adds every top-level snarl with both\n * boundary nodes in the window, which is what brings back the bubbles a\n * reference-only walk leaves out; a haplotype still breaks into a new W\n * line wherever it leaves the window's nodes (a 60 kb C4 window on the\n * HPRC graph: 2,703 nodes, 8,083 walks for 464 haplotypes). `overlapping`\n * also follows snarls that leave the window, so every haplotype is one\n * walk (464), at the price of every node in those snarls (4,184 there,\n * 24,547 across the KIV-2 repeat). `none` leaves only the bp `context`.\n */\n subgraphSnarls: {\n type: 'stringEnum',\n model: types.enumeration('SnarlOutput', [\n 'none',\n 'contained',\n 'overlapping',\n ]),\n defaultValue: GBZ_CUT_DEFAULTS.snarls,\n },\n /**\n * #slot\n * The graph sample the anchor window is located on. Empty means the sample\n * the anchor's PanSN prefix names, or the database's one reference sample\n * (`gbwt_reference_samples`) when the anchor names none; a database with\n * several reference samples then needs this set.\n */\n referenceSample: {\n type: 'string',\n defaultValue: '',\n },\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN prefix in the graph, sample or\n * haplotype level (`{ hg38: 'GRCh38#0', 'HG002.1': 'HG002#1' }`). Each\n * session assembly with a `sample#haplotype` alias (`HG002#1`) is mapped to\n * it already, so this is the override: an entry takes its prefix from any\n * assembly aliased to it. An assembly in neither maps to itself.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n /**\n * #slot\n * Graph context around the window, in bp, on top of `subgraphSnarls`: the\n * cut, its reference walk and every haplotype walk extend this far past\n * the window on each side. A haplotype walk breaks into pieces wherever it\n * leaves the cut's nodes, so context and snarls together decide whether a\n * lane's bubble is one record or several. A window inside a snarl far\n * larger than itself (MHC class II on the HPRC graph, 90 kb) is 1.1M pieces\n * at 0 and 464 walks at 1000, three times faster.\n */\n context: {\n type: 'number',\n defaultValue: GBZ_CUT_DEFAULTS.context,\n advanced: true,\n },\n /**\n * #slot\n * The most graph nodes one window may load before the query fails rather\n * than reading a whole chromosome into the worker.\n */\n nodeLimit: {\n type: 'number',\n defaultValue: GBZ_CUT_DEFAULTS.limit,\n advanced: true,\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n *\n *\n * preprocessor to allow minimal config, where a `.gz` `reads` is taken to\n * be bgzipped with a `.tbi` beside it:\n * ```json\n * {\n * \"type\": \"GbzBaseSyntenyAdapter\",\n * \"uri\": \"graph.gbz.db\",\n * \"reads\": \"reads.gaf.gz\",\n * \"assemblyNames\": [\"hg38\"]\n * }\n * ```\n */\n preProcessSnapshot: snap => {\n const { uri, baseUri, reads } = snap\n return {\n ...snap,\n ...(uri ? { gbzDbLocation: { uri, baseUri } } : {}),\n ...(typeof reads === 'string'\n ? {\n readsLocation: { uri: reads, baseUri },\n ...readsIndexBeside(reads, baseUri),\n }\n : {}),\n }\n },\n },\n)\n\n// a bgzipped GAF's index, before any query string its url carries\nfunction readsIndexBeside(reads: string, baseUri: unknown) {\n const { name, query } = splitUri(reads)\n return name.endsWith('.gz')\n ? { readsIndex: { location: { uri: `${name}.tbi${query}`, baseUri } } }\n : {}\n}\n\nexport type GbzBaseSyntenyAdapterConfig = Instance<typeof GbzBaseSyntenyAdapter>\n\nexport default GbzBaseSyntenyAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function GbzBaseSyntenyAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'GbzBaseSyntenyAdapter',\n displayName: 'gbz-base pangenome adapter',\n configSchema,\n // The same opened database serves the graph display's subgraph.\n // headerLanes: getHeader declares every haplotype as a lane, which is\n // what makes MultiWaySyntenyDisplay read the header of an untiered\n // adapter and offer its lane picker over the whole graph.\n // lanePairsOnAnchor: a window of the anchor answers any two lanes'\n // alignment to each other, so the display fetches each adjacent pair\n // rather than composing it through the reference.\n // lanePairBatches: every pair on a window comes from one cut\n adapterCapabilities: [\n 'getSubgraph',\n 'headerLanes',\n 'lanePairsOnAnchor',\n 'lanePairBatches',\n ],\n adapterMetadata: {\n category: 'Synteny adapters',\n },\n getAdapterClass: () =>\n import('./GbzBaseSyntenyAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { RpcMethodType } from '@jbrowse/core/pluggableElementTypes'\n\nimport { adapterImplementing } from './adapterImplementing'\n\nimport type { RpcExecuteArgs } from '@jbrowse/core/rpc/RpcRegistry'\n\n// The haplotypes a graph names without a cut, for the track's haplotype picker:\n// a walk-indexed rGFA's header lines. Undefined where the graph names none, and\n// the picker falls back to typed names.\n\nexport interface GetGraphHaplotypesArgs {\n adapterConfig: Record<string, unknown>\n}\n\ndeclare module '@jbrowse/core/rpc/RpcRegistry' {\n interface RpcRegistry {\n GetGraphHaplotypes: {\n args: GetGraphHaplotypesArgs\n return: string[] | undefined\n }\n }\n}\n\ninterface HaplotypeNamesAdapter {\n getHaplotypeNames(opts: {\n signal?: AbortSignal\n }): Promise<string[] | undefined>\n}\n\nexport default class GetGraphHaplotypes extends RpcMethodType<'GetGraphHaplotypes'> {\n name = 'GetGraphHaplotypes' as const\n\n async execute(args: RpcExecuteArgs<'GetGraphHaplotypes'>) {\n const { adapter } = await adapterImplementing<HaplotypeNamesAdapter>(\n this.pluginManager,\n args,\n 'getHaplotypeNames',\n )\n return adapter?.getHaplotypeNames({ signal: args.signal })\n }\n}\n", "import { lazy } from 'react'\n\nimport { AddTrackWorkflowType } from '@jbrowse/core/pluggableElementTypes'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nconst GraphAddTrackWidget = lazy(() => import('./AddTrackWorkflow'))\n\n// Open track cannot replace this form: only the form reads\n// `<prefix>.graph.json`, the coarse tier and the reference's PanSN sample, and\n// gfa-to-tabix build's config.json writes bare relative uris a hosted session\n// cannot load (9316630 restored the form 777e7c0 deleted)\nexport default function GraphAddTrackWorkflowF(pluginManager: PluginManager) {\n pluginManager.addAddTrackWorkflowType(\n () =>\n new AddTrackWorkflowType({\n name: 'Pangenome graph track',\n displayName: 'Add pangenome graph track',\n ReactComponent: GraphAddTrackWidget,\n stateModel: types.model({}),\n }),\n )\n}\n", "import { layoutEngine } from '@jbrowse/bandage-core/layoutEngines'\nimport { RpcMethodType } from '@jbrowse/core/pluggableElementTypes'\n\nimport type { EngineRequest } from '@jbrowse/bandage-core/pipeline'\nimport type { LayoutResult } from '@jbrowse/bandage-core/types'\nimport type { RpcExecuteArgs } from '@jbrowse/core/rpc/RpcRegistry'\n\n// The payload is the pipeline's EngineRequest, the same request a standalone\n// page hands the engine. `sessionId` and `statusCallback` are the CALL's, not\n// the payload's: core's `EntriesDeclaringCallLevelFields` fails the build for a\n// registry entry that declares either. `execute` still receives both, through\n// `RpcExecuteArgs`'s intersection with `RpcCallContext`.\n\ndeclare module '@jbrowse/core/rpc/RpcRegistry' {\n interface RpcRegistry {\n GraphComputeLayout: {\n args: EngineRequest\n return: { result: LayoutResult; duration: number }\n }\n }\n}\n\nexport default class GraphComputeLayout extends RpcMethodType<'GraphComputeLayout'> {\n name = 'GraphComputeLayout' as const\n\n async execute(args: RpcExecuteArgs<'GraphComputeLayout'>) {\n const { graph, options, signal, statusCallback } = args\n // The engine takes no signal, so a layout superseded while it queued\n // behind another is dropped here rather than holding up the next cut. Its\n // abort is a message queued behind the call, read only after a macrotask.\n await new Promise(resolve => setTimeout(resolve, 0))\n signal?.throwIfAborted()\n statusCallback?.('Computing layout')\n return layoutEngine({ graph, options })\n }\n}\n", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/ViewType\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/ViewType\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/core/util/withLaunchInput\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/util/withLaunchInput\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const defineLaunchKeys = /* @__PURE__ */ read(\"defineLaunchKeys\")\nexport const isTrackRecipe = /* @__PURE__ */ read(\"isTrackRecipe\")\nexport const legacyInitMessage = /* @__PURE__ */ read(\"legacyInitMessage\")\nexport const pendingLaunch = /* @__PURE__ */ read(\"pendingLaunch\")\nexport const snapshotSettings = /* @__PURE__ */ read(\"snapshotSettings\")\nexport const unknownKeysMessage = /* @__PURE__ */ read(\"unknownKeysMessage\")\nexport const withLaunchInput = /* @__PURE__ */ read(\"withLaunchInput\")\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/models\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/models\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const BaseConnectionModelFactory = /* @__PURE__ */ read(\"BaseConnectionModelFactory\")\nexport const BaseDisplay = /* @__PURE__ */ read(\"BaseDisplay\")\nexport const BaseInternetAccountConfig = /* @__PURE__ */ read(\"BaseInternetAccountConfig\")\nexport const BaseViewModel = /* @__PURE__ */ read(\"BaseViewModel\")\nexport const InternetAccount = /* @__PURE__ */ read(\"InternetAccount\")\nexport const baseConnectionConfig = /* @__PURE__ */ read(\"baseConnectionConfig\")\nexport const createBaseTrackConfig = /* @__PURE__ */ read(\"createBaseTrackConfig\")\nexport const createBaseTrackModel = /* @__PURE__ */ read(\"createBaseTrackModel\")\nexport const migrateRetiredDisplays = /* @__PURE__ */ read(\"migrateRetiredDisplays\")\nexport const preprocessTrackConfigSnapshot = /* @__PURE__ */ read(\"preprocessTrackConfigSnapshot\")\nexport default host && host.__esModule ? host.default : host", "import { LAYOUT_ENGINE_VALUES } from '@jbrowse/bandage-core/layoutEngines'\nimport { LAYOUT_MODE_VALUES } from '@jbrowse/bandage-core/layoutModes'\nimport { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models'\nimport { getSession, isViewContainer } from '@jbrowse/core/util'\nimport { isAlive, types } from '@jbrowse/mobx-state-tree'\n\nimport { graphTrackChoices } from './graphTrackChoices'\nimport { HOVER_HIGHLIGHT_VALUES } from './hoverHighlight'\nimport { lenientMaybeEnum, lenientOptionalEnum } from './lenientEnum'\nimport { GraphPane, fileName, formatSpanBp } from './model'\nimport {\n canonicalRegion,\n showTrackInLinearView,\n} from '../launchFromGraph/launchFromGraph'\nimport { LINKS_DRAWN_VALUES } from '../linksDrawn'\n\nimport type { GraphLayers } from './graphLayers'\nimport type { NodeColor } from './nodeColor'\nimport type { NodeSize } from './nodeSize'\nimport type { SubgraphRegion } from '../GetSubgraph'\nimport type { GraphGrammar, GraphRows } from './pane/graphViews'\nimport type { FacetInput } from '@jbrowse/bandage-core/facetGrid'\nimport type { LayoutModeValue } from '@jbrowse/bandage-core/layoutModes'\nimport type { WalkLayer } from '@jbrowse/bandage-core/walkEncoding'\nimport type { AnyTrackConfig } from '@jbrowse/core/configuration'\nimport type { FileLocation } from '@jbrowse/core/util/types'\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\nexport default function stateModelFactory() {\n return types\n .compose(\n 'GraphGenomeView',\n BaseViewModel,\n GraphPane,\n types.model({\n type: types.literal('GraphGenomeView'),\n // a whole GFA the view loads on attach, kept so the source round-trips\n // through a session snapshot\n gfaLocation: types.maybe(types.frozen<FileLocation>()),\n // the reference window the file or the cut was stated beside\n loadedRegion: types.maybe(types.frozen<SubgraphRegion>()),\n // A session track the view cuts `loadedRegion` from once, as 4.0\n // sessions and the docs' figure specs state it. Following the linear\n // view is the track's job (LinearGraphDisplay).\n loadedTrackId: types.optional(types.string, ''),\n // unset is force\n layoutMode: lenientMaybeEnum(LAYOUT_MODE_VALUES),\n // Which engine draws the force layout: Bandage's FMMM, or the stress\n // layout, which reads the reference straight. See LAYOUT_ENGINES.\n layoutEngine: lenientOptionalEnum(LAYOUT_ENGINE_VALUES, 'fmmm'),\n color: types.maybe(types.frozen<NodeColor>()),\n size: types.maybe(types.frozen<NodeSize>()),\n layers: types.maybe(types.frozen<GraphLayers>()),\n facet: types.maybe(types.frozen<FacetInput>()),\n rows: types.maybe(types.frozen<GraphRows>()),\n // unset is nodes\n hover: lenientMaybeEnum(HOVER_HIGHLIGHT_VALUES),\n links: lenientMaybeEnum(LINKS_DRAWN_VALUES),\n walks: types.maybe(types.frozen<WalkLayer[]>()),\n }),\n )\n .views(self => ({\n get grammar(): GraphGrammar {\n return {\n layoutMode: self.layoutMode,\n layoutEngine: self.layoutEngine,\n encoding: { color: self.color },\n size: self.size,\n layers: self.layers,\n facet: self.facet,\n rows: self.rows,\n hover: self.hover,\n links: self.links,\n walks: self.walks,\n }\n },\n }))\n .actions(self => ({\n writeGrammar({ encoding, ...settings }: GraphGrammar) {\n Object.assign(\n self,\n encoding ? { ...settings, color: encoding.color } : settings,\n )\n },\n }))\n .volatile(() => ({\n widthMeasured: false,\n }))\n .actions(self => {\n const setBaseWidth = self.setWidth\n return {\n setWidth(width: number) {\n setBaseWidth(width)\n self.widthMeasured = true\n },\n }\n })\n .views(self => ({\n get rpcSessionId() {\n return self.id\n },\n // a view is not its own containing view\n get paneWidth() {\n return self.width\n },\n // until then the width is BaseViewModel's 800 px default\n get paneMeasured() {\n return self.widthMeasured\n },\n get sourceTrack(): AnyTrackConfig | undefined {\n return self.loadedTrackId\n ? self.sessionTrack(self.loadedTrackId)\n : undefined\n },\n // the session's graph tracks the import form offers\n get graphTracks() {\n return graphTrackChoices(getSession(self).tracks)\n },\n get canRetryLoad() {\n return (\n self.gfaLocation !== undefined ||\n (self.loadedTrackId !== '' && self.loadedRegion !== undefined)\n )\n },\n }))\n .views(self => ({\n get hasPendingSource() {\n return self.canRetryLoad && !self.graph && !self.loadCanceled\n },\n menuItems() {\n return [...self.exportMenuItems(), ...self.launchMenuItems()]\n },\n }))\n .actions(self => {\n const clearPane = self.clearGraph\n function loadRegion(\n region: SubgraphRegion | undefined,\n ): Promise<unknown> | undefined {\n if (self.gfaLocation) {\n // a whole file has no assembly to name the view by\n if (!self.displayName) {\n self.setDisplayName(fileName(self.gfaLocation))\n }\n return self.loadGFAFromLocation(self.gfaLocation, region)\n }\n if (!self.loadedTrackId || !region) {\n return undefined\n }\n const adapter = self.sourceAdapter\n const span = region.end - region.start\n const problem = self.offReference(region)\n if (!adapter) {\n self.setError(\n new Error(\n `The track this graph was cut from, \"${self.loadedTrackId}\", is not in this session`,\n ),\n )\n } else if (problem) {\n self.setError(new Error(problem))\n } else if (span > self.maxRegionBp) {\n self.setError(\n new Error(\n `Region too large (${formatSpanBp(span)}) \u2014 zoom in to view graph (max ${formatSpanBp(self.maxRegionBp)})`,\n ),\n )\n } else {\n self.markCut()\n return self.cutSubgraph(adapter, region, self.cutOptions)\n }\n return undefined\n }\n return {\n // the stated source goes too, or a reloaded session would load the\n // dismissed graph again, and so does a name taken from its file\n clearGraph() {\n clearPane()\n if (\n self.gfaLocation &&\n self.displayName === fileName(self.gfaLocation)\n ) {\n self.displayName = undefined\n }\n self.gfaLocation = undefined\n self.loadedRegion = undefined\n self.loadedTrackId = ''\n },\n // The graph keeps the region by the session's names, which hover sync\n // and launches compare with, so a stated alias resolves first, once\n // its assembly's refName aliases have loaded.\n load(): Promise<unknown> | undefined {\n const stated = self.loadedRegion\n const session = getSession(self)\n const { assemblyManager } = session\n const assembly =\n stated && assemblyManager.has(stated.assemblyName)\n ? assemblyManager.get(stated.assemblyName)\n : undefined\n return stated && assembly?.initialized === false\n ? assemblyManager\n .waitForAssembly(stated.assemblyName)\n .catch(() => undefined)\n .then(() =>\n isAlive(self) && self.loadedRegion === stated\n ? loadRegion(canonicalRegion(session, stated))\n : undefined,\n )\n : loadRegion(stated && canonicalRegion(session, stated))\n },\n }\n })\n .actions(self => ({\n retryLoad() {\n void self.load()\n },\n setGfaLocation(location: FileLocation) {\n self.gfaLocation = location\n },\n relayoutFrom(_from: LayoutModeValue) {\n return self.loadedTrackId && self.cutStale\n ? self.load()\n : self.recomputeLayout()\n },\n // Stated as the source once it loads, so a saved session reopens it; a\n // URL that fails stays in the import form to be corrected.\n async openGfaLocation(location: FileLocation) {\n await self.loadGFAFromLocation(location)\n if (isAlive(self) && self.hasGraph) {\n this.setGfaLocation(location)\n if (!self.displayName) {\n self.setDisplayName(fileName(location))\n }\n }\n },\n // The form's way to a graph track: the linear view draws it at every\n // zoom, so this view, still empty, gives way to it\n showTrackInLinearView(trackId: string, assembly: string, loc: string) {\n const session = getSession(self)\n showTrackInLinearView({ session, trackId, assembly, loc })\n if (isViewContainer(session)) {\n session.removeView(self)\n }\n },\n // Here rather than when the rendering backend starts: the canvas only\n // mounts once there is a graph, so a view whose graph must be fetched\n // would never fetch it.\n afterAttach() {\n if (!self.graph) {\n void self.load()\n }\n },\n }))\n}\n\nexport type GraphGenomeViewModel = Instance<\n ReturnType<typeof stateModelFactory>\n>\n", "import { lazy } from 'react'\n\nimport ViewType from '@jbrowse/core/pluggableElementTypes/ViewType'\nimport { defineLaunchKeys } from '@jbrowse/core/util/withLaunchInput'\n\nimport modelFactory from './viewModel'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\n// No launch keys, declared so `loadSessionSpec` reports a spec's unknown keys\n// instead of dropping them silently.\nconst graphLaunchKeys = defineLaunchKeys<object>()({})\n\nexport default function GraphGenomeViewF(pluginManager: PluginManager) {\n pluginManager.addViewType(() => {\n return new ViewType({\n name: 'GraphGenomeView',\n displayName: 'Graph genome view',\n stateModel: modelFactory(),\n launchKeys: graphLaunchKeys,\n ReactComponent: lazy(() => import('./components/GraphGenomeView')),\n })\n })\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport {\n TrackType,\n createBaseTrackConfig,\n createBaseTrackModel,\n} from '@jbrowse/core/pluggableElementTypes'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'\n\n// core's synteny displays, copied to ask for headerLanes so only the gbz-base\n// and walk-tabix adapters open in a synteny, dotplot or circular view.\n// LinearBasicDisplay is copied to ask for referenceSegments: a lanes adapter\n// answers getFeatures with every haplotype's lane features, which the segments\n// lane can only offer to force-load\nexport const SYNTENY_DISPLAYS = [\n 'MultiWaySyntenyDisplay',\n 'LinearSyntenyDisplay',\n 'DotplotDisplay',\n 'ChordSyntenyDisplay',\n]\n\nfunction displaysInOrder(pluginManager: PluginManager): DisplayType[] {\n const displays = pluginManager.getElementTypesInGroup(\n 'display',\n ) as DisplayType[]\n const named = (name: string) => displays.find(d => d.name === name)\n const needs = (capability: string, display: DisplayType | undefined) =>\n display &&\n Object.assign(Object.create(display) as DisplayType, {\n adapterCapabilities: [capability],\n })\n return [\n named('LinearGraphDisplay'),\n needs('referenceSegments', named('LinearBasicDisplay')),\n ...SYNTENY_DISPLAYS.map(name => needs('headerLanes', named(name))),\n ].filter((d): d is DisplayType => d !== undefined)\n}\n\nexport default function GraphTrackF(pluginManager: PluginManager) {\n pluginManager.addTrackType(() => {\n const configSchema = ConfigurationSchema(\n 'GraphTrack',\n {},\n {\n baseConfiguration: createBaseTrackConfig(pluginManager),\n explicitIdentifier: 'trackId',\n },\n )\n const track = new TrackType({\n name: 'GraphTrack',\n displayName: 'Pangenome graph track',\n configSchema,\n stateModel: createBaseTrackModel(\n pluginManager,\n 'GraphTrack',\n configSchema,\n ),\n })\n for (const display of displaysInOrder(pluginManager)) {\n track.addDisplayType(display)\n }\n return track\n })\n}\n", "import type modelFactory from './GraphGenomeView/viewModel'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\nimport type { SnapshotIn } from '@jbrowse/mobx-state-tree'\n\n// Every view prop, taken off the model so a new prop widens the launch with\n// it; `type` is the dispatch key, not a setting.\nexport type LaunchGraphGenomeViewArgs = Partial<\n Omit<SnapshotIn<ReturnType<typeof modelFactory>>, 'type'>\n> & {\n session: AbstractSessionModel\n}\n\ndeclare module '@jbrowse/core/PluginManager' {\n interface ExtensionPointRegistry {\n 'LaunchView-GraphGenomeView': {\n args: LaunchGraphGenomeViewArgs\n result: LaunchGraphGenomeViewArgs\n }\n }\n}\n\nexport default function LaunchGraphGenomeViewF(pluginManager: PluginManager) {\n /** #extensionPoint LaunchView-GraphGenomeView | async | Programmatically launch a graph genome view */\n pluginManager.addToExtensionPoint('LaunchView-GraphGenomeView', args => {\n const { session, ...spec } = args\n session.addView('GraphGenomeView', spec)\n return args\n })\n}\n", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/DisplayType\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/DisplayType\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/heightModeConfigSchemaFields\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/heightModeConfigSchemaFields\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const heightModeConfigSchemaFields = /* @__PURE__ */ read(\"heightModeConfigSchemaFields\")\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/trackHeightConfigSchemaFields\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/trackHeightConfigSchemaFields\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const trackHeightConfigSchemaFields = /* @__PURE__ */ read(\"trackHeightConfigSchemaFields\")\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/facetConfigSchema\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/facetConfigSchema\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const facetConfigSchema = /* @__PURE__ */ read(\"facetConfigSchema\")\nexport const facetSettingOf = /* @__PURE__ */ read(\"facetSettingOf\")\nexport default host && host.__esModule ? host.default : host", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { facetConfigSchema } from '@jbrowse/display-kit/facetConfigSchema'\n\n/**\n * #config GraphFacet\n * The graph display's `facet`: core's Facet, a `field` and the `sort` its\n * sections lead with, and the `columns` a node layout's panels wrap at. A\n * bare string is the field.\n *\n * #example\n * ```js\n * { type: 'LinearGraphDisplay', facet: { field: 'walk', columns: 3 } }\n * ```\n */\nexport const graphFacetConfigSchema = ConfigurationSchema(\n 'GraphFacet',\n {\n /**\n * #slot columns\n * Panels per row of a node layout's grid; unset fits them to the track.\n */\n columns: {\n type: 'maybeNumber',\n description: \"panels per row of a node layout's grid; unset fits them\",\n },\n },\n {\n /**\n * #baseConfiguration\n */\n baseConfiguration: facetConfigSchema,\n },\n)\n", "export type Extent = 'fetched' | 'view'\n\nexport const EXTENT_VALUES: Extent[] = ['fetched', 'view']\n\nexport const DEFAULT_EXTENT: Extent = 'fetched'\n", "import { LAYOUT_ENGINE_VALUES } from '@jbrowse/bandage-core/layoutEngines'\nimport { LAYOUT_MODE_VALUES } from '@jbrowse/bandage-core/layoutModes'\nimport { DEFAULT_TRACK_FIT } from '@jbrowse/bandage-core/trackFit'\nimport { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { heightModeConfigSchemaFields } from '@jbrowse/display-kit/heightModeConfigSchemaFields'\nimport { trackHeightConfigSchemaFields } from '@jbrowse/display-kit/trackHeightConfigSchemaFields'\n\nimport { graphFacetConfigSchema } from './graphFacetConfigSchema'\nimport { DEFAULT_EXTENT, EXTENT_VALUES } from '../GraphGenomeView/extent'\nimport { HOVER_HIGHLIGHT_VALUES } from '../GraphGenomeView/hoverHighlight'\nimport {\n DEFAULT_KEY_PLACEMENT,\n KEY_PLACEMENT_VALUES,\n} from '../GraphGenomeView/keyPlacement'\nimport { lenientSlotEnum } from '../GraphGenomeView/lenientEnum'\nimport { DEFAULT_LINKS_DRAWN, LINKS_DRAWN_VALUES } from '../linksDrawn'\nimport { DEFAULT_SITES, SITES_VALUES } from '../sitesDrawn'\n\n/**\n * #config LinearGraphDisplay\n * The graph drawn as a track of the linear genome view. A layout whose x is\n * reference bp draws under the view's coordinates and re-cuts as the view\n * moves; force, ordered and walk rows draw in their own coordinates, fitted to\n * the track.\n */\nexport function configSchemaFactory() {\n return ConfigurationSchema(\n 'LinearGraphDisplay',\n {\n /**\n * #slot\n * the layout the track opens in: `force`, which `layoutEngine` draws,\n * or `auto` for the anchored layout, whose x is reference bp\n */\n layoutMode: {\n type: 'stringEnum',\n model: lenientSlotEnum(LAYOUT_MODE_VALUES, 'force'),\n defaultValue: 'force',\n },\n /**\n * #slot\n * the engine that draws `force`: Bandage's `fmmm`, or `stress`, which\n * holds the reference straight and keeps a re-cut's drawing in place\n * (ADR-044)\n */\n layoutEngine: {\n type: 'stringEnum',\n model: lenientSlotEnum(LAYOUT_ENGINE_VALUES, 'fmmm'),\n defaultValue: 'fmmm',\n },\n /**\n * #slot\n * the channels the nodes are painted through, as core's `encoding`.\n * `color` is `{ value: 'grey' }` or `{ value: 'uniform' }`, or the\n * `field` nodes are colored by, `depth`, `length`, `rank`, `position` or\n * `id` (`scale: { type: 'ordinal' }` or `scale: { scheme: 'rainbow' }`).\n * `scale.domainMin` and `scale.domainMax` span the position ramp. `{}`\n * colors an anchored graph by position. `site` is how a collapsed\n * site's band is drawn, bandage-core's site encoding: `thickness` by\n * `reaching` (the default) or `haplotypes`, `lightness` by `reaching`,\n * and `ticks` by `lengths`.\n * ```js\n * { encoding: { color: { field: 'depth' } } }\n * { encoding: { site: { thickness: { field: 'haplotypes' }, lightness: { field: 'reaching' } } } }\n * ```\n */\n encoding: {\n type: 'frozen',\n defaultValue: {},\n plot: true,\n },\n /**\n * #slot\n * the node thickness: a px number draws every node that thick;\n * `{ field: 'walks', value }` draws a node as thick as the passes the\n * walks make through it, the most passes in the graph `value` px;\n * `{ field: 'depth', value }` thickens a node the more paths carry it,\n * around `value` px; `{ field: 'frequency', value }` draws it as wide as\n * the share of haplotypes through it, `value` px at 100%; `links:\n * 'walks'` draws a link as thick as the passes along it, on the scale\n * nodes by walks are drawn on. Nodes by walks draw by depth in a graph\n * without walks\n */\n size: {\n type: 'frozen',\n defaultValue: { field: 'walks', value: 6, links: 'walks' },\n plot: true,\n },\n /**\n * #slot\n * what the drawing adds over its nodes and edges, stated as changes to\n * the defaults: `paths`, `bubbles`, `walkStrip`, `walkRibbons` and\n * `smallSites` are off, `deletions`, `genes` and `referenceStrip` on\n * ```js\n * { layers: { bubbles: true, genes: false } }\n * ```\n */\n layers: {\n type: 'frozen',\n defaultValue: {},\n plot: true,\n },\n /**\n * #slot\n * one section per value of a field: a node layout draws a panel per\n * `walk` or `sample`, and walk rows stack into a section per value of\n * a sample table column. A bare field, or `{ field, sort, columns }`\n */\n facet: graphFacetConfigSchema,\n /**\n * #slot\n * the rows walk rows draw: `{ kept: [...] }` names the samples, or\n * `sample#haplotype` haplotypes, shown; `{ kept: 'lifted' }` shows the\n * haplotypes of the lifted walks\n */\n rows: {\n type: 'frozen',\n defaultValue: {},\n plot: true,\n },\n /**\n * #slot\n * the walks highlighted, as the track's Haplotypes list sets them: each\n * is lifted out of the drawing as a lane of its own and the rest fade.\n * A walk's `color` takes a `field` (`progress`, `walk`, `reference` or\n * `pass`) and a `scheme` (`grey`, `blue`, `red`, `purple`, `green`,\n * `orange` or `rainbow`)\n * ```js\n * { walks: [{ walk: 'GRCh38#0#chr6' }, { walk: 'HG00133#1#CM090045.1' }] }\n * ```\n */\n walks: {\n type: 'frozen',\n defaultValue: [],\n plot: true,\n },\n /**\n * #slot\n * what the pointer lights: `nodes` lightens a hovered node and bands its\n * span on the view; `everything` also lights edges, and the node at the\n * view's pointer bp\n */\n hover: {\n type: 'stringEnum',\n model: lenientSlotEnum(HOVER_HIGHLIGHT_VALUES, 'nodes'),\n defaultValue: 'nodes',\n },\n /**\n * #slot\n * the links a cut of a walk file draws: `walked`, those the haplotypes\n * shown walk, or `between`, also those any other haplotype in the file\n * takes between the nodes shown. Walk rows draw no links\n */\n links: {\n type: 'stringEnum',\n model: lenientSlotEnum(LINKS_DRAWN_VALUES, DEFAULT_LINKS_DRAWN),\n defaultValue: DEFAULT_LINKS_DRAWN,\n },\n /**\n * #slot\n * how a fold to threads draws the alleles of one site, where its\n * haplotypes leave and rejoin the reference: `collapsed`, one band at\n * the longest, as thick at each point as the haplotypes at least that\n * long, with a tick at each length; or `open`, a node for each run of\n * lengths within the fold's threshold of each other\n */\n sites: {\n type: 'stringEnum',\n model: lenientSlotEnum(SITES_VALUES, DEFAULT_SITES),\n defaultValue: DEFAULT_SITES,\n },\n /**\n * #slot\n * where the key goes: `column`, a column of its own at the track's\n * right edge, the drawing fitted beside it; `overlay`, at the track's\n * top right with no column, so a drawing that follows the view's\n * window spans the track edge to edge under the tracks above it, and\n * sits below the key where the track is tall enough for both; or\n * `hidden`\n */\n key: {\n type: 'stringEnum',\n model: lenientSlotEnum(KEY_PLACEMENT_VALUES, DEFAULT_KEY_PLACEMENT),\n defaultValue: DEFAULT_KEY_PLACEMENT,\n },\n /**\n * #slot\n * how much of the graph a drawing that follows the view's window draws:\n * `fetched`, the whole stretch fetched around the view, as wide as the\n * layout needs, its colour ramp and key over that stretch; or `view`,\n * only what branches inside the view, with lengths, gene pins, the\n * colour ramp and the key's range over the view. `view` suits a still\n * picture: during a pan it redraws in steps as the view settles\n */\n extent: {\n type: 'stringEnum',\n model: lenientSlotEnum(EXTENT_VALUES, DEFAULT_EXTENT),\n defaultValue: DEFAULT_EXTENT,\n },\n ...trackHeightConfigSchemaFields({\n defaultHeight: 520,\n height: 'the height of the track the graph is drawn in',\n }),\n ...heightModeConfigSchemaFields({\n heightMode:\n \"how a force drawing the view's window places meets the track's height: `fit` shrinks the cut to the track's height, less what hangs off the reference by one end, which may run past the top or bottom with a mark where it does; `grow` does the same into `growMaxHeight` and grows the track to hold it; `fixed` shrinks only the reference the window shows to the track's height, holds it whole and marks where what hangs off it runs past the top or bottom\",\n growMaxHeight: 'the tallest `grow` makes the track, in px',\n defaultHeightMode: DEFAULT_TRACK_FIT,\n }),\n },\n {\n explicitlyTyped: true,\n explicitIdentifier: 'displayId',\n misnamed: { walkLayers: 'walks' },\n },\n )\n}\n\nexport type LinearGraphDisplayConfigModel = ReturnType<\n typeof configSchemaFactory\n>\n", "import { lazy } from 'react'\n\nimport DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'\n\nimport { configSchemaFactory } from './configSchema'\nimport { stateModelFactory } from './model'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function LinearGraphDisplayF(pluginManager: PluginManager) {\n pluginManager.addDisplayType(() => {\n const configSchema = configSchemaFactory()\n return Object.assign(\n new DisplayType({\n name: 'LinearGraphDisplay',\n displayName: 'Graph',\n configSchema,\n stateModel: stateModelFactory(configSchema),\n trackType: 'GraphTrack',\n viewType: 'LinearGenomeView',\n ReactComponent: lazy(() => import('./components/LinearGraphDisplay')),\n }),\n { adapterCapabilities: ['getSubgraph'] },\n )\n })\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { fileLocationSlot, tabixIndexSchema, tbiBeside } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config MinigraphBubbleAdapter\n * #trackType FeatureTrack\n * #fileFormat graph | Minigraph bubble BED | `gfatools bubble` output; HPRC publishes one ready-made, so no preprocessing at all\n * the tabix-indexed BED `gfatools bubble` writes for a minigraph graph: one row\n * per bubble, on the reference's own coordinates. Unlike\n * [RgfaTabixAdapter](/docs/config/rgfatabixadapter) this needs no index build of\n * your own, because HPRC publishes this file beside its minigraph graph.\n *\n * It shows *where* the graph varies and by how much, not the graph itself.\n *\n * #example\n * ```js\n * {\n * type: 'MinigraphBubbleAdapter',\n * uri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38.bubbles.bed.gz',\n * assemblyNameToPanSN: { hg38: 'GRCh38' },\n * }\n * ```\n */\n\nfunction normalizeSnapshot(snap: Record<string, unknown>) {\n const { uri, baseUri, csi } = snap\n return typeof uri === 'string'\n ? {\n ...snap,\n bubblesLocation: { uri, baseUri },\n index: tbiBeside(uri, baseUri, csi),\n }\n : snap\n}\n\nconst MinigraphBubbleAdapter = ConfigurationSchema(\n 'MinigraphBubbleAdapter',\n {\n /**\n * #slot\n */\n bubblesLocation: fileLocationSlot('/path/to/graph.bb.bed.gz'),\n /**\n * #slot\n */\n index: tabixIndexSchema(\n 'MinigraphBubbleIndex',\n '/path/to/graph.bb.bed.gz.tbi',\n ),\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN sample prefix, for when they\n * differ. `gfatools bubble` names each row after the graph's stable\n * sequence, so a Minigraph-Cactus graph yields `GRCh38#0#chr6` and an\n * `hg38` assembly needs `{ hg38: 'GRCh38' }`; HPRC's published v1.0\n * minigraph bubbles are bare (`chr6`) and need nothing.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n *\n * preprocessor to allow the minimal config\n * ```json\n * { \"type\": \"MinigraphBubbleAdapter\", \"uri\": \"graph.bb.bed.gz\" }\n * ```\n */\n preProcessSnapshot: normalizeSnapshot,\n },\n)\n\nexport type MinigraphBubbleAdapterConfig = Instance<\n typeof MinigraphBubbleAdapter\n>\n\nexport default MinigraphBubbleAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function MinigraphBubbleAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'MinigraphBubbleAdapter',\n displayName: 'Minigraph bubble BED adapter',\n configSchema,\n adapterMetadata: {\n category: 'Graph adapters',\n },\n getAdapterClass: () =>\n import('./MinigraphBubbleAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { GRAPH_SUFFIX } from '../locationName.ts'\nimport { WALK_BUDGETS } from '../slotDefaults.ts'\nimport {\n fileLocationSlot,\n tabixIndexSchema,\n tbiBeside,\n walksLocations,\n} from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config RgfaTabixAdapter\n * #trackType GraphTrack\n * #fileFormat graph | Indexed GFA | Built by `gfa-to-tabix`; serves segments as features and extracts local subgraphs\n * two tabix-indexed BED files, one of a graph's segments and one of its links,\n * written by [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) from an rGFA\n * or from a plain GFA with paths. Both of its layouts are read: `anchored`,\n * where one query per file returns the graph under a region, and `contig`,\n * where the adapter follows links onto other contigs.\n *\n * The `uri` shorthand takes the prefix the build script was given and resolves\n * `<uri>.segs.bed.gz`, `<uri>.links.bed.gz` and their `.tbi` indexes. With\n * `format: 2` it resolves gfa-to-tabix's format 2 instead, `<uri>.graph.bed.gz`\n * and its index: nodes and links in one file, a plain GFA's carriers as bits,\n * from `gfa-to-tabix --format 2`. `coarse`\n * takes the same shorthand for a second pair at one node per bubble, built by\n * `gfa-to-tabix fold`, plus either the zoom past which a graph view following\n * a linear view cuts it (`aboveBpPerPx`) or the size it was folded at\n * (`foldBelowBp`), from which the plugin derives that zoom.\n *\n * `walksUri` takes the prefix of a walk file in place of `uri`, and resolves\n * `<walksUri>.walks.gz` and its directory `<walksUri>.walks.gz.idx`.\n * `gfa-to-tabix --walks -o <prefix>` writes one per reference sample, so a\n * track names one as `<prefix>.<sample>`. The adapter reads walk format 8,\n * which gfa-to-tabix writes from 5.0, through @gmod/gfa-tabix. Such a\n * graph's cut carries\n * the haplotypes' walks, and `defaultHaplotypes` names the ones it is cut for\n * until the user picks others.\n *\n * #example\n * ```js\n * {\n * type: 'RgfaTabixAdapter',\n * uri: 'https://example.com/hprc.rgfa',\n * coarse: { uri: 'https://example.com/hprc.fold10000', foldBelowBp: 10000 },\n * }\n * ```\n *\n * #example\n * ```js\n * {\n * type: 'RgfaTabixAdapter',\n * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38-f8.GRCh38',\n * assemblyNameToPanSN: { hg38: 'GRCh38' },\n * defaultHaplotypes: ['HG002', 'HG00733', 'HG02257', 'NA19240'],\n * }\n * ```\n */\n\nfunction prefixLocations(snap: Record<string, unknown>) {\n const { uri, baseUri, csi, format } = snap\n if (typeof uri !== 'string') {\n return snap\n }\n return format === 2\n ? {\n ...snap,\n graphLocation: { uri: `${uri}${GRAPH_SUFFIX}`, baseUri },\n graphIndex: tbiBeside(`${uri}${GRAPH_SUFFIX}`, baseUri, csi),\n }\n : {\n ...snap,\n segmentsLocation: { uri: `${uri}.segs.bed.gz`, baseUri },\n segmentsIndex: tbiBeside(`${uri}.segs.bed.gz`, baseUri, csi),\n linksLocation: { uri: `${uri}.links.bed.gz`, baseUri },\n linksIndex: tbiBeside(`${uri}.links.bed.gz`, baseUri, csi),\n }\n}\n\nfunction normalizeSnapshot(snap: Record<string, unknown>) {\n const { coarse, baseUri, csi } = snap\n return walksLocations(\n prefixLocations(\n typeof coarse === 'object' && coarse !== null\n ? { ...snap, coarse: prefixLocations({ baseUri, csi, ...coarse }) }\n : snap,\n ),\n )\n}\n\nconst RgfaTabixCoarseTier = ConfigurationSchema('RgfaTabixCoarseTier', {\n /**\n * #slot\n * The adapter's `uri` shorthand for this pair: the prefix `gfa-to-tabix\n * fold` was given, from which the locations below resolve.\n */\n uri: { type: 'maybeString' },\n /**\n * #slot\n * The adapter's `format` for this pair: `2` resolves format 2's one\n * `<uri>.graph.bed.gz`.\n */\n format: { type: 'maybeNumber' },\n /**\n * #slot\n * The linear view's bp per px past which a graph following it cuts this\n * pair. Unset, with `foldBelowBp` unset too, means the track has no coarse\n * tier. There is no default,\n * because the zoom a fine cut stays drawable to depends on the graph's\n * density: a minigraph graph averages ~7 kb per segment, a base-level pggb\n * graph ~17 bp.\n */\n aboveBpPerPx: { type: 'maybeNumber' },\n /**\n * #slot\n * The size, in bp, this pair was folded at (`gfa-to-tabix fold --below`).\n * When `aboveBpPerPx` is unset, the handover is `foldBelowBp / 10`, the zoom\n * at which the fine cut folds the same variants away.\n */\n foldBelowBp: { type: 'maybeNumber' },\n /**\n * #slot\n */\n segmentsLocation: fileLocationSlot('/path/to/graph.tier.segs.bed.gz'),\n /**\n * #slot\n */\n segmentsIndex: tabixIndexSchema(\n 'RgfaCoarseSegmentsIndex',\n '/path/to/graph.tier.segs.bed.gz.tbi',\n ),\n /**\n * #slot\n */\n linksLocation: fileLocationSlot('/path/to/graph.tier.links.bed.gz'),\n /**\n * #slot\n */\n linksIndex: tabixIndexSchema(\n 'RgfaCoarseLinksIndex',\n '/path/to/graph.tier.links.bed.gz.tbi',\n ),\n /**\n * #slot\n * format 2's one file in place of the pair; see the adapter's `graphLocation`\n */\n graphLocation: fileLocationSlot(''),\n /**\n * #slot\n */\n graphIndex: tabixIndexSchema('RgfaCoarseGraphIndex'),\n})\n\nconst RgfaTabixAdapter = ConfigurationSchema(\n 'RgfaTabixAdapter',\n {\n /**\n * #slot\n * one row per segment: `stableName start end segmentId rank`, as emitted by\n * `gfatools gfa2bed -m`\n */\n segmentsLocation: fileLocationSlot('/path/to/graph.segs.bed.gz'),\n /**\n * #slot\n */\n segmentsIndex: tabixIndexSchema(\n 'RgfaSegmentsIndex',\n '/path/to/graph.segs.bed.gz.tbi',\n ),\n /**\n * #slot\n * one row per link per endpoint, each carrying both endpoints in full so a\n * neighbour on another stable sequence needs no segment-id lookup\n */\n linksLocation: fileLocationSlot('/path/to/graph.links.bed.gz'),\n /**\n * #slot\n */\n linksIndex: tabixIndexSchema(\n 'RgfaLinksIndex',\n '/path/to/graph.links.bed.gz.tbi',\n ),\n /**\n * #slot\n * gfa-to-tabix's format 2, `<prefix>.graph.bed.gz`: segments and links in\n * one file, read in place of `segmentsLocation` and `linksLocation`.\n * Unset means the graph is the pair.\n */\n graphLocation: fileLocationSlot(''),\n /**\n * #slot\n */\n graphIndex: tabixIndexSchema('RgfaGraphIndex'),\n /**\n * #slot\n * a `gfa-to-tabix --walks` file in walk format 8: per tile of a\n * reference, the reference's path, the ways haplotypes leave it and each\n * haplotype's piece, and every departure from the reference. Unset means\n * the graph has no walks.\n */\n walksLocation: fileLocationSlot(''),\n /**\n * #slot\n * the walk file's directory, `<prefix>.<sample>.walks.gz.idx`. Unset\n * reads it beside the walk file.\n */\n walksIndex: fileLocationSlot(''),\n /**\n * #slot\n * the most haplotype steps a cut keeps; a window whose walks hold more\n * shows a zoom-in notice instead, as does one whose rows hold eight times\n * as many. Counts only the haplotypes the cut is for, so fewer haplotypes\n * draw a wider window. Walk rows draw runs rather than steps, as does a\n * graph folded to threads, which reads the walks as runs, and both are\n * bounded by `walkByteBudget` alone.\n */\n walkStepBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.stepBudget,\n },\n /**\n * #slot\n * the most compressed bytes a cut of a walk-indexed graph fetches from its\n * walk file, which its directory gives before any row is read; a window\n * over it shows a zoom-in notice instead. The budget covers every\n * haplotype, since a tile's rows are filed for all of them.\n */\n walkByteBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.byteBudget,\n },\n /**\n * #slot\n * the haplotypes a walk-indexed graph is cut for until the user picks\n * others in the track's Haplotypes menu or Graph settings, as PanSN prefixes\n * (`HG002#1`, or `HG002` for both of its haplotypes). Empty means every\n * haplotype, or the lanes the track's `assemblyNames` lists after its\n * reference.\n */\n defaultHaplotypes: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * A tab-separated table of per-sample metadata, which the graph view's\n * walk rows group by (\"Group by...\"). Its header row names the columns\n * (`population`, `superpopulation`, ...), and its first column is the\n * walk's sample (`HG00097`) or haplotype (`HG00097#1`). Empty means no\n * grouping. A `color` column (`#rgb` or `#rrggbb`) colours that\n * haplotype's lifted walk in the graph display.\n */\n samplesTsvLocation: fileLocationSlot(''),\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN sample prefix in the graph, for\n * when they differ. Defaults to identity: the assembly name is assumed to be\n * the PanSN sample name, and a graph whose stable names are bare (minigraph\n * writes `chr1`) needs nothing here at all.\n *\n * Minigraph-Cactus writes PanSN stable names, so HPRC's release-2 graph\n * calls the reference `GRCh38#0#chr1` and an `hg38` assembly needs\n * `{ hg38: 'GRCh38' }`. The prefix is what disambiguates: that same graph\n * also contains `CHM13#0#chr1`, so matching on the contig alone would\n * silently resolve to the wrong sample.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n /**\n * #slot\n * The same graph at one node per bubble, which a graph view following a\n * linear view cuts once that view is zoomed out past `aboveBpPerPx`, and\n * which no bp cap applies to. `{ uri, aboveBpPerPx }` or `{ uri,\n * foldBelowBp }`, where `uri` is a prefix as the adapter's own is;\n * `aboveBpPerPx` wins when both are given.\n */\n coarse: RgfaTabixCoarseTier,\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n *\n * preprocessor to allow the minimal config\n * ```json\n * { \"type\": \"RgfaTabixAdapter\", \"uri\": \"graph.rgfa\" }\n * ```\n * or, for the GRCh38 set of a graph built by `gfa-to-tabix --walks -o\n * chr22`,\n * ```json\n * { \"type\": \"RgfaTabixAdapter\", \"walksUri\": \"chr22.GRCh38\" }\n * ```\n */\n preProcessSnapshot: normalizeSnapshot,\n },\n)\n\nexport type RgfaTabixAdapterConfig = Instance<typeof RgfaTabixAdapter>\n\nexport default RgfaTabixAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function RgfaTabixAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'RgfaTabixAdapter',\n displayName: 'Indexed rGFA adapter',\n configSchema,\n // what a graph display needs of its track's adapter, and the\n // reference's segments that its getFeatures gives the segments lane\n adapterCapabilities: ['getSubgraph', 'referenceSegments'],\n adapterMetadata: {\n category: 'Graph adapters',\n },\n getAdapterClass: () =>\n import('./RgfaTabixAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { DisplayType } from '@jbrowse/core/pluggableElementTypes'\nimport { getContainingView, getSession } from '@jbrowse/core/util'\nimport { getConfAssemblyNamesOrNone } from '@jbrowse/core/util/tracks'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport { floorOf, pinnedLocus, pinnedOf, warningPrefix } from './pinned.ts'\nimport { hostWindow, isLinearHost } from '../GraphGenomeView/host.ts'\nimport { trackAdapterSnapshot } from '../graphTrackConfig.ts'\n\nimport type { FloorBp, Pinned } from './pinned.ts'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AnyTrackConfig } from '@jbrowse/core/configuration'\nimport type { MenuItem } from '@jbrowse/core/ui'\nimport type {\n IAnyStateTreeNode,\n IModelType,\n ModelProperties,\n} from '@jbrowse/mobx-state-tree'\n\n// By track type, not display name, which has changed across releases; the\n// mixin is inert off a WalkFormsAdapter track\nexport function takesFormsMenu(display: DisplayType) {\n return (\n display.viewType === 'LinearGenomeView' &&\n [display.trackType].flat().includes('VariantTrack')\n )\n}\n\nexport const FLOORS: { label: string; value: FloorBp }[] = [\n { label: 'Auto', value: 'auto' },\n { label: '50 bp', value: 50 },\n { label: '1 kb', value: 1000 },\n { label: '10 kb', value: 10_000 },\n]\n\nexport function pinnedLabel(pinned: Pinned | undefined, forms?: number) {\n return pinned\n ? `Pinned to ${pinnedLocus(pinned)}${forms === undefined ? '' : ` \u00B7 ${forms} form${forms === 1 ? '' : 's'}`}`\n : 'Not pinned'\n}\n\ninterface FormsHost {\n parentTrack: { configuration: AnyTrackConfig }\n sourcesBase?: Record<string, unknown>[]\n trackMenuItems: () => MenuItem[]\n setSources?(sources: unknown, adapterConfig?: unknown): void\n}\n\ninterface Snackbar {\n snackbarMessages?: { message: string }[]\n removeSnackbarMessage?: (message: string) => void\n}\n\nfunction clearWarnings(\n node: IAnyStateTreeNode,\n windows: (Pinned | undefined)[],\n) {\n const session = getSession(node) as unknown as Snackbar\n const prefixes = windows.flatMap(w => (w ? [warningPrefix(w)] : []))\n for (const { message } of [...(session.snackbarMessages ?? [])]) {\n if (prefixes.some(p => message.startsWith(p))) {\n session.removeSnackbarMessage?.(message)\n }\n }\n}\n\n/**\n * Gives a WalkFormsAdapter track's display a pinned window and floor of its\n * own, which the display stores in the session and sends in the adapter config\n * with each request. A config edit would change the track's RPC session id\n * and move the requests to a worker without the cut; display state leaves it.\n */\nexport function withFormsMenu<\n PROPS extends ModelProperties,\n HOST extends FormsHost,\n>(model: IModelType<PROPS, HOST>) {\n return model\n .props({\n formsPinned: types.maybe(types.frozen<Pinned>()),\n formsFloorBp: types.maybe(types.frozen<FloorBp>()),\n })\n .views(self => ({\n get configuredAdapter() {\n return trackAdapterSnapshot(self.parentTrack.configuration)\n },\n get walkForms() {\n return this.configuredAdapter.type === 'WalkFormsAdapter'\n },\n }))\n .views(self => ({\n get pinnedAliases() {\n const pinned = pinnedOf(\n self.formsPinned ?? self.configuredAdapter.pinned,\n )\n const [assemblyName] = getConfAssemblyNamesOrNone(\n self.parentTrack.configuration,\n )\n const assembly =\n pinned && assemblyName\n ? getSession(self).assemblyManager.get(assemblyName)\n : undefined\n return pinned && assembly\n ? assembly.getAliasesForRefName(pinned.refName)\n : []\n },\n }))\n .views(self => ({\n get adapterConfig() {\n const conf = self.configuredAdapter\n return self.walkForms\n ? {\n ...conf,\n ...(self.formsPinned ? { pinned: self.formsPinned } : {}),\n ...(self.pinnedAliases.length > 0\n ? { pinnedAliases: self.pinnedAliases }\n : {}),\n ...(self.formsFloorBp === undefined\n ? {}\n : { floorBp: self.formsFloorBp }),\n }\n : conf\n },\n get formsWindow() {\n return pinnedOf(this.adapterConfig.pinned)\n },\n get formsFloor() {\n return floorOf(this.adapterConfig.floorBp)\n },\n get formsCount() {\n return self.sourcesBase?.reduce(\n (n, row) => n + (Number(row.forms) || 1),\n 0,\n )\n },\n get visibleWindow(): Pinned | undefined {\n const view: unknown = getContainingView(self)\n const window = isLinearHost(view) ? hostWindow(view) : undefined\n return window && window.end > window.start\n ? {\n refName: window.refName,\n start: Math.max(0, Math.floor(window.start)),\n end: Math.ceil(window.end),\n }\n : undefined\n },\n }))\n .volatile(() => ({\n warnedWindow: undefined as Pinned | undefined,\n }))\n .actions(self => {\n const { setSources: superSetSources } = self\n const clearFormsWarnings = () => {\n clearWarnings(self, [self.warnedWindow, self.formsWindow])\n }\n return {\n setFormsPinned(pinned: Pinned) {\n clearFormsWarnings()\n self.formsPinned = pinned\n },\n setFormsFloorBp(floorBp: FloorBp) {\n clearFormsWarnings()\n self.formsFloorBp = floorBp\n },\n // Core posts the new forms' warnings right after this, so the old\n // ones come down first\n setSources(sources: unknown, adapterConfig?: unknown) {\n if (self.walkForms) {\n clearFormsWarnings()\n self.warnedWindow = self.formsWindow\n }\n superSetSources?.(sources, adapterConfig)\n },\n }\n })\n .views(self => {\n const { trackMenuItems: superTrackMenuItems } = self\n return {\n formsMenuItems(): MenuItem[] {\n const pinned = self.formsWindow\n const visible = self.visibleWindow\n return [\n {\n label: pinnedLabel(pinned, self.formsCount),\n disabled: true,\n onClick: () => {},\n },\n {\n label: 'Re-pin to visible region',\n helpText:\n 'Cut the forms from the region the view shows. Panning and zooming leave the forms alone',\n disabled:\n !visible ||\n (pinned !== undefined &&\n pinnedLocus(visible) === pinnedLocus(pinned)),\n onClick: () => {\n if (visible) {\n self.setFormsPinned(visible)\n }\n },\n },\n {\n label: 'Hide changes under',\n subMenu: FLOORS.map(({ label, value }) => ({\n label,\n type: 'radio' as const,\n checked: self.formsFloor === value,\n onClick: () => {\n self.setFormsFloorBp(value)\n },\n })),\n },\n ]\n },\n trackMenuItems(): MenuItem[] {\n return self.walkForms\n ? [...superTrackMenuItems(), ...this.formsMenuItems()]\n : superTrackMenuItems()\n },\n }\n })\n}\n\nexport default function WalkFormsMenuF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint('Core-extendPluggableElement', element => {\n if (element instanceof DisplayType && takesFormsMenu(element)) {\n element.extendStateModel(withFormsMenu)\n }\n return element\n })\n}\n\nexport function warnIfNoFormsDisplay(pluginManager: PluginManager) {\n const displays = pluginManager.getElementTypesInGroup('display')\n if (!displays.some(d => d instanceof DisplayType && takesFormsMenu(d))) {\n console.warn(\n 'jbrowse-plugin-graphgenomeviewer: no linear VariantTrack display is registered, so WalkFormsAdapter tracks get no pin or floor menu',\n )\n }\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { DEFAULT_MAX_FORMS } from '../slotDefaults.ts'\nimport { fileLocationSlot, walksLocations } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config WalkFormsAdapter\n * #trackType VariantTrack\n * #fileFormat variant | Walk-file structural forms | Built by `gfa-to-tabix --walks`; one row per group of haplotypes making the same structural changes\n * Groups the haplotypes of a\n * [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) `--walks` file by the\n * structural changes their walks make over one pinned window, through\n * @gmod/gfa-tabix's `getFormsForRange` and `structuralForms`. Each group is a\n * form, which `LinearVariantDisplay` draws as one row, and each\n * change a variant whose genotype is `1` in the forms that make it.\n *\n * - The adapter cuts the pinned window once, whatever the view shows; outside\n * it the rows stay and draw empty\n * - The largest `maxForms` forms get a row each, labelled by share and largest\n * change (\"66% \u00B7 del 18.4kb\"); the rest share one empty \"other forms\" row\n * - A variant's `consequence` is `loss`, `gain` or `inversion`, for\n * colouring the cells; `svType` and `type` follow core's names\n * - `walksUri` takes the prefix of one reference's walk file and resolves\n * `<walksUri>.walks.gz` and its directory `<walksUri>.walks.gz.idx`, as\n * the other walk adapters do. The adapter reads walk format 8, which\n * gfa-to-tabix writes from 5.0\n *\n * #example\n * ```js\n * {\n * type: 'WalkFormsAdapter',\n * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38-f8.GRCh38',\n * pinned: { refName: 'chr1', start: 109680000, end: 109715000 },\n * exclude: ['CHM13'],\n * }\n * ```\n */\nconst WalkFormsAdapter = ConfigurationSchema(\n 'WalkFormsAdapter',\n {\n /**\n * #slot\n * a `gfa-to-tabix --walks` file in walk format 8\n */\n walksLocation: fileLocationSlot('/path/to/graph.walks.gz'),\n /**\n * #slot\n * the walk file's directory, `<prefix>.<sample>.walks.gz.idx`. Unset\n * reads it beside the walk file.\n */\n walksIndex: fileLocationSlot(''),\n /**\n * #slot\n * The window the forms come from, `{ refName, start, end }`, 0-based and\n * half-open. `refName` is the contig as the walk file's reference sample\n * names it (`chr1`), or its full PanSN name (`GRCh38#0#chr1`).\n */\n pinned: {\n type: 'frozen',\n defaultValue: {},\n },\n /**\n * #slot\n * The assembly's other names for `pinned.refName`, tried in turn when the\n * walk file's reference sample has no contig by that name. The forms menu\n * fills it in from the track's assembly, so a window pinned on `6` in a\n * view of an assembly with bare contig names cuts `GRCh38#0#chr6`.\n */\n pinnedAliases: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * The smallest change that tells two forms apart: `auto`, which follows\n * the pinned window's width (50 bp under 25 kb, 1 kb to 300 kb, 10 kb\n * past it), or 50, 1000 or 10000. A change of floor regroups the same\n * cut.\n */\n floorBp: {\n type: 'frozen',\n defaultValue: 'auto',\n },\n /**\n * #slot\n * Samples or `sample#haplotype`s left out of every form, such as a second\n * reference the walk file carries as a haplotype (`CHM13` in HPRC's\n * GRCh38 file)\n */\n exclude: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * The most forms drawn as rows of their own, largest first. The rest\n * share one empty \"other forms\" row, and a warning counts them.\n */\n maxForms: {\n type: 'integer',\n defaultValue: DEFAULT_MAX_FORMS,\n },\n /**\n * #slot\n * The most compressed bytes the forms cut fetches from the walk file,\n * its blocks of walks kept in short form included, which its directory\n * gives before any row is read. A pinned window over it shows an error\n * instead. The default admits the MHC windows the format 7 file drew.\n * Bytes stand in for memory only roughly: a window under the budget can\n * still be heavy for a browser tab.\n */\n walkByteBudget: {\n type: 'integer',\n defaultValue: 1_500_000,\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n * preprocessor to allow the minimal config\n * ```json\n * {\n * \"type\": \"WalkFormsAdapter\",\n * \"walksUri\": \"chr22.GRCh38\",\n * \"pinned\": { \"refName\": \"chr22\", \"start\": 0, \"end\": 50000 }\n * }\n * ```\n */\n preProcessSnapshot: walksLocations,\n },\n)\n\nexport type WalkFormsAdapterConfig = Instance<typeof WalkFormsAdapter>\n\nexport default WalkFormsAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function WalkFormsAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'WalkFormsAdapter',\n displayName: 'Walk-file structural forms adapter',\n configSchema,\n adapterMetadata: {\n category: 'Variant adapters',\n },\n getAdapterClass: () =>\n import('./WalkFormsAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "export type LaneRibbons = 'reference' | 'neighbours'\n\nexport const DEFAULT_LANE_RIBBONS: LaneRibbons = 'reference'\n\nexport const LANE_RIBBONS_LABEL = 'Lane ribbons'\n\nexport const LANE_RIBBONS: { value: LaneRibbons; label: string }[] = [\n { value: 'reference', label: 'each lane against the reference' },\n { value: 'neighbours', label: 'each lane against the lane above' },\n]\n\nexport const LANE_RIBBONS_VALUES = LANE_RIBBONS.map(option => option.value)\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { lenientSlotEnum } from '../GraphGenomeView/lenientEnum.ts'\nimport { DEFAULT_LANE_RIBBONS, LANE_RIBBONS_VALUES } from '../laneRibbons.ts'\nimport { WALK_BUDGETS } from '../slotDefaults.ts'\nimport { fileLocationSlot, walksLocations } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config WalkTabixSyntenyAdapter\n * #trackType GraphTrack\n * #fileFormat synteny | Walk-indexed graph | Built by `gfa-to-tabix --walks`; haplotype lanes and local subgraphs from a walk file\n * Serves a pangenome graph whose haplotype walks\n * [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) `--walks` filed under\n * tiles of a reference, as haplotype-versus-reference alignments, the shape\n * `MultiWaySyntenyDisplay` draws as one lane per haplotype, and as the graph\n * display's cut. A window on the reference reads the walk rows filed under\n * it, and each haplotype is aligned to the reference, or to another\n * haplotype, on the nodes both walks visit. No base is compared, so a short\n * bubble with equal bases on both sides is written as mismatches and any other\n * as an insertion and a deletion.\n *\n * `walksUri` takes the prefix of one reference's walk file, `<prefix>.<sample>`,\n * and resolves `<walksUri>.walks.gz` and its directory `<walksUri>.walks.gz.idx`.\n * The adapter reads walk format 8, which gfa-to-tabix writes from 5.0, through\n * @gmod/gfa-tabix.\n * Only a window on the anchor is answered.\n *\n * #example\n * ```js\n * {\n * type: 'WalkTabixSyntenyAdapter',\n * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38-f8.GRCh38',\n * assemblyNames: ['hg38'],\n * assemblyNameToPanSN: { hg38: 'GRCh38' },\n * }\n * ```\n */\n\nconst WalkTabixSyntenyAdapter = ConfigurationSchema(\n 'WalkTabixSyntenyAdapter',\n {\n /**\n * #slot\n * The first entry is the anchor: the JBrowse assembly the walk file's\n * reference sample is loaded as. A haplotype needs no entry: its lane\n * draws on the session assembly `assemblyNameToPanSN` maps to it, at\n * haplotype (`HG002#1`) or sample (`HG002`) depth, and a haplotype with no\n * assembly is still a lane, labelled by its PanSN prefix.\n */\n assemblyNames: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * a `gfa-to-tabix --walks` file in walk format 8\n */\n walksLocation: fileLocationSlot('/path/to/graph.walks.gz'),\n /**\n * #slot\n * the walk file's directory, `<prefix>.<sample>.walks.gz.idx`. Unset\n * reads it beside the walk file.\n */\n walksIndex: fileLocationSlot(''),\n /**\n * #slot\n * the most haplotype steps one window keeps; a window whose walks hold\n * more shows a zoom-in notice instead, as does one whose rows hold eight\n * times as many. Counts only the haplotypes asked for. Walk rows draw\n * runs rather than steps, as does a graph folded to threads, which reads\n * the walks as runs, and both are bounded by `walkByteBudget` alone.\n */\n walkStepBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.stepBudget,\n },\n /**\n * #slot\n * the most compressed bytes one window fetches from the walk file, which\n * its directory gives before any row is read; a window over it shows a\n * zoom-in notice instead.\n */\n walkByteBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.byteBudget,\n },\n /**\n * #slot\n * the haplotypes the graph display is cut for until the user picks\n * others, as PanSN prefixes (`HG002#1`, or `HG002` for both of its\n * haplotypes). Empty means the lanes the track's `assemblyNames` lists\n * after its reference, else every haplotype.\n */\n defaultHaplotypes: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * A tab-separated table of per-sample metadata, which the graph view's\n * walk rows group by. Its header row names the columns, and its first\n * column is the walk's sample (`HG00097`) or haplotype (`HG00097#1`).\n * Empty means no grouping. A `color` column (`#rgb` or `#rrggbb`) colours\n * that haplotype's lane, as the header's `lanes[].color` and\n * `anchorColor`, and its lifted walk in the graph display; a row whose\n * `assembly` column names a lane's assembly counts for it too.\n */\n samplesTsvLocation: fileLocationSlot(''),\n /**\n * #slot\n * what each lane's ribbons join it to: `reference`, the reference, read\n * from where the walk file places each step, or `neighbours`, the lane\n * above, each pair aligned on the nodes both walk. A multi-way display\n * that does not say it reads lanes against the reference, as JBrowse\n * releases before it did not, gets `neighbours` whatever this says\n */\n laneRibbons: {\n type: 'stringEnum',\n model: lenientSlotEnum(LANE_RIBBONS_VALUES, DEFAULT_LANE_RIBBONS),\n defaultValue: DEFAULT_LANE_RIBBONS,\n },\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN prefix in the graph, sample or\n * haplotype level (`{ hg38: 'GRCh38', 'HG002.1': 'HG002#1' }`). An\n * assembly not listed maps to itself.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n * preprocessor to allow the minimal config, for the GRCh38 set of a graph\n * built by `gfa-to-tabix --walks -o chr22`\n * ```json\n * {\n * \"type\": \"WalkTabixSyntenyAdapter\",\n * \"walksUri\": \"chr22.GRCh38\",\n * \"assemblyNames\": [\"hg38\"],\n * \"assemblyNameToPanSN\": { \"hg38\": \"GRCh38\" }\n * }\n * ```\n */\n preProcessSnapshot: walksLocations,\n },\n)\n\nexport type WalkTabixSyntenyAdapterConfig = Instance<\n typeof WalkTabixSyntenyAdapter\n>\n\nexport default WalkTabixSyntenyAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function WalkTabixSyntenyAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'WalkTabixSyntenyAdapter',\n displayName: 'Walk-indexed graph adapter',\n configSchema,\n // the capabilities GbzBaseSyntenyAdapter declares, for the same\n // reasons: the header lists every haplotype as a lane, and one read\n // of an anchor window answers any pair of lanes, or several. The\n // header's lanesReadAgainstAnchor sets which the display reads\n adapterCapabilities: [\n 'getSubgraph',\n 'headerLanes',\n 'lanePairsOnAnchor',\n 'lanePairBatches',\n ],\n adapterMetadata: {\n category: 'Synteny adapters',\n },\n getAdapterClass: () =>\n import('./WalkTabixSyntenyAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { buildAdapterConfig } from '../GraphAddTrackWorkflow/buildTrackConfig'\nimport { isGraphIndexLocation } from '../GraphAddTrackWorkflow/graphManifest'\nimport { WALKS_SUFFIX, locationName, readsSiblings } from '../locationName'\n\nimport type { GraphFileChoice } from '../GraphAddTrackWorkflow/buildTrackConfig'\nimport type { FileLocation } from '@jbrowse/core/util'\n\nconst BUBBLES_SUFFIX = '.bubbles.bed.gz'\n\nfunction isGbzLocation(loc: FileLocation) {\n return locationName(loc).toLowerCase().endsWith('.gbz.db')\n}\n\nfunction guessChoice(\n file: FileLocation,\n index: FileLocation | undefined,\n adapterHint: string | undefined,\n): GraphFileChoice | undefined {\n const name = locationName(file)\n const allows = (type: GraphFileChoice) => !adapterHint || adapterHint === type\n // a file picked in the browser has no index beside it to assume\n const indexReachable = index !== undefined || readsSiblings(file)\n return isGbzLocation(file)\n ? allows('GbzBaseSyntenyAdapter')\n ? 'GbzBaseSyntenyAdapter'\n : undefined\n : isGraphIndexLocation(file)\n ? allows('RgfaTabixAdapter')\n ? 'RgfaTabixAdapter'\n : undefined\n : !indexReachable\n ? undefined\n : name.endsWith(WALKS_SUFFIX)\n ? // lanes beside the graph, unless the hint asks for the rGFA\n // adapter, which reads the file without them\n adapterHint === 'RgfaTabixAdapter'\n ? 'RgfaTabixWalks'\n : allows('WalkTabixSyntenyAdapter')\n ? 'WalkTabixSyntenyAdapter'\n : undefined\n : allows('MinigraphBubbleAdapter') &&\n (name.endsWith(BUBBLES_SUFFIX) || adapterHint !== undefined)\n ? 'MinigraphBubbleAdapter'\n : undefined\n}\n\nexport function guessGraphAdapter(\n file: FileLocation,\n index?: FileLocation,\n adapterHint?: string,\n) {\n const choice = guessChoice(file, index, adapterHint)\n return choice\n ? buildAdapterConfig({\n choice,\n loc: file,\n indexLoc: index,\n assembly: '',\n sample: '',\n })\n : undefined\n}\n", "import { guessGraphAdapter } from './guessAdapter'\nimport { GRAPH_ADAPTERS, walkIndexed } from '../graphTrackConfig'\nimport { isRecord } from '../isRecord'\nimport { WALKS_SUFFIX, splitUri, walkFileSample } from '../locationName'\nimport { LANE_ADAPTERS } from '../panSNAliases/trackAdapterConfig'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type {\n AdapterGuesser,\n TrackTypeGuesser,\n} from '@jbrowse/core/util/tracks'\n\ntype TrackConfigSnapshot = Record<string, unknown>\n\n// A lanes adapter cuts on the first assembly it names. A track added through\n// Open track names that assembly on the track alone.\nexport function withLaneAnchor(snap: TrackConfigSnapshot) {\n const adapter = snap.adapter as\n { type?: string; assemblyNames?: unknown[] } | undefined\n return adapter?.type !== undefined &&\n LANE_ADAPTERS.has(adapter.type) &&\n !adapter.assemblyNames?.length &&\n Array.isArray(snap.assemblyNames) &&\n snap.assemblyNames.length > 0\n ? { ...snap, adapter: { ...adapter, assemblyNames: snap.assemblyNames } }\n : snap\n}\n\n// The walk file a config snapshot names, by the `walksUri` shorthand or the\n// location it expands to\nfunction walkFileName({ walksUri, walksLocation }: Record<string, unknown>) {\n const { uri, localPath, name } = isRecord(walksLocation) ? walksLocation : {}\n return typeof walksUri === 'string' && walksUri !== ''\n ? `${walksUri}${WALKS_SUFFIX}`\n : typeof uri === 'string'\n ? splitUri(uri).name\n : typeof localPath === 'string'\n ? localPath\n : typeof name === 'string'\n ? name\n : undefined\n}\n\n// A walk file opened with no PanSN map reads as the sample its name gives, on\n// the track's assembly; a guessed adapter had no assembly to key that by\nexport function withWalkReference(snap: TrackConfigSnapshot) {\n const adapter = isRecord(snap.adapter) ? snap.adapter : undefined\n const [assembly] = Array.isArray(snap.assemblyNames)\n ? (snap.assemblyNames as string[])\n : []\n const file =\n adapter && walkIndexed(adapter) ? walkFileName(adapter) : undefined\n const sample = file ? walkFileSample(file) : undefined\n return adapter &&\n assembly &&\n sample &&\n sample !== assembly &&\n adapter.assemblyNameToPanSN === undefined\n ? {\n ...snap,\n adapter: { ...adapter, assemblyNameToPanSN: { [assembly]: sample } },\n }\n : snap\n}\n\nexport default function GraphTrackDefaultsF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint(\n 'Core-preProcessTrackConfig',\n withLaneAnchor,\n )\n pluginManager.addToExtensionPoint(\n 'Core-preProcessTrackConfig',\n withWalkReference,\n )\n pluginManager.addToExtensionPoint(\n 'Core-guessAdapterForLocation',\n (next: AdapterGuesser): AdapterGuesser =>\n (file, index, adapterHint) =>\n guessGraphAdapter(file, index, adapterHint) ??\n next(file, index, adapterHint),\n )\n pluginManager.addToExtensionPoint(\n 'Core-guessTrackTypeForLocation',\n (next: TrackTypeGuesser): TrackTypeGuesser =>\n (adapterName, file) =>\n GRAPH_ADAPTERS.has(adapterName)\n ? 'GraphTrack'\n : adapterName === 'MinigraphBubbleAdapter'\n ? 'FeatureTrack'\n : next(adapterName, file),\n )\n}\n", "import { isRecord } from '../isRecord'\nimport { withRows } from '../launchFromGraph/linearViewTarget'\n\nexport interface HighlightRegion {\n refName: string\n start: number\n end: number\n assemblyName?: string\n}\n\nexport interface GraphViewHighlight {\n key: string\n region: HighlightRegion\n}\n\nfunction readRegion(value: unknown): HighlightRegion | undefined {\n let region: HighlightRegion | undefined\n if (isRecord(value)) {\n const { refName, start, end, assemblyName } = value\n if (\n typeof refName === 'string' &&\n typeof start === 'number' &&\n typeof end === 'number'\n ) {\n region = {\n refName,\n start,\n end,\n assemblyName:\n typeof assemblyName === 'string' ? assemblyName : undefined,\n }\n }\n }\n return region\n}\n\n// Whether a graph view's highlights belong on a given linear view.\n// `connectedViewId` is written by the launch menu, so a launched pair is\n// explicit. A graph view without one \u2014 a hand-written session snapshot, or\n// `Add > Graph genome view` followed by a subgraph load \u2014 matches any linear\n// view, because the alternative is silently drawing nothing.\n//\n// So does one whose linear view has been closed. Held to an id nothing answers\n// to, it matched no view and its hover drew nowhere for the rest of the\n// session, the view it next opened included.\nfunction isConnected(\n view: Record<string, unknown>,\n linearViewId: string,\n liveViewIds: ReadonlySet<unknown>,\n) {\n const connectedViewId = view.connectedViewId\n return (\n connectedViewId === undefined ||\n connectedViewId === linearViewId ||\n !liveViewIds.has(connectedViewId)\n )\n}\n\n// ...and whether the view can mean anything by it. `getHighlightCoords`\n// canonicalizes a refName against the region's OWN assembly and then lays it\n// out against this view's displayed regions, without ever asking whether the\n// two are the same assembly \u2014 so a band handed to the wrong view is drawn, at\n// coordinates that belong to somebody else's genome.\n//\n// That is not hypothetical for an unpaired graph, which by the rule above\n// matches every linear view in the session. A synteny stack's rows are LGVs on\n// different assemblies, and a PanSN name reduces to a bare contig: the five\n// E. coli strains each have one refName `chr`, so a graph cut from K12 painted\n// its K12 interval across Sakai's row and CFT073's at their own offsets. With\n// the assembly checked the reference row keeps the band and the rest correctly\n// draw nothing.\n//\n// A region stating no assembly still passes \u2014 `readRegion` leaves it optional,\n// and the fallback is the behaviour every existing snapshot has.\nfunction isOnAssembly(\n region: HighlightRegion,\n assemblyNames: string[] | undefined,\n) {\n return (\n region.assemblyName === undefined ||\n assemblyNames === undefined ||\n assemblyNames.includes(region.assemblyName)\n )\n}\n\n// The graph displays in a linear view's own tracks, connected to it by where\n// they sit.\nfunction trackGraphs(view: Record<string, unknown>) {\n const tracks = Array.isArray(view.tracks) ? view.tracks : []\n return tracks.flatMap((track: unknown) =>\n isRecord(track) && Array.isArray(track.displays)\n ? track.displays.filter(\n (display: unknown): display is Record<string, unknown> =>\n isRecord(display) && display.type === 'LinearGraphDisplay',\n )\n : [],\n )\n}\n\n// The highlights a linear view should draw for the graph views connected to it.\n// Reads `session.views` structurally: the members it needs are declared by\n// GraphGenomeView, not by the AbstractViewModel the session array is typed as.\nexport function graphViewHighlights(\n views: unknown[],\n linearViewId: string,\n // the drawing view's own assemblies, so a band is only drawn where its\n // coordinates mean something \u2014 see isOnAssembly\n linearAssemblyNames?: string[],\n): GraphViewHighlight[] {\n const highlights: GraphViewHighlight[] = []\n const candidates = withRows(views)\n const liveViewIds = new Set(\n candidates.map(view => (isRecord(view) ? view.id : undefined)),\n )\n for (const view of candidates) {\n if (isRecord(view) && view.id === linearViewId) {\n for (const display of trackGraphs(view)) {\n const region = readRegion(display.hoverHighlight)\n if (region && isOnAssembly(region, linearAssemblyNames)) {\n highlights.push({\n key: typeof display.id === 'string' ? display.id : 'graph-track',\n region,\n })\n }\n }\n }\n // A hovered node's span on each haplotype's own assembly goes to any\n // view of that assembly, paired or not: the assembly name says where it\n // belongs, and those views are a synteny stack's rows or opened beside\n for (const graph of isRecord(view)\n ? [\n ...trackGraphs(view),\n ...(view.type === 'GraphGenomeView' ? [view] : []),\n ]\n : []) {\n const spans = Array.isArray(graph.assemblyHoverHighlights)\n ? graph.assemblyHoverHighlights\n : []\n spans.forEach((value: unknown, i) => {\n const region = readRegion(value)\n if (\n region?.assemblyName !== undefined &&\n linearAssemblyNames?.includes(region.assemblyName)\n ) {\n highlights.push({\n key: `${typeof graph.id === 'string' ? graph.id : 'graph'}-${i}`,\n region,\n })\n }\n })\n }\n if (\n isRecord(view) &&\n view.type === 'GraphGenomeView' &&\n isConnected(view, linearViewId, liveViewIds)\n ) {\n const region = readRegion(view.hoverHighlight)\n if (region && isOnAssembly(region, linearAssemblyNames)) {\n highlights.push({\n key: typeof view.id === 'string' ? view.id : 'graph',\n region,\n })\n }\n }\n }\n return highlights\n}\n", "import { getSession } from '@jbrowse/core/util'\nimport { alpha } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { graphViewHighlights } from './graphViewHighlights'\n\nimport type { HighlightRegion } from './graphViewHighlights'\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\nconst useStyles = makeStyles()(theme => ({\n highlight: {\n height: '100%',\n position: 'absolute',\n background: alpha(theme.palette.primary.main, 0.08),\n borderLeft: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n borderRight: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n pointerEvents: 'none',\n zIndex: 10,\n },\n}))\n\n// One band over the linear view for a hovered graph node. `getHighlightCoords`\n// is the LGV's own projection \u2014 it canonicalizes the refName and floors the\n// width to 3 px, so a pure insertion (a zero-length reference span) still shows\n// as a mark rather than vanishing.\nconst Highlight = observer(function Highlight({\n model,\n region,\n}: {\n model: LinearGenomeViewModel\n region: HighlightRegion\n}) {\n const { classes } = useStyles()\n const coords = model.getHighlightCoords(region)\n return coords ? (\n <div\n data-testid=\"graph-node-highlight\"\n className={classes.highlight}\n style={{ left: coords.left, width: coords.width }}\n />\n ) : null\n})\n\nconst GraphNodeHighlight = observer(function GraphNodeHighlight({\n model,\n}: {\n model: LinearGenomeViewModel\n}) {\n const { views } = getSession(model)\n return (\n <>\n {graphViewHighlights([...views], model.id, model.assemblyNames).map(\n ({ key, region }) => (\n <Highlight key={`graph-hover-${key}`} model={model} region={region} />\n ),\n )}\n </>\n )\n})\n\nexport default GraphNodeHighlight\n", "import GraphNodeHighlight from './GraphNodeHighlight'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\n// The graph-to-linear half of the hover sync. The reverse half needs no mount\n// point: an LGV already publishes its hover to `session.hovered`, and the graph\n// view's own autorun reads it (see GraphGenomeView/pane/renderingActions.ts).\n//\n// Mounted through the extension point rather than imported by the LGV, so this\n// plugin never imports @jbrowse/plugin-linear-genome-view at runtime: it is not\n// one of JBrowse's shared globals, so a value import would bundle a second copy\n// of that whole plugin.\nconst POINT = 'LinearGenomeView-TracksContainerComponent'\n\nexport default function contributeGraphHoverSync(pluginManager: PluginManager) {\n pluginManager.contributeToExtensionPoint(POINT, ({ model }) => (\n <GraphNodeHighlight key=\"graphgenomeview-hover-highlight\" model={model} />\n ))\n}\n", "import { DisplayType } from '@jbrowse/core/pluggableElementTypes'\nimport { getContainingTrack } from '@jbrowse/core/util'\n\nimport { trackAdapterConfig } from './trackAdapterConfig'\nimport { SYNTENY_DISPLAYS } from '../GraphTrack/index'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { IAnyModelType, IAnyStateTreeNode } from '@jbrowse/mobx-state-tree'\n\n// Core's synteny displays send `adapterConfig` with every request, the lane\n// listing's included, so overriding the getter reaches them all\nfunction withTrackAdapterConfig(model: IAnyModelType) {\n return model.views((self: IAnyStateTreeNode) => ({\n get adapterConfig(): Record<string, unknown> {\n return trackAdapterConfig(self, getContainingTrack(self).configuration)\n },\n }))\n}\n\nexport default function PanSNAliasesF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint('Core-extendPluggableElement', element => {\n if (\n element instanceof DisplayType &&\n SYNTENY_DISPLAYS.includes(element.name)\n ) {\n element.extendStateModel(withTrackAdapterConfig)\n }\n return element\n })\n}\n", "// The name JBrowse knows this plugin by, which a config's `plugins` entry\n// states beside its `esmUrl`.\nexport const PLUGIN_NAME = 'GraphGenomeView'\n", "export const version = '10.16.0'\n", "import Plugin from '@jbrowse/core/Plugin'\nimport { isAbstractMenuManager } from '@jbrowse/core/util'\nimport BubbleChartIcon from '@mui/icons-material/BubbleChart'\n\nimport GbzBaseSyntenyAdapterF from './GbzBaseSyntenyAdapter/index'\nimport GetGraphHaplotypes from './GetGraphHaplotypes'\nimport GetGraphReads from './GetGraphReads'\nimport GetSubgraph from './GetSubgraph'\nimport GraphAddTrackWorkflowF from './GraphAddTrackWorkflow/index'\nimport GraphComputeLayout from './GraphComputeLayout'\nimport GraphGenomeViewF from './GraphGenomeView/index'\nimport GraphTrackF from './GraphTrack/index'\nimport LaunchGraphGenomeViewF from './LaunchGraphGenomeView'\nimport LinearGraphDisplayF from './LinearGraphDisplay/index'\nimport MinigraphBubbleAdapterF from './MinigraphBubbleAdapter/index'\nimport RgfaTabixAdapterF from './RgfaTabixAdapter/index'\nimport WalkFormsMenuF, {\n warnIfNoFormsDisplay,\n} from './WalkFormsAdapter/formsMenu'\nimport WalkFormsAdapterF from './WalkFormsAdapter/index'\nimport WalkTabixSyntenyAdapterF from './WalkTabixSyntenyAdapter/index'\nimport GraphTrackDefaultsF from './graphTrackDefaults/index'\nimport contributeGraphHoverSync from './hoverSync/index'\nimport PanSNAliasesF from './panSNAliases/index'\nimport { PLUGIN_NAME } from './pluginName'\nimport { version } from './version'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\n\nexport default class GraphGenomeViewPlugin extends Plugin {\n name = PLUGIN_NAME\n version = version\n\n install(pluginManager: PluginManager) {\n GraphGenomeViewF(pluginManager)\n LinearGraphDisplayF(pluginManager)\n GraphTrackF(pluginManager)\n LaunchGraphGenomeViewF(pluginManager)\n contributeGraphHoverSync(pluginManager)\n RgfaTabixAdapterF(pluginManager)\n MinigraphBubbleAdapterF(pluginManager)\n GbzBaseSyntenyAdapterF(pluginManager)\n WalkTabixSyntenyAdapterF(pluginManager)\n WalkFormsAdapterF(pluginManager)\n WalkFormsMenuF(pluginManager)\n GraphAddTrackWorkflowF(pluginManager)\n GraphTrackDefaultsF(pluginManager)\n PanSNAliasesF(pluginManager)\n pluginManager.addRpcMethod(() => new GraphComputeLayout(pluginManager))\n pluginManager.addRpcMethod(() => new GetSubgraph(pluginManager))\n pluginManager.addRpcMethod(() => new GetGraphReads(pluginManager))\n pluginManager.addRpcMethod(() => new GetGraphHaplotypes(pluginManager))\n }\n\n // A throw from configure() takes the whole session to its error page, and a\n // menu entry is not worth that: hubs 1.0.9 did exactly this to every\n // jbrowse.org/ucsc launch by appending to a menu a released host defines as\n // a function. The view is still reachable without the entry.\n configure(pluginManager: PluginManager) {\n warnIfNoFormsDisplay(pluginManager)\n try {\n if (isAbstractMenuManager(pluginManager.rootModel)) {\n pluginManager.rootModel.appendToSubMenu(['Add'], {\n label: 'Graph genome view',\n icon: BubbleChartIcon,\n onClick: (session: AbstractSessionModel) => {\n session.addView('GraphGenomeView', {})\n },\n })\n }\n } catch (e) {\n console.warn('[GraphGenomeView] could not add the Add menu entry', e)\n }\n }\n}\n"],
|
|
5
|
-
"mappings":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AAM,IAAIiB,GAAcjB,CAAa,CAAC,EACjEA,EAAc,aAAa,IAAM,IAAIkB,EAAmBlB,CAAa,CAAC,CACxE,CAMA,UAAUA,EAA8B,CACtCmB,GAAqBnB,CAAa,EAClC,GAAI,CACEoB,GAAsBpB,EAAc,SAAS,GAC/CA,EAAc,UAAU,gBAAgB,CAAC,KAAK,EAAG,CAC/C,MAAO,oBACP,KAAMqB,GACN,QAAUC,GAAkC,CAC1CA,EAAQ,QAAQ,kBAAmB,CAAC,CAAC,CACvC,CACF,CAAC,CAEL,OAASC,EAAG,CACV,QAAQ,KAAK,qDAAsDA,CAAC,CACtE,CACF,CACF",
|
|
6
|
-
"names": ["host", "Plugin_default", "host", "host", "AdapterType_default", "host", "fileLocationSlot", "uri", "tabixIndexSchema", "name", "defaultUri", "ConfigurationSchema", "types", "tbiBeside", "baseUri", "csi", "walksLocations", "snap", "walksUri", "walks", "WALKS_SUFFIX", "GbzBaseSyntenyAdapter", "ConfigurationSchema", "fileLocationSlot", "tabixIndexSchema", "types", "GBZ_CUT_DEFAULTS", "snap", "uri", "baseUri", "reads", "readsIndexBeside", "name", "query", "splitUri", "configSchema_default", "GbzBaseSyntenyAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "GetGraphHaplotypes", "RpcMethodType", "args", "adapter", "adapterImplementing", "GraphAddTrackWidget", "lazy", "GraphAddTrackWorkflowF", "pluginManager", "AddTrackWorkflowType", "types", "GraphComputeLayout", "RpcMethodType", "args", "graph", "options", "signal", "statusCallback", "resolve", "layoutEngine", "host", "ViewType_default", "host", "host", "read", "name", "defineLaunchKeys", "withLaunchInput_default", "host", "host", "read", "name", "BaseViewModel", "read", "models_default", "host", "stateModelFactory", "types", "BaseViewModel", "GraphPane", "lenientMaybeEnum", "LAYOUT_MODE_VALUES", "lenientOptionalEnum", "LAYOUT_ENGINE_VALUES", "HOVER_HIGHLIGHT_VALUES", "LINKS_DRAWN_VALUES", "self", "encoding", "settings", "setBaseWidth", "width", "graphTrackChoices", "getSession", "clearPane", "loadRegion", "region", "fileName", "adapter", "span", "problem", "formatSpanBp", "stated", "session", "assemblyManager", "assembly", "isAlive", "canonicalRegion", "location", "_from", "trackId", "loc", "showTrackInLinearView", "isViewContainer", "graphLaunchKeys", "defineLaunchKeys", "GraphGenomeViewF", "pluginManager", "ViewType_default", "stateModelFactory", "lazy", "SYNTENY_DISPLAYS", "displaysInOrder", "pluginManager", "displays", "named", "name", "d", "needs", "capability", "display", "GraphTrackF", "configSchema", "ConfigurationSchema", "createBaseTrackConfig", "track", "TrackType", "createBaseTrackModel", "LaunchGraphGenomeViewF", "pluginManager", "args", "session", "spec", "host", "DisplayType_default", "host", "host", "read", "name", "heightModeConfigSchemaFields", "heightModeConfigSchemaFields_default", "host", "read", "name", "trackHeightConfigSchemaFields", "trackHeightConfigSchemaFields_default", "host", "read", "name", "facetConfigSchema", "facetConfigSchema_default", "host", "graphFacetConfigSchema", "ConfigurationSchema", "facetConfigSchema", "EXTENT_VALUES", "DEFAULT_EXTENT", "configSchemaFactory", "ConfigurationSchema", "lenientSlotEnum", "LAYOUT_MODE_VALUES", "LAYOUT_ENGINE_VALUES", "graphFacetConfigSchema", "HOVER_HIGHLIGHT_VALUES", "LINKS_DRAWN_VALUES", "DEFAULT_LINKS_DRAWN", "SITES_VALUES", "DEFAULT_SITES", "KEY_PLACEMENT_VALUES", "DEFAULT_KEY_PLACEMENT", "EXTENT_VALUES", "DEFAULT_EXTENT", "trackHeightConfigSchemaFields", "heightModeConfigSchemaFields", "DEFAULT_TRACK_FIT", "LinearGraphDisplayF", "pluginManager", "configSchema", "configSchemaFactory", "DisplayType_default", "stateModelFactory", "lazy", "normalizeSnapshot", "snap", "uri", "baseUri", "csi", "tbiBeside", "MinigraphBubbleAdapter", "ConfigurationSchema", "fileLocationSlot", "tabixIndexSchema", "configSchema_default", "MinigraphBubbleAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "prefixLocations", "snap", "uri", "baseUri", "csi", "format", "GRAPH_SUFFIX", "tbiBeside", "normalizeSnapshot", "coarse", "walksLocations", "RgfaTabixCoarseTier", "ConfigurationSchema", "fileLocationSlot", "tabixIndexSchema", "RgfaTabixAdapter", "WALK_BUDGETS", "configSchema_default", "RgfaTabixAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "takesFormsMenu", "display", "FLOORS", "pinnedLabel", "pinned", "forms", "pinnedLocus", "clearWarnings", "node", "windows", "session", "getSession", "prefixes", "w", "warningPrefix", "message", "p", "withFormsMenu", "model", "types", "self", "trackAdapterSnapshot", "pinnedOf", "assemblyName", "getConfAssemblyNamesOrNone", "assembly", "conf", "floorOf", "n", "row", "view", "getContainingView", "window", "isLinearHost", "hostWindow", "superSetSources", "clearFormsWarnings", "floorBp", "sources", "adapterConfig", "superTrackMenuItems", "visible", "label", "value", "WalkFormsMenuF", "pluginManager", "element", "DisplayType", "warnIfNoFormsDisplay", "d", "WalkFormsAdapter", "ConfigurationSchema", "fileLocationSlot", "DEFAULT_MAX_FORMS", "walksLocations", "configSchema_default", "WalkFormsAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "DEFAULT_LANE_RIBBONS", "LANE_RIBBONS", "LANE_RIBBONS_VALUES", "option", "WalkTabixSyntenyAdapter", "ConfigurationSchema", "fileLocationSlot", "WALK_BUDGETS", "lenientSlotEnum", "LANE_RIBBONS_VALUES", "DEFAULT_LANE_RIBBONS", "walksLocations", "configSchema_default", "WalkTabixSyntenyAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "BUBBLES_SUFFIX", "isGbzLocation", "loc", "locationName", "guessChoice", "file", "index", "adapterHint", "name", "allows", "type", "indexReachable", "readsSiblings", "isGraphIndexLocation", "WALKS_SUFFIX", "guessGraphAdapter", "choice", "buildAdapterConfig", "withLaneAnchor", "snap", "adapter", "LANE_ADAPTERS", "walkFileName", "walksUri", "walksLocation", "uri", "localPath", "name", "isRecord", "WALKS_SUFFIX", "splitUri", "withWalkReference", "assembly", "file", "walkIndexed", "sample", "walkFileSample", "GraphTrackDefaultsF", "pluginManager", "next", "index", "adapterHint", "guessGraphAdapter", "adapterName", "GRAPH_ADAPTERS", "readRegion", "value", "region", "isRecord", "refName", "start", "end", "assemblyName", "isConnected", "view", "linearViewId", "liveViewIds", "connectedViewId", "isOnAssembly", "assemblyNames", "trackGraphs", "track", "display", "graphViewHighlights", "views", "linearAssemblyNames", "highlights", "candidates", "withRows", "graph", "i", "useStyles", "makeStyles", "theme", "alpha", "Highlight", "observer", "model", "region", "classes", "coords", "jsx", "GraphNodeHighlight", "views", "getSession", "Fragment", "graphViewHighlights", "key", "GraphNodeHighlight_default", "POINT", "contributeGraphHoverSync", "pluginManager", "model", "jsx", "GraphNodeHighlight_default", "withTrackAdapterConfig", "model", "self", "trackAdapterConfig", "getContainingTrack", "PanSNAliasesF", "pluginManager", "element", "DisplayType", "SYNTENY_DISPLAYS", "PLUGIN_NAME", "version", "GraphGenomeViewPlugin", "Plugin_default", "PLUGIN_NAME", "version", "pluginManager", "GraphGenomeViewF", "LinearGraphDisplayF", "GraphTrackF", "LaunchGraphGenomeViewF", "contributeGraphHoverSync", "RgfaTabixAdapterF", "MinigraphBubbleAdapterF", "GbzBaseSyntenyAdapterF", "WalkTabixSyntenyAdapterF", "WalkFormsAdapterF", "WalkFormsMenuF", "GraphAddTrackWorkflowF", "GraphTrackDefaultsF", "PanSNAliasesF", "GraphComputeLayout", "GetSubgraph", "GetGraphReads", "GetGraphHaplotypes", "warnIfNoFormsDisplay", "isAbstractMenuManager", "BubbleChart_default", "session", "e"]
|
|
4
|
+
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/core/Plugin\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/Plugin\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/AdapterType\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/AdapterType\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport { WALKS_SUFFIX } from './locationName.ts'\n\n// A file slot whose default is a url, '' for none\nexport const fileLocationSlot = (uri: string) => ({\n type: 'fileLocation' as const,\n defaultValue: { uri, locationType: 'UriLocation' },\n})\n\n/**\n * The index slot `openTabixSlot` reads: its own `location` and `indexType`\n */\nexport const tabixIndexSchema = (name: string, defaultUri = '') =>\n ConfigurationSchema(name, {\n /**\n * #slot\n */\n indexType: {\n model: types.enumeration('IndexType', ['TBI', 'CSI']),\n type: 'stringEnum',\n defaultValue: 'TBI',\n },\n /**\n * #slot\n */\n location: fileLocationSlot(defaultUri),\n })\n\n// The index slot's snapshot for a file whose `.tbi`, or `.csi`, sits beside it\nexport function tbiBeside(uri: string, baseUri: unknown, csi: unknown) {\n return {\n indexType: csi ? 'CSI' : 'TBI',\n location: { uri: `${uri}.${csi ? 'csi' : 'tbi'}`, baseUri },\n }\n}\n\n// The `walksUri` shorthand: `<walksUri>.walks.gz` and its directory beside it\nexport function walksLocations(snap: Record<string, unknown>) {\n const { walksUri, baseUri } = snap\n if (typeof walksUri !== 'string') {\n return snap\n }\n const walks = `${walksUri}${WALKS_SUFFIX}`\n return {\n ...snap,\n walksLocation: { uri: walks, baseUri },\n walksIndex: { uri: `${walks}.idx`, baseUri },\n }\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport { splitUri } from '../locationName'\nimport { GBZ_CUT_DEFAULTS } from '../slotDefaults.ts'\nimport { fileLocationSlot, tabixIndexSchema } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config GbzBaseSyntenyAdapter\n * #trackType GraphTrack\n * #fileFormat synteny | gbz-base pangenome database | Haplotype alignments read from the graph at query time, no PAF conversion\n * Serves a pangenome graph stored as a gbz-base SQLite database (`.gbz.db`) as\n * haplotype-versus-reference alignments, the shape `MultiWaySyntenyDisplay`\n * draws as one lane per haplotype. A window on the reference is located on the\n * graph's reference path, every haplotype's walk through the nodes it covers\n * is recovered and named, and each haplotype becomes one alignment record with\n * a CIGAR, so the graph is read through HTTP range requests with no offline\n * conversion. Naming the walks takes the companion haplotype index that\n * `gbz-haplotype-index` writes; without it the graph cannot say which\n * haplotype a walk belongs to.\n *\n * Only the fine tier exists: a whole-chromosome view stays on a PIF's coarse\n * tier. A window of the anchor answers any two lanes' alignment, so the\n * multi-way display fetches each adjacent lane pair directly.\n *\n * #example\n * ```js\n * {\n * type: 'GbzBaseSyntenyAdapter',\n * uri: 'hprc-v2.gbz.db',\n * assemblyNames: ['hg38'],\n * assemblyNameToPanSN: { hg38: 'GRCh38#0' },\n * }\n * ```\n */\nconst GbzBaseSyntenyAdapter = ConfigurationSchema(\n 'GbzBaseSyntenyAdapter',\n {\n /**\n * #slot\n * The first entry is the anchor: the JBrowse assembly the graph's reference\n * sample is loaded as. A haplotype needs no entry: its lane draws on the\n * session assembly named or aliased by its PanSN prefix (`HG002.1` with the\n * alias `HG002#1`), or the one `assemblyNameToPanSN` maps to it. A further\n * entry names an assembly by its sample (`HG002`), which takes both of the\n * sample's lanes. A haplotype with no assembly is still a lane, labelled by\n * its PanSN prefix.\n */\n assemblyNames: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * The `.gbz.db` written by `gbz-base construct`; read by HTTP range\n * requests, so it can be large.\n */\n gbzDbLocation: fileLocationSlot('/path/to/graph.gbz.db'),\n /**\n * #slot\n * The haplotype index `gbz-haplotype-index` writes beside the graph\n * database, which names its walks. One with stray rows (the tool from\n * 0.2.0) lets a fetch for a chosen set of lanes walk only those\n * haplotypes. Empty means `graph.haplotype-index.db` beside\n * `graph.gbz.db` if there is one; otherwise the walks go unnamed.\n */\n haplotypeIndexLocation: fileLocationSlot(''),\n /**\n * #slot\n * Reads aligned to the graph as GAF, which the tube map layouts draw under\n * the haplotypes. Its segment names have to be the cut's: numeric node ids,\n * or `vg giraffe --named-coordinates` on a graph whose segments were\n * renamed or chopped. Empty means no reads.\n */\n readsLocation: fileLocationSlot(''),\n /**\n * #slot\n * The `tabix -p gaf` index of a bgzipped `readsLocation`, which fetches the\n * reads over each window's node ids. Empty reads the GAF whole, up to 50 MB.\n */\n readsIndex: tabixIndexSchema('GbzBaseReadsIndex'),\n /**\n * #slot\n * A tab-separated table of per-sample metadata, which the graph view's\n * walk rows group by (\"Group by...\"). Its header row names the columns\n * (`population`, `superpopulation`, ...), and its first column is the\n * walk's sample (`HG00097`) or haplotype (`HG00097#1`). Empty means no\n * grouping. A `color` column (`#rgb` or `#rrggbb`) colours that\n * haplotype's lifted walk in the graph display.\n */\n samplesTsvLocation: fileLocationSlot(''),\n /**\n * #slot\n * How the graph view's subgraph is extended past the nodes the reference\n * window touches. `contained` adds every top-level snarl with both\n * boundary nodes in the window, which is what brings back the bubbles a\n * reference-only walk leaves out; a haplotype still breaks into a new W\n * line wherever it leaves the window's nodes (a 60 kb C4 window on the\n * HPRC graph: 2,703 nodes, 8,083 walks for 464 haplotypes). `overlapping`\n * also follows snarls that leave the window, so every haplotype is one\n * walk (464), at the price of every node in those snarls (4,184 there,\n * 24,547 across the KIV-2 repeat). `none` leaves only the bp `context`.\n */\n subgraphSnarls: {\n type: 'stringEnum',\n model: types.enumeration('SnarlOutput', [\n 'none',\n 'contained',\n 'overlapping',\n ]),\n defaultValue: GBZ_CUT_DEFAULTS.snarls,\n },\n /**\n * #slot\n * The graph sample the anchor window is located on. Empty means the sample\n * the anchor's PanSN prefix names, or the database's one reference sample\n * (`gbwt_reference_samples`) when the anchor names none; a database with\n * several reference samples then needs this set.\n */\n referenceSample: {\n type: 'string',\n defaultValue: '',\n },\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN prefix in the graph, sample or\n * haplotype level (`{ hg38: 'GRCh38#0', 'HG002.1': 'HG002#1' }`). Each\n * session assembly with a `sample#haplotype` alias (`HG002#1`) is mapped to\n * it already, so this is the override: an entry takes its prefix from any\n * assembly aliased to it. An assembly in neither maps to itself.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n /**\n * #slot\n * Graph context around the window, in bp, on top of `subgraphSnarls`: the\n * cut, its reference walk and every haplotype walk extend this far past\n * the window on each side. A haplotype walk breaks into pieces wherever it\n * leaves the cut's nodes, so context and snarls together decide whether a\n * lane's bubble is one record or several. A window inside a snarl far\n * larger than itself (MHC class II on the HPRC graph, 90 kb) is 1.1M pieces\n * at 0 and 464 walks at 1000, three times faster.\n */\n context: {\n type: 'number',\n defaultValue: GBZ_CUT_DEFAULTS.context,\n advanced: true,\n },\n /**\n * #slot\n * The most graph nodes one window may load before the query fails rather\n * than reading a whole chromosome into the worker.\n */\n nodeLimit: {\n type: 'number',\n defaultValue: GBZ_CUT_DEFAULTS.limit,\n advanced: true,\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n *\n *\n * preprocessor to allow minimal config, where a `.gz` `reads` is taken to\n * be bgzipped with a `.tbi` beside it:\n * ```json\n * {\n * \"type\": \"GbzBaseSyntenyAdapter\",\n * \"uri\": \"graph.gbz.db\",\n * \"reads\": \"reads.gaf.gz\",\n * \"assemblyNames\": [\"hg38\"]\n * }\n * ```\n */\n preProcessSnapshot: snap => {\n const { uri, baseUri, reads } = snap\n return {\n ...snap,\n ...(uri ? { gbzDbLocation: { uri, baseUri } } : {}),\n ...(typeof reads === 'string'\n ? {\n readsLocation: { uri: reads, baseUri },\n ...readsIndexBeside(reads, baseUri),\n }\n : {}),\n }\n },\n },\n)\n\n// a bgzipped GAF's index, before any query string its url carries\nfunction readsIndexBeside(reads: string, baseUri: unknown) {\n const { name, query } = splitUri(reads)\n return name.endsWith('.gz')\n ? { readsIndex: { location: { uri: `${name}.tbi${query}`, baseUri } } }\n : {}\n}\n\nexport type GbzBaseSyntenyAdapterConfig = Instance<typeof GbzBaseSyntenyAdapter>\n\nexport default GbzBaseSyntenyAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function GbzBaseSyntenyAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'GbzBaseSyntenyAdapter',\n displayName: 'gbz-base pangenome adapter',\n configSchema,\n // The same opened database serves the graph display's subgraph.\n // headerLanes: getHeader declares every haplotype as a lane, which is\n // what makes MultiWaySyntenyDisplay read the header of an untiered\n // adapter and offer its lane picker over the whole graph.\n // lanePairsOnAnchor: a window of the anchor answers any two lanes'\n // alignment to each other, so the display fetches each adjacent pair\n // rather than composing it through the reference.\n // lanePairBatches: every pair on a window comes from one cut\n adapterCapabilities: [\n 'getSubgraph',\n 'headerLanes',\n 'lanePairsOnAnchor',\n 'lanePairBatches',\n ],\n adapterMetadata: {\n category: 'Synteny adapters',\n },\n getAdapterClass: () =>\n import('./GbzBaseSyntenyAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { RpcMethodType } from '@jbrowse/core/pluggableElementTypes'\n\nimport { adapterImplementing } from './adapterImplementing'\n\nimport type { RpcExecuteArgs } from '@jbrowse/core/rpc/RpcRegistry'\n\n// The haplotypes a graph names without a cut, for the track's haplotype picker:\n// a walk-indexed rGFA's header lines. Undefined where the graph names none, and\n// the picker falls back to typed names.\n\nexport interface GetGraphHaplotypesArgs {\n adapterConfig: Record<string, unknown>\n}\n\ndeclare module '@jbrowse/core/rpc/RpcRegistry' {\n interface RpcRegistry {\n GetGraphHaplotypes: {\n args: GetGraphHaplotypesArgs\n return: string[] | undefined\n }\n }\n}\n\ninterface HaplotypeNamesAdapter {\n getHaplotypeNames(opts: {\n signal?: AbortSignal\n }): Promise<string[] | undefined>\n}\n\nexport default class GetGraphHaplotypes extends RpcMethodType<'GetGraphHaplotypes'> {\n name = 'GetGraphHaplotypes' as const\n\n async execute(args: RpcExecuteArgs<'GetGraphHaplotypes'>) {\n const { adapter } = await adapterImplementing<HaplotypeNamesAdapter>(\n this.pluginManager,\n args,\n 'getHaplotypeNames',\n )\n return adapter?.getHaplotypeNames({ signal: args.signal })\n }\n}\n", "import { lazy } from 'react'\n\nimport { AddTrackWorkflowType } from '@jbrowse/core/pluggableElementTypes'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nconst GraphAddTrackWidget = lazy(() => import('./AddTrackWorkflow'))\n\n// Open track cannot replace this form: only the form reads\n// `<prefix>.graph.json`, the coarse tier and the reference's PanSN sample, and\n// gfa-to-tabix build's config.json writes bare relative uris a hosted session\n// cannot load (9316630 restored the form 777e7c0 deleted)\nexport default function GraphAddTrackWorkflowF(pluginManager: PluginManager) {\n pluginManager.addAddTrackWorkflowType(\n () =>\n new AddTrackWorkflowType({\n name: 'Pangenome graph track',\n displayName: 'Add pangenome graph track',\n ReactComponent: GraphAddTrackWidget,\n stateModel: types.model({}),\n }),\n )\n}\n", "import { layoutEngine } from '@jbrowse/bandage-core/layoutEngines'\nimport { RpcMethodType } from '@jbrowse/core/pluggableElementTypes'\n\nimport type { EngineRequest } from '@jbrowse/bandage-core/pipeline'\nimport type { LayoutResult } from '@jbrowse/bandage-core/types'\nimport type { RpcExecuteArgs } from '@jbrowse/core/rpc/RpcRegistry'\n\n// The payload is the pipeline's EngineRequest, the same request a standalone\n// page hands the engine. `sessionId` and `statusCallback` are the CALL's, not\n// the payload's: core's `EntriesDeclaringCallLevelFields` fails the build for a\n// registry entry that declares either. `execute` still receives both, through\n// `RpcExecuteArgs`'s intersection with `RpcCallContext`.\n\ndeclare module '@jbrowse/core/rpc/RpcRegistry' {\n interface RpcRegistry {\n GraphComputeLayout: {\n args: EngineRequest\n return: { result: LayoutResult; duration: number }\n }\n }\n}\n\nexport default class GraphComputeLayout extends RpcMethodType<'GraphComputeLayout'> {\n name = 'GraphComputeLayout' as const\n\n async execute(args: RpcExecuteArgs<'GraphComputeLayout'>) {\n const { graph, options, signal, statusCallback } = args\n // The engine takes no signal, so a layout superseded while it queued\n // behind another is dropped here rather than holding up the next cut. Its\n // abort is a message queued behind the call, read only after a macrotask.\n await new Promise(resolve => setTimeout(resolve, 0))\n signal?.throwIfAborted()\n statusCallback?.('Computing layout')\n return layoutEngine({ graph, options })\n }\n}\n", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/ViewType\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/ViewType\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/core/util/withLaunchInput\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/util/withLaunchInput\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const defineLaunchKeys = /* @__PURE__ */ read(\"defineLaunchKeys\")\nexport const isTrackRecipe = /* @__PURE__ */ read(\"isTrackRecipe\")\nexport const legacyInitMessage = /* @__PURE__ */ read(\"legacyInitMessage\")\nexport const pendingLaunch = /* @__PURE__ */ read(\"pendingLaunch\")\nexport const snapshotSettings = /* @__PURE__ */ read(\"snapshotSettings\")\nexport const unknownKeysMessage = /* @__PURE__ */ read(\"unknownKeysMessage\")\nexport const withLaunchInput = /* @__PURE__ */ read(\"withLaunchInput\")\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/models\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/models\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const BaseConnectionModelFactory = /* @__PURE__ */ read(\"BaseConnectionModelFactory\")\nexport const BaseDisplay = /* @__PURE__ */ read(\"BaseDisplay\")\nexport const BaseInternetAccountConfig = /* @__PURE__ */ read(\"BaseInternetAccountConfig\")\nexport const BaseViewModel = /* @__PURE__ */ read(\"BaseViewModel\")\nexport const InternetAccount = /* @__PURE__ */ read(\"InternetAccount\")\nexport const baseConnectionConfig = /* @__PURE__ */ read(\"baseConnectionConfig\")\nexport const createBaseTrackConfig = /* @__PURE__ */ read(\"createBaseTrackConfig\")\nexport const createBaseTrackModel = /* @__PURE__ */ read(\"createBaseTrackModel\")\nexport const migrateRetiredDisplays = /* @__PURE__ */ read(\"migrateRetiredDisplays\")\nexport const preprocessTrackConfigSnapshot = /* @__PURE__ */ read(\"preprocessTrackConfigSnapshot\")\nexport default host && host.__esModule ? host.default : host", "import { LAYOUT_ENGINE_VALUES } from '@jbrowse/bandage-core/layoutEngines'\nimport { LAYOUT_MODE_VALUES } from '@jbrowse/bandage-core/layoutModes'\nimport { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models'\nimport { getSession, isViewContainer } from '@jbrowse/core/util'\nimport { isAlive, types } from '@jbrowse/mobx-state-tree'\n\nimport { graphTrackChoices } from './graphTrackChoices'\nimport { HOVER_HIGHLIGHT_VALUES } from './hoverHighlight'\nimport { lenientMaybeEnum, lenientOptionalEnum } from './lenientEnum'\nimport { GraphPane, fileName, formatSpanBp } from './model'\nimport {\n canonicalRegion,\n showTrackInLinearView,\n} from '../launchFromGraph/launchFromGraph'\nimport { LINKS_DRAWN_VALUES } from '../linksDrawn'\n\nimport type { GraphLayers } from './graphLayers'\nimport type { NodeColor } from './nodeColor'\nimport type { NodeSize } from './nodeSize'\nimport type { SubgraphRegion } from '../GetSubgraph'\nimport type { GraphGrammar, GraphRows } from './pane/graphViews'\nimport type { FacetInput } from '@jbrowse/bandage-core/facetGrid'\nimport type { LayoutModeValue } from '@jbrowse/bandage-core/layoutModes'\nimport type { WalkLayer } from '@jbrowse/bandage-core/walkEncoding'\nimport type { AnyTrackConfig } from '@jbrowse/core/configuration'\nimport type { FileLocation } from '@jbrowse/core/util/types'\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\nexport default function stateModelFactory() {\n return types\n .compose(\n 'GraphGenomeView',\n BaseViewModel,\n GraphPane,\n types.model({\n type: types.literal('GraphGenomeView'),\n // a whole GFA the view loads on attach, kept so the source round-trips\n // through a session snapshot\n gfaLocation: types.maybe(types.frozen<FileLocation>()),\n // the reference window the file or the cut was stated beside\n loadedRegion: types.maybe(types.frozen<SubgraphRegion>()),\n // A session track the view cuts `loadedRegion` from once, as 4.0\n // sessions and the docs' figure specs state it. Following the linear\n // view is the track's job (LinearGraphDisplay).\n loadedTrackId: types.optional(types.string, ''),\n // unset is force\n layoutMode: lenientMaybeEnum(LAYOUT_MODE_VALUES),\n // Which engine draws the force layout: Bandage's FMMM, or the stress\n // layout, which reads the reference straight. See LAYOUT_ENGINES.\n layoutEngine: lenientOptionalEnum(LAYOUT_ENGINE_VALUES, 'fmmm'),\n color: types.maybe(types.frozen<NodeColor>()),\n size: types.maybe(types.frozen<NodeSize>()),\n layers: types.maybe(types.frozen<GraphLayers>()),\n facet: types.maybe(types.frozen<FacetInput>()),\n rows: types.maybe(types.frozen<GraphRows>()),\n // unset is nodes\n hover: lenientMaybeEnum(HOVER_HIGHLIGHT_VALUES),\n links: lenientMaybeEnum(LINKS_DRAWN_VALUES),\n walks: types.maybe(types.frozen<WalkLayer[]>()),\n }),\n )\n .views(self => ({\n get grammar(): GraphGrammar {\n return {\n layoutMode: self.layoutMode,\n layoutEngine: self.layoutEngine,\n encoding: { color: self.color },\n size: self.size,\n layers: self.layers,\n facet: self.facet,\n rows: self.rows,\n hover: self.hover,\n links: self.links,\n walks: self.walks,\n }\n },\n }))\n .actions(self => ({\n writeGrammar({ encoding, ...settings }: GraphGrammar) {\n Object.assign(\n self,\n encoding ? { ...settings, color: encoding.color } : settings,\n )\n },\n }))\n .volatile(() => ({\n widthMeasured: false,\n }))\n .actions(self => {\n const setBaseWidth = self.setWidth\n return {\n setWidth(width: number) {\n setBaseWidth(width)\n self.widthMeasured = true\n },\n }\n })\n .views(self => ({\n get rpcSessionId() {\n return self.id\n },\n // a view is not its own containing view\n get paneWidth() {\n return self.width\n },\n // until then the width is BaseViewModel's 800 px default\n get paneMeasured() {\n return self.widthMeasured\n },\n get sourceTrack(): AnyTrackConfig | undefined {\n return self.loadedTrackId\n ? self.sessionTrack(self.loadedTrackId)\n : undefined\n },\n // the session's graph tracks the import form offers\n get graphTracks() {\n return graphTrackChoices(getSession(self).tracks)\n },\n get canRetryLoad() {\n return (\n self.gfaLocation !== undefined ||\n (self.loadedTrackId !== '' && self.loadedRegion !== undefined)\n )\n },\n }))\n .views(self => ({\n get hasPendingSource() {\n return self.canRetryLoad && !self.graph && !self.loadCanceled\n },\n menuItems() {\n return [...self.exportMenuItems(), ...self.launchMenuItems()]\n },\n }))\n .actions(self => {\n const clearPane = self.clearGraph\n function loadRegion(\n region: SubgraphRegion | undefined,\n ): Promise<unknown> | undefined {\n if (self.gfaLocation) {\n // a whole file has no assembly to name the view by\n if (!self.displayName) {\n self.setDisplayName(fileName(self.gfaLocation))\n }\n return self.loadGFAFromLocation(self.gfaLocation, region)\n }\n if (!self.loadedTrackId || !region) {\n return undefined\n }\n const adapter = self.sourceAdapter\n const span = region.end - region.start\n const problem = self.offReference(region)\n if (!adapter) {\n self.setError(\n new Error(\n `The track this graph was cut from, \"${self.loadedTrackId}\", is not in this session`,\n ),\n )\n } else if (problem) {\n self.setError(new Error(problem))\n } else if (span > self.maxRegionBp) {\n self.setError(\n new Error(\n `Region too large (${formatSpanBp(span)}) \u2014 zoom in to view graph (max ${formatSpanBp(self.maxRegionBp)})`,\n ),\n )\n } else {\n self.markCut()\n return self.cutSubgraph(adapter, region, self.cutOptions)\n }\n return undefined\n }\n return {\n // the stated source goes too, or a reloaded session would load the\n // dismissed graph again, and so does a name taken from its file\n clearGraph() {\n clearPane()\n if (\n self.gfaLocation &&\n self.displayName === fileName(self.gfaLocation)\n ) {\n self.displayName = undefined\n }\n self.gfaLocation = undefined\n self.loadedRegion = undefined\n self.loadedTrackId = ''\n },\n // The graph keeps the region by the session's names, which hover sync\n // and launches compare with, so a stated alias resolves first, once\n // its assembly's refName aliases have loaded.\n load(): Promise<unknown> | undefined {\n const stated = self.loadedRegion\n const session = getSession(self)\n const { assemblyManager } = session\n const assembly =\n stated && assemblyManager.has(stated.assemblyName)\n ? assemblyManager.get(stated.assemblyName)\n : undefined\n return stated && assembly?.initialized === false\n ? assemblyManager\n .waitForAssembly(stated.assemblyName)\n .catch(() => undefined)\n .then(() =>\n isAlive(self) && self.loadedRegion === stated\n ? loadRegion(canonicalRegion(session, stated))\n : undefined,\n )\n : loadRegion(stated && canonicalRegion(session, stated))\n },\n }\n })\n .actions(self => ({\n retryLoad() {\n void self.load()\n },\n setGfaLocation(location: FileLocation) {\n self.gfaLocation = location\n },\n relayoutFrom(_from: LayoutModeValue) {\n return self.loadedTrackId && self.cutStale\n ? self.load()\n : self.recomputeLayout()\n },\n // Stated as the source once it loads, so a saved session reopens it; a\n // URL that fails stays in the import form to be corrected.\n async openGfaLocation(location: FileLocation) {\n await self.loadGFAFromLocation(location)\n if (isAlive(self) && self.hasGraph) {\n this.setGfaLocation(location)\n if (!self.displayName) {\n self.setDisplayName(fileName(location))\n }\n }\n },\n // The form's way to a graph track: the linear view draws it at every\n // zoom, so this view, still empty, gives way to it\n showTrackInLinearView(trackId: string, assembly: string, loc: string) {\n const session = getSession(self)\n showTrackInLinearView({ session, trackId, assembly, loc })\n if (isViewContainer(session)) {\n session.removeView(self)\n }\n },\n // Here rather than when the rendering backend starts: the canvas only\n // mounts once there is a graph, so a view whose graph must be fetched\n // would never fetch it.\n afterAttach() {\n if (!self.graph) {\n void self.load()\n }\n },\n }))\n}\n\nexport type GraphGenomeViewModel = Instance<\n ReturnType<typeof stateModelFactory>\n>\n", "import { lazy } from 'react'\n\nimport ViewType from '@jbrowse/core/pluggableElementTypes/ViewType'\nimport { defineLaunchKeys } from '@jbrowse/core/util/withLaunchInput'\n\nimport modelFactory from './viewModel'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\n// No launch keys, declared so `loadSessionSpec` reports a spec's unknown keys\n// instead of dropping them silently.\nconst graphLaunchKeys = defineLaunchKeys<object>()({})\n\nexport default function GraphGenomeViewF(pluginManager: PluginManager) {\n pluginManager.addViewType(() => {\n return new ViewType({\n name: 'GraphGenomeView',\n displayName: 'Graph genome view',\n stateModel: modelFactory(),\n launchKeys: graphLaunchKeys,\n ReactComponent: lazy(() => import('./components/GraphGenomeView')),\n })\n })\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport {\n TrackType,\n createBaseTrackConfig,\n createBaseTrackModel,\n} from '@jbrowse/core/pluggableElementTypes'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'\n\n// core's synteny displays, copied to ask for headerLanes so only the gbz-base\n// and walk-tabix adapters open in a synteny, dotplot or circular view.\n// LinearBasicDisplay is copied to ask for referenceSegments: a lanes adapter\n// answers getFeatures with every haplotype's lane features, which the segments\n// lane can only offer to force-load\nexport const SYNTENY_DISPLAYS = [\n 'MultiWaySyntenyDisplay',\n 'LinearSyntenyDisplay',\n 'DotplotDisplay',\n 'ChordSyntenyDisplay',\n]\n\nfunction displaysInOrder(pluginManager: PluginManager): DisplayType[] {\n const displays = pluginManager.getElementTypesInGroup(\n 'display',\n ) as DisplayType[]\n const named = (name: string) => displays.find(d => d.name === name)\n const needs = (capability: string, display: DisplayType | undefined) =>\n display &&\n Object.assign(Object.create(display) as DisplayType, {\n adapterCapabilities: [capability],\n })\n return [\n named('LinearGraphDisplay'),\n needs('referenceSegments', named('LinearBasicDisplay')),\n ...SYNTENY_DISPLAYS.map(name => needs('headerLanes', named(name))),\n ].filter((d): d is DisplayType => d !== undefined)\n}\n\nexport default function GraphTrackF(pluginManager: PluginManager) {\n pluginManager.addTrackType(() => {\n const configSchema = ConfigurationSchema(\n 'GraphTrack',\n {},\n {\n baseConfiguration: createBaseTrackConfig(pluginManager),\n explicitIdentifier: 'trackId',\n },\n )\n const track = new TrackType({\n name: 'GraphTrack',\n displayName: 'Pangenome graph track',\n configSchema,\n stateModel: createBaseTrackModel(\n pluginManager,\n 'GraphTrack',\n configSchema,\n ),\n })\n for (const display of displaysInOrder(pluginManager)) {\n track.addDisplayType(display)\n }\n return track\n })\n}\n", "import type modelFactory from './GraphGenomeView/viewModel'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\nimport type { SnapshotIn } from '@jbrowse/mobx-state-tree'\n\n// Every view prop, taken off the model so a new prop widens the launch with\n// it; `type` is the dispatch key, not a setting.\nexport type LaunchGraphGenomeViewArgs = Partial<\n Omit<SnapshotIn<ReturnType<typeof modelFactory>>, 'type'>\n> & {\n session: AbstractSessionModel\n}\n\ndeclare module '@jbrowse/core/PluginManager' {\n interface ExtensionPointRegistry {\n 'LaunchView-GraphGenomeView': {\n args: LaunchGraphGenomeViewArgs\n result: LaunchGraphGenomeViewArgs\n }\n }\n}\n\nexport default function LaunchGraphGenomeViewF(pluginManager: PluginManager) {\n /** #extensionPoint LaunchView-GraphGenomeView | async | Programmatically launch a graph genome view */\n pluginManager.addToExtensionPoint('LaunchView-GraphGenomeView', args => {\n const { session, ...spec } = args\n session.addView('GraphGenomeView', spec)\n return args\n })\n}\n", "const host = JBrowseExports[\"@jbrowse/core/pluggableElementTypes/DisplayType\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/pluggableElementTypes/DisplayType\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/heightModeConfigSchemaFields\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/heightModeConfigSchemaFields\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const heightModeConfigSchemaFields = /* @__PURE__ */ read(\"heightModeConfigSchemaFields\")\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/trackHeightConfigSchemaFields\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/trackHeightConfigSchemaFields\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const trackHeightConfigSchemaFields = /* @__PURE__ */ read(\"trackHeightConfigSchemaFields\")\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/facetConfigSchema\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/facetConfigSchema\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const facetConfigSchema = /* @__PURE__ */ read(\"facetConfigSchema\")\nexport const facetSettingOf = /* @__PURE__ */ read(\"facetSettingOf\")\nexport default host && host.__esModule ? host.default : host", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { facetConfigSchema } from '@jbrowse/display-kit/facetConfigSchema'\n\n/**\n * #config GraphFacet\n * The graph display's `facet`: core's Facet, a `field` and the `sort` its\n * sections lead with, and the `columns` a node layout's panels wrap at. A\n * bare string is the field.\n *\n * #example\n * ```js\n * { type: 'LinearGraphDisplay', facet: { field: 'walk', columns: 3 } }\n * ```\n */\nexport const graphFacetConfigSchema = ConfigurationSchema(\n 'GraphFacet',\n {\n /**\n * #slot columns\n * Panels per row of a node layout's grid; unset fits them to the track.\n */\n columns: {\n type: 'maybeNumber',\n description: \"panels per row of a node layout's grid; unset fits them\",\n },\n },\n {\n /**\n * #baseConfiguration\n */\n baseConfiguration: facetConfigSchema,\n },\n)\n", "export type Extent = 'fetched' | 'view'\n\nexport const EXTENT_VALUES: Extent[] = ['fetched', 'view']\n\nexport const DEFAULT_EXTENT: Extent = 'fetched'\n", "import { LAYOUT_ENGINE_VALUES } from '@jbrowse/bandage-core/layoutEngines'\nimport { LAYOUT_MODE_VALUES } from '@jbrowse/bandage-core/layoutModes'\nimport { DEFAULT_TRACK_FIT } from '@jbrowse/bandage-core/trackFit'\nimport { ConfigurationSchema } from '@jbrowse/core/configuration'\nimport { heightModeConfigSchemaFields } from '@jbrowse/display-kit/heightModeConfigSchemaFields'\nimport { trackHeightConfigSchemaFields } from '@jbrowse/display-kit/trackHeightConfigSchemaFields'\n\nimport { graphFacetConfigSchema } from './graphFacetConfigSchema'\nimport { DEFAULT_EXTENT, EXTENT_VALUES } from '../GraphGenomeView/extent'\nimport { HOVER_HIGHLIGHT_VALUES } from '../GraphGenomeView/hoverHighlight'\nimport {\n DEFAULT_KEY_PLACEMENT,\n KEY_PLACEMENT_VALUES,\n} from '../GraphGenomeView/keyPlacement'\nimport { lenientSlotEnum } from '../GraphGenomeView/lenientEnum'\nimport { DEFAULT_LINKS_DRAWN, LINKS_DRAWN_VALUES } from '../linksDrawn'\nimport { DEFAULT_SITES, SITES_VALUES } from '../sitesDrawn'\n\n/**\n * #config LinearGraphDisplay\n * The graph drawn as a track of the linear genome view. A layout whose x is\n * reference bp draws under the view's coordinates and re-cuts as the view\n * moves; force, ordered and walk rows draw in their own coordinates, fitted to\n * the track.\n */\nexport function configSchemaFactory() {\n return ConfigurationSchema(\n 'LinearGraphDisplay',\n {\n /**\n * #slot\n * the layout the track opens in: `force`, which `layoutEngine` draws,\n * or `auto` for the anchored layout, whose x is reference bp\n */\n layoutMode: {\n type: 'stringEnum',\n model: lenientSlotEnum(LAYOUT_MODE_VALUES, 'force'),\n defaultValue: 'force',\n },\n /**\n * #slot\n * the engine that draws `force`: Bandage's `fmmm`, or `stress`, which\n * holds the reference straight and keeps a re-cut's drawing in place\n * (ADR-044)\n */\n layoutEngine: {\n type: 'stringEnum',\n model: lenientSlotEnum(LAYOUT_ENGINE_VALUES, 'fmmm'),\n defaultValue: 'fmmm',\n },\n /**\n * #slot\n * the channels the nodes are painted through, as core's `encoding`.\n * `color` is `{ value: 'grey' }` or `{ value: 'uniform' }`, or the\n * `field` nodes are colored by, `depth`, `length`, `rank`, `position` or\n * `id` (`scale: { type: 'ordinal' }` or `scale: { scheme: 'rainbow' }`).\n * `scale.domainMin` and `scale.domainMax` span the position ramp. `{}`\n * colors an anchored graph by position. `site` is how a collapsed\n * site's band is drawn, bandage-core's site encoding: `thickness` by\n * `reaching` (the default) or `haplotypes`, `lightness` by `reaching`,\n * and `ticks` by `lengths`.\n * ```js\n * { encoding: { color: { field: 'depth' } } }\n * { encoding: { site: { thickness: { field: 'haplotypes' }, lightness: { field: 'reaching' } } } }\n * ```\n */\n encoding: {\n type: 'frozen',\n defaultValue: {},\n plot: true,\n },\n /**\n * #slot\n * the node thickness: a px number draws every node that thick;\n * `{ field: 'walks', value }` draws a node as thick as the passes the\n * walks make through it, the most passes in the graph `value` px;\n * `{ field: 'depth', value }` thickens a node the more paths carry it,\n * around `value` px; `{ field: 'frequency', value }` draws it as wide as\n * the share of haplotypes through it, `value` px at 100%; `links:\n * 'walks'` draws a link as thick as the passes along it, on the scale\n * nodes by walks are drawn on. Nodes by walks draw by depth in a graph\n * without walks\n */\n size: {\n type: 'frozen',\n defaultValue: { field: 'walks', value: 6, links: 'walks' },\n plot: true,\n },\n /**\n * #slot\n * what the drawing adds over its nodes and edges, stated as changes to\n * the defaults: `paths`, `bubbles`, `walkStrip`, `walkRibbons` and\n * `smallSites` are off, `deletions`, `genes` and `referenceStrip` on\n * ```js\n * { layers: { bubbles: true, genes: false } }\n * ```\n */\n layers: {\n type: 'frozen',\n defaultValue: {},\n plot: true,\n },\n /**\n * #slot\n * one section per value of a field: a node layout draws a panel per\n * `walk` or `sample`, and walk rows stack into a section per value of\n * a sample table column. A bare field, or `{ field, sort, columns }`\n */\n facet: graphFacetConfigSchema,\n /**\n * #slot\n * the rows walk rows draw: `{ kept: [...] }` names the samples, or\n * `sample#haplotype` haplotypes, shown; `{ kept: 'lifted' }` shows the\n * haplotypes of the lifted walks\n */\n rows: {\n type: 'frozen',\n defaultValue: {},\n plot: true,\n },\n /**\n * #slot\n * the walks highlighted, as the track's Haplotypes list sets them: each\n * is lifted out of the drawing as a lane of its own and the rest fade.\n * A walk's `color` takes a `field` (`progress`, `walk`, `reference` or\n * `pass`) and a `scheme` (`grey`, `blue`, `red`, `purple`, `green`,\n * `orange` or `rainbow`)\n * ```js\n * { walks: [{ walk: 'GRCh38#0#chr6' }, { walk: 'HG00133#1#CM090045.1' }] }\n * ```\n */\n walks: {\n type: 'frozen',\n defaultValue: [],\n plot: true,\n },\n /**\n * #slot\n * what the pointer lights: `nodes` lightens a hovered node and bands its\n * span on the view; `everything` also lights edges, and the node at the\n * view's pointer bp\n */\n hover: {\n type: 'stringEnum',\n model: lenientSlotEnum(HOVER_HIGHLIGHT_VALUES, 'nodes'),\n defaultValue: 'nodes',\n },\n /**\n * #slot\n * the links a cut of a walk file draws: `walked`, those the haplotypes\n * shown walk, or `between`, also those any other haplotype in the file\n * takes between the nodes shown. Walk rows draw no links\n */\n links: {\n type: 'stringEnum',\n model: lenientSlotEnum(LINKS_DRAWN_VALUES, DEFAULT_LINKS_DRAWN),\n defaultValue: DEFAULT_LINKS_DRAWN,\n },\n /**\n * #slot\n * how a fold to threads draws the alleles of one site, where its\n * haplotypes leave and rejoin the reference: `collapsed`, one band at\n * the longest, as thick at each point as the haplotypes at least that\n * long, with a tick at each length; or `open`, a node for each run of\n * lengths within the fold's threshold of each other\n */\n sites: {\n type: 'stringEnum',\n model: lenientSlotEnum(SITES_VALUES, DEFAULT_SITES),\n defaultValue: DEFAULT_SITES,\n },\n /**\n * #slot\n * where the key goes: `column`, a column of its own at the track's\n * right edge, the drawing fitted beside it; `overlay`, at the track's\n * top right with no column, so a drawing that follows the view's\n * window spans the track edge to edge under the tracks above it, and\n * sits below the key where the track is tall enough for both; or\n * `hidden`\n */\n key: {\n type: 'stringEnum',\n model: lenientSlotEnum(KEY_PLACEMENT_VALUES, DEFAULT_KEY_PLACEMENT),\n defaultValue: DEFAULT_KEY_PLACEMENT,\n },\n /**\n * #slot\n * how much of the graph a drawing that follows the view's window draws:\n * `fetched`, the whole stretch fetched around the view, as wide as the\n * layout needs, its colour ramp and key over that stretch; or `view`,\n * only what branches inside the view, with lengths, gene pins, the\n * colour ramp and the key's range over the view. `view` suits a still\n * picture: during a pan it redraws in steps as the view settles\n */\n extent: {\n type: 'stringEnum',\n model: lenientSlotEnum(EXTENT_VALUES, DEFAULT_EXTENT),\n defaultValue: DEFAULT_EXTENT,\n },\n ...trackHeightConfigSchemaFields({\n defaultHeight: 520,\n height: 'the height of the track the graph is drawn in',\n }),\n ...heightModeConfigSchemaFields({\n heightMode:\n \"how a force drawing the view's window places meets the track's height: `fit` shrinks the cut to the track's height, less what hangs off the reference by one end, which may run past the top or bottom with a mark where it does; `grow` does the same into `growMaxHeight` and grows the track to hold it; `fixed` shrinks only the reference the window shows to the track's height, holds it whole and marks where what hangs off it runs past the top or bottom\",\n growMaxHeight: 'the tallest `grow` makes the track, in px',\n defaultHeightMode: DEFAULT_TRACK_FIT,\n }),\n },\n {\n explicitlyTyped: true,\n explicitIdentifier: 'displayId',\n misnamed: { walkLayers: 'walks' },\n },\n )\n}\n\nexport type LinearGraphDisplayConfigModel = ReturnType<\n typeof configSchemaFactory\n>\n", "import { lazy } from 'react'\n\nimport DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'\n\nimport { configSchemaFactory } from './configSchema'\nimport { stateModelFactory } from './model'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function LinearGraphDisplayF(pluginManager: PluginManager) {\n pluginManager.addDisplayType(() => {\n const configSchema = configSchemaFactory()\n return Object.assign(\n new DisplayType({\n name: 'LinearGraphDisplay',\n displayName: 'Graph',\n configSchema,\n stateModel: stateModelFactory(configSchema),\n trackType: 'GraphTrack',\n viewType: 'LinearGenomeView',\n ReactComponent: lazy(() => import('./components/LinearGraphDisplay')),\n }),\n { adapterCapabilities: ['getSubgraph'] },\n )\n })\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { fileLocationSlot, tabixIndexSchema, tbiBeside } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config MinigraphBubbleAdapter\n * #trackType FeatureTrack\n * #fileFormat graph | Minigraph bubble BED | `gfatools bubble` output; HPRC publishes one ready-made, so no preprocessing at all\n * the tabix-indexed BED `gfatools bubble` writes for a minigraph graph: one row\n * per bubble, on the reference's own coordinates. Unlike\n * [RgfaTabixAdapter](/docs/config/rgfatabixadapter) this needs no index build of\n * your own, because HPRC publishes this file beside its minigraph graph.\n *\n * It shows *where* the graph varies and by how much, not the graph itself.\n *\n * #example\n * ```js\n * {\n * type: 'MinigraphBubbleAdapter',\n * uri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38.bubbles.bed.gz',\n * assemblyNameToPanSN: { hg38: 'GRCh38' },\n * }\n * ```\n */\n\nfunction normalizeSnapshot(snap: Record<string, unknown>) {\n const { uri, baseUri, csi } = snap\n return typeof uri === 'string'\n ? {\n ...snap,\n bubblesLocation: { uri, baseUri },\n index: tbiBeside(uri, baseUri, csi),\n }\n : snap\n}\n\nconst MinigraphBubbleAdapter = ConfigurationSchema(\n 'MinigraphBubbleAdapter',\n {\n /**\n * #slot\n */\n bubblesLocation: fileLocationSlot('/path/to/graph.bb.bed.gz'),\n /**\n * #slot\n */\n index: tabixIndexSchema(\n 'MinigraphBubbleIndex',\n '/path/to/graph.bb.bed.gz.tbi',\n ),\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN sample prefix, for when they\n * differ. `gfatools bubble` names each row after the graph's stable\n * sequence, so a Minigraph-Cactus graph yields `GRCh38#0#chr6` and an\n * `hg38` assembly needs `{ hg38: 'GRCh38' }`; HPRC's published v1.0\n * minigraph bubbles are bare (`chr6`) and need nothing.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n *\n * preprocessor to allow the minimal config\n * ```json\n * { \"type\": \"MinigraphBubbleAdapter\", \"uri\": \"graph.bb.bed.gz\" }\n * ```\n */\n preProcessSnapshot: normalizeSnapshot,\n },\n)\n\nexport type MinigraphBubbleAdapterConfig = Instance<\n typeof MinigraphBubbleAdapter\n>\n\nexport default MinigraphBubbleAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\nexport default function MinigraphBubbleAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'MinigraphBubbleAdapter',\n displayName: 'Minigraph bubble BED adapter',\n configSchema,\n adapterMetadata: {\n category: 'Graph adapters',\n },\n getAdapterClass: () =>\n import('./MinigraphBubbleAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { GRAPH_SUFFIX } from '../locationName.ts'\nimport { WALK_BUDGETS } from '../slotDefaults.ts'\nimport {\n fileLocationSlot,\n tabixIndexSchema,\n tbiBeside,\n walksLocations,\n} from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config RgfaTabixAdapter\n * #trackType GraphTrack\n * #fileFormat graph | Indexed GFA | Built by `gfa-to-tabix`; serves segments as features and extracts local subgraphs\n * two tabix-indexed BED files, one of a graph's segments and one of its links,\n * written by [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) from an rGFA\n * or from a plain GFA with paths. Both of its layouts are read: `anchored`,\n * where one query per file returns the graph under a region, and `contig`,\n * where the adapter follows links onto other contigs.\n *\n * The `uri` shorthand takes the prefix the build script was given and resolves\n * `<uri>.segs.bed.gz`, `<uri>.links.bed.gz` and their `.tbi` indexes. With\n * `format: 2` it resolves gfa-to-tabix's format 2 instead, `<uri>.graph.bed.gz`\n * and its index: nodes and links in one file, a plain GFA's carriers as bits,\n * from `gfa-to-tabix --format 2`. `coarse`\n * takes the same shorthand for a second pair at one node per bubble, built by\n * `gfa-to-tabix fold`, plus either the zoom past which a graph view following\n * a linear view cuts it (`aboveBpPerPx`) or the size it was folded at\n * (`foldBelowBp`), from which the plugin derives that zoom.\n *\n * `walksUri` takes the prefix of a walk file in place of `uri`, and resolves\n * `<walksUri>.walks.gz` and its directory `<walksUri>.walks.gz.idx`.\n * `gfa-to-tabix --walks -o <prefix>` writes one per reference sample, so a\n * track names one as `<prefix>.<sample>`. The adapter reads walk format 8,\n * which gfa-to-tabix writes from 5.0, through @gmod/gfa-tabix. Such a\n * graph's cut carries\n * the haplotypes' walks, and `defaultHaplotypes` names the ones it is cut for\n * until the user picks others.\n *\n * #example\n * ```js\n * {\n * type: 'RgfaTabixAdapter',\n * uri: 'https://example.com/hprc.rgfa',\n * coarse: { uri: 'https://example.com/hprc.fold10000', foldBelowBp: 10000 },\n * }\n * ```\n *\n * #example\n * ```js\n * {\n * type: 'RgfaTabixAdapter',\n * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38-f8.GRCh38',\n * assemblyNameToPanSN: { hg38: 'GRCh38' },\n * defaultHaplotypes: ['HG002', 'HG00733', 'HG02257', 'NA19240'],\n * }\n * ```\n */\n\nfunction prefixLocations(snap: Record<string, unknown>) {\n const { uri, baseUri, csi, format } = snap\n if (typeof uri !== 'string') {\n return snap\n }\n return format === 2\n ? {\n ...snap,\n graphLocation: { uri: `${uri}${GRAPH_SUFFIX}`, baseUri },\n graphIndex: tbiBeside(`${uri}${GRAPH_SUFFIX}`, baseUri, csi),\n }\n : {\n ...snap,\n segmentsLocation: { uri: `${uri}.segs.bed.gz`, baseUri },\n segmentsIndex: tbiBeside(`${uri}.segs.bed.gz`, baseUri, csi),\n linksLocation: { uri: `${uri}.links.bed.gz`, baseUri },\n linksIndex: tbiBeside(`${uri}.links.bed.gz`, baseUri, csi),\n }\n}\n\nfunction normalizeSnapshot(snap: Record<string, unknown>) {\n const { coarse, baseUri, csi } = snap\n return walksLocations(\n prefixLocations(\n typeof coarse === 'object' && coarse !== null\n ? { ...snap, coarse: prefixLocations({ baseUri, csi, ...coarse }) }\n : snap,\n ),\n )\n}\n\nconst RgfaTabixCoarseTier = ConfigurationSchema('RgfaTabixCoarseTier', {\n /**\n * #slot\n * The adapter's `uri` shorthand for this pair: the prefix `gfa-to-tabix\n * fold` was given, from which the locations below resolve.\n */\n uri: { type: 'maybeString' },\n /**\n * #slot\n * The adapter's `format` for this pair: `2` resolves format 2's one\n * `<uri>.graph.bed.gz`.\n */\n format: { type: 'maybeNumber' },\n /**\n * #slot\n * The linear view's bp per px past which a graph following it cuts this\n * pair. Unset, with `foldBelowBp` unset too, means the track has no coarse\n * tier. There is no default,\n * because the zoom a fine cut stays drawable to depends on the graph's\n * density: a minigraph graph averages ~7 kb per segment, a base-level pggb\n * graph ~17 bp.\n */\n aboveBpPerPx: { type: 'maybeNumber' },\n /**\n * #slot\n * The size, in bp, this pair was folded at (`gfa-to-tabix fold --below`).\n * When `aboveBpPerPx` is unset, the handover is `foldBelowBp / 10`, the zoom\n * at which the fine cut folds the same variants away.\n */\n foldBelowBp: { type: 'maybeNumber' },\n /**\n * #slot\n */\n segmentsLocation: fileLocationSlot('/path/to/graph.tier.segs.bed.gz'),\n /**\n * #slot\n */\n segmentsIndex: tabixIndexSchema(\n 'RgfaCoarseSegmentsIndex',\n '/path/to/graph.tier.segs.bed.gz.tbi',\n ),\n /**\n * #slot\n */\n linksLocation: fileLocationSlot('/path/to/graph.tier.links.bed.gz'),\n /**\n * #slot\n */\n linksIndex: tabixIndexSchema(\n 'RgfaCoarseLinksIndex',\n '/path/to/graph.tier.links.bed.gz.tbi',\n ),\n /**\n * #slot\n * format 2's one file in place of the pair; see the adapter's `graphLocation`\n */\n graphLocation: fileLocationSlot(''),\n /**\n * #slot\n */\n graphIndex: tabixIndexSchema('RgfaCoarseGraphIndex'),\n})\n\nconst RgfaTabixAdapter = ConfigurationSchema(\n 'RgfaTabixAdapter',\n {\n /**\n * #slot\n * one row per segment: `stableName start end segmentId rank`, as emitted by\n * `gfatools gfa2bed -m`\n */\n segmentsLocation: fileLocationSlot('/path/to/graph.segs.bed.gz'),\n /**\n * #slot\n */\n segmentsIndex: tabixIndexSchema(\n 'RgfaSegmentsIndex',\n '/path/to/graph.segs.bed.gz.tbi',\n ),\n /**\n * #slot\n * one row per link per endpoint, each carrying both endpoints in full so a\n * neighbour on another stable sequence needs no segment-id lookup\n */\n linksLocation: fileLocationSlot('/path/to/graph.links.bed.gz'),\n /**\n * #slot\n */\n linksIndex: tabixIndexSchema(\n 'RgfaLinksIndex',\n '/path/to/graph.links.bed.gz.tbi',\n ),\n /**\n * #slot\n * gfa-to-tabix's format 2, `<prefix>.graph.bed.gz`: segments and links in\n * one file, read in place of `segmentsLocation` and `linksLocation`.\n * Unset means the graph is the pair.\n */\n graphLocation: fileLocationSlot(''),\n /**\n * #slot\n */\n graphIndex: tabixIndexSchema('RgfaGraphIndex'),\n /**\n * #slot\n * a `gfa-to-tabix --walks` file in walk format 8: per tile of a\n * reference, the reference's path, the ways haplotypes leave it and each\n * haplotype's piece, and every departure from the reference. Unset means\n * the graph has no walks.\n */\n walksLocation: fileLocationSlot(''),\n /**\n * #slot\n * the walk file's directory, `<prefix>.<sample>.walks.gz.idx`. Unset\n * reads it beside the walk file.\n */\n walksIndex: fileLocationSlot(''),\n /**\n * #slot\n * the most haplotype steps a cut keeps; a window whose walks hold more\n * shows a zoom-in notice instead, as does one whose rows hold eight times\n * as many. Counts only the haplotypes the cut is for, so fewer haplotypes\n * draw a wider window. Walk rows draw runs rather than steps, as does a\n * graph folded to threads, which reads the walks as runs, and both are\n * bounded by `walkByteBudget` alone.\n */\n walkStepBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.stepBudget,\n },\n /**\n * #slot\n * the most compressed bytes a cut of a walk-indexed graph fetches from its\n * walk file, which its directory gives before any row is read; a window\n * over it shows a zoom-in notice instead. The budget covers every\n * haplotype, since a tile's rows are filed for all of them.\n */\n walkByteBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.byteBudget,\n },\n /**\n * #slot\n * the haplotypes a walk-indexed graph is cut for until the user picks\n * others in the track's Haplotypes menu or Graph settings, as PanSN prefixes\n * (`HG002#1`, or `HG002` for both of its haplotypes). Empty means every\n * haplotype, or the lanes the track's `assemblyNames` lists after its\n * reference.\n */\n defaultHaplotypes: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * A tab-separated table of per-sample metadata, which the graph view's\n * walk rows group by (\"Group by...\"). Its header row names the columns\n * (`population`, `superpopulation`, ...), and its first column is the\n * walk's sample (`HG00097`) or haplotype (`HG00097#1`). Empty means no\n * grouping. A `color` column (`#rgb` or `#rrggbb`) colours that\n * haplotype's lifted walk in the graph display.\n */\n samplesTsvLocation: fileLocationSlot(''),\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN sample prefix in the graph, for\n * when they differ. Defaults to identity: the assembly name is assumed to be\n * the PanSN sample name, and a graph whose stable names are bare (minigraph\n * writes `chr1`) needs nothing here at all.\n *\n * Minigraph-Cactus writes PanSN stable names, so HPRC's release-2 graph\n * calls the reference `GRCh38#0#chr1` and an `hg38` assembly needs\n * `{ hg38: 'GRCh38' }`. The prefix is what disambiguates: that same graph\n * also contains `CHM13#0#chr1`, so matching on the contig alone would\n * silently resolve to the wrong sample.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n /**\n * #slot\n * The same graph at one node per bubble, which a graph view following a\n * linear view cuts once that view is zoomed out past `aboveBpPerPx`, and\n * which no bp cap applies to. `{ uri, aboveBpPerPx }` or `{ uri,\n * foldBelowBp }`, where `uri` is a prefix as the adapter's own is;\n * `aboveBpPerPx` wins when both are given.\n */\n coarse: RgfaTabixCoarseTier,\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n *\n * preprocessor to allow the minimal config\n * ```json\n * { \"type\": \"RgfaTabixAdapter\", \"uri\": \"graph.rgfa\" }\n * ```\n * or, for the GRCh38 set of a graph built by `gfa-to-tabix --walks -o\n * chr22`,\n * ```json\n * { \"type\": \"RgfaTabixAdapter\", \"walksUri\": \"chr22.GRCh38\" }\n * ```\n */\n preProcessSnapshot: normalizeSnapshot,\n },\n)\n\nexport type RgfaTabixAdapterConfig = Instance<typeof RgfaTabixAdapter>\n\nexport default RgfaTabixAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\n// `.idx` pairs the walk file's directory with it in a host's file selection.\n// Held outside the call because AdapterMetadata through 5.0.0-beta.23 has no\n// indexSuffixes, and an object literal there would not compile\nconst adapterMetadata = {\n category: 'Graph adapters',\n indexSuffixes: ['.idx'],\n}\n\nexport default function RgfaTabixAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'RgfaTabixAdapter',\n displayName: 'Indexed rGFA adapter',\n configSchema,\n // what a graph display needs of its track's adapter, and the\n // reference's segments that its getFeatures gives the segments lane\n adapterCapabilities: ['getSubgraph', 'referenceSegments'],\n adapterMetadata,\n getAdapterClass: () =>\n import('./RgfaTabixAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { DisplayType } from '@jbrowse/core/pluggableElementTypes'\nimport { getContainingView, getSession } from '@jbrowse/core/util'\nimport { getConfAssemblyNamesOrNone } from '@jbrowse/core/util/tracks'\nimport { types } from '@jbrowse/mobx-state-tree'\n\nimport { floorOf, pinnedLocus, pinnedOf, warningPrefix } from './pinned.ts'\nimport { hostWindow, isLinearHost } from '../GraphGenomeView/host.ts'\nimport { trackAdapterSnapshot } from '../graphTrackConfig.ts'\n\nimport type { FloorBp, Pinned } from './pinned.ts'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AnyTrackConfig } from '@jbrowse/core/configuration'\nimport type { MenuItem } from '@jbrowse/core/ui'\nimport type {\n IAnyStateTreeNode,\n IModelType,\n ModelProperties,\n} from '@jbrowse/mobx-state-tree'\n\n// By track type, not display name, which has changed across releases; the\n// mixin is inert off a WalkFormsAdapter track\nexport function takesFormsMenu(display: DisplayType) {\n return (\n display.viewType === 'LinearGenomeView' &&\n [display.trackType].flat().includes('VariantTrack')\n )\n}\n\nexport const FLOORS: { label: string; value: FloorBp }[] = [\n { label: 'Auto', value: 'auto' },\n { label: '50 bp', value: 50 },\n { label: '1 kb', value: 1000 },\n { label: '10 kb', value: 10_000 },\n]\n\nexport function pinnedLabel(pinned: Pinned | undefined, forms?: number) {\n return pinned\n ? `Pinned to ${pinnedLocus(pinned)}${forms === undefined ? '' : ` \u00B7 ${forms} form${forms === 1 ? '' : 's'}`}`\n : 'Not pinned'\n}\n\ninterface FormsHost {\n parentTrack: { configuration: AnyTrackConfig }\n sourcesBase?: Record<string, unknown>[]\n trackMenuItems: () => MenuItem[]\n setSources?(sources: unknown, adapterConfig?: unknown): void\n}\n\ninterface Snackbar {\n snackbarMessages?: { message: string }[]\n removeSnackbarMessage?: (message: string) => void\n}\n\nfunction clearWarnings(\n node: IAnyStateTreeNode,\n windows: (Pinned | undefined)[],\n) {\n const session = getSession(node) as unknown as Snackbar\n const prefixes = windows.flatMap(w => (w ? [warningPrefix(w)] : []))\n for (const { message } of [...(session.snackbarMessages ?? [])]) {\n if (prefixes.some(p => message.startsWith(p))) {\n session.removeSnackbarMessage?.(message)\n }\n }\n}\n\n/**\n * Gives a WalkFormsAdapter track's display a pinned window and floor of its\n * own, which the display stores in the session and sends in the adapter config\n * with each request. A config edit would change the track's RPC session id\n * and move the requests to a worker without the cut; display state leaves it.\n */\nexport function withFormsMenu<\n PROPS extends ModelProperties,\n HOST extends FormsHost,\n>(model: IModelType<PROPS, HOST>) {\n return model\n .props({\n formsPinned: types.maybe(types.frozen<Pinned>()),\n formsFloorBp: types.maybe(types.frozen<FloorBp>()),\n })\n .views(self => ({\n get configuredAdapter() {\n return trackAdapterSnapshot(self.parentTrack.configuration)\n },\n get walkForms() {\n return this.configuredAdapter.type === 'WalkFormsAdapter'\n },\n }))\n .views(self => ({\n get pinnedAliases() {\n const pinned = pinnedOf(\n self.formsPinned ?? self.configuredAdapter.pinned,\n )\n const [assemblyName] = getConfAssemblyNamesOrNone(\n self.parentTrack.configuration,\n )\n const assembly =\n pinned && assemblyName\n ? getSession(self).assemblyManager.get(assemblyName)\n : undefined\n return pinned && assembly\n ? assembly.getAliasesForRefName(pinned.refName)\n : []\n },\n }))\n .views(self => ({\n get adapterConfig() {\n const conf = self.configuredAdapter\n return self.walkForms\n ? {\n ...conf,\n ...(self.formsPinned ? { pinned: self.formsPinned } : {}),\n ...(self.pinnedAliases.length > 0\n ? { pinnedAliases: self.pinnedAliases }\n : {}),\n ...(self.formsFloorBp === undefined\n ? {}\n : { floorBp: self.formsFloorBp }),\n }\n : conf\n },\n get formsWindow() {\n return pinnedOf(this.adapterConfig.pinned)\n },\n get formsFloor() {\n return floorOf(this.adapterConfig.floorBp)\n },\n get formsCount() {\n return self.sourcesBase?.reduce(\n (n, row) => n + (Number(row.forms) || 1),\n 0,\n )\n },\n get visibleWindow(): Pinned | undefined {\n const view: unknown = getContainingView(self)\n const window = isLinearHost(view) ? hostWindow(view) : undefined\n return window && window.end > window.start\n ? {\n refName: window.refName,\n start: Math.max(0, Math.floor(window.start)),\n end: Math.ceil(window.end),\n }\n : undefined\n },\n }))\n .volatile(() => ({\n warnedWindow: undefined as Pinned | undefined,\n }))\n .actions(self => {\n const { setSources: superSetSources } = self\n const clearFormsWarnings = () => {\n clearWarnings(self, [self.warnedWindow, self.formsWindow])\n }\n return {\n setFormsPinned(pinned: Pinned) {\n clearFormsWarnings()\n self.formsPinned = pinned\n },\n setFormsFloorBp(floorBp: FloorBp) {\n clearFormsWarnings()\n self.formsFloorBp = floorBp\n },\n // Core posts the new forms' warnings right after this, so the old\n // ones come down first\n setSources(sources: unknown, adapterConfig?: unknown) {\n if (self.walkForms) {\n clearFormsWarnings()\n self.warnedWindow = self.formsWindow\n }\n superSetSources?.(sources, adapterConfig)\n },\n }\n })\n .views(self => {\n const { trackMenuItems: superTrackMenuItems } = self\n return {\n formsMenuItems(): MenuItem[] {\n const pinned = self.formsWindow\n const visible = self.visibleWindow\n return [\n {\n label: pinnedLabel(pinned, self.formsCount),\n disabled: true,\n onClick: () => {},\n },\n {\n label: 'Re-pin to visible region',\n helpText:\n 'Cut the forms from the region the view shows. Panning and zooming leave the forms alone',\n disabled:\n !visible ||\n (pinned !== undefined &&\n pinnedLocus(visible) === pinnedLocus(pinned)),\n onClick: () => {\n if (visible) {\n self.setFormsPinned(visible)\n }\n },\n },\n {\n label: 'Hide changes under',\n subMenu: FLOORS.map(({ label, value }) => ({\n label,\n type: 'radio' as const,\n checked: self.formsFloor === value,\n onClick: () => {\n self.setFormsFloorBp(value)\n },\n })),\n },\n ]\n },\n trackMenuItems(): MenuItem[] {\n return self.walkForms\n ? [...superTrackMenuItems(), ...this.formsMenuItems()]\n : superTrackMenuItems()\n },\n }\n })\n}\n\nexport default function WalkFormsMenuF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint('Core-extendPluggableElement', element => {\n if (element instanceof DisplayType && takesFormsMenu(element)) {\n element.extendStateModel(withFormsMenu)\n }\n return element\n })\n}\n\nexport function warnIfNoFormsDisplay(pluginManager: PluginManager) {\n const displays = pluginManager.getElementTypesInGroup('display')\n if (!displays.some(d => d instanceof DisplayType && takesFormsMenu(d))) {\n console.warn(\n 'jbrowse-plugin-graphgenomeviewer: no linear VariantTrack display is registered, so WalkFormsAdapter tracks get no pin or floor menu',\n )\n }\n}\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { DEFAULT_MAX_FORMS } from '../slotDefaults.ts'\nimport { fileLocationSlot, walksLocations } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config WalkFormsAdapter\n * #trackType VariantTrack\n * #fileFormat variant | Walk-file structural forms | Built by `gfa-to-tabix --walks`; one row per group of haplotypes making the same structural changes\n * Groups the haplotypes of a\n * [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) `--walks` file by the\n * structural changes their walks make over one pinned window, through\n * @gmod/gfa-tabix's `getFormsForRange` and `structuralForms`. Each group is a\n * form, which `LinearVariantDisplay` draws as one row, and each\n * change a variant whose genotype is `1` in the forms that make it.\n *\n * - The adapter cuts the pinned window once, whatever the view shows; outside\n * it the rows stay and draw empty\n * - The largest `maxForms` forms get a row each, labelled by share and largest\n * change (\"66% \u00B7 del 18.4kb\"); the rest share one empty \"other forms\" row\n * - A variant's `consequence` is `loss`, `gain` or `inversion`, for\n * colouring the cells; `svType` and `type` follow core's names\n * - `walksUri` takes the prefix of one reference's walk file and resolves\n * `<walksUri>.walks.gz` and its directory `<walksUri>.walks.gz.idx`, as\n * the other walk adapters do. The adapter reads walk format 8, which\n * gfa-to-tabix writes from 5.0\n *\n * #example\n * ```js\n * {\n * type: 'WalkFormsAdapter',\n * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38-f8.GRCh38',\n * pinned: { refName: 'chr1', start: 109680000, end: 109715000 },\n * exclude: ['CHM13'],\n * }\n * ```\n */\nconst WalkFormsAdapter = ConfigurationSchema(\n 'WalkFormsAdapter',\n {\n /**\n * #slot\n * a `gfa-to-tabix --walks` file in walk format 8\n */\n walksLocation: fileLocationSlot('/path/to/graph.walks.gz'),\n /**\n * #slot\n * the walk file's directory, `<prefix>.<sample>.walks.gz.idx`. Unset\n * reads it beside the walk file.\n */\n walksIndex: fileLocationSlot(''),\n /**\n * #slot\n * The window the forms come from, `{ refName, start, end }`, 0-based and\n * half-open. `refName` is the contig as the walk file's reference sample\n * names it (`chr1`), or its full PanSN name (`GRCh38#0#chr1`).\n */\n pinned: {\n type: 'frozen',\n defaultValue: {},\n },\n /**\n * #slot\n * The assembly's other names for `pinned.refName`, tried in turn when the\n * walk file's reference sample has no contig by that name. The forms menu\n * fills it in from the track's assembly, so a window pinned on `6` in a\n * view of an assembly with bare contig names cuts `GRCh38#0#chr6`.\n */\n pinnedAliases: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * The smallest change that tells two forms apart: `auto`, which follows\n * the pinned window's width (50 bp under 25 kb, 1 kb to 300 kb, 10 kb\n * past it), or 50, 1000 or 10000. A change of floor regroups the same\n * cut.\n */\n floorBp: {\n type: 'frozen',\n defaultValue: 'auto',\n },\n /**\n * #slot\n * Samples or `sample#haplotype`s left out of every form, such as a second\n * reference the walk file carries as a haplotype (`CHM13` in HPRC's\n * GRCh38 file)\n */\n exclude: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * The most forms drawn as rows of their own, largest first. The rest\n * share one empty \"other forms\" row, and a warning counts them.\n */\n maxForms: {\n type: 'integer',\n defaultValue: DEFAULT_MAX_FORMS,\n },\n /**\n * #slot\n * The most compressed bytes the forms cut fetches from the walk file,\n * its blocks of walks kept in short form included, which its directory\n * gives before any row is read. A pinned window over it shows an error\n * instead. The default admits the MHC windows the format 7 file drew.\n * Bytes stand in for memory only roughly: a window under the budget can\n * still be heavy for a browser tab.\n */\n walkByteBudget: {\n type: 'integer',\n defaultValue: 1_500_000,\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n * preprocessor to allow the minimal config\n * ```json\n * {\n * \"type\": \"WalkFormsAdapter\",\n * \"walksUri\": \"chr22.GRCh38\",\n * \"pinned\": { \"refName\": \"chr22\", \"start\": 0, \"end\": 50000 }\n * }\n * ```\n */\n preProcessSnapshot: walksLocations,\n },\n)\n\nexport type WalkFormsAdapterConfig = Instance<typeof WalkFormsAdapter>\n\nexport default WalkFormsAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\n// `.idx` pairs the walk file's directory with it in a host's file selection.\n// Held outside the call because AdapterMetadata through 5.0.0-beta.23 has no\n// indexSuffixes, and an object literal there would not compile\nconst adapterMetadata = {\n category: 'Variant adapters',\n indexSuffixes: ['.idx'],\n}\n\nexport default function WalkFormsAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'WalkFormsAdapter',\n displayName: 'Walk-file structural forms adapter',\n configSchema,\n adapterMetadata,\n getAdapterClass: () =>\n import('./WalkFormsAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "export type LaneRibbons = 'reference' | 'neighbours'\n\nexport const DEFAULT_LANE_RIBBONS: LaneRibbons = 'reference'\n\nexport const LANE_RIBBONS_LABEL = 'Lane ribbons'\n\nexport const LANE_RIBBONS: { value: LaneRibbons; label: string }[] = [\n { value: 'reference', label: 'each lane against the reference' },\n { value: 'neighbours', label: 'each lane against the lane above' },\n]\n\nexport const LANE_RIBBONS_VALUES = LANE_RIBBONS.map(option => option.value)\n", "import { ConfigurationSchema } from '@jbrowse/core/configuration'\n\nimport { lenientSlotEnum } from '../GraphGenomeView/lenientEnum.ts'\nimport { DEFAULT_LANE_RIBBONS, LANE_RIBBONS_VALUES } from '../laneRibbons.ts'\nimport { WALK_BUDGETS } from '../slotDefaults.ts'\nimport { fileLocationSlot, walksLocations } from '../tabixSlots.ts'\n\nimport type { Instance } from '@jbrowse/mobx-state-tree'\n\n/**\n * #config WalkTabixSyntenyAdapter\n * #trackType GraphTrack\n * #fileFormat synteny | Walk-indexed graph | Built by `gfa-to-tabix --walks`; haplotype lanes and local subgraphs from a walk file\n * Serves a pangenome graph whose haplotype walks\n * [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) `--walks` filed under\n * tiles of a reference, as haplotype-versus-reference alignments, the shape\n * `MultiWaySyntenyDisplay` draws as one lane per haplotype, and as the graph\n * display's cut. A window on the reference reads the walk rows filed under\n * it, and each haplotype is aligned to the reference, or to another\n * haplotype, on the nodes both walks visit. No base is compared, so a short\n * bubble with equal bases on both sides is written as mismatches and any other\n * as an insertion and a deletion.\n *\n * `walksUri` takes the prefix of one reference's walk file, `<prefix>.<sample>`,\n * and resolves `<walksUri>.walks.gz` and its directory `<walksUri>.walks.gz.idx`.\n * The adapter reads walk format 8, which gfa-to-tabix writes from 5.0, through\n * @gmod/gfa-tabix.\n * Only a window on the anchor is answered.\n *\n * #example\n * ```js\n * {\n * type: 'WalkTabixSyntenyAdapter',\n * walksUri: 'https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38-f8.GRCh38',\n * assemblyNames: ['hg38'],\n * assemblyNameToPanSN: { hg38: 'GRCh38' },\n * }\n * ```\n */\n\nconst WalkTabixSyntenyAdapter = ConfigurationSchema(\n 'WalkTabixSyntenyAdapter',\n {\n /**\n * #slot\n * The first entry is the anchor: the JBrowse assembly the walk file's\n * reference sample is loaded as. A haplotype needs no entry: its lane\n * draws on the session assembly `assemblyNameToPanSN` maps to it, at\n * haplotype (`HG002#1`) or sample (`HG002`) depth, and a haplotype with no\n * assembly is still a lane, labelled by its PanSN prefix.\n */\n assemblyNames: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * a `gfa-to-tabix --walks` file in walk format 8\n */\n walksLocation: fileLocationSlot('/path/to/graph.walks.gz'),\n /**\n * #slot\n * the walk file's directory, `<prefix>.<sample>.walks.gz.idx`. Unset\n * reads it beside the walk file.\n */\n walksIndex: fileLocationSlot(''),\n /**\n * #slot\n * the most haplotype steps one window keeps; a window whose walks hold\n * more shows a zoom-in notice instead, as does one whose rows hold eight\n * times as many. Counts only the haplotypes asked for. Walk rows draw\n * runs rather than steps, as does a graph folded to threads, which reads\n * the walks as runs, and both are bounded by `walkByteBudget` alone.\n */\n walkStepBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.stepBudget,\n },\n /**\n * #slot\n * the most compressed bytes one window fetches from the walk file, which\n * its directory gives before any row is read; a window over it shows a\n * zoom-in notice instead.\n */\n walkByteBudget: {\n type: 'integer',\n defaultValue: WALK_BUDGETS.byteBudget,\n },\n /**\n * #slot\n * the haplotypes the graph display is cut for until the user picks\n * others, as PanSN prefixes (`HG002#1`, or `HG002` for both of its\n * haplotypes). Empty means the lanes the track's `assemblyNames` lists\n * after its reference, else every haplotype.\n */\n defaultHaplotypes: {\n type: 'stringArray',\n defaultValue: [],\n },\n /**\n * #slot\n * A tab-separated table of per-sample metadata, which the graph view's\n * walk rows group by. Its header row names the columns, and its first\n * column is the walk's sample (`HG00097`) or haplotype (`HG00097#1`).\n * Empty means no grouping. A `color` column (`#rgb` or `#rrggbb`) colours\n * that haplotype's lane, as the header's `lanes[].color` and\n * `anchorColor`, and its lifted walk in the graph display; a row whose\n * `assembly` column names a lane's assembly counts for it too.\n */\n samplesTsvLocation: fileLocationSlot(''),\n /**\n * #slot\n * what each lane's ribbons join it to: `reference`, the reference, read\n * from where the walk file places each step, or `neighbours`, the lane\n * above, each pair aligned on the nodes both walk. A multi-way display\n * that does not say it reads lanes against the reference, as JBrowse\n * releases before it did not, gets `neighbours` whatever this says\n */\n laneRibbons: {\n type: 'stringEnum',\n model: lenientSlotEnum(LANE_RIBBONS_VALUES, DEFAULT_LANE_RIBBONS),\n defaultValue: DEFAULT_LANE_RIBBONS,\n },\n /**\n * #slot\n * Maps a JBrowse assembly name to its PanSN prefix in the graph, sample or\n * haplotype level (`{ hg38: 'GRCh38', 'HG002.1': 'HG002#1' }`). An\n * assembly not listed maps to itself.\n */\n assemblyNameToPanSN: {\n type: 'frozen',\n defaultValue: {},\n },\n },\n {\n explicitlyTyped: true,\n\n /**\n * #preProcessSnapshot\n * preprocessor to allow the minimal config, for the GRCh38 set of a graph\n * built by `gfa-to-tabix --walks -o chr22`\n * ```json\n * {\n * \"type\": \"WalkTabixSyntenyAdapter\",\n * \"walksUri\": \"chr22.GRCh38\",\n * \"assemblyNames\": [\"hg38\"],\n * \"assemblyNameToPanSN\": { \"hg38\": \"GRCh38\" }\n * }\n * ```\n */\n preProcessSnapshot: walksLocations,\n },\n)\n\nexport type WalkTabixSyntenyAdapterConfig = Instance<\n typeof WalkTabixSyntenyAdapter\n>\n\nexport default WalkTabixSyntenyAdapter\n", "import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'\n\nimport configSchema from './configSchema.ts'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\n// `.idx` pairs the walk file's directory with it in a host's file selection.\n// Held outside the call because AdapterMetadata through 5.0.0-beta.23 has no\n// indexSuffixes, and an object literal there would not compile\nconst adapterMetadata = {\n category: 'Synteny adapters',\n indexSuffixes: ['.idx'],\n}\n\nexport default function WalkTabixSyntenyAdapterF(pluginManager: PluginManager) {\n pluginManager.addAdapterType(\n () =>\n new AdapterType({\n name: 'WalkTabixSyntenyAdapter',\n displayName: 'Walk-indexed graph adapter',\n configSchema,\n // the capabilities GbzBaseSyntenyAdapter declares, for the same\n // reasons: the header lists every haplotype as a lane, and one read\n // of an anchor window answers any pair of lanes, or several. The\n // header's lanesReadAgainstAnchor sets which the display reads\n adapterCapabilities: [\n 'getSubgraph',\n 'headerLanes',\n 'lanePairsOnAnchor',\n 'lanePairBatches',\n ],\n adapterMetadata,\n getAdapterClass: () =>\n import('./WalkTabixSyntenyAdapter.ts').then(r => r.default),\n }),\n )\n}\n", "import { buildAdapterConfig } from '../GraphAddTrackWorkflow/buildTrackConfig'\nimport { isGraphIndexLocation } from '../GraphAddTrackWorkflow/graphManifest'\nimport { WALKS_SUFFIX, locationName, readsSiblings } from '../locationName'\n\nimport type { GraphFileChoice } from '../GraphAddTrackWorkflow/buildTrackConfig'\nimport type { FileLocation } from '@jbrowse/core/util'\n\nconst BUBBLES_SUFFIX = '.bubbles.bed.gz'\n\nfunction isGbzLocation(loc: FileLocation) {\n return locationName(loc).toLowerCase().endsWith('.gbz.db')\n}\n\nfunction guessChoice(\n file: FileLocation,\n index: FileLocation | undefined,\n adapterHint: string | undefined,\n): GraphFileChoice | undefined {\n const name = locationName(file)\n const allows = (type: GraphFileChoice) => !adapterHint || adapterHint === type\n // a file picked in the browser has no index beside it to assume\n const indexReachable = index !== undefined || readsSiblings(file)\n return isGbzLocation(file)\n ? allows('GbzBaseSyntenyAdapter')\n ? 'GbzBaseSyntenyAdapter'\n : undefined\n : isGraphIndexLocation(file)\n ? allows('RgfaTabixAdapter')\n ? 'RgfaTabixAdapter'\n : undefined\n : !indexReachable\n ? undefined\n : name.endsWith(WALKS_SUFFIX)\n ? // lanes beside the graph, unless the hint asks for the rGFA\n // adapter, which reads the file without them\n adapterHint === 'RgfaTabixAdapter'\n ? 'RgfaTabixWalks'\n : allows('WalkTabixSyntenyAdapter')\n ? 'WalkTabixSyntenyAdapter'\n : undefined\n : allows('MinigraphBubbleAdapter') &&\n (name.endsWith(BUBBLES_SUFFIX) || adapterHint !== undefined)\n ? 'MinigraphBubbleAdapter'\n : undefined\n}\n\nexport function guessGraphAdapter(\n file: FileLocation,\n index?: FileLocation,\n adapterHint?: string,\n) {\n const choice = guessChoice(file, index, adapterHint)\n return choice\n ? buildAdapterConfig({\n choice,\n loc: file,\n indexLoc: index,\n assembly: '',\n sample: '',\n })\n : undefined\n}\n", "import { guessGraphAdapter } from './guessAdapter'\nimport { GRAPH_ADAPTERS, walkIndexed } from '../graphTrackConfig'\nimport { isRecord } from '../isRecord'\nimport { WALKS_SUFFIX, splitUri, walkFileSample } from '../locationName'\nimport { LANE_ADAPTERS } from '../panSNAliases/trackAdapterConfig'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type {\n AdapterGuesser,\n TrackTypeGuesser,\n} from '@jbrowse/core/util/tracks'\n\ntype TrackConfigSnapshot = Record<string, unknown>\n\n// A lanes adapter cuts on the first assembly it names. A track added through\n// Open track names that assembly on the track alone.\nexport function withLaneAnchor(snap: TrackConfigSnapshot) {\n const adapter = snap.adapter as\n { type?: string; assemblyNames?: unknown[] } | undefined\n return adapter?.type !== undefined &&\n LANE_ADAPTERS.has(adapter.type) &&\n !adapter.assemblyNames?.length &&\n Array.isArray(snap.assemblyNames) &&\n snap.assemblyNames.length > 0\n ? { ...snap, adapter: { ...adapter, assemblyNames: snap.assemblyNames } }\n : snap\n}\n\n// The walk file a config snapshot names, by the `walksUri` shorthand or the\n// location it expands to\nfunction walkFileName({ walksUri, walksLocation }: Record<string, unknown>) {\n const { uri, localPath, name } = isRecord(walksLocation) ? walksLocation : {}\n return typeof walksUri === 'string' && walksUri !== ''\n ? `${walksUri}${WALKS_SUFFIX}`\n : typeof uri === 'string'\n ? splitUri(uri).name\n : typeof localPath === 'string'\n ? localPath\n : typeof name === 'string'\n ? name\n : undefined\n}\n\n// A walk file opened with no PanSN map reads as the sample its name gives, on\n// the track's assembly; a guessed adapter had no assembly to key that by\nexport function withWalkReference(snap: TrackConfigSnapshot) {\n const adapter = isRecord(snap.adapter) ? snap.adapter : undefined\n const [assembly] = Array.isArray(snap.assemblyNames)\n ? (snap.assemblyNames as string[])\n : []\n const file =\n adapter && walkIndexed(adapter) ? walkFileName(adapter) : undefined\n const sample = file ? walkFileSample(file) : undefined\n return adapter &&\n assembly &&\n sample &&\n sample !== assembly &&\n adapter.assemblyNameToPanSN === undefined\n ? {\n ...snap,\n adapter: { ...adapter, assemblyNameToPanSN: { [assembly]: sample } },\n }\n : snap\n}\n\nexport default function GraphTrackDefaultsF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint(\n 'Core-preProcessTrackConfig',\n withLaneAnchor,\n )\n pluginManager.addToExtensionPoint(\n 'Core-preProcessTrackConfig',\n withWalkReference,\n )\n pluginManager.addToExtensionPoint(\n 'Core-guessAdapterForLocation',\n (next: AdapterGuesser): AdapterGuesser =>\n (file, index, adapterHint) =>\n guessGraphAdapter(file, index, adapterHint) ??\n next(file, index, adapterHint),\n )\n pluginManager.addToExtensionPoint(\n 'Core-guessTrackTypeForLocation',\n (next: TrackTypeGuesser): TrackTypeGuesser =>\n (adapterName, file) =>\n GRAPH_ADAPTERS.has(adapterName)\n ? 'GraphTrack'\n : adapterName === 'MinigraphBubbleAdapter'\n ? 'FeatureTrack'\n : next(adapterName, file),\n )\n}\n", "import { isRecord } from '../isRecord'\nimport { withRows } from '../launchFromGraph/linearViewTarget'\n\nexport interface HighlightRegion {\n refName: string\n start: number\n end: number\n assemblyName?: string\n}\n\nexport interface GraphViewHighlight {\n key: string\n region: HighlightRegion\n}\n\nfunction readRegion(value: unknown): HighlightRegion | undefined {\n let region: HighlightRegion | undefined\n if (isRecord(value)) {\n const { refName, start, end, assemblyName } = value\n if (\n typeof refName === 'string' &&\n typeof start === 'number' &&\n typeof end === 'number'\n ) {\n region = {\n refName,\n start,\n end,\n assemblyName:\n typeof assemblyName === 'string' ? assemblyName : undefined,\n }\n }\n }\n return region\n}\n\n// Whether a graph view's highlights belong on a given linear view.\n// `connectedViewId` is written by the launch menu, so a launched pair is\n// explicit. A graph view without one \u2014 a hand-written session snapshot, or\n// `Add > Graph genome view` followed by a subgraph load \u2014 matches any linear\n// view, because the alternative is silently drawing nothing.\n//\n// So does one whose linear view has been closed. Held to an id nothing answers\n// to, it matched no view and its hover drew nowhere for the rest of the\n// session, the view it next opened included.\nfunction isConnected(\n view: Record<string, unknown>,\n linearViewId: string,\n liveViewIds: ReadonlySet<unknown>,\n) {\n const connectedViewId = view.connectedViewId\n return (\n connectedViewId === undefined ||\n connectedViewId === linearViewId ||\n !liveViewIds.has(connectedViewId)\n )\n}\n\n// ...and whether the view can mean anything by it. `getHighlightCoords`\n// canonicalizes a refName against the region's OWN assembly and then lays it\n// out against this view's displayed regions, without ever asking whether the\n// two are the same assembly \u2014 so a band handed to the wrong view is drawn, at\n// coordinates that belong to somebody else's genome.\n//\n// That is not hypothetical for an unpaired graph, which by the rule above\n// matches every linear view in the session. A synteny stack's rows are LGVs on\n// different assemblies, and a PanSN name reduces to a bare contig: the five\n// E. coli strains each have one refName `chr`, so a graph cut from K12 painted\n// its K12 interval across Sakai's row and CFT073's at their own offsets. With\n// the assembly checked the reference row keeps the band and the rest correctly\n// draw nothing.\n//\n// A region stating no assembly still passes \u2014 `readRegion` leaves it optional,\n// and the fallback is the behaviour every existing snapshot has.\nfunction isOnAssembly(\n region: HighlightRegion,\n assemblyNames: string[] | undefined,\n) {\n return (\n region.assemblyName === undefined ||\n assemblyNames === undefined ||\n assemblyNames.includes(region.assemblyName)\n )\n}\n\n// The graph displays in a linear view's own tracks, connected to it by where\n// they sit.\nfunction trackGraphs(view: Record<string, unknown>) {\n const tracks = Array.isArray(view.tracks) ? view.tracks : []\n return tracks.flatMap((track: unknown) =>\n isRecord(track) && Array.isArray(track.displays)\n ? track.displays.filter(\n (display: unknown): display is Record<string, unknown> =>\n isRecord(display) && display.type === 'LinearGraphDisplay',\n )\n : [],\n )\n}\n\n// The highlights a linear view should draw for the graph views connected to it.\n// Reads `session.views` structurally: the members it needs are declared by\n// GraphGenomeView, not by the AbstractViewModel the session array is typed as.\nexport function graphViewHighlights(\n views: unknown[],\n linearViewId: string,\n // the drawing view's own assemblies, so a band is only drawn where its\n // coordinates mean something \u2014 see isOnAssembly\n linearAssemblyNames?: string[],\n): GraphViewHighlight[] {\n const highlights: GraphViewHighlight[] = []\n const candidates = withRows(views)\n const liveViewIds = new Set(\n candidates.map(view => (isRecord(view) ? view.id : undefined)),\n )\n for (const view of candidates) {\n if (isRecord(view) && view.id === linearViewId) {\n for (const display of trackGraphs(view)) {\n const region = readRegion(display.hoverHighlight)\n if (region && isOnAssembly(region, linearAssemblyNames)) {\n highlights.push({\n key: typeof display.id === 'string' ? display.id : 'graph-track',\n region,\n })\n }\n }\n }\n // A hovered node's span on each haplotype's own assembly goes to any\n // view of that assembly, paired or not: the assembly name says where it\n // belongs, and those views are a synteny stack's rows or opened beside\n for (const graph of isRecord(view)\n ? [\n ...trackGraphs(view),\n ...(view.type === 'GraphGenomeView' ? [view] : []),\n ]\n : []) {\n const spans = Array.isArray(graph.assemblyHoverHighlights)\n ? graph.assemblyHoverHighlights\n : []\n spans.forEach((value: unknown, i) => {\n const region = readRegion(value)\n if (\n region?.assemblyName !== undefined &&\n linearAssemblyNames?.includes(region.assemblyName)\n ) {\n highlights.push({\n key: `${typeof graph.id === 'string' ? graph.id : 'graph'}-${i}`,\n region,\n })\n }\n })\n }\n if (\n isRecord(view) &&\n view.type === 'GraphGenomeView' &&\n isConnected(view, linearViewId, liveViewIds)\n ) {\n const region = readRegion(view.hoverHighlight)\n if (region && isOnAssembly(region, linearAssemblyNames)) {\n highlights.push({\n key: typeof view.id === 'string' ? view.id : 'graph',\n region,\n })\n }\n }\n }\n return highlights\n}\n", "import { getSession } from '@jbrowse/core/util'\nimport { alpha } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { graphViewHighlights } from './graphViewHighlights'\n\nimport type { HighlightRegion } from './graphViewHighlights'\nimport type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'\n\nconst useStyles = makeStyles()(theme => ({\n highlight: {\n height: '100%',\n position: 'absolute',\n background: alpha(theme.palette.primary.main, 0.08),\n borderLeft: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n borderRight: `1px solid ${alpha(theme.palette.primary.main, 0.4)}`,\n pointerEvents: 'none',\n zIndex: 10,\n },\n}))\n\n// One band over the linear view for a hovered graph node. `getHighlightCoords`\n// is the LGV's own projection \u2014 it canonicalizes the refName and floors the\n// width to 3 px, so a pure insertion (a zero-length reference span) still shows\n// as a mark rather than vanishing.\nconst Highlight = observer(function Highlight({\n model,\n region,\n}: {\n model: LinearGenomeViewModel\n region: HighlightRegion\n}) {\n const { classes } = useStyles()\n const coords = model.getHighlightCoords(region)\n return coords ? (\n <div\n data-testid=\"graph-node-highlight\"\n className={classes.highlight}\n style={{ left: coords.left, width: coords.width }}\n />\n ) : null\n})\n\nconst GraphNodeHighlight = observer(function GraphNodeHighlight({\n model,\n}: {\n model: LinearGenomeViewModel\n}) {\n const { views } = getSession(model)\n return (\n <>\n {graphViewHighlights([...views], model.id, model.assemblyNames).map(\n ({ key, region }) => (\n <Highlight key={`graph-hover-${key}`} model={model} region={region} />\n ),\n )}\n </>\n )\n})\n\nexport default GraphNodeHighlight\n", "import GraphNodeHighlight from './GraphNodeHighlight'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\n\n// The graph-to-linear half of the hover sync. The reverse half needs no mount\n// point: an LGV already publishes its hover to `session.hovered`, and the graph\n// view's own autorun reads it (see GraphGenomeView/pane/renderingActions.ts).\n//\n// Mounted through the extension point rather than imported by the LGV, so this\n// plugin never imports @jbrowse/plugin-linear-genome-view at runtime: it is not\n// one of JBrowse's shared globals, so a value import would bundle a second copy\n// of that whole plugin.\nconst POINT = 'LinearGenomeView-TracksContainerComponent'\n\nexport default function contributeGraphHoverSync(pluginManager: PluginManager) {\n pluginManager.contributeToExtensionPoint(POINT, ({ model }) => (\n <GraphNodeHighlight key=\"graphgenomeview-hover-highlight\" model={model} />\n ))\n}\n", "import { DisplayType } from '@jbrowse/core/pluggableElementTypes'\nimport { getContainingTrack } from '@jbrowse/core/util'\n\nimport { trackAdapterConfig } from './trackAdapterConfig'\nimport { SYNTENY_DISPLAYS } from '../GraphTrack/index'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { IAnyModelType, IAnyStateTreeNode } from '@jbrowse/mobx-state-tree'\n\n// Core's synteny displays send `adapterConfig` with every request, the lane\n// listing's included, so overriding the getter reaches them all\nfunction withTrackAdapterConfig(model: IAnyModelType) {\n return model.views((self: IAnyStateTreeNode) => ({\n get adapterConfig(): Record<string, unknown> {\n return trackAdapterConfig(self, getContainingTrack(self).configuration)\n },\n }))\n}\n\nexport default function PanSNAliasesF(pluginManager: PluginManager) {\n pluginManager.addToExtensionPoint('Core-extendPluggableElement', element => {\n if (\n element instanceof DisplayType &&\n SYNTENY_DISPLAYS.includes(element.name)\n ) {\n element.extendStateModel(withTrackAdapterConfig)\n }\n return element\n })\n}\n", "// The name JBrowse knows this plugin by, which a config's `plugins` entry\n// states beside its `esmUrl`.\nexport const PLUGIN_NAME = 'GraphGenomeView'\n", "export const version = '10.17.0'\n", "import Plugin from '@jbrowse/core/Plugin'\nimport { isAbstractMenuManager } from '@jbrowse/core/util'\nimport BubbleChartIcon from '@mui/icons-material/BubbleChart'\n\nimport GbzBaseSyntenyAdapterF from './GbzBaseSyntenyAdapter/index'\nimport GetGraphHaplotypes from './GetGraphHaplotypes'\nimport GetGraphReads from './GetGraphReads'\nimport GetSubgraph from './GetSubgraph'\nimport GraphAddTrackWorkflowF from './GraphAddTrackWorkflow/index'\nimport GraphComputeLayout from './GraphComputeLayout'\nimport GraphGenomeViewF from './GraphGenomeView/index'\nimport GraphTrackF from './GraphTrack/index'\nimport LaunchGraphGenomeViewF from './LaunchGraphGenomeView'\nimport LinearGraphDisplayF from './LinearGraphDisplay/index'\nimport MinigraphBubbleAdapterF from './MinigraphBubbleAdapter/index'\nimport RgfaTabixAdapterF from './RgfaTabixAdapter/index'\nimport WalkFormsMenuF, {\n warnIfNoFormsDisplay,\n} from './WalkFormsAdapter/formsMenu'\nimport WalkFormsAdapterF from './WalkFormsAdapter/index'\nimport WalkTabixSyntenyAdapterF from './WalkTabixSyntenyAdapter/index'\nimport GraphTrackDefaultsF from './graphTrackDefaults/index'\nimport contributeGraphHoverSync from './hoverSync/index'\nimport PanSNAliasesF from './panSNAliases/index'\nimport { PLUGIN_NAME } from './pluginName'\nimport { version } from './version'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { AbstractSessionModel } from '@jbrowse/core/util'\n\nexport default class GraphGenomeViewPlugin extends Plugin {\n name = PLUGIN_NAME\n version = version\n\n install(pluginManager: PluginManager) {\n GraphGenomeViewF(pluginManager)\n LinearGraphDisplayF(pluginManager)\n GraphTrackF(pluginManager)\n LaunchGraphGenomeViewF(pluginManager)\n contributeGraphHoverSync(pluginManager)\n RgfaTabixAdapterF(pluginManager)\n MinigraphBubbleAdapterF(pluginManager)\n GbzBaseSyntenyAdapterF(pluginManager)\n WalkTabixSyntenyAdapterF(pluginManager)\n WalkFormsAdapterF(pluginManager)\n WalkFormsMenuF(pluginManager)\n GraphAddTrackWorkflowF(pluginManager)\n GraphTrackDefaultsF(pluginManager)\n PanSNAliasesF(pluginManager)\n pluginManager.addRpcMethod(() => new GraphComputeLayout(pluginManager))\n pluginManager.addRpcMethod(() => new GetSubgraph(pluginManager))\n pluginManager.addRpcMethod(() => new GetGraphReads(pluginManager))\n pluginManager.addRpcMethod(() => new GetGraphHaplotypes(pluginManager))\n }\n\n // A throw from configure() takes the whole session to its error page, and a\n // menu entry is not worth that: hubs 1.0.9 did exactly this to every\n // jbrowse.org/ucsc launch by appending to a menu a released host defines as\n // a function. The view is still reachable without the entry.\n configure(pluginManager: PluginManager) {\n warnIfNoFormsDisplay(pluginManager)\n try {\n if (isAbstractMenuManager(pluginManager.rootModel)) {\n pluginManager.rootModel.appendToSubMenu(['Add'], {\n label: 'Graph genome view',\n icon: BubbleChartIcon,\n onClick: (session: AbstractSessionModel) => {\n session.addView('GraphGenomeView', {})\n },\n })\n }\n } catch (e) {\n console.warn('[GraphGenomeView] could not add the Add menu entry', e)\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "kqDAAA,IAAMA,EAAO,eAAe,sBAAsB,EAUlD,IAAOC,GAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECVxD,IAAMC,EAAO,eAAe,iDAAiD,EAU7E,IAAOC,EAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECJjD,IAAMC,EAAoBC,IAAiB,CAChD,KAAM,eACN,aAAc,CAAE,IAAAA,EAAK,aAAc,aAAc,CACnD,GAKaC,EAAmB,CAACC,EAAcC,EAAa,KAC1DC,EAAoBF,EAAM,CAIxB,UAAW,CACT,MAAOG,EAAM,YAAY,YAAa,CAAC,MAAO,KAAK,CAAC,EACpD,KAAM,aACN,aAAc,KAChB,EAIA,SAAUN,EAAiBI,CAAU,CACvC,CAAC,EAGI,SAASG,EAAUN,EAAaO,EAAkBC,EAAc,CACrE,MAAO,CACL,UAAWA,EAAM,MAAQ,MACzB,SAAU,CAAE,IAAK,GAAGR,CAAG,IAAIQ,EAAM,MAAQ,KAAK,GAAI,QAAAD,CAAQ,CAC5D,CACF,CAGO,SAASE,EAAeC,EAA+B,CAC5D,GAAM,CAAE,SAAAC,EAAU,QAAAJ,CAAQ,EAAIG,EAC9B,GAAI,OAAOC,GAAa,SACtB,OAAOD,EAET,IAAME,EAAQ,GAAGD,CAAQ,GAAGE,CAAY,GACxC,MAAO,CACL,GAAGH,EACH,cAAe,CAAE,IAAKE,EAAO,QAAAL,CAAQ,EACrC,WAAY,CAAE,IAAK,GAAGK,CAAK,OAAQ,QAAAL,CAAQ,CAC7C,CACF,CCbA,IAAMO,GAAwBC,EAC5B,wBACA,CAWE,cAAe,CACb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ACzBI,GAAuBJ,CAAa,EACpCK,GAAyBL,CAAa,EACtCM,GAAkBN,CAAa,EAC/BO,GAAwBP,CAAa,EACrCQ,GAAuBR,CAAa,EACpCS,GAAyBT,CAAa,EACtCU,GAAkBV,CAAa,EAC/BW,GAAeX,CAAa,EAC5BY,GAAuBZ,CAAa,EACpCa,GAAoBb,CAAa,EACjCc,GAAcd,CAAa,EAC3BA,EAAc,aAAa,IAAM,IAAIe,EAAmBf,CAAa,CAAC,EACtEA,EAAc,aAAa,IAAM,IAAIgB,GAAYhB,CAAa,CAAC,EAC/DA,EAAc,aAAa,IAAM,IAAIiB,GAAcjB,CAAa,CAAC,EACjEA,EAAc,aAAa,IAAM,IAAIkB,EAAmBlB,CAAa,CAAC,CACxE,CAMA,UAAUA,EAA8B,CACtCmB,GAAqBnB,CAAa,EAClC,GAAI,CACEoB,GAAsBpB,EAAc,SAAS,GAC/CA,EAAc,UAAU,gBAAgB,CAAC,KAAK,EAAG,CAC/C,MAAO,oBACP,KAAMqB,GACN,QAAUC,GAAkC,CAC1CA,EAAQ,QAAQ,kBAAmB,CAAC,CAAC,CACvC,CACF,CAAC,CAEL,OAASC,EAAG,CACV,QAAQ,KAAK,qDAAsDA,CAAC,CACtE,CACF,CACF",
|
|
6
|
+
"names": ["host", "Plugin_default", "host", "host", "AdapterType_default", "host", "fileLocationSlot", "uri", "tabixIndexSchema", "name", "defaultUri", "ConfigurationSchema", "types", "tbiBeside", "baseUri", "csi", "walksLocations", "snap", "walksUri", "walks", "WALKS_SUFFIX", "GbzBaseSyntenyAdapter", "ConfigurationSchema", "fileLocationSlot", "tabixIndexSchema", "types", "GBZ_CUT_DEFAULTS", "snap", "uri", "baseUri", "reads", "readsIndexBeside", "name", "query", "splitUri", "configSchema_default", "GbzBaseSyntenyAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "GetGraphHaplotypes", "RpcMethodType", "args", "adapter", "adapterImplementing", "GraphAddTrackWidget", "lazy", "GraphAddTrackWorkflowF", "pluginManager", "AddTrackWorkflowType", "types", "GraphComputeLayout", "RpcMethodType", "args", "graph", "options", "signal", "statusCallback", "resolve", "layoutEngine", "host", "ViewType_default", "host", "host", "read", "name", "defineLaunchKeys", "withLaunchInput_default", "host", "host", "read", "name", "BaseViewModel", "read", "models_default", "host", "stateModelFactory", "types", "BaseViewModel", "GraphPane", "lenientMaybeEnum", "LAYOUT_MODE_VALUES", "lenientOptionalEnum", "LAYOUT_ENGINE_VALUES", "HOVER_HIGHLIGHT_VALUES", "LINKS_DRAWN_VALUES", "self", "encoding", "settings", "setBaseWidth", "width", "graphTrackChoices", "getSession", "clearPane", "loadRegion", "region", "fileName", "adapter", "span", "problem", "formatSpanBp", "stated", "session", "assemblyManager", "assembly", "isAlive", "canonicalRegion", "location", "_from", "trackId", "loc", "showTrackInLinearView", "isViewContainer", "graphLaunchKeys", "defineLaunchKeys", "GraphGenomeViewF", "pluginManager", "ViewType_default", "stateModelFactory", "lazy", "SYNTENY_DISPLAYS", "displaysInOrder", "pluginManager", "displays", "named", "name", "d", "needs", "capability", "display", "GraphTrackF", "configSchema", "ConfigurationSchema", "createBaseTrackConfig", "track", "TrackType", "createBaseTrackModel", "LaunchGraphGenomeViewF", "pluginManager", "args", "session", "spec", "host", "DisplayType_default", "host", "host", "read", "name", "heightModeConfigSchemaFields", "heightModeConfigSchemaFields_default", "host", "read", "name", "trackHeightConfigSchemaFields", "trackHeightConfigSchemaFields_default", "host", "read", "name", "facetConfigSchema", "facetConfigSchema_default", "host", "graphFacetConfigSchema", "ConfigurationSchema", "facetConfigSchema", "EXTENT_VALUES", "DEFAULT_EXTENT", "configSchemaFactory", "ConfigurationSchema", "lenientSlotEnum", "LAYOUT_MODE_VALUES", "LAYOUT_ENGINE_VALUES", "graphFacetConfigSchema", "HOVER_HIGHLIGHT_VALUES", "LINKS_DRAWN_VALUES", "DEFAULT_LINKS_DRAWN", "SITES_VALUES", "DEFAULT_SITES", "KEY_PLACEMENT_VALUES", "DEFAULT_KEY_PLACEMENT", "EXTENT_VALUES", "DEFAULT_EXTENT", "trackHeightConfigSchemaFields", "heightModeConfigSchemaFields", "DEFAULT_TRACK_FIT", "LinearGraphDisplayF", "pluginManager", "configSchema", "configSchemaFactory", "DisplayType_default", "stateModelFactory", "lazy", "normalizeSnapshot", "snap", "uri", "baseUri", "csi", "tbiBeside", "MinigraphBubbleAdapter", "ConfigurationSchema", "fileLocationSlot", "tabixIndexSchema", "configSchema_default", "MinigraphBubbleAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "prefixLocations", "snap", "uri", "baseUri", "csi", "format", "GRAPH_SUFFIX", "tbiBeside", "normalizeSnapshot", "coarse", "walksLocations", "RgfaTabixCoarseTier", "ConfigurationSchema", "fileLocationSlot", "tabixIndexSchema", "RgfaTabixAdapter", "WALK_BUDGETS", "configSchema_default", "adapterMetadata", "RgfaTabixAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "takesFormsMenu", "display", "FLOORS", "pinnedLabel", "pinned", "forms", "pinnedLocus", "clearWarnings", "node", "windows", "session", "getSession", "prefixes", "w", "warningPrefix", "message", "p", "withFormsMenu", "model", "types", "self", "trackAdapterSnapshot", "pinnedOf", "assemblyName", "getConfAssemblyNamesOrNone", "assembly", "conf", "floorOf", "n", "row", "view", "getContainingView", "window", "isLinearHost", "hostWindow", "superSetSources", "clearFormsWarnings", "floorBp", "sources", "adapterConfig", "superTrackMenuItems", "visible", "label", "value", "WalkFormsMenuF", "pluginManager", "element", "DisplayType", "warnIfNoFormsDisplay", "d", "WalkFormsAdapter", "ConfigurationSchema", "fileLocationSlot", "DEFAULT_MAX_FORMS", "walksLocations", "configSchema_default", "adapterMetadata", "WalkFormsAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "DEFAULT_LANE_RIBBONS", "LANE_RIBBONS", "LANE_RIBBONS_VALUES", "option", "WalkTabixSyntenyAdapter", "ConfigurationSchema", "fileLocationSlot", "WALK_BUDGETS", "lenientSlotEnum", "LANE_RIBBONS_VALUES", "DEFAULT_LANE_RIBBONS", "walksLocations", "configSchema_default", "adapterMetadata", "WalkTabixSyntenyAdapterF", "pluginManager", "AdapterType_default", "configSchema_default", "r", "BUBBLES_SUFFIX", "isGbzLocation", "loc", "locationName", "guessChoice", "file", "index", "adapterHint", "name", "allows", "type", "indexReachable", "readsSiblings", "isGraphIndexLocation", "WALKS_SUFFIX", "guessGraphAdapter", "choice", "buildAdapterConfig", "withLaneAnchor", "snap", "adapter", "LANE_ADAPTERS", "walkFileName", "walksUri", "walksLocation", "uri", "localPath", "name", "isRecord", "WALKS_SUFFIX", "splitUri", "withWalkReference", "assembly", "file", "walkIndexed", "sample", "walkFileSample", "GraphTrackDefaultsF", "pluginManager", "next", "index", "adapterHint", "guessGraphAdapter", "adapterName", "GRAPH_ADAPTERS", "readRegion", "value", "region", "isRecord", "refName", "start", "end", "assemblyName", "isConnected", "view", "linearViewId", "liveViewIds", "connectedViewId", "isOnAssembly", "assemblyNames", "trackGraphs", "track", "display", "graphViewHighlights", "views", "linearAssemblyNames", "highlights", "candidates", "withRows", "graph", "i", "useStyles", "makeStyles", "theme", "alpha", "Highlight", "observer", "model", "region", "classes", "coords", "jsx", "GraphNodeHighlight", "views", "getSession", "Fragment", "graphViewHighlights", "key", "GraphNodeHighlight_default", "POINT", "contributeGraphHoverSync", "pluginManager", "model", "jsx", "GraphNodeHighlight_default", "withTrackAdapterConfig", "model", "self", "trackAdapterConfig", "getContainingTrack", "PanSNAliasesF", "pluginManager", "element", "DisplayType", "SYNTENY_DISPLAYS", "PLUGIN_NAME", "version", "GraphGenomeViewPlugin", "Plugin_default", "PLUGIN_NAME", "version", "pluginManager", "GraphGenomeViewF", "LinearGraphDisplayF", "GraphTrackF", "LaunchGraphGenomeViewF", "contributeGraphHoverSync", "RgfaTabixAdapterF", "MinigraphBubbleAdapterF", "GbzBaseSyntenyAdapterF", "WalkTabixSyntenyAdapterF", "WalkFormsAdapterF", "WalkFormsMenuF", "GraphAddTrackWorkflowF", "GraphTrackDefaultsF", "PanSNAliasesF", "GraphComputeLayout", "GetSubgraph", "GetGraphReads", "GetGraphHaplotypes", "warnIfNoFormsDisplay", "isAbstractMenuManager", "BubbleChart_default", "session", "e"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jbrowse-plugin-graphgenomeviewer",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.17.0",
|
|
4
4
|
"description": "JBrowse 2 graph genome (pangenome) view: rGFA reference-anchored layouts, the Bandage force-directed engine, and haplotype lanes read from a gbz-base database",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|
|
@@ -4,6 +4,14 @@ import configSchema from './configSchema.ts'
|
|
|
4
4
|
|
|
5
5
|
import type PluginManager from '@jbrowse/core/PluginManager'
|
|
6
6
|
|
|
7
|
+
// `.idx` pairs the walk file's directory with it in a host's file selection.
|
|
8
|
+
// Held outside the call because AdapterMetadata through 5.0.0-beta.23 has no
|
|
9
|
+
// indexSuffixes, and an object literal there would not compile
|
|
10
|
+
const adapterMetadata = {
|
|
11
|
+
category: 'Graph adapters',
|
|
12
|
+
indexSuffixes: ['.idx'],
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
export default function RgfaTabixAdapterF(pluginManager: PluginManager) {
|
|
8
16
|
pluginManager.addAdapterType(
|
|
9
17
|
() =>
|
|
@@ -14,9 +22,7 @@ export default function RgfaTabixAdapterF(pluginManager: PluginManager) {
|
|
|
14
22
|
// what a graph display needs of its track's adapter, and the
|
|
15
23
|
// reference's segments that its getFeatures gives the segments lane
|
|
16
24
|
adapterCapabilities: ['getSubgraph', 'referenceSegments'],
|
|
17
|
-
adapterMetadata
|
|
18
|
-
category: 'Graph adapters',
|
|
19
|
-
},
|
|
25
|
+
adapterMetadata,
|
|
20
26
|
getAdapterClass: () =>
|
|
21
27
|
import('./RgfaTabixAdapter.ts').then(r => r.default),
|
|
22
28
|
}),
|
|
@@ -4,6 +4,14 @@ import configSchema from './configSchema.ts'
|
|
|
4
4
|
|
|
5
5
|
import type PluginManager from '@jbrowse/core/PluginManager'
|
|
6
6
|
|
|
7
|
+
// `.idx` pairs the walk file's directory with it in a host's file selection.
|
|
8
|
+
// Held outside the call because AdapterMetadata through 5.0.0-beta.23 has no
|
|
9
|
+
// indexSuffixes, and an object literal there would not compile
|
|
10
|
+
const adapterMetadata = {
|
|
11
|
+
category: 'Variant adapters',
|
|
12
|
+
indexSuffixes: ['.idx'],
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
export default function WalkFormsAdapterF(pluginManager: PluginManager) {
|
|
8
16
|
pluginManager.addAdapterType(
|
|
9
17
|
() =>
|
|
@@ -11,9 +19,7 @@ export default function WalkFormsAdapterF(pluginManager: PluginManager) {
|
|
|
11
19
|
name: 'WalkFormsAdapter',
|
|
12
20
|
displayName: 'Walk-file structural forms adapter',
|
|
13
21
|
configSchema,
|
|
14
|
-
adapterMetadata
|
|
15
|
-
category: 'Variant adapters',
|
|
16
|
-
},
|
|
22
|
+
adapterMetadata,
|
|
17
23
|
getAdapterClass: () =>
|
|
18
24
|
import('./WalkFormsAdapter.ts').then(r => r.default),
|
|
19
25
|
}),
|
|
@@ -4,6 +4,14 @@ import configSchema from './configSchema.ts'
|
|
|
4
4
|
|
|
5
5
|
import type PluginManager from '@jbrowse/core/PluginManager'
|
|
6
6
|
|
|
7
|
+
// `.idx` pairs the walk file's directory with it in a host's file selection.
|
|
8
|
+
// Held outside the call because AdapterMetadata through 5.0.0-beta.23 has no
|
|
9
|
+
// indexSuffixes, and an object literal there would not compile
|
|
10
|
+
const adapterMetadata = {
|
|
11
|
+
category: 'Synteny adapters',
|
|
12
|
+
indexSuffixes: ['.idx'],
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
export default function WalkTabixSyntenyAdapterF(pluginManager: PluginManager) {
|
|
8
16
|
pluginManager.addAdapterType(
|
|
9
17
|
() =>
|
|
@@ -21,9 +29,7 @@ export default function WalkTabixSyntenyAdapterF(pluginManager: PluginManager) {
|
|
|
21
29
|
'lanePairsOnAnchor',
|
|
22
30
|
'lanePairBatches',
|
|
23
31
|
],
|
|
24
|
-
adapterMetadata
|
|
25
|
-
category: 'Synteny adapters',
|
|
26
|
-
},
|
|
32
|
+
adapterMetadata,
|
|
27
33
|
getAdapterClass: () =>
|
|
28
34
|
import('./WalkTabixSyntenyAdapter.ts').then(r => r.default),
|
|
29
35
|
}),
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
2
|
|
|
3
3
|
import GraphTrackDefaultsF, { withLaneAnchor, withWalkReference } from './index'
|
|
4
|
+
import RgfaTabixAdapterF from '../RgfaTabixAdapter/index'
|
|
5
|
+
import WalkFormsAdapterF from '../WalkFormsAdapter/index'
|
|
6
|
+
import WalkTabixSyntenyAdapterF from '../WalkTabixSyntenyAdapter/index'
|
|
4
7
|
|
|
5
8
|
const uri = (u: string) => ({ uri: u, locationType: 'UriLocation' as const })
|
|
6
9
|
|
|
@@ -159,6 +162,23 @@ test('a walk file picked in the browser needs its directory picked too', () => {
|
|
|
159
162
|
})
|
|
160
163
|
})
|
|
161
164
|
|
|
165
|
+
test("the walk adapters declare the walk directory's `.idx` as an index suffix, so a host's selection pairs it", () => {
|
|
166
|
+
const pm = new PluginManager()
|
|
167
|
+
RgfaTabixAdapterF(pm)
|
|
168
|
+
WalkTabixSyntenyAdapterF(pm)
|
|
169
|
+
WalkFormsAdapterF(pm)
|
|
170
|
+
pm.createPluggableElements()
|
|
171
|
+
for (const name of [
|
|
172
|
+
'RgfaTabixAdapter',
|
|
173
|
+
'WalkTabixSyntenyAdapter',
|
|
174
|
+
'WalkFormsAdapter',
|
|
175
|
+
]) {
|
|
176
|
+
expect(pm.getAdapterType(name).adapterMetadata).toMatchObject({
|
|
177
|
+
indexSuffixes: ['.idx'],
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
|
|
162
182
|
test("gfa-to-tabix's bubbles file guesses a bubble feature track", () => {
|
|
163
183
|
const bubbles = uri('https://example.com/hprc.bubbles.bed.gz')
|
|
164
184
|
const { adapter, trackType } = guessers()
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '10.
|
|
1
|
+
export const version = '10.17.0'
|