jbrowse-plugin-graphgenomeviewer 6.26.1 → 6.27.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/chunks/{AddTrackWorkflow-ELAP73WV.js → AddTrackWorkflow-Q6RY23LF.js} +2 -2
- package/dist/chunks/GbzBaseSyntenyAdapter-O5OWS5EK.js +2 -0
- package/dist/chunks/GbzBaseSyntenyAdapter-O5OWS5EK.js.map +7 -0
- package/dist/chunks/{GraphGenomeView-3ZJSM36D.js → GraphGenomeView-T4YQMLAX.js} +2 -2
- package/dist/chunks/{GraphGenomeView-3ZJSM36D.js.map → GraphGenomeView-T4YQMLAX.js.map} +1 -1
- package/dist/chunks/GraphTrackSettingsDialog-EQ5W5KTL.js +6 -0
- package/dist/chunks/GraphTrackSettingsDialog-EQ5W5KTL.js.map +7 -0
- package/dist/chunks/{HighlightColorDialog-H6AGVINB.js → HighlightColorDialog-3BONNNBR.js} +2 -2
- package/dist/chunks/LinearGraphDisplay-MQ4LD2RQ.js +2 -0
- package/dist/chunks/{LinearGraphDisplay-RTMEWTK4.js.map → LinearGraphDisplay-MQ4LD2RQ.js.map} +3 -3
- package/dist/chunks/MinigraphBubbleAdapter-DPRKYY5Y.js +2 -0
- package/dist/chunks/MinigraphBubbleAdapter-DPRKYY5Y.js.map +7 -0
- package/dist/chunks/RgfaTabixAdapter-DRAJSERI.js +3 -0
- package/dist/chunks/RgfaTabixAdapter-DRAJSERI.js.map +7 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-PY4HXRFX.js +2 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-PY4HXRFX.js.map +7 -0
- package/dist/chunks/{bandage-layout-3AR6BCUD-SOXMX65M.js → bandage-layout-3AR6BCUD-OCBA5MS7.js} +1 -1
- package/dist/chunks/{bandage-layout-3AR6BCUD-SOXMX65M.js.map → bandage-layout-3AR6BCUD-OCBA5MS7.js.map} +1 -1
- package/dist/chunks/chunk-2APZWSYD.js +3 -0
- package/dist/chunks/chunk-2APZWSYD.js.map +7 -0
- package/dist/chunks/{chunk-C4ORW22P.js → chunk-56V22DVI.js} +1 -1
- package/dist/chunks/{chunk-C4ORW22P.js.map → chunk-56V22DVI.js.map} +1 -1
- package/dist/chunks/chunk-5OI6LO4I.js +2 -0
- package/dist/chunks/chunk-5OI6LO4I.js.map +7 -0
- package/dist/chunks/chunk-CH2E7TRS.js +2 -0
- package/dist/chunks/chunk-CH2E7TRS.js.map +7 -0
- package/dist/chunks/chunk-E2QPSDQL.js +2 -0
- package/dist/chunks/chunk-E2QPSDQL.js.map +7 -0
- package/dist/chunks/chunk-ECZOKJYP.js +2 -0
- package/dist/chunks/chunk-ECZOKJYP.js.map +7 -0
- package/dist/chunks/chunk-EHCF6AXH.js +2 -0
- package/dist/chunks/chunk-EHCF6AXH.js.map +7 -0
- package/dist/chunks/{chunk-6NKKRJ2C.js → chunk-G57N55FV.js} +2 -2
- package/dist/chunks/{chunk-6NKKRJ2C.js.map → chunk-G57N55FV.js.map} +1 -1
- package/dist/chunks/{chunk-5JKSYSN5.js → chunk-G73A6PEI.js} +2 -2
- package/dist/chunks/{chunk-5JKSYSN5.js.map → chunk-G73A6PEI.js.map} +1 -1
- package/dist/chunks/{chunk-VAATBXRG.js → chunk-HW4LIGPA.js} +1 -1
- package/dist/chunks/{chunk-VAATBXRG.js.map → chunk-HW4LIGPA.js.map} +1 -1
- package/dist/chunks/chunk-KJOBOE4W.js +2 -0
- package/dist/chunks/chunk-KJOBOE4W.js.map +7 -0
- package/dist/chunks/chunk-KOB7YIMR.js +2 -0
- package/dist/chunks/chunk-KOB7YIMR.js.map +7 -0
- package/dist/chunks/chunk-MVVXRZXV.js +2 -0
- package/dist/chunks/chunk-MVVXRZXV.js.map +7 -0
- package/dist/chunks/{chunk-KFP5PZRE.js → chunk-OUN4BNWJ.js} +1 -1
- package/dist/chunks/{chunk-KFP5PZRE.js.map → chunk-OUN4BNWJ.js.map} +1 -1
- package/dist/chunks/{chunk-3GI2K2L7.js → chunk-Q5PP7UMC.js} +3 -3
- package/dist/chunks/{chunk-3GI2K2L7.js.map → chunk-Q5PP7UMC.js.map} +1 -1
- package/dist/chunks/chunk-RKOQVSZG.js +4 -0
- package/dist/chunks/{chunk-LCODIX3W.js.map → chunk-RKOQVSZG.js.map} +3 -3
- package/dist/chunks/chunk-STTY74OG.js +4 -0
- package/dist/chunks/chunk-STTY74OG.js.map +7 -0
- package/dist/chunks/{chunk-EHGTBGBO.js → chunk-TOT4S3TG.js} +1 -1
- package/dist/chunks/{chunk-EHGTBGBO.js.map → chunk-TOT4S3TG.js.map} +1 -1
- package/dist/chunks/chunk-U6CKN6LS.js +2 -0
- package/dist/chunks/chunk-U6CKN6LS.js.map +7 -0
- package/dist/chunks/chunk-V4YHDVV3.js +2 -0
- package/dist/chunks/chunk-V4YHDVV3.js.map +7 -0
- package/dist/chunks/{chunk-GTESIJZQ.js → chunk-XJDTSPBL.js} +2 -2
- package/dist/chunks/{chunk-GTESIJZQ.js.map → chunk-XJDTSPBL.js.map} +1 -1
- package/dist/chunks/chunk-Z4B6RZGP.js +2 -0
- package/dist/chunks/{chunk-BQQTY3GZ.js.map → chunk-Z4B6RZGP.js.map} +3 -3
- package/dist/chunks/chunk-ZWMYT35X.js +2 -0
- package/dist/chunks/chunk-ZWMYT35X.js.map +7 -0
- package/dist/chunks/renderSvg-QLUKGVIN.js +2 -0
- package/dist/chunks/renderSvg-QLUKGVIN.js.map +7 -0
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +4 -4
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
- package/package.json +6 -9
- package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.test.ts +35 -35
- package/src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.ts +24 -36
- package/src/GbzBaseSyntenyAdapter/companion.test.ts +8 -4
- package/src/GbzBaseSyntenyAdapter/configSchema.ts +2 -17
- package/src/GetGraphReads.ts +3 -11
- package/src/GetSubgraph.test.ts +30 -48
- package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +6 -3
- package/src/GraphAddTrackWorkflow/graphManifest.ts +9 -5
- package/src/GraphGenomeView/components/FacetPanels.tsx +24 -1
- package/src/GraphGenomeView/components/GraphCanvas.tsx +18 -12
- package/src/GraphGenomeView/components/GraphSettingsDialog.test.tsx +36 -0
- package/src/GraphGenomeView/components/GraphSettingsDialog.tsx +12 -10
- package/src/GraphGenomeView/components/LabelChip.tsx +28 -6
- package/src/GraphGenomeView/components/LabelLayer.tsx +28 -4
- package/src/GraphGenomeView/components/PaneSvg.tsx +11 -0
- package/src/GraphGenomeView/components/ReferenceStripOverlay.tsx +1 -1
- package/src/GraphGenomeView/components/WalkRowsOverlay.tsx +68 -77
- package/src/GraphGenomeView/components/WalkStrip.test.tsx +44 -0
- package/src/GraphGenomeView/components/WalkStrip.tsx +47 -40
- package/src/GraphGenomeView/components/usePaneGestures.test.tsx +78 -0
- package/src/GraphGenomeView/components/usePaneGestures.ts +16 -2
- package/src/GraphGenomeView/genes/geneFeatures.ts +12 -5
- package/src/GraphGenomeView/genes/genes.test.ts +14 -0
- package/src/GraphGenomeView/index.ts +2 -19
- package/src/GraphGenomeView/legendSections.ts +17 -6
- package/src/GraphGenomeView/model.test.ts +132 -25
- package/src/GraphGenomeView/pane/fitViews.ts +16 -13
- package/src/GraphGenomeView/pane/graphViews.ts +7 -12
- package/src/GraphGenomeView/pane/hostViews.ts +14 -15
- package/src/GraphGenomeView/pane/launchActions.ts +2 -3
- package/src/GraphGenomeView/pane/launchViews.ts +23 -22
- package/src/GraphGenomeView/pane/loadActions.ts +93 -76
- package/src/GraphGenomeView/pane/paneBase.ts +3 -2
- package/src/GraphGenomeView/pane/renderingActions.ts +9 -5
- package/src/GraphGenomeView/pane/settingActions.ts +22 -15
- package/src/GraphGenomeView/renderPipeline.test.ts +5 -1
- package/src/GraphGenomeView/repeats/repeatFeatures.ts +1 -1
- package/src/GraphGenomeView/subgraphLoad.test.ts +34 -5
- package/src/LaunchGraphGenomeView.ts +2 -18
- package/src/LinearGraphDisplay/LinearGraphDisplay.test.ts +90 -14
- package/src/LinearGraphDisplay/components/GraphStatusChrome.test.tsx +5 -0
- package/src/LinearGraphDisplay/components/GraphStatusChrome.tsx +9 -11
- package/src/LinearGraphDisplay/components/SubgraphContextSelect.test.tsx +27 -0
- package/src/LinearGraphDisplay/components/SubgraphContextSelect.tsx +6 -2
- package/src/LinearGraphDisplay/components/SubgraphHaplotypesField.test.tsx +1 -1
- package/src/LinearGraphDisplay/components/SubgraphHaplotypesField.tsx +5 -5
- package/src/LinearGraphDisplay/model.ts +17 -11
- package/src/MinigraphBubbleAdapter/MinigraphBubbleAdapter.test.ts +18 -0
- package/src/MinigraphBubbleAdapter/MinigraphBubbleAdapter.ts +2 -1
- package/src/MinigraphBubbleAdapter/configSchema.ts +7 -25
- package/src/RgfaTabixAdapter/RgfaTabixAdapter.test.ts +37 -18
- package/src/RgfaTabixAdapter/RgfaTabixAdapter.ts +73 -44
- package/src/RgfaTabixAdapter/bubbleTier.test.ts +19 -4
- package/src/RgfaTabixAdapter/configSchema.ts +16 -39
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_follow.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_header.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_maxnode.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.links.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.links.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.nodes.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.nodes.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks1_rejoin.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_follow.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_follow.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_header.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_header.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_maxnode.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_maxnode.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_rejoin.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks2_rejoin.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/walkFiles.test.ts +38 -3
- package/src/RgfaTabixAdapter/walkFormat2.test.ts +186 -0
- package/src/RgfaTabixAdapter/walkFormat2.ts +682 -0
- package/src/RgfaTabixAdapter/walkReader.ts +120 -32
- package/src/RgfaTabixAdapter/walkRows.test.ts +8 -5
- package/src/RgfaTabixAdapter/walkRows.ts +67 -20
- package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +16 -30
- package/src/WalkTabixSyntenyAdapter/configSchema.ts +8 -33
- package/src/graphTrackConfig.ts +3 -3
- package/src/launchFromGraph/contributors.test.ts +9 -3
- package/src/launchFromGraph/launchFromGraph.test.ts +2 -0
- package/src/launchFromGraph/launchFromGraph.ts +21 -16
- package/src/launchFromGraph/launchTracks.ts +4 -11
- package/src/launchFromGraph/syntenyTracks.ts +4 -11
- package/src/locationName.ts +21 -0
- package/src/panSNAliases/panSNAliases.test.ts +93 -88
- package/src/panSNAliases/trackAdapterConfig.ts +8 -2
- package/src/panSNTabix.ts +32 -0
- package/src/synteny/ComparativeAdapterBase.ts +4 -3
- package/src/synteny/lanePairs.ts +15 -0
- package/src/{RgfaTabixAdapter/tabixRange.ts → tabixRange.ts} +4 -1
- package/src/version.ts +1 -1
- package/dist/chunks/GbzBaseSyntenyAdapter-KTZMVVMW.js +0 -2
- package/dist/chunks/GbzBaseSyntenyAdapter-KTZMVVMW.js.map +0 -7
- package/dist/chunks/GraphTrackSettingsDialog-JHKKV2S4.js +0 -6
- package/dist/chunks/GraphTrackSettingsDialog-JHKKV2S4.js.map +0 -7
- package/dist/chunks/LinearGraphDisplay-RTMEWTK4.js +0 -2
- package/dist/chunks/MinigraphBubbleAdapter-FKDOLLD3.js +0 -2
- package/dist/chunks/MinigraphBubbleAdapter-FKDOLLD3.js.map +0 -7
- package/dist/chunks/RgfaTabixAdapter-SMDO5VX7.js +0 -3
- package/dist/chunks/RgfaTabixAdapter-SMDO5VX7.js.map +0 -7
- package/dist/chunks/WalkTabixSyntenyAdapter-L2E7QSX2.js +0 -2
- package/dist/chunks/WalkTabixSyntenyAdapter-L2E7QSX2.js.map +0 -7
- package/dist/chunks/chunk-2I4VPDLZ.js +0 -2
- package/dist/chunks/chunk-2I4VPDLZ.js.map +0 -7
- package/dist/chunks/chunk-4II37RC7.js +0 -2
- package/dist/chunks/chunk-4II37RC7.js.map +0 -7
- package/dist/chunks/chunk-AHEG3FOH.js +0 -2
- package/dist/chunks/chunk-AHEG3FOH.js.map +0 -7
- package/dist/chunks/chunk-BQQTY3GZ.js +0 -2
- package/dist/chunks/chunk-EAZJJZAY.js +0 -2
- package/dist/chunks/chunk-EAZJJZAY.js.map +0 -7
- package/dist/chunks/chunk-HHADQLAY.js +0 -2
- package/dist/chunks/chunk-HHADQLAY.js.map +0 -7
- package/dist/chunks/chunk-LCODIX3W.js +0 -4
- package/dist/chunks/chunk-N6PJ3YND.js +0 -3
- package/dist/chunks/chunk-N6PJ3YND.js.map +0 -7
- package/dist/chunks/chunk-OTU3GXFO.js +0 -2
- package/dist/chunks/chunk-OTU3GXFO.js.map +0 -7
- package/dist/chunks/chunk-R3TRNF7N.js +0 -2
- package/dist/chunks/chunk-R3TRNF7N.js.map +0 -7
- package/dist/chunks/chunk-TH3R5SGF.js +0 -2
- package/dist/chunks/chunk-TH3R5SGF.js.map +0 -7
- package/dist/chunks/chunk-Z35N4ZAV.js +0 -4
- package/dist/chunks/chunk-Z35N4ZAV.js.map +0 -7
- package/dist/chunks/renderSvg-MS35CDL4.js +0 -2
- package/dist/chunks/renderSvg-MS35CDL4.js.map +0 -7
- /package/dist/chunks/{AddTrackWorkflow-ELAP73WV.js.map → AddTrackWorkflow-Q6RY23LF.js.map} +0 -0
- /package/dist/chunks/{HighlightColorDialog-H6AGVINB.js.map → HighlightColorDialog-3BONNNBR.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as H,b as j,c as O,d as z,g as J}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=AddTrackWorkflow-
|
|
1
|
+
import{a as H,b as j,c as O,d as z,g as J}from"./chunk-EHCF6AXH.js";import"./chunk-5OI6LO4I.js";import"./chunk-7WIBGKBU.js";import"./chunk-OGQ6OQDN.js";import{d as w,e as R}from"./chunk-NDRLCGPC.js";import{b as T,h as G,j as S,m as A}from"./chunk-TENPGIPX.js";import{g as r}from"./chunk-6OPB7FOJ.js";import{A as N,B as _,C as W,F as b,a as v,e as x,f as p,o as E,s as B,t as I,u as P}from"./chunk-E3WYW7Z6.js";import{b as t,c as g,d as M}from"./chunk-JMBDTNUR.js";var s=JBrowseExports["@jbrowse/core/util/tss-react"],$=o=>s!=null&&o in Object(s)?s[o]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+o+"' from '@jbrowse/core/util/tss-react' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:o});var D=$("makeStyles"),oe=s&&s.__esModule?s.default:s;var ee=D()(o=>({paper:{margin:o.spacing(),padding:o.spacing()},field:{marginTop:o.spacing(2)},submit:{marginTop:25,marginBottom:100,display:"block"}})),te=["RgfaTabixAdapter","GbzBaseSyntenyAdapter","MinigraphBubbleAdapter"],ae=M(function({model:a}){let{classes:l}=ee(),f=S(a),d=w(a),[n,V]=r("RgfaTabixAdapter"),[i,X]=r(),[y,q]=r(),[k,K]=r(),m=n==="GbzBaseSyntenyAdapter",[C,Q]=r(""),[h,U]=r("Pangenome graph"),[F,u]=r(),[Y,L]=r(!1);async function Z(){if(!i||!a.assembly)return;u(void 0),L(!0);let e=n==="RgfaTabixAdapter"?await H(i,G(a).pluginManager):void 0;if(L(!1),!(!R(a)||!a.assembly))try{let c=h.trim();T({model:a,session:f,conf:J({choice:n,loc:i,indexLoc:y,readsLoc:m?k:void 0,manifest:e,assembly:a.assembly,sample:C,trackId:A({name:c}),name:c})})}catch(c){u(c)}}return g(N,{className:l.paper,children:[F?t(x,{error:F}):null,g(B,{children:[t(P,{children:"File type"}),t(W,{value:n,onChange:e=>{V(e.target.value),u(void 0)},children:te.map(e=>t(I,{value:e,control:t(_,{}),label:j[e]},e))})]}),t(p,{location:i,name:O[n],rootModel:d,setLocation:X}),t(p,{location:y,name:z[n],rootModel:d,setLocation:q}),m?t(p,{location:k,name:"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)",rootModel:d,setLocation:K}):null,t(b,{className:l.field,value:C,onChange:e=>{Q(e.target.value)},label:"Sample name in the graph",slotProps:{htmlInput:{"data-testid":"graph-sample-input"}},helperText:m?"Optional. The graph's sample for this assembly, e.g. GRCh38 where the assembly is hg38; leave blank when they share a name or the graph has one reference sample":"Optional. The PanSN prefix the graph gives this assembly, e.g. GRCh38 for HPRC's GRCh38#0#chr1; leave blank when the graph's stable names are bare",placeholder:"GRCh38",fullWidth:!0}),t(b,{className:l.field,value:h,helperText:"Track name",slotProps:{htmlInput:{"data-testid":"graph-track-name-input"}},onChange:e=>{U(e.target.value)}}),t(v,{session:f,helperText:"Select assembly to add track to",selected:a.assembly,onChange:e=>{a.setAssembly(e)},fullWidth:!0}),t(E,{variant:"contained",className:l.submit,disabled:!i||!h.trim()||!a.assembly||Y,onClick:()=>{Z()},children:"Submit"})]})}),ue=ae;export{ue as default};
|
|
2
|
+
//# sourceMappingURL=AddTrackWorkflow-Q6RY23LF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as q,b as re,c as de,d as oe,e as T}from"./chunk-RKOQVSZG.js";import{a as ne}from"./chunk-KOB7YIMR.js";import{a as O,b as H}from"./chunk-56V22DVI.js";import{c as Z,d as U,e as X,f as g,g as C,h as M,i as k,j as E,k as z,m as Y}from"./chunk-Q5PP7UMC.js";import{h as ae}from"./chunk-G57N55FV.js";import"./chunk-HW4LIGPA.js";import{a as ee,c as L,f as te}from"./chunk-ECZOKJYP.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import{e as A,f as P,g as B}from"./chunk-OUN4BNWJ.js";import"./chunk-E7J6SB5P.js";import{b as G,e as J,f as K,g as V}from"./chunk-5OI6LO4I.js";import"./chunk-7WIBGKBU.js";import{a as N}from"./chunk-OGQ6OQDN.js";import"./chunk-NDRLCGPC.js";import{e as W,o as $}from"./chunk-TENPGIPX.js";function F(n){let i=/\.gbz\.db$/i;return i.test(n)?n.replace(i,".haplotype-index.db"):void 0}function fe(n){return K(n)&&F(J(n))?V(n,i=>F(i)):void 0}function he(n){return n instanceof Error&&(/\bHTTP 40[34]\b/.test(n.message)||n.code==="ENOENT")}async function se(n,i){let t=fe(n);if(!t)return{};try{return await N(t,i).stat(),{location:t}}catch(e){return he(e)?{}:{unreadable:String(e)}}}var ge=5e3,ue=50*2**20,_=class extends Error{constructor(t){super(`this GAF is ${(t/2**20).toFixed(0)} MB without an index; bgzip it and index it with tabix -p gaf`);this.name="UnindexedGafTooLargeError"}};function ye(n,i){if(n.length<=i)return n;let t=n.length/i;return Array.from({length:i},(e,a)=>n[Math.floor(a*t)])}var ie=(n,i)=>n.path.some(t=>i.has(t.name)),v=class{constructor(i,t){this.file=i;this.tabix=t;this.whole=L({setup:async({signal:i})=>{let{size:t}=await this.file.stat();if(t>ue)throw new _(t);let e=await this.file.readFile({signal:i}),a=new TextDecoder().decode(e[0]===31&&e[1]===139?await ee(e):e);return H(a)}})}async readIndexed(i,t,e){let a=1/0,r=-1/0;for(let c of t){let s=Number(c);Number.isInteger(s)&&(a=Math.min(a,s),r=Math.max(r,s))}let o=[];return a<=r&&await i.getLines("{node}",a,r+1,{signal:e,lineCallback:c=>{let s=O(c);s&&ie(s,t)&&o.push(s)}}),o}async readsOver(i,{signal:t}={}){let e=this.tabix?await this.readIndexed(this.tabix,i,t):(await this.whole({signal:t})).filter(a=>ie(a,i));return{records:ye(e,ge),total:e.length}}};var I=class extends Error{constructor(t){super(t===void 0?"no haplotype index is set, so the walks cannot be named; build one with gbz-haplotype-index (cargo install gbz-haplotype-index) and set it as haplotypeIndexLocation":`the haplotype index beside the graph database could not be checked (${t}), so the walks cannot be named; if it is there, reload to try again, or set haplotypeIndexLocation`);this.name="NoHaplotypeIndexError"}},D=class extends Error{constructor(t,e){super(`the graph is cut on its reference, ${e}; a window on ${t} has no reference coordinates to cut at. Open the graph from a ${e} view, and find this haplotype's lane there`);this.name="HaplotypeWindowError"}};function be(n,i){return`${g(n)}#${n.contig}@${i.start.node}.${i.start.offset}`}function we({alignment:n,assemblyName:i,refName:t,lane:e}){let{refStart:a,refEnd:r,strand:o,cigar:c}=n;if(!(r<=a)){let{name:s,hapStart:p,hapEnd:l}=n,f=be(s,n),u={uniqueId:f,assemblyName:i,refName:t,start:a,end:r,type:"match",strand:o==="-"?-1:1,CIGAR:c,syntenyId:f,mate:{refName:s.contig,start:p,end:l,assemblyName:e}};return new q(u)}}function xe({pair:n,lane:i,mateLane:t}){let e=`${g(n.target)}#${n.target.contig}:${n.targetStart}-${n.targetEnd}|${g(n.query)}#${n.query.contig}:${n.queryStart}-${n.queryEnd}`;return new q({uniqueId:e,assemblyName:i,refName:n.target.contig,start:n.targetStart,end:n.targetEnd,type:"match",strand:n.strand==="-"?-1:1,CIGAR:n.cigar,syntenyId:e,identity:n.matches/Math.max(n.columns,1),numMatches:n.matches,blockLen:n.columns,mate:{refName:n.query.contig,start:n.queryStart,end:n.queryEnd,assemblyName:t}})}var Se=12e4;function Pe(n,i){let t=new Map;for(let a of n)for(let{name:r,start:o,end:c}of a.walkSpans()){let s=g(r);if(i.has(s)){let p=`${s}#${r.contig}`,l=t.get(p);l?l.push([o,c]):t.set(p,[[o,c]])}}let e=0;for(let a of t.values()){a.sort((r,o)=>r[0]-o[0]);for(let r=1;r<a.length;r++){let o=a[r][0]-a[r-1][1];o>0&&o<=Se&&(e=Math.max(e,o))}}return e}function Q(n,i){return n instanceof X&&(n.message=`Zoom in to about ${W(n.fitsBp)} to see ${i}`),n}var ce=n=>({...n,start:Math.floor(n.start),end:Math.ceil(n.end)}),j=class extends re{constructor(){super(...arguments);this.graph=L({label:"Opening pangenome database",setup:async()=>{let t=this.getConf("gbzDbLocation"),e=this.getConf("haplotypeIndexLocation"),a=G(e)?{location:e}:await se(t,this.pluginManager),r=a.location,o=await U.open({source:N(t,this.pluginManager),haplotypeIndex:r?N(r,this.pluginManager):void 0}),c=this.getConf("assemblyNames")[0];if(c===void 0)throw new Error("GbzBaseSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as");let s=await M(o),p=k({configured:this.getConf("referenceSample"),anchorPrefix:P(this,c),referenceSamples:s});return{db:o,anchor:c,referenceSample:p,referenceSamples:s,unreadableIndex:a.unreadable}}});this.gaf=L({label:"Opening reads",setup:async()=>{let t=this.getConf("readsLocation"),e=this.getConf(["readsIndex","location"]);return G(t)?new v(N(t,this.pluginManager),G(e)?te(this,["readsLocation"],["readsIndex"]):void 0):void 0}})}async referenceQuery(t,e){let{db:a,referenceSample:r}=await this.graph(e);return E(a,r,t)}async getHaplotypes(t={}){let{db:e,referenceSamples:a}=await this.graph(t),r=new Map;for(let o of await e.paths()){let c=g(o.name),s=r.get(c);s?s.contigs.includes(o.name.contig)||s.contigs.push(o.name.contig):r.set(c,{prefix:c,sample:o.name.sample,haplotype:o.name.haplotype,contigs:[o.name.contig],isReference:a.includes(o.name.sample)})}return[...r.values()]}async getHeader(t={}){let{anchor:e,referenceSample:a,referenceSamples:r}=await this.graph(t),o=B(this),c=[];for(let s of await this.getHaplotypes(t))s.sample!==a&&c.push({name:T(o,s.prefix),label:s.prefix,group:s.sample});return{hasCoarseTier:!1,anchorAssemblyName:e,referenceSample:a,referenceSamples:r,lanes:c}}async getRefNames(t={}){let{db:e,anchor:a,referenceSample:r}=await this.graph(t),{assemblyName:o}=t,c=o===a?void 0:P(this,o),s=(await e.paths()).filter(p=>o===a?p.isIndexed&&p.name.sample===r:A(g(p.name),c)).map(p=>p.name.contig);return[...new Set(s)]}keepPredicate(t,e){let a=t===void 0||t.length===0?void 0:t.map(r=>P(this,r));return a===void 0&&e===void 0?void 0:r=>C(r,a)&&(e===void 0||A(g(r),e))}async getSubgraph(t,e={}){let{signal:a}=e,{db:r,anchor:o,referenceSample:c,unreadableIndex:s}=await this.graph({signal:a}),{assemblyName:p,refName:l,start:f,end:u}=ce(t);if(p!==o)throw new D(p,o);let y=await this.referenceQuery(l,{signal:a});if(!y)throw new Error(`${c} has no indexed path ${l} in this graph`);let x=this.keepPredicate(e.haplotypes);if(x!==void 0&&!r.hasHaplotypeIndex)throw new I(s);let m=await Y(r,y,f,u,{context:this.getConf("context"),snarls:e.snarls??this.getConf("subgraphSnarls"),limit:this.getConf("nodeLimit"),signal:e.signal,keep:x}).catch(b=>{throw Q(b,"the graph")});return typeof m=="string"?m:ae(m,{start:f,end:u},e.walkRows)}async getReads(t,e={}){let a=await this.gaf(e);return a?a.readsOver(new Set(t),e):{records:[],total:0}}async laneHaplotypes(t,e){let a=P(this,t);return(await this.getHaplotypes(e)).filter(r=>A(r.prefix,a))}async anchorFeatures(t,e){let{db:a}=await this.graph(e),{assemblyName:r,refName:o,start:c,end:s}=t,p=P(this,e.targetAssemblyName),l=B(this),f=this.keepPredicate(e.haplotypes,p),u=await this.referenceQuery(o,e),y=this.getConf("nodeLimit");return(u?await $(`Reading graph ${o}:${c.toLocaleString()}-${s.toLocaleString()}`,e.statusCallback,()=>a.getAlignments({path:u,start:c,end:s,context:this.getConf("context"),haplotypes:"all",limit:y,signal:e.signal,keep:f}).catch(m=>{throw Q(z(m,y,s-c)??m,"lanes")})):[]).flatMap(m=>{let b=m.resolved?we({alignment:m,assemblyName:r,refName:o,lane:T(l,g(m.name))}):void 0;return b===void 0?[]:[b]})}async pairFeatures(t,e,a){let{db:r}=await this.graph(a),{refName:o,start:c,end:s}=t,l=(await Promise.all(e.map(async d=>({pair:d,featureSide:await this.laneHaplotypes(d.queryAssemblyName,a),mateSide:await this.laneHaplotypes(d.targetAssemblyName,a)})))).filter(({featureSide:d,mateSide:h})=>d.length>0&&h.length>0),f=new Set(l.flatMap(({featureSide:d,mateSide:h})=>[...d,...h].map(g))),u=await this.referenceQuery(o,a),y=this.getConf("nodeLimit"),x=this.getConf("context"),[m]=e,b=(d,h)=>r.getSubgraphs({path:d,start:c,end:s,context:h,snarls:this.getConf("subgraphSnarls"),haplotypes:"all",limit:y,signal:a.signal,keep:S=>f.has(g(S))}),pe=async d=>{let h=await b(d,x).catch(w=>{throw Q(z(w,y,s-c)??w,"lanes")}),S=Pe(h,f),R=Math.ceil(S/2)+2e3;return S>0&&R>x?b(d,R).catch(w=>{if(w instanceof Z)return h;throw w}):h};return(u&&m&&l.length>0?await $(e.length===1?`Reading ${m.queryAssemblyName} against ${m.targetAssemblyName}`:`Reading ${e.length} lane pairs`,a.statusCallback,()=>pe(u)):[]).flatMap(d=>l.flatMap(({pair:h,featureSide:S,mateSide:R})=>S.flatMap(w=>R.flatMap(le=>d.pairAlignments({target:w,query:le,bases:!1}).map(me=>xe({pair:me,lane:h.queryAssemblyName,mateLane:h.targetAssemblyName}))))))}getFeatures(t,e={}){let a=ce(t);return ne(async r=>{let{db:o,anchor:c,unreadableIndex:s}=await this.graph(e);if(!o.hasHaplotypeIndex)throw new I(s);if(a.assemblyName===c){let p=oe(e),l=p.length>0?await this.pairFeatures(a,p,e):await this.anchorFeatures(a,e);for(let f of l)r.next(f)}r.complete()},e.signal)}};export{D as HaplotypeWindowError,I as NoHaplotypeIndexError,de as PairTargetError,j as default,we as fragmentFeature,xe as pairFeature,Pe as widestWalkGap};
|
|
2
|
+
//# sourceMappingURL=GbzBaseSyntenyAdapter-O5OWS5EK.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@10.2.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-FLFBYSJO.js", "../../src/GbzBaseSyntenyAdapter/companion.ts", "../../src/gaf/gafFile.ts", "../../src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n GBZ_CUT_DEFAULTS,\n cutWindowGFA,\n haplotypeWanted,\n referencePathQuery,\n referenceSamplesOf,\n resolveReferenceSample\n} from \"./chunk-Q7LYHGGQ.js\";\n\n// src/gbzCut.ts\nimport { GBZBase } from \"@gmod/gbz-base\";\nvar HPRC_GBZ = {\n db: \"https://s3-us-west-2.amazonaws.com/human-pangenomics/pangenomes/freeze/release2/minigraph-cactus/v2.1/hprc-v2.1-mc-grch38/hprc-v2.1-mc-grch38.gbz.db\",\n index: \"https://jbrowse.org/demos/hprc/hprc-v2.1-mc-grch38.haplotype-index.f3.db\"\n};\nfunction haplotypeIndexBeside(db) {\n const GBZ_DB = /\\.gbz\\.db$/i;\n return GBZ_DB.test(db) ? db.replace(GBZ_DB, \".haplotype-index.db\") : void 0;\n}\nfunction parseRegion(text) {\n const m = /^\\s*([^:\\s]+):([\\d,]+)-([\\d,]+)\\s*$/.exec(text);\n if (!m) {\n throw new Error(\n `\"${text}\" is not a region like chr6:160,614,798-160,647,758`\n );\n }\n const n = (s) => Number(s.replaceAll(\",\", \"\"));\n return { refName: m[1], start: n(m[2]), end: n(m[3]) };\n}\nasync function openGbz(db, index) {\n const base = await GBZBase.open({ source: db, haplotypeIndex: index });\n return { base, referenceSamples: await referenceSamplesOf(base) };\n}\nfunction referenceSample(ref, samples) {\n try {\n return resolveReferenceSample({\n configured: \"\",\n anchorPrefix: ref ?? samples[0] ?? \"\",\n referenceSamples: samples\n });\n } catch (e) {\n if (ref) {\n return ref;\n }\n throw e;\n }\n}\nasync function cutGbzRegion({ base, referenceSamples }, src, signal) {\n const region = parseRegion(src.region);\n const sample = referenceSample(src.referenceSample, referenceSamples);\n const query = await referencePathQuery(base, sample, region.refName);\n if (!query) {\n throw new Error(`${sample} has no indexed path named ${region.refName}`);\n }\n signal?.throwIfAborted();\n const wanted = src.haplotypes?.length ? src.haplotypes : void 0;\n const text = await cutWindowGFA(base, query, region.start, region.end, {\n context: src.context ?? GBZ_CUT_DEFAULTS.context,\n snarls: src.snarls ?? GBZ_CUT_DEFAULTS.snarls,\n limit: GBZ_CUT_DEFAULTS.limit,\n signal,\n keep: wanted ? (name) => haplotypeWanted(name, wanted) : void 0\n });\n return { text, region, sample };\n}\n\nexport {\n HPRC_GBZ,\n haplotypeIndexBeside,\n parseRegion,\n openGbz,\n cutGbzRegion\n};\n", "import { haplotypeIndexBeside } from '@jbrowse/bandage-core/gbzCut'\nimport { openLocation } from '@jbrowse/core/util/io'\n\nimport { locationName, readsSiblings, renamed } from '../locationName'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { FileLocation } from '@jbrowse/core/util/types'\n\nexport function siblingCompanion(gbzDb: FileLocation) {\n return readsSiblings(gbzDb) && haplotypeIndexBeside(locationName(gbzDb))\n ? renamed(gbzDb, name => haplotypeIndexBeside(name)!)\n : undefined\n}\n\n// 404 is a missing file, and so is 403 from a bucket that does not let a\n// reader list it; anything else leaves the file's presence unknown\nfunction isMissing(error: unknown) {\n return (\n error instanceof Error &&\n (/\\bHTTP 40[34]\\b/.test(error.message) ||\n (error as { code?: unknown }).code === 'ENOENT')\n )\n}\n\n// `unreadable` is why a companion that may be there could not be checked, such\n// as a network error, or a server that answers a missing file without CORS\nexport async function findCompanion(\n gbzDb: FileLocation,\n pluginManager?: PluginManager,\n): Promise<{ location?: FileLocation; unreadable?: string }> {\n const candidate = siblingCompanion(gbzDb)\n if (!candidate) {\n return {}\n }\n try {\n await openLocation(candidate, pluginManager).stat()\n return { location: candidate }\n } catch (error) {\n return isMissing(error) ? {} : { unreadable: String(error) }\n }\n}\n", "import { unzip } from '@gmod/bgzf-filehandle'\nimport { parseGaf, parseGafLine } from '@jbrowse/bandage-core/gaf/parseGaf'\nimport { cachedSetup } from '@jbrowse/core/data_adapters/BaseAdapter'\n\nimport type { TabixIndexedFile } from '@gmod/tabix'\nimport type { GafRecord } from '@jbrowse/bandage-core/gaf/parseGaf'\n\ninterface WholeFile {\n stat(): Promise<{ size: number }>\n readFile(opts?: { signal?: AbortSignal }): Promise<Uint8Array>\n}\n\nexport interface GafReads {\n records: GafRecord[]\n // reads over the nodes before sampling\n total: number\n}\n\n// The tube map lays reads out on the main thread at about 40 ms per thousand\nexport const MAX_READS = 5000\n\n// An unindexed GAF is read whole, once, into the worker\nconst MAX_UNINDEXED_BYTES = 50 * 2 ** 20\n\nexport class UnindexedGafTooLargeError extends Error {\n override name = 'UnindexedGafTooLargeError'\n\n constructor(size: number) {\n super(\n `this GAF is ${(size / 2 ** 20).toFixed(0)} MB without an index; bgzip it and index it with tabix -p gaf`,\n )\n }\n}\n\n// Evenly spaced, so a pileup thins out rather than losing its right half\nfunction sample(records: GafRecord[], max: number) {\n if (records.length <= max) {\n return records\n }\n const stride = records.length / max\n return Array.from({ length: max }, (_, k) => records[Math.floor(k * stride)]!)\n}\n\nconst touches = (record: GafRecord, names: ReadonlySet<string>) =>\n record.path.some(step => names.has(step.name))\n\n// A GAF over a graph's segments: bgzipped and indexed with `tabix -p gaf`,\n// which keys each line by its lowest and highest node id and so needs numeric\n// segment names, or plain or gzipped and read whole.\nexport class GafFile {\n // Shared by every window, so the signal is cachedSetup's own, which aborts\n // once no caller is left waiting\n private whole = cachedSetup({\n setup: async ({ signal }) => {\n const { size } = await this.file.stat()\n if (size > MAX_UNINDEXED_BYTES) {\n throw new UnindexedGafTooLargeError(size)\n }\n const bytes = await this.file.readFile({ signal })\n const text = new TextDecoder().decode(\n bytes[0] === 0x1f && bytes[1] === 0x8b ? await unzip(bytes) : bytes,\n )\n return parseGaf(text)\n },\n })\n\n constructor(\n private file: WholeFile,\n private tabix?: TabixIndexedFile,\n ) {}\n\n private async readIndexed(\n tabix: TabixIndexedFile,\n names: ReadonlySet<string>,\n signal?: AbortSignal,\n ) {\n let lo = Infinity\n let hi = -Infinity\n for (const name of names) {\n const id = Number(name)\n if (Number.isInteger(id)) {\n lo = Math.min(lo, id)\n hi = Math.max(hi, id)\n }\n }\n const records: GafRecord[] = []\n if (lo <= hi) {\n // a GAF index ignores the refName, and getLines keeps a read whose node\n // ids span min..max when min < end && max >= start, hence hi + 1\n await tabix.getLines('{node}', lo, hi + 1, {\n signal,\n lineCallback: line => {\n const record = parseGafLine(line)\n if (record && touches(record, names)) {\n records.push(record)\n }\n },\n })\n }\n return records\n }\n\n async readsOver(\n names: ReadonlySet<string>,\n { signal }: { signal?: AbortSignal } = {},\n ): Promise<GafReads> {\n const records = this.tabix\n ? await this.readIndexed(this.tabix, names, signal)\n : (await this.whole({ signal })).filter(r => touches(r, names))\n return { records: sample(records, MAX_READS), total: records.length }\n }\n}\n", "import { GBZBase, SubgraphLimitError } from '@gmod/gbz-base'\nimport {\n NodeLimitError,\n cutWindowTables,\n haplotypePrefix,\n haplotypeWanted,\n nodeLimitError,\n referencePathQuery,\n referenceSamplesOf,\n resolveReferenceSample,\n} from '@jbrowse/bandage-core/gbzWindow'\nimport {\n assemblyByPanSNPrefix,\n panSNMatchesPrefix,\n resolvePanSNPrefix,\n} from '@jbrowse/bandage-core/pansn'\nimport { cachedSetup } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { getBpDisplayStr, updateStatus } from '@jbrowse/core/util'\nimport { openLocation } from '@jbrowse/core/util/io'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\n\nimport { findCompanion } from './companion.ts'\nimport { walkCutFor } from '../RgfaTabixAdapter/walkRowRuns.ts'\nimport { GafFile } from '../gaf/gafFile.ts'\nimport { locationIsSet } from '../locationName.ts'\nimport { openTabixSlot } from '../panSNTabix.ts'\nimport { ComparativeAdapterBase } from '../synteny/ComparativeAdapterBase.ts'\nimport SyntenyFeature from '../synteny/SyntenyFeature.ts'\nimport { laneAssemblyName, requestedPairs } from '../synteny/lanePairs.ts'\n\nimport type { GbzBaseSyntenyAdapterConfig } from './configSchema.ts'\nimport type { SubgraphAdapterOptions } from '../GetSubgraph.ts'\nimport type { GafReads } from '../gaf/gafFile.ts'\nimport type { LaneFeatureOptions, LanePair } from '../synteny/lanePairs.ts'\nimport type {\n HaplotypeAlignment,\n HaplotypeRef,\n PairAlignment,\n PathName,\n PathQuery,\n Subgraph,\n} from '@gmod/gbz-base'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport type { Feature, SimpleFeatureSerialized } from '@jbrowse/core/util'\nimport type { FileLocation, Region } from '@jbrowse/core/util/types'\n\nexport class NoHaplotypeIndexError extends Error {\n override name = 'NoHaplotypeIndexError'\n\n constructor(unreadable?: string) {\n super(\n unreadable === undefined\n ? 'no haplotype index is set, so the walks cannot be named; build one with gbz-haplotype-index (cargo install gbz-haplotype-index) and set it as haplotypeIndexLocation'\n : `the haplotype index beside the graph database could not be checked (${unreadable}), so the walks cannot be named; if it is there, reload to try again, or set haplotypeIndexLocation`,\n )\n }\n}\n\nexport interface GbzHaplotype {\n prefix: string\n sample: string\n haplotype: number\n contigs: string[]\n isReference: boolean\n}\n\n/**\n * One lane the header declares, in the shape MultiWaySyntenyDisplay's lane\n * picker reads: `name` is the lane's assembly name, the same string the\n * fetched features' mates carry, `label` its PanSN prefix and `group` its\n * sample, so a diploid sample's two lanes sit together\n */\ninterface GbzHeaderLane {\n name: string\n label: string\n group: string\n}\n\nexport { PairTargetError } from '../synteny/lanePairs.ts'\nexport type { LanePair } from '../synteny/lanePairs.ts'\n\nexport class HaplotypeWindowError extends Error {\n override name = 'HaplotypeWindowError'\n\n constructor(assemblyName: string, anchor: string) {\n super(\n `the graph is cut on its reference, ${anchor}; a window on ${assemblyName} has no reference coordinates to cut at. Open the graph from a ${anchor} view, and find this haplotype's lane there`,\n )\n }\n}\n\ntype ResolvedAlignment = Extract<HaplotypeAlignment, { resolved: true }>\n\n/**\n * The id of one haplotype fragment: the walk's GBWT position at its first node\n * in the window, which is a property of the graph, so the same fragment gets\n * the same id on a refetch of the same window and the display's hover and\n * selection survive it. `clipToRegion` suffixes the window.\n */\nfunction fragmentId(name: PathName, alignment: ResolvedAlignment) {\n return `${haplotypePrefix(name)}#${name.contig}@${alignment.start.node}.${alignment.start.offset}`\n}\n\nexport function fragmentFeature({\n alignment,\n assemblyName,\n refName,\n lane,\n}: {\n alignment: ResolvedAlignment\n assemblyName: string\n refName: string\n lane: string\n}) {\n const { refStart, refEnd, strand, cigar } = alignment\n if (refEnd <= refStart) {\n return undefined\n } else {\n const { name, hapStart, hapEnd } = alignment\n const id = fragmentId(name, alignment)\n const data: SimpleFeatureSerialized = {\n uniqueId: id,\n assemblyName,\n refName,\n start: refStart,\n end: refEnd,\n type: 'match',\n strand: strand === '-' ? -1 : 1,\n CIGAR: cigar,\n syntenyId: id,\n mate: {\n refName: name.contig,\n start: hapStart,\n end: hapEnd,\n assemblyName: lane,\n },\n }\n return new SyntenyFeature(data)\n }\n}\n\n/**\n * One record of a lane pair, on the target walk's own contig with the query\n * walk as its mate. gbz-base writes the CIGAR along the target, a `D` being\n * target bases the query lacks, which is the side a JBrowse feature is, so it\n * passes through unchanged.\n */\nexport function pairFeature({\n pair,\n lane,\n mateLane,\n}: {\n pair: PairAlignment\n lane: string\n mateLane: string\n}) {\n const id = `${haplotypePrefix(pair.target)}#${pair.target.contig}:${pair.targetStart}-${pair.targetEnd}|${haplotypePrefix(pair.query)}#${pair.query.contig}:${pair.queryStart}-${pair.queryEnd}`\n return new SyntenyFeature({\n uniqueId: id,\n assemblyName: lane,\n refName: pair.target.contig,\n start: pair.targetStart,\n end: pair.targetEnd,\n type: 'match',\n strand: pair.strand === '-' ? -1 : 1,\n CIGAR: pair.cigar,\n syntenyId: id,\n identity: pair.matches / Math.max(pair.columns, 1),\n numMatches: pair.matches,\n blockLen: pair.columns,\n mate: {\n refName: pair.query.contig,\n start: pair.queryStart,\n end: pair.queryEnd,\n assemblyName: mateLane,\n },\n })\n}\n\n// The longest detour a pair cut widens its context to take in\nconst BRIDGE_MAX_BP = 120_000\n\n/**\n * The widest gap, up to `BRIDGE_MAX_BP`, between two pieces of one kept walk:\n * a haplotype that left the cut's nodes for sequence the reference lacks and\n * came back. Two kept haplotypes that share that sequence only align across it\n * once its nodes are in the cut.\n */\nexport function widestWalkGap(subgraphs: Subgraph[], kept: Set<string>) {\n const byPath = new Map<string, [number, number][]>()\n for (const subgraph of subgraphs) {\n for (const { name, start, end } of subgraph.walkSpans()) {\n const prefix = haplotypePrefix(name)\n if (kept.has(prefix)) {\n const key = `${prefix}#${name.contig}`\n const spans = byPath.get(key)\n if (spans) {\n spans.push([start, end])\n } else {\n byPath.set(key, [[start, end]])\n }\n }\n }\n }\n let widest = 0\n for (const spans of byPath.values()) {\n spans.sort((a, b) => a[0] - b[0])\n for (let i = 1; i < spans.length; i++) {\n const gap = spans[i]![0] - spans[i - 1]![1]\n if (gap > 0 && gap <= BRIDGE_MAX_BP) {\n widest = Math.max(widest, gap)\n }\n }\n }\n return widest\n}\n\n// A window past the node limit fails as a zoom-in notice naming a span that\n// fits\nfunction zoomInNotice(error: unknown, what: string) {\n if (error instanceof NodeLimitError) {\n error.message = `Zoom in to about ${getBpDisplayStr(error.fitsBp)} to see ${what}`\n }\n return error\n}\n\n// gbz-base reads whole bp; a view asks at fractional ones\nconst wholeBp = (region: Region) => ({\n ...region,\n start: Math.floor(region.start),\n end: Math.ceil(region.end),\n})\n\nexport default class GbzBaseSyntenyAdapter extends ComparativeAdapterBase<GbzBaseSyntenyAdapterConfig> {\n private graph = cachedSetup({\n label: 'Opening pangenome database',\n setup: async () => {\n const gbzDb: FileLocation = this.getConf('gbzDbLocation')\n const configured: FileLocation = this.getConf('haplotypeIndexLocation')\n const companion = locationIsSet(configured)\n ? { location: configured }\n : await findCompanion(gbzDb, this.pluginManager)\n const indexLocation = companion.location\n const db = await GBZBase.open({\n source: openLocation(gbzDb, this.pluginManager),\n haplotypeIndex: indexLocation\n ? openLocation(indexLocation, this.pluginManager)\n : undefined,\n })\n const anchor = this.getConf('assemblyNames')[0]\n if (anchor === undefined) {\n throw new Error(\n 'GbzBaseSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as',\n )\n }\n const referenceSamples = await referenceSamplesOf(db)\n const referenceSample = resolveReferenceSample({\n configured: this.getConf('referenceSample'),\n anchorPrefix: resolvePanSNPrefix(this, anchor),\n referenceSamples,\n })\n return {\n db,\n anchor,\n referenceSample,\n referenceSamples,\n unreadableIndex: companion.unreadable,\n }\n },\n })\n\n /**\n * The indexed reference path a window on `refName` resolves against, or\n * undefined when the reference sample has no indexed path by that contig.\n */\n private async referenceQuery(\n refName: string,\n opts: BaseOptions,\n ): Promise<PathQuery | undefined> {\n const { db, referenceSample } = await this.graph(opts)\n return referencePathQuery(db, referenceSample, refName)\n }\n\n /**\n * Every haplotype the graph carries a walk for, `sample#haplotype` with its\n * contigs, from the Paths scan the adapter already makes; the lane picker's\n * source list. Reference samples are included and flagged.\n */\n async getHaplotypes(opts: BaseOptions = {}): Promise<GbzHaplotype[]> {\n const { db, referenceSamples } = await this.graph(opts)\n const byPrefix = new Map<string, GbzHaplotype>()\n for (const path of await db.paths()) {\n const prefix = haplotypePrefix(path.name)\n const entry = byPrefix.get(prefix)\n if (entry) {\n if (!entry.contigs.includes(path.name.contig)) {\n entry.contigs.push(path.name.contig)\n }\n } else {\n byPrefix.set(prefix, {\n prefix,\n sample: path.name.sample,\n haplotype: path.name.haplotype,\n contigs: [path.name.contig],\n isReference: referenceSamples.includes(path.name.sample),\n })\n }\n }\n return [...byPrefix.values()]\n }\n\n /**\n * `lanes` is every haplotype but the reference sample's own, which is the\n * anchor rather than a lane, declared up front so the display can offer the\n * whole graph's haplotypes before a fetch has placed any of them.\n */\n async getHeader(opts: BaseOptions = {}) {\n const { anchor, referenceSample, referenceSamples } = await this.graph(opts)\n const asmByPrefix = assemblyByPanSNPrefix(this)\n const lanes: GbzHeaderLane[] = []\n for (const haplotype of await this.getHaplotypes(opts)) {\n if (haplotype.sample !== referenceSample) {\n lanes.push({\n name: laneAssemblyName(asmByPrefix, haplotype.prefix),\n label: haplotype.prefix,\n group: haplotype.sample,\n })\n }\n }\n return {\n hasCoarseTier: false,\n anchorAssemblyName: anchor,\n referenceSample,\n referenceSamples,\n lanes,\n }\n }\n\n async getRefNames(opts: BaseOptions = {}) {\n const { db, anchor, referenceSample } = await this.graph(opts)\n const { assemblyName } = opts\n const prefix =\n assemblyName === anchor\n ? undefined\n : resolvePanSNPrefix(this, assemblyName)\n const contigs = (await db.paths())\n .filter(path =>\n assemblyName === anchor\n ? path.isIndexed && path.name.sample === referenceSample\n : panSNMatchesPrefix(haplotypePrefix(path.name), prefix),\n )\n .map(path => path.name.contig)\n return [...new Set(contigs)]\n }\n\n /**\n * The predicate gbz-base builds a window for, from the lanes a fetch asks\n * for. With a companion whose stray rows cover the window gbz-base walks\n * only the wanted haplotypes; otherwise it names every walk and keeps the\n * ones the predicate accepts, and throws rather than guess when a walk has\n * no name. Either way a cut holds those walks, the reference, and the nodes\n * they visit. Undefined when every haplotype is wanted.\n */\n //\n // `targetPrefix` is a pairwise view's one lane, and it belongs in here: left\n // to filter what came back, it handed gbz-base no predicate, and every\n // haplotype in the graph was walked for one to be kept.\n private keepPredicate(\n haplotypes: string[] | undefined,\n targetPrefix?: string,\n ) {\n const wantedPrefixes =\n haplotypes === undefined || haplotypes.length === 0\n ? undefined\n : haplotypes.map(lane => resolvePanSNPrefix(this, lane))\n return wantedPrefixes === undefined && targetPrefix === undefined\n ? undefined\n : (name: PathName) =>\n haplotypeWanted(name, wantedPrefixes) &&\n (targetPrefix === undefined ||\n panSNMatchesPrefix(haplotypePrefix(name), targetPrefix))\n }\n\n /**\n * The graph view's cut of the window, as tables: the reference walk, every\n * top-level snarl contained in it, and one walk per haplotype, PanSN-named\n * when the database (or its companion) carries the haplotype index and\n * `unknown#N` otherwise. The reference walk is the first, which is the one\n * the view anchors on by default. With `haplotypes` the walks are that\n * set's and the nodes those walks visit, the reference walk kept. With\n * `walkRows` the rows' runs come along, as on a walk-file cut.\n *\n * Only a window on the anchor can be cut: a haplotype lane's coordinates\n * are its own contig's, and the graph is indexed for random access on the\n * reference sample's paths alone.\n */\n async getSubgraph(region: Region, opts: SubgraphAdapterOptions = {}) {\n const { signal } = opts\n const { db, anchor, referenceSample, unreadableIndex } = await this.graph({\n signal,\n })\n const { assemblyName, refName, start, end } = wholeBp(region)\n if (assemblyName !== anchor) {\n throw new HaplotypeWindowError(assemblyName, anchor)\n }\n const query = await this.referenceQuery(refName, { signal })\n if (!query) {\n throw new Error(\n `${referenceSample} has no indexed path ${refName} in this graph`,\n )\n }\n const keep = this.keepPredicate(opts.haplotypes)\n if (keep !== undefined && !db.hasHaplotypeIndex) {\n throw new NoHaplotypeIndexError(unreadableIndex)\n }\n const cut = await cutWindowTables(db, query, start, end, {\n context: this.getConf('context'),\n snarls: opts.snarls ?? this.getConf('subgraphSnarls'),\n limit: this.getConf('nodeLimit'),\n signal: opts.signal,\n keep,\n }).catch((error: unknown) => {\n throw zoomInNotice(error, 'the graph')\n })\n return typeof cut === 'string'\n ? cut\n : walkCutFor(cut, { start, end }, opts.walkRows)\n }\n\n private gaf = cachedSetup({\n label: 'Opening reads',\n setup: async () => {\n const location: FileLocation = this.getConf('readsLocation')\n const index: FileLocation = this.getConf(['readsIndex', 'location'])\n return locationIsSet(location)\n ? new GafFile(\n openLocation(location, this.pluginManager),\n locationIsSet(index)\n ? openTabixSlot(this, ['readsLocation'], ['readsIndex'])\n : undefined,\n )\n : undefined\n },\n })\n\n /**\n * The reads over a cut's segments, from `readsLocation`, sampled down to\n * what the tube map lays out at interactive speed\n */\n async getReads(\n nodeNames: string[],\n opts: BaseOptions = {},\n ): Promise<GafReads> {\n const gaf = await this.gaf(opts)\n return gaf\n ? gaf.readsOver(new Set(nodeNames), opts)\n : { records: [], total: 0 }\n }\n\n private async laneHaplotypes(\n assemblyName: string,\n opts: BaseOptions,\n ): Promise<HaplotypeRef[]> {\n const prefix = resolvePanSNPrefix(this, assemblyName)\n return (await this.getHaplotypes(opts)).filter(haplotype =>\n panSNMatchesPrefix(haplotype.prefix, prefix),\n )\n }\n\n private async anchorFeatures(region: Region, opts: LaneFeatureOptions) {\n const { db } = await this.graph(opts)\n const { assemblyName, refName, start, end } = region\n const targetPrefix = resolvePanSNPrefix(this, opts.targetAssemblyName)\n const asmByPrefix = assemblyByPanSNPrefix(this)\n const keep = this.keepPredicate(opts.haplotypes, targetPrefix)\n const query = await this.referenceQuery(refName, opts)\n const nodeLimit: number = this.getConf('nodeLimit')\n const alignments = query\n ? await updateStatus(\n `Reading graph ${refName}:${start.toLocaleString()}-${end.toLocaleString()}`,\n opts.statusCallback,\n () =>\n db\n .getAlignments({\n path: query,\n start,\n end,\n context: this.getConf('context'),\n haplotypes: 'all',\n limit: nodeLimit,\n signal: opts.signal,\n keep,\n })\n .catch((error: unknown) => {\n throw zoomInNotice(\n nodeLimitError(error, nodeLimit, end - start) ?? error,\n 'lanes',\n )\n }),\n )\n : []\n return alignments.flatMap(alignment => {\n const feature = alignment.resolved\n ? fragmentFeature({\n alignment,\n assemblyName,\n refName,\n lane: laneAssemblyName(\n asmByPrefix,\n haplotypePrefix(alignment.name),\n ),\n })\n : undefined\n return feature === undefined ? [] : [feature]\n })\n }\n\n /**\n * Each pair's two lanes cut out of the anchor window alone, all pairs in one\n * cut, and each walk of a pair's query lane aligned to each walk of its\n * target lane on the nodes both visit, with no base compared. A pair's\n * records sit on its query lane's contigs, the lane the display draws on top.\n *\n * Whether the index has anchor rows changes only how fast gbz-base finds\n * the walks: both routes cut the same pieces.\n */\n private async pairFeatures(\n region: Region,\n pairs: LanePair[],\n opts: LaneFeatureOptions,\n ) {\n const { db } = await this.graph(opts)\n const { refName, start, end } = region\n const sides = await Promise.all(\n pairs.map(async pair => ({\n pair,\n featureSide: await this.laneHaplotypes(pair.queryAssemblyName, opts),\n mateSide: await this.laneHaplotypes(pair.targetAssemblyName, opts),\n })),\n )\n const answerable = sides.filter(\n ({ featureSide, mateSide }) =>\n featureSide.length > 0 && mateSide.length > 0,\n )\n const kept = new Set(\n answerable.flatMap(({ featureSide, mateSide }) =>\n [...featureSide, ...mateSide].map(haplotypePrefix),\n ),\n )\n const query = await this.referenceQuery(refName, opts)\n const nodeLimit: number = this.getConf('nodeLimit')\n const baseContext: number = this.getConf('context')\n const [first] = pairs\n const cut = (path: PathQuery, context: number) =>\n db.getSubgraphs({\n path,\n start,\n end,\n context,\n snarls: this.getConf('subgraphSnarls'),\n haplotypes: 'all',\n limit: nodeLimit,\n signal: opts.signal,\n keep: name => kept.has(haplotypePrefix(name)),\n })\n // a cut past the node limit for the wider context keeps the first one\n const bridged = async (path: PathQuery) => {\n const subgraphs = await cut(path, baseContext).catch((error: unknown) => {\n throw zoomInNotice(\n nodeLimitError(error, nodeLimit, end - start) ?? error,\n 'lanes',\n )\n })\n const gap = widestWalkGap(subgraphs, kept)\n const context = Math.ceil(gap / 2) + 2000\n return gap > 0 && context > baseContext\n ? cut(path, context).catch((error: unknown) => {\n if (error instanceof SubgraphLimitError) {\n return subgraphs\n }\n throw error\n })\n : subgraphs\n }\n const subgraphs =\n query && first && answerable.length > 0\n ? await updateStatus(\n pairs.length === 1\n ? `Reading ${first.queryAssemblyName} against ${first.targetAssemblyName}`\n : `Reading ${pairs.length} lane pairs`,\n opts.statusCallback,\n () => bridged(query),\n )\n : []\n return subgraphs.flatMap(subgraph =>\n answerable.flatMap(({ pair, featureSide, mateSide }) =>\n featureSide.flatMap(target =>\n mateSide.flatMap(mate =>\n subgraph\n .pairAlignments({ target, query: mate, bases: false })\n .map(alignment =>\n pairFeature({\n pair: alignment,\n lane: pair.queryAssemblyName,\n mateLane: pair.targetAssemblyName,\n }),\n ),\n ),\n ),\n ),\n )\n }\n\n getFeatures(asked: Region, opts: LaneFeatureOptions = {}) {\n const region = wholeBp(asked)\n return ObservableCreate<Feature>(async observer => {\n const { db, anchor, unreadableIndex } = await this.graph(opts)\n if (!db.hasHaplotypeIndex) {\n throw new NoHaplotypeIndexError(unreadableIndex)\n }\n // the graph is indexed on its reference alone, so a window on a\n // haplotype lane has no answer: a lane pair is read inside the anchor's\n if (region.assemblyName === anchor) {\n const pairs = requestedPairs(opts)\n const features =\n pairs.length > 0\n ? await this.pairFeatures(region, pairs, opts)\n : await this.anchorFeatures(region, opts)\n for (const feature of features) {\n observer.next(feature)\n }\n }\n observer.complete()\n }, opts.signal)\n }\n}\n"],
|
|
5
|
+
"mappings": "ytBAeA,SAASA,EAAqBC,EAAI,CAChC,IAAMC,EAAS,cACf,OAAOA,EAAO,KAAKD,CAAE,EAAIA,EAAG,QAAQC,EAAQ,qBAAqB,EAAI,MACvE,CCVO,SAASC,GAAiBC,EAAqB,CACpD,OAAOC,EAAcD,CAAK,GAAKE,EAAqBC,EAAaH,CAAK,CAAC,EACnEI,EAAQJ,EAAOK,GAAQH,EAAqBG,CAAI,CAAE,EAClD,MACN,CAIA,SAASC,GAAUC,EAAgB,CACjC,OACEA,aAAiB,QAChB,kBAAkB,KAAKA,EAAM,OAAO,GAClCA,EAA6B,OAAS,SAE7C,CAIA,eAAsBC,GACpBR,EACAS,EAC2D,CAC3D,IAAMC,EAAYX,GAAiBC,CAAK,EACxC,GAAI,CAACU,EACH,MAAO,CAAC,EAEV,GAAI,CACF,aAAMC,EAAaD,EAAWD,CAAa,EAAE,KAAK,EAC3C,CAAE,SAAUC,CAAU,CAC/B,OAASH,EAAO,CACd,OAAOD,GAAUC,CAAK,EAAI,CAAC,EAAI,CAAE,WAAY,OAAOA,CAAK,CAAE,CAC7D,CACF,CCrBO,IAAMK,GAAY,IAGnBC,GAAsB,GAAK,GAAK,GAEzBC,EAAN,cAAwC,KAAM,CAGnD,YAAYC,EAAc,CACxB,MACE,gBAAgBA,EAAO,GAAK,IAAI,QAAQ,CAAC,CAAC,+DAC5C,EALF,KAAS,KAAO,2BAMhB,CACF,EAGA,SAASC,GAAOC,EAAs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M,KAAK,aAAanD,EAAQmD,EAAO7B,CAAI,EAC3C,MAAM,KAAK,eAAetB,EAAQsB,CAAI,EAC5C,QAAW4B,KAAWgB,EACpBF,EAAS,KAAKd,CAAO,CAEzB,CACAc,EAAS,SAAS,CACpB,EAAG1C,EAAK,MAAM,CAChB,CACF",
|
|
6
|
+
"names": ["haplotypeIndexBeside", "db", "GBZ_DB", "siblingCompanion", "gbzDb", "readsSiblings", "haplotypeIndexBeside", "locationName", "renamed", "name", "isMissing", "error", "findCompanion", "pluginManager", "candidate", "openLocation", "MAX_READS", "MAX_UNINDEXED_BYTES", "UnindexedGafTooLargeError", "size", "sample", "records", "max", "stride", "_", "k", "touches", "record", "names", "step", "GafFile", "file", "tabix", "cachedSetup", "signal", "bytes", "text", "unzip", "parseGaf", "lo", "hi", "name", "id", "line", "parseGafLine", "r", "NoHaplotypeIndexError", "unreadable", "HaplotypeWindowError", "assemblyName", "anchor", "fragmentId", "name", "alignment", "haplotypePrefix", "fragmentFeature", "refName", "lane", "refStart", "refEnd", "strand", "cigar", "hapStart", "hapEnd", "id", "data", "SyntenyFeature", "pairFeature", "pair", "mateLane", "BRIDGE_MAX_BP", "widestWalkGap", "subgraphs", "kept", "byPath", "subgraph", "start", "end", "prefix", "key", "spans", "widest", "a", "b", "i", "gap", "zoomInNotice", "error", "what", "NodeLimitError", "getBpDisplayStr", "wholeBp", "region", "GbzBaseSyntenyAdapter", "ComparativeAdapterBase", "cachedSetup", "gbzDb", "configured", "companion", "locationIsSet", "findCompanion", "indexLocation", "db", "GBZBase", "openLocation", "referenceSamples", "referenceSamplesOf", "referenceSample", "resolveReferenceSample", "resolvePanSNPrefix", "location", "index", "GafFile", "openTabixSlot", "opts", "referencePathQuery", "byPrefix", "path", "entry", "asmByPrefix", "assemblyByPanSNPrefix", "lanes", "haplotype", "laneAssemblyName", "contigs", "panSNMatchesPrefix", "haplotypes", "targetPrefix", "wantedPrefixes", "haplotypeWanted", "signal", "unreadableIndex", "query", "keep", "cut", "cutWindowTables", "walkCutFor", "nodeNames", "gaf", "nodeLimit", "updateStatus", "nodeLimitError", "feature", "pairs", "answerable", "featureSide", "mateSide", "baseContext", "first", "context", "bridged", "SubgraphLimitError", "target", "mate", "asked", "ObservableCreate", "observer", "requestedPairs", "features"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-V4YHDVV3.js";import"./chunk-Z4B6RZGP.js";import"./chunk-2APZWSYD.js";import"./chunk-STTY74OG.js";import{k as d}from"./chunk-ZWMYT35X.js";import"./chunk-CH2E7TRS.js";import"./chunk-XJDTSPBL.js";import"./chunk-G73A6PEI.js";import"./chunk-TOT4S3TG.js";import"./chunk-56V22DVI.js";import"./chunk-G57N55FV.js";import"./chunk-HW4LIGPA.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import"./chunk-OUN4BNWJ.js";import"./chunk-5OI6LO4I.js";import"./chunk-NDRLCGPC.js";import"./chunk-TENPGIPX.js";import{g as x}from"./chunk-6OPB7FOJ.js";import{A as l,F as L,H as p,d as s,i as v,o as n,x as G}from"./chunk-E3WYW7Z6.js";import{a as y,b as a,c as r,d as i}from"./chunk-JMBDTNUR.js";var w=d()({paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto",display:"flex",flexDirection:"column",gap:12},row:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8}}),E=i(function({model:e}){let{classes:t}=w();return e.isLoading?r(l,{className:t.paper,"data-testid":"graph-genome-loading",children:[r("div",{className:t.row,children:[a(v,{variant:"h6",message:e.statusMessage}),a(n,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{e.cancelLoad()},children:"Cancel"})]}),a(G,{variant:"indeterminate"})]}):e.error?a(l,{className:t.paper,children:a(s,{error:e.error,onReset:()=>{e.retryLoad()}})}):a(l,{className:t.paper,"data-testid":"graph-genome-load-canceled",children:r("div",{className:t.row,children:[a(p,{variant:"h6",children:"Loading canceled"}),a(n,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{e.retryLoad()},children:"Retry"})]})})}),g=E;var F=`H VN:Z:1.0
|
|
2
2
|
S 1 ACGT
|
|
3
3
|
S 2 GGCC
|
|
4
4
|
S 3 TTAA
|
|
@@ -7,4 +7,4 @@ L 1 + 2 + 0M
|
|
|
7
7
|
L 1 + 3 + 0M
|
|
8
8
|
L 2 + 4 + 0M
|
|
9
9
|
L 3 + 4 + 0M`,S=d()({column:{display:"flex",flexDirection:"column",gap:8},rowEnd:{display:"flex",gap:8,alignItems:"flex-end"},rowCenter:{display:"flex",gap:8,alignItems:"center"},flex1:{flex:1},paper:{padding:16,margin:8,maxWidth:560,marginInline:"auto"},header:{marginBottom:12},footer:{marginTop:12,display:"flex",justifyContent:"flex-end"}}),T=i(function({model:e}){let{classes:t}=S(),[m,M]=x("");function u(){let o=m.trim();o&&e.loadGFAFromLocation({uri:o,locationType:"UriLocation"})}function N(o){let c=o.target.files?.[0];o.target.value="",c&&c.text().then(f=>e.loadGFA(f,c.name)).catch(f=>{e.setError(f)})}return r(l,{className:t.paper,children:[a("div",{className:t.header,children:a(p,{variant:"h6",children:"Load a GFA graph"})}),r("div",{className:t.column,children:[r("div",{className:t.rowCenter,children:[r(n,{variant:"outlined",component:"label",size:"small",children:["Choose file",a("input",{type:"file",accept:".gfa,.gfa1,.gfa2",hidden:!0,onChange:o=>{N(o)}})]}),a(p,{variant:"caption",color:"text.secondary",children:"Whole-file GFA; best for small/medium graphs."})]}),r("div",{className:t.rowEnd,children:[a(L,{size:"small",label:"URL",placeholder:"https://example.com/graph.gfa",value:m,onChange:o=>{M(o.target.value)},onKeyDown:o=>{o.key==="Enter"&&u()},className:t.flex1}),a(n,{variant:"contained",onClick:()=>{u()},disabled:!m.trim(),children:"Open"})]})]}),a("div",{className:t.footer,children:a(n,{size:"small",onClick:()=>{e.loadGFA(F,"Example graph")},children:"Load 4-node example"})}),e.error?a(s,{error:e.error}):null]})}),P=T;var A=i(function({model:e}){return e.hasGraph?a(C,{model:e}):e.canRetryLoad&&(e.error||e.loadCanceled)?a(g,{model:e}):r(y,{children:[e.isLoading?a(g,{model:e}):null,a("div",{hidden:e.isLoading,children:a(P,{model:e})})]})}),J=A;export{J as default};
|
|
10
|
-
//# sourceMappingURL=GraphGenomeView-
|
|
10
|
+
//# sourceMappingURL=GraphGenomeView-T4YQMLAX.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/GraphGenomeView/components/GraphLoadStatus.tsx", "../../src/GraphGenomeView/components/ImportForm.tsx", "../../src/GraphGenomeView/components/GraphGenomeView.tsx"],
|
|
4
4
|
"sourcesContent": ["import { ErrorBanner, LoadingEllipses } from '@jbrowse/core/ui'\nimport { Button, LinearProgress, Paper, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n paper: {\n padding: 16,\n margin: 8,\n maxWidth: 560,\n marginInline: 'auto',\n display: 'flex',\n flexDirection: 'column',\n gap: 12,\n },\n row: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 8,\n },\n})\n\n// What a view with no graph on screen shows while its load runs, and after a\n// load of a source it can retry was canceled or failed.\nconst GraphLoadStatus = observer(function GraphLoadStatus({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n if (model.isLoading) {\n return (\n <Paper className={classes.paper} data-testid=\"graph-genome-loading\">\n <div className={classes.row}>\n <LoadingEllipses variant=\"h6\" message={model.statusMessage} />\n <Button\n size=\"small\"\n data-testid=\"graph-genome-cancel\"\n onClick={() => {\n model.cancelLoad()\n }}\n >\n Cancel\n </Button>\n </div>\n <LinearProgress variant=\"indeterminate\" />\n </Paper>\n )\n }\n if (model.error) {\n return (\n <Paper className={classes.paper}>\n <ErrorBanner\n error={model.error}\n onReset={() => {\n model.retryLoad()\n }}\n />\n </Paper>\n )\n }\n return (\n <Paper className={classes.paper} data-testid=\"graph-genome-load-canceled\">\n <div className={classes.row}>\n <Typography variant=\"h6\">Loading canceled</Typography>\n <Button\n variant=\"contained\"\n size=\"small\"\n data-testid=\"graph-genome-retry\"\n onClick={() => {\n model.retryLoad()\n }}\n >\n Retry\n </Button>\n </div>\n </Paper>\n )\n})\n\nexport default GraphLoadStatus\n", "import { useState } from 'react'\n\nimport { ErrorBanner } from '@jbrowse/core/ui'\nimport { Button, Paper, TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport type { GraphPaneModel } from '../model'\n\nconst EXAMPLE_GFA = `H\\tVN:Z:1.0\nS\\t1\\tACGT\nS\\t2\\tGGCC\nS\\t3\\tTTAA\nS\\t4\\tCCGG\nL\\t1\\t+\\t2\\t+\\t0M\nL\\t1\\t+\\t3\\t+\\t0M\nL\\t2\\t+\\t4\\t+\\t0M\nL\\t3\\t+\\t4\\t+\\t0M`\n\nconst useStyles = makeStyles()({\n column: { display: 'flex', flexDirection: 'column', gap: 8 },\n rowEnd: { display: 'flex', gap: 8, alignItems: 'flex-end' },\n rowCenter: { display: 'flex', gap: 8, alignItems: 'center' },\n flex1: { flex: 1 },\n paper: { padding: 16, margin: 8, maxWidth: 560, marginInline: 'auto' },\n header: { marginBottom: 12 },\n footer: { marginTop: 12, display: 'flex', justifyContent: 'flex-end' },\n})\n\nconst ImportForm = observer(function ImportForm({\n model,\n}: {\n model: GraphPaneModel\n}) {\n const { classes } = useStyles()\n const [url, setUrl] = useState('')\n\n function handleUrlLoad() {\n const uri = url.trim()\n if (uri) {\n void model.loadGFAFromLocation({ uri, locationType: 'UriLocation' })\n }\n }\n\n function handleFileUpload(event: React.ChangeEvent<HTMLInputElement>) {\n const file = event.target.files?.[0]\n // or picking the same file again fires no change\n event.target.value = ''\n if (file) {\n file\n .text()\n .then(text => model.loadGFA(text, file.name))\n .catch((err: unknown) => {\n model.setError(err)\n })\n }\n }\n\n return (\n <Paper className={classes.paper}>\n <div className={classes.header}>\n <Typography variant=\"h6\">Load a GFA graph</Typography>\n </div>\n\n <div className={classes.column}>\n <div className={classes.rowCenter}>\n <Button variant=\"outlined\" component=\"label\" size=\"small\">\n Choose file\n <input\n type=\"file\"\n accept=\".gfa,.gfa1,.gfa2\"\n hidden\n onChange={event => {\n handleFileUpload(event)\n }}\n />\n </Button>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Whole-file GFA; best for small/medium graphs.\n </Typography>\n </div>\n\n <div className={classes.rowEnd}>\n <TextField\n size=\"small\"\n label=\"URL\"\n placeholder=\"https://example.com/graph.gfa\"\n value={url}\n onChange={e => {\n setUrl(e.target.value)\n }}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n handleUrlLoad()\n }\n }}\n className={classes.flex1}\n />\n <Button\n variant=\"contained\"\n onClick={() => {\n handleUrlLoad()\n }}\n disabled={!url.trim()}\n >\n Open\n </Button>\n </div>\n </div>\n\n <div className={classes.footer}>\n <Button\n size=\"small\"\n onClick={() => {\n void model.loadGFA(EXAMPLE_GFA, 'Example graph')\n }}\n >\n Load 4-node example\n </Button>\n </div>\n\n {model.error ? <ErrorBanner error={model.error} /> : null}\n </Paper>\n )\n})\n\nexport default ImportForm\n", "import { observer } from 'mobx-react'\n\nimport GraphCanvas from './GraphCanvas'\nimport GraphLoadStatus from './GraphLoadStatus'\nimport ImportForm from './ImportForm'\n\nimport type { GraphPaneModel } from '../model'\n\nconst GraphGenomeView = observer(function GraphGenomeView({\n model,\n}: {\n model: GraphPaneModel\n}) {\n if (model.hasGraph) {\n return <GraphCanvas model={model} />\n }\n // A launched or restored view has a source of its own, so the import form\n // has nothing to offer it when that source fails\n if (model.canRetryLoad && (model.error || model.loadCanceled)) {\n return <GraphLoadStatus model={model} />\n }\n // Hidden rather than unmounted, so a typed URL survives a failed load\n return (\n <>\n {model.isLoading ? <GraphLoadStatus model={model} /> : null}\n <div hidden={model.isLoading}>\n <ImportForm model={model} />\n </div>\n </>\n )\n})\n\nexport default GraphGenomeView\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "usBAOA,IAAMA,EAAYC,EAAW,EAAE,CAC7B,MAAO,CACL,QAAS,GACT,OAAQ,EACR,SAAU,IACV,aAAc,OACd,QAAS,OACT,cAAe,SACf,IAAK,EACP,EACA,IAAK,CACH,QAAS,OACT,WAAY,SACZ,eAAgB,gBAChB,IAAK,CACP,CACF,CAAC,EAIKC,EAAkBC,EAAS,SAAyB,CACxD,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIL,EAAU,EAC9B,OAAII,EAAM,UAENE,EAACC,EAAA,CAAM,UAAWF,EAAQ,MAAO,cAAY,uBAC3C,UAAAC,EAAC,OAAI,UAAWD,EAAQ,IACtB,UAAAG,EAACC,EAAA,CAAgB,QAAQ,KAAK,QAASL,EAAM,cAAe,EAC5DI,EAACE,EAAA,CACC,KAAK,QACL,cAAY,sBACZ,QAAS,IAAM,CACbN,EAAM,WAAW,CACnB,EACD,kBAED,GACF,EACAI,EAACG,EAAA,CAAe,QAAQ,gBAAgB,GAC1C,EAGAP,EAAM,MAENI,EAACD,EAAA,CAAM,UAAWF,EAAQ,MACxB,SAAAG,EAACI,EAAA,CACC,MAAOR,EAAM,MACb,QAAS,IAAM,CACbA,EAAM,UAAU,CAClB,EACF,EACF,EAIFI,EAACD,EAAA,CAAM,UAAWF,EAAQ,MAAO,cAAY,6BAC3C,SAAAC,EAAC,OAAI,UAAWD,EAAQ,IACtB,UAAAG,EAACK,EAAA,CAAW,QAAQ,KAAK,4BAAgB,EACzCL,EAACE,EAAA,CACC,QAAQ,YACR,KAAK,QACL,cAAY,qBACZ,QAAS,IAAM,CACbN,EAAM,UAAU,CAClB,EACD,iBAED,GACF,EACF,CAEJ,CAAC,EAEMU,EAAQZ,EC1Ef,IAAMa,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AAK,OACL,OAAO,mBACP,OAAM,GACN,SAAUN,GAAS,CACjBD,EAAiBC,CAAK,CACxB,EACF,GACF,EACAM,EAACC,EAAA,CAAW,QAAQ,UAAU,MAAM,iBAAiB,yDAErD,GACF,EAEAH,EAAC,OAAI,UAAWX,EAAQ,OACtB,UAAAa,EAACG,EAAA,CACC,KAAK,QACL,MAAM,MACN,YAAY,gCACZ,MAAOf,EACP,SAAUgB,GAAK,CACbf,EAAOe,EAAE,OAAO,KAAK,CACvB,EACA,UAAWA,GAAK,CACVA,EAAE,MAAQ,SACZb,EAAc,CAElB,EACA,UAAWJ,EAAQ,MACrB,EACAa,EAACE,EAAA,CACC,QAAQ,YACR,QAAS,IAAM,CACbX,EAAc,CAChB,EACA,SAAU,CAACH,EAAI,KAAK,EACrB,gBAED,GACF,GACF,EAEAY,EAAC,OAAI,UAAWb,EAAQ,OACtB,SAAAa,EAACE,EAAA,CACC,KAAK,QACL,QAAS,IAAM,CACRhB,EAAM,QAAQL,EAAa,eAAe,CACjD,EACD,+BAED,EACF,EAECK,EAAM,MAAQc,EAACK,EAAA,CAAY,MAAOnB,EAAM,MAAO,EAAK,MACvD,CAEJ,CAAC,EAEMoB,EAAQtB,ECtHf,IAAMuB,EAAkBC,EAAS,SAAyB,CACxD,MAAAC,CACF,EAEG,CACD,OAAIA,EAAM,SACDC,EAACC,EAAA,CAAY,MAAOF,EAAO,EAIhCA,EAAM,eAAiBA,EAAM,OAASA,EAAM,cACvCC,EAACE,EAAA,CAAgB,MAAOH,EAAO,EAItCI,EAAAC,EAAA,CACG,UAAAL,EAAM,UAAYC,EAACE,EAAA,CAAgB,MAAOH,EAAO,EAAK,KACvDC,EAAC,OAAI,OAAQD,EAAM,UACjB,SAAAC,EAACK,EAAA,CAAW,MAAON,EAAO,EAC5B,GACF,CAEJ,CAAC,EAEMO,EAAQT",
|
|
6
6
|
"names": ["useStyles", "makeStyles", "GraphLoadStatus", "observer", "model", "classes", "jsxs", "Paper", "jsx", "LoadingEllipses", "Button", "LinearProgress", "ErrorBanner", "Typography", "GraphLoadStatus_default", "EXAMPLE_GFA", "useStyles", "makeStyles", "ImportForm", "observer", "model", "classes", "url", "setUrl", "useState", "handleUrlLoad", "uri", "handleFileUpload", "event", "file", "text", "err", "jsxs", "Paper", "jsx", "Typography", "Button", "TextField", "e", "ErrorBanner", "ImportForm_default", "GraphGenomeView", "observer", "model", "jsx", "GraphCanvas_default", "GraphLoadStatus_default", "jsxs", "Fragment", "ImportForm_default", "GraphGenomeView_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{b as G}from"./chunk-Z4B6RZGP.js";import{b as H,c as x}from"./chunk-E2QPSDQL.js";import{k as h}from"./chunk-ZWMYT35X.js";import"./chunk-G73A6PEI.js";import"./chunk-HW4LIGPA.js";import"./chunk-MVVXRZXV.js";import"./chunk-OUN4BNWJ.js";import"./chunk-5OI6LO4I.js";import{g as u}from"./chunk-6OPB7FOJ.js";import{D as v,F as f,H as c,n as g,s as b,w as S,z as C}from"./chunk-E3WYW7Z6.js";import{b as a,c as l,d as i}from"./chunk-JMBDTNUR.js";var F=h()({section:{marginBottom:24},formControl:{minWidth:200}}),M=[{value:0,label:"None"},{value:1,label:"1 hop"},{value:2,label:"2 hops"}],I=i(function({model:t}){let{classes:e}=F();return t.adapterConfig.type==="RgfaTabixAdapter"&&!H(t.adapterConfig)?l("div",{className:e.section,children:[l(b,{className:e.formControl,children:[a(S,{children:"Graph context"}),a(v,{value:t.subgraphContext,label:"Graph context","data-testid":"graph-context-select",onChange:o=>{t.setSubgraphContext(o.target.value),t.cut()},children:M.map(({value:o,label:p})=>a(C,{value:o,children:p},o))})]}),a(c,{variant:"caption",component:"div",color:"text.secondary",children:"How far the cut follows links out of the region. At none, a detour that leaves the window draws as two stubs. No effect on gfa-to-tabix's default anchored index."})]}):null}),L=I;var N=h()({section:{marginBottom:24}});function P(n){let t=n.split(/[\s,]+/).map(e=>e.trim()).filter(e=>e!=="");return t.length===0?void 0:t}var T=i(function({model:t}){let[e,o]=u(t.cutHaplotypes?.join(", ")??""),p=()=>{let r=P(e)??[];r.join(`
|
|
2
|
+
`)===(t.cutHaplotypes??[]).join(`
|
|
3
|
+
`)||(t.setSubgraphHaplotypes(r),t.cut())};return a(f,{fullWidth:!0,label:"Haplotypes",placeholder:"every haplotype",value:e,slotProps:{htmlInput:{"data-testid":"graph-haplotypes-field"}},onChange:r=>{o(r.target.value)},onBlur:()=>{p()},onKeyDown:r=>{r.key==="Enter"&&p()}})}),w=i(function({model:t,names:e}){let[o,p]=u(t.cutHaplotypes??[]),[r,d]=u(!1),m=s=>{s.join(`
|
|
4
|
+
`)!==(t.cutHaplotypes??[]).join(`
|
|
5
|
+
`)&&(t.setSubgraphHaplotypes(s),t.cut())};return a(g,{multiple:!0,freeSolo:!0,disableCloseOnSelect:!0,options:e,value:o,open:r,onOpen:()=>{d(!0)},onClose:()=>{d(!1),m(o)},onChange:(s,y)=>{p(y),r||m(y)},renderInput:s=>a(f,{...s,label:"Haplotypes",placeholder:o.length===0?"every haplotype":void 0,slotProps:{...s.slotProps,htmlInput:{...s.slotProps.htmlInput,"data-testid":"graph-haplotypes-field"}}})})}),D=i(function({model:t}){let{classes:e}=N(),o=t.haplotypeNames,p=t.cutHaplotypes?.join(",")??"";return x(t.adapterConfig)?l("div",{className:e.section,children:[o?a(w,{model:t,names:o},p):a(T,{model:t},p),l(c,{variant:"caption",component:"div",color:"text.secondary",children:[o?`Which of the graph's ${o.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`:"Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas."," ","Empty is every haplotype."]})]}):null}),k=D;function B({model:n,open:t,onClose:e}){return l(G,{model:n,open:t,onClose:e,children:[a(L,{model:n}),a(k,{model:n})]})}export{B as default};
|
|
6
|
+
//# sourceMappingURL=GraphTrackSettingsDialog-EQ5W5KTL.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/LinearGraphDisplay/components/SubgraphContextSelect.tsx", "../../src/LinearGraphDisplay/components/SubgraphHaplotypesField.tsx", "../../src/LinearGraphDisplay/components/GraphTrackSettingsDialog.tsx"],
|
|
4
|
+
"sourcesContent": ["import {\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { walkIndexed } from '../../graphTrackConfig'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n formControl: {\n minWidth: 200,\n },\n})\n\n// Only an rGFA cut from segment rows reads hops: a GBZ cut widens by its\n// adapter's bp `context`, and a walk-indexed cut follows its walks.\n// Hops past the region's own segments, each costing a tabix query per\n// off-reference segment already reached. One is the default: at none a single\n// detour draws as two unrelated stubs, which is a wrong picture of the graph\n// rather than a cheaper one. Two exists for a graph whose alleles have alleles\n// (HPRC's amylase window keeps growing at 2, the E. coli paa locus does not), and\n// it stops there because a frontier is still not a bubble decomposition. Cut an\n// exact slice with gfatools when that is what is wanted.\nconst SUBGRAPH_CONTEXTS = [\n { value: 0, label: 'None' },\n { value: 1, label: '1 hop' },\n { value: 2, label: '2 hops' },\n]\n\nconst SubgraphContextSelect = observer(function SubgraphContextSelect({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n return model.adapterConfig.type === 'RgfaTabixAdapter' &&\n !walkIndexed(model.adapterConfig) ? (\n <div className={classes.section}>\n <FormControl className={classes.formControl}>\n <InputLabel>Graph context</InputLabel>\n <Select\n value={model.subgraphContext}\n label=\"Graph context\"\n data-testid=\"graph-context-select\"\n onChange={e => {\n model.setSubgraphContext(e.target.value)\n void model.cut()\n }}\n >\n {SUBGRAPH_CONTEXTS.map(({ value, label }) => (\n <MenuItem key={value} value={value}>\n {label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n How far the cut follows links out of the region. At none, a detour that\n leaves the window draws as two stubs. No effect on gfa-to-tabix's\n default anchored index.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphContextSelect\n", "import { useState } from 'react'\n\nimport { Autocomplete, TextField, Typography } from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport { cutsByHaplotype } from '../../graphTrackConfig'\n\nimport type { LinearGraphCutModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n})\n\nexport function parseHaplotypeList(text: string) {\n const names = text\n .split(/[\\s,]+/)\n .map(name => name.trim())\n .filter(name => name !== '')\n return names.length === 0 ? undefined : names\n}\n\nconst HaplotypeListField = observer(function HaplotypeListField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes?.join(', ') ?? '')\n const apply = () => {\n const parsed = parseHaplotypeList(draft) ?? []\n const unchanged =\n parsed.join('\\n') === (model.cutHaplotypes ?? []).join('\\n')\n if (!unchanged) {\n model.setSubgraphHaplotypes(parsed)\n void model.cut()\n }\n }\n return (\n <TextField\n fullWidth\n label=\"Haplotypes\"\n placeholder=\"every haplotype\"\n value={draft}\n slotProps={{ htmlInput: { 'data-testid': 'graph-haplotypes-field' } }}\n onChange={e => {\n setDraft(e.target.value)\n }}\n onBlur={() => {\n apply()\n }}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n apply()\n }\n }}\n />\n )\n})\n\n// The haplotypes a walk-indexed graph's header names, searched as typed. A\n// typed prefix the list lacks (HG002 for both haplotypes) is kept too. The\n// set applies when the list closes or, with the list closed, as it changes.\nconst HaplotypePickField = observer(function HaplotypePickField({\n model,\n names,\n}: {\n model: LinearGraphCutModel\n names: string[]\n}) {\n const [draft, setDraft] = useState(model.cutHaplotypes ?? [])\n const [open, setOpen] = useState(false)\n const apply = (haplotypes: string[]) => {\n if (haplotypes.join('\\n') !== (model.cutHaplotypes ?? []).join('\\n')) {\n model.setSubgraphHaplotypes(haplotypes)\n void model.cut()\n }\n }\n return (\n <Autocomplete\n multiple\n freeSolo\n disableCloseOnSelect\n options={names}\n value={draft}\n open={open}\n onOpen={() => {\n setOpen(true)\n }}\n onClose={() => {\n setOpen(false)\n apply(draft)\n }}\n onChange={(_, value) => {\n setDraft(value)\n if (!open) {\n apply(value)\n }\n }}\n renderInput={params => (\n <TextField\n {...params}\n label=\"Haplotypes\"\n placeholder={draft.length === 0 ? 'every haplotype' : undefined}\n slotProps={{\n ...params.slotProps,\n htmlInput: {\n ...params.slotProps.htmlInput,\n 'data-testid': 'graph-haplotypes-field',\n },\n }}\n />\n )}\n />\n )\n})\n\n// Only a GBZ cut and a walk-indexed rGFA cut read the set. The inner field is\n// keyed on it so an outside change (a restored session, a launch) resets the\n// draft rather than fighting it.\nconst SubgraphHaplotypesField = observer(function SubgraphHaplotypesField({\n model,\n}: {\n model: LinearGraphCutModel\n}) {\n const { classes } = useStyles()\n const names = model.haplotypeNames\n const key = model.cutHaplotypes?.join(',') ?? ''\n return cutsByHaplotype(model.adapterConfig) ? (\n <div className={classes.section}>\n {names ? (\n <HaplotypePickField key={key} model={model} names={names} />\n ) : (\n <HaplotypeListField key={key} model={model} />\n )}\n <Typography variant=\"caption\" component=\"div\" color=\"text.secondary\">\n {names\n ? `Which of the graph's ${names.length.toLocaleString()} haplotypes to cut, or a PanSN prefix (HG002 for both).`\n : 'Which haplotypes to cut, as lane assembly names or PanSN prefixes (HG002#1, or HG002 for both) separated by commas.'}{' '}\n Empty is every haplotype.\n </Typography>\n </div>\n ) : null\n})\n\nexport default SubgraphHaplotypesField\n", "import SubgraphContextSelect from './SubgraphContextSelect'\nimport SubgraphHaplotypesField from './SubgraphHaplotypesField'\nimport GraphSettingsDialog from '../../GraphGenomeView/components/GraphSettingsDialog'\n\nimport type { LinearGraphCutModel } from '../model'\n\nexport default function GraphTrackSettingsDialog({\n model,\n open,\n onClose,\n}: {\n model: LinearGraphCutModel\n open: boolean\n onClose: () => void\n}) {\n return (\n <GraphSettingsDialog model={model} open={open} onClose={onClose}>\n <SubgraphContextSelect model={model} />\n <SubgraphHaplotypesField model={model} />\n </GraphSettingsDialog>\n )\n}\n"],
|
|
5
|
+
"mappings": "2bAcA,IAAMA,EAAYC,EAAW,EAAE,CAC7B,QAAS,CACP,aAAc,EAChB,EACA,YAAa,CACX,SAAU,GACZ,CACF,CAAC,EAWKC,EAAoB,CACxB,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,OAAQ,EAC3B,CAAE,MAAO,EAAG,MAAO,QAAS,CAC9B,EAEMC,EAAwBC,EAAS,SAA+B,CACpE,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIN,EAAU,EAC9B,OAAOK,EAAM,cAAc,OAAS,oBAClC,CAACE,EAAYF,EAAM,aAAa,EAChCG,EAAC,OAAI,UAAWF,EAAQ,QACtB,UAAAE,EAACC,EAAA,CAAY,UAAWH,EAAQ,YAC9B,UAAAI,EAACC,EAAA,CAAW,yBAAa,EACzBD,EAACE,EAAA,CACC,MAAOP,EAAM,gBACb,MAAM,gBACN,cAAY,uBACZ,SAAUQ,GAAK,CACbR,EAAM,mBAAmBQ,EAAE,OAAO,KAAK,EAClCR,EAAM,IAAI,CACjB,EAEC,SAAAH,EAAkB,IAAI,CAAC,CAAE,MAAAY,EAAO,MAAAC,CAAM,IACrCL,EAACM,EAAA,CAAqB,MAAOF,EAC1B,SAAAC,GADYD,CAEf,CACD,EACH,GACF,EACAJ,EAACO,EAAA,CAAW,QAAQ,UAAU,UAAU,MAAM,MAAM,iBAAiB,6KAIrE,GACF,EACE,IACN,CAAC,EAEMC,EAAQf,EChEf,IAAMgB,EAAYC,EAAW,EAAE,CAC7B,QAAS,CACP,aAAc,EAChB,CACF,CAAC,EAEM,SAASC,EAAmBC,EAAc,CAC/C,IAAM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", "walkIndexed", "jsxs", "FormControl", "jsx", "InputLabel", "Select", "e", "value", "label", "MenuItem", "Typography", "SubgraphContextSelect_default", "useStyles", "makeStyles", "parseHaplotypeList", "text", "names", "name", "HaplotypeListField", "observer", "model", "draft", "setDraft", "useState", "apply", "parsed", "jsx", "TextField", "e", "HaplotypePickField", "open", "setOpen", "haplotypes", "Autocomplete", "_", "value", "params", "SubgraphHaplotypesField", "classes", "key", "cutsByHaplotype", "jsxs", "Typography", "SubgraphHaplotypesField_default", "GraphTrackSettingsDialog", "model", "open", "onClose", "jsxs", "GraphSettingsDialog_default", "jsx", "SubgraphContextSelect_default", "SubgraphHaplotypesField_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as v,p as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=HighlightColorDialog-
|
|
1
|
+
import{o as v,p as C}from"./chunk-XJDTSPBL.js";import"./chunk-G73A6PEI.js";import"./chunk-HW4LIGPA.js";import"./chunk-OUN4BNWJ.js";import{F as g,H as t,c as u,o as y,q as c,r as d,z as s}from"./chunk-E3WYW7Z6.js";import{a as h,b as l,c as p,d as m}from"./chunk-JMBDTNUR.js";var b=m(function({model:o,onClose:r}){return p(u,{open:!0,onClose:r,title:"Color highlighted haplotypes",children:[p(d,{sx:{display:"grid",gridTemplateColumns:"auto 1fr 1fr",alignItems:"center",gap:1.5},children:[l(t,{variant:"subtitle2",children:"Haplotype"}),l(t,{variant:"subtitle2",children:"Color by"}),l(t,{variant:"subtitle2",children:"Palette"}),o.drawnWalks.map(({name:a,encoding:n})=>l(f,{label:o.walkLabel(a),field:n.field,scheme:n.scheme,onField:e=>{o.setWalkColor(a,{field:e})},onScheme:e=>{o.setWalkColor(a,{scheme:e})}},a))]}),l(c,{children:l(y,{variant:"contained",onClick:r,children:"Done"})})]})});function f({label:i,field:o,scheme:r,onField:a,onScheme:n}){return p(h,{children:[l(t,{variant:"body2",children:i}),l(g,{select:!0,size:"small",value:o,slotProps:{select:{SelectDisplayProps:{"aria-label":`Color ${i} by`}}},onChange:e=>{a(e.target.value)},children:v.map(e=>l(s,{value:e.value,children:e.label},e.value))}),l(g,{select:!0,size:"small",value:r,slotProps:{select:{SelectDisplayProps:{"aria-label":`Palette for ${i}`}}},onChange:e=>{n(e.target.value)},children:C.filter(e=>e.value!=="rainbow"||o==="reference").map(e=>l(s,{value:e.value,children:e.label},e.value))})]})}var P=b;export{P as default};
|
|
2
|
+
//# sourceMappingURL=HighlightColorDialog-3BONNNBR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g}from"./chunk-V4YHDVV3.js";import"./chunk-Z4B6RZGP.js";import"./chunk-2APZWSYD.js";import"./chunk-STTY74OG.js";import"./chunk-ZWMYT35X.js";import"./chunk-CH2E7TRS.js";import"./chunk-XJDTSPBL.js";import"./chunk-G73A6PEI.js";import"./chunk-TOT4S3TG.js";import"./chunk-56V22DVI.js";import"./chunk-G57N55FV.js";import"./chunk-HW4LIGPA.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import"./chunk-OUN4BNWJ.js";import"./chunk-5OI6LO4I.js";import"./chunk-NDRLCGPC.js";import"./chunk-TENPGIPX.js";import{g as y}from"./chunk-6OPB7FOJ.js";import"./chunk-E3WYW7Z6.js";import{b as e,c as l,d as T}from"./chunk-JMBDTNUR.js";var s=JBrowseExports["@jbrowse/display-kit/DisplayBackgroundProgress"];var v=s&&s.__esModule?s.default:s;var i=JBrowseExports["@jbrowse/display-kit/DisplayErrorBar"];var h=i&&i.__esModule?i.default:i;var a=JBrowseExports["@jbrowse/display-kit/DisplayLoadingOverlay"];var O=a&&a.__esModule?a.default:a;var n=JBrowseExports["@jbrowse/display-kit/TooLargeMessage"];var f=n&&n.__esModule?n.default:n;var t=JBrowseExports["@jbrowse/display-ui"],p=r=>t!=null&&r in Object(t)?t[r]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+r+"' from '@jbrowse/display-ui' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:r});var w=p("BottomRightCornerContext");var c=p("TrackOverlayPortal");var L=p("useChromeOverlayOverride");var j=t&&t.__esModule?t.default:t;var D={TooLarge:f,ErrorBar:h,Loading:O,BackgroundProgress:v};function d({model:r,phase:o,drawn:u,testid:_,style:C,children:E,...B}){let{TooLarge:G,ErrorBar:S,Loading:b,BackgroundProgress:m}=L()??D,[P,A]=y(null),x={...B,"data-testid":_,"data-display-id":r.configuration.displayId,"data-display-drawn":u,"data-display-phase":o};return o==="tooLarge"?e("div",{style:{display:"contents"},...x,children:e(c,{children:e("div",{style:{pointerEvents:"auto"},children:e(G,{model:r})})})}):l("div",{style:{position:"relative",height:r.height,...C},...x,children:[e(w,{value:P,children:E}),l(c,{children:[e(S,{model:r,visible:o==="error"}),e(b,{model:r,visible:o==="loading"||o==="canceled",immediate:!u}),e("div",{ref:A,style:{position:"absolute",bottom:2,right:2,display:"flex",flexDirection:"column",alignItems:"flex-end",gap:4,pointerEvents:"none"},children:e(m,{model:r,visible:o==="ready"})})]})]})}var I=T(function({model:o}){return e(d,{model:o,phase:o.displayPhase,drawn:o.painted&&o.geometryPainted,testid:"linear-graph-display","data-layout":o.chosenLayoutMode,"data-cut-tier":o.cutTier,"data-recuts":o.recuts,"data-node-count":o.hasGraph?o.nodeCount:void 0,"data-loading":o.isLoading?"":void 0,style:{width:o.paneWidth,height:o.height,overflow:"hidden"},children:e(g,{model:o,ownChrome:!1})})}),Q=I;export{Q as default};
|
|
2
|
+
//# sourceMappingURL=LinearGraphDisplay-MQ4LD2RQ.js.map
|
package/dist/chunks/{LinearGraphDisplay-RTMEWTK4.js.map → LinearGraphDisplay-MQ4LD2RQ.js.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["host:@jbrowse/display-kit/DisplayBackgroundProgress", "host:@jbrowse/display-kit/DisplayErrorBar", "host:@jbrowse/display-kit/DisplayLoadingOverlay", "host:@jbrowse/display-kit/TooLargeMessage", "host:@jbrowse/display-ui", "../../src/LinearGraphDisplay/components/GraphStatusChrome.tsx", "../../src/LinearGraphDisplay/components/LinearGraphDisplay.tsx"],
|
|
4
|
-
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/display-kit/DisplayBackgroundProgress\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayBackgroundProgress\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/DisplayErrorBar\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayErrorBar\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/DisplayLoadingOverlay\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayLoadingOverlay\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/TooLargeMessage\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/TooLargeMessage\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-ui\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-ui\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport const AXIS_GUTTER_WIDTH_PX = /* @__PURE__ */ read(\"AXIS_GUTTER_WIDTH_PX\")\nexport const AXIS_RIGHT_INSET_PX = /* @__PURE__ */ read(\"AXIS_RIGHT_INSET_PX\")\nexport const AxisCaption = /* @__PURE__ */ read(\"AxisCaption\")\nexport const AxisCaptionOverlay = /* @__PURE__ */ read(\"AxisCaptionOverlay\")\nexport const AxisGutter = /* @__PURE__ */ read(\"AxisGutter\")\nexport const BOTTOM_RIGHT_CONTROLS_ORDER = /* @__PURE__ */ read(\"BOTTOM_RIGHT_CONTROLS_ORDER\")\nexport const BottomRightCornerContext = /* @__PURE__ */ read(\"BottomRightCornerContext\")\nexport const COMPACT_AXIS_HEIGHT = /* @__PURE__ */ read(\"COMPACT_AXIS_HEIGHT\")\nexport const CrossHatchLines = /* @__PURE__ */ read(\"CrossHatchLines\")\nexport const CrossHatches = /* @__PURE__ */ read(\"CrossHatches\")\nexport const DEFAULT_RULE_COLOR = /* @__PURE__ */ read(\"DEFAULT_RULE_COLOR\")\nexport const DisplayChromeOverlayProvider = /* @__PURE__ */ read(\"DisplayChromeOverlayProvider\")\nexport const DisplayUIProvider = /* @__PURE__ */ read(\"DisplayUIProvider\")\nexport const FLOATING_LEGEND_RIGHT_PX = /* @__PURE__ */ read(\"FLOATING_LEGEND_RIGHT_PX\")\nexport const FLOATING_LEGEND_TOP_PX = /* @__PURE__ */ read(\"FLOATING_LEGEND_TOP_PX\")\nexport const FloatingLegend = /* @__PURE__ */ read(\"FloatingLegend\")\nexport const FloatingSvgOverlay = /* @__PURE__ */ read(\"FloatingSvgOverlay\")\nexport const FloatingText = /* @__PURE__ */ read(\"FloatingText\")\nexport const PointerLayer = /* @__PURE__ */ read(\"PointerLayer\")\nexport const SCORE_CAPTION_HEIGHT = /* @__PURE__ */ read(\"SCORE_CAPTION_HEIGHT\")\nexport const ScoreDomainCaption = /* @__PURE__ */ read(\"ScoreDomainCaption\")\nexport const ScoreRuleLines = /* @__PURE__ */ read(\"ScoreRuleLines\")\nexport const ScoreRules = /* @__PURE__ */ read(\"ScoreRules\")\nexport const SvgHaloText = /* @__PURE__ */ read(\"SvgHaloText\")\nexport const TEXT_BASELINE_RATIO = /* @__PURE__ */ read(\"TEXT_BASELINE_RATIO\")\nexport const Tooltip = /* @__PURE__ */ read(\"Tooltip\")\nexport const TrackControlProvider = /* @__PURE__ */ read(\"TrackControlProvider\")\nexport const TrackOverlayContext = /* @__PURE__ */ read(\"TrackOverlayContext\")\nexport const TrackOverlayPortal = /* @__PURE__ */ read(\"TrackOverlayPortal\")\nexport const TrackOverlaySlot = /* @__PURE__ */ read(\"TrackOverlaySlot\")\nexport const YSCALEBAR_LABEL_OFFSET = /* @__PURE__ */ read(\"YSCALEBAR_LABEL_OFFSET\")\nexport const YScaleBar = /* @__PURE__ */ read(\"YScaleBar\")\nexport const YScaleBarOverlay = /* @__PURE__ */ read(\"YScaleBarOverlay\")\nexport const axisDrawn = /* @__PURE__ */ read(\"axisDrawn\")\nexport const axisGutterLeft = /* @__PURE__ */ read(\"axisGutterLeft\")\nexport const axisGutterWidth = /* @__PURE__ */ read(\"axisGutterWidth\")\nexport const axisPlotBox = /* @__PURE__ */ read(\"axisPlotBox\")\nexport const clampStrokeInsideAxis = /* @__PURE__ */ read(\"clampStrokeInsideAxis\")\nexport const cullOverlappingLabels = /* @__PURE__ */ read(\"cullOverlappingLabels\")\nexport const formatScore = /* @__PURE__ */ read(\"formatScore\")\nexport const isLiveModel = /* @__PURE__ */ read(\"isLiveModel\")\nexport const leftAxisGutterWidth = /* @__PURE__ */ read(\"leftAxisGutterWidth\")\nexport const plainChromeOverlays = /* @__PURE__ */ read(\"plainChromeOverlays\")\nexport const plainTrackControl = /* @__PURE__ */ read(\"plainTrackControl\")\nexport const resolveOverlays = /* @__PURE__ */ read(\"resolveOverlays\")\nexport const scoreToAxisY = /* @__PURE__ */ read(\"scoreToAxisY\")\nexport const textHalo = /* @__PURE__ */ read(\"textHalo\")\nexport const tooLargeBannerText = /* @__PURE__ */ read(\"tooLargeBannerText\")\nexport const useChromeOverlayOverride = /* @__PURE__ */ read(\"useChromeOverlayOverride\")\nexport const useTooltip = /* @__PURE__ */ read(\"useTooltip\")\nexport const useTrackControlMenu = /* @__PURE__ */ read(\"useTrackControlMenu\")\nexport const useTrackControlOverride = /* @__PURE__ */ read(\"useTrackControlOverride\")\nexport default host && host.__esModule ? host.default : host", "import { useState } from 'react'\nimport type { CSSProperties, ReactNode } from 'react'\n\nimport DisplayBackgroundProgress from '@jbrowse/display-kit/DisplayBackgroundProgress'\nimport DisplayErrorBar from '@jbrowse/display-kit/DisplayErrorBar'\nimport DisplayLoadingOverlay from '@jbrowse/display-kit/DisplayLoadingOverlay'\nimport TooLargeMessage from '@jbrowse/display-kit/TooLargeMessage'\nimport {\n BottomRightCornerContext,\n TrackOverlayPortal,\n useChromeOverlayOverride,\n} from '@jbrowse/display-ui'\n\nimport type { LinearGraphDisplayModel } from '../model'\nimport type { DisplayStatusPhase } from '@jbrowse/render-core/displayPhase'\n\nconst muiOverlays = {\n TooLarge: TooLargeMessage,\n ErrorBar: DisplayErrorBar,\n Loading: DisplayLoadingOverlay,\n BackgroundProgress: DisplayBackgroundProgress,\n}\n\n/**\n * The status chrome of a display that owns its canvas: the zoom-in notice in\n * place of the display, and the error bar, loading overlay and progress chip\n * over it in the track's overlay layer. Core's `DisplayStatusChrome` drew this\n * until jbrowse-web main removed it on 2026-10-08 (d8db736896), and its named\n * import came back undefined there, failing the track with React error #130.\n * Built here from the overlays every host from 5.0.0-beta.11 serves.\n */\nexport default function GraphStatusChrome({\n model,\n phase,\n drawn,\n testid,\n style,\n children,\n ...dataProps\n}: {\n model: LinearGraphDisplayModel\n phase: DisplayStatusPhase\n drawn: boolean\n testid: string\n style?: CSSProperties\n children: ReactNode\n} & Record<`data-${string}`, unknown>) {\n const { TooLarge, ErrorBar, Loading, BackgroundProgress } =\n useChromeOverlayOverride() ?? muiOverlays\n const [corner, setCorner] = useState<HTMLDivElement | null>(null)\n const { displayId } = model.configuration\n if (phase === 'tooLarge') {\n return (\n <div\n style={{ display: 'contents' }}\n data-display-id={displayId}\n data-display-phase={phase}\n >\n <TrackOverlayPortal>\n <div style={{ pointerEvents: 'auto' }}>\n <TooLarge model={model} />\n </div>\n </TrackOverlayPortal>\n </div>\n )\n }\n return (\n <div\n {...dataProps}\n style={{ position: 'relative', height: model.height, ...style }}\n data-testid={testid}\n data-display-id={displayId}\n data-display-drawn={drawn}\n data-display-phase={phase}\n >\n <BottomRightCornerContext value={corner}>\n {children}\n </BottomRightCornerContext>\n <TrackOverlayPortal>\n <ErrorBar model={model} visible={phase === 'error'} />\n <Loading\n model={model}\n visible={phase === 'loading' || phase === 'canceled'}\n immediate={!drawn}\n />\n <div\n ref={setCorner}\n style={{\n position: 'absolute',\n bottom: 2,\n right: 2,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-end',\n gap: 4,\n pointerEvents: 'none',\n }}\n >\n <BackgroundProgress model={model} visible={phase === 'ready'} />\n </div>\n </TrackOverlayPortal>\n </div>\n )\n}\n", "import { observer } from 'mobx-react'\n\nimport GraphStatusChrome from './GraphStatusChrome'\nimport GraphCanvas from '../../GraphGenomeView/components/GraphCanvas'\n\nimport type { LinearGraphDisplayModel } from '../model'\n\nconst LinearGraphDisplay = observer(function LinearGraphDisplay({\n model,\n}: {\n model: LinearGraphDisplayModel\n}) {\n return (\n <GraphStatusChrome\n model={model}\n phase={model.displayPhase}\n drawn={model.painted && model.geometryPainted}\n testid=\"linear-graph-display\"\n data-layout={model.chosenLayoutMode}\n data-cut-tier={model.cutTier}\n data-recuts={model.recuts}\n data-node-count={model.hasGraph ? model.nodeCount : undefined}\n data-loading={model.isLoading ? '' : undefined}\n style={{\n width: model.paneWidth,\n height: model.height,\n overflow: 'hidden',\n }}\n >\n <GraphCanvas model={model} ownChrome={false} />\n </GraphStatusChrome>\n )\n})\n\nexport default LinearGraphDisplay\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["host", "DisplayBackgroundProgress_default", "host", "host", "DisplayErrorBar_default", "host", "host", "DisplayLoadingOverlay_default", "host", "host", "TooLargeMessage_default", "host", "host", "read", "name", "BottomRightCornerContext", "read", "TrackOverlayPortal", "read", "useChromeOverlayOverride", "read", "display_ui_default", "host", "muiOverlays", "TooLargeMessage_default", "DisplayErrorBar_default", "DisplayLoadingOverlay_default", "DisplayBackgroundProgress_default", "GraphStatusChrome", "model", "phase", "drawn", "testid", "style", "children", "dataProps", "TooLarge", "ErrorBar", "Loading", "BackgroundProgress", "useChromeOverlayOverride", "corner", "setCorner", "useState", "
|
|
4
|
+
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/display-kit/DisplayBackgroundProgress\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayBackgroundProgress\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/DisplayErrorBar\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayErrorBar\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/DisplayLoadingOverlay\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/DisplayLoadingOverlay\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-kit/TooLargeMessage\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-kit/TooLargeMessage\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport default host && host.__esModule ? host.default : host", "const host = JBrowseExports[\"@jbrowse/display-ui\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\n \"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/display-ui\" + \"' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\",\n )\n },\n { jbrowseHostMissing: name },\n )\nexport const AXIS_GUTTER_WIDTH_PX = /* @__PURE__ */ read(\"AXIS_GUTTER_WIDTH_PX\")\nexport const AXIS_RIGHT_INSET_PX = /* @__PURE__ */ read(\"AXIS_RIGHT_INSET_PX\")\nexport const AxisCaption = /* @__PURE__ */ read(\"AxisCaption\")\nexport const AxisCaptionOverlay = /* @__PURE__ */ read(\"AxisCaptionOverlay\")\nexport const AxisGutter = /* @__PURE__ */ read(\"AxisGutter\")\nexport const BOTTOM_RIGHT_CONTROLS_ORDER = /* @__PURE__ */ read(\"BOTTOM_RIGHT_CONTROLS_ORDER\")\nexport const BottomRightCornerContext = /* @__PURE__ */ read(\"BottomRightCornerContext\")\nexport const COMPACT_AXIS_HEIGHT = /* @__PURE__ */ read(\"COMPACT_AXIS_HEIGHT\")\nexport const CrossHatchLines = /* @__PURE__ */ read(\"CrossHatchLines\")\nexport const CrossHatches = /* @__PURE__ */ read(\"CrossHatches\")\nexport const DEFAULT_RULE_COLOR = /* @__PURE__ */ read(\"DEFAULT_RULE_COLOR\")\nexport const DisplayChromeOverlayProvider = /* @__PURE__ */ read(\"DisplayChromeOverlayProvider\")\nexport const DisplayUIProvider = /* @__PURE__ */ read(\"DisplayUIProvider\")\nexport const FLOATING_LEGEND_RIGHT_PX = /* @__PURE__ */ read(\"FLOATING_LEGEND_RIGHT_PX\")\nexport const FLOATING_LEGEND_TOP_PX = /* @__PURE__ */ read(\"FLOATING_LEGEND_TOP_PX\")\nexport const FloatingLegend = /* @__PURE__ */ read(\"FloatingLegend\")\nexport const FloatingSvgOverlay = /* @__PURE__ */ read(\"FloatingSvgOverlay\")\nexport const FloatingText = /* @__PURE__ */ read(\"FloatingText\")\nexport const PointerLayer = /* @__PURE__ */ read(\"PointerLayer\")\nexport const SCORE_CAPTION_HEIGHT = /* @__PURE__ */ read(\"SCORE_CAPTION_HEIGHT\")\nexport const ScoreDomainCaption = /* @__PURE__ */ read(\"ScoreDomainCaption\")\nexport const ScoreRuleLines = /* @__PURE__ */ read(\"ScoreRuleLines\")\nexport const ScoreRules = /* @__PURE__ */ read(\"ScoreRules\")\nexport const SvgHaloText = /* @__PURE__ */ read(\"SvgHaloText\")\nexport const TEXT_BASELINE_RATIO = /* @__PURE__ */ read(\"TEXT_BASELINE_RATIO\")\nexport const Tooltip = /* @__PURE__ */ read(\"Tooltip\")\nexport const TrackControlProvider = /* @__PURE__ */ read(\"TrackControlProvider\")\nexport const TrackOverlayContext = /* @__PURE__ */ read(\"TrackOverlayContext\")\nexport const TrackOverlayPortal = /* @__PURE__ */ read(\"TrackOverlayPortal\")\nexport const TrackOverlaySlot = /* @__PURE__ */ read(\"TrackOverlaySlot\")\nexport const YSCALEBAR_LABEL_OFFSET = /* @__PURE__ */ read(\"YSCALEBAR_LABEL_OFFSET\")\nexport const YScaleBar = /* @__PURE__ */ read(\"YScaleBar\")\nexport const YScaleBarOverlay = /* @__PURE__ */ read(\"YScaleBarOverlay\")\nexport const axisDrawn = /* @__PURE__ */ read(\"axisDrawn\")\nexport const axisGutterLeft = /* @__PURE__ */ read(\"axisGutterLeft\")\nexport const axisGutterWidth = /* @__PURE__ */ read(\"axisGutterWidth\")\nexport const axisPlotBox = /* @__PURE__ */ read(\"axisPlotBox\")\nexport const clampStrokeInsideAxis = /* @__PURE__ */ read(\"clampStrokeInsideAxis\")\nexport const cullOverlappingLabels = /* @__PURE__ */ read(\"cullOverlappingLabels\")\nexport const formatScore = /* @__PURE__ */ read(\"formatScore\")\nexport const isLiveModel = /* @__PURE__ */ read(\"isLiveModel\")\nexport const leftAxisGutterWidth = /* @__PURE__ */ read(\"leftAxisGutterWidth\")\nexport const plainChromeOverlays = /* @__PURE__ */ read(\"plainChromeOverlays\")\nexport const plainTrackControl = /* @__PURE__ */ read(\"plainTrackControl\")\nexport const resolveOverlays = /* @__PURE__ */ read(\"resolveOverlays\")\nexport const scoreToAxisY = /* @__PURE__ */ read(\"scoreToAxisY\")\nexport const textHalo = /* @__PURE__ */ read(\"textHalo\")\nexport const tooLargeBannerText = /* @__PURE__ */ read(\"tooLargeBannerText\")\nexport const useChromeOverlayOverride = /* @__PURE__ */ read(\"useChromeOverlayOverride\")\nexport const useTooltip = /* @__PURE__ */ read(\"useTooltip\")\nexport const useTrackControlMenu = /* @__PURE__ */ read(\"useTrackControlMenu\")\nexport const useTrackControlOverride = /* @__PURE__ */ read(\"useTrackControlOverride\")\nexport default host && host.__esModule ? host.default : host", "import { useState } from 'react'\nimport type { CSSProperties, ReactNode } from 'react'\n\nimport DisplayBackgroundProgress from '@jbrowse/display-kit/DisplayBackgroundProgress'\nimport DisplayErrorBar from '@jbrowse/display-kit/DisplayErrorBar'\nimport DisplayLoadingOverlay from '@jbrowse/display-kit/DisplayLoadingOverlay'\nimport TooLargeMessage from '@jbrowse/display-kit/TooLargeMessage'\nimport {\n BottomRightCornerContext,\n TrackOverlayPortal,\n useChromeOverlayOverride,\n} from '@jbrowse/display-ui'\n\nimport type { LinearGraphDisplayModel } from '../model'\nimport type { DisplayStatusPhase } from '@jbrowse/render-core/displayPhase'\n\nconst muiOverlays = {\n TooLarge: TooLargeMessage,\n ErrorBar: DisplayErrorBar,\n Loading: DisplayLoadingOverlay,\n BackgroundProgress: DisplayBackgroundProgress,\n}\n\n/**\n * The status chrome of a display that owns its canvas: the zoom-in notice in\n * place of the display, and the error bar, loading overlay and progress chip\n * over it in the track's overlay layer. Core's `DisplayStatusChrome` drew this\n * until jbrowse-web main removed it on 2026-10-08 (d8db736896), and its named\n * import came back undefined there, failing the track with React error #130.\n * Built here from the overlays every host from 5.0.0-beta.11 serves.\n */\nexport default function GraphStatusChrome({\n model,\n phase,\n drawn,\n testid,\n style,\n children,\n ...dataProps\n}: {\n model: LinearGraphDisplayModel\n phase: DisplayStatusPhase\n drawn: boolean\n testid: string\n style?: CSSProperties\n children: ReactNode\n} & Record<`data-${string}`, unknown>) {\n const { TooLarge, ErrorBar, Loading, BackgroundProgress } =\n useChromeOverlayOverride() ?? muiOverlays\n const [corner, setCorner] = useState<HTMLDivElement | null>(null)\n const attributes = {\n ...dataProps,\n 'data-testid': testid,\n 'data-display-id': model.configuration.displayId,\n 'data-display-drawn': drawn,\n 'data-display-phase': phase,\n }\n if (phase === 'tooLarge') {\n return (\n <div style={{ display: 'contents' }} {...attributes}>\n <TrackOverlayPortal>\n <div style={{ pointerEvents: 'auto' }}>\n <TooLarge model={model} />\n </div>\n </TrackOverlayPortal>\n </div>\n )\n }\n return (\n <div\n style={{ position: 'relative', height: model.height, ...style }}\n {...attributes}\n >\n <BottomRightCornerContext value={corner}>\n {children}\n </BottomRightCornerContext>\n <TrackOverlayPortal>\n <ErrorBar model={model} visible={phase === 'error'} />\n <Loading\n model={model}\n visible={phase === 'loading' || phase === 'canceled'}\n immediate={!drawn}\n />\n <div\n ref={setCorner}\n style={{\n position: 'absolute',\n bottom: 2,\n right: 2,\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'flex-end',\n gap: 4,\n pointerEvents: 'none',\n }}\n >\n <BackgroundProgress model={model} visible={phase === 'ready'} />\n </div>\n </TrackOverlayPortal>\n </div>\n )\n}\n", "import { observer } from 'mobx-react'\n\nimport GraphStatusChrome from './GraphStatusChrome'\nimport GraphCanvas from '../../GraphGenomeView/components/GraphCanvas'\n\nimport type { LinearGraphDisplayModel } from '../model'\n\nconst LinearGraphDisplay = observer(function LinearGraphDisplay({\n model,\n}: {\n model: LinearGraphDisplayModel\n}) {\n return (\n <GraphStatusChrome\n model={model}\n phase={model.displayPhase}\n drawn={model.painted && model.geometryPainted}\n testid=\"linear-graph-display\"\n data-layout={model.chosenLayoutMode}\n data-cut-tier={model.cutTier}\n data-recuts={model.recuts}\n data-node-count={model.hasGraph ? model.nodeCount : undefined}\n data-loading={model.isLoading ? '' : undefined}\n style={{\n width: model.paneWidth,\n height: model.height,\n overflow: 'hidden',\n }}\n >\n <GraphCanvas model={model} ownChrome={false} />\n </GraphStatusChrome>\n )\n})\n\nexport default LinearGraphDisplay\n"],
|
|
5
|
+
"mappings": "8nBAAA,IAAMA,EAAO,eAAe,gDAAgD,EAY5E,IAAOC,EAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECZxD,IAAMC,EAAO,eAAe,sCAAsC,EAYlE,IAAOC,EAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECZxD,IAAMC,EAAO,eAAe,4CAA4C,EAYxE,IAAOC,EAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECZxD,IAAMC,EAAO,eAAe,sCAAsC,EAYlE,IAAOC,EAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,ECZxD,IAAMC,EAAO,eAAe,qBAAqB,EAC3CC,EAAOC,GACXF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A,CACC,MAAOT,EACP,QAASC,IAAU,WAAaA,IAAU,WAC1C,UAAW,CAACC,EACd,EACAc,EAAC,OACC,IAAKH,EACL,MAAO,CACL,SAAU,WACV,OAAQ,EACR,MAAO,EACP,QAAS,OACT,cAAe,SACf,WAAY,WACZ,IAAK,EACL,cAAe,MACjB,EAEA,SAAAG,EAACN,EAAA,CAAmB,MAAOV,EAAO,QAASC,IAAU,QAAS,EAChE,GACF,GACF,CAEJ,CC9FA,IAAMmB,EAAqBC,EAAS,SAA4B,CAC9D,MAAAC,CACF,EAEG,CACD,OACEC,EAACC,EAAA,CACC,MAAOF,EACP,MAAOA,EAAM,aACb,MAAOA,EAAM,SAAWA,EAAM,gBAC9B,OAAO,uBACP,cAAaA,EAAM,iBACnB,gBAAeA,EAAM,QACrB,cAAaA,EAAM,OACnB,kBAAiBA,EAAM,SAAWA,EAAM,UAAY,OACpD,eAAcA,EAAM,UAAY,GAAK,OACrC,MAAO,CACL,MAAOA,EAAM,UACb,OAAQA,EAAM,OACd,SAAU,QACZ,EAEA,SAAAC,EAACE,EAAA,CAAY,MAAOH,EAAO,UAAW,GAAO,EAC/C,CAEJ,CAAC,EAEMI,EAAQN",
|
|
6
|
+
"names": ["host", "DisplayBackgroundProgress_default", "host", "host", "DisplayErrorBar_default", "host", "host", "DisplayLoadingOverlay_default", "host", "host", "TooLargeMessage_default", "host", "host", "read", "name", "BottomRightCornerContext", "read", "TrackOverlayPortal", "read", "useChromeOverlayOverride", "read", "display_ui_default", "host", "muiOverlays", "TooLargeMessage_default", "DisplayErrorBar_default", "DisplayLoadingOverlay_default", "DisplayBackgroundProgress_default", "GraphStatusChrome", "model", "phase", "drawn", "testid", "style", "children", "dataProps", "TooLarge", "ErrorBar", "Loading", "BackgroundProgress", "useChromeOverlayOverride", "corner", "setCorner", "useState", "attributes", "jsx", "TrackOverlayPortal", "jsxs", "BottomRightCornerContext", "LinearGraphDisplay", "observer", "model", "jsx", "GraphStatusChrome", "GraphCanvas_default", "LinearGraphDisplay_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as d}from"./chunk-U6CKN6LS.js";import{a as g,d as f,f as c}from"./chunk-TOT4S3TG.js";import{a as u}from"./chunk-KOB7YIMR.js";import{b,f as p,g as m}from"./chunk-ECZOKJYP.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import"./chunk-OUN4BNWJ.js";import"./chunk-OGQ6OQDN.js";import"./chunk-NDRLCGPC.js";import{a as i,o as l}from"./chunk-TENPGIPX.js";var r=class extends b{static{this.capabilities=["getFeatures","getRefNames"]}constructor(t,a,s){super(t,a,s),this.bubbles=p(this,["bubblesLocation"],["index"]),this.refNames=new m(this.bubbles,this)}async getRefNames(t={}){return this.refNames.assemblyRefNames(t)}async hasDataForRefName(){return!0}getFeatures(t,a={}){let{signal:s,statusCallback:h}=a;return u(async o=>{let n=await this.refNames.resolve(t,a);n!==void 0&&await l("Downloading bubbles",h,()=>d(this.bubbles,n,t.start,t.end,{signal:s,lineCallback:(A,y)=>{let e=g(A);o.next(new i({uniqueId:`bubble-${y}`,refName:t.refName,start:e.start,end:e.end,name:f(e),description:c(e),type:"bubble",score:e.segmentCount,segmentCount:e.segmentCount,pathCount:e.pathCount,inversion:e.inversion,shortestAlleleLength:e.shortestAlleleLength,longestAlleleLength:e.longestAlleleLength,segments:e.segments,shortestAllele:e.shortestAllele,longestAllele:e.longestAllele}))}})),o.complete()},s)}};export{r as default};
|
|
2
|
+
//# sourceMappingURL=MinigraphBubbleAdapter-DPRKYY5Y.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/MinigraphBubbleAdapter/MinigraphBubbleAdapter.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n bubbleDescription,\n bubbleLabel,\n parseBubbleLine,\n} from '@jbrowse/bandage-core/bubbles/bubbleLine'\nimport { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { SimpleFeature, updateStatus } from '@jbrowse/core/util'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\n\nimport { PanSNRefNames, openTabixSlot } from '../panSNTabix.ts'\nimport { getLines } from '../tabixRange.ts'\n\nimport type { MinigraphBubbleAdapterConfig } from './configSchema.ts'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache'\nimport type { Feature } from '@jbrowse/core/util'\nimport type { Region } from '@jbrowse/core/util/types'\n\nexport default class MinigraphBubbleAdapter extends BaseFeatureDataAdapter<MinigraphBubbleAdapterConfig> {\n public static capabilities = ['getFeatures', 'getRefNames']\n\n private readonly bubbles\n // `gfatools bubble` names each row after the graph's stable sequence, so a\n // Minigraph-Cactus graph produces PanSN rows (`GRCh38#0#chr6`) where a plain\n // minigraph graph produces bare ones (`chr6`). Same resolution the segment\n // adapter does, through the same `assemblyNameToPanSN` slot.\n private readonly refNames\n\n public constructor(\n config: MinigraphBubbleAdapterConfig,\n getSubAdapter?: getSubAdapterType,\n pluginManager?: PluginManager,\n ) {\n super(config, getSubAdapter, pluginManager)\n this.bubbles = openTabixSlot(this, ['bubblesLocation'], ['index'])\n this.refNames = new PanSNRefNames(this.bubbles, this)\n }\n\n async getRefNames(opts: BaseOptions = {}) {\n return this.refNames.assemblyRefNames(opts)\n }\n\n public async hasDataForRefName() {\n return true\n }\n\n getFeatures(query: Region, opts: BaseOptions = {}) {\n const { signal, statusCallback } = opts\n return ObservableCreate<Feature>(async observer => {\n const tabixRefName = await this.refNames.resolve(query, opts)\n if (tabixRefName !== undefined) {\n await updateStatus('Downloading bubbles', statusCallback, () =>\n getLines(this.bubbles, tabixRefName, query.start, query.end, {\n signal,\n lineCallback: (line, fileOffset) => {\n const bubble = parseBubbleLine(line)\n observer.next(\n new SimpleFeature({\n uniqueId: `bubble-${fileOffset}`,\n refName: query.refName,\n start: bubble.start,\n end: bubble.end,\n // How variable this spot is, in two words, since that is the\n // whole point of the track.\n name: bubbleLabel(bubble),\n description: bubbleDescription(bubble),\n type: 'bubble',\n score: bubble.segmentCount,\n segmentCount: bubble.segmentCount,\n pathCount: bubble.pathCount,\n inversion: bubble.inversion,\n shortestAlleleLength: bubble.shortestAlleleLength,\n longestAlleleLength: bubble.longestAlleleLength,\n segments: bubble.segments,\n shortestAllele: bubble.shortestAllele,\n longestAllele: bubble.longestAllele,\n }),\n )\n },\n }),\n )\n }\n observer.complete()\n }, signal)\n }\n}\n"],
|
|
5
|
+
"mappings": "kXAmBA,IAAqBA,EAArB,cAAoDC,CAAqD,CACvG,YAAc,aAAe,CAAC,cAAe,aAAa,EASnD,YACLC,EACAC,EACAC,EACA,CACA,MAAMF,EAAQC,EAAeC,CAAa,EAC1C,KAAK,QAAUC,EAAc,KAAM,CAAC,iBAAiB,EAAG,CAAC,OAAO,CAAC,EACjE,KAAK,SAAW,IAAIC,EAAc,KAAK,QAAS,IAAI,CACtD,CAEA,MAAM,YAAYC,EAAoB,CAAC,EAAG,CACxC,OAAO,KAAK,SAAS,iBAAiBA,CAAI,CAC5C,CAEA,MAAa,mBAAoB,CAC/B,MAAO,EACT,CAEA,YAAYC,EAAeD,EAAoB,CAAC,EAAG,CACjD,GAAM,CAAE,OAAAE,EAAQ,eAAAC,CAAe,EAAIH,EACnC,OAAOI,EAA0B,MAAMC,GAAY,CACjD,IAAMC,EAAe,MAAM,KAAK,SAAS,QAAQL,EAAOD,CAAI,EACxDM,IAAiB,QACnB,MAAMC,EAAa,sBAAuBJ,EAAgB,IACxDK,EAAS,KAAK,QAASF,EAAcL,EAAM,MAAOA,EAAM,IAAK,CAC3D,OAAAC,EACA,aAAc,CAACO,EAAMC,IAAe,CAClC,IAAMC,EAASC,EAAgBH,CAAI,EACnCJ,EAAS,KACP,IAAIQ,EAAc,CAChB,SAAU,UAAUH,CAAU,GAC9B,QAAST,EAAM,QACf,MAAOU,EAAO,MACd,IAAKA,EAAO,IAGZ,KAAMG,EAAYH,CAAM,EACxB,YAAaI,EAAkBJ,CAAM,EACrC,KAAM,SACN,MAAOA,EAAO,aACd,aAAcA,EAAO,aACrB,UAAWA,EAAO,UAClB,UAAWA,EAAO,UAClB,qBAAsBA,EAAO,qBAC7B,oBAAqBA,EAAO,oBAC5B,SAAUA,EAAO,SACjB,eAAgBA,EAAO,eACvB,cAAeA,EAAO,aACxB,CAAC,CACH,CACF,CACF,CAAC,CACH,EAEFN,EAAS,SAAS,CACpB,EAAGH,CAAM,CACX,CACF",
|
|
6
|
+
"names": ["MinigraphBubbleAdapter", "BaseFeatureDataAdapter", "config", "getSubAdapter", "pluginManager", "openTabixSlot", "PanSNRefNames", "opts", "query", "signal", "statusCallback", "ObservableCreate", "observer", "tabixRefName", "updateStatus", "getLines", "line", "fileOffset", "bubble", "parseBubbleLine", "SimpleFeature", "bubbleLabel", "bubbleDescription"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as P,c as v,d as O}from"./chunk-KJOBOE4W.js";import{b as h}from"./chunk-U6CKN6LS.js";import{a as T}from"./chunk-KOB7YIMR.js";import"./chunk-Q5PP7UMC.js";import"./chunk-G57N55FV.js";import"./chunk-HW4LIGPA.js";import{b as A,f as b,g as B}from"./chunk-ECZOKJYP.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import{f as I}from"./chunk-OUN4BNWJ.js";import{b as M}from"./chunk-5OI6LO4I.js";import"./chunk-OGQ6OQDN.js";import"./chunk-NDRLCGPC.js";import{a as L,o as y}from"./chunk-TENPGIPX.js";function C(i){let e=i.split(" "),n=e.length>=8,s=n?5:0;return{anchored:n,segment:{refName:e[s],start:+e[s+1],end:+e[s+2],id:e[3],rank:+e[4],tags:e[n?8:5]??""}}}function Z(i){let e=i.tags.split(" ").find(s=>s.startsWith("SM:Z:"));if(e===void 0)return;let n=e.slice(5).split(",").map(s=>s.trim()).filter(Boolean);return n.length>0?n:void 0}function j(i){return{id:i.slice(0,-1),strand:i.slice(-1)}}function x(i){let e=i.split(" "),n=j(e[3]),s=j(e[4]);return{source:n.id,sourceStrand:n.strand,target:s.id,targetStrand:s.strand,sourceSegment:{id:n.id,refName:e[5],start:+e[6],end:+e[7],rank:+e[8],tags:e[13]??""},targetSegment:{id:s.id,refName:e[9],start:+e[10],end:+e[11],rank:+e[12],tags:e[14]??""}}}function k(i){return`${i.source}${i.sourceStrand}${i.target}${i.targetStrand}`}function W(i,e,n){let s=a=>a.rank!==0||a.refName!==n.refName?0:a.end<=n.start?-1:a.start>=n.end?1:0,t=new Map(i),r=new Map;for(let a of e)if(i.has(a.source)||i.has(a.target)||s(a.sourceSegment)*s(a.targetSegment)===-1){r.set(k(a),a);for(let f of[a.sourceSegment,a.targetSegment])t.has(f.id)||t.set(f.id,f)}for(let a of e)t.has(a.source)&&t.has(a.target)&&r.set(k(a),a);return{segments:t,links:r}}function D(i,e,n){let s=t=>t.refName!==n.refName||t.end<=n.start||t.start>=n.end;return[...G(i.filter(t=>t.rank>0),e,n.end-n.start),...G(i.filter(t=>t.rank===0&&s(t)),new Set(i.map(t=>t.id)),0)]}function G(i,e,n){let s=[...i].sort((r,a)=>w(r.refName,a.refName)||r.start-a.start),t=[];for(let r of s){let a=t.at(-1);a?.refName===r.refName&&r.start-a.end<=n?(a.needed||=r.start>a.end||e.has(r.id),a.end=Math.max(a.end,r.end)):t.push({refName:r.refName,start:r.start,end:r.end,needed:e.has(r.id)})}return t.filter(r=>r.needed).map(({refName:r,start:a,end:f})=>({refName:r,start:a,end:f}))}function H(i,e,n){let s=t=>e.has(t.id)||n.some(r=>r.refName===t.refName&&t.start>=r.start&&t.end<=r.end);return i.filter(t=>s(t.sourceSegment)&&s(t.targetSegment))}var E=/^[A-Za-z][A-Za-z0-9]:[AifZJHB]:/;function K(i){let{id:e,refName:n,start:s,end:t,rank:r,tags:a}=i,f=a.split(" ").filter(p=>E.test(p)),l=f.length===0?"":` ${f.join(" ")}`;return`S ${e} * LN:i:${t-s} SN:Z:${n} SO:i:${s} SR:i:${r}${l}`}function J(i){let{source:e,sourceStrand:n,target:s,targetStrand:t}=i;return`L ${e} ${n} ${s} ${t} 0M`}function w(i,e){return i<e?-1:i>e?1:0}function $(i,e){let n=[...i.values()].sort((t,r)=>w(t.refName,r.refName)||t.start-r.start||w(t.id,r.id)),s=[...e.keys()].sort((t,r)=>w(t,r));return["H VN:Z:1.0",...n.map(t=>K(t)),...s.map(t=>J(e.get(t)))].join(`
|
|
2
|
+
`)}function _(i){return i.filter(e=>e.rank>0)}var F=class extends A{static{this.capabilities=["getFeatures","getRefNames"]}constructor(e,n,s){super(e,n,s),this.fine=this.openIndex([])}openIndex(e){let n=b(this,[...e,"segmentsLocation"],[...e,"segmentsIndex"]),s=this.getConf("walksLocation"),t=e.length===0&&M(s),r=b(this,[...e,"linksLocation"],[...e,"linksIndex"]),a=t?b(this,["walksLocation"],["walksIndex"]):void 0;return{segments:n,links:r,walkFile:a,walks:a?new v({walks:a,nodes:n,links:r},this.getConf("walkChunk")):void 0,refNames:new B(a??n,this)}}async getHaplotypeNames(e={}){let n=await this.fine.walks?.header(e);return n?.haplotypes.length?n.haplotypes:void 0}index(e="fine"){return e==="fine"?this.fine:(this.coarse??=this.openIndex(["coarse"]),this.coarse)}async getRefNames(e={}){return this.fine.refNames.assemblyRefNames(e)}async hasDataForRefName(){return!0}getFeatures(e,n={}){let{signal:s,statusCallback:t}=n;return T(async r=>{let a=await this.fine.refNames.resolve(e,n);if(a!==void 0){let{walks:f,walkFile:l}=this.fine,p=f?await f.queryStart(e.start,n):e.start;if(l&&(await f?.header(n))?.format===2){let S=[];await y("Downloading walks",t,()=>h(l,a,p,e.end,{signal:s,lineCallback:g=>{let o=g.split(" ");o[3]==="ref"&&S.push(o)}}));let d=new Set;for(let g of P(S))if(g.refName===a&&g.end>e.start&&!d.has(g.id)){d.add(g.id);let o=String(g.id);r.next(new L({uniqueId:o,refName:e.refName,start:g.start,end:g.end,name:o,type:"segment",rank:0,stableName:g.refName}))}r.complete();return}await y("Downloading segments",t,()=>h(this.fine.segments,a,p,e.end,{signal:s,lineCallback:S=>{let{segment:d,anchored:g}=C(S);if(g&&d.refName!==a||d.end<=e.start)return;let o=Z(d);r.next(new L({uniqueId:d.id,refName:e.refName,start:d.start,end:d.end,name:d.id,type:"segment",rank:d.rank,stableName:d.refName,...o&&{samples:o,sampleCount:o.length}}))}}))}r.complete()},s)}async getSubgraph(e,n={}){let{hops:s=0,signal:t,tier:r}=n,a=this.index(r),f=new Map,l=new Map,p=await a.refNames.resolve(e,{signal:t}),S=async(o,c,m)=>{let u=[];return await h(a.links,o,c,m,{signal:t,lineCallback:z=>{let N=x(z);l.set(k(N),N);for(let R of[N.sourceSegment,N.targetSegment])f.has(R.id)||(f.set(R.id,R),u.push(R))}}),u};if(p===void 0)throw new Error(`${e.assemblyName} ${e.refName} is not in this graph's index; a graph with PanSN names (GRCh38#0#chr1) needs ${e.assemblyName} mapped to its prefix in assemblyNameToPanSN`);if(a.walks)return O(a.walks,p,e,{signal:t,prefixes:n.haplotypes?.map(o=>I(this,o)),walkRows:n.walkRows,stepBudget:this.getConf("walkStepBudget"),byteBudget:this.getConf("walkByteBudget")});let d={anchored:!1};if(await h(a.segments,p,e.start,e.end,{signal:t,lineCallback:o=>{let c=C(o);d.anchored||=c.anchored,f.set(c.segment.id,c.segment)}}),d.anchored){let o=[];await h(a.links,p,e.start,e.end,{signal:t,lineCallback:m=>{o.push(x(m))}});let c=W(f,o,{refName:p,start:e.start,end:e.end});return $(c.segments,c.links)}let g=_(await S(p,e.start,e.end));for(let o=0;o<s;o++){let c=await Promise.all(g.map(m=>S(m.refName,m.start,m.end)));g=_(c.flat())}if(s>0){let o=D([...f.values()],new Set(g.map(m=>m.id)),{refName:p,start:e.start,end:e.end}),c=[];await Promise.all(o.map(m=>h(a.links,m.refName,m.start,m.end,{signal:t,lineCallback:u=>{c.push(x(u))}})));for(let m of H(c,f,o)){l.set(k(m),m);for(let u of[m.sourceSegment,m.targetSegment])f.has(u.id)||f.set(u.id,u)}}return $(f,l)}};export{F as default};
|
|
3
|
+
//# sourceMappingURL=RgfaTabixAdapter-DRAJSERI.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/RgfaTabixAdapter/rgfaBed.ts", "../../src/RgfaTabixAdapter/RgfaTabixAdapter.ts"],
|
|
4
|
+
"sourcesContent": ["// A segment as it appears in segs.bed.gz, and as it is repeated inside every\n// links.bed.gz row: `stableName start end segmentId rank [tags]`. The first\n// five are the SN/SO/SR tags rGFA already carries, projected to BED by\n// `gfatools gfa2bed -m`.\n//\n// `tags` is a space-separated list of GFA tags, written verbatim onto the\n// S-line formatSegment synthesizes, where the GFA parser reads them into\n// `GraphNode.tags` with no work here. It is the extension point for everything\n// the five columns cannot say: carriage on a path-derived graph (`SM:Z:`), the\n// collapse summary on a level-of-detail tier (`ct:Z:`, `cn:i:`, ...), a\n// precomputed layout position later. rGFA files have no sixth column at all,\n// so this is empty for them and nothing changes.\nexport interface RgfaSegment {\n refName: string\n start: number\n end: number\n id: string\n rank: number\n tags: string\n}\n\nexport interface RgfaLink {\n source: string\n sourceStrand: string\n target: string\n targetStrand: string\n sourceSegment: RgfaSegment\n targetSegment: RgfaSegment\n}\n\nexport function parseSegmentLine(line: string): RgfaSegment {\n return parseSegmentRow(line).segment\n}\n\n// gfa-to-tabix's anchored layout files a segment under the reference interval\n// its bubble hangs from and states the segment's own coordinate after the rank:\n// `anchorName anchorStart anchorEnd segmentId rank stableName start end [tags]`.\n// One query over a region then returns every segment of every bubble under it,\n// and `anchored` tells a cut it has nothing left to follow.\nexport function parseSegmentRow(line: string) {\n const cols = line.split('\\t')\n const anchored = cols.length >= 8\n const own = anchored ? 5 : 0\n return {\n anchored,\n segment: {\n refName: cols[own]!,\n start: +cols[own + 1]!,\n end: +cols[own + 2]!,\n id: cols[3]!,\n rank: +cols[4]!,\n tags: cols[anchored ? 8 : 5] ?? '',\n } satisfies RgfaSegment,\n }\n}\n\n// Carriage as an ordinary feature attribute, for the linear track rather than\n// the graph. The tag column reaches the graph view through the synthesized\n// S-line (formatSegment below, then gfaConverter reads SM into\n// `GraphNode.samples`), and that route ends at the graph: `getFeatures` builds\n// its own features and had no way to say who carries a segment, so a lane\n// colored by carriage was not expressible.\n//\n// `SM:Z:` is its own grammar check here. build_pggb_tabix.sh wrote a bare\n// comma-separated list in this column before the tag column existed, and those\n// files are still hosted; a bare list has no prefix to match, so it is dropped\n// rather than read as one sample named `K12,Sakai,CFT073`.\n//\n// Undefined rather than [] when the tag is absent, matching gfaConverter: an\n// rGFA has no sixth column at all, so a segment that says nothing about\n// carriage stays distinguishable from one carried by nobody.\nexport function segmentSamples(segment: RgfaSegment) {\n const tag = segment.tags.split(' ').find(t => t.startsWith('SM:Z:'))\n if (tag === undefined) {\n return undefined\n }\n const samples = tag\n .slice('SM:Z:'.length)\n .split(',')\n .map(s => s.trim())\n .filter(Boolean)\n return samples.length > 0 ? samples : undefined\n}\n\n// `s322+` \u2014 the L-line's segment id with its orientation appended, mirroring\n// the GFA record it came from.\nfunction parseEndpoint(field: string) {\n return { id: field.slice(0, -1), strand: field.slice(-1) }\n}\n\nexport function parseLinkLine(line: string): RgfaLink {\n const cols = line.split('\\t')\n const source = parseEndpoint(cols[3]!)\n const target = parseEndpoint(cols[4]!)\n return {\n source: source.id,\n sourceStrand: source.strand,\n target: target.id,\n targetStrand: target.strand,\n sourceSegment: {\n id: source.id,\n refName: cols[5]!,\n start: +cols[6]!,\n end: +cols[7]!,\n rank: +cols[8]!,\n tags: cols[13] ?? '',\n },\n targetSegment: {\n id: target.id,\n refName: cols[9]!,\n start: +cols[10]!,\n end: +cols[11]!,\n rank: +cols[12]!,\n tags: cols[14] ?? '',\n },\n }\n}\n\nexport function linkKey(link: RgfaLink) {\n return `${link.source}${link.sourceStrand}${link.target}${link.targetStrand}`\n}\n\n// The cut an anchored index gives: `under` is what the segment file returned\n// for the window, every segment of every bubble under it, and `found` is what\n// the link file returned. gfa-to-tabix files a link widely enough that `found`\n// holds every link touching a segment in `under` and every link between the\n// segments those lead to, plus links of neither kind, which are dropped here.\n// A backbone link that jumps the whole window, as a deletion or inversion\n// spanning it does, touches nothing in `under` and is kept by its own rule.\nexport function anchoredCut(\n under: Map<string, RgfaSegment>,\n found: RgfaLink[],\n window: StableSpan,\n) {\n const side = (segment: RgfaSegment) =>\n segment.rank !== 0 || segment.refName !== window.refName\n ? 0\n : segment.end <= window.start\n ? -1\n : segment.start >= window.end\n ? 1\n : 0\n const segments = new Map(under)\n const links = new Map<string, RgfaLink>()\n for (const link of found) {\n if (\n under.has(link.source) ||\n under.has(link.target) ||\n side(link.sourceSegment) * side(link.targetSegment) === -1\n ) {\n links.set(linkKey(link), link)\n for (const segment of [link.sourceSegment, link.targetSegment]) {\n if (!segments.has(segment.id)) {\n segments.set(segment.id, segment)\n }\n }\n }\n }\n for (const link of found) {\n if (segments.has(link.source) && segments.has(link.target)) {\n links.set(linkKey(link), link)\n }\n }\n return { segments, links }\n}\n\n// Both endpoints of a link are written into every row, so the same link is\n// indexed under each endpoint's stable sequence and arrives twice for a region\n// covering both. Callers dedupe on linkKey.\n\nexport interface StableSpan {\n refName: string\n start: number\n end: number\n}\n\n// Where a cut reads links once more to close itself. A hop reads the links of\n// the segments the round before it reached, so a link between two segments of\n// the last round is never read and an allele reached from both ends draws as\n// two stubs. rGFA lays an allele out as one stretch of the stable sequence that\n// introduced it, so pieces of one sequence within the window's length of each\n// other merge into a span, and reading it brings the pieces between too.\n// Backbone reached past the window is unread for the same reason; its spans\n// join only abutting pieces, since the reference past the window is not the\n// cut's to fill. A span whose segments were all read and abut is skipped.\nexport function closingSpans(\n held: RgfaSegment[],\n unread: Set<string>,\n window: StableSpan,\n) {\n const outside = (segment: RgfaSegment) =>\n segment.refName !== window.refName ||\n segment.end <= window.start ||\n segment.start >= window.end\n return [\n ...mergedSpans(\n held.filter(segment => segment.rank > 0),\n unread,\n window.end - window.start,\n ),\n ...mergedSpans(\n held.filter(segment => segment.rank === 0 && outside(segment)),\n new Set(held.map(segment => segment.id)),\n 0,\n ),\n ]\n}\n\nfunction mergedSpans(\n segments: RgfaSegment[],\n unread: Set<string>,\n maxGap: number,\n) {\n const sorted = [...segments].sort(\n (a, b) => compare(a.refName, b.refName) || a.start - b.start,\n )\n const spans: (StableSpan & { needed: boolean })[] = []\n for (const segment of sorted) {\n const span = spans.at(-1)\n if (\n span?.refName === segment.refName &&\n segment.start - span.end <= maxGap\n ) {\n span.needed ||= segment.start > span.end || unread.has(segment.id)\n span.end = Math.max(span.end, segment.end)\n } else {\n spans.push({\n refName: segment.refName,\n start: segment.start,\n end: segment.end,\n needed: unread.has(segment.id),\n })\n }\n }\n return spans\n .filter(span => span.needed)\n .map(({ refName, start, end }): StableSpan => ({ refName, start, end }))\n}\n\n// The links a closing read keeps: each end is a segment the cut holds or one\n// lying inside a span. Following anything else is what another hop is for.\nexport function closingLinks(\n found: RgfaLink[],\n held: Map<string, RgfaSegment>,\n spans: StableSpan[],\n) {\n const inside = (segment: RgfaSegment) =>\n held.has(segment.id) ||\n spans.some(\n span =>\n span.refName === segment.refName &&\n segment.start >= span.start &&\n segment.end <= span.end,\n )\n return found.filter(\n link => inside(link.sourceSegment) && inside(link.targetSegment),\n )\n}\n\n// Segments carry no sequence here \u2014 the BED records only their span \u2014 so every\n// S-line is written with `*` and an LN tag, which is what the GFA spec asks for\n// and what packages/graph-core's parser reads back as the node length.\n// `NM:i:0`, `SM:Z:HG002.1,HG002.2` \u2014 the GFA tag grammar, checked rather than\n// trusted. Files built before the tag column existed put a bare comma-separated\n// sample list here, and passing that through would put a field that is not a\n// tag on an S-line, which is a malformed GFA rather than a missing annotation.\n// Dropping it degrades to the pre-tag behaviour instead.\nconst GFA_TAG = /^[A-Za-z][A-Za-z0-9]:[AifZJHB]:/\n\nfunction formatSegment(segment: RgfaSegment) {\n const { id, refName, start, end, rank, tags } = segment\n const valid = tags.split(' ').filter(t => GFA_TAG.test(t))\n const extra = valid.length === 0 ? '' : `\\t${valid.join('\\t')}`\n return `S\\t${id}\\t*\\tLN:i:${end - start}\\tSN:Z:${refName}\\tSO:i:${start}\\tSR:i:${rank}${extra}`\n}\n\nfunction formatLink(link: RgfaLink) {\n const { source, sourceStrand, target, targetStrand } = link\n return `L\\t${source}\\t${sourceStrand}\\t${target}\\t${targetStrand}\\t0M`\n}\n\n// Codepoint order, not localeCompare: the byte-identical-output guarantee below\n// has to hold across locales.\nfunction compare(a: string, b: string) {\n return a < b ? -1 : a > b ? 1 : 0\n}\n\n// Deterministic ordering: the same region always produces byte-identical GFA,\n// so a layout computed from it is reproducible.\nexport function formatSubgraph(\n segments: Map<string, RgfaSegment>,\n links: Map<string, RgfaLink>,\n) {\n const sortedSegments = [...segments.values()].sort(\n (a, b) =>\n compare(a.refName, b.refName) || a.start - b.start || compare(a.id, b.id),\n )\n const sortedLinks = [...links.keys()].sort((a, b) => compare(a, b))\n return [\n 'H\\tVN:Z:1.0',\n ...sortedSegments.map(s => formatSegment(s)),\n ...sortedLinks.map(k => formatLink(links.get(k)!)),\n ].join('\\n')\n}\n", "import { resolvePanSNPrefix } from '@jbrowse/bandage-core/pansn'\nimport { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { SimpleFeature, updateStatus } from '@jbrowse/core/util'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\n\nimport { locationIsSet } from '../locationName.ts'\nimport { PanSNRefNames, openTabixSlot } from '../panSNTabix.ts'\nimport { getLines } from '../tabixRange.ts'\nimport {\n anchoredCut,\n closingLinks,\n closingSpans,\n formatSubgraph,\n linkKey,\n parseLinkLine,\n parseSegmentRow,\n segmentSamples,\n} from './rgfaBed.ts'\nimport { referenceNodes } from './walkFormat2.ts'\nimport { WalkReader, walkSubgraph } from './walkReader.ts'\n\nimport type { RgfaTabixAdapterConfig } from './configSchema.ts'\nimport type { SubgraphAdapterOptions, SubgraphTier } from '../GetSubgraph.ts'\nimport type { RgfaLink, RgfaSegment } from './rgfaBed.ts'\nimport type { WalkCut } from './walkRowRuns.ts'\nimport type { TabixIndexedFile } from '@gmod/tabix'\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport type { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache'\nimport type { Feature } from '@jbrowse/core/util'\nimport type { FileLocation, Region } from '@jbrowse/core/util/types'\n\n// What a hop follows: alleles, never the backbone. A rank-0 segment reached\n// through a link is flanking backbone, usually outside the window, so querying\n// its links walks the reference away from the region, brings back more backbone,\n// and closes nothing. Every segment that closes a bubble is an allele interior,\n// and an allele interior is rank > 0 in both index formats (rGFA's SR tag, and\n// pggb's rank 0-or-1 against the anchor path). Reached backbone still becomes a\n// node and its edge still draws; it is only not walked through.\n//\n// This is gfabase's rule, arrived at from the other end. `gfabase sub` expands\n// from a seed either to the whole connected component (`--connected`, which its\n// own README calls overkill) or with `--cutpoints 1`, which takes the biconnected\n// component by *stopping at cutpoints*, the segments every end-to-end walk of\n// the chromosome must traverse. In a reference-anchored pangenome the cutpoints\n// are the backbone, and rank is what the index already states about it, so\n// `rank > 0` is that stopping rule without a connectivity index to build. The\n// third tool is the same shape again: `gfatools view -R` maps the region onto its\n// precomputed bubble decomposition and returns whole overlapping bubbles\n// (gfa_query_by_reg), which is complete for the same reason. Bandage's own\n// `--distance` is a node-step radius, but Bandage holds the entire graph in\n// memory, so its scope is a drawing filter rather than a fetch strategy.\n//\n// Measured with this rule: the E. coli paa window converges at one hop (17\n// segments at 1 and at 2), so the cut closes and stays closed. HPRC's amylase\n// window keeps growing (63 at 0, 78 at 1, 92 at 2) because its alleles have\n// alleles, and wall-clock is flat across all three, since a hop's queries go out\n// together and the remote index dominates.\n//\n// The exact version, when a graph ships a bubble index beside its segments:\n// gfatools' bubble rows carry the member segment ids of every bubble, so the\n// bubbles overlapping the region state which segments a complete cut must\n// contain. That turns the hop count into a termination condition rather than a\n// setting, and MinigraphBubbleAdapter already parses those rows.\nfunction offReference(segments: RgfaSegment[]) {\n return segments.filter(segment => segment.rank > 0)\n}\n\ninterface GraphIndex {\n segments: TabixIndexedFile\n links: TabixIndexedFile\n walks?: WalkReader\n walkFile?: TabixIndexedFile\n refNames: PanSNRefNames\n}\n\nexport default class RgfaTabixAdapter extends BaseFeatureDataAdapter<RgfaTabixAdapterConfig> {\n public static capabilities = ['getFeatures', 'getRefNames']\n\n private readonly fine\n private coarse: GraphIndex | undefined\n\n public constructor(\n config: RgfaTabixAdapterConfig,\n getSubAdapter?: getSubAdapterType,\n pluginManager?: PluginManager,\n ) {\n super(config, getSubAdapter, pluginManager)\n this.fine = this.openIndex([])\n }\n\n // refNames off the SEGMENT index: it is the one that names every stable\n // sequence the graph is anchored to, where the link index only names those a\n // link touches. A walk-indexed graph's walk file names the same sequences,\n // and format 2 has no segment file.\n private openIndex(under: string[]): GraphIndex {\n const segments = openTabixSlot(\n this,\n [...under, 'segmentsLocation'],\n [...under, 'segmentsIndex'],\n )\n const walksLocation: FileLocation = this.getConf('walksLocation')\n const hasWalks = under.length === 0 && locationIsSet(walksLocation)\n const links = openTabixSlot(\n this,\n [...under, 'linksLocation'],\n [...under, 'linksIndex'],\n )\n const walkFile = hasWalks\n ? openTabixSlot(this, ['walksLocation'], ['walksIndex'])\n : undefined\n return {\n segments,\n links,\n walkFile,\n walks: walkFile\n ? new WalkReader(\n { walks: walkFile, nodes: segments, links },\n this.getConf('walkChunk'),\n )\n : undefined,\n refNames: new PanSNRefNames(walkFile ?? segments, this),\n }\n }\n\n /**\n * The haplotypes a walk-indexed graph's header names, `sample#haplotype`\n * in byte order, or undefined when it names none\n */\n async getHaplotypeNames(opts: BaseOptions = {}) {\n const header = await this.fine.walks?.header(opts)\n return header?.haplotypes.length ? header.haplotypes : undefined\n }\n\n private index(tier: SubgraphTier = 'fine') {\n if (tier === 'fine') {\n return this.fine\n }\n this.coarse ??= this.openIndex(['coarse'])\n return this.coarse\n }\n\n async getRefNames(opts: BaseOptions = {}) {\n return this.fine.refNames.assemblyRefNames(opts)\n }\n\n public async hasDataForRefName() {\n return true\n }\n\n getFeatures(query: Region, opts: BaseOptions = {}) {\n const { signal, statusCallback } = opts\n return ObservableCreate<Feature>(async observer => {\n const tabixRefName = await this.fine.refNames.resolve(query, opts)\n if (tabixRefName !== undefined) {\n // a walk-indexed node row names only its chunk's first base, and a\n // node crossing in from a chunk before is filed there\n const { walks, walkFile } = this.fine\n const start = walks\n ? await walks.queryStart(query.start, opts)\n : query.start\n if (walkFile && (await walks?.header(opts))?.format === 2) {\n // a format-2 graph's reference nodes are its ref rows' steps\n const refRows: string[][] = []\n await updateStatus('Downloading walks', statusCallback, () =>\n getLines(walkFile, tabixRefName, start, query.end, {\n signal,\n lineCallback: line => {\n const cols = line.split('\\t')\n if (cols[3] === 'ref') {\n refRows.push(cols)\n }\n },\n }),\n )\n // as format 1's node rows do, every node of the chunks read that\n // ends past the window's start\n const seen = new Set<number>()\n for (const node of referenceNodes(refRows)) {\n if (\n node.refName === tabixRefName &&\n node.end > query.start &&\n !seen.has(node.id)\n ) {\n seen.add(node.id)\n const id = String(node.id)\n observer.next(\n new SimpleFeature({\n uniqueId: id,\n refName: query.refName,\n start: node.start,\n end: node.end,\n name: id,\n type: 'segment',\n rank: 0,\n stableName: node.refName,\n }),\n )\n }\n }\n observer.complete()\n return\n }\n await updateStatus('Downloading segments', statusCallback, () =>\n getLines(this.fine.segments, tabixRefName, start, query.end, {\n signal,\n lineCallback: line => {\n const { segment, anchored } = parseSegmentRow(line)\n // An anchored index also returns the alleles under the region,\n // which lie on other stable sequences and have no place on this\n // one; a lookback chunk returns nodes ending before it\n if (\n (anchored && segment.refName !== tabixRefName) ||\n segment.end <= query.start\n ) {\n return\n }\n // `samples` lists the haplotypes whose paths visit the segment and\n // `sampleCount` counts them. A lane's color reads the count, and\n // a count in jexl would otherwise rely on `.length` resolving\n // through a member access on an array.\n const samples = segmentSamples(segment)\n observer.next(\n new SimpleFeature({\n uniqueId: segment.id,\n refName: query.refName,\n start: segment.start,\n end: segment.end,\n name: segment.id,\n type: 'segment',\n rank: segment.rank,\n stableName: segment.refName,\n ...(samples && { samples, sampleCount: samples.length }),\n }),\n )\n },\n }),\n )\n }\n observer.complete()\n }, signal)\n }\n\n // Extract the graph around a region for GraphGenomeView: GFA text, or a\n // walk-indexed graph's tables (walkSubgraph). The\n // region's own segments come from segs.bed.gz; links.bed.gz supplies the edges\n // incident to them *and* the coordinates of the segments on the other end,\n // which typically sit on a different stable sequence (a rank>0 bubble) and so\n // are not reachable by any coordinate query on this region.\n //\n // `hops` is extra rounds of link-following past the region's own segments\n // and their immediate neighbours, each costing one tabix query per\n // off-reference segment newly reached. After the last round, one more read\n // per stretch of stable sequence the cut holds closes it (closingSpans), so\n // an allele reached from both ends draws whole. The view asks for one hop; a\n // hopless cut stays as cheap as it was. `signal` goes to every one of those\n // queries, so a cut the view has replaced stops.\n // `tier: 'coarse'` reads the `coarse` pair instead, the same way.\n async getSubgraph(\n region: Region,\n opts: SubgraphAdapterOptions = {},\n ): Promise<string | WalkCut> {\n const { hops = 0, signal, tier } = opts\n const index = this.index(tier)\n const segments = new Map<string, RgfaSegment>()\n const links = new Map<string, RgfaLink>()\n const tabixRefName = await index.refNames.resolve(region, { signal })\n\n const addLinksOver = async (\n refName: string,\n start: number,\n end: number,\n ) => {\n const reached: RgfaSegment[] = []\n await getLines(index.links, refName, start, end, {\n signal,\n lineCallback: line => {\n const link = parseLinkLine(line)\n links.set(linkKey(link), link)\n for (const segment of [link.sourceSegment, link.targetSegment]) {\n if (!segments.has(segment.id)) {\n segments.set(segment.id, segment)\n reached.push(segment)\n }\n }\n },\n })\n return reached\n }\n\n if (tabixRefName === undefined) {\n throw new Error(\n `${region.assemblyName} ${region.refName} is not in this graph's index; a graph with PanSN names (GRCh38#0#chr1) needs ${region.assemblyName} mapped to its prefix in assemblyNameToPanSN`,\n )\n }\n if (index.walks) {\n return walkSubgraph(index.walks, tabixRefName, region, {\n signal,\n prefixes: opts.haplotypes?.map(lane => resolvePanSNPrefix(this, lane)),\n walkRows: opts.walkRows,\n stepBudget: this.getConf('walkStepBudget'),\n byteBudget: this.getConf('walkByteBudget'),\n })\n }\n const layout = { anchored: false }\n await getLines(index.segments, tabixRefName, region.start, region.end, {\n signal,\n lineCallback: line => {\n const row = parseSegmentRow(line)\n layout.anchored ||= row.anchored\n segments.set(row.segment.id, row.segment)\n },\n })\n // An anchored index files every allele and every link under the reference\n // interval its bubble hangs from, so one read of each file holds the whole\n // graph under the region and there is nothing to hop to or close.\n if (layout.anchored) {\n const found: RgfaLink[] = []\n await getLines(index.links, tabixRefName, region.start, region.end, {\n signal,\n lineCallback: line => {\n found.push(parseLinkLine(line))\n },\n })\n const cut = anchoredCut(segments, found, {\n refName: tabixRefName,\n start: region.start,\n end: region.end,\n })\n return formatSubgraph(cut.segments, cut.links)\n }\n let frontier = offReference(\n await addLinksOver(tabixRefName, region.start, region.end),\n )\n for (let hop = 0; hop < hops; hop++) {\n // One hop's queries are independent of each other, so they go out\n // together rather than one round-trip at a time. Their callbacks share\n // the segment and link maps, which is safe because only one of them runs\n // at a time, and the output is sorted at the end regardless of the order\n // they arrive in.\n const reached = await Promise.all(\n frontier.map(segment =>\n addLinksOver(segment.refName, segment.start, segment.end),\n ),\n )\n frontier = offReference(reached.flat())\n }\n if (hops > 0) {\n const spans = closingSpans(\n [...segments.values()],\n new Set(frontier.map(segment => segment.id)),\n { refName: tabixRefName, start: region.start, end: region.end },\n )\n const found: RgfaLink[] = []\n await Promise.all(\n spans.map(span =>\n getLines(index.links, span.refName, span.start, span.end, {\n signal,\n lineCallback: line => {\n found.push(parseLinkLine(line))\n },\n }),\n ),\n )\n for (const link of closingLinks(found, segments, spans)) {\n links.set(linkKey(link), link)\n for (const segment of [link.sourceSegment, link.targetSegment]) {\n if (!segments.has(segment.id)) {\n segments.set(segment.id, segment)\n }\n }\n }\n }\n\n return formatSubgraph(segments, links)\n }\n}\n"],
|
|
5
|
+
"mappings": "+fAuCO,SAASA,EAAgBC,EAAc,CAC5C,IAAMC,EAAOD,EAAK,MAAM,GAAI,EACtBE,EAAWD,EAAK,QAAU,EAC1BE,EAAMD,EAAW,EAAI,EAC3B,MAAO,CACL,SAAAA,EACA,QAAS,CACP,QAASD,EAAKE,CAAG,EACjB,MAAO,CAACF,EAAKE,EAAM,CAAC,EACpB,IAAK,CAACF,EAAKE,EAAM,CAAC,EAClB,GAAIF,EAAK,CAAC,EACV,KAAM,CAACA,EAAK,CAAC,EACb,KAAMA,EAAKC,EAAW,EAAI,CAAC,GAAK,EAClC,CACF,CACF,CAiBO,SAASE,EAAeC,EAAsB,CACnD,IAAMC,EAAMD,EAAQ,KAAK,MAAM,GAAG,EAAE,KAAKE,GAAKA,EAAE,WAAW,OAAO,CAAC,EACnE,GAAID,IAAQ,OACV,OAEF,IAAME,EAAUF,EACb,MAAM,CAAc,EACpB,MAAM,GAAG,EACT,IAAI,GAAK,EAAE,KAAK,CAAC,EACjB,OAAO,OAAO,EACjB,OAAOE,EAAQ,OAAS,EAAIA,EAAU,MACxC,CAIA,SAASC,EAAcC,EAAe,CACpC,MAAO,CAAE,GAAIA,EAAM,MAAM,EAAG,EAAE,EAAG,OAAQA,EAAM,MAAM,EAAE,CAAE,CAC3D,CAEO,SAASC,EAAcX,EAAwB,CACpD,IAAMC,EAAOD,EAAK,MAAM,GAAI,EACtBY,EAASH,EAAcR,EAAK,CAAC,CAAE,EAC/BY,EAASJ,EAAcR,EAAK,CAAC,CAAE,EACrC,MAAO,CACL,OAAQW,EAAO,GACf,aAAcA,EAAO,OACrB,OAAQC,EAAO,GACf,aAAcA,EAAO,OACrB,cAAe,CACb,GAAID,EAAO,GACX,QAASX,EAAK,CAAC,EACf,MAAO,CAACA,EAAK,CAAC,EACd,IAAK,CAACA,EAAK,CAAC,EACZ,KAAM,CAACA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EAAM,EAAGA,EAAMnB,EAAMmB,IAAO,CAMnC,IAAMd,EAAU,MAAM,QAAQ,IAC5Ba,EAAS,IAAI3D,GACX2C,EAAa3C,EAAQ,QAASA,EAAQ,MAAOA,EAAQ,GAAG,CAC1D,CACF,EACA2D,EAAW7D,EAAagD,EAAQ,KAAK,CAAC,CACxC,CACA,GAAIL,EAAO,EAAG,CACZ,IAAMoB,EAAQC,EACZ,CAAC,GAAG/D,EAAS,OAAO,CAAC,EACrB,IAAI,IAAI4D,EAAS,IAAI3D,GAAWA,EAAQ,EAAE,CAAC,EAC3C,CAAE,QAASuB,EAAc,MAAOiB,EAAO,MAAO,IAAKA,EAAO,GAAI,CAChE,EACMe,EAAoB,CAAC,EAC3B,MAAM,QAAQ,IACZM,EAAM,IAAIE,GACRnC,EAASc,EAAM,MAAOqB,EAAK,QAASA,EAAK,MAAOA,EAAK,IAAK,CACxD,OAAA5C,EACA,aAAcU,GAAQ,CACpB0B,EAAM,KAAKP,EAAcnB,CAAI,CAAC,CAChC,CACF,CAAC,CACH,CACF,EACA,QAAWkB,KAAQiB,EAAaT,EAAOxD,EAAU8D,CAAK,EAAG,CACvDlD,EAAM,IAAIsC,EAAQF,CAAI,EAAGA,CAAI,EAC7B,QAAW/C,IAAW,CAAC+C,EAAK,cAAeA,EAAK,aAAa,EACtDhD,EAAS,IAAIC,EAAQ,EAAE,GAC1BD,EAAS,IAAIC,EAAQ,GAAIA,CAAO,CAGtC,CACF,CAEA,OAAO0D,EAAe3D,EAAUY,CAAK,CACvC,CACF",
|
|
6
|
+
"names": ["parseSegmentRow", "line", "cols", "anchored", "own", "segmentSamples", "segment", "tag", "t", "samples", "parseEndpoint", "field", "parseLinkLine", "source", "target", "linkKey", "link", "anchoredCut", "under", "found", "window", "side", "segments", "links", "closingSpans", "held", "unread", "outside", "mergedSpans", "maxGap", "sorted", "a", "b", "compare", "spans", "span", "refName", "start", "end", "closingLinks", "inside", "GFA_TAG", "formatSegment", "id", "rank", "tags", "valid", "extra", "formatLink", "sourceStrand", "targetStrand", "formatSubgraph", "sortedSegments", "sortedLinks", "s", "k", "offReference", "segments", "segment", "RgfaTabixAdapter", "BaseFeatureDataAdapter", "config", "getSubAdapter", "pluginManager", "under", "openTabixSlot", "walksLocation", "hasWalks", "locationIsSet", "links", "walkFile", "WalkReader", "PanSNRefNames", "opts", "header", "tier", "query", "signal", "statusCallback", "ObservableCreate", "observer", "tabixRefName", "walks", "start", "refRows", "updateStatus", "getLines", "line", "cols", "seen", "node", "referenceNodes", "id", "SimpleFeature", "anchored", "parseSegmentRow", "samples", "segmentSamples", "region", "hops", "index", "addLinksOver", "refName", "end", "reached", "link", "parseLinkLine", "linkKey", "walkSubgraph", "lane", "resolvePanSNPrefix", "layout", "row", "found", "cut", "anchoredCut", "formatSubgraph", "frontier", "hop", "spans", "closingSpans", "span", "closingLinks"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as j,c as D,d as H}from"./chunk-KJOBOE4W.js";import"./chunk-U6CKN6LS.js";import{a as T,b as q,d as _,e as C}from"./chunk-RKOQVSZG.js";import{a as I}from"./chunk-KOB7YIMR.js";import{a as B,b as L,e as $}from"./chunk-Q5PP7UMC.js";import"./chunk-G57N55FV.js";import"./chunk-HW4LIGPA.js";import{f as P,g as v}from"./chunk-ECZOKJYP.js";import"./chunk-YBLNN5FU.js";import"./chunk-MVVXRZXV.js";import{a as x,c as F,d as S,e as A,f as N,g as W}from"./chunk-OUN4BNWJ.js";import"./chunk-E7J6SB5P.js";import"./chunk-7WIBGKBU.js";import"./chunk-OGQ6OQDN.js";import"./chunk-NDRLCGPC.js";import{o as R}from"./chunk-TENPGIPX.js";var Y=50;function Z(m){let e=[];for(let t=0;t<m.length;t++){let[r,s]=m[t],[a,n]=m[t+1]??[];s===n&&s<=Y&&(r==="I"&&a==="D"||r==="D"&&a==="I")?(e.push(["X",s]),t++):e.push([r,s])}return e}function ee(m){return m.map(([e,t])=>`${t}${e}`).join("")}function G(m){let e=new Map,t=a=>{let n=m.get(a),i=n===void 0?0:n.end-n.start,p=e.get(i);return p===void 0&&(p="N".repeat(i),e.set(i,p)),p},r=new Map,s=a=>{let n=r.get(a);return n===void 0&&(n=Array.from(a.ids,(i,p)=>2*i+a.rev[p]),r.set(a,n)),n};return(a,n)=>L({query:s(a),target:s(n),sequenceOf:t,bases:!1})}var te=100;function M(m,e,t){let r=m.at(-1);t>0&&(r?.[0]===e?r[1]+=t:m.push([e,t]))}function X(m){let e=s=>{let a=m.get(s>>1);return a===void 0?0:a.end-a.start},t=s=>{let a=new Float64Array(s.length+1);return s.forEach((n,i)=>{a[i+1]=a[i]+e(n)}),a},r=s=>Array.from(s.ids,(a,n)=>2*a+s.rev[n]);return(s,a)=>{let n=r(a),i=r(s),[p,y]=B(i,n,e),[h,l]=B(i.map(b=>b^1).reverse(),n,e),f=l>y,c=f?h:p,d=Math.max(y,l);if(d<te)return[];let u=t(n),o=t(i),g=b=>f?i.length-1-c[b][0]:c[b][0],w=[];c.forEach(([,b],k)=>{if(k>0){let[J,K]=[g(k-1),g(k)].sort((Q,V)=>Q-V);M(w,"I",o[K]-o[J+1]),M(w,"D",u[b]-u[c[k-1][1]+1])}M(w,"=",e(n[b]))});let[z,U]=[g(0),g(c.length-1)].sort((b,k)=>b-k);return[{queryStart:o[z],queryEnd:o[U+1],targetStart:u[c[0][1]],targetEnd:u[c.at(-1)[1]+1],strand:f?"-":"+",edits:w,sharedBases:d}]}}function O({chain:m,target:e,query:t,assemblyName:r,refName:s,mateAssemblyName:a}){let n=e.hapStart+m.targetStart,i=e.hapStart+m.targetEnd,p=t.hapStart+m.queryStart,y=t.hapStart+m.queryEnd,h=Z(m.edits),l=h.reduce((d,[u,o])=>d+(u==="="?o:0),0),f=h.reduce((d,[,u])=>d+u,0),c=`${e.name}:${n}-${i}|${t.name}:${p}-${y}`;return new T({uniqueId:c,assemblyName:r,refName:s,start:n,end:i,type:"match",strand:m.strand==="-"?-1:1,CIGAR:ee(h),syntenyId:c,identity:l/Math.max(f,1),numMatches:l,blockLen:f,mate:{refName:S(t.name),start:p,end:y,assemblyName:a}})}var ae=m=>F(m.name)??m.name,E=class extends q{constructor(e,t,r){super(e,t,r);let s=P(this,["walksLocation"],["walksIndex"]);this.reader=new D({walks:s,nodes:P(this,["nodesLocation"],["nodesIndex"]),links:P(this,["linksLocation"],["linksIndex"])},this.getConf("walkChunk")),this.refNames=new v(s,this)}get anchor(){let e=this.getConf("assemblyNames")[0];if(e===void 0)throw new Error("WalkTabixSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as");return e}async getHaplotypeNames(e={}){let{haplotypes:t}=await this.reader.header(e);return t.length>0?t:void 0}async getHeader(e={}){let{haplotypes:t,references:r}=await this.reader.header(e),{anchor:s}=this,a=N(this,s),n=W(this);return{hasCoarseTier:!1,anchorAssemblyName:s,referenceSamples:r,lanes:t.filter(i=>i!==a&&x(i)!==a).map(i=>({name:C(n,i),label:i,group:x(i)}))}}async getRefNames(e={}){let{assemblyName:t}=e;return t===void 0||t===this.anchor?this.refNames.assemblyRefNames({...e,assemblyName:this.anchor}):[]}budgets(){return{stepBudget:this.getConf("walkStepBudget"),byteBudget:this.getConf("walkByteBudget")}}async getSubgraph(e,t={}){let{signal:r,haplotypes:s,walkRows:a}=t,n=await this.refNames.resolve(e,{signal:r});if(n===void 0)throw new Error(`${e.assemblyName} ${e.refName} is not in this graph's index; the graph is cut on ${this.anchor}, mapped to its PanSN prefix in assemblyNameToPanSN`);return H(this.reader,n,e,{...this.budgets(),signal:r,prefixes:s?.map(i=>N(this,i)),walkRows:a})}async laneWalks(e,t,r,s,a){return R(a,s.statusCallback,()=>this.reader.cut(e,t,{...this.budgets(),signal:s.signal,keep:j(r,F(e)),links:!1}).catch(n=>{throw n instanceof $&&(n.message=n.message.replace("to see the graph","to see lanes")),n}))}async anchorFeatures(e,t,r){let s=r.haplotypes?.length?r.haplotypes.map(o=>N(this,o)):void 0,a=N(this,r.targetAssemblyName),n=a===void 0?s:s===void 0||s.some(o=>A(a,o)||A(o,a))?[a]:[];if(n?.length===0)return[];let{start:i,end:p}=t,{graph:y,fragments:h}=await this.laneWalks(e,t,n,r,`Reading walks ${t.refName}:${i.toLocaleString()}-${p.toLocaleString()}`),l=X(y.nodes),f=W(this),c=h.filter(o=>o.name===e),d=o=>n===void 0?0:n.findIndex(g=>A(o.name,g));return h.filter(o=>o.name!==e&&d(o)>=0).sort((o,g)=>d(o)-d(g)).flatMap(o=>c.flatMap(g=>l(o,g).map(w=>O({chain:w,target:g,query:o,assemblyName:t.assemblyName,refName:t.refName,mateAssemblyName:C(f,ae(o))}))))}async pairFeatures(e,t,r,s){let[a]=r,n=r.map(l=>({pair:l,featurePrefix:N(this,l.queryAssemblyName),matePrefix:N(this,l.targetAssemblyName)})),{graph:i,fragments:p}=await this.laneWalks(e,t,n.flatMap(l=>[l.featurePrefix,l.matePrefix]),s,r.length===1&&a?`Reading ${a.queryAssemblyName} against ${a.targetAssemblyName}`:`Reading ${r.length} lane pairs`),y=G(i.nodes),h=l=>p.filter(f=>A(f.name,l));return n.flatMap(({pair:l,featurePrefix:f,matePrefix:c})=>h(f).flatMap(d=>h(c).flatMap(u=>y(u,d).map(o=>O({chain:o,target:d,query:u,assemblyName:l.queryAssemblyName,refName:S(d.name),mateAssemblyName:l.targetAssemblyName})))))}getFeatures(e,t={}){return I(async r=>{let s=e.assemblyName===this.anchor?await this.refNames.resolve(e,t):void 0;if(s!==void 0){let a=_(t),n=a.length>0?await this.pairFeatures(s,e,a,t):await this.anchorFeatures(s,e,t);for(let i of n)r.next(i)}r.complete()},t.signal)}};export{E as default};
|
|
2
|
+
//# sourceMappingURL=WalkTabixSyntenyAdapter-PY4HXRFX.js.map
|