jbrowse-plugin-graphgenomeviewer 8.8.2 → 9.0.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/README.md +6 -6
- package/dist/chunks/{AddTrackWorkflow-FANMD3WB.js → AddTrackWorkflow-3PX4I4DX.js} +2 -2
- package/dist/chunks/{AddTrackWorkflow-FANMD3WB.js.map → AddTrackWorkflow-3PX4I4DX.js.map} +2 -2
- package/dist/chunks/{GbzBaseSyntenyAdapter-NAXISJUH.js → GbzBaseSyntenyAdapter-YUT5RT7G.js} +2 -2
- package/dist/chunks/{GbzBaseSyntenyAdapter-NAXISJUH.js.map → GbzBaseSyntenyAdapter-YUT5RT7G.js.map} +2 -2
- package/dist/chunks/{GraphGenomeView-PPOVN5LA.js → GraphGenomeView-XFKLX3VQ.js} +2 -2
- package/dist/chunks/{GraphTrackSettingsDialog-BRTDTVOJ.js → GraphTrackSettingsDialog-KOYYI2XH.js} +2 -2
- package/dist/chunks/{HighlightColorDialog-CGW7J3SK.js → HighlightColorDialog-F4IARMEO.js} +2 -2
- package/dist/chunks/LinearGraphDisplay-BZ44C6S3.js +2 -0
- package/dist/chunks/MinigraphBubbleAdapter-2KIWDIY7.js +2 -0
- package/dist/chunks/MinigraphBubbleAdapter-2KIWDIY7.js.map +7 -0
- package/dist/chunks/RgfaTabixAdapter-7QKNUHKX.js +2 -0
- package/dist/chunks/RgfaTabixAdapter-7QKNUHKX.js.map +7 -0
- package/dist/chunks/{TrackWarningsDialog-23WL6FPV.js → TrackWarningsDialog-V5YSUFRO.js} +1 -1
- package/dist/chunks/{TrackWarningsDialog-23WL6FPV.js.map → TrackWarningsDialog-V5YSUFRO.js.map} +1 -1
- package/dist/chunks/WalkFormsAdapter-5NDOULY6.js +2 -0
- package/dist/chunks/WalkFormsAdapter-5NDOULY6.js.map +7 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-KI7ESKKP.js +2 -0
- package/dist/chunks/WalkTabixSyntenyAdapter-KI7ESKKP.js.map +7 -0
- package/dist/chunks/{chunk-RS274NAD.js → chunk-3HSJ7SAT.js} +2 -2
- package/dist/chunks/{chunk-RS274NAD.js.map → chunk-3HSJ7SAT.js.map} +1 -1
- package/dist/chunks/chunk-42VF2CSA.js +4 -0
- package/dist/chunks/chunk-42VF2CSA.js.map +7 -0
- package/dist/chunks/{chunk-LFQFVYNY.js → chunk-47UWMS4O.js} +3 -3
- package/dist/chunks/chunk-47UWMS4O.js.map +7 -0
- package/dist/chunks/{chunk-MWQGJP3J.js → chunk-7PVPO366.js} +2 -2
- package/dist/chunks/{chunk-MWQGJP3J.js.map → chunk-7PVPO366.js.map} +1 -1
- package/dist/chunks/{chunk-SKB4GSET.js → chunk-AQSLN3RH.js} +2 -2
- package/dist/chunks/{chunk-SKB4GSET.js.map → chunk-AQSLN3RH.js.map} +1 -1
- package/dist/chunks/chunk-AXUXLPO3.js +6 -0
- package/dist/chunks/chunk-AXUXLPO3.js.map +7 -0
- package/dist/chunks/chunk-CJ4VON23.js +2 -0
- package/dist/chunks/chunk-CJ4VON23.js.map +7 -0
- package/dist/chunks/{chunk-AGUEPVOR.js → chunk-FQI75MV6.js} +1 -1
- package/dist/chunks/{chunk-AGUEPVOR.js.map → chunk-FQI75MV6.js.map} +1 -1
- package/dist/chunks/{chunk-FM4T47WH.js → chunk-HFBUC6GF.js} +2 -2
- package/dist/chunks/{chunk-FM4T47WH.js.map → chunk-HFBUC6GF.js.map} +1 -1
- package/dist/chunks/chunk-I2XBA4H7.js +9 -0
- package/dist/chunks/{chunk-EFXNCI7R.js.map → chunk-I2XBA4H7.js.map} +4 -4
- package/dist/chunks/chunk-KIURR66K.js +3 -0
- package/dist/chunks/chunk-KIURR66K.js.map +7 -0
- package/dist/chunks/{chunk-CHLLRNBQ.js → chunk-LQSOJR7D.js} +2 -2
- package/dist/chunks/{chunk-CHLLRNBQ.js.map → chunk-LQSOJR7D.js.map} +1 -1
- package/dist/chunks/chunk-M6YSANSW.js +2 -0
- package/dist/chunks/chunk-M6YSANSW.js.map +7 -0
- package/dist/chunks/{chunk-ZWHXVFZF.js → chunk-MPUAUZSJ.js} +1 -1
- package/dist/chunks/{chunk-ZWHXVFZF.js.map → chunk-MPUAUZSJ.js.map} +1 -1
- package/dist/chunks/{chunk-5HDIVUAZ.js → chunk-N4ZFGZDN.js} +2 -2
- package/dist/chunks/{chunk-5HDIVUAZ.js.map → chunk-N4ZFGZDN.js.map} +1 -1
- package/dist/chunks/{chunk-KBOVZ3GI.js → chunk-OSEQDKL3.js} +1 -1
- package/dist/chunks/{chunk-KBOVZ3GI.js.map → chunk-OSEQDKL3.js.map} +1 -1
- package/dist/chunks/{chunk-NSQ4VXKR.js → chunk-P76SUZFP.js} +3 -3
- package/dist/chunks/{chunk-NSQ4VXKR.js.map → chunk-P76SUZFP.js.map} +3 -3
- package/dist/chunks/{chunk-HKGTCZOL.js → chunk-R34FRICP.js} +4 -4
- package/dist/chunks/{chunk-HKGTCZOL.js.map → chunk-R34FRICP.js.map} +2 -2
- package/dist/chunks/chunk-SXMUGZXP.js +2 -0
- package/dist/chunks/chunk-SXMUGZXP.js.map +7 -0
- package/dist/chunks/chunk-T7NMFIRW.js +2 -0
- package/dist/chunks/chunk-T7NMFIRW.js.map +7 -0
- package/dist/chunks/chunk-TLUGH4VW.js +2 -0
- package/dist/chunks/{chunk-LKD5NRWR.js → chunk-VAWAASUT.js} +1 -1
- package/dist/chunks/{chunk-LKD5NRWR.js.map → chunk-VAWAASUT.js.map} +1 -1
- package/dist/chunks/chunk-Y4TLRGAC.js +2 -0
- package/dist/chunks/{chunk-EEWEXRY6.js.map → chunk-Y4TLRGAC.js.map} +3 -3
- package/dist/chunks/chunk-ZXJRZKWF.js +2 -0
- package/dist/chunks/chunk-ZXJRZKWF.js.map +7 -0
- package/dist/chunks/{executeDiagonalize-HZFFXMG4.js → executeDiagonalize-ZMW5BLEJ.js} +2 -2
- package/dist/chunks/{executeDiagonalize-HZFFXMG4.js.map → executeDiagonalize-ZMW5BLEJ.js.map} +1 -1
- package/dist/chunks/{renderSvg-UKXPWKKV.js → renderSvg-DLJTA2B3.js} +2 -2
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +5 -5
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
- package/package.json +12 -12
- package/src/GraphAddTrackWorkflow/AddTrackWorkflow.test.tsx +4 -7
- package/src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx +1 -1
- package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +9 -6
- package/src/GraphGenomeView/model.test.ts +21 -8
- package/src/GraphGenomeView/pane/loadActions.ts +7 -2
- package/src/GraphGenomeView/pane/walkRowViews.ts +1 -1
- package/src/GraphGenomeView/walkRowGroups.test.ts +14 -3
- package/src/GraphGenomeView/walkRowGroups.ts +0 -22
- package/src/GraphGenomeView/walkRowsCut.ts +1 -0
- package/src/MinigraphBubbleAdapter/MinigraphBubbleAdapter.ts +5 -2
- package/src/RgfaTabixAdapter/RgfaTabixAdapter.test.ts +1 -1
- package/src/RgfaTabixAdapter/RgfaTabixAdapter.ts +16 -16
- package/src/RgfaTabixAdapter/configSchema.ts +16 -12
- package/src/RgfaTabixAdapter/test_data/walks7/build.sh +27 -0
- package/src/RgfaTabixAdapter/test_data/walks7/follow.GRCh38.gfa +35 -0
- package/src/RgfaTabixAdapter/test_data/walks7/follow.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/follow.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/header.GRCh38.gfa +22 -0
- package/src/RgfaTabixAdapter/test_data/walks7/header.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/header.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/inversion.GRCh38.gfa +15 -0
- package/src/RgfaTabixAdapter/test_data/walks7/inversion.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/inversion.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/lanepairs.GRCh38.gfa +19 -0
- package/src/RgfaTabixAdapter/test_data/walks7/lanepairs.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/lanepairs.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/maxnode.GRCh38.gfa +11 -0
- package/src/RgfaTabixAdapter/test_data/walks7/maxnode.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/maxnode.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/rejoin.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skip.GRCh38.gfa +23 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skip.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skip.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skipfollow.GRCh38.gfa +50 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skipfollow.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skipfollow.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.gfa +45 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/skipinv.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/test_data/walks7/twopart.GRCh38.gfa +22 -0
- package/src/RgfaTabixAdapter/test_data/walks7/twopart.GRCh38.walks.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks7/twopart.GRCh38.walks.gz.idx +3 -0
- package/src/RgfaTabixAdapter/walkFiles.test.ts +131 -119
- package/src/RgfaTabixAdapter/walkReader.ts +36 -49
- package/src/WalkFormsAdapter/WalkFormsAdapter.test.ts +7 -28
- package/src/WalkFormsAdapter/WalkFormsAdapter.ts +4 -29
- package/src/WalkFormsAdapter/configSchema.ts +13 -13
- package/src/WalkFormsAdapter/formRows.test.ts +0 -7
- package/src/WalkFormsAdapter/formRows.ts +0 -12
- package/src/WalkFormsAdapter/formsMenu.test.ts +1 -1
- package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.test.ts +54 -96
- package/src/WalkTabixSyntenyAdapter/WalkTabixSyntenyAdapter.ts +56 -152
- package/src/WalkTabixSyntenyAdapter/configSchema.ts +15 -16
- package/src/WalkTabixSyntenyAdapter/gbzParity.test.ts +5 -6
- package/src/WalkTabixSyntenyAdapter/walkLanes.ts +48 -142
- package/src/graphTrackConfig.test.ts +1 -1
- package/src/graphTrackDefaults/graphTrackDefaults.test.ts +7 -10
- package/src/launchFromGraph/syntenyTracks.test.ts +1 -1
- package/src/locationName.ts +2 -2
- package/src/panSNAliases/panSNAliases.test.ts +4 -6
- package/src/panSNTabix.test.ts +3 -23
- package/src/panSNTabix.ts +58 -34
- package/src/synteny/laneZoomNotice.test.ts +1 -0
- package/src/version.ts +1 -1
- package/dist/chunks/LinearGraphDisplay-2AZ7X7TK.js +0 -2
- package/dist/chunks/MinigraphBubbleAdapter-NR3MMUUG.js +0 -2
- package/dist/chunks/MinigraphBubbleAdapter-NR3MMUUG.js.map +0 -7
- package/dist/chunks/RgfaTabixAdapter-JDQLVQVP.js +0 -2
- package/dist/chunks/RgfaTabixAdapter-JDQLVQVP.js.map +0 -7
- package/dist/chunks/WalkFormsAdapter-YMQC3NLG.js +0 -2
- package/dist/chunks/WalkFormsAdapter-YMQC3NLG.js.map +0 -7
- package/dist/chunks/WalkTabixSyntenyAdapter-PBWN53PE.js +0 -2
- package/dist/chunks/WalkTabixSyntenyAdapter-PBWN53PE.js.map +0 -7
- package/dist/chunks/chunk-6VNDP3UB.js +0 -2
- package/dist/chunks/chunk-6VNDP3UB.js.map +0 -7
- package/dist/chunks/chunk-A27SW7X7.js +0 -2
- package/dist/chunks/chunk-A27SW7X7.js.map +0 -7
- package/dist/chunks/chunk-APSXG7SV.js +0 -2
- package/dist/chunks/chunk-DEWVJ57F.js +0 -4
- package/dist/chunks/chunk-DEWVJ57F.js.map +0 -7
- package/dist/chunks/chunk-EEWEXRY6.js +0 -2
- package/dist/chunks/chunk-EFXNCI7R.js +0 -9
- package/dist/chunks/chunk-EH5OCKSE.js +0 -3
- package/dist/chunks/chunk-EH5OCKSE.js.map +0 -7
- package/dist/chunks/chunk-GLSUAMGV.js +0 -3
- package/dist/chunks/chunk-GLSUAMGV.js.map +0 -7
- package/dist/chunks/chunk-LFQFVYNY.js.map +0 -7
- package/dist/chunks/chunk-QUDJ7AM3.js +0 -2
- package/dist/chunks/chunk-QUDJ7AM3.js.map +0 -7
- package/dist/chunks/chunk-T7LVVBTT.js +0 -2
- package/dist/chunks/chunk-T7LVVBTT.js.map +0 -7
- package/dist/chunks/chunk-ZBFIEBO6.js +0 -2
- package/dist/chunks/chunk-ZBFIEBO6.js.map +0 -7
- 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/walks5_follow.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_follow.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_header.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_header.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_inversion.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_inversion.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_lanepairs.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_lanepairs.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_maxnode.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_maxnode.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_rejoin.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_rejoin.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_skip.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_skip.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_skipfollow.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_skipfollow.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_skipinv.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_skipinv.GRCh38.walks.bed.gz.tbi +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_twopart.GRCh38.walks.bed.gz +0 -0
- package/src/RgfaTabixAdapter/test_data/walks5_twopart.GRCh38.walks.bed.gz.tbi +0 -0
- /package/dist/chunks/{GraphGenomeView-PPOVN5LA.js.map → GraphGenomeView-XFKLX3VQ.js.map} +0 -0
- /package/dist/chunks/{GraphTrackSettingsDialog-BRTDTVOJ.js.map → GraphTrackSettingsDialog-KOYYI2XH.js.map} +0 -0
- /package/dist/chunks/{HighlightColorDialog-CGW7J3SK.js.map → HighlightColorDialog-F4IARMEO.js.map} +0 -0
- /package/dist/chunks/{LinearGraphDisplay-2AZ7X7TK.js.map → LinearGraphDisplay-BZ44C6S3.js.map} +0 -0
- /package/dist/chunks/{chunk-APSXG7SV.js.map → chunk-TLUGH4VW.js.map} +0 -0
- /package/dist/chunks/{renderSvg-UKXPWKKV.js.map → renderSvg-DLJTA2B3.js.map} +0 -0
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
- **In:** one of
|
|
4
4
|
- a [gfa-to-tabix](https://github.com/GMOD/gfa-to-tabix) walk file
|
|
5
|
-
(`<prefix>.<sample>.walks.
|
|
6
|
-
**Open track**
|
|
5
|
+
(`<prefix>.<sample>.walks.gz` beside its directory `.walks.gz.idx`), opened
|
|
6
|
+
with File → **Open track**
|
|
7
7
|
- a gfa-to-tabix graph index (`<prefix>.graph.bed.gz` beside its `.tbi`, or
|
|
8
8
|
format 1's `.segs.bed.gz` and `.links.bed.gz` pair), opened the same way
|
|
9
9
|
- a [gbz-base](https://github.com/jltsiren/gbz-base) database (`.gbz.db`),
|
|
@@ -23,7 +23,7 @@ short.
|
|
|
23
23
|
|
|
24
24
|
## Quick start
|
|
25
25
|
|
|
26
|
-
1. Add the plugin to your JBrowse 5.0.0-beta.
|
|
26
|
+
1. Add the plugin to your JBrowse 5.0.0-beta.20 or later config:
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
29
|
{
|
|
@@ -44,9 +44,9 @@ short.
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
3. In an hg38 session, File → **Open track** on the url of
|
|
47
|
-
`chr22.GRCh38.walks.
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
`chr22.GRCh38.walks.gz`. The track redraws the graph for the view's window as
|
|
48
|
+
you pan. [docs/data.md](docs/data.md) covers the other formats and the track
|
|
49
|
+
config
|
|
50
50
|
|
|
51
51
|
4. Explore:
|
|
52
52
|
- Pick a layout from the track menu: force-directed, ordered, anchored,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as J,c as D,d as V,e as X,f as q,h as K}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=AddTrackWorkflow-
|
|
1
|
+
import{b as J,c as D,d as V,e as X,f as q,h as K}from"./chunk-SXMUGZXP.js";import"./chunk-TMM73K4C.js";import"./chunk-D6TY2QEG.js";import{d as M,e as P}from"./chunk-FLKXKTS2.js";import"./chunk-M6YSANSW.js";import{b as w,h as R,j as v,m as x}from"./chunk-TC265JAP.js";import{i as o}from"./chunk-J2PN6CG3.js";import{A as O,B as j,C as z,F as h,a as H,f as E,g as c,o as B,s as N,t as W,u as _}from"./chunk-WE7DQVXF.js";import{b as a,c as f,d as I}from"./chunk-DUU6T2I5.js";var n=JBrowseExports["@jbrowse/core/util/tss-react"],oe=s=>n!=null&&s in Object(n)?n[s]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+s+"' from '@jbrowse/core/util/tss-react' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:s});var Q=oe("makeStyles"),ie=n&&n.__esModule?n.default:n;var se=Q()(s=>({paper:{margin:s.spacing(),padding:s.spacing()},field:{marginTop:s.spacing(2)},submit:{marginTop:25,marginBottom:100,display:"block"}})),re=["RgfaTabixAdapter","WalkTabixSyntenyAdapter","GbzBaseSyntenyAdapter","MinigraphBubbleAdapter"],ne=I(function({model:t}){let{classes:i}=se(),y=v(t),d=M(t),[r,U]=o("RgfaTabixAdapter"),[l,Y]=o(),[k,G]=o(),[T,Z]=o(),m=r==="GbzBaseSyntenyAdapter",u=r==="WalkTabixSyntenyAdapter",[C,$]=o(""),[S,ee]=o(""),[b,ae]=o("Pangenome graph"),[A,g]=o(),[F,L]=o(!1);async function te(){if(!l||!t.assembly)return;g(void 0),L(!0);let e=r==="RgfaTabixAdapter"?await J(l,R(t).pluginManager):void 0;if(L(!1),!(!P(t)||!t.assembly))try{let p=b.trim();w({model:t,session:y,conf:K({choice:r,loc:l,indexLoc:k,readsLoc:m?T:void 0,manifest:e,assembly:t.assembly,sample:C,haplotypes:u?q(S):void 0,trackId:x({name:p}),name:p})})}catch(p){g(p)}}return f(O,{className:i.paper,children:[A?a(E,{error:A}):null,f(N,{children:[a(_,{children:"File type"}),a(z,{value:r,onChange:e=>{U(e.target.value),G(void 0),g(void 0)},children:re.map(e=>a(W,{value:e,control:a(j,{}),label:D[e]},e))})]}),a(c,{location:l,name:V[r],rootModel:d,setLocation:Y}),a(c,{location:k,name:X[r],rootModel:d,setLocation:G}),m?a(c,{location:T,name:"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)",rootModel:d,setLocation:Z}):null,a(h,{className:i.field,value:C,onChange:e=>{$(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":u?"Optional. The PanSN sample this assembly is in the graph; blank takes it from the file name, GRCh38 in chr22.GRCh38.walks.gz":"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}),u?a(h,{className:i.field,value:S,onChange:e=>{ee(e.target.value)},label:"Haplotypes",slotProps:{htmlInput:{"data-testid":"graph-haplotypes-input"}},helperText:"Optional. The haplotypes the track cuts for until you pick others in its menu, as PanSN names separated by commas (HG002#1, or HG002 for both); blank is every haplotype in the file",placeholder:"HG002, HG00733",fullWidth:!0}):null,a(h,{className:i.field,value:b,label:"Track name",slotProps:{htmlInput:{"data-testid":"graph-track-name-input"}},onChange:e=>{ae(e.target.value)}}),a(H,{session:y,helperText:"Select assembly to add track to",selected:t.assembly,onChange:e=>{t.setAssembly(e)},fullWidth:!0}),a(B,{variant:"contained",className:i.submit,disabled:!l||!b.trim()||!t.assembly||F,onClick:()=>{te()},children:F?"Reading graph.json\u2026":"Submit"})]})}),ye=ne;export{ye as default};
|
|
2
|
+
//# sourceMappingURL=AddTrackWorkflow-3PX4I4DX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["jbrowse-host:@jbrowse/core/util/tss-react", "../../src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx"],
|
|
4
|
-
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/core/util/tss-react\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/util/tss-react\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const cx = /* @__PURE__ */ read(\"cx\")\nexport const keyframes = /* @__PURE__ */ read(\"keyframes\")\nexport const makeStyles = /* @__PURE__ */ read(\"makeStyles\")\nexport default host && host.__esModule ? host.default : host", "import { useState } from 'react'\n\nimport { AssemblySelector, ErrorMessage, FileSelector } from '@jbrowse/core/ui'\nimport {\n addTrackFromWidget,\n getEnv,\n getSession,\n makeTrackId,\n} from '@jbrowse/core/util'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { getRoot, isAlive } from '@jbrowse/mobx-state-tree'\nimport {\n Button,\n FormControl,\n FormControlLabel,\n FormLabel,\n Paper,\n Radio,\n RadioGroup,\n TextField,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport {\n GRAPH_FILE_FIELDS,\n GRAPH_FILE_LABELS,\n GRAPH_INDEX_FIELDS,\n buildTrackConfig,\n parseHaplotypes,\n} from './buildTrackConfig'\nimport { readGraphManifest } from './graphManifest'\n\nimport type { GraphFileChoice } from './buildTrackConfig'\nimport type {\n AbstractRootModel,\n AddTrackWorkflowModel,\n FileLocation,\n} from '@jbrowse/core/util'\n\nconst useStyles = makeStyles()(theme => ({\n paper: {\n margin: theme.spacing(),\n padding: theme.spacing(),\n },\n field: {\n marginTop: theme.spacing(2),\n },\n submit: {\n marginTop: 25,\n marginBottom: 100,\n display: 'block',\n },\n}))\n\nconst CHOICES: GraphFileChoice[] = [\n 'RgfaTabixAdapter',\n 'WalkTabixSyntenyAdapter',\n 'GbzBaseSyntenyAdapter',\n 'MinigraphBubbleAdapter',\n]\n\nconst GraphAddTrackWidget = observer(function GraphAddTrackWidget({\n model,\n}: {\n model: AddTrackWorkflowModel\n}) {\n const { classes } = useStyles()\n const session = getSession(model)\n const rootModel = getRoot<AbstractRootModel>(model)\n const [choice, setChoice] = useState<GraphFileChoice>('RgfaTabixAdapter')\n const [loc, setLoc] = useState<FileLocation>()\n const [indexLoc, setIndexLoc] = useState<FileLocation>()\n const [readsLoc, setReadsLoc] = useState<FileLocation>()\n const gbz = choice === 'GbzBaseSyntenyAdapter'\n const walks = choice === 'WalkTabixSyntenyAdapter'\n const [sample, setSample] = useState('')\n const [haplotypes, setHaplotypes] = useState('')\n const [trackName, setTrackName] = useState('Pangenome graph')\n const [error, setError] = useState<unknown>()\n const [submitting, setSubmitting] = useState(false)\n\n async function handleSubmit() {\n if (!loc || !model.assembly) {\n return\n }\n setError(undefined)\n setSubmitting(true)\n const manifest =\n choice === 'RgfaTabixAdapter'\n ? await readGraphManifest(loc, getEnv(model).pluginManager)\n : undefined\n setSubmitting(false)\n if (!isAlive(model) || !model.assembly) {\n return\n }\n try {\n const name = trackName.trim()\n addTrackFromWidget({\n model,\n session,\n conf: buildTrackConfig({\n choice,\n loc,\n indexLoc,\n readsLoc: gbz ? readsLoc : undefined,\n manifest,\n assembly: model.assembly,\n sample,\n haplotypes: walks ? parseHaplotypes(haplotypes) : undefined,\n trackId: makeTrackId({ name }),\n name,\n }),\n })\n } catch (e) {\n setError(e)\n }\n }\n\n return (\n <Paper className={classes.paper}>\n {error ? <ErrorMessage error={error} /> : null}\n <FormControl>\n <FormLabel>File type</FormLabel>\n <RadioGroup\n value={choice}\n onChange={event => {\n setChoice(event.target.value as GraphFileChoice)\n setIndexLoc(undefined)\n setError(undefined)\n }}\n >\n {CHOICES.map(option => (\n <FormControlLabel\n key={option}\n value={option}\n control={<Radio />}\n label={GRAPH_FILE_LABELS[option]}\n />\n ))}\n </RadioGroup>\n </FormControl>\n <FileSelector\n location={loc}\n name={GRAPH_FILE_FIELDS[choice]}\n rootModel={rootModel}\n setLocation={setLoc}\n />\n <FileSelector\n location={indexLoc}\n name={GRAPH_INDEX_FIELDS[choice]}\n rootModel={rootModel}\n setLocation={setIndexLoc}\n />\n {gbz ? (\n <FileSelector\n location={readsLoc}\n name=\"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)\"\n rootModel={rootModel}\n setLocation={setReadsLoc}\n />\n ) : null}\n <TextField\n className={classes.field}\n value={sample}\n onChange={event => {\n setSample(event.target.value)\n }}\n label=\"Sample name in the graph\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-sample-input' } }}\n helperText={\n gbz\n ? \"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\"\n : walks\n ? 'Optional. The PanSN sample this assembly is in the graph; blank takes it from the file name, GRCh38 in chr22.GRCh38.walks.
|
|
5
|
-
"mappings": "udAAA,IAAMA,EAAO,eAAe,8BAA8B,EACpDC,GAAOC,GACXF,GAAQ,MAAQE,KAAQ,OAAOF,CAAI,EAC/BA,EAAKE,CAAI,EACT,OAAO,OACL,UAAY,CACV,MAAM,IAAI,MAAM,kCAAoCA,EAAO,8IAA6J,CAC1N,EACA,CAAE,mBAAoBA,CAAK,CAC7B,EAGC,IAAMC,EAA6BC,GAAK,YAAY,EACpDC,GAAQC,GAAQA,EAAK,WAAaA,EAAK,QAAUA,EC0BxD,IAAMC,GAAYC,EAAW,EAAEC,IAAU,CACvC,MAAO,CACL,OAAQA,EAAM,QAAQ,EACtB,QAASA,EAAM,QAAQ,CACzB,EACA,MAAO,CACL,UAAWA,EAAM,QAAQ,CAAC,CAC5B,EACA,OAAQ,CACN,UAAW,GACX,aAAc,IACd,QAAS,OACX,CACF,EAAE,EAEIC,GAA6B,CACjC,mBACA,0BACA,wBACA,wBACF,EAEMC,GAAsBC,EAAS,SAA6B,CAChE,MAAAC,CACF,EAEG,CACD,GAAM,CAAE,QAAAC,CAAQ,EAAIP,GAAU,EACxBQ,EAAUC,EA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,EAAK,KAC1Ce,EAACI,EAAA,CACC,UAAAF,EAACG,EAAA,CAAU,qBAAS,EACpBH,EAACI,EAAA,CACC,MAAOtC,EACP,SAAUuC,GAAS,CACjBtC,EAAUsC,EAAM,OAAO,KAAwB,EAC/CjC,EAAY,MAAS,EACrBY,EAAS,MAAS,CACpB,EAEC,SAAA3B,GAAQ,IAAIiD,GACXN,EAACO,EAAA,CAEC,MAAOD,EACP,QAASN,EAACQ,EAAA,EAAM,EAChB,MAAOC,EAAkBH,CAAM,GAH1BA,CAIP,CACD,EACH,GACF,EACAN,EAACU,EAAA,CACC,SAAUzC,EACV,KAAM0C,EAAkB7C,CAAM,EAC9B,UAAWF,EACX,YAAaM,EACf,EACA8B,EAACU,EAAA,CACC,SAAUvC,EACV,KAAMyC,EAAmB9C,CAAM,EAC/B,UAAWF,EACX,YAAaQ,EACf,EACCG,EACCyB,EAACU,EAAA,CACC,SAAUrC,EACV,KAAK,4FACL,UAAWT,EACX,YAAaU,EACf,EACE,KACJ0B,EAACa,EAAA,CACC,UAAWpD,EAAQ,MACnB,MAAOgB,EACP,SAAU4B,GAAS,CACjB3B,EAAU2B,EAAM,OAAO,KAAK,CAC9B,EACA,MAAM,2BACN,UAAW,CAAE,UAAW,CAAE,cAAe,oBAAqB,CAAE,EAChE,WACE9B,EACI,mKACAC,EACE,
|
|
4
|
+
"sourcesContent": ["const host = JBrowseExports[\"@jbrowse/core/util/tss-react\"]\nconst read = name =>\n host != null && name in Object(host)\n ? host[name]\n : Object.assign(\n function () {\n throw new Error(\"This JBrowse does not provide '\" + name + \"' from '\" + \"@jbrowse/core/util/tss-react\" + \"' to plugins: \" + \"GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse\")\n },\n { jbrowseHostMissing: name },\n )\nexport const cx = /* @__PURE__ */ read(\"cx\")\nexport const keyframes = /* @__PURE__ */ read(\"keyframes\")\nexport const makeStyles = /* @__PURE__ */ read(\"makeStyles\")\nexport default host && host.__esModule ? host.default : host", "import { useState } from 'react'\n\nimport { AssemblySelector, ErrorMessage, FileSelector } from '@jbrowse/core/ui'\nimport {\n addTrackFromWidget,\n getEnv,\n getSession,\n makeTrackId,\n} from '@jbrowse/core/util'\nimport { makeStyles } from '@jbrowse/core/util/tss-react'\nimport { getRoot, isAlive } from '@jbrowse/mobx-state-tree'\nimport {\n Button,\n FormControl,\n FormControlLabel,\n FormLabel,\n Paper,\n Radio,\n RadioGroup,\n TextField,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport {\n GRAPH_FILE_FIELDS,\n GRAPH_FILE_LABELS,\n GRAPH_INDEX_FIELDS,\n buildTrackConfig,\n parseHaplotypes,\n} from './buildTrackConfig'\nimport { readGraphManifest } from './graphManifest'\n\nimport type { GraphFileChoice } from './buildTrackConfig'\nimport type {\n AbstractRootModel,\n AddTrackWorkflowModel,\n FileLocation,\n} from '@jbrowse/core/util'\n\nconst useStyles = makeStyles()(theme => ({\n paper: {\n margin: theme.spacing(),\n padding: theme.spacing(),\n },\n field: {\n marginTop: theme.spacing(2),\n },\n submit: {\n marginTop: 25,\n marginBottom: 100,\n display: 'block',\n },\n}))\n\nconst CHOICES: GraphFileChoice[] = [\n 'RgfaTabixAdapter',\n 'WalkTabixSyntenyAdapter',\n 'GbzBaseSyntenyAdapter',\n 'MinigraphBubbleAdapter',\n]\n\nconst GraphAddTrackWidget = observer(function GraphAddTrackWidget({\n model,\n}: {\n model: AddTrackWorkflowModel\n}) {\n const { classes } = useStyles()\n const session = getSession(model)\n const rootModel = getRoot<AbstractRootModel>(model)\n const [choice, setChoice] = useState<GraphFileChoice>('RgfaTabixAdapter')\n const [loc, setLoc] = useState<FileLocation>()\n const [indexLoc, setIndexLoc] = useState<FileLocation>()\n const [readsLoc, setReadsLoc] = useState<FileLocation>()\n const gbz = choice === 'GbzBaseSyntenyAdapter'\n const walks = choice === 'WalkTabixSyntenyAdapter'\n const [sample, setSample] = useState('')\n const [haplotypes, setHaplotypes] = useState('')\n const [trackName, setTrackName] = useState('Pangenome graph')\n const [error, setError] = useState<unknown>()\n const [submitting, setSubmitting] = useState(false)\n\n async function handleSubmit() {\n if (!loc || !model.assembly) {\n return\n }\n setError(undefined)\n setSubmitting(true)\n const manifest =\n choice === 'RgfaTabixAdapter'\n ? await readGraphManifest(loc, getEnv(model).pluginManager)\n : undefined\n setSubmitting(false)\n if (!isAlive(model) || !model.assembly) {\n return\n }\n try {\n const name = trackName.trim()\n addTrackFromWidget({\n model,\n session,\n conf: buildTrackConfig({\n choice,\n loc,\n indexLoc,\n readsLoc: gbz ? readsLoc : undefined,\n manifest,\n assembly: model.assembly,\n sample,\n haplotypes: walks ? parseHaplotypes(haplotypes) : undefined,\n trackId: makeTrackId({ name }),\n name,\n }),\n })\n } catch (e) {\n setError(e)\n }\n }\n\n return (\n <Paper className={classes.paper}>\n {error ? <ErrorMessage error={error} /> : null}\n <FormControl>\n <FormLabel>File type</FormLabel>\n <RadioGroup\n value={choice}\n onChange={event => {\n setChoice(event.target.value as GraphFileChoice)\n setIndexLoc(undefined)\n setError(undefined)\n }}\n >\n {CHOICES.map(option => (\n <FormControlLabel\n key={option}\n value={option}\n control={<Radio />}\n label={GRAPH_FILE_LABELS[option]}\n />\n ))}\n </RadioGroup>\n </FormControl>\n <FileSelector\n location={loc}\n name={GRAPH_FILE_FIELDS[choice]}\n rootModel={rootModel}\n setLocation={setLoc}\n />\n <FileSelector\n location={indexLoc}\n name={GRAPH_INDEX_FIELDS[choice]}\n rootModel={rootModel}\n setLocation={setIndexLoc}\n />\n {gbz ? (\n <FileSelector\n location={readsLoc}\n name=\"Path to reads aligned to the graph as GAF (optional; a .gz is read by the .tbi beside it)\"\n rootModel={rootModel}\n setLocation={setReadsLoc}\n />\n ) : null}\n <TextField\n className={classes.field}\n value={sample}\n onChange={event => {\n setSample(event.target.value)\n }}\n label=\"Sample name in the graph\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-sample-input' } }}\n helperText={\n gbz\n ? \"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\"\n : walks\n ? 'Optional. The PanSN sample this assembly is in the graph; blank takes it from the file name, GRCh38 in chr22.GRCh38.walks.gz'\n : \"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\"\n }\n placeholder=\"GRCh38\"\n fullWidth\n />\n {walks ? (\n <TextField\n className={classes.field}\n value={haplotypes}\n onChange={event => {\n setHaplotypes(event.target.value)\n }}\n label=\"Haplotypes\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-haplotypes-input' } }}\n helperText=\"Optional. The haplotypes the track cuts for until you pick others in its menu, as PanSN names separated by commas (HG002#1, or HG002 for both); blank is every haplotype in the file\"\n placeholder=\"HG002, HG00733\"\n fullWidth\n />\n ) : null}\n <TextField\n className={classes.field}\n value={trackName}\n label=\"Track name\"\n slotProps={{ htmlInput: { 'data-testid': 'graph-track-name-input' } }}\n onChange={event => {\n setTrackName(event.target.value)\n }}\n />\n <AssemblySelector\n session={session}\n helperText=\"Select assembly to add track to\"\n selected={model.assembly}\n onChange={arg => {\n model.setAssembly(arg)\n }}\n fullWidth\n />\n <Button\n variant=\"contained\"\n className={classes.submit}\n disabled={!loc || !trackName.trim() || !model.assembly || submitting}\n onClick={() => {\n void handleSubmit()\n }}\n >\n {submitting ? 'Reading graph.json\u2026' : 'Submit'}\n </Button>\n </Paper>\n )\n})\n\nexport default GraphAddTrackWidget\n"],
|
|
5
|
+
"mappings": "udAAA,IAAMA,EAAO,eAAe,8BAA8B,EACpDC,GAAOC,GACXF,GAAQ,MAAQE,KAAQ,OAAOF,CAAI,EAC/BA,EAAKE,CAAI,EACT,OAAO,OACL,UAAY,CACV,MAAM,IAAI,MAAM,kCAAoCA,EAAO,8IAA6J,CAC1N,EACA,CAAE,mBAAoBA,CAAK,CAC7B,EAGC,IAAMC,EAA6BC,GAAK,YAAY,EACpDC,GAAQC,GAAQA,EAAK,WAAaA,EAA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Y,SACZ,UAAS,GACX,EACCA,EACCwB,EAACa,EAAA,CACC,UAAWpD,EAAQ,MACnB,MAAOkB,EACP,SAAU0B,GAAS,CACjBzB,GAAcyB,EAAM,OAAO,KAAK,CAClC,EACA,MAAM,aACN,UAAW,CAAE,UAAW,CAAE,cAAe,wBAAyB,CAAE,EACpE,WAAW,uLACX,YAAY,iBACZ,UAAS,GACX,EACE,KACJL,EAACa,EAAA,CACC,UAAWpD,EAAQ,MACnB,MAAOoB,EACP,MAAM,aACN,UAAW,CAAE,UAAW,CAAE,cAAe,wBAAyB,CAAE,EACpE,SAAUwB,GAAS,CACjBvB,GAAauB,EAAM,OAAO,KAAK,CACjC,EACF,EACAL,EAACc,EAAA,CACC,QAASpD,EACT,WAAW,kCACX,SAAUF,EAAM,SAChB,SAAUuD,GAAO,CACfvD,EAAM,YAAYuD,CAAG,CACvB,EACA,UAAS,GACX,EACAf,EAACgB,EAAA,CACC,QAAQ,YACR,UAAWvD,EAAQ,OACnB,SAAU,CAACQ,GAAO,CAACY,EAAU,KAAK,GAAK,CAACrB,EAAM,UAAYyB,EAC1D,QAAS,IAAM,CACRE,GAAa,CACpB,EAEC,SAAAF,EAAa,2BAAwB,SACxC,GACF,CAEJ,CAAC,EAEMgC,GAAQ3D",
|
|
6
6
|
"names": ["host", "read", "name", "makeStyles", "read", "tss_react_default", "host", "useStyles", "makeStyles", "theme", "CHOICES", "GraphAddTrackWidget", "observer", "model", "classes", "session", "getSession", "rootModel", "getRoot", "choice", "setChoice", "useState", "loc", "setLoc", "indexLoc", "setIndexLoc", "readsLoc", "setReadsLoc", "gbz", "walks", "sample", "setSample", "haplotypes", "setHaplotypes", "trackName", "setTrackName", "error", "setError", "submitting", "setSubmitting", "handleSubmit", "manifest", "readGraphManifest", "getEnv", "isAlive", "name", "addTrackFromWidget", "buildTrackConfig", "parseHaplotypes", "makeTrackId", "e", "jsxs", "Paper", "jsx", "ErrorMessage", "FormControl", "FormLabel", "RadioGroup", "event", "option", "FormControlLabel", "Radio", "GRAPH_FILE_LABELS", "FileSelector", "GRAPH_FILE_FIELDS", "GRAPH_INDEX_FIELDS", "TextField", "AssemblySelector", "arg", "Button", "AddTrackWorkflow_default"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ne,b as ae,c as ue,d as re,e as oe,f as O,g as ie,h as se}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=GbzBaseSyntenyAdapter-
|
|
1
|
+
import{a as ne,b as ae,c as ue,d as re,e as oe,f as O,g as ie,h as se}from"./chunk-47UWMS4O.js";import{a as te}from"./chunk-TLUGH4VW.js";import{a as ee}from"./chunk-V55TK2NP.js";import{a as Q,b as D,c as Z,d as u,e as k,f as M,g as j,h as $,i as W,k as U}from"./chunk-I2XBA4H7.js";import"./chunk-M2D7NUOY.js";import{h as z,i as E}from"./chunk-42VF2CSA.js";import"./chunk-YBLNN5FU.js";import"./chunk-CJ4VON23.js";import"./chunk-AQSLN3RH.js";import{D as V,a as K,c as L}from"./chunk-AXUXLPO3.js";import"./chunk-YBLNN5FU.js";import"./chunk-T7NMFIRW.js";import{g as F,h as N,i as C}from"./chunk-OSEQDKL3.js";import"./chunk-FQI75MV6.js";import"./chunk-TMM73K4C.js";import{a as P}from"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{e as G,h as X,i as Y,j as J}from"./chunk-M6YSANSW.js";import{e as _,o as B}from"./chunk-TC265JAP.js";function A(n){let i=/\.gbz\.db$/i;return i.test(n)?n.replace(i,".haplotype-index.db"):void 0}function ge(n){return Y(n)&&A(X(n))?J(n,i=>A(i)):void 0}function ye(n){return n instanceof Error&&(/\bHTTP 40[34]\b/.test(n.message)||n.code==="ENOENT")}async function ce(n,i){let e=ge(n);if(!e)return{};try{return await P(e,i).stat(),{location:e}}catch(t){return ye(t)?{}:{unreadable:String(t)}}}var be=5e3,we=50*2**20,H=class extends Error{constructor(e){super(`this GAF is ${(e/2**20).toFixed(0)} MB without an index; bgzip it and index it with tabix -p gaf`);this.name="UnindexedGafTooLargeError"}};function xe(n,i){if(n.length<=i)return n;let e=n.length/i;return Array.from({length:i},(t,a)=>n[Math.floor(a*e)])}var pe=(n,i)=>n.path.some(e=>i.has(e.name)),v=class{constructor(i,e){this.file=i;this.tabix=e;this.whole=L({setup:async({signal:i})=>{let{size:e}=await this.file.stat();if(e>we)throw new H(e);let t=await this.file.readFile({signal:i}),a=new TextDecoder().decode(t[0]===31&&t[1]===139?await K(t):t);return E(a)}})}async readIndexed(i,e,t){let a=1/0,r=-1/0;for(let s of e){let c=Number(s);Number.isInteger(c)&&(a=Math.min(a,c),r=Math.max(r,c))}let o=[];return a<=r&&await i.getLines("{node}",a,r+1,{signal:t,lineCallback:s=>{let c=z(s);c&&pe(c,e)&&o.push(c)}}),o}async readsOver(i,{signal:e}={}){let t=this.tabix?await this.readIndexed(this.tabix,i,e):(await this.whole({signal:e})).filter(a=>pe(a,i));return{records:xe(t,be),total:t.length}}};var I=class extends Error{constructor(e){super(e===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 (${e}), so the walks cannot be named; if it is there, reload to try again, or set haplotypeIndexLocation`);this.name="NoHaplotypeIndexError"}},q=class extends Error{constructor(e,t){super(`the graph is cut on its reference, ${t}; a window on ${e} has no reference coordinates to cut at. Open the graph from a ${t} view, and find this haplotype's lane there`);this.name="HaplotypeWindowError"}};function Se(n,i){return`${u(n)}#${n.contig}@${i.start.node}.${i.start.offset}`}function Ne({alignment:n,assemblyName:i,refName:e,lane:t}){let{refStart:a,refEnd:r,strand:o,cigar:s}=n;if(!(r<=a)){let{name:c,hapStart:p,hapEnd:l}=n,f=Se(c,n),g={uniqueId:f,assemblyName:i,refName:e,start:a,end:r,type:"match",strand:o==="-"?-1:1,CIGAR:s,syntenyId:f,mate:{refName:c.contig,start:p,end:l,assemblyName:t}};return new ne(g)}}function Pe({pair:n,lane:i,mateLane:e}){return se({target:{name:`${u(n.target)}#${n.target.contig}`,assemblyName:i,refName:n.target.contig,start:n.targetStart,end:n.targetEnd},query:{name:`${u(n.query)}#${n.query.contig}`,assemblyName:e,refName:n.query.contig,start:n.queryStart,end:n.queryEnd},strand:n.strand,cigar:n.cigar,matches:n.matches,columns:n.columns})}var Le=12e4;function Re(n,i){let e=new Map;for(let a of n)for(let{name:r,start:o,end:s}of a.walkSpans()){let c=u(r);if(i.has(c)){let p=`${c}#${r.contig}`,l=e.get(p);l?l.push([o,s]):e.set(p,[[o,s]])}}let t=0;for(let a of e.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<=Le&&(t=Math.max(t,o))}}return t}function fe(n,i){return n instanceof Z&&(n.message=`Zoom in to about ${_(n.fitsBp)} to see ${i}`),n}var le=(n,i,e)=>ie(fe(W(n,i,e)??n,"lanes"),e),me=n=>({...n,start:Math.floor(n.start),end:Math.ceil(n.end)}),T=class extends ae{constructor(){super(...arguments);this.graph=L({label:"Opening pangenome database",setup:async()=>{let e=this.getConf("gbzDbLocation"),t=this.getConf("haplotypeIndexLocation"),a=G(t)?{location:t}:await ce(e,this.pluginManager),r=a.location,o=await D.open({source:P(e,this.pluginManager),haplotypeIndex:r?P(r,this.pluginManager):void 0}),s=this.getConf("assemblyNames")[0];if(s===void 0)throw new Error("GbzBaseSyntenyAdapter needs assemblyNames: its first entry is the assembly the reference sample is loaded as");let c=await M(o),p=j({configured:this.getConf("referenceSample"),anchorPrefix:N(this,s),referenceSamples:c});return{db:o,anchor:s,referenceSample:p,referenceSamples:c,unreadableIndex:a.unreadable}}});this.gaf=L({label:"Opening reads",setup:async()=>{let e=this.getConf("readsLocation"),t=this.getConf(["readsIndex","location"]);return G(e)?new v(P(e,this.pluginManager),G(t)?V(this,["readsLocation"],["readsIndex"]):void 0):void 0}})}async referenceQuery(e,t){let{db:a,referenceSample:r}=await this.graph(t);return $(a,r,e)}async getHaplotypes(e={}){let{db:t,referenceSamples:a}=await this.graph(e),r=new Map;for(let o of await t.paths()){let s=u(o.name),c=r.get(s);c?c.contigs.includes(o.name.contig)||c.contigs.push(o.name.contig):r.set(s,{prefix:s,sample:o.name.sample,haplotype:o.name.haplotype,contigs:[o.name.contig],isReference:a.includes(o.name.sample)})}return[...r.values()]}async getHeader(e={}){let{anchor:t,referenceSample:a}=await this.graph(e),r=C(this),o=[];for(let s of await this.getHaplotypes(e))s.sample!==a&&o.push({name:O(r,s.prefix),label:s.prefix,group:s.sample});return{hasCoarseTier:!1,anchorAssemblyName:t,lanes:o}}async getRefNames(e={}){let{db:t,anchor:a,referenceSample:r}=await this.graph(e),{assemblyName:o}=e,s=o===a?void 0:N(this,o),c=(await t.paths()).filter(p=>o===a?p.isIndexed&&p.name.sample===r:F(u(p.name),s)).map(p=>p.name.contig);return[...new Set(c)]}keepPredicate(e,t){let a=e===void 0||e.length===0?void 0:e.map(r=>N(this,r));return a===void 0&&t===void 0?void 0:r=>k(r,a)&&(t===void 0||F(u(r),t))}async getSubgraph(e,t={}){let{signal:a}=t,{db:r,anchor:o,referenceSample:s,unreadableIndex:c}=await this.graph({signal:a}),{assemblyName:p,refName:l,start:f,end:g}=me(e);if(p!==o)throw new q(p,o);let y=await this.referenceQuery(l,{signal:a});if(!y)throw new Error(`${s} has no indexed path ${l} in this graph`);let b=this.keepPredicate(t.haplotypes);if(b!==void 0&&!r.hasHaplotypeIndex)throw new I(c);let d=await U(r,y,f,g,{context:this.getConf("context"),snarls:t.snarls??this.getConf("subgraphSnarls"),limit:this.getConf("nodeLimit"),signal:t.signal,keep:b}).catch(w=>{throw fe(w,"the graph")});return typeof d=="string"?d:te(d,{start:f,end:g},t.walkRows)}async getReads(e,t={}){let a=await this.gaf(t);return a?a.readsOver(new Set(e),t):{records:[],total:0}}async laneHaplotypes(e,t){let a=N(this,e);return(await this.getHaplotypes(t)).filter(r=>F(r.prefix,a))}async anchorFeatures(e,t){let{db:a}=await this.graph(t),{assemblyName:r,refName:o,start:s,end:c}=e,p=N(this,t.targetAssemblyName),l=C(this),f=this.keepPredicate(t.haplotypes,p),g=await this.referenceQuery(o,t),y=this.getConf("nodeLimit");return(g?await B(`Reading graph ${o}:${s.toLocaleString()}-${c.toLocaleString()}`,t.statusCallback,()=>a.getAlignments({path:g,start:s,end:c,context:this.getConf("context"),haplotypes:"all",limit:y,signal:t.signal,keep:f}).catch(d=>{throw le(d,y,c-s)})):[]).flatMap(d=>{let w=d.resolved?Ne({alignment:d,assemblyName:r,refName:o,lane:O(l,u(d.name))}):void 0;return w===void 0?[]:[w]})}async pairFeatures(e,t,a){let{db:r}=await this.graph(a),{refName:o,start:s,end:c}=e,l=(await Promise.all(t.map(async m=>({pair:m,featureSide:await this.laneHaplotypes(m.queryAssemblyName,a),mateSide:await this.laneHaplotypes(m.targetAssemblyName,a)})))).filter(({featureSide:m,mateSide:h})=>m.length>0&&h.length>0),f=new Set(l.flatMap(({featureSide:m,mateSide:h})=>[...m,...h].map(u))),g=await this.referenceQuery(o,a),y=this.getConf("nodeLimit"),b=this.getConf("context"),d=(m,h)=>r.getSubgraphs({path:m,start:s,end:c,context:h,snarls:this.getConf("subgraphSnarls"),haplotypes:"all",limit:y,signal:a.signal,keep:x=>f.has(u(x))}),w=async m=>{let h=await d(m,b).catch(S=>{throw le(S,y,c-s)}),x=Re(h,f),R=Math.ceil(x/2)+2e3;return x>0&&R>b?d(m,R).catch(S=>{if(S instanceof Q)return h;throw S}):h};return(g&&l.length>0?await B(oe(t),a.statusCallback,()=>w(g)):[]).flatMap(m=>l.flatMap(({pair:h,featureSide:x,mateSide:R})=>x.flatMap(S=>R.flatMap(de=>m.pairAlignments({target:S,query:de,bases:!1}).map(he=>Pe({pair:he,lane:h.queryAssemblyName,mateLane:h.targetAssemblyName}))))))}getFeatures(e,t={}){let a=me(e);return ee(async r=>{let{db:o,anchor:s,unreadableIndex:c}=await this.graph(t);if(!o.hasHaplotypeIndex)throw new I(c);if(a.assemblyName===s){let p=re(t),l=p.length>0?await this.pairFeatures(a,p,t):await this.anchorFeatures(a,t);for(let f of l)r.next(f)}r.complete()},t.signal)}};export{I as NoHaplotypeIndexError,ue as PairTargetError,T as default,Re as widestWalkGap};
|
|
2
|
+
//# sourceMappingURL=GbzBaseSyntenyAdapter-YUT5RT7G.js.map
|
package/dist/chunks/{GbzBaseSyntenyAdapter-NAXISJUH.js.map → GbzBaseSyntenyAdapter-YUT5RT7G.js.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@
|
|
4
|
-
"sourcesContent": ["import {\n GBZ_CUT_DEFAULTS,\n NoReferenceSampleError,\n aliasedSample,\n cutWindowGFA,\n haplotypeWanted,\n referencePathQuery,\n referenceSamplesOf\n} from \"./chunk-RQHIDUZR.js\";\nimport {\n panSNSample\n} from \"./chunk-2JL2JVZ2.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 gbzLocations({ db, index }) {\n return db === \"hprc\" ? { db: HPRC_GBZ.db, index: index ?? HPRC_GBZ.index } : { db, index };\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 0-based region like chr6:160,614,797-160,647,758`\n );\n }\n const n = (s) => Number(s.replaceAll(\",\", \"\"));\n const region = { refName: m[1], start: n(m[2]), end: n(m[3]) };\n if (region.end <= region.start) {\n throw new Error(`\"${text}\" ends at or before it starts`);\n }\n return region;\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 if (ref) {\n return aliasedSample(panSNSample(ref), samples) ?? ref;\n }\n const first = samples[0];\n if (first === void 0) {\n throw new NoReferenceSampleError(\"\", samples);\n }\n return first;\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 gbzLocations,\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/walkCut.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 {\n laneAssemblyName,\n lanePairsStatus,\n requestedPairs,\n} from '../synteny/lanePairs.ts'\nimport { laneZoomNotice } from '../synteny/laneZoomNotice.ts'\nimport { matchFeature } from '../synteny/matchFeature.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\ninterface 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'\n\nclass 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\nfunction 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// gbz-base writes the CIGAR along the target, which is the side a JBrowse\n// feature is, so it passes through unchanged\nfunction pairFeature({\n pair,\n lane,\n mateLane,\n}: {\n pair: PairAlignment\n lane: string\n mateLane: string\n}) {\n return matchFeature({\n target: {\n name: `${haplotypePrefix(pair.target)}#${pair.target.contig}`,\n assemblyName: lane,\n refName: pair.target.contig,\n start: pair.targetStart,\n end: pair.targetEnd,\n },\n query: {\n name: `${haplotypePrefix(pair.query)}#${pair.query.contig}`,\n assemblyName: mateLane,\n refName: pair.query.contig,\n start: pair.queryStart,\n end: pair.queryEnd,\n },\n strand: pair.strand,\n cigar: pair.cigar,\n matches: pair.matches,\n columns: pair.columns,\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\nconst laneLimitNotice = (error: unknown, nodeLimit: number, windowBp: number) =>\n laneZoomNotice(\n zoomInNotice(nodeLimitError(error, nodeLimit, windowBp) ?? error, 'lanes'),\n windowBp,\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 } = 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 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 laneLimitNotice(error, nodeLimit, end - start)\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 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 laneLimitNotice(error, nodeLimit, end - start)\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 && answerable.length > 0\n ? await updateStatus(lanePairsStatus(pairs), 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"],
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@13.1.0/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-IDYGRSNF.js", "../../src/GbzBaseSyntenyAdapter/companion.ts", "../../src/gaf/gafFile.ts", "../../src/GbzBaseSyntenyAdapter/GbzBaseSyntenyAdapter.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n GBZ_CUT_DEFAULTS,\n NoReferenceSampleError,\n aliasedSample,\n cutWindowGFA,\n haplotypeWanted,\n referencePathQuery,\n referenceSamplesOf\n} from \"./chunk-4SM3YYY4.js\";\nimport {\n panSNSample\n} from \"./chunk-2JL2JVZ2.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 gbzLocations({ db, index }) {\n return db === \"hprc\" ? { db: HPRC_GBZ.db, index: index ?? HPRC_GBZ.index } : { db, index };\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 0-based region like chr6:160,614,797-160,647,758`\n );\n }\n const n = (s) => Number(s.replaceAll(\",\", \"\"));\n const region = { refName: m[1], start: n(m[2]), end: n(m[3]) };\n if (region.end <= region.start) {\n throw new Error(`\"${text}\" ends at or before it starts`);\n }\n return region;\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 if (ref) {\n return aliasedSample(panSNSample(ref), samples) ?? ref;\n }\n const first = samples[0];\n if (first === void 0) {\n throw new NoReferenceSampleError(\"\", samples);\n }\n return first;\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 gbzLocations,\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/walkCut.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 {\n laneAssemblyName,\n lanePairsStatus,\n requestedPairs,\n} from '../synteny/lanePairs.ts'\nimport { laneZoomNotice } from '../synteny/laneZoomNotice.ts'\nimport { matchFeature } from '../synteny/matchFeature.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\ninterface 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'\n\nclass 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\nfunction 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// gbz-base writes the CIGAR along the target, which is the side a JBrowse\n// feature is, so it passes through unchanged\nfunction pairFeature({\n pair,\n lane,\n mateLane,\n}: {\n pair: PairAlignment\n lane: string\n mateLane: string\n}) {\n return matchFeature({\n target: {\n name: `${haplotypePrefix(pair.target)}#${pair.target.contig}`,\n assemblyName: lane,\n refName: pair.target.contig,\n start: pair.targetStart,\n end: pair.targetEnd,\n },\n query: {\n name: `${haplotypePrefix(pair.query)}#${pair.query.contig}`,\n assemblyName: mateLane,\n refName: pair.query.contig,\n start: pair.queryStart,\n end: pair.queryEnd,\n },\n strand: pair.strand,\n cigar: pair.cigar,\n matches: pair.matches,\n columns: pair.columns,\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\nconst laneLimitNotice = (error: unknown, nodeLimit: number, windowBp: number) =>\n laneZoomNotice(\n zoomInNotice(nodeLimitError(error, nodeLimit, windowBp) ?? error, 'lanes'),\n windowBp,\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 } = 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 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 laneLimitNotice(error, nodeLimit, end - start)\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 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 laneLimitNotice(error, nodeLimit, end - start)\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 && answerable.length > 0\n ? await updateStatus(lanePairsStatus(pairs), 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
5
|
"mappings": "o0BAsBA,SAASA,EAAqBC,EAAI,CAChC,IAAMC,EAAS,cACf,OAAOA,EAAO,KAAKD,CAAE,EAAIA,EAAG,QAAQC,EAAQ,qBAAqB,EAAI,MACvE,CCjBO,SAASC,GAAiBC,EAAqB,CACpD,OAAOC,EAAcD,CAAK,GAAKE,EAAqBC,EAAaH,CAAK,CAAC,EACnEI,EAAQJ,EAAOK,GAAQH,EAAqBG,CAAI,CAAE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F,CACF,CAEA,YAAY0F,EAAetC,EAA2B,CAAC,EAAG,CACxD,IAAMtB,EAASD,GAAQ6D,CAAK,EAC5B,OAAOC,GAA0B,MAAMC,GAAY,CACjD,GAAM,CAAE,GAAApD,EAAI,OAAA1D,EAAQ,gBAAAuF,CAAgB,EAAI,MAAM,KAAK,MAAMjB,CAAI,EAC7D,GAAI,CAACZ,EAAG,kBACN,MAAM,IAAI9D,EAAsB2F,CAAe,EAIjD,GAAIvC,EAAO,eAAiBhD,EAAQ,CAClC,IAAMiG,EAAQc,GAAezC,CAAI,EAC3B0C,EACJf,EAAM,OAAS,EACX,MAAM,KAAK,aAAajD,EAAQiD,EAAO3B,CAAI,EAC3C,MAAM,KAAK,eAAetB,EAAQsB,CAAI,EAC5C,QAAW0B,KAAWgB,EACpBF,EAAS,KAAKd,CAAO,CAEzB,CACAc,EAAS,SAAS,CACpB,EAAGxC,EAAK,MAAM,CAChB,CACF",
|
|
6
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", "matchFeature", "BRIDGE_MAX_BP", "widestWalkGap", "subgraphs", "kept", "byPath", "subgraph", "start", "end", "prefix", "key", "spans", "widest", "a", "b", "i", "gap", "zoomInNotice", "error", "what", "NodeLimitError", "getBpDisplayStr", "laneLimitNotice", "nodeLimit", "windowBp", "laneZoomNotice", "nodeLimitError", "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", "updateStatus", "feature", "pairs", "answerable", "featureSide", "mateSide", "baseContext", "context", "bridged", "SubgraphLimitError", "lanePairsStatus", "target", "mate", "asked", "ObservableCreate", "observer", "requestedPairs", "features"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as C}from"./chunk-
|
|
1
|
+
import{b as C}from"./chunk-7PVPO366.js";import"./chunk-3HSJ7SAT.js";import"./chunk-R34FRICP.js";import"./chunk-P76SUZFP.js";import{s as d}from"./chunk-N4ZFGZDN.js";import"./chunk-KIURR66K.js";import"./chunk-HFBUC6GF.js";import"./chunk-MPUAUZSJ.js";import"./chunk-LQSOJR7D.js";import"./chunk-VAWAASUT.js";import"./chunk-42VF2CSA.js";import"./chunk-YBLNN5FU.js";import"./chunk-CJ4VON23.js";import"./chunk-AQSLN3RH.js";import"./chunk-YBLNN5FU.js";import"./chunk-T7NMFIRW.js";import"./chunk-OSEQDKL3.js";import"./chunk-TMM73K4C.js";import"./chunk-FLKXKTS2.js";import"./chunk-M6YSANSW.js";import"./chunk-TC265JAP.js";import{i as L}from"./chunk-J2PN6CG3.js";import{A as l,F as G,H as p,e as s,j as v,o as n,x as y}from"./chunk-WE7DQVXF.js";import{a as h,b as e,c as r,d as i}from"./chunk-DUU6T2I5.js";var N=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}}),S=i(function({model:a}){let{classes:t}=N();return!a.error&&!a.loadCanceled?r(l,{className:t.paper,"data-testid":"graph-genome-loading",children:[r("div",{className:t.row,children:[e(v,{variant:"h6",message:a.statusMessage||void 0}),a.canCancelLoad?e(n,{size:"small","data-testid":"graph-genome-cancel",onClick:()=>{a.cancelLoad()},children:"Cancel"}):null]}),e(y,{variant:"indeterminate"})]}):a.error?e(l,{className:t.paper,children:e(s,{error:a.error,onReset:()=>{a.retryLoad()}})}):e(l,{className:t.paper,"data-testid":"graph-genome-load-canceled",children:r("div",{className:t.row,children:[e(p,{variant:"h6",children:"Loading canceled"}),e(n,{variant:"contained",size:"small","data-testid":"graph-genome-retry",onClick:()=>{a.retryLoad()},children:"Retry"})]})})}),f=S;var T=`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`,E=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"}}),F=i(function({model:a}){let{classes:t}=E(),[m,w]=L("");function u(){let o=m.trim();o&&a.openGfaLocation({uri:o,locationType:"UriLocation"})}function M(o){let c=o.target.files?.[0];o.target.value="",c&&a.loadGFAFile(c,c.name)}return r(l,{className:t.paper,children:[e("div",{className:t.header,children:e(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",e("input",{type:"file",accept:".gfa,.gfa1,.gfa2,.gz",hidden:!0,onChange:o=>{M(o)}})]}),e(p,{variant:"caption",color:"text.secondary",children:"Whole-file GFA; best for small/medium graphs."})]}),r("div",{className:t.rowEnd,children:[e(G,{size:"small",label:"URL",placeholder:"https://example.com/graph.gfa",value:m,onChange:o=>{w(o.target.value)},onKeyDown:o=>{o.key==="Enter"&&u()},className:t.flex1}),e(n,{variant:"contained",onClick:()=>{u()},disabled:!m.trim(),children:"Open"})]})]}),e("div",{className:t.footer,children:e(n,{size:"small",onClick:()=>{a.loadGFA(T,"Example graph")},children:"Load 4-node example"})}),a.error?e(s,{error:a.error}):null]})}),x=F;var B=i(function({model:a}){return a.hasGraph?e(C,{model:a}):a.canRetryLoad?e(f,{model:a}):r(h,{children:[a.isLoading?e(f,{model:a}):null,e("div",{hidden:a.isLoading,children:e(x,{model:a})})]})}),q=B;export{q as default};
|
|
10
|
-
//# sourceMappingURL=GraphGenomeView-
|
|
10
|
+
//# sourceMappingURL=GraphGenomeView-XFKLX3VQ.js.map
|
package/dist/chunks/{GraphTrackSettingsDialog-BRTDTVOJ.js → GraphTrackSettingsDialog-KOYYI2XH.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as G,b as L}from"./chunk-
|
|
1
|
+
import{a as G,b as L}from"./chunk-3HSJ7SAT.js";import{e as v,f as x,s as f}from"./chunk-N4ZFGZDN.js";import"./chunk-MPUAUZSJ.js";import"./chunk-LQSOJR7D.js";import"./chunk-AQSLN3RH.js";import"./chunk-T7NMFIRW.js";import"./chunk-OSEQDKL3.js";import"./chunk-TMM73K4C.js";import"./chunk-M6YSANSW.js";import{h as g,i as d}from"./chunk-J2PN6CG3.js";import{F as y,H as h,n as H}from"./chunk-WE7DQVXF.js";import{b as p,c as i,d as s}from"./chunk-DUU6T2I5.js";var k=f()({section:{marginBottom:24}}),w=[{value:"0",label:"None"},{value:"1",label:"1 hop"},{value:"2",label:"2 hops"}],F=s(function({model:t}){let{classes:o}=k(),e=t.sourceAdapter;return e?.type==="RgfaTabixAdapter"&&!v(e)?i("div",{className:o.section,children:[p(G,{label:"Graph context",sx:{minWidth:200},value:String(t.subgraphContext),options:w,testId:"graph-context-select",onChange:n=>{t.setSubgraphContext(Number(n)),t.recut()}}),p(h,{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}),M=F;var I=f()({section:{marginBottom:24}});function A(a){return a.split(/[\s,]+/).filter(t=>t!=="")}var N=(a,t)=>a.join(`
|
|
2
2
|
`)===t.join(`
|
|
3
3
|
`);function P(a,t){let o=a.cutHaplotypes??[],[e,n]=d(o);return N(o,e)||(n(o),t()),r=>{N(r,o)||(n(r),a.setSubgraphHaplotypes(r),a.recut())}}var D=s(function({model:t}){let[o,e]=d(t.cutHaplotypes?.join(", ")??""),n=P(t,()=>{e(t.cutHaplotypes?.join(", ")??"")}),r=()=>{n(A(o))};return p(y,{fullWidth:!0,label:"Haplotypes",placeholder:"every haplotype",value:o,slotProps:{htmlInput:{"data-testid":"graph-haplotypes-field"}},onChange:c=>{e(c.target.value)},onBlur:()=>{r()},onKeyDown:c=>{c.key==="Enter"&&r()}})}),B=s(function({model:t,names:o}){let[e,n]=d(t.cutHaplotypes??[]),r=g(e),c=g(""),[b,S]=d(!1),C=P(t,()=>{r.current=t.cutHaplotypes??[],n(r.current)});return p(H,{multiple:!0,freeSolo:!0,disableCloseOnSelect:!0,options:o,value:e,open:b,onOpen:()=>{S(!0)},onInputChange:(u,l)=>{c.current=l},onClose:(u,l)=>{S(!1);let m=c.current.trim();l==="blur"&&m&&!r.current.includes(m)&&(r.current=[...r.current,m],n(r.current)),C(r.current)},onChange:(u,l)=>{r.current=l,n(l),b||C(l)},renderInput:u=>p(y,{...u,label:"Haplotypes",placeholder:e.length===0?"every haplotype":void 0,slotProps:{...u.slotProps,htmlInput:{...u.slotProps.htmlInput,"data-testid":"graph-haplotypes-field"}}})})}),O=s(function({model:t}){let{classes:o}=I(),e=t.haplotypeNames,n=t.sourceAdapter;return n&&x(n)?i("div",{className:o.section,children:[e?p(B,{model:t,names:e}):p(D,{model:t}),i(h,{variant:"caption",component:"div",color:"text.secondary",children:[e?`Which of the graph's ${e.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}),T=O;var ot=s(function({model:t,onClose:o}){return i(L,{model:t,onClose:o,children:[p(M,{model:t}),p(T,{model:t})]})});export{ot as default};
|
|
4
|
-
//# sourceMappingURL=GraphTrackSettingsDialog-
|
|
4
|
+
//# sourceMappingURL=GraphTrackSettingsDialog-KOYYI2XH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{x as v,y as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=HighlightColorDialog-
|
|
1
|
+
import{x as v,y as C}from"./chunk-HFBUC6GF.js";import"./chunk-LQSOJR7D.js";import"./chunk-AQSLN3RH.js";import"./chunk-OSEQDKL3.js";import{F as h,H as r,d as m,o as y,q as c,r as d,z as g}from"./chunk-WE7DQVXF.js";import{a as u,b as l,c as p,d as s}from"./chunk-DUU6T2I5.js";var f=s(function({model:o,onClose:t}){return p(m,{open:!0,onClose:t,title:"Color highlighted haplotypes",children:[p(d,{sx:{display:"grid",gridTemplateColumns:"auto 1fr 1fr",alignItems:"center",gap:1.5},children:[l(r,{variant:"subtitle2",children:"Haplotype"}),l(r,{variant:"subtitle2",children:"Color by"}),l(r,{variant:"subtitle2",children:"Palette"}),o.drawnWalks.map(({name:a,encoding:n})=>l(S,{label:o.walkLabel(a),field:n.field,scheme:n.scheme,onField:i=>{o.setWalkColor(a,{field:i})},onScheme:i=>{o.setWalkColor(a,{scheme:i})}},a))]}),l(c,{children:l(y,{variant:"contained",onClick:t,children:"Done"})})]})}),S=s(function({label:o,field:t,scheme:a,onField:n,onScheme:i}){return p(u,{children:[l(r,{variant:"body2",children:o}),l(h,{select:!0,size:"small",value:t,slotProps:{select:{SelectDisplayProps:{"aria-label":`Color ${o} by`}}},onChange:e=>{n(e.target.value)},children:v.map(e=>l(g,{value:e.value,children:e.label},e.value))}),l(h,{select:!0,size:"small",value:a,slotProps:{select:{SelectDisplayProps:{"aria-label":`Palette for ${o}`}}},onChange:e=>{i(e.target.value)},children:C.filter(e=>e.value!=="rainbow"||t==="reference").map(e=>l(g,{value:e.value,children:e.label},e.value))})]})}),T=f;export{T as default};
|
|
2
|
+
//# sourceMappingURL=HighlightColorDialog-F4IARMEO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b as i}from"./chunk-7PVPO366.js";import"./chunk-3HSJ7SAT.js";import"./chunk-R34FRICP.js";import"./chunk-P76SUZFP.js";import"./chunk-N4ZFGZDN.js";import"./chunk-KIURR66K.js";import"./chunk-HFBUC6GF.js";import"./chunk-MPUAUZSJ.js";import"./chunk-LQSOJR7D.js";import"./chunk-VAWAASUT.js";import"./chunk-42VF2CSA.js";import"./chunk-YBLNN5FU.js";import"./chunk-CJ4VON23.js";import"./chunk-AQSLN3RH.js";import"./chunk-YBLNN5FU.js";import"./chunk-T7NMFIRW.js";import"./chunk-OSEQDKL3.js";import"./chunk-TMM73K4C.js";import"./chunk-FLKXKTS2.js";import"./chunk-M6YSANSW.js";import"./chunk-TC265JAP.js";import"./chunk-J2PN6CG3.js";import"./chunk-WE7DQVXF.js";import{b as o,d as t}from"./chunk-DUU6T2I5.js";var e=JBrowseExports["@jbrowse/display-kit/DisplayChrome"];var s=e&&e.__esModule?e.default:e;var p=t(function({model:r}){return o(s,{model:r,factory:a,testid:"linear-graph-display","data-layout":r.chosenLayoutMode,"data-cut-tier":r.cutTier,"data-recuts":r.recuts,"data-node-count":r.hasGraph?r.nodeCount:void 0,"data-loading":r.isLoading?"":void 0,style:{width:r.paneWidth,height:r.height,overflow:"hidden"},children:n=>o(i,{model:r,handle:n})})}),c=p;export{c as default};
|
|
2
|
+
//# sourceMappingURL=LinearGraphDisplay-BZ44C6S3.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as c,d,f as h}from"./chunk-VAWAASUT.js";import{a as f}from"./chunk-V55TK2NP.js";import{D as p,F as u,G as g,b,y as m}from"./chunk-AXUXLPO3.js";import"./chunk-YBLNN5FU.js";import"./chunk-T7NMFIRW.js";import"./chunk-OSEQDKL3.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import"./chunk-M6YSANSW.js";import{a as i,o as l}from"./chunk-TC265JAP.js";var a=class extends b{constructor(){super(...arguments);this.bubbles=p(this,["bubblesLocation"],["index"]);this.refNames=new g(u(this.bubbles),this)}static{this.capabilities=["getFeatures","getRefNames"]}async getRefNames(t={}){return this.refNames.assemblyRefNames(t)}async getRegionByteSize(t,s={}){return this.refNames.regionBytes(t,s)}async hasDataForRefName(){return!0}getFeatures(t,s={}){let{signal:n,statusCallback:N}=s;return f(async r=>{let o=await this.refNames.resolveMapped(t,s);o!==void 0&&await l("Downloading bubbles",N,()=>m(this.bubbles,o,t.start,t.end,{signal:n,lineCallback:(y,A)=>{let e=c(y);r.next(new i({uniqueId:`bubble-${A}`,refName:t.refName,start:e.start,end:e.end,name:d(e),description:h(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}))}})),r.complete()},n)}};export{a as default};
|
|
2
|
+
//# sourceMappingURL=MinigraphBubbleAdapter-2KIWDIY7.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, tabixRefNames } from '../panSNTabix.ts'\nimport { getLines } from '../tabixRange.ts'\n\nimport type { MinigraphBubbleAdapterConfig } from './configSchema.ts'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\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 = openTabixSlot(this, ['bubblesLocation'], ['index'])\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 = new PanSNRefNames(\n tabixRefNames(this.bubbles),\n this,\n )\n\n async getRefNames(opts: BaseOptions = {}) {\n return this.refNames.assemblyRefNames(opts)\n }\n\n async getRegionByteSize(regions: Region[], opts: BaseOptions = {}) {\n return this.refNames.regionBytes(regions, 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.resolveMapped(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": "+WAiBA,IAAqBA,EAArB,cAAoDC,CAAqD,CAAzG,kCAGE,KAAiB,QAAUC,EAAc,KAAM,CAAC,iBAAiB,EAAG,CAAC,OAAO,CAAC,EAK7E,KAAiB,SAAW,IAAIC,EAC9BC,EAAc,KAAK,OAAO,EAC1B,IACF,EAVA,YAAc,aAAe,CAAC,cAAe,aAAa,EAY1D,MAAM,YAAYC,EAAoB,CAAC,EAAG,CACxC,OAAO,KAAK,SAAS,iBAAiBA,CAAI,CAC5C,CAEA,MAAM,kBAAkBC,EAAmBD,EAAoB,CAAC,EAAG,CACjE,OAAO,KAAK,SAAS,YAAYC,EAASD,CAAI,CAChD,CAEA,MAAa,mBAAoB,CAC/B,MAAO,EACT,CAEA,YAAYE,EAAeF,EAAoB,CAAC,EAAG,CACjD,GAAM,CAAE,OAAAG,EAAQ,eAAAC,CAAe,EAAIJ,EACnC,OAAOK,EAA0B,MAAMC,GAAY,CACjD,IAAMC,EAAe,MAAM,KAAK,SAAS,cAAcL,EAAOF,CAAI,EAC9DO,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", "openTabixSlot", "PanSNRefNames", "tabixRefNames", "opts", "regions", "query", "signal", "statusCallback", "ObservableCreate", "observer", "tabixRefName", "updateStatus", "getLines", "line", "fileOffset", "bubble", "parseBubbleLine", "SimpleFeature", "bubbleLabel", "bubbleDescription"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y}from"./chunk-ZXJRZKWF.js";import"./chunk-TLUGH4VW.js";import{a as F}from"./chunk-V55TK2NP.js";import"./chunk-YBLNN5FU.js";import"./chunk-CJ4VON23.js";import"./chunk-AQSLN3RH.js";import{D as p,E as R,F as c,G as d,b as u,t as w,u as b,v as k,w as x,x as N,y as f}from"./chunk-AXUXLPO3.js";import"./chunk-YBLNN5FU.js";import"./chunk-T7NMFIRW.js";import"./chunk-OSEQDKL3.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import{e as g}from"./chunk-M6YSANSW.js";import{a as m,o as l}from"./chunk-TC265JAP.js";var h=class extends u{constructor(){super(...arguments);this.fine=this.openIndex([])}static{this.capabilities=["getFeatures","getRefNames"]}openIndex(e){let t=this.getConf("walksLocation"),n=e.length===0&&g(t)?new y(R(this),this):void 0,r=e.length===0?this.getConf("graphLocation"):this.getConf(["coarse","graphLocation"]);if(g(r)){let s=p(this,[...e,"graphLocation"],[...e,"graphIndex"]);return{graph:s,walks:n,refNames:new d(n?.source??c(s),this)}}let a=p(this,[...e,"segmentsLocation"],[...e,"segmentsIndex"]),i=p(this,[...e,"linksLocation"],[...e,"linksIndex"]);return{segments:a,links:i,walks:n,refNames:new d(n?.source??c(a),this)}}async getHaplotypeNames(e={}){return this.fine.walks?.haplotypeNames(e)}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 getRegionByteSize(e,t={}){return this.fine.refNames.regionBytes(e,t)}async hasDataForRefName(){return!0}getFeatures(e,t={}){return F(async n=>{let r=await this.fine.refNames.resolveMapped(e,t);if(r!==void 0){let{walks:a}=this.fine,i=s=>{n.next(s)};await(a?this.walkFeatures(a,r,e,t,i):this.segmentFeatures(r,e,t,i))}n.complete()},t.signal)}async walkFeatures(e,t,n,r,a){let i=await l("Downloading walks",r.statusCallback,()=>e.referenceNodes(t,n,r));for(let s of i){let o=String(s.id);a(new m({uniqueId:o,refName:n.refName,start:s.start,end:s.end,name:o,type:"segment",rank:0,stableName:s.refName}))}}async segmentRows(e,t,n,r){let a=this.fine;if("graph"in a){let i=k(await a.graph.getHeaderLines({signal:n.signal}));return f(a.graph,e,t.start,t.end,{signal:n.signal,lineCallback:s=>{let o=x(s,i);o?.kind==="N"&&r(o.segment,i.anchored)}})}return f(a.segments,e,t.start,t.end,{signal:n.signal,lineCallback:i=>{let{segment:s,anchored:o}=w(i);r(s,o)}})}async segmentFeatures(e,t,n,r){await l("Downloading segments",n.statusCallback,()=>this.segmentRows(e,t,n,(a,i)=>{if(i&&a.refName!==e)return;let s=b(a);r(new m({uniqueId:a.id,refName:t.refName,start:a.start,end:a.end,name:a.id,type:"segment",rank:a.rank,stableName:a.refName,...s&&{samples:s,sampleCount:s.length}}))}))}async getSubgraph(e,t={}){let{hops:n,signal:r,tier:a}=t,i=this.index(a),s=await i.refNames.resolveForCut(e,{signal:r});return i.walks?i.walks.subgraph(s,e,t):N(i,{refName:s,start:e.start,end:e.end},{hops:n,signal:r})}};export{h as default};
|
|
2
|
+
//# sourceMappingURL=RgfaTabixAdapter-7QKNUHKX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/RgfaTabixAdapter/RgfaTabixAdapter.ts"],
|
|
4
|
+
"sourcesContent": ["import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { SimpleFeature, updateStatus } from '@jbrowse/core/util'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\nimport {\n parseGraphHeader,\n parseGraphRow,\n parseSegmentRow,\n rgfaCut,\n segmentSamples,\n} from '@jbrowse/graph-walks'\n\nimport { locationIsSet } from '../locationName.ts'\nimport {\n PanSNRefNames,\n openTabixSlot,\n openWalkReader,\n tabixRefNames,\n} from '../panSNTabix.ts'\nimport { getLines } from '../tabixRange.ts'\nimport { WalkIndex } from './walkReader.ts'\n\nimport type { RgfaTabixAdapterConfig } from './configSchema.ts'\nimport type { SubgraphAdapterOptions, SubgraphTier } from '../GetSubgraph.ts'\nimport type { WalkCut } from './walkCut.ts'\nimport type { TabixIndexedFile } from '@gmod/tabix'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport type { Feature } from '@jbrowse/core/util'\nimport type { FileLocation, Region } from '@jbrowse/core/util/types'\nimport type { RgfaSegment } from '@jbrowse/graph-walks'\n\n// gfa-to-tabix's format 1 pair, or format 2's one file\ntype GraphIndex = (\n | { segments: TabixIndexedFile; links: TabixIndexedFile }\n | { graph: TabixIndexedFile }\n) & {\n walks?: WalkIndex\n refNames: PanSNRefNames\n}\n\nexport default class RgfaTabixAdapter extends BaseFeatureDataAdapter<RgfaTabixAdapterConfig> {\n public static capabilities = ['getFeatures', 'getRefNames']\n\n private readonly fine = this.openIndex([])\n private coarse: GraphIndex | undefined\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. Format 2's one file names them all. A walk-indexed graph's\n // walk file names the same sequences, and it has no segment file.\n private openIndex(under: string[]): GraphIndex {\n const walksLocation: FileLocation = this.getConf('walksLocation')\n const walks =\n under.length === 0 && locationIsSet(walksLocation)\n ? new WalkIndex(openWalkReader(this), this)\n : undefined\n const graphLocation: FileLocation =\n under.length === 0\n ? this.getConf('graphLocation')\n : this.getConf(['coarse', 'graphLocation'])\n if (locationIsSet(graphLocation)) {\n const graph = openTabixSlot(\n this,\n [...under, 'graphLocation'],\n [...under, 'graphIndex'],\n )\n return {\n graph,\n walks,\n refNames: new PanSNRefNames(\n walks?.source ?? tabixRefNames(graph),\n this,\n ),\n }\n }\n const segments = openTabixSlot(\n this,\n [...under, 'segmentsLocation'],\n [...under, 'segmentsIndex'],\n )\n const links = openTabixSlot(\n this,\n [...under, 'linksLocation'],\n [...under, 'linksIndex'],\n )\n return {\n segments,\n links,\n walks,\n refNames: new PanSNRefNames(\n walks?.source ?? tabixRefNames(segments),\n this,\n ),\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 return this.fine.walks?.haplotypeNames(opts)\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 async getRegionByteSize(regions: Region[], opts: BaseOptions = {}) {\n return this.fine.refNames.regionBytes(regions, opts)\n }\n\n public async hasDataForRefName() {\n return true\n }\n\n getFeatures(query: Region, opts: BaseOptions = {}) {\n return ObservableCreate<Feature>(async observer => {\n const tabixRefName = await this.fine.refNames.resolveMapped(query, opts)\n if (tabixRefName !== undefined) {\n const { walks } = this.fine\n const emit = (feature: Feature) => {\n observer.next(feature)\n }\n await (walks\n ? this.walkFeatures(walks, tabixRefName, query, opts, emit)\n : this.segmentFeatures(tabixRefName, query, opts, emit))\n }\n observer.complete()\n }, opts.signal)\n }\n\n // A walk-indexed graph's reference nodes are its ref rows' steps\n private async walkFeatures(\n walks: WalkIndex,\n tabixRefName: string,\n query: Region,\n opts: BaseOptions,\n emit: (feature: Feature) => void,\n ) {\n const nodes = await updateStatus(\n 'Downloading walks',\n opts.statusCallback,\n () => walks.referenceNodes(tabixRefName, query, opts),\n )\n for (const node of nodes) {\n const id = String(node.id)\n emit(\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\n // Each segment row under the window, from the segment file or from format\n // 2's node rows, with whether the index is anchored\n private async segmentRows(\n tabixRefName: string,\n query: Region,\n opts: BaseOptions,\n each: (segment: RgfaSegment, anchored: boolean) => void,\n ) {\n const index = this.fine\n if ('graph' in index) {\n const header = parseGraphHeader(\n await index.graph.getHeaderLines({ signal: opts.signal }),\n )\n return getLines(index.graph, tabixRefName, query.start, query.end, {\n signal: opts.signal,\n lineCallback: line => {\n const row = parseGraphRow(line, header)\n if (row?.kind === 'N') {\n each(row.segment, header.anchored)\n }\n },\n })\n }\n return getLines(index.segments, tabixRefName, query.start, query.end, {\n signal: opts.signal,\n lineCallback: line => {\n const { segment, anchored } = parseSegmentRow(line)\n each(segment, anchored)\n },\n })\n }\n\n private async segmentFeatures(\n tabixRefName: string,\n query: Region,\n opts: BaseOptions,\n emit: (feature: Feature) => void,\n ) {\n await updateStatus('Downloading segments', opts.statusCallback, () =>\n this.segmentRows(tabixRefName, query, opts, (segment, anchored) => {\n // An anchored index also returns the alleles under the region,\n // which lie on other stable sequences and have no place on this one\n if (anchored && segment.refName !== tabixRefName) {\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 emit(\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 // The graph around a region for GraphGenomeView: GFA text (rgfaCut), or a\n // walk-indexed graph's tables (WalkIndex.subgraph). `tier: 'coarse'` reads\n // the `coarse` pair instead, the same way.\n async getSubgraph(\n region: Region,\n opts: SubgraphAdapterOptions = {},\n ): Promise<string | WalkCut> {\n const { hops, signal, tier } = opts\n const index = this.index(tier)\n const tabixRefName = await index.refNames.resolveForCut(region, { signal })\n if (index.walks) {\n return index.walks.subgraph(tabixRefName, region, opts)\n }\n return rgfaCut(\n index,\n { refName: tabixRefName, start: region.start, end: region.end },\n { hops, signal },\n )\n }\n}\n"],
|
|
5
|
+
"mappings": "ihBAuCA,IAAqBA,EAArB,cAA8CC,CAA+C,CAA7F,kCAGE,KAAiB,KAAO,KAAK,UAAU,CAAC,CAAC,EAFzC,YAAc,aAAe,CAAC,cAAe,aAAa,EASlD,UAAUC,EAA6B,CAC7C,IAAMC,EAA8B,KAAK,QAAQ,eAAe,EAC1DC,EACJF,EAAM,SAAW,GAAKG,EAAcF,CAAa,EAC7C,IAAIG,EAAUC,EAAe,IAAI,EAAG,IAAI,EACxC,OACAC,EACJN,EAAM,SAAW,EACb,KAAK,QAAQ,eAAe,EAC5B,KAAK,QAAQ,CAAC,SAAU,eAAe,CAAC,EAC9C,GAAIG,EAAcG,CAAa,EAAG,CAChC,IAAMC,EAAQC,EACZ,KACA,CAAC,GAAGR,EAAO,eAAe,EAC1B,CAAC,GAAGA,EAAO,YAAY,C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GjE,GAAIA,GAAYD,EAAQ,UAAYhB,EAClC,OAMF,IAAMmB,EAAUC,EAAeJ,CAAO,EACtCf,EACE,IAAIM,EAAc,CAChB,SAAUS,EAAQ,GAClB,QAASnB,EAAM,QACf,MAAOmB,EAAQ,MACf,IAAKA,EAAQ,IACb,KAAMA,EAAQ,GACd,KAAM,UACN,KAAMA,EAAQ,KACd,WAAYA,EAAQ,QACpB,GAAIG,GAAW,CAAE,QAAAA,EAAS,YAAaA,EAAQ,MAAO,CACxD,CAAC,CACH,CACF,CAAC,CACH,CACF,CAKA,MAAM,YACJE,EACA3B,EAA+B,CAAC,EACL,CAC3B,GAAM,CAAE,KAAA4B,EAAM,OAAAC,EAAQ,KAAA5B,CAAK,EAAID,EACzBe,EAAQ,KAAK,MAAMd,CAAI,EACvBK,EAAe,MAAMS,EAAM,SAAS,cAAcY,EAAQ,CAAE,OAAAE,CAAO,CAAC,EAC1E,OAAId,EAAM,MACDA,EAAM,MAAM,SAAST,EAAcqB,EAAQ3B,CAAI,EAEjD8B,EACLf,EACA,CAAE,QAAST,EAAc,MAAOqB,EAAO,MAAO,IAAKA,EAAO,GAAI,EAC9D,CAAE,KAAAC,EAAM,OAAAC,CAAO,CACjB,CACF,CACF",
|
|
6
|
+
"names": ["RgfaTabixAdapter", "BaseFeatureDataAdapter", "under", "walksLocation", "walks", "locationIsSet", "WalkIndex", "openWalkReader", "graphLocation", "graph", "openTabixSlot", "PanSNRefNames", "tabixRefNames", "segments", "links", "opts", "tier", "regions", "query", "ObservableCreate", "observer", "tabixRefName", "emit", "feature", "nodes", "updateStatus", "node", "id", "SimpleFeature", "each", "index", "header", "parseGraphHeader", "getLines", "line", "row", "parseGraphRow", "segment", "anchored", "parseSegmentRow", "samples", "segmentSamples", "region", "hops", "signal", "rgfaCut"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{H as i,h as o,m as a}from"./chunk-WE7DQVXF.js";import{c as r,d as e}from"./chunk-DUU6T2I5.js";var u=e(function({model:n,title:s,children:l,handleClose:m}){return r(o,{open:!0,title:s,onClose:()=>{m()},children:[l,n.trackWarnings.flatMap(({name:f,warnings:g},p)=>g.map((t,c)=>r(a,{severity:"warning",style:{marginBottom:8},children:[r(i,{variant:"subtitle2",children:[f,": ",t.message]}),t.effect]},`${p}_${c}`)))]})}),x=u;export{x as default};
|
|
2
|
-
//# sourceMappingURL=TrackWarningsDialog-
|
|
2
|
+
//# sourceMappingURL=TrackWarningsDialog-V5YSUFRO.js.map
|
package/dist/chunks/{TrackWarningsDialog-23WL6FPV.js.map → TrackWarningsDialog-V5YSUFRO.js.map}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/.pnpm/@jbrowse+synteny-core@5.0.0-beta.
|
|
3
|
+
"sources": ["../../node_modules/.pnpm/@jbrowse+synteny-core@5.0.0-beta.20_@emotion+react@11.14.0_@types+react@19.3.0_react@19_56a3e322b5b3da42dc5bccc6b71729c9/node_modules/@jbrowse/synteny-core/esm/TrackWarningsDialog.js"],
|
|
4
4
|
"sourcesContent": ["import { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { InfoDialog } from '@jbrowse/core/ui';\nimport { Alert, Typography } from '@mui/material';\nimport { observer } from 'mobx-react';\n/**\n * The render-warnings report both comparative views open, over the rows\n * `collectTrackWarnings` builds for them. Reads them off the view rather than\n * taking a copy, so a refetch that raises or clears a warning while the dialog\n * is open shows in it.\n *\n * Grouped by track, with the track name leading each row: a stacked view's\n * levels raise the same swapped-assemblies warning verbatim, and so does every\n * overlaid track that hits it, so an ungrouped list repeated one sentence N\n * times without ever naming the file to go fix.\n *\n * Keyed by position \u2014 the message is not an identity, and neither is the track\n * name once one track raises two warnings.\n */\nconst TrackWarningsDialog = observer(function TrackWarningsDialog({ model, title, children, handleClose, }) {\n return (_jsxs(InfoDialog, { open: true, title: title, onClose: () => {\n handleClose();\n }, children: [children, model.trackWarnings.flatMap(({ name, warnings }, i) => warnings.map((w, j) => (_jsxs(Alert\n // eslint-disable-next-line @eslint-react/no-array-index-key -- see above\n , { severity: \"warning\", style: { marginBottom: 8 }, children: [_jsxs(Typography, { variant: \"subtitle2\", children: [name, \": \", w.message] }), w.effect] }, `${i}_${j}`))))] }));\n});\nexport default TrackWarningsDialog;\n"],
|
|
5
5
|
"mappings": "qGAkBA,IAAMA,EAAsBC,EAAS,SAA6B,CAAE,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,YAAAC,CAAa,EAAG,CACxG,OAAQC,EAAMC,EAAY,CAAE,KAAM,GAAM,MAAOJ,EAAO,QAAS,IAAM,CAC7DE,EAAY,CAChB,EAAG,SAAU,CAACD,EAAUF,EAAM,cAAc,QAAQ,CAAC,CAAE,KAAAM,EAAM,SAAAC,CAAS,EAAGC,IAAMD,EAAS,IAAI,CAACE,EAAGC,IAAON,EAAMO,EAEvG,CAAE,SAAU,UAAW,MAAO,CAAE,aAAc,CAAE,EAAG,SAAU,CAACP,EAAMQ,EAAY,CAAE,QAAS,YAAa,SAAU,CAACN,EAAM,KAAMG,EAAE,OAAO,CAAE,CAAC,EAAGA,EAAE,MAAM,CAAE,EAAG,GAAGD,CAAC,IAAIE,CAAC,EAAE,CAAE,CAAC,CAAC,CAAE,CAAC,CAC3L,CAAC,EACMG,EAAQf",
|
|
6
6
|
"names": ["TrackWarningsDialog", "observer", "model", "title", "children", "handleClose", "jsxs", "InfoDialog", "name", "warnings", "i", "w", "j", "Alert", "Typography", "TrackWarningsDialog_default"]
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as b,b as k,c as x,d as C,f,g as R,h as v}from"./chunk-Y4TLRGAC.js";import{a as $}from"./chunk-V55TK2NP.js";import{E as S,b as l,d as g,e as w,f as h,g as m,n as y,r as B,s as F}from"./chunk-AXUXLPO3.js";import"./chunk-YBLNN5FU.js";import"./chunk-T7NMFIRW.js";import"./chunk-OSEQDKL3.js";import"./chunk-D6TY2QEG.js";import"./chunk-FLKXKTS2.js";import"./chunk-M6YSANSW.js";import{a as d,o as u}from"./chunk-TC265JAP.js";var N=r=>`${(r/1e6).toFixed(1)} MB`,P=r=>`${(r/1e6).toFixed(1)} M`;function O(r,p){if(!(r instanceof g))return r;let t=x(p);if(r instanceof B)return new Error(`The pinned window ${t} is too large to read every walk in full for structural forms: its walks take ${P(r.steps)} steps, over the ${P(r.limit)} step budget, and about ${m(r.fitsBp)} of it fits. Pin a narrower window`);let e=`walkByteBudget, ${N(r.limit)}`;return new Error(`The pinned window ${t} is too large to cut for structural forms: ${r.zoomHelps?`about ${m(r.fitsBp)} of it fits in ${e}. Pin a narrower window or raise walkByteBudget`:`its cut fetches ${N(r.bytes??0)}, over ${e}. Raise walkByteBudget`}`)}var T=8,i=new Map;function E(r,p){let t=i.get(r),e=t??p();if(i.delete(r),i.set(r,e),!t){e.catch(()=>{i.get(r)===e&&i.delete(r)});for(let s of i.keys()){if(i.size<=T)break;i.delete(s)}}return e}var c=class extends l{constructor(){super(...arguments);this.reader=S(this)}static{this.capabilities=["getFeatures","getRefNames"]}async referenceSample(t){let{references:e}=await this.reader.header(t);return e[0]??""}async getRefNames(t={}){let e=await this.reader.referenceSequences(t),s=await this.referenceSample(t),a=e.filter(o=>h(o,s)).map(o=>w(o));return a.length>0?[...new Set(a)]:e}pinned(){let t=b(this.getConf("pinned"));if(!t)throw new Error("WalkFormsAdapter needs `pinned`, the window its forms come from: { refName, start, end }");return t}forms(t){if(!this.formsRead){let e=this.pinned(),s=`${JSON.stringify(this.getConf("walksLocation"))} ${e.refName}:${e.start}-${e.end}`,a=this.getConf("walkByteBudget"),o=E(`${s} ${a}`,()=>u("Cutting walks",t.statusCallback,()=>F(this.reader,e,{byteBudget:a,partial:!1}).catch(n=>{throw O(n,e)}))).then(n=>y(n,{window:e,floorBp:k(this.getConf("floorBp")),exclude:this.getConf("exclude")}));o.catch(()=>{this.formsRead===o&&(this.formsRead=void 0)}),this.formsRead=o}return this.formsRead}maxForms(){return this.getConf("maxForms")}async getSourcesAndWarnings(t={}){let e=await this.forms(t),s=C(this.pinned());return{sources:f(e,this.maxForms()),warnings:R(e,this.maxForms()).map(a=>s+a)}}async getSources(t,e={}){return f(await this.forms(e),this.maxForms())}async onPinnedSequence(t,e){let s=await this.referenceSample(e),[a,o]=await Promise.all([this.reader.sequenceFor(s,t,e),this.reader.sequenceFor(s,this.pinned().refName,e)]);return a!==void 0&&a===o}getFeatures(t,e={}){return $(async s=>{let a=await this.forms(e),o=await this.onPinnedSequence(t.refName,e)?v(a,this.maxForms()).filter(n=>n.start<t.end&&n.end>t.start):[];for(let n of o)s.next(new d({uniqueId:`forms-${a.floorBp}-${n.id}`,refName:t.refName,start:n.start,end:n.end,name:n.name,description:n.description,type:n.type,svType:n.svType,consequence:n.consequence,REF:"N",ALT:[n.alt],INFO:{SVTYPE:[n.svType],SVLEN:[n.mark.delta]},mark:n.mark,genotypes:n.genotypes}));s.complete()},e.signal)}};export{c as default};
|
|
2
|
+
//# sourceMappingURL=WalkFormsAdapter-5NDOULY6.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/WalkFormsAdapter/WalkFormsAdapter.ts"],
|
|
4
|
+
"sourcesContent": ["import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport { SimpleFeature, updateStatus } from '@jbrowse/core/util'\nimport { ObservableCreate } from '@jbrowse/core/util/rxjs'\nimport {\n ExpansionTooLargeError,\n RegionTooLargeError,\n bpString,\n formsCut,\n panSNContig,\n panSNMatchesPrefix,\n structuralForms,\n} from '@jbrowse/graph-walks'\n\nimport { formSources, formVariants, formWarnings } from './formRows.ts'\nimport { floorOf, pinnedLocus, pinnedOf, warningPrefix } from './pinned.ts'\nimport { openWalkReader } from '../panSNTabix.ts'\n\nimport type { WalkFormsAdapterConfig } from './configSchema.ts'\nimport type { Pinned } from './pinned.ts'\nimport type { BaseOptions } from '@jbrowse/core/data_adapters/BaseAdapter'\nimport type { Feature } from '@jbrowse/core/util'\nimport type { Region } from '@jbrowse/core/util/types'\nimport type { HaplotypeDepartures, StructuralForms } from '@jbrowse/graph-walks'\n\nconst megabytes = (bytes: number) => `${(bytes / 1_000_000).toFixed(1)} MB`\n\nconst millions = (n: number) => `${(n / 1_000_000).toFixed(1)} M`\n\n// A zoom-in notice would mislead, since the view's zoom does not move the\n// pinned window\nfunction pinnedTooLarge(error: unknown, pinned: Pinned) {\n if (!(error instanceof RegionTooLargeError)) {\n return error\n }\n const window = pinnedLocus(pinned)\n if (error instanceof ExpansionTooLargeError) {\n return new Error(\n `The pinned window ${window} is too large to read every walk in full for structural forms: its walks take ${millions(error.steps)} steps, over the ${millions(error.limit)} step budget, and about ${bpString(error.fitsBp)} of it fits. Pin a narrower window`,\n )\n }\n const budget = `walkByteBudget, ${megabytes(error.limit)}`\n return new Error(\n `The pinned window ${window} is too large to cut for structural forms: ${\n error.zoomHelps\n ? `about ${bpString(error.fitsBp)} of it fits in ${budget}. Pin a narrower window or raise walkByteBudget`\n : `its cut fetches ${megabytes(error.bytes ?? 0)}, over ${budget}. Raise walkByteBudget`\n }`,\n )\n}\n\n// The departures of each pinned window, shared across adapter instances:\n// dataAdapterCache keys an adapter on its whole config, so a new floor or\n// exclude list makes a new adapter, which regroups these without a new cut.\n// A cut at the MHC takes 8 s.\nconst CUTS_KEPT = 8\nconst cuts = new Map<string, Promise<HaplotypeDepartures[]>>()\n\nfunction cachedCut(key: string, cut: () => Promise<HaplotypeDepartures[]>) {\n const kept = cuts.get(key)\n const read = kept ?? cut()\n cuts.delete(key)\n cuts.set(key, read)\n if (!kept) {\n read.catch(() => {\n if (cuts.get(key) === read) {\n cuts.delete(key)\n }\n })\n for (const old of cuts.keys()) {\n if (cuts.size <= CUTS_KEPT) {\n break\n }\n cuts.delete(old)\n }\n }\n return read\n}\n\nexport default class WalkFormsAdapter extends BaseFeatureDataAdapter<WalkFormsAdapterConfig> {\n public static capabilities = ['getFeatures', 'getRefNames']\n\n private readonly reader = openWalkReader(this)\n\n private formsRead: Promise<StructuralForms> | undefined\n\n private async referenceSample(opts: BaseOptions) {\n const { references } = await this.reader.header(opts)\n return references[0] ?? ''\n }\n\n // The reference sample's contigs, as the assembly names them\n async getRefNames(opts: BaseOptions = {}) {\n const names = await this.reader.referenceSequences(opts)\n const sample = await this.referenceSample(opts)\n const contigs = names\n .filter(n => panSNMatchesPrefix(n, sample))\n .map(n => panSNContig(n))\n return contigs.length > 0 ? [...new Set(contigs)] : names\n }\n\n private pinned() {\n const pinned = pinnedOf(this.getConf('pinned'))\n if (!pinned) {\n throw new Error(\n 'WalkFormsAdapter needs `pinned`, the window its forms come from: { refName, start, end }',\n )\n }\n return pinned\n }\n\n // Read once per adapter, and so once per floor and exclude list. The cut\n // takes no caller's signal, since every later caller shares it. A partial\n // expansion would leave some walks as net changes over a whole tile, so a\n // window too large to read them all errors instead.\n private forms(opts: BaseOptions) {\n if (!this.formsRead) {\n const pinned = this.pinned()\n const key = `${JSON.stringify(this.getConf('walksLocation'))}\\t${pinned.refName}:${pinned.start}-${pinned.end}`\n const byteBudget = this.getConf('walkByteBudget')\n const read = cachedCut(`${key}\\t${byteBudget}`, () =>\n updateStatus('Cutting walks', opts.statusCallback, () =>\n formsCut(this.reader, pinned, { byteBudget, partial: false }).catch(\n (error: unknown) => {\n throw pinnedTooLarge(error, pinned)\n },\n ),\n ),\n ).then(departures =>\n structuralForms(departures, {\n window: pinned,\n floorBp: floorOf(this.getConf('floorBp')),\n exclude: this.getConf('exclude'),\n }),\n )\n read.catch(() => {\n if (this.formsRead === read) {\n this.formsRead = undefined\n }\n })\n this.formsRead = read\n }\n return this.formsRead\n }\n\n private maxForms() {\n return this.getConf('maxForms')\n }\n\n /**\n * One source per form up to maxForms, which core's multi-sample variant\n * display draws as a row, and warnings naming the haplotypes left\n * abridged, unplaced or in the \"other forms\" row\n */\n async getSourcesAndWarnings(opts: BaseOptions = {}) {\n const result = await this.forms(opts)\n const prefix = warningPrefix(this.pinned())\n return {\n sources: formSources(result, this.maxForms()),\n warnings: formWarnings(result, this.maxForms()).map(w => prefix + w),\n }\n }\n\n async getSources(_regions: Region[], opts: BaseOptions = {}) {\n return formSources(await this.forms(opts), this.maxForms())\n }\n\n private async onPinnedSequence(refName: string, opts: BaseOptions) {\n const sample = await this.referenceSample(opts)\n const [query, pinned] = await Promise.all([\n this.reader.sequenceFor(sample, refName, opts),\n this.reader.sequenceFor(sample, this.pinned().refName, opts),\n ])\n return query !== undefined && query === pinned\n }\n\n getFeatures(query: Region, opts: BaseOptions = {}) {\n return ObservableCreate<Feature>(async observer => {\n const result = await this.forms(opts)\n const variants = (await this.onPinnedSequence(query.refName, opts))\n ? formVariants(result, this.maxForms()).filter(\n v => v.start < query.end && v.end > query.start,\n )\n : []\n for (const v of variants) {\n observer.next(\n new SimpleFeature({\n uniqueId: `forms-${result.floorBp}-${v.id}`,\n refName: query.refName,\n start: v.start,\n end: v.end,\n name: v.name,\n description: v.description,\n type: v.type,\n svType: v.svType,\n consequence: v.consequence,\n REF: 'N',\n ALT: [v.alt],\n INFO: { SVTYPE: [v.svType], SVLEN: [v.mark.delta] },\n mark: v.mark,\n genotypes: v.genotypes,\n }),\n )\n }\n observer.complete()\n }, opts.signal)\n }\n}\n"],
|
|
5
|
+
"mappings": "4aAwBA,IAAMA,EAAaC,GAAkB,IAAIA,EAAQ,KAAW,QAAQ,CAAC,CAAC,MAEhEC,EAAYC,GAAc,IAAIA,EAAI,KAAW,QAAQ,CAAC,CAAC,KAI7D,SAASC,EAAeC,EAAgBC,EAAgB,CACtD,GAAI,EAAED,aAAiBE,GACrB,OAAOF,EAET,IAAMG,EAASC,EAAYH,CAAM,EACjC,GAAID,aAAiBK,EACnB,OAAO,IAAI,MACT,qBAAqBF,CAAM,iFAAiFN,EAASG,EAAM,KAAK,CAAC,oBAAoBH,EAASG,EAAM,KAAK,CAAC,2BAA2BM,EAASN,EAAM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ChB,CACF",
|
|
6
|
+
"names": ["megabytes", "bytes", "millions", "n", "pinnedTooLarge", "error", "pinned", "RegionTooLargeError", "window", "pinnedLocus", "ExpansionTooLargeError", "bpString", "budget", "CUTS_KEPT", "cuts", "cachedCut", "key", "cut", "kept", "read", "old", "WalkFormsAdapter", "BaseFeatureDataAdapter", "openWalkReader", "opts", "references", "names", "sample", "contigs", "panSNMatchesPrefix", "panSNContig", "pinnedOf", "byteBudget", "updateStatus", "formsCut", "departures", "structuralForms", "floorOf", "result", "prefix", "warningPrefix", "formSources", "formWarnings", "w", "_regions", "refName", "query", "ObservableCreate", "observer", "variants", "formVariants", "v", "SimpleFeature"]
|
|
7
|
+
}
|