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

Brief introduction

Two widely used metabolic pathways are utilized in metpath, namely KEGG and HMDB/SMPDB.

KEGG pathway

We can just download the KEGG online or from the metpaht pacakge.

library(metpath)
kegg_hsa_pathway = 
  get_kegg_pathway(local = TRUE, organism = "hsa", threads = 3)

The date when the pathway database is downloaded will show.

kegg_hsa_pathway

Just type the pathway and the information of it will show.

We can also download the latest version of KEGG pathway. Make sure the internet is good and it will take a while to download.

kegg_hsa_pathway2 = 
  get_kegg_pathway(local = FALSE, organism = "hsa", threads = 3)
kegg_hsa_pathway2

KEGG compound

We can also get the KEGG compound database using metpath.

kegg_compound = 
  get_kegg_compound(local = TRUE, threads = 5)
kegg_compound

We can also download the online KEGG compound database. But it will take a long time.

kegg_compound2 = 
  get_kegg_compound(local = FALSE, threads = 5)

HMDB pathway

We can just download the HMDB online or from the metpaht pacakge.

hmdb_hsa_pathway = 
  get_hmdb_pathway(threads = 3)

The date when the pathway database is downloaded will show.

hmdb_hsa_pathway

Just type the pathway and the information of it will show.

HMDB compound

We can also get the HMDB compound database using metpath.

hmdb_compound = 
  get_hmdb_compound(threads = 5)
hmdb_compound

Processing of pathway class

Brief information of pathway database

length(kegg_hsa_pathway)
get_pathway_class(kegg_hsa_pathway)

Accessor

kegg_hsa_pathway[1:5]
head(names(kegg_hsa_pathway))
names(kegg_hsa_pathway[c("hsa00010", "hsa00020")])

Extract data

database_info(kegg_hsa_pathway)


tidymass/metpath documentation built on July 21, 2023, 3:11 p.m.