Skip to content

Commit dfd01cf

Browse files
authored
Pigean x hpo (#965)
* working * working on geneset * made all but HPO default * show trait group in header
1 parent 6554da0 commit dfd01cf

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

src/components/TraitGroupSelectPicker.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<select v-model="traitGroup" class="form-control">
33
<option value="all">All</option>
4+
<option value="all_but_hpo">All but HPO</option>
45
<option v-for="group in groups" :value="group[0]">
56
{{ group[1] }}
67
</option>
@@ -42,6 +43,7 @@ export default Vue.component("trait-group-selectpicker", {
4243
keyParamsTraitGroup(newKey) {
4344
// do we need this?
4445
if (this.size === null) {
46+
console.log("Is this thing firing?");
4547
this.size = newKey;
4648
}
4749
},

src/utils/bioIndexUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ async function processRequest(req, onResolve, onError, onLoad, limitWhile) {
140140
}
141141
export const DEFAULT_SIGMA = 2;
142142
export const DEFAULT_GENESET_SIZE = "small";
143-
export const DEFAULT_TRAIT_GROUP = "all";
143+
export const DEFAULT_TRAIT_GROUP = "all_but_hpo";
144144
export const TRAIT_GROUPS = {
145145
"portal": "A2F",
146146
"gcat_trait": "GWAS Catalog",

src/views/PIGEAN/Gene/Template.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<script setup lang="ts">
2+
import bioIndexUtils from '../../../utils/bioIndexUtils';
3+
4+
</script>
5+
16
<template>
27
<div>
38
<!-- Header -->
@@ -89,7 +94,10 @@
8994

9095
<div class="card mdkp-card">
9196
<div class="card-body pigean-title">
92-
<h4 class="card-title">Traits with genetic support</h4>
97+
<h4 class="card-title">Traits with genetic support
98+
(trait group: {{ !!bioIndexUtils.TRAIT_GROUPS[$store.state.traitGroup]
99+
? bioIndexUtils.TRAIT_GROUPS[$store.state.traitGroup]
100+
: $parent.tissueFormatter($store.state.traitGroup).toUpperCase()}})</h4>
93101
<div>
94102
Combined genetic support is composed of direct support
95103
(from GWAS associations near the gene) and indirect

src/views/PIGEAN/Gene/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ new Vue({
196196
pigeanUtils.mapPhenotypes(this.$store.state.pigeanAllPhenotypes.data);
197197
},
198198
methods: {
199+
tissueFormatter: Formatters.tissueFormatter,
199200
// go to region page
200201
exploreRegion(expanded = 0) {
201202
let r = this.region;

src/views/PIGEAN/Gene/store.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,17 @@ export default new Vuex.Store({
8686
context.commit("setTraitGroup", traitGroup);
8787
if (!!name) {
8888
context.dispatch("gene/query", { q: name });
89-
if (traitGroup !== 'all'){
89+
if (!traitGroup.startsWith('all')){
9090
await context.dispatch("pigeanGene/query", { q:
9191
`${traitGroup},${name},${bioIndexUtils.DEFAULT_SIGMA},${genesetSize}`});
9292
context.commit("setPhewasData", context.state.pigeanGene.data);
9393
} else {
9494
// If ALL is selected, query all trait groups and get top results across all
9595
let traitsData = [];
9696
let traits = Object.keys(bioIndexUtils.TRAIT_GROUPS);
97+
if (traitGroup === 'all_but_hpo'){
98+
traits = traits.filter(t => t !== 'hpo');
99+
}
97100
for (let i = 0; i < traits.length; i++){
98101
let group = traits[i];
99102
let traitQuery = `${group},${context.state.geneName},${

src/views/PIGEAN/GeneSet/store.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,19 @@ export default new Vuex.Store({
5858
context.commit("setGenesetSize", genesetSize);
5959
context.commit("setTraitGroup", traitGroup);
6060

61-
if (traitGroup !== 'all'){
61+
if (!traitGroup.startsWith('all')){
6262
await context.dispatch("pigeanGeneset/query", { q:
6363
`${traitGroup},${name},${bioIndexUtils.DEFAULT_SIGMA},${genesetSize}`});
6464
context.commit("setPhewasData", context.state.pigeanGeneset.data);
6565
} else {
6666
// If ALL is selected, query all trait groups and get top results across all
67+
let traits = Object.keys(bioIndexUtils.TRAIT_GROUPS);
68+
if (traitGroup === 'all_but_hpo'){
69+
traits = traits.filter(t => t !== 'hpo');
70+
}
6771
let traitsData = [];
68-
for (let i = 0; i < bioIndexUtils.TRAIT_GROUPS.length; i++){
69-
let group = bioIndexUtils.TRAIT_GROUPS[i];
72+
for (let i = 0; i < traits.length; i++){
73+
let group = traits[i];
7074
let traitQuery = `${group},${name},${
7175
bioIndexUtils.DEFAULT_SIGMA},${genesetSize}`;
7276
let groupData = await bioIndexUtils.query("pigean-gene-set", traitQuery);

0 commit comments

Comments
 (0)