diff --git a/README.md b/README.md index b568921a6a621bff3f3a6ffcfcf1ab6640c40551..0f06b593e02ee1721f5900b198eebe47f9ddc0b8 100644 --- a/README.md +++ b/README.md @@ -1,636 +1,108 @@ [](https://git-r3lab.uni.lu/piotr.gawron/minerva/commits/master) -# Rest API (version 11) +# For users +Documentation for minerva can be found here: https://minerva.pages.uni.lu/doc/ -## Introduction +# For developers -Rest API is located in /api/ path of the deployed application. For instance, Rest API of pdmap project that can be browsed using http://pdmap.uni.lu/minerva/ will be located here: http://pdmap.uni.lu/minerva/api/ +## Installation -Rest API tries to follow [API Design Guide](https://cloud.google.com/apis/design/) by Google. - -All API calls (except login) must include MINERVA_AUTH_TOKEN obtained due login process. - -## Quickstart guide - -To use API first we need to login: -`curl -X POST -c - --data "login=anonymous&password=" http://pg-sandbox.uni.lu/minerva/api/doLogin` +After cloning repo you need to install following tools: +* postgresql (>=9.1) +* tomcat (tested on tomcat7) +* Java8 - works on both OpenJDK 8 and Oracle Java 8 +* maven +* ant +* node.js + npm +You need to create user and database: ``` - % Total % Received % Xferd Average Speed Time Time Time Current - Dload Upload Total Spent Left Speed -100 55 0 55 0 0 1774 0 --:--:-- --:--:-- --:--:-- 1774{"info":"Login successful. TOKEN returned as a cookie"}# Netscape HTTP Cookie File -# https://curl.haxx.se/docs/http-cookies.html -# This file was generated by libcurl! Edit at your own risk. - -localhost FALSE / FALSE 1496934071 MINERVA_AUTH_TOKEN xxxxxxxx +username: map_viewer +password: 123qweasdzxc +dbname: map_viewer ``` -The response creates an authentication token and puts it into a cookie `MINERVA_AUTH_TOKEN=xxxxxxxx`. When using console curl command this cookie must be attached to every query that follows. -When we have authentication token we can access information about december release of PD map project: -` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/ -` -## Specification +If you want to use different credentials or your database in not hosted locally you can configure it by creating file `/etc/minerva/db.properties`. Template of the file can be found here: https://git-r3lab.uni.lu/minerva/core/blob/master/persist/src/main/resources/db.properties -### Authentication -* Login: - * URL: `/doLogin` - * Method: POST - * Parameters: - * `login` - user login, 'anonymous' can be used for accessing api with guest account access level - * `password` - user passwod, for guest account this field is optional - * Output. If login operation is successfull then `MINERVA_AUTH_TOKEN` cookie will be created with authentication token. If credentails are invalid response with `403` status code will be returned. Token will be valid for the next 120 minutes. - * Example: -``` -curl -X POST -c - --data "login=anonymous&password=" http://pg-sandbox.uni.lu/minerva/api/doLogin -``` +Database schema is managed automatically by [flyway](https://flywaydb.org/), so there is no need to populate the database with anything. -* Logout: - * URL: `/doLogout` - * Method: POST - * Parameters: *NONE* - * Example: +Now your dev environment is configured and ready to use. To test it you can run unit tests: +* back-end - go to one of the Java modules (ie 'persist') and call mvn test: ``` -curl -X POST -c - http://pg-sandbox.uni.lu/minerva/api/doLogout +cd ~/workspace/minerva/commons/ +mvn test ``` - - -### Configuration -* URL: `/configuration/` -* Method: GET -* Parameters: *NONE* -* Output: List of all minerva configuration details. -* Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/configuration/ +* front-end - go to module with front-end, install all npm dependencies and run tests: ``` - -### Genomics -* URL: `/genomics/taxonomies/{organismId}/genomeTypes/{type}/versions/{version}/` -* Method: GET -* Parameters: - * `organismId` - identifier of the organism in taxonomy db - * `type` - type of genome (database from which reference genome should be used), for now only UCSC is supported - * `version` - version of the reference genome -* Example: +cd ~/workspace/minerva/frontend-js/ +npm install +npm test ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/genomics/taxonomies/9606/genomeTypes/UCSC/versions/hg19/ -``` -### Projects +## Build -* Project data: - * URL: `/projects/{projectId}/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/ -``` - -* Source file: - * URL: `/projects/{projectId}:downloadSource` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_jun16:downloadSource --output some.file -``` - -#### (sub)Maps -* List of (sub)maps in a project - * URL: `/projects/{projectId}/models/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/" -``` - -* Download map as a model file (ie. in CellDesigner format) - * URL: `/projects/{projectId}/models/{modelId}:downloadModel` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project - * `handlerClass` - class preparing model file. For list of all possible values check `/configuration/` response. - * `polygonString` (\*) - polygon defining part of the model for downloading - * See also `/configuration/` query to get list of possible formats - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/15305:downloadModel?handlerClass=lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser" --output some.file -``` - -* Download map as an image - * URL: `/projects/{projectId}/models/{modelId}:downloadImage` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project - * `handlerClass` - class preparing image file. For list of all possible values check `/configuration/` response. - * `backgroundOverlayId` (\*) - identifier of the overlay used as a background overlay when creating image - * `overlayIds` (\*) - comma separated list of overlay identifiers that should be included in the image - * `zoomLevel` (\*) - zoom level at which image should be generated (min value used by default) - * `polygonString` (\*) - polygon defining part of the model for downloading - * See also `/configuration/` query to get list of possible formats - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/15305:downloadImage?handlerClass=lcsb.mapviewer.converter.graphics.PngImageGenerator" --output some.file -``` - -* Elements: - * URL: `/projects/{projectId}/models/{modelId}/bioEntities/elements/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '*' character - * `columns` (\*) - set of columns (optional). Possible values are: id, modelId, name, type, description, symbol, complexId, compartmentId, fullName, abbreviation, formula, name, synonyms, formerSymbols, references, bounds, hierarchyVisibilityLevel, - * `ids` (\*)- set of database ids (optional) - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities/elements/?columns=id,name,type -``` - -* Reactions: - * URL: `/projects/{projectId}/models/{modelId}/bioEntities/reactions/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '*' character - * `columns` (\*) - set of columns. Possible values are: id, reactionId, modelId, type, lines, centerPoint, products, reactants, modifiers, hierarchyVisibilityLevel, notes - * `ids` (\*) - set of database ids - * `participantId` (\*) - identifier of the element that should be part of the reaction - * Example: +To build `*.war` file that can be deployed on tomcat you need to call ant maven-build task: ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities/reactions/?columns=id,name,type -``` - -* Search: - * URL: `/projects/{projectId}/models/{modelId}/bioEntities:search` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '*' character - * `query` (\*) - search term identifing bioEntity - * `coordinates` (\*) - coordinates where bioEntity should be located - * `count` (\*) - max number of bioEntities to return - * `perfectMatch` (\*) - true when true query must be matched exactly, if false similar results are also acceptable - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities:search?query=SNCA -``` - -* Suggested search queries: - * URL: `/projects/{projectId}/models/{modelId}/bioEntities/suggestedQueryList` - * Method: GET - * Output: List of suggested queries for search mechanism. - * Parameters: - * `projectId` - identifier of the project - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/bioEntities/suggestedQueryList -``` - - -#### Chemicals -* URL: `/projects/{projectId}/chemicals:search` -* Method: GET -* Parameters: - * `projectId` - identifier of the project - * `columns` (\*) - set of columns for each result. Possible values are: name, references, description, directEvidenceReferences, directEvidence, synonyms, id, targets, - * `query` (\*) - chemical name - * `target` (\*) - target for which we are lookig for chemicals. Target is defined as TYPE:ID. For example "ALIAS:534" is searching for chemicals that target Alias with id=534. -* Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/chemicals:search?query=rotenone" -``` - -#### Comments -* List comments - * URL: `/projects/{projectId}/comments/models/{modelId}/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '*' character - * `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email, - * `removed` (\*) - if defined then removed paramter must match. - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" "http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/*/" -``` - -* Reaction comments - * URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/reactions/{reactionId}` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '*' character - * `reactionId` - identifier of the reaction - * `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email, - * `removed` (\*) - if defined then removed paramter must match. - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/reactions/187811/ -``` - -* Element comments - * URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/elements/{elementId}` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '*' character - * `elementId` - identifier of the element - * `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email, - * `removed` (\*) - if defined then removed paramter must match. - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/elements/431868/ -``` - -* Point comments - * URL: `/projects/{projectId}/comments/models/{modelId}/points/{coordinates}` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '*' character - * `coordinates` - coordinates of the point on (sub)map - * `columns` (\*) - set of columns for each result. Possible values are: title, type, content, removed, coord, modelId, elementId, id, pinned, author, email, - * `removed` (\*) - if defined then removed paramter must match. - * Example: TODO - -* Create element comment - * URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/elements/{elementId}` - * Method: POST - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project - * `elementId` - identifier of the element to be commented - * `name` - name of the author - * `email` - email of the author - * `content` - content of the comment - * `pinned` (\*) - when true comment will be visible for others, if false then nobody except of admin will see it - * `coordinates` - coordinates where comment is placed - * Example: -``` -curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&email=a@a.pl&content=someCont&coordinates=1,2" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/elements/431868/ -``` - -* Create reaction comment - * URL: `/projects/{projectId}/comments/models/{modelId}/bioEntities/reactions/{reactionId}` - * Method: POST - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project - * `reactionId` - identifier of the reaction - * `name` - name of the author - * `email` - email of the author - * `content` - content of the comment - * `pinned` (\*) - when true comment will be visible for others, if false then nobody except of admin will see it - * `coordinates` - coordinates where comment is placed - * Example: -``` -curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&email=a@a.pl&content=someCont&coordinates=1,2" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/bioEntities/reactions/187811 -``` - - -* Create coordinates comment - * URL: `/projects/{projectId}/comments/models/{modelId}/points/{coordinates}` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project - * `name` - name of the author - * `email` - email of the author - * `content` - content of the comment - * `pinned` (\*) - when true comment will be visible for others, if false then nobody except of admin will see it - * `coordinates` - coordinates where comment is placed - * Example: -``` -curl -X POST --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data "name=testComment&email=a@a.pl&content=someCont" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/comments/models/15305/points/1.00,2.00 -``` - -#### Drugs -* URL: `/projects/{projectId}/drugs:search` -* Method: GET -* Parameters: - * `projectId` - identifier of the project - * `columns` (\*) - set of columns for each result. Possible values are: name, references, description, bloodBrainBarrier, brandNames, synonyms, id, targets, - * `query` (\*) - drug name or synonym - * `target` (\*) - target for which we are lookig for drugs. Target is defined as TYPE:ID. For example "ALIAS:534" is searching for drugs that target Alias with id=534. -* Example: +cd ~/workspace/minerva/ +ant maven-build ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/drugs:search?query=aspirin -``` - -#### MiRNAs - -* URL: `/projects/{projectId}/miRnas:search` -* Method: GET -* Parameters: - * `projectId` - identifier of the project - * `columns` (\*) - set of columns for each result. Possible values are: name, id, targets, - * `query` (\*) - mirna id - * `target` (\*) - target for which we are lookig for drugs. Target is defined as TYPE:ID. For example "ALIAS:534" is searching for drugs that target Alias with id=534. -* Example: +This will create `~/workspace/minerva/web/target/web-1.0.war` file which can be deployed on tomcat: ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/miRnas:search?query=hsa-miR-125a-3p -``` - - -#### Publications - -* URL: `/projects/{projectId}/models/{modelId}/publications/` -* Method: GET -* Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project or wildcard '\*' character - * `start` (\*) - first element to be return when pagination is on (default 0) - * `length` (\*) - how many publication we want to retrieve (default 10) - -* Example: +cp ~/workspace/minerva/web/target/web-1.0.war $CATALINA_HOME/webapps/minerva.war ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/models/*/publications/ -``` -#### Data overlays -* List user data overlays - * URL: `/projects/{projectId}/overlays/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * Example: +After starting tomcat you can access minerva using http://localhost:8080/minerva/. +Default credentials are: ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/ -``` - -* Add overlay - * URL: `/projects/{projectId}/overlays/` - * Method: POST - * Parameters: - * `projectId` - identifier of the project - * `name` - name of the data overlay - * `content` - content of the file that is uploaded with definition what should be visible where - * `description` - short desription of the data overlay - * `filename` - name of the file that should be used when downloading the source - * Example: +login: admin +password: admin ``` -curl -X POST --data "content=name%09color%0ACAPN1%09%2300FF00%0APARK7%09%23AC0000&description=test%20desc&filename=test.txt&name=test%20nam" --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/ -``` -* Update overlay - * URL: `/projects/{projectId}/overlays/{overlayId}/` - * Method: PATCH - * Parameters: - * `projectId` - identifier of the project - * `overlayId` - identifier of data overlay - * Body: json with updated overlay +## Deployment and release +Before making new release update [changelog file](https://git-r3lab.uni.lu/minerva/core/blob/master/CHANGELOG). -{ - "overlay": { - "name" : name, - "description" : description - } -} - - * Example: +### Debian packages +When all the changes are ready tag commit and push it to the repository. Gitlab ci will execute unit tests and prepare distribution files that can be released. For now we release minerva using debian repository. Therefore gitlab ci creates a deb package (for instance: https://git-r3lab.uni.lu/minerva/core/-/jobs/29918). This package should be uploaded to our repository: ``` -curl -X PATCH --data "{\"overlay\":{\"name\":\"test\", \"description\":\"test2\"}}" --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/ -``` - -* Remove overlay - * URL: `/projects/{projectId}/overlays/{overlayId}/` - * Method: DELETE - * Parameters: - * `projectId` - identifier of the project - * `overlayId` - identifier of data overlay - * Example: +echo 'PUT minerva_12.0.3_amd64.deb'| sftp -P 8022 repo-r3lab.lcsb.uni.lu +ssh repo 'sudo reprepro -b /var/www/html/debian includedeb test minerva_12.0.3_amd64.deb' ``` -curl -X DELETE --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/ -``` -* Download source - * URL: `/projects/{projectId}/overlays/{overlayId}:downloadSource` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `overlayId` - identifier of data overlay - * Example: -``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203:downloadSource -``` +Remember to use proper repository: +* stable - for production ready debian packages +* test - for packages that are ready to test and probably will be moved to stable soon +* experimental - for packages that might crash, can be unstable are created during development process (anything that has `alpha`, `beta` in the version number should be put here) -* Data overlay details - * URL: `/projects/{projectId}/overlays/{overlayId}/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `overlayId` - identifier of data overlay - * Example: +Moreover we store all debian packages on webdav: ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/ -``` - -* bioEntities (Elements and reactions) - * URL: `/projects/{projectId}/overlays/{overlayId}/models/{modelId}/bioEntities/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `overlayId` - identifier of data overlay - * Example: +echo 'put minerva_12.0.3_amd64.deb' | cadaver https://webdav-r3lab.uni.lu/public/minerva/ ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/models/*/bioEntities/ -``` -* Reaction - * URL: `/projects/{projectId}/overlays/{overlayId}/models/{modelId}/bioEntities/reactions/{reactionId}/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project - * `overlayId` - identifier of data overlay - * `reactionId` - identifier of the reaction - * Example: +### Docker image +There is [Dockerfile]( https://git-r3lab.uni.lu/minerva/core/blob/master/Docker/Dockerfile) that allows to build Docker image from currently released debian package. After releasing debian package crete a Docker image and deploy it: ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/models/15305/bioEntities/reactions/187811/ -``` - -* Element - * URL: `/projects/{projectId}/overlays/{overlayId}/models/{modelId}/bioEntities/elements/{elementId}/` - * Method: GET - * Parameters: - * `projectId` - identifier of the project - * `modelId` - identifier of the (sub)map in the project - * `overlayId` - identifier of data overlay - * `elementId` - identifier of the element - * Example: +cd ~/workspace/minerva/Docker/ +docker build --no-cache -t minerva . ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/projects/pdmap_dec15/overlays/3203/models/15305/bioEntities/elements/431433/ -``` - -### Users -* User data - * URL: `/users/{login}/` - * Method: GET - * Parameters: - * `login` - user login - * Example: +Check list of docker images to find DOCKER ID ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/users/testAdmin -``` - -### Conversion - -Conversion API provides access to MINERVA's ability convert between different systems biology -network formats and to export of layouts to different graphical formats. +docker images -* Conversion to systems biology formats - * List available formats - * URL: `/convert/` - * Method: GET or POST - * Example: - * Output: List of input and output format identifiers which can be used as values for the `sourceFormat` and `targetFormat` parameters in other convert API calls +REPOSITORY TAG IMAGE ID CREATED SIZE +minerva latest 26a9534e37ff About an hour ago 1.223 GB +debian jessie bb5d89f9b6cb 13 days ago 125.1 MB ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/convert/ -``` - - * Convert network from an input format to an output format - * URL: `/convert/{sourceFromat}:{tagetFormat}/` - * Method: POST - * Parameters: - * `sourceFromat` - input format (list of available formats be obtained from the `/convert/` API) - * `tagetFormat` - input format (list of available formats be obtained from the `/convert/` API) - * Body: the input file to be converted - * Example: +Tag docker image (assume that your docker ID is "26a9534e37ff" and version is 9999) and push it to repo: ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data-binary @cell_designer.xml -H "Content-Type: text/plain" http://pg-sandbox.uni.lu/minerva/api/convert/CellDesigner_SBML:SBML -``` - -* Conversion to image - * List available formats - * URL: `/convert/image/` - * Method: GET or POST - * Output: List of input and output format identifiers which can be used as values for the `sourceFormat` and `targetFormat` parameters in other convert API calls - * Example: +docker tag 26a9534e37ff docker-r3lab.uni.lu/minerva/minerva:9999 +docker login https://docker-r3lab.uni.lu/ +docker push docker-r3lab.uni.lu/minerva/minerva ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" http://pg-sandbox.uni.lu/minerva/api/convert/image/ -``` - * Convert network from an input format to an output image - * URL: `/convert/image/{sourceFromat}:{tagetFormat}/` - * Method: POST - * Parameters: - * `sourceFromat` - input format (list of available formats be obtained from the `/convert/image/` API) - * `tagetFormat` - input format (list of available formats be obtained from the `/convert/image/` API) - * Body: the input file to be converted - * Example: +### VirtualBox images +We provide also VirtualBox images with minerva installed on it. Just create a new debian virtual box image and upload it to webdav: ``` -curl -X GET --cookie "MINERVA_AUTH_TOKEN=xxxxxxxx" --data-binary @cell_designer.xml -H "Content-Type: text/plain" http://pg-sandbox.uni.lu/minerva/api/convert/image/CellDesigner_SBML:SVG +echo 'put minerva-12.0.1_release.ova' | cadaver https://webdav-r3lab.uni.lu/public/minerva/ ``` -# JavaScript API. Unstable dev API. - -Minerva visualization is created by including `minerva.js` and calling `minerva.create({element:divElement})` method. This method returns a Promise which will resolve to the object that allows custom JS manipulation. - -## Specification - -* `getVisibleDataOverlays()` - * Description: Returns a Promise with list of visible overlays - * Arguments: *NONE* - * Example: -``` -customMap.getVisibleDataOverlays().then(function(overlays){console.log(overlays);}); -``` -* `addListener({dbOverlayName, type, callback})` - * Description: Adds a listener to database connector like drug database. - * Arguments: - * dbOverlayName - string representing database for which we want to register listener, available databases are: `search`, `drug`, `chemical`, `mirna`, `comment` - * type - type of the event, supported db Events are: `onSearch` - * callback - callback method - * Example -``` -customMap.addListener({dbOverlayName:"search",type:"onSearch", callback:function(res){console.log(res);}}); -``` -* `getHighlightedBioEntities(dbOverlayName)` - * Description: returns a promise with list of elements that are currently highlight by the specufuc database - * Arguments: dbOverlayName - string representing database for which we want to register listener, available databases are: `search`, `drug`, `chemical`, `mirna`, `comment` - * Example: -``` -customMap.getHighlightedBioEntities("search").then(function(elements){console.log(elements);}); -``` -* `getProject()` - * Description: Returns object with information about visualized disease map project. - * Arguments: NONE - * Example: -``` -customMap.getProject() -``` -* `getConfiguration()` - * Description: Returns a promise with configuration information obtained from server. Configuration information include configuration options (like default visible map), supported formats, etc. - * Arguments: NONE - * Example: -``` -customMap.getConfiguration().then(function(configuration){console.log(configuration);}); -``` -* `getAllBioEntities()` - * Arguments: NONE - * Example: -``` -customMap.getAllBioEntities().then(function(bioEntities){console.log(bioEntities);}); -``` -* `getBioEntityById({id, modelId, type})` - * Arguments: TODO - * Example: -``` -TODO -``` - -* `getReactionsWithElement(element)` - * Arguments: TODO - * Example: -``` -TODO -``` - -* `showBioEntity({element, type, options})` - * Arguments: - * element - object identifying the element, it should contain three fields: id, type, model; where id is the element id, type is type of the element ('ALIAS', 'REACTION'), and model define submap on which it's defined - * type - how do you want to visualize BioEntity: 'ICON', 'SURFACE' - * options - set of visualization options: color, opacity, lineColor, lineWeight, lineOpacity - * Example: -``` -customMap.showBioEntity({element:{id:18306,type:"ALIAS", modelId:5}, type: "SURFACE", options:{color:"#FF0000"}}); -``` - -* `hideBioEntity({element, type})` - * Arguments: - * element - object identifying the element, it should contain three fields: id, type, model; where id is the element id, type is type of the element ('ALIAS', 'REACTION'), and model define submap on which it's defined - * type - which visualization of BioEntity you want to hide: 'ICON', 'SURFACE' - * Example: -``` -customMap.hideBioEntity({element:{id:18306,type:"ALIAS", modelId:5}, type: "SURFACE"}); -``` - -* `setCenter({modelId, x, y})` - * Arguments: TODO - * Example: -``` -TODO -``` - -* `fitBounds({modelId, x1, y1, x2, y2})` - * Arguments: TODO - * Example: -``` -TODO -``` - -* `setCenter({modelId, x, y})` - * Arguments: TODO - * Example: -``` -TODO -``` - +Image should have root account with `123qweasdzxc` password. It should also expose port 8080 on the host. diff --git a/doc/description.txt b/doc/description.txt deleted file mode 100644 index c0335cd3b20c9b836109dafae6b190e78a8cdd20..0000000000000000000000000000000000000000 --- a/doc/description.txt +++ /dev/null @@ -1,3 +0,0 @@ -MINERVA (Molecular Mnteraction NEtwoRk VisuAlization) platform is a standalone webserver for visualization, exploration and management of molecular networks encoded in SBGN-compliant format. After installation, the resource is used and managed via a webbrowser, under the default address 'http://localhost:8080/minerva/'. You can configure your Tomcat server later to change the address. - - diff --git a/doc/general.vsd b/doc/general.vsd deleted file mode 100644 index 04328b72263876148969ace37181b2c39215e2d6..0000000000000000000000000000000000000000 Binary files a/doc/general.vsd and /dev/null differ diff --git a/doc/installation.txt b/doc/installation.txt deleted file mode 100644 index eaf3460841cc754f9906b85c76c4714d72e22305..0000000000000000000000000000000000000000 --- a/doc/installation.txt +++ /dev/null @@ -1,99 +0,0 @@ -Here is a short description how to install the software. Example commands are designed for Debian. - -1. Requirements - a) java (at least 1.8, but it must be oracle implementation, with sun implementation there are some problems): - > echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list - > echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list - > apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 apt-get update - > apt-get update - > apt-get install oracle-java8-installer - - b) tomcat (7.x): - > wget http://apache.mirrors.pair.com/tomcat/tomcat-7/v7.0.61/bin/apache-tomcat-7.0.61.tar.gz - > tar -zxf apache-tomcat-7.0.61.tar.gz - > mv apache-tomcat-7.0.61 /opt/ - > chown -R localadmin:localadmin /opt/apache-tomcat-7.0.61 - - c) postgres (9.3 or higher): - > echo deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main >/etc/apt/sources.list.d/pgdg.list - > wget https://www.postgresql.org/media/keys/ACCC4CF8.asc - > apt-key add ACCC4CF8.asc - > apt-get update - > apt-get install postgresql - -2. Installation - a) Setup database. Let assume that we have a dump of empty db in the default directory: ~/map_viewer.sql. - Dump of current version can be found in repository: MapViewer/script/db/map_viewer_date.rar. - We need user 'map_viewer' with password '123qweasdzxc' and a database map_viewer. - - > #create user and db - > su - postgres - > createuser -d -r -s map_viewer - > echo "ALTER USER map_viewer WITH PASSWORD '123qweasdzxc';"| psql - > - > #create db - > createdb -O map_viewer map_viewer - > exit - > - > #change hba_conf: - > cp /etc/postgresql/9.4/main/pg_hba.conf /etc/postgresql/9.4/main/pg_hba.conf.bac - > cat /etc/postgresql/9.4/main/pg_hba.conf.bac |grep -v "all[ \t]*peer" >/etc/postgresql/9.4/main/pg_hba.conf - > printf "local all all md5\n" >>/etc/postgresql/9.4/main/pg_hba.conf - > /etc/init.d/postgresql restart - > - > echo "localhost:5432:*:map_viewer:123qweasdzxc" > .pgpass - > chmod 0600 .pgpass - > #unrar db schema - > rar x map_viewer_2014_07_22.rar - > #and copy it into db - > psql -U map_viewer -f map_viewer.sql map_viewer - - b) copy of MapViewer.war deploy file into tomcat webapps - > cp MapViewer.war /opt/apache-tomcat-7.0.57/webapps/ - - c) start tomcat - > /opt/apache-tomcat-7.0.57/bin/startup.sh - - This will setup the software on the machine on the port 8080 (default tomcat port) inthe MapViewer folder. Assuming that you use localhost the url should be something like this: - http://localhost:8080/MapViewer/. - - There is one more thing. Generatnig map requires some libraries for awt that are missing by default installation. Therefore we need to modify catalina.sh scritp in tomcat and add this option: - CATALINA_OPTS="$CATALINA_OPTS -Djava.awt.headless=true" - -3. Installataion of ajp connector for apache (to be able to connect to the map from default 80 port): - - a) install apache - > apt-get install apache2 - - b) install mod_jk - > apt-get install libapache2-mod-jk - - c) configure module if necessary: - > #vi /etc/libapache2-mod-jk/workers.properties - - d) remove xhtml from mod_mime mapping: - > vi /etc/apache2/sites-available/default - - add line like this: - - RemoveType xhtml - - e) add mounting tomcat to the directories - - > vi /etc/apache2/sites-available/default - - add lines: - - JkMount /map_images/ ajp13_worker - JkMount /map_images/* ajp13_worker - JkMount /MapViewer/ ajp13_worker - JkMount /MapViewer ajp13_worker - JkMount /MapViewer/* ajp13_worker - - f) turn on the module - > a2enmod jk - - g) restart apache - > /etc/init.d/apache2 restart - - \ No newline at end of file