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

formats in sbgn

parent ebd8d89d
Pipeline #36782 passed with stages
in 2 minutes and 38 seconds
##################################################
## Project: COVID-19 Disease Map
## Script purpose: Get different formats of the MINERVA diagrams
## Date: 25.01.2021
## Author: Marek Ostaszewski
##################################################
### Helper functions to access and retrieve content from MINERVA-hosted diagrams
source("https://git-r3lab.uni.lu/covid/models/-/raw/master/Integration/MINERVA_access/minerva_access_functions.R")
### The address of the COVID-19 Disease Map in MINERVA
map <- "https://covid19map.elixir-luxembourg.org/minerva/api/"
library(jsonlite)
### Get config to obtain the default map and different format handlers
cfg <- fromJSON(ask_GET(paste0(map, "configuration/")))
### Get the default (most recent) project id
project_id <- cfg$options[cfg$options$type == "DEFAULT_MAP","value"]
### The address of the latest (default) build
mnv_base <- paste0(map, "projects/",project_id,"/")
### Get model information
models <- fromJSON(ask_GET(paste0(mnv_base, "models/")))
### Format handler;
### see cfg$modelFormats for available handlers, we will use the SBGNML handler
this_handler <- with(cfg$modelFormats, handler[name == "SBGN-ML"])
this_extension <- with(cfg$modelFormats, extension[name == "SBGN-ML"])
### Iterate over all model ids, get them in the format defined by the handler and add the handler-associated extension
for(i in 1:nrow(models)) {
lines <- ask_GET(paste0(mnv_base, "models/", models$idObject[i],":downloadModel?handlerClass=",this_handler))
cat(lines, file = paste0(models$name[i], ".", this_extension))
}
message("Done.")
\ 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