Set up

library(DESeq2)
library(apeglm)
library(gprofiler2)
library(fgsea)
library(msigdbr)
library(org.Hs.eg.db)
library(limma)
library(patchwork)
library(ggrepel)
library(reactable)
library(shiny)
library(tippy)
library(ggdist)
library(dbplyr)
library(tidyverse)
library(leafviz)
# set your working directory
setwd("~/Documents/HGEN_663/extra/lec7")

Part 1

Install package

# install leafviz
install.packages("remotes")
remotes::install_github("jackhump/leafviz")
library(leafviz)

Run Leafviz

You can find more details on Leafviz here

leafviz("path/to/viz.rda")

Part 2

Import results from rMATS

Import the rest of the results from rMATS (ie. those ending with ‘.JC.’, which are junction counts).

se <- read.table("output_rmats/SE.MATS.JC.txt",sep = '\t', header = TRUE, stringsAsFactors = FALSE)

Differential Splicing Events

Which type are the most abundant differentially spliced events (DSEs)? Is there a tendancy for the knockdown samples towards one of the DSEs? (for example exon skipping?)

# Hint: for the differentially spliced events, if they increase in the control samples, then they must decrease in the knockdown samples
se_dse <- se %>%
  filter(FDR < 0.05) 

Pathway analysis of genes with DSEs

Do pathway analyses for genes for each of the different DSE. Are any pathways over-represented?

# geneIDs and geneSymbols are included in the rMATS output. Remember to remove duplicated genes!
#
g <- gost(query = ,
          organism = 'hsapiens',
          custom_bg = ,
          user_threshold = 0.05,
          significant = FALSE,
          correction_method = "fdr")
gostplot(g)

Extra

While the dataset above is a toy example, you can take a look at the rMATS output of a real dataset: /home/hgen_share/lec7_extra/rmats_output_SNRPB. If you have time, do the same type of analyses as before with this dataset of a SNRPB heterozygous mutant. As previously, sample 1 in the rMATS output are the control samples in triplicates whereas sample 2 are the heterozygous SNRPB mutants, in triplicates as well.