Skip to content

Commit

Permalink
Index search (#795)
Browse files Browse the repository at this point in the history
* truncating names of phenotypes to 30 chars

* better when it's 400px

* hiding tooltip for now

* New phenotypes for the index page
  • Loading branch information
moriondo2022 authored Nov 21, 2024
1 parent 91f6aea commit 6ecc2aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/views/PIGEAN/Index/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,14 @@ new Vue({
},
},

created() {
async created() {
this.$store.dispatch("bioPortal/getDiseaseSystems");
this.$store.dispatch("bioPortal/getDiseaseGroups");
this.$store.dispatch("bioPortal/getPhenotypes");
this.$store.dispatch("bioPortal/getDatasets");
this.getStats();
await this.$store.dispatch("getPigeanPhenotypes");
this.formatAllPhenotypes();
},

methods: {
Expand All @@ -392,16 +394,29 @@ new Vue({
let data = dataConvert.csv2Json(
contJson[0]["field_data_points"]
);
console.log(data);
this.stats = data;
console.log(this.stats);
}
},
capitalize(str) {
return str.replace(/\b\w/g, function (char) {
return char.toUpperCase();
});
},
toOldStyle(newStylePhenotype){
let oldStyle = structuredClone(newStylePhenotype);
oldStyle.description = newStylePhenotype.phenotype_name;
oldStyle.name = newStylePhenotype.phenotype;
oldStyle.group = newStylePhenotype.display_group;
return oldStyle;
},
formatAllPhenotypes(){
let newPhenotypes = this.$store.state.pigeanAllPhenotypes.data;
let output = [];
for (let i = 0; i < newPhenotypes.length; i++){
output.push(this.toOldStyle(newPhenotypes[i]));
}
this.$store.dispatch("phenotypesInSession", output);
}
},

render(createElement, context) {
Expand Down
5 changes: 5 additions & 0 deletions src/views/PIGEAN/Index/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from "vue";
import Vuex from "vuex";

import bioPortal from "@/modules/bioPortal";
import bioIndex from "@/modules/bioIndex";
import kp4cd from "@/modules/kp4cd";
import regionUtils from "@/utils/regionUtils";
import variantUtils from "@/utils/variantUtils";
Expand All @@ -15,6 +16,7 @@ export default new Vuex.Store({
modules: {
bioPortal,
kp4cd,
pigeanAllPhenotypes: bioIndex("pigean-phenotypes"),
},
state: {
geneOrRegionOrVariant: null,
Expand Down Expand Up @@ -90,6 +92,9 @@ export default new Vuex.Store({
async onDatasetChange(context, dataset) {
window.location.href = "./dinspector.html?dataset=" + dataset.name;
},
async getPigeanPhenotypes(context) {
await context.dispatch("pigeanAllPhenotypes/query", {q:1});
},

},

Expand Down

0 comments on commit 6ecc2aa

Please sign in to comment.