Commit ef21d360 authored by David Hoksza's avatar David Hoksza
Browse files

Merge branch 'master' into 'minerva-v14'

# Conflicts:
#   .gitlab-ci.yml
#   src/js/index.js
parents d00c4bbc 8396a1d4
Pipeline #12992 passed with stage
in 1 minute and 1 second
......@@ -26,7 +26,7 @@ deploy:
- npm install
- npm run build
- echo "mkdir plugins-www/gsea"|sftp -P 8022 gitlab-ci@10.240.6.160
- echo "put dist/plugin.js plugins-www/gsea/"|sftp -P 8022 gitlab-ci@10.240.6.160
- echo "mkdir plugins-www/starter-kit"|sftp -P 8022 gitlab-ci@10.240.6.160
- echo "put dist/plugin.js plugins-www/starter-kit/"|sftp -P 8022 gitlab-ci@10.240.6.160
# Minerva GSEA plugin
# Minerva plugin creation with starter-kit
A plugin allowing to calculate the gene set enrichment based on the data overlays highlighted by the user.
Minerva plugin is a javascript file which manages its dedicated space in the Minerva page (right hand side panel). Since the plugin is a single Javascript file, all its content needs to be added/updated with JavaScript (no HTML pages). The same holds for CSS which either needs to be added via JavaSscript, or bundled using NPM (that is what starter-kit is doing), Gulp, Webpack or other similar technologies.
## General comments
......@@ -16,6 +16,8 @@ The starter-kit example uses NPM (node package manager) and Browserify (and few
* Download and install [NPM](https://nodejs.org/en/download/) if it is not yet installed on your system (try running `npm` from command line to find out)
* run `npm install` (this will create the *node_modules* directory with the required NPM modules)
* run `npm run build` to build the plugin which will be available in the *dist* directory
* run `npm run build-debug` if you want to obtained non-minified version of the compiled plugin, which can be used for
debugging the plugin in, e.g., Google Chrome DevTools
* publish the resulting *plugin.js* file somewhere where it can be accessed by Minerva (please beware that if the instance is running on HTTPS, the plugin must be also accessible through HTTPS)
For the development process you might want to have your local instance of Minerva running, so that you do not have to publish the plugin file every time you do a change. However, if you do not have a local Minerva instance, you can use command line to commit and push your plugin to, e.g., GitHub and provide Minerva address of the raw file. So for example if your GitHub repository with the plugin is [https://github.com/davidhoksza/minerva-plugins-starter-kit/](https://github.com/davidhoksza/minerva-plugins-starter-kit/) you can run
......@@ -54,6 +56,18 @@ All the interaction with Minerva should happen through the minerva proxy object
* beware that most of these functions are asynchronous so they actually return a promise not the actual objects
* map: functions to interact with the visual aspect of the map, mainly `showBioEntity` (highlights a bioentity), `hideBioEntity`, `fitBounds` (zooms to provided coordinates) and `addListener` (enables listening to events such as selection of entities) - see examples of using these functions in the starter-kit and the Minerva's [JavaScript API documntation](https://git-r3lab.uni.lu/piotr.gawron/minerva#javascript-api-unstable-dev-api).
An example of interaction with Minerva (see the `index.html` for more examples):
```
minervaProxy.project.data.getAllBioEntities().then(function(bes){
console.log(bes);
let be = bes[0];
//the following line is valid only if the first bioineity is of type ALIAS and not REACTION
minervaProxy.project.data.getBioEntityById({id:be.getId(), modelId:bw.getModelId(), type:'ALIAS'}).then( function(be1) {
console.log(be1);
});
```
Some of the functions are also described in the [JavaScript API documntation](https://git-r3lab.uni.lu/piotr.gawron/minerva#javascript-api-unstable-dev-api).
###### ServerConnector object
......@@ -62,8 +76,4 @@ Minerva also exposes variable called `ServerConnector` to the global scope (ther
###### Minerva's API
It can happen that there exists a (mainly data-related) functionality which is not available in the proxy object but is available through [Minerva's REST API](https://git-r3lab.uni.lu/piotr.gawron/minerva). In such case you can use Ajax to retrieve the data (the easiest way is probably to use jQuery's [getJSON](http://api.jquery.com/jquery.getjson/) function).
It can happen that there exists a (mainly data-related) functionality which is not available in the proxy object but is available through [Minerva's REST API](https://git-r3lab.uni.lu/piotr.gawron/minerva). In such case you can use Ajax to retrieve the data (the easiest way is probably to use jQuery's [getJSON](http://api.jquery.com/jquery.getjson/) function).
\ No newline at end of file
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