-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
117 lines (82 loc) · 3.11 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
BI503G R-Package Build Seminar
================
André Bourbonnais, Luan Gardenalli
2022-12-15
<!-- README.md is generated from README.Rmd. Please edit that file -->
# LuAndre
<!-- badges: start -->
<!-- badges: end -->
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](https://github.com/ndreey/luandre) use:
``` r
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
- Check out the [LuAndre Manual](https://raw.githack.com/ndreey/luandre/main/docs/index.html) for more information
## Enrichment Analysis
### Option 1: Use the wrapper
This wrapper orchestrates the necessary functions calls in order
``` r
# 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.
``` r
# 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.