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

Merge branch 'fix-old-browsers-support' into 'master'

Fix old browsers support

See merge request !7
parents 93247220 38f555a7
Pipeline #14735 passed with stages
in 2 minutes and 10 seconds
const presets = [
[
"@babel/env",
{
targets: {
"browsers": ["chrome >= 40 or firefox >= 35 or safari > 9"]
},
useBuiltIns: "usage",
corejs: 3,
},
],
];
module.exports = { presets };
\ No newline at end of file
{
"name": "minerva-plugins-gsea",
"version": "0.0.1",
"version": "0.9.0",
"description": "",
"main": "index.js",
"scripts": {
"babel": "babel src -d __tmp_minerva_plugin -D ",
"clean-babel": "rimraf __tmp_minerva_plugin",
"build-css": "node-sass --include-path src/css src/css/styles.scss src/css/styles.css",
"build": "mkdirp dist && npm run build-css && browserify -t [ babelify --presets es2015 ] -t browserify-css src/js/index.js | uglifyjs --compress --mangle > dist/plugin.js ",
"build-debug": "mkdirp dist && npm run build-css && browserify -t [ babelify --presets es2015 ] -t browserify-css src/js/index.js > dist/plugin.js ",
"watch-js": "mkdirp dist && npm run build-css && watchify -v -t [ babelify --presets es2015 ] -t browserify-css src/js/index.js -o dist/plugin.js",
"clean": "rimraf dist"
"build": "mkdirp dist && npm run build-css && npm run babel && browserify -t browserify-css __tmp_minerva_plugin/js/index.js | uglifyjs --compress --mangle > dist/plugin.js && npm run clean-babel",
"build-debug": "mkdirp dist && npm run build-css && npm run babel && browserify -t browserify-css __tmp_minerva_plugin/js/index.js > dist/plugin.js && npm run clean-babel",
"clean": "rimraf dist && npm run clean-babel"
},
"author": "Marek Ostaszewski, David Hoksza",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babelify": "^8.0.0",
"@babel/cli": "^7.6.2",
"@babel/core": "^7.6.2",
"@babel/preset-env": "^7.6.2",
"browserify": "^14.5.0",
"browserify-css": "^0.13.1",
"browserify-css": "^0.15.0",
"core-js": "^3.2.1",
"mkdirp": "^0.5.1",
"node-sass": "^4.6.1",
"rimraf": "latest",
"uglify-js": "^3.1.9",
"watchify": "^3.9.0"
"uglify-js": "^3.1.9"
},
"dependencies": {
"npm": "^6.4.1"
"@babel/polyfill": "^7.6.0",
"npm": "^6.11.3"
}
}
......@@ -161,7 +161,7 @@ function initMainPageStructure() {
<span class="pull-right fa fa-chevron-down">
</div>
<div id="instructions_panel_${pluginContainerId}" class="panel-body card-body panel-default panel-collapse collapse">
This is a basic Gene Set Enrichment plugin. It calculates enrichment of elements from selected overlay(s) in the pathways of the map (grey areas).<br><br>
This is a basic Gene Set Enrichment plugin. It calculates enrichment of elements from selected overlay(s) in the pathways of the map (coloured areas).<br><br>
<u>Show enriched pathways</u> button calculates the enrichment scores (Bonferroni-adjusted p-value), lists the significantly enriched pathways in the window "Gene Set Enrichment Analysis" window, and highlights them.<br><br>
<u>Reset</u> button removes the results and the enrichment.<br><br>
If multiple overlays are selected, the enrichment will be calculated for the combined gene sets.
......@@ -186,11 +186,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();
......@@ -205,6 +210,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;
......@@ -237,7 +243,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