Commit 318ee94f authored by Marek Ostaszewski's avatar Marek Ostaszewski
Browse files

updated code for text mining/omnipath network

parent d92ab358
......@@ -60,8 +60,7 @@ retrieve_stringdb_net <- function(finput, fn, fscore) {
resp <- httr::POST(url = "api.jensenlab.org/network",
httr::add_headers('Content-Type' = "application/x-www-form-urlencoded"),
body = paste0("entities=", entities, "&additional=", n),
httr::verbose())
body = paste0("entities=", entities, "&additional=", n))
json <- jsonlite::fromJSON(httr::content(resp, as = "text", encoding = "UTF-8"), flatten = FALSE)
......@@ -92,8 +91,7 @@ retrieve_omnipath <- function(finput, only_between_inputs = T) {
paste(finput, collapse = ","),"&fields=sources,references")
resp <- httr::GET(url = url,
httr::add_headers('Content-Type' = "application/x-www-form-urlencoded"),
httr::verbose())
httr::add_headers('Content-Type' = "application/x-www-form-urlencoded"))
result <- read.table(text = httr::content(resp, as = "text", encoding = "UTF-8"),
sep = "\t", header = T)
......@@ -184,4 +182,4 @@ if(nrow(ppi_network) == 0) {
"is_directed", "consensus_direction", "references")]
write.table(ppi_network, outputFile, sep = "\t", quote = F, row.names = F, col.names = T)
}
\ No newline at end of file
}
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