Commit 8dc06b45 authored by Marek Ostaszewski's avatar Marek Ostaszewski
Browse files

WikiPathways CellDesigner conversions

parent 3c09cc1d
......@@ -7,4 +7,27 @@
library(httr)
read.csv()
\ No newline at end of file
### Read the list of resources to be integrated
res <- read.csv(url("https://git-r3lab.uni.lu/covid/models/raw/master/Integration/resources.csv"),
header = T, stringsAsFactors = F)
gpmls <- res[res$Type == "GPML",]
for(r in 1:nrow(gpmls)) {
con <- url(gpmls[r,]$Resource)
rls <- paste(readLines(con), collapse = "\n")
close(con)
### We use httr::POST to execute the API call, and then write down the response
res <- httr::POST(url = "https://minerva-covid19-curation.lcsb.uni.lu/minerva/api/convert/GPML:CellDesigner_SBML",
body = rls,
content_type("text/plain"))
### Get resulting XML content as text
cont <- content(res, as = "text")
### Get resource filename to name the output, last token after splitting by '/'
fname <- tail(unlist(strsplit(gpmls[r,]$Resource, split = "/")),1)
### Write the result to a file
cat(cont, file = paste0(fname,".xml"))
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
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