Metabolomic network edge list generation
if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("ChemmineR") devtools::install_github('dgrapov/metabomapr')
#devtools::install_github("dgrapov/metabomapr") library(metabomapr) library(dplyr)
main<-test_data() head(main)
type<-'CID' id<-main[,type] cid_el<-CID_tanimoto(id,as='edge.list') head(cid_el)
type<-'KEGG' id<-main[,type] kegg_el<-get_KEGG_edgeList(id) head(kegg_el)
type<-'CID' cid_el<- cid_el %>% convert_edgeIndex(.,start=type,end='id',db=main) %>% data.frame(.,cid_el %>% select(-source,-target),type=type) type<-'KEGG' kegg_el<- kegg_el %>% convert_edgeIndex(.,start=type,end='id',db=main) %>% data.frame(.,kegg_el %>% select(-source,-target),value=1,type=type) #combined edge list el<-rbind(kegg_el,cid_el) head(el)
Define server
options('open_cpu_url' = 'http://localhost/ocpu/') options('metabomapr_url' = 'library/metabomapr/R/' )
Make call using simple opencpuclient
library(ocpuclient) type<-'CID' id<-main[,type] body<-list(type=type,cids=id,as='edge.list') fun<-'CID_tanimoto' x<-ocpuclient:::ocpu_post(fun,body=body,pkg_url = getOption('metabomapr_url'), base_url=getOption('open_cpu_url')) x$results
r Sys.Date()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.