` : ''}
@@ -36,12 +36,12 @@ export default function createTrackSelectionModal({id, label = '', sections, des
`
` :
`
'}
@@ -85,19 +85,19 @@ export default function createTrackSelectionModal({id, label = '', sections, des
})
const trackMap = new Map()
- const fillTrackMap = (sections) => {
- sections.forEach(section => {
- if (section.tracks) {
- section.tracks.forEach(track => {
+ const fillTrackMap = (groups) => {
+ groups.forEach(group => {
+ if (group.tracks) {
+ group.tracks.forEach(track => {
trackMap.set(track._id, track)
})
}
- if (section.children) {
- fillTrackMap(section.children)
+ if (group.children) {
+ fillTrackMap(group.children)
}
})
}
- fillTrackMap(sections)
+ fillTrackMap(groups)
// Listen for the modal close event
diff --git a/js/widgets/trackWidgets.js b/js/widgets/trackWidgets.js
index dca085c..b159b23 100644
--- a/js/widgets/trackWidgets.js
+++ b/js/widgets/trackWidgets.js
@@ -229,18 +229,18 @@ async function trackMenuGenomeChange(browser, genome) {
const loadedIDs = browser ? new Set(browser.findTracks(true).map(t => trackId(t))) : new Set()
// Annotate track config objects with a unique ID comprised of url + name
- const annotateTracks = (section) => {
- if (section.tracks) {
- for (const track of section.tracks) {
+ const annotateTracks = (groups) => {
+ if (groups.tracks) {
+ for (const track of groups.tracks) {
track._id = trackId(track)
track._loaded = loadedIDs.has(track._id)
}
}
- if (section.children) for (const child of section.children) {
+ if (groups.children) for (const child of groups.children) {
annotateTracks(child)
}
}
- for (const group of config.sections) {
+ for (const group of config.groups) {
annotateTracks(group)
}
@@ -292,15 +292,18 @@ function prepRegistryConfig(registry) {
registry.customModalTable = customModalTable
return registry
} else {
+
+ const groups = registry.groups || [{
+ label: registry.label,
+ tracks: registry.tracks
+ }]
+
return {
type: registry.type || 'track-selection-modal',
id: `_${Math.random().toString(36).substring(2, 9)}`,
label: registry.label,
description: registry.description,
- sections: [{
- label: registry.label,
- tracks: registry.tracks
- }],
+ groups: groups
}
}
}
@@ -315,7 +318,7 @@ async function prepHubConfig(hubURL, genomeID) {
id: `_${Math.random().toString(36).substring(2, 9)}`,
label: `${hub.getShortLabel()}`,
description: descriptionUrl ? `
${hub.getLongLabel()}` : '',
- sections: groups
+ groups: groups
}
}
diff --git a/resources/tracks/mm10_sample.json b/resources/tracks/mm10_sample.json
new file mode 100644
index 0000000..b1f9721
--- /dev/null
+++ b/resources/tracks/mm10_sample.json
@@ -0,0 +1,48 @@
+{
+ "label": "mm10 Sample Tracks",
+ "type": "hub",
+ "description": "Some sample tracks for the mm10 genome",
+ "groups": [
+ {
+ "label": "Genes and Gene Predictions",
+ "tracks": [
+ {
+ "id": "HLTOGAannotvHg38v1",
+ "name": "TOGA vs. hg38",
+ "url": "https://hgdownload.soe.ucsc.edu/gbdb/mm10/TOGAvHg38v1/HLTOGAannotVsHg38v1.bb"
+ },
+ {
+ "id": "crisprAllTargets",
+ "name": "CRISPR Targets",
+ "group": "genes",
+ "url": "https://hgdownload.soe.ucsc.edu/gbdb/mm10/crisprAll/crispr.bb",
+ "html": "https://crispor.gi.ucsc.edu/crispor.py?org=$D&pos=$S:${&pam=NGG"
+ }
+ ]
+ },
+ {
+ "label": "Regulation",
+ "tracks": [
+ {
+ "id": "encodeCcreCombined",
+ "name": "ENCODE cCREs",
+ "url": "https://hgdownload.soe.ucsc.edu/gbdb/mm10/encode3/ccre/encodeCcreCombined.bb",
+ "html": "https://screen-v2.wenglab.org/search/?q=$$&assembly=mm10"
+ },
+ {
+ "id": "refSeqFuncElems",
+ "name": "RefSeq Func Elems",
+ "group": "regulation",
+ "url": "https://hgdownload.soe.ucsc.edu/gbdb/mm10/ncbiRefSeq/refSeqFuncElems.bb"
+ },
+ {
+ "id": "vistaEnhancersBb",
+ "name": "VISTA Enhancers",
+ "group": "regulation",
+ "url": "https://hgdownload.soe.ucsc.edu/gbdb/mm10/vistaEnhancers/vistaEnhancers.bb",
+ "html": "https://enhancer.lbl.gov/cgi-bin/imagedb3.pl?form=presentation&show=1&organism_id=2&experiment_id=$
"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
From 61caa3350a7df245cce5bceeb6f2699bb279af22 Mon Sep 17 00:00:00 2001
From: Jim Robinson <933148+jrobinso@users.noreply.github.com>
Date: Tue, 9 Dec 2025 11:27:30 -0800
Subject: [PATCH 2/2] Update resources/tracks/mm10_sample.json
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---
resources/tracks/mm10_sample.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/resources/tracks/mm10_sample.json b/resources/tracks/mm10_sample.json
index b1f9721..87555ca 100644
--- a/resources/tracks/mm10_sample.json
+++ b/resources/tracks/mm10_sample.json
@@ -16,7 +16,7 @@
"name": "CRISPR Targets",
"group": "genes",
"url": "https://hgdownload.soe.ucsc.edu/gbdb/mm10/crisprAll/crispr.bb",
- "html": "https://crispor.gi.ucsc.edu/crispor.py?org=$D&pos=$S:${&pam=NGG"
+ "html": "https://crispor.gi.ucsc.edu/crispor.py?org=$D&pos=$S:$E&pam=NGG"
}
]
},