Skip to content

Commit

Permalink
Getting and displaying phenotype description
Browse files Browse the repository at this point in the history
  • Loading branch information
moriondo2022 committed Nov 20, 2024
1 parent 986b797 commit 1395303
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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 @@ -74,7 +74,11 @@
</search-header-wrapper>
<div class="card mdkp-card">
<div class="card-body">
<h4 class="card-title">Mechanism Graph</h4>
<h4 class="card-title">Mechanism Graph
<span v-if="!!$store.state.phenotype">
for {{ $store.state.phenotype?.description }}
</span>
</h4>
<template v-if="$store.state.phenotype && $parent.genesetSize">
<network-graph
:phenotype="$store.state.phenotype.name"
Expand Down
20 changes: 11 additions & 9 deletions src/views/PIGEAN/NetworkGraph/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ new Vue({
};
},
computed: {
phenotype() {
let currentPhenotype = keyParams.phenotype || "";
return currentPhenotype;
},
genesetSize() {
return keyParams.genesetSize || "small";
},
Expand Down Expand Up @@ -63,18 +59,24 @@ new Vue({
},
searchPhenotype(){
this.$store.dispatch("onPhenotypeChange", this.selectedPhenotype);
}
},
mapPhenotypes(){
let phenotypeMap = {};
let phenotypes = this.$store.state.pigeanAllPhenotypes.data
phenotypes.forEach(item => {
phenotypeMap[item.phenotype] = this.toOldStyle(item);
});
return phenotypeMap;
},
},
async created() {
this.$store.dispatch("bioPortal/getDiseaseSystems");
this.$store.dispatch("bioPortal/getDiseaseGroups");
this.$store.dispatch("bioPortal/getPhenotypes");
await this.$store.dispatch("getPigeanPhenotypes");
let initialPhenotype = {
name: keyParams.phenotype
};
this.pigeanPhenotypeMap = this.mapPhenotypes();
let initialPhenotype = this.pigeanPhenotypeMap[keyParams.phenotype];
this.$store.dispatch("onPhenotypeChange", initialPhenotype)

},
render(createElement) {
return createElement(Template);
Expand Down

0 comments on commit 1395303

Please sign in to comment.