Commit faaf461b authored by Marek Ostaszewski's avatar Marek Ostaszewski
Browse files

Merge branch 'fix-undefined-model' into 'master'

fix situtation when a pathway is obtained before any species

See merge request !8
parents abcb5bc1 26d702c3
Pipeline #15709 passed with stages
in 2 minutes and 14 seconds
require('../css/styles.css'); require('../css/styles.css');
const pluginName = 'GSEA'; const pluginName = 'GSEA';
const pluginVersion = '0.9.0'; const pluginVersion = '0.9.1';
const globals = { const globals = {
models: {}, models: {},
...@@ -196,6 +196,17 @@ function calculatePathways() { ...@@ -196,6 +196,17 @@ function calculatePathways() {
modelAllProteinRnaGene[modelId] = []; modelAllProteinRnaGene[modelId] = [];
} }
if (!(modelId in globals.ModelPathway)) {
globals.ModelPathway[modelId] = {};
//empty pathway name stands for the whole submap
globals.ModelPathway[modelId][''] = {
bioEntities: [],
hgncNames: new Set(),
pVal: undefined
};
modelHgncs[modelId] = [];
}
if (eType === "Pathway") { if (eType === "Pathway") {
pwIdName[e.id] = e.getName(); pwIdName[e.id] = e.getName();
const pwName = e.getName(); const pwName = e.getName();
...@@ -214,17 +225,6 @@ function calculatePathways() { ...@@ -214,17 +225,6 @@ function calculatePathways() {
const hgncs = [...new Set(e.getReferences().filter(ref => ref.getType() === "HGNC_SYMBOL").map(ann => ann.getResource()))]; const hgncs = [...new Set(e.getReferences().filter(ref => ref.getType() === "HGNC_SYMBOL").map(ann => ann.getResource()))];
globals.hgncProteinRnaGene[e.id] = hgncs; globals.hgncProteinRnaGene[e.id] = hgncs;
if (!(modelId in globals.ModelPathway)) {
globals.ModelPathway[modelId] = {};
//empty pathway name stands for the whole submap
globals.ModelPathway[modelId][''] = {
bioEntities: [],
hgncNames: new Set(),
pVal: undefined
};
modelHgncs[modelId] = [];
}
if (hgncs.length > 0) { if (hgncs.length > 0) {
//empty pathway name stands for the whole (sub)map //empty pathway name stands for the whole (sub)map
modelHgncs[modelId]= modelHgncs[modelId].concat(hgncs); modelHgncs[modelId]= modelHgncs[modelId].concat(hgncs);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment