knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  warning = FALSE,
  message = TRUE,
  out.width = "100%"
)

Request

Get the information of all pathways in KEGG (https://www.genome.jp/kegg/pathway.html).

library(massdatabase)
pathway_info <- 
  request_kegg_pathway_info(organism = "hsa")
head(pathway_info)

Get the information of one pathway.

pathway <- 
  request_kegg_pathway(pathway_id = "hsa00010")
pathway

Download

Download the human pathway data.

download_kegg_pathway(path = "kegg_human_pathway",
                      sleep = 1,
                      organism = "hsa")

Read

Read the download pathway data.

data <- 
  read_kegg_pathway(path = "kegg_human_pathway")
class(data)
length(data)
data[[1]]$pathway_id
data[[1]]$pathway_name
data[[1]]$pathway_class
data[[1]]$compound_list
data[[1]]$related_module

Convert it to metpath class database

# kegg_human_pathway <- 
# convert_kegg2metpath(data = data, 
#                      path = "kegg_human_pathway", 
#                      threads = 3)
# kegg_human_pathway

Session information

sessionInfo()


tidymass/massdatabase documentation built on Sept. 10, 2023, 10:35 p.m.