-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscWBM_DEG_other_clusters.Rmd
85 lines (64 loc) · 2.4 KB
/
scWBM_DEG_other_clusters.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
---
title: "DE w/in Cluster scWBM"
author: "D. Ford Hannum"
date: "5/27/2020"
output:
html_document:
toc: true
toc_depth: 3
number_sections: false
theme: united
highlight: tango
---
\newpage
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = F)
library(Seurat)
library(MAST)
library(ggplot2)
```
# Summary
Going to focus on differential expression within all the clusters from Experiment 1 of scWBM with the Sang Lab.
This analysis has already been performed on megakaryocytes which are the primary cell type of interest with regards to primary myelofibrosis.
```{r lists to include}
# profibrotic factors of interest
pf <- read.table('./data/profibrotic_factors.txt')$V1
pf <- pf[2:length(pf)]
```
```{r loading the data and getting new idents}
wbm <- readRDS('./data/wbm_clustered_filtered_named.rds')
new_levels <- c('Granulocyte','Granulocyte','Granulocyte', 'B-cell','MK',
'Granulocyte', 'HSPC','Monocyte','Macrophage','Erythroid','B-cell',
'T-cell/NK', 'MEP')
names(new_levels) <- levels(wbm)
new_levels
wbm <- RenameIdents(wbm, new_levels)
[email protected]$condition <- ifelse([email protected]$condition == 'control', 'Control','Mpl')
```
## Granulocytes
```{r DEG}
gr.markers <- FindMarkers(wbm, ident.1 = 'Control', ident.2 = 'Mpl',
group.by = 'condition',
verbose = T, subset.ident = "Granulocyte",
logfc.threshold = log(2), test.use = "MAST")
gr.markers
gr.cells <- WhichCells(wbm, ident = 'Granulocyte')
DoHeatmap(wbm, features = rownames(gr.markers), group.by = 'condition',
cells = gr.cells, label = F)
```
```{r hspcs DEG}
hspc.markers <- FindMarkers(wbm, ident.1 = 'Control', ident.2 = 'Mpl',
group.by = 'condition',
verbose = T, subset.ident = "HSPC",
logfc.threshold = log(2),test.use = "MAST")
hspc.markers
hspc.cells = WhichCells(wbm, ident = 'HSPC')
DoHeatmap(wbm, features = rownames(hspc.markers), group.by = 'condition',
cells = hspc.cells, label = F) +
theme_minimal() +
xlab('MK Cells') + ylab('DE genes') +
scale_x_discrete(position = 'top') +
theme(text = element_text(size = 10, family = 'sans'),
axis.text = element_blank(),
axis.ticks = element_blank())
```