jbrowse-plugin-graphgenomeviewer 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddTrackWorkflow-7CXTSSMR.js → AddTrackWorkflow-JAIB6H2T.js} +2 -2
- package/dist/chunks/chunk-ZEE3HTOT.js +2 -0
- package/dist/chunks/chunk-ZEE3HTOT.js.map +7 -0
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +2 -2
- package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/GraphAddTrackWorkflow/buildTrackConfig.test.ts +18 -0
- package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +10 -0
- package/src/GraphAddTrackWorkflow/graphManifest.test.ts +12 -0
- package/src/GraphAddTrackWorkflow/graphManifest.ts +10 -2
- package/src/version.ts +1 -1
- package/dist/chunks/chunk-5FNGR33G.js +0 -2
- package/dist/chunks/chunk-5FNGR33G.js.map +0 -7
- /package/dist/chunks/{AddTrackWorkflow-7CXTSSMR.js.map → AddTrackWorkflow-JAIB6H2T.js.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jbrowse-plugin-graphgenomeviewer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "JBrowse 2 graph genome (pangenome) view: rGFA reference-anchored layouts, the Bandage force-directed engine, and haplotype lanes read from a gbz-base database",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|
|
@@ -270,6 +270,24 @@ describe('buildTrackConfig', () => {
|
|
|
270
270
|
expect(conf.adapter).not.toHaveProperty('coarse.aboveBpPerPx')
|
|
271
271
|
})
|
|
272
272
|
|
|
273
|
+
it('reads a format 2 tier as its one file', () => {
|
|
274
|
+
const conf = buildTrackConfig({
|
|
275
|
+
...args,
|
|
276
|
+
manifest: { tier: { ...tier, format: 2 } },
|
|
277
|
+
})
|
|
278
|
+
expect(conf.adapter).toMatchObject({
|
|
279
|
+
coarse: {
|
|
280
|
+
foldBelowBp: 10000,
|
|
281
|
+
graphLocation: at('hprc.fold10000.graph.bed.gz'),
|
|
282
|
+
graphIndex: {
|
|
283
|
+
indexType: 'TBI',
|
|
284
|
+
location: at('hprc.fold10000.graph.bed.gz.tbi'),
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
})
|
|
288
|
+
expect(conf.adapter).not.toHaveProperty('coarse.segmentsLocation')
|
|
289
|
+
})
|
|
290
|
+
|
|
273
291
|
it('maps the assembly onto its reference unless the user named one', () => {
|
|
274
292
|
const reference = { reference: 'GRCh38' }
|
|
275
293
|
expect(
|
|
@@ -94,6 +94,16 @@ function coarseTier(
|
|
|
94
94
|
if (!tier) {
|
|
95
95
|
return {}
|
|
96
96
|
}
|
|
97
|
+
if (tier.format === 2) {
|
|
98
|
+
const graph = besideSegments(loc, `${tier.prefix}${GRAPH_SUFFIX}`)
|
|
99
|
+
return {
|
|
100
|
+
coarse: {
|
|
101
|
+
foldBelowBp: tier.foldBelowBp,
|
|
102
|
+
graphLocation: graph,
|
|
103
|
+
graphIndex: siblingIndex(graph, indexLoc),
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
}
|
|
97
107
|
const segs = besideSegments(loc, `${tier.prefix}${SEGMENTS_SUFFIX}`)
|
|
98
108
|
const links = besideSegments(loc, `${tier.prefix}.links.bed.gz`)
|
|
99
109
|
return {
|
|
@@ -49,6 +49,18 @@ test('reads the reference and tier, ignoring unknown fields', () => {
|
|
|
49
49
|
})
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
+
test('reads a format 2 tier', () => {
|
|
53
|
+
expect(
|
|
54
|
+
parse({
|
|
55
|
+
...manifest,
|
|
56
|
+
tier: { prefix: 'out.fold10000', foldBelowBp: 10000, format: 2 },
|
|
57
|
+
}),
|
|
58
|
+
).toEqual({
|
|
59
|
+
reference: 'GRCh38',
|
|
60
|
+
tier: { prefix: 'out.fold10000', foldBelowBp: 10000, format: 2 },
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
|
|
52
64
|
test('a null reference, tier and companions leave those out', () => {
|
|
53
65
|
expect(
|
|
54
66
|
parse({
|
|
@@ -15,7 +15,9 @@ import type { FileLocation } from '@jbrowse/core/util'
|
|
|
15
15
|
// Open track reads
|
|
16
16
|
export interface GraphManifest {
|
|
17
17
|
reference?: string
|
|
18
|
-
tier
|
|
18
|
+
// `format: 2` when the tier is one `<prefix>.graph.bed.gz`, as gfa-to-tabix
|
|
19
|
+
// 2 writes it, rather than a segments and links pair
|
|
20
|
+
tier?: { prefix: string; foldBelowBp: number; format?: 2 }
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
const FETCH_TIMEOUT_MS = 5000
|
|
@@ -67,7 +69,13 @@ export function parseGraphManifest(text: string): GraphManifest | undefined {
|
|
|
67
69
|
return {
|
|
68
70
|
...(typeof reference === 'string' ? { reference: reference.trim() } : {}),
|
|
69
71
|
...(isTier(tier)
|
|
70
|
-
? {
|
|
72
|
+
? {
|
|
73
|
+
tier: {
|
|
74
|
+
prefix: tier.prefix,
|
|
75
|
+
foldBelowBp: tier.foldBelowBp,
|
|
76
|
+
...(tier.format === 2 ? { format: 2 as const } : {}),
|
|
77
|
+
},
|
|
78
|
+
}
|
|
71
79
|
: {}),
|
|
72
80
|
}
|
|
73
81
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '8.
|
|
1
|
+
export const version = '8.3.0'
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as m}from"./chunk-3VGXCEMQ.js";import{a as p,b as l,c as h,d as A,h as a,i as g,j as d}from"./chunk-6VNDP3UB.js";import{a as T}from"./chunk-OGQ6OQDN.js";var z=5e3;function G(e){return typeof e=="string"&&/^[\w+-][\w.+-]*$/.test(e)}function x(e){return e==null}function M(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function L(e){return M(e)&&G(e.prefix)&&typeof e.foldBelowBp=="number"&&Number.isFinite(e.foldBelowBp)&&e.foldBelowBp>0}function P(e){let n;try{n=JSON.parse(e)}catch{return}if(!M(n)||n.schema!==1)return;let{reference:i,tier:t,index:r,contig:o,bubbles:s,alleles:f}=n;if((x(i)||typeof i=="string"&&i.trim()!=="")&&(x(t)||L(t))&&[r,o,s,f].every(I=>x(I)||G(I)))return{...typeof i=="string"?{reference:i.trim()}:{},...L(t)?{tier:{prefix:t.prefix,foldBelowBp:t.foldBelowBp}}:{}}}function y(e,n){return d(e,i=>i.replace(/[^/\\]*$/,n))}function R(e){let n=a(e);return[p,l].find(i=>n.endsWith(i))}function N(e){return g(e)&&R(e)!==void 0}function F(e,n){let i=R(e)??p;return d(e,t=>`${t.slice(0,-i.length)}${n}`)}function _(e){return N(e)?F(e,".graph.json"):void 0}async function X(e,n){let i=_(e);if(i)try{let t=await T(i,n).readFile({encoding:"utf8",signal:AbortSignal.timeout(z)});return P(t)}catch{return}}var J={RgfaTabixAdapter:"Indexed GFA (gfa-to-tabix .segs.bed.gz or .graph.bed.gz)",RgfaTabixWalks:"Haplotype walks (.walks.bed.gz)",GbzBaseSyntenyAdapter:"GBZ database (.gbz.db)",MinigraphBubbleAdapter:"Minigraph bubbles (tabix BED)"},K={RgfaTabixAdapter:"Path to segments BED (.segs.bed.gz from gfa-to-tabix; the .links.bed.gz, its index and any .graph.json are read beside it), or format 2's .graph.bed.gz",RgfaTabixWalks:"Path to a walk file (<prefix>.<sample>.walks.bed.gz from gfa-to-tabix --walks, for the sample this assembly is)",GbzBaseSyntenyAdapter:"Path to the .gbz.db written by gbz-base construct",MinigraphBubbleAdapter:"Path to bubbles BED (.bed.gz from gfatools bubble)"},B="Path to tabix index (optional; the sibling .tbi is assumed, a .csi is recognised by name)",Z={RgfaTabixAdapter:B,RgfaTabixWalks:B,GbzBaseSyntenyAdapter:"Path to the haplotype index (optional; graph.haplotype-index.db beside the database is assumed)",MinigraphBubbleAdapter:B};function b(e,n){return d(e,i=>i+n)}function C(e){if(!a(e).endsWith(p))throw new Error(`Expected a segments BED ending in ${p}, got ${a(e)}`);return F(e,".links.bed.gz")}function u(e,n){return n?{location:n,indexType:m(a(n),"CSI","TBI")}:{location:b(e,".tbi"),indexType:"TBI"}}function k(e,n){return n!==void 0&&m(a(n),"CSI","TBI")==="CSI"?{location:b(e,".csi"),indexType:"CSI"}:{location:b(e,".tbi"),indexType:"TBI"}}function w(e,n){let i=n.trim();return i&&e?{assemblyNameToPanSN:{[e]:i}}:{}}function E(e,n,i){if(!i)return{};let t=y(e,`${i.prefix}${p}`),r=y(e,`${i.prefix}.links.bed.gz`);return{coarse:{foldBelowBp:i.foldBelowBp,segmentsLocation:t,segmentsIndex:k(t,n),linksLocation:r,linksIndex:k(r,n)}}}function S(e,n,i){let t=i===e?void 0:i;return w(e,n.trim()||t||"")}function W(e){return e?{readsLocation:e,...a(e).endsWith(".gz")&&g(e)?{readsIndex:{location:b(e,".tbi")}}:{}}:{}}function q(e){return e.split(/[\s,]+/).filter(n=>n!=="")}function D({choice:e,loc:n,indexLoc:i,readsLoc:t,manifest:r,assembly:o,sample:s,haplotypes:f=[]}){if(e==="RgfaTabixWalks"){if(!a(n).endsWith(h))throw new Error(`Expected a walk file ending in ${h}, got ${a(n)}`);return{type:"RgfaTabixAdapter",walksLocation:n,walksIndex:u(n,i),...S(o,s,A(n)),...f.length>0?{defaultHaplotypes:f}:{}}}if(e==="GbzBaseSyntenyAdapter")return{type:"GbzBaseSyntenyAdapter",gbzDbLocation:n,...i?{haplotypeIndexLocation:i}:{},...W(t),...w(o,s)};if(e==="MinigraphBubbleAdapter")return{type:"MinigraphBubbleAdapter",bubblesLocation:n,index:u(n,i),...w(o,s)};if(a(n).endsWith(l))return{type:"RgfaTabixAdapter",graphLocation:n,graphIndex:u(n,i),...S(o,s,r?.reference),...E(n,i,r?.tier)};let c=C(n);return{type:"RgfaTabixAdapter",segmentsLocation:n,segmentsIndex:u(n,i),linksLocation:c,linksIndex:k(c,i),...S(o,s,r?.reference),...E(n,i,r?.tier)}}function Q(e){let{choice:n,assembly:i,trackId:t,name:r}=e;return{type:n==="MinigraphBubbleAdapter"?"FeatureTrack":"GraphTrack",trackId:t,name:r,assemblyNames:[i],adapter:D(e),...n==="RgfaTabixAdapter"||n==="RgfaTabixWalks"?{displayDefaults:{labels:{name:{show:!1},description:{show:!1}}}}:{}}}export{N as a,X as b,J as c,K as d,Z as e,q as f,D as g,Q as h};
|
|
2
|
-
//# sourceMappingURL=chunk-5FNGR33G.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/GraphAddTrackWorkflow/graphManifest.ts", "../../src/GraphAddTrackWorkflow/buildTrackConfig.ts"],
|
|
4
|
-
"sourcesContent": ["import { openLocation } from '@jbrowse/core/util/io'\n\nimport {\n GRAPH_SUFFIX,\n SEGMENTS_SUFFIX,\n locationName,\n readsSiblings,\n renamed,\n} from '../locationName'\n\nimport type PluginManager from '@jbrowse/core/PluginManager'\nimport type { FileLocation } from '@jbrowse/core/util'\n\n// The part of `<prefix>.graph.json`, written by `gfa-to-tabix build`, that\n// Open track reads\nexport interface GraphManifest {\n reference?: string\n tier?: { prefix: string; foldBelowBp: number }\n}\n\nconst FETCH_TIMEOUT_MS = 5000\n\n// A bare file name beside the manifest: no directory, scheme or leading dot\nfunction isSiblingName(name: unknown): name is string {\n return typeof name === 'string' && /^[\\w+-][\\w.+-]*$/.test(name)\n}\n\nfunction isAbsent(value: unknown) {\n return value === undefined || value === null\n}\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction isTier(tier: unknown): tier is NonNullable<GraphManifest['tier']> {\n return (\n isPlainRecord(tier) &&\n isSiblingName(tier.prefix) &&\n typeof tier.foldBelowBp === 'number' &&\n Number.isFinite(tier.foldBelowBp) &&\n tier.foldBelowBp > 0\n )\n}\n\nexport function parseGraphManifest(text: string): GraphManifest | undefined {\n let json: unknown\n try {\n json = JSON.parse(text)\n } catch {\n return undefined\n }\n if (!isPlainRecord(json) || json.schema !== 1) {\n return undefined\n }\n const { reference, tier, index, contig, bubbles, alleles } = json\n const valid =\n (isAbsent(reference) ||\n (typeof reference === 'string' && reference.trim() !== '')) &&\n (isAbsent(tier) || isTier(tier)) &&\n [index, contig, bubbles, alleles].every(\n f => isAbsent(f) || isSiblingName(f),\n )\n if (!valid) {\n return undefined\n }\n return {\n ...(typeof reference === 'string' ? { reference: reference.trim() } : {}),\n ...(isTier(tier)\n ? { tier: { prefix: tier.prefix, foldBelowBp: tier.foldBelowBp } }\n : {}),\n }\n}\n\n// A file the manifest names, in the directory of the segments file opened\nexport function besideSegments(segs: FileLocation, fileName: string) {\n return renamed(segs, name => name.replace(/[^/\\\\]*$/, fileName))\n}\n\n// The suffix of a gfa-to-tabix index file: format 1's segments BED or format\n// 2's graph BED\nfunction indexSuffix(loc: FileLocation) {\n const name = locationName(loc)\n return [SEGMENTS_SUFFIX, GRAPH_SUFFIX].find(suffix => name.endsWith(suffix))\n}\n\n// A segments BED, or format 2's graph BED, the rest of the index and the\n// manifest can be found beside\nexport function isGraphIndexLocation(loc: FileLocation) {\n return readsSiblings(loc) && indexSuffix(loc) !== undefined\n}\n\n// `<prefix><suffix>` beside `<prefix>.segs.bed.gz` or `<prefix>.graph.bed.gz`\nexport function segmentsSibling(segs: FileLocation, suffix: string) {\n const own = indexSuffix(segs) ?? SEGMENTS_SUFFIX\n return renamed(segs, name => `${name.slice(0, -own.length)}${suffix}`)\n}\n\nexport function manifestLocation(segs: FileLocation) {\n return isGraphIndexLocation(segs)\n ? segmentsSibling(segs, '.graph.json')\n : undefined\n}\n\n// Undefined for a manifest that is missing, unreadable or not schema 1, so\n// Open track falls back to the files beside the segments alone\nexport async function readGraphManifest(\n segs: FileLocation,\n pluginManager?: PluginManager,\n) {\n const loc = manifestLocation(segs)\n if (!loc) {\n return undefined\n }\n try {\n const text = await openLocation(loc, pluginManager).readFile({\n encoding: 'utf8',\n signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),\n })\n return parseGraphManifest(text)\n } catch {\n return undefined\n }\n}\n", "import { makeIndexType } from '@jbrowse/core/util/tracks'\n\nimport { besideSegments, segmentsSibling } from './graphManifest'\nimport {\n GRAPH_SUFFIX,\n SEGMENTS_SUFFIX,\n WALKS_SUFFIX,\n locationName,\n readsSiblings,\n renamed,\n walkFileSample,\n} from '../locationName'\n\nimport type { GraphManifest } from './graphManifest'\nimport type { FileLocation } from '@jbrowse/core/util'\n\n// 'RgfaTabixWalks' is an RgfaTabixAdapter read from a walk file\nexport type GraphFileChoice =\n | 'RgfaTabixAdapter'\n | 'RgfaTabixWalks'\n | 'GbzBaseSyntenyAdapter'\n | 'MinigraphBubbleAdapter'\n\nexport const GRAPH_FILE_LABELS: Record<GraphFileChoice, string> = {\n RgfaTabixAdapter: 'Indexed GFA (gfa-to-tabix .segs.bed.gz or .graph.bed.gz)',\n RgfaTabixWalks: 'Haplotype walks (.walks.bed.gz)',\n GbzBaseSyntenyAdapter: 'GBZ database (.gbz.db)',\n MinigraphBubbleAdapter: 'Minigraph bubbles (tabix BED)',\n}\n\nexport const GRAPH_FILE_FIELDS: Record<GraphFileChoice, string> = {\n RgfaTabixAdapter:\n \"Path to segments BED (.segs.bed.gz from gfa-to-tabix; the .links.bed.gz, its index and any .graph.json are read beside it), or format 2's .graph.bed.gz\",\n RgfaTabixWalks:\n 'Path to a walk file (<prefix>.<sample>.walks.bed.gz from gfa-to-tabix --walks, for the sample this assembly is)',\n GbzBaseSyntenyAdapter: 'Path to the .gbz.db written by gbz-base construct',\n MinigraphBubbleAdapter: 'Path to bubbles BED (.bed.gz from gfatools bubble)',\n}\n\nconst TABIX_INDEX_FIELD =\n 'Path to tabix index (optional; the sibling .tbi is assumed, a .csi is recognised by name)'\n\nexport const GRAPH_INDEX_FIELDS: Record<GraphFileChoice, string> = {\n RgfaTabixAdapter: TABIX_INDEX_FIELD,\n RgfaTabixWalks: TABIX_INDEX_FIELD,\n GbzBaseSyntenyAdapter:\n 'Path to the haplotype index (optional; graph.haplotype-index.db beside the database is assumed)',\n MinigraphBubbleAdapter: TABIX_INDEX_FIELD,\n}\n\nfunction sibling(loc: FileLocation, suffix: string) {\n return renamed(loc, name => name + suffix)\n}\n\nfunction linksLocation(loc: FileLocation) {\n if (!locationName(loc).endsWith(SEGMENTS_SUFFIX)) {\n throw new Error(\n `Expected a segments BED ending in ${SEGMENTS_SUFFIX}, got ${locationName(loc)}`,\n )\n }\n return segmentsSibling(loc, '.links.bed.gz')\n}\n\nfunction tabixIndex(loc: FileLocation, indexLoc: FileLocation | undefined) {\n return indexLoc\n ? {\n location: indexLoc,\n indexType: makeIndexType(locationName(indexLoc), 'CSI', 'TBI'),\n }\n : { location: sibling(loc, '.tbi'), indexType: 'TBI' }\n}\n\n// The links file's index is assumed beside it, of the kind the segments' is.\nfunction siblingIndex(loc: FileLocation, indexLoc: FileLocation | undefined) {\n const csi =\n indexLoc !== undefined &&\n makeIndexType(locationName(indexLoc), 'CSI', 'TBI') === 'CSI'\n return csi\n ? { location: sibling(loc, '.csi'), indexType: 'CSI' }\n : { location: sibling(loc, '.tbi'), indexType: 'TBI' }\n}\n\n// none for a guessed config, which knows no assembly yet; see withWalkReference\nfunction panSN(assembly: string, sample: string) {\n const name = sample.trim()\n return name && assembly ? { assemblyNameToPanSN: { [assembly]: name } } : {}\n}\n\nfunction coarseTier(\n loc: FileLocation,\n indexLoc: FileLocation | undefined,\n tier: GraphManifest['tier'],\n) {\n if (!tier) {\n return {}\n }\n const segs = besideSegments(loc, `${tier.prefix}${SEGMENTS_SUFFIX}`)\n const links = besideSegments(loc, `${tier.prefix}.links.bed.gz`)\n return {\n coarse: {\n foldBelowBp: tier.foldBelowBp,\n segmentsLocation: segs,\n segmentsIndex: siblingIndex(segs, indexLoc),\n linksLocation: links,\n linksIndex: siblingIndex(links, indexLoc),\n },\n }\n}\n\n// The user's sample wins; the reference the graph's files name (a manifest's,\n// or a walk file's own) stands in when blank\nfunction referencePanSN(\n assembly: string,\n sample: string,\n reference: string | undefined,\n) {\n const fromManifest = reference === assembly ? undefined : reference\n return panSN(assembly, sample.trim() || fromManifest || '')\n}\n\n// a bgzipped GAF is read by its tabix index, a plain one whole\nfunction readsConfig(readsLoc: FileLocation | undefined) {\n return readsLoc\n ? {\n readsLocation: readsLoc,\n ...(locationName(readsLoc).endsWith('.gz') && readsSiblings(readsLoc)\n ? { readsIndex: { location: sibling(readsLoc, '.tbi') } }\n : {}),\n }\n : {}\n}\n\n// Names typed as a list, by comma or space\nexport function parseHaplotypes(text: string) {\n return text.split(/[\\s,]+/).filter(name => name !== '')\n}\n\nexport function buildAdapterConfig({\n choice,\n loc,\n indexLoc,\n readsLoc,\n manifest,\n assembly,\n sample,\n haplotypes = [],\n}: {\n choice: GraphFileChoice\n loc: FileLocation\n indexLoc: FileLocation | undefined\n // a GBZ track's GAF reads, which no other choice takes\n readsLoc?: FileLocation\n // the `.graph.json` beside an rGFA segments file\n manifest?: GraphManifest\n assembly: string\n sample: string\n // a walk file's haplotypes to cut for until the user picks others\n haplotypes?: string[]\n}) {\n if (choice === 'RgfaTabixWalks') {\n if (!locationName(loc).endsWith(WALKS_SUFFIX)) {\n throw new Error(\n `Expected a walk file ending in ${WALKS_SUFFIX}, got ${locationName(loc)}`,\n )\n }\n return {\n type: 'RgfaTabixAdapter',\n walksLocation: loc,\n walksIndex: tabixIndex(loc, indexLoc),\n ...referencePanSN(assembly, sample, walkFileSample(loc)),\n ...(haplotypes.length > 0 ? { defaultHaplotypes: haplotypes } : {}),\n }\n }\n if (choice === 'GbzBaseSyntenyAdapter') {\n return {\n type: 'GbzBaseSyntenyAdapter',\n gbzDbLocation: loc,\n ...(indexLoc ? { haplotypeIndexLocation: indexLoc } : {}),\n ...readsConfig(readsLoc),\n ...panSN(assembly, sample),\n }\n }\n if (choice === 'MinigraphBubbleAdapter') {\n return {\n type: 'MinigraphBubbleAdapter',\n bubblesLocation: loc,\n index: tabixIndex(loc, indexLoc),\n ...panSN(assembly, sample),\n }\n }\n if (locationName(loc).endsWith(GRAPH_SUFFIX)) {\n return {\n type: 'RgfaTabixAdapter',\n graphLocation: loc,\n graphIndex: tabixIndex(loc, indexLoc),\n ...referencePanSN(assembly, sample, manifest?.reference),\n ...coarseTier(loc, indexLoc, manifest?.tier),\n }\n }\n const links = linksLocation(loc)\n return {\n type: 'RgfaTabixAdapter',\n segmentsLocation: loc,\n segmentsIndex: tabixIndex(loc, indexLoc),\n linksLocation: links,\n linksIndex: siblingIndex(links, indexLoc),\n ...referencePanSN(assembly, sample, manifest?.reference),\n ...coarseTier(loc, indexLoc, manifest?.tier),\n }\n}\n\nexport function buildTrackConfig(args: {\n choice: GraphFileChoice\n loc: FileLocation\n indexLoc: FileLocation | undefined\n readsLoc?: FileLocation\n manifest?: GraphManifest\n assembly: string\n sample: string\n haplotypes?: string[]\n trackId: string\n name: string\n}) {\n const { choice, assembly, trackId, name } = args\n return {\n type: choice === 'MinigraphBubbleAdapter' ? 'FeatureTrack' : 'GraphTrack',\n trackId,\n name,\n assemblyNames: [assembly],\n adapter: buildAdapterConfig(args),\n ...(choice === 'RgfaTabixAdapter' || choice === 'RgfaTabixWalks'\n ? {\n displayDefaults: {\n labels: { name: { show: false }, description: { show: false } },\n },\n }\n : {}),\n }\n}\n"],
|
|
5
|
-
"mappings": "kKAoBA,IAAMA,EAAmB,IAGzB,SAASC,EAAcC,EAA+B,CACpD,OAAO,OAAOA,GAAS,UAAY,mBAAmB,KAAKA,CAAI,CACjE,CAEA,SAASC,EAASC,EAAgB,CAChC,OAA8BA,GAAU,IAC1C,CAEA,SAASC,EAAcD,EAAkD,CACvE,OAAO,OAAOA,GAAU,UAAYA,IAAU,MAAQ,CAAC,MAAM,QAAQA,CAAK,CAC5E,CAEA,SAASE,EAAOC,EAA2D,CACzE,OACEF,EAAc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AAUqB,GAAU,IAAI,CAC7C,CACF,CAEO,SAASK,EAAiBC,EAW9B,CACD,GAAM,CAAE,OAAAP,EAAQ,SAAAhB,EAAU,QAAAwB,EAAS,KAAAlC,CAAK,EAAIiC,EAC5C,MAAO,CACL,KAAMP,IAAW,yBAA2B,eAAiB,aAC7D,QAAAQ,EACA,KAAAlC,EACA,cAAe,CAACU,CAAQ,EACxB,QAASe,EAAmBQ,CAAI,EAChC,GAAIP,IAAW,oBAAsBA,IAAW,iBAC5C,CACE,gBAAiB,CACf,OAAQ,CAAE,KAAM,CAAE,KAAM,EAAM,EAAG,YAAa,CAAE,KAAM,EAAM,CAAE,CAChE,CACF,EACA,CAAC,CACP,CACF",
|
|
6
|
-
"names": ["FETCH_TIMEOUT_MS", "isSiblingName", "name", "isAbsent", "value", "isPlainRecord", "isTier", "tier", "parseGraphManifest", "text", "json", "reference", "index", "contig", "bubbles", "alleles", "f", "besideSegments", "segs", "fileName", "renamed", "indexSuffix", "loc", "locationName", "SEGMENTS_SUFFIX", "GRAPH_SUFFIX", "suffix", "isGraphIndexLocation", "readsSiblings", "segmentsSibling", "own", "manifestLocation", "readGraphManifest", "pluginManager", "openLocation", "GRAPH_FILE_LABELS", "GRAPH_FILE_FIELDS", "TABIX_INDEX_FIELD", "GRAPH_INDEX_FIELDS", "sibling", "loc", "suffix", "renamed", "name", "linksLocation", "locationName", "SEGMENTS_SUFFIX", "segmentsSibling", "tabixIndex", "indexLoc", "makeIndexType", "siblingIndex", "panSN", "assembly", "sample", "coarseTier", "tier", "segs", "besideSegments", "links", "referencePanSN", "reference", "fromManifest", "readsConfig", "readsLoc", "readsSiblings", "parseHaplotypes", "text", "buildAdapterConfig", "choice", "manifest", "haplotypes", "WALKS_SUFFIX", "walkFileSample", "GRAPH_SUFFIX", "buildTrackConfig", "args", "trackId"]
|
|
7
|
-
}
|
|
File without changes
|