Skip to content

ndreey/luandre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BI503G R-Package Build Seminar

André Bourbonnais, Luan Gardenalli 2022-12-15

LuAndre

Package created for Differential Expression Analysis of bulk RNA-seq data.

Installation

LuAndre is not available on CRAN: Install the development version of LuAndre from GitHub use:

if (!require("pacman")) install.packages("pacman")
pacman::p_load(devtools, AnnotationDbi, GOSemSim, enrichplot, org.Hs.eg.db, clusterProfiler, limma, edgeR)
devtools::install_github("ndreey/luandre")

Tutorials

Enrichment Analysis

Option 1: Use the wrapper

This wrapper orchestrates the necessary functions calls in order

# Run enrich_analysis() to perform standard analysis
enrich_analysis("E-MTAB-2523.counts.txt",   # counts table
                "E-MTAB-2523.sample.txt",   # sample table
                db = "GO",                  # "KEGG" or "GO"
                ontology = "BP",            # Biological Process
                threshold = 2)              # Filtering threshold

Note that ontology = is only required if "GO"is set.

Option 2: Step-wise analysis

The plots and excel file will be stored in your working directory.

# Import data
fetched_data <- fetch_data_from_file("E-MTAB-2523.counts.txt",
                                   "E-MTAB-2523.sample.txt")

# Lets check the dims
dim(fetched_data[[1]])       # 19351 genes, 18 samples
dim(fetched_data[[2]])       # 18 samples, 3 sample info columns.

# Lets filter the data to remove low expression counts
filtered_data <- filter(fetched_data, threshold = 3)

# Lets check how many gene are kept
dim(filtered_data[[1]])       # 10730 genes

# Lets create a Digital gene expression list and a design matrix using data3
digital_list <- digital_gene_expression(filtered_data)

# Lets fit it to a general linear model
results <- fit_test_model(digital_list)

# Lets filter out degs that dont meet our requirments.
deg_df <- get_deg(results, lfc = 2, adj_p = 0.01)
dim(deg_df)      # 180 DEGs!

# Lets store them to an excel file.
save_deg_excel(deg_df3, "E-MTAB-2523")

# Prepare for plotting
# Adds ENTREZID column to data frame
deg_df <- get_Hs_entrez(deg_df)


# Enrich genes with KEGG or GO (Homo sapiens)
enrich_results <- enrich_Hs_genes(deg_df$ENTREZID, db = "GO", ontology = "BP")

# Plots for over-representaiton data.
enrich_plots(enrich_results, n = 10, font_size = 10, file_id = "E-MTAB-2523", 
             width = 8, height = 6, dpi = 300)

Installation notes

System requirements:

LuAndre has been successfully installed on windows 11 using pacman and the devtools package.

Dependencies:

  • R>=3.6.x
  • edgeR
  • limma
  • clusterProfiler
  • org.Hs.eg.db
  • ggplot2
  • enrichplot
  • GOSemSim
  • ggupset
  • openxlsx
  • AnnotationDbi

Troubleshooting:

  • Been issues where the required dependencies are not installing. Please see the recommended code line for the installation above.