forked from mcrewcow/BaranovLab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrain_microglia.R
27 lines (20 loc) · 1.14 KB
/
brain_microglia.R
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
#download the datasets from Hammond et al, 2019 https://github.com/samuel-marsh/Hammond-et-al_2019_Microglia_scRNAseq
wget -O Hammond_et-al-2019_Seurat_Converted_v4.qs https://figshare.com/ndownloader/files/37624052 #use terminal
install.packages('qs')
library(qs)
[email protected] <- hammond_all_samples$Age
hammond <- subset(hammond_all_samples, subset = Paper_Cluster == 'Mono/Mac', invert = TRUE)
table(hammond$Paper_Cluster)
hammond.markers <- FindAllMarkers(hammond, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25)
hammond.markers %>%
group_by(cluster) %>%
slice_max(n = 2, order_by = avg_log2FC)
hammond.markers %>%
group_by(cluster) %>%
top_n(n = 20, wt = avg_log2FC) -> top20
DoHeatmap(hammond, features = top20$gene, slot = 'data') + NoLegend()
hammond_normal <- subset(hammond, idents = c('E14','P4/P5','P30','P100','P540'))
#rerun DEG for normal only
#сделать фигуру male+female (VEGFA otdelno) kak FD vs OD try merge/separate by states - homeostatic, inflammatory, IFN response, proinflammatory (DAM),
#DEGs (B2m to inflammatory, neonatal / aging)
#heatmap no gene labels, smaller size