Skip to content

Commit 35a17fd

Browse files
committed
Add toggle for showing single signals
1 parent f3a13cc commit 35a17fd

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

src/components/DataTable/DataTable.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ watch(() => appStore.filterPanelControls.filterDataChanged, async () => {
148148
await loadDataDebounced()
149149
})
150150
151+
watch(() => appStore[currentPageName.value]?.showOrphans, async () => {
152+
await loadDataDebounced()
153+
})
154+
151155
watch(() => loadTableDataFlag.value, async () => {
152156
await loadData()
153157
})
@@ -281,7 +285,10 @@ const loadData = async () => {
281285
try {
282286
if ([locuszoomPage, multizoomPage].includes(cpn)) {
283287
if(!appStore[cpn].colocDataReady) {
284-
const colocURL = `${URLS.COLOC_DATA}/${colocID}?include_orphans=1`
288+
let colocURL = `${URLS.COLOC_DATA}/${colocID}`
289+
if (appStore[cpn].showOrphans) {
290+
colocURL += `?include_orphans=1`
291+
}
285292
await loadColocData(cpn, colocURL)
286293
}
287294
const signal1 = appStore[cpn].colocData.signal1

src/components/FilterPanel/FilterPanel.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<CtlSwitch :controlSet="controlConfig.colorCodeVariants" />
2525
<CtlSwitch :controlSet="controlConfig.showEnsIDs" />
2626
<CtlSwitch :controlSet="controlConfig.showEffects" />
27+
<CtlSwitch :controlSet="controlConfig.showOrphans" />
2728
</FilterPanelSubpanel>
2829
</v-sheet>
2930
</template>
@@ -69,7 +70,8 @@ const controlConfig = {
6970
r2: { title: 'r² ≥', topKey: 'filter', storeKey: 'r2', items: null, emptyValue: '0', defaultValue: THRESHOLDS.R2, placeholder: null },
7071
colorCodeVariants: { title: 'Color-code variants', storeKey: 'colorCodeVariants', defaultValue: true },
7172
showEnsIDs: { title: 'Show Ensembl IDs', storeKey: 'showEnsIDs', defaultValue: false },
72-
showEffects: { title: 'Show effect sizes', storeKey: 'showEffects', defaultValue: false }
73+
showEffects: { title: 'Show effect sizes', storeKey: 'showEffects', defaultValue: false },
74+
showOrphans: { title: 'Show single signals', storeKey: 'showOrphans', defaultValue: false },
7375
}
7476
7577
</script>

src/composables/DataTableHelpers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const useDataTableHelpers = () => {
1313
const showEnsIDs = ref(false)
1414
const showEffects = ref(false)
1515
const showCellType = ref(false)
16+
const showOrphans = ref(false)
1617

1718
const showAddPlotIcon = () => {
1819
return [locuszoomPage, multizoomPage].includes(appStore.currentPageName)
@@ -26,6 +27,10 @@ export const useDataTableHelpers = () => {
2627
watch(() => appStore[manhattanPage].showEffects, newValue => {showEffects.value = newValue})
2728
watch(() => appStore[searchPage].showEffects, newValue => {showEffects.value = newValue})
2829

30+
watch(() => appStore[locuszoomPage].showOrphans, newValue => {showOrphans.value = newValue})
31+
watch(() => appStore[manhattanPage].showOrphans, newValue => {showOrphans.value = newValue})
32+
watch(() => appStore[searchPage].showOrphans, newValue => {showOrphans.value = newValue})
33+
2934
watch(() => appStore.showCellType, newValue => {showCellType.value = newValue}, { immediate: true })
3035

3136
const alwaysShow = () => true

src/stores/AppStore.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ export const useAppStore = defineStore('appStore', {
127127
if(p?.toString().length > 0) url.searchParams.set(value, p)
128128
})
129129

130-
// Always allow orphan signals to be included
131-
url.searchParams.set('include_orphans', 1)
130+
// Check if orphan signals should be included
131+
if (this[parentKey].showOrphans) {
132+
url.searchParams.set('include_orphans', 1)
133+
}
132134
},
133135

134136
buildLZdataTableURL(urlPath, signal1, signal2) {
@@ -181,6 +183,7 @@ export const useAppStore = defineStore('appStore', {
181183
this[parentKey].filters.colorCodeVariants = this[PAGE_NAMES.SEARCH].filters.colorCodeVariants
182184
this[parentKey].filters.showEnsIDs = this[PAGE_NAMES.SEARCH].filters.showEnsIDs
183185
this[parentKey].filters.showEffects = this[PAGE_NAMES.SEARCH].filters.showEffects
186+
this[parentKey].filters.showOrphans = this[PAGE_NAMES.SEARCH].filters.showOrphans
184187
this[parentKey].filters.itemsPerPage = this[PAGE_NAMES.SEARCH].filters.itemsPerPage
185188
this[parentKey].filters.pageNum = 1
186189
},
@@ -293,6 +296,7 @@ function getFilterPanelSettings() {
293296
colorCodeVariants: true,
294297
showEnsIDs: false,
295298
showEffects: false,
299+
showOrphans: false,
296300
filters: {
297301
// these are actual filters set by the user in the UI
298302
studies: [],

0 commit comments

Comments
 (0)