Commit 35bda576 authored by David Hoksza's avatar David Hoksza
Browse files

fixed submaps enrichment

parent 887804e9
......@@ -180,11 +180,16 @@ function calculatePathways() {
const pwIdName = {};
const modelHgncs = {};
const modelAllProteinRnaGene = {};
globals.allBioEntities.forEach(e => {
const eType = e.getType();
const modelId = e.getModelId();
if (!(modelId in modelAllProteinRnaGene)){
modelAllProteinRnaGene[modelId] = [];
}
if (eType === "Pathway") {
pwIdName[e.id] = e.getName();
const pwName = e.getName();
......@@ -199,6 +204,7 @@ function calculatePathways() {
}
} else if (eType === "Protein" || eType === "RNA" || eType === "Gene") {
globals.allProteinRnaGene.push(e);
modelAllProteinRnaGene[modelId].push(e);
const hgncs = [...new Set(e.getReferences().filter(ref => ref.getType() === "HGNC_SYMBOL").map(ann => ann.getResource()))];
globals.hgncProteinRnaGene[e.id] = hgncs;
......@@ -231,7 +237,8 @@ function calculatePathways() {
let hgncs = [];
globals.ModelPathway[modelId][pwName].bioEntities.forEach(e => {
const pwDims= [e.getX(), e.getX() + e.getWidth(), e.getY(), e.getY() + e.getHeight()];
globals.allProteinRnaGene.forEach(prg => {
modelAllProteinRnaGene[modelId].forEach(prg => {
// globals.allProteinRnaGene.forEach(prg => {
if (pointInRectangle(prg.getX(), prg.getY(), pwDims) ||
pointInRectangle(prg.getX() + prg.getWidth(), prg.getY(), pwDims) ||
pointInRectangle(prg.getX(), prg.getY() + prg.getHeight(), pwDims) ||
......
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