MetaPhOR was developed to enable users to assess metabolic dysregulation using transcriptomic-level data (RNA-sequencing and Microarray data) and produce publication-quality figures. A list of differentially expressed genes (DEGs), which includes fold change and p value, from DESeq2 (Love, Huber, and Anders (2014)) or limma (Ritchie et al. (2015)), can be used as input, with sample size for MetaPhOR, and will produce a data frame of scores for each KEGG pathway. These scores represent the magnitude and direction of transcriptional change within the pathway, along with estimated p-values (Rosario et al. (2018)). MetaPhOR then uses these scores to visualize metabolic profiles within and between samples through a variety of mechanisms, including: bubble plots, heatmaps, and pathway models.
This command line can be used to install and load MetaPhOR.
if (!require(“BiocManager”, quietly = TRUE))
install.packages(“BiocManager”)
BiocManager::install(“MetaPhOR”)
library(MetaPhOR)
Minimal data preparation is required to run MetaPhOR. DEGs may be loaded into R in the form of .csv or .tsv for use with this package. The DEG file must contain columns for log fold change, adjusted p-value, and HUGO gene names. By default, MetaPhOR assumes DESeq2 header stylings: “log2FoldChange” and “padj”. In any function that assumes these headers, however, the user can define column names for these values. Below is a sample DEG file resulting from limma:
exdegs <- read.csv(system.file("extdata/exampledegs.csv",
package = "MetaPhOR"),
header = TRUE)
X | logFC | AveExpr | t | P.Value | adj.P.Val | B |
---|---|---|---|---|---|---|
TATDN1 | 0.0996779 | 6.112478 | 6.074387 | 0e+00 | 0.0000523 | 10.736686 |
ZNF706 | 0.1055866 | 6.446976 | 5.845307 | 0e+00 | 0.0000958 | 9.237467 |
DCAF13 | 0.0882855 | 6.393943 | 5.513711 | 1e-07 | 0.0002918 | 7.531541 |
TRMT12 | 0.1093866 | 6.071099 | 5.434470 | 1e-07 | 0.0003550 | 7.377948 |
IGF2BP1 | 0.9256589 | 4.454204 | 5.631783 | 0e+00 | 0.0002065 | 7.273836 |
MAP6D1 | 0.1619178 | 5.719428 | 5.342911 | 1e-07 | 0.0004612 | 7.090578 |
“pathwayAnalysis” first assigns scores and their absolute values using log fold change and p value to each gene (Rosario et al. (2018)). These transcript-level scores, along with sample size, are then utilized to calculate both scores (directional change) and absolute value scores (magnitude of change) (Rosario et al. (2018)) for each KEGG Pathway (Kanehisa and Goto (2000)). We then utilize a bootstrapping method, to randomly calculate 100,000 scores per pathway, based on the number of genes in that pathway and model the distribution. This distribution can then be used to evaluate where the actual score for that pathway sits in relation to the distribution, and can assign a p-value to the achieved score.
For example, if the polyamine biosynthetic pathway contains 13 genes, we can get a score for the sum of the 13 genes that exist within that pathway. Using bootstrapping, we can then randomly sample, with replacement, 13 genes to create scores, 100,000 times. We use these random samples (100,000) to generate a distribution, and we can calculate a p-value dependent on where the score that consists of the 13 genes that actually exist within the pathway falls within the distribution.
Taken together, the scores and p-values resulting from “pathwayAnalysis” provide a measure for both the biological and statistical significance of metabolic dysregulation.
Note: A seed MUST be set before utilizing this function to ensure reproducible results by bootstrapping. It is NECESSARY that the seed remain the same throughout an analysis.
Note: Bootrapping is performed, by default, with 100,000 iterations of resampling for optimal power. The number of iterations can be decreased for improved speed. We use 50,000 iterations for improved speed of examples.*
pathwayAnalysis() requires:
A partial output of the pathway analysis function can be seen as follows:
set.seed(1234)
brca <- pathwayAnalysis(DEGpath = system.file("extdata/BRCA_DEGS.csv",
package = "MetaPhOR"),
genename = "X",
sampsize = 1095,
iters = 50000,
headers = c("logFC", "adj.P.Val"))
Scores | ABSScores | ScorePvals | ABSScorePvals | |
---|---|---|---|---|
Cardiolipin.Metabolism | 0.0293332 | 0.0299031 | 0.22996 | 0.60408 |
Cardiolipin.Biosynthesis | 0.0031671 | 0.0031671 | 0.43074 | 0.91878 |
Cholesterol.Biosynthesis | 0.2400430 | 0.2614076 | 0.06334 | 0.35952 |
Citric.Acid.Cycle | 0.0314352 | 0.1469312 | 0.48340 | 0.92848 |
Cyclooxygenase.Arachidonic.Acid.Metabolism | 0.0004634 | 0.0080444 | 0.52228 | 0.92286 |
Prostaglandin.Biosynthesis | -0.0392858 | 0.1046875 | 0.79502 | 0.35816 |
The metabolic profile determined by pathway analysis can be easily visualized using “bubblePlot.” Scores are plotted on the x-axis, while absolute value scores are plotted on the y-axis. Each point represents a KEGG pathway, where point size represents p-value (the smaller the p value, the larger the point) and point color is dictated by scores. Negative scores, which indicate transcriptional downregulation, are blue, and positive scores, which indicate transcriptional upregulation, are red. The top ten points, either by smallest p value or greatest dysregulation by score, are labeled with their pathway names. The plot demonstrates which pathways are the most statistically and biologically relevant.
bubblePlot() requires:
Bubble Plot Labeled by P Value
pval <- bubblePlot(scorelist = brca,
labeltext = "Pval",
labelsize = .85)
plot(pval)
Bubble Plot Labeled by LogFC
logfc <- bubblePlot(scorelist = brca,
labeltext = "LogFC",
labelsize = .85)
plot(logfc)
“metaHeatmap” provides a useful visualization for comparing metabolic profiles between groups, including only significantly dysregulated pathways, and highlighting those which are most highly changed. This function should be used when you have multiple groups/DEGs being compared, e.g. if you have 4 conditions all being compared to each other. This will not be useful if you have a single DEG list. This function can be used only when multiple DEG comparisons are scored by “pathwayAnalysis.” The absolute pathway scores are scaled across outputs and plotted via pheatmap, selecting only those which have absolute score p values below the level of significance.
Note: A heatmap cannot be produced if there are no pathways significantly dysregulated below the p value cut off.
metaHeatmap() requires:
##read in two additional sets of scores,
##run in the same manner as brca for comparison
ovca <- read.csv(system.file("extdata/OVCA_Scores.csv", package = "MetaPhOR"),
header = TRUE,
row.names = 1)
prad <- read.csv(system.file("extdata/PRAD_Scores.csv", package = "MetaPhOR"),
header = TRUE,
row.names = 1)
all.scores <- list(brca, ovca, prad)
names <- c("BRCA", "OVCA", "PRAD")
metaHeatmap(scorelist = all.scores,
samplenames = names,
pvalcut = 0.05)
“cytoPath” models metabolic pathways, sourced from WikiPathway (Martens et al. (2021)), using the transcriptional change of individual genes in the pathway. The resulting figure can be used to identify candidate genes for further study by providing a detailed look at transcriptional dysregulation within and between “pathwayAnalysis” outputs. Pathways of interest can be readily identified from “bubblePlot” or “metaHeatmap.” This function utilizes Cytoscape (Gustavsen et al. (2019)); the package RCy3 and a local instance of Cytoscape are required to render this plot. For details regarding legends, see the Cytoscape Legend Creator Tutorial (https://cytoscape.org/cytoscape-tutorials/protocols/legend-creator/#/ introduction).
cytoPath() requires:
cytoPath(pathway = "Tryptophan Metabolism",
DEGpath = "BRCA_DEGS.csv",
figpath = paste(getwd(), "BRCA_Tryptophan_Pathway", sep = "/"),
genename = "X",
headers = c("logFC", "adj.P.Val"))
The WikiPathways available within MetaPhOR have been restricted to metabolic pathways. The pathwayList function will provide a complete list of WikiPathways for mapping with “cytoPath.”
pathwayList()
wpid2name$name |
---|
Acetylcholine synthesis |
Activation of vitamin K-dependent proteins |
Adipogenesis |
Aerobic glycolysis |
Aflatoxin B1 metabolism |
AGE/RAGE pathway |
MetaPhOR contains five functions for the analysis of metabolic dysregulation using transcriptomic-level data and the production of publication-quality figures. This version of MetaPhOR, 0.99.0, is available at https://github.com/emilyise/MetaPhOR.
sessionInfo()
## R Under development (unstable) (2024-10-21 r87258)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.1 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.21-bioc/R/lib/libRblas.so
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_GB LC_COLLATE=C
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## time zone: America/New_York
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] MetaPhOR_1.9.0 kableExtra_1.4.0 BiocStyle_2.35.0
##
## loaded via a namespace (and not attached):
## [1] RColorBrewer_1.1-3 rstudioapi_0.17.1 jsonlite_1.8.9
## [4] magrittr_2.0.3 magick_2.8.5 ggtangle_0.0.3
## [7] farver_2.1.2 rmarkdown_2.28 fs_1.6.4
## [10] zlibbioc_1.53.0 vctrs_0.6.5 memoise_2.0.1
## [13] RCurl_1.98-1.16 ggtree_3.15.0 base64enc_0.1-3
## [16] tinytex_0.53 htmltools_0.5.8.1 gridGraphics_0.5-1
## [19] sass_0.4.9 parallelly_1.38.0 KernSmooth_2.23-24
## [22] bslib_0.8.0 plyr_1.8.9 RecordLinkage_0.4-12.4
## [25] cachem_1.1.0 uuid_1.2-1 igraph_2.1.1
## [28] lifecycle_1.0.4 pkgconfig_2.0.3 gson_0.1.0
## [31] Matrix_1.7-1 R6_2.5.1 fastmap_1.2.0
## [34] GenomeInfoDbData_1.2.13 future_1.34.0 aplot_0.2.3
## [37] enrichplot_1.27.0 digest_0.6.37 colorspace_2.1-1
## [40] patchwork_1.3.0 AnnotationDbi_1.69.0 S4Vectors_0.45.0
## [43] RSQLite_2.3.7 base64url_1.4 labeling_0.4.3
## [46] fansi_1.0.6 RJSONIO_1.3-1.9 httr_1.4.7
## [49] compiler_4.5.0 proxy_0.4-27 withr_3.0.2
## [52] bit64_4.5.2 backports_1.5.0 BiocParallel_1.41.0
## [55] RCy3_2.27.0 DBI_1.2.3 highr_0.11
## [58] gplots_3.2.0 R.utils_2.12.3 MASS_7.3-61
## [61] lava_1.8.0 gtools_3.9.5 caTools_1.18.3
## [64] tools_4.5.0 ape_5.8 future.apply_1.11.3
## [67] nnet_7.3-19 R.oo_1.26.0 glue_1.8.0
## [70] nlme_3.1-166 GOSemSim_2.33.0 grid_4.5.0
## [73] pbdZMQ_0.3-13 reshape2_1.4.4 fgsea_1.33.0
## [76] generics_0.1.3 gtable_0.3.6 R.methodsS3_1.8.2
## [79] class_7.3-22 tidyr_1.3.1 data.table_1.16.2
## [82] xml2_1.3.6 utf8_1.2.4 XVector_0.47.0
## [85] BiocGenerics_0.53.0 ggrepel_0.9.6 pillar_1.9.0
## [88] stringr_1.5.1 yulab.utils_0.1.7 IRdisplay_1.1
## [91] splines_4.5.0 dplyr_1.1.4 treeio_1.31.0
## [94] lattice_0.22-6 survival_3.7-0 bit_4.5.0
## [97] tidyselect_1.2.1 GO.db_3.20.0 Biostrings_2.75.0
## [100] knitr_1.48 bookdown_0.41 IRanges_2.41.0
## [103] svglite_2.1.3 stats4_4.5.0 xfun_0.48
## [106] Biobase_2.67.0 pheatmap_1.0.12 stringi_1.8.4
## [109] UCSC.utils_1.3.0 lazyeval_0.2.2 ggfun_0.1.7
## [112] yaml_2.3.10 evaluate_1.0.1 codetools_0.2-20
## [115] evd_2.3-7.1 tibble_3.2.1 qvalue_2.39.0
## [118] BiocManager_1.30.25 graph_1.85.0 ggplotify_0.1.2
## [121] cli_3.6.3 IRkernel_1.3.2 rpart_4.1.23
## [124] xtable_1.8-4 systemfonts_1.1.0 repr_1.1.7
## [127] munsell_0.5.1 jquerylib_0.1.4 Rcpp_1.0.13
## [130] GenomeInfoDb_1.43.0 globals_0.16.3 png_0.1-8
## [133] XML_3.99-0.17 parallel_4.5.0 ggplot2_3.5.1
## [136] blob_1.2.4 clusterProfiler_4.15.0 DOSE_4.1.0
## [139] bitops_1.0-9 ff_4.5.0 listenv_0.9.1
## [142] tidytree_0.4.6 viridisLite_0.4.2 ipred_0.9-15
## [145] scales_1.3.0 prodlim_2024.06.25 e1071_1.7-16
## [148] purrr_1.0.2 crayon_1.5.3 rlang_1.1.4
## [151] ada_2.0-5 cowplot_1.1.3 fastmatch_1.1-4
## [154] KEGGREST_1.47.0