knitr::opts_chunk$set(
  echo = FALSE,
  message = FALSE,
  warning = FALSE
)

if(!exists("progress")){
  progress <- function(howmuch, detail){
    invisible(NULL)
  }
}

res <- eval(params$results)
p1 <- params$plot1
GPStab <- eval(params$GPStable)
direction_greater <- eval(params$direction_greater)
contrast <- params$contrast

library(tidyverse)
library(prora)
library(knitr)

Introduction

The following analysis compares filters proteins based on a fold change threshold and uses signature over-representation analysis (sigORA) to identify dysregulated pathways. In principle, sigORA compares the weighted number of observed pairs of proteins (unique to a single pathway) in the cluster of interest to the number one would expect to show up by chance (in this case the reference is comprised by the whole database, i.e. KEGG). These statistics are then translated into a P-value and adjusted for multiplicity, since potentially many pathways are tested [@Leong2009]. This then yields the reported adjusted P-value in the table Signifcantly enriched pathways. sigORA is implemented in the R package sigora [@Foroushani2013].

Parameters

ORA results {.tabset .tabset-pills}

Significantly enriched pathways

res$ora %>%
  dplyr::select(pathwyid, description, success, pathwaySize, pvalues, Bonfer) %>%
  DT::datatable(
    caption = "ORA results: classical overrepresentation analysis using Fisher's exact test",
    colnames = c(
      "Pathway",
      "Description",
      "Successes",
      "Pathway Size",
      "P value",
      "Adj. P value"
    ),
    style = "bootstrap"
  ) %>% DT::formatRound(digits = 3,
                        columns = c("pvalues", "Bonfer"))

sigORA results {.tabset .tabset-pills}

Significantly enriched pathways

res$sigora$summary_results %>% 
  dplyr::select(pathwy.id, description, successes, PathwaySize, pvalues, Bonferroni) %>% 
  dplyr::filter(Bonferroni <= 0.05) %>% 
  DT::datatable(caption = "sigORA results: ORA using gene pair signatures", 
                colnames = c(
                  "Pathway",
                  "Description",
                  "Successess",
                  "Pathway Size",
                  "P value",
                  "Adj. P value"
                )
  ) %>% DT::formatRound(digits = 3, columns = c("pvalues", "Bonferroni"))

All pathways matched

res$sigora$summary_results %>% 
  dplyr::select(pathwy.id, description, pvalues, Bonferroni) %>% 
  DT::datatable(caption = "sigORA results: All matched pathways", 
               colnames = c(
                 "Pathway",
                 "Description",
                 "P value",
                 "Adj. P value"
               )
  ) %>% DT::formatRound(digits = 3, columns = c("pvalues", "Bonferroni"))

Weighting scheme

res$sigora$detailed_results %>% 
  DT::datatable(caption = "sigORA: Weighting scheme of gene pair signatures used",
               colnames = c(
                 "User ID 1",
                 "User ID 2",
                 "Pathway",
                 "Weight"
               )
  ) %>% DT::formatRound(digits = 3, columns = "weight")

Visualisation

if (is_character(p1)) {
  message("No pathways to visualise")
} else {
  p1
}
try(sigora_upsetR(sigora_res = res, GPStable = GPStab))

Data used

colnames(res$data) <- c("User ID", "Score")
res$data %>%
  mutate(`Score` = round(`Score`, 2)) %>% 
  DT::datatable(colnames = c("User ID", "Score"), width = 700, style = "bootstrap") %>%
  DT::formatRound(digits = 3, columns = "Score")

References



protViz/fgcz.gsea.ora documentation built on Dec. 24, 2021, 9:47 a.m.