1. Introduction

The pathway analysis module supports pathway analysis (integrating enrichment analysis and pathway topology analysis) and visualization for 21 model organisms, including Human, Mouse, Rat, Cow, Chicken, Zebrafish, Arabidopsis thaliana, Rice, Drosophila, Malaria, S. cerevisae, E.coli, and others, with a total of ~1600 metabolic pathways.

2. Pathway Analysis Example Workflow

In this workflow, we will perform pathway analysis where the input is a list of compound names.

# Create vector consisting of compounds for enrichment analysis 
tmp.vec <- c("Acetoacetic acid", "Beta-Alanine", "Creatine", "Dimethylglycine", "Fumaric acid", "Glycine", "Homocysteine", "L-Cysteine", "L-Isolucine", "L-Phenylalanine", "L-Serine", "L-Threonine", "L-Tyrosine", "L-Valine", "Phenylpyruvic acid", "Propionic acid", "Pyruvic acid", "Sarcosine")

# Create mSetObj for storing objects created during your analysis
mSet<-InitDataObjects("conc", "pathora", FALSE)

# Set up mSetObj with the list of compounds
mSet<-Setup.MapData(mSet, tmp.vec);

# Cross reference list of compounds against libraries (hmdb, pubchem, chebi, kegg, metlin)
mSet<-CrossReferencing(mSet, "name");

# Creates a mapping result table; shows HMDB, KEGG, PubChem, etc. IDs
# Saved as "name_map.csv" or can be found in mSet$dataSet$map.table
# Compounds with no hits will contain NAs across the columns
mSet<-CreateMappingResultTable(mSet);

# From the mapping result table, L-Isolucine has no matches
# Now, perform potential matching with our database against this compound
mSet<-PerformDetailMatch(mSet, "L-Isolucine");

# Get list of candidates for matching
# Results are found in mSet$name.map$hits.candidate.list
mSet<-GetCandidateList(mSet);

# Replace L-Isolucine with selected compound (L-Isoleucine)
mSet<-SetCandidate(mSet, "L-Isolucine", "L-Isoleucine");

# Select the pathway library, ranging from mammals to prokaryotes
# Note the third parameter, where users need to input the KEGG pathway version. 
# Use "current" for the latest KEGG pathway library or "v2018" for the KEGG pathway library version prior to November 2019. 
mSet<-SetKEGG.PathLib(mSet, "hsa", "current")

# Set the metabolite filter
# Default set to false
mSet<-SetMetabolomeFilter(mSet, F);

# Calculate the over representation analysis score, here we selected to use the hypergeometric test (alternative is Fisher's exact test)
# A results table "pathway_results.csv" will be created and found within your working directory
mSet<-CalculateOraScore(mSet, "rbc", "hyperg")

# Plot of the Pathway Analysis Overview 
mSet<-PlotPathSummary(mSet, "path_view_0_", "png", 72, width=NA)

# Plot a specific metabolic pathway, in this case "Glycine, serine and threonine metabolism"
mSet<-PlotKEGGPath(mSet, "Glycine, serine and threonine metabolism",528, 480, "png", NULL)

Trouble Shooting

When performing compound mapping (PerformIntegCmpdMapping), you may come across this error:

[1] "Loading files from server unsuccessful. Ensure curl is downloaded on your computer." Error in .read.metaboanalyst.lib("compound_db.rds") : objet 'my.lib' introuvable

This means that the function was unable to download the "compound_db.rds" file from the MetaboAnalyst server. This could be because curl is not installed on your computer. Download from here: https://curl.haxx.se/download.html. curl is a command line tool for transferring files using a URL. Once curl is installed, try the function again. If it still does not work, download the "compound_db.rds" file manually from this link: https://www.dropbox.com/s/nte1ok440bt1l8w/compound_db.rds?dl=0. Make sure that the file is always in your current working directory when performing compound mapping.

3. Sweave Report

Following analysis, a comprehensive report can be generated which contains a detailed description of each step performed in the R package, embedded with graphical and tabular outputs. To prepare the sweave report, please use the PreparePDFReport function. You must ensure that you have the nexessary Latex libraries to generate the report (i.e. pdflatex, LaTexiT). The object created must be named mSet, and specify the user name in quotation marks.

PreparePDFReport(mSet, "My Name")


xia-lab/MetaboAnalystR3.0 documentation built on May 6, 2020, 11:03 p.m.