-
Notifications
You must be signed in to change notification settings - Fork 0
/
GSEA_ColorGradientBarPlots.Rmd
33 lines (27 loc) · 1.36 KB
/
GSEA_ColorGradientBarPlots.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
---
title: "Untitled"
output: html_document
date: "2023-07-18"
---
```{r}
bmec.gsea <- read.table("/Users/gagled01/Downloads/BMEC_GSEA.tsv", sep = "\t", header = T)
mscolc.gsea <- read.table("/Users/gagled01/Downloads/MSCOLC_GSEA.tsv", sep = "\t", header = T)
```
```{r}
plotting.df <- data.frame(bmec.gsea$NAME, bmec.gsea$NES, bmec.gsea$FDR.q.val)
plotting.df <- head(plotting.df, n = 20)
colnames(plotting.df) <- c("Pathway", "NES", "FDR.q.val")
plotting.df$Pathway <- gsub("HALLMARK_", "", plotting.df$Pathway)
plotting.df2 <- data.frame(mscolc.gsea$NAME, mscolc.gsea$NES, mscolc.gsea$FDR.q.val)
plotting.df2 <- head(plotting.df2, n = 20)
colnames(plotting.df2) <- c("Pathway", "NES", "FDR.q.val")
plotting.df2$Pathway <- gsub("HALLMARK_", "", plotting.df2$Pathway)
```
```{r}
ggplot(plotting.df, aes(x=NES, y=reorder(Pathway,-FDR.q.val), fill=FDR.q.val)) + geom_bar(stat="identity")+scale_fill_gradient(low="red", high="blue") +
ylab("") + theme_minimal()
ggsave("/Users/gagled01/morganLab/single-cell/5TG_Mouse_Rerun/figures/BMEC_GSEA_Barplot.png", height = 6, width = 8)
ggplot(plotting.df2, aes(x=NES, y=reorder(Pathway,-FDR.q.val), fill=FDR.q.val)) + geom_bar(stat="identity")+scale_fill_gradient(low="red", high="blue") +
ylab("") + theme_minimal()
ggsave("/Users/gagled01/morganLab/single-cell/5TG_Mouse_Rerun/figures/BMEC_MSCOLC_Barplot.png", height = 6, width = 8)
```