-
Notifications
You must be signed in to change notification settings - Fork 1
/
hmdb_database.R
59 lines (55 loc) · 1.26 KB
/
hmdb_database.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#' @title get_hmdb_pathway
#' @description Get compound from HMDB (SMPDB)
#' @author Xiaotao Shen
#' \email{shenxt@@stanford.edu}
#' @param threads threads
#' @export
get_hmdb_compound <- function(
threads = 3
){
data("hmdbMS1Database", envir = environment())
message(
crayon::yellow(
"This database is downloaded in",
hmdbMS1Database@database.info$Version
)
)
cat("\n")
return(hmdbMS1Database)
}
#' @title get_hmdb_pathway
#' @description Get pathways from HMDB (SMPDB)
#' @author Xiaotao Shen
#' \email{shenxt@@stanford.edu}
#' @param threads threads
#' @export
# load("data/hmdb_pathway.rda")
# load("data/primary_pathway")
#
# idx = match(primary_pathway, hmdb_pathway@pathway_id)
# idx = idx[!is.na(idx)]
# pathway_class =
# hmdb_pathway@pathway_class
#
# for(x in idx){
# pathway_class[[x]] = paste(pathway_class[[x]], "primary_pathway", sep = ";")
# }
#
#
#
# pathway_class[idx]
#
# hmdb_pathway@pathway_class = pathway_class
#
# save(hmdb_pathway, file = "data/hmdb_pathway.rda", )
get_hmdb_pathway <- function(threads = 3) {
data("hmdb_pathway", envir = environment())
message(
crayon::yellow(
"This database is downloaded in",
hmdb_pathway@database_info$version
)
)
cat("\n")
return(hmdb_pathway)
}