--- title: "4. MiR-ORA" author: "Zhesi Zhang, Xin Lai" date: "`r Sys.Date()`" package: miREA output: BiocStyle::html_document: toc: true toc_float: true vignette: > %\VignetteIndexEntry{4. MiR-ORA} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set(collapse = TRUE, comment = "#>") ``` # Overview `MiR_ORA()` performs miRNA enrichment analysis by testing the overlap between a set of differentially expressed miRNAs and each pathway's miRNA set. Pathway definitions only specify genes, so the pathway miRNA set is derived from the pathway gene set through `background_MGI`. This is a standard over-representation analysis, built on `r BiocStyle::Biocpkg("clusterProfiler")`'s `enricher()`. This vignette uses the same toy BLCA example data as the package's main Quick Start vignette. See `vignette("miREA")` for a description of that data and for running all nine methods together through `miREA()`. # Required inputs * `pathway`, a two column data frame with columns `pathway` and `gene`. * `mir_DEdata`, a four column data frame with columns `miRNA`, `log2FoldChange`, `stat`, and `padj`. * `background_MGI`, a two column data frame with columns `miRNA` and `gene`, or `NULL` to use the bundled default (see `vignette("miREA")`, Step 1, for details on `background_MGI`). * `background` for `MiR_ORA()` itself, a character vector of background miRNAs. If left `NULL`, `MiR_ORA()` falls back to all mature miRNAs in miRBase version 22. ```{r load-data} library(miREA) data(toy_pathway) data(toy_mir_DEdata) data(toy_gene_DEdata) data(background_MGI) ``` # Run MiR-ORA ```{r prepare-input} input_data <- getAllInputData( methods = "MiR_ORA", pathway = toy_pathway, mir_DEdata = toy_mir_DEdata, gene_DEdata = toy_gene_DEdata, background_MGI = background_MGI ) ``` `input_data$data$MiR_ORA` holds the differentially expressed miRNAs, built by `getAllInputData()`. `input_data$pathway$MiR` holds the pathway miRNA sets, derived from `toy_pathway`'s genes through `background_MGI`. ```{r run-mir-ora} res <- MiR_ORA( DEmiR = input_data$data$MiR_ORA, background = unique(input_data$pathway$MiR$miRNA), pathway = input_data$pathway$MiR, pvalueCutoff = 1 ) head(res) ``` # Run through miREA() `MiR_ORA()` can also be run through the `miREA()` wrapper, which is useful when you want its result alongside other methods' results in a single `miREAResult` object (see `vignette("miREA")`, Step 2, for the multi-method case). Unlike the direct call above, `background` is optional here: if omitted, `miREA()` auto-derives one for the `MiR` target from `input_data$pathway$MiR` (the same vector used above). ```{r run-through-miREA} result <- miREA( methods = "MiR_ORA", input_data = input_data, pvalueCutoff = 1 ) head(result$result$MiR_ORA) ``` # Supplying your own miRNA list If you already have a list of differentially expressed miRNAs from an external analysis instead of letting `getAllInputData()` derive one from `mir_DEdata`, call `MiR_ORA()` directly with that list and `input_data$pathway$MiR`. ```{r custom-list, eval=FALSE} # replace with your own miRNA list my_DEmiR <- c("hsa-miR-21-5p", "hsa-miR-155-5p") res_custom <- MiR_ORA( DEmiR = my_DEmiR, background = unique(input_data$pathway$MiR$miRNA), pathway = input_data$pathway$MiR, pvalueCutoff = 1 ) ``` # Session info ```{r session-info} sessionInfo() ```