Open KristinaGagalova opened 1 year ago
Hi I was wondering if you can share some functions in R to access HMDB, SMPDB, ChemFont? Do you access these dbs through an API? Thank you in advance Kristina
have you solved the problem?
3.2 #Compound name mapping
name.vec <- sig_up_volcano_list #c("1,3-Diaminopropane;2-Ketobutyric acid;2-Hydroxybutyric acid;2-Methoxyestrone") toSend = list(queryList = name.vec, inputType = "hmdb_id") head(toSend) library(httr)
call <- "http://api.xialab.ca/mapcompounds"
query_results <- httr::POST(call, body = toSend, encode = "json") head(query_results)
query_results$status_code==200
query_results_text <- content(query_results, "text", encoding = "UTF-8") query_results_json <- rjson::fromJSON(query_results_text, flatten = TRUE) query_results_table <- t(rbind.data.frame(query_results_json)) rownames(query_results_table) <- query_results_table[,1]
Hi I was wondering if you can share some functions in R to access HMDB, SMPDB, ChemFont? Do you access these dbs through an API? Thank you in advance Kristina