Skip to content

Commit

Permalink
query small or large geneset size
Browse files Browse the repository at this point in the history
  • Loading branch information
moriondo2022 committed Nov 20, 2024
1 parent d9ecad3 commit 0565e1d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/views/PIGEAN/NetworkGraph/Template.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
</template>
</ul>
</div>
<div class="col filter-col-md">
<div class="label">Number of gene sets included</div>
<geneset-size-selectpicker></geneset-size-selectpicker>
</div>
<div class="region-search col filter-col-md hidden">
<div class="label">Search</div>
<button
Expand All @@ -82,7 +86,7 @@
<template v-if="$store.state.phenotype && $parent.genesetSize">
<network-graph
:phenotype="$store.state.phenotype.name"
:geneset-size="$parent.genesetSize"
:geneset-size="$store.state.genesetSize"
></network-graph>
</template>
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/views/PIGEAN/NetworkGraph/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import store from "./store";

import NetworkGraph from "@/components/NetworkGraph.vue";
import SearchHeaderWrapper from "@/components/SearchHeaderWrapper.vue";
import GenesetSizeSelectPicker from "@/components/GenesetSizeSelectPicker.vue";
import keyParams from "@/utils/keyParams";
import { pageMixin } from "@/mixins/pageMixin.js";
new Vue({
store,
components: {
NetworkGraph,
SearchHeaderWrapper,
GenesetSizeSelectPicker,
},
mixins: [pageMixin],
data() {
Expand Down Expand Up @@ -58,7 +60,9 @@ new Vue({
return oldStyle;
},
searchPhenotype(){
this.$store.dispatch("onPhenotypeChange", this.selectedPhenotype);
let phenotypeToSearch = this.selectedPhenotype
|| this.pigeanPhenotypeMap[keyParams.phenotype];
this.$store.dispatch("sendSearch", phenotypeToSearch);
},
mapPhenotypes(){
let phenotypeMap = {};
Expand All @@ -76,7 +80,7 @@ new Vue({
await this.$store.dispatch("getPigeanPhenotypes");
this.pigeanPhenotypeMap = this.mapPhenotypes();
let initialPhenotype = this.pigeanPhenotypeMap[keyParams.phenotype];
this.$store.dispatch("onPhenotypeChange", initialPhenotype)
this.$store.dispatch("sendSearch", initialPhenotype)
},
render(createElement) {
return createElement(Template);
Expand Down
7 changes: 5 additions & 2 deletions src/views/PIGEAN/NetworkGraph/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default new Vuex.Store({
},
state: {
phenotype: null,
genesetSize: "small",
genesetSize: keyParams.genesetSize || DEFAULT_GENESET_SIZE,
genesetSizeToQuery: keyParams.genesetSize || DEFAULT_GENESET_SIZE,
selectedPhenotype: null,
},
mutations: {
Expand All @@ -26,9 +27,11 @@ export default new Vuex.Store({
},
},
actions: {
onPhenotypeChange(context, phenotype) {
sendSearch(context, phenotype) {
context.state.phenotype = phenotype;
keyParams.set({ phenotype: phenotype.name });
context.state.genesetSize = context.state.genesetSizeToQuery;
keyParams.set({ genesetSize: context.state.genesetSize });
},
async getPigeanPhenotypes(context) {
await context.dispatch("pigeanAllPhenotypes/query", { q: 1 });
Expand Down

0 comments on commit 0565e1d

Please sign in to comment.