|
a |
|
b/FigS3L.R |
|
|
1 |
GIT_HOME="/research/users/ppolonen/git_home/ImmunogenomicLandscape-BloodCancers/" |
|
|
2 |
source(file.path(GIT_HOME, "common_scripts/scRNA/functions.scRNA.analysis.R")) |
|
|
3 |
source(file.path(GIT_HOME, "common_scripts/visualisation/plotting_functions.R")) |
|
|
4 |
|
|
|
5 |
library(Matrix) |
|
|
6 |
library(Seurat) |
|
|
7 |
library(data.table) |
|
|
8 |
library(ComplexHeatmap) |
|
|
9 |
library(circlize) |
|
|
10 |
library(parallel) |
|
|
11 |
library(ggplot2) |
|
|
12 |
|
|
|
13 |
setwd("/research/groups/sysgen/PROJECTS/HEMAP_IMMUNOLOGY/petri_work/HEMAP_IMMUNOLOGY/Published_data_figures") |
|
|
14 |
|
|
|
15 |
# Compare MDS in blasts between FIMM AML and then compare to HCA |
|
|
16 |
load("HCA_scRNA.Rdata") |
|
|
17 |
|
|
|
18 |
MDS=get(load("MDS_genesets.Rdata")) |
|
|
19 |
|
|
|
20 |
Idents(scmat)=scmat[["SingleR.label"]] |
|
|
21 |
markers=FindAllMarkers(scmat, features = MDS$MDS_signature_all_filt[MDS$MDS_signature_all_filt%in%rownames(scmat)], only.pos = T) |
|
|
22 |
|
|
|
23 |
for(i in 1:5){ |
|
|
24 |
markers[,i]=prettyNum(signif(markers[,i],2)) |
|
|
25 |
} |
|
|
26 |
write.table(markers[markers$avg_logFC>0,c("gene", "cluster", "avg_logFC", "pct.1", "pct.2", "p_val", "p_val_adj")], "TableS3_MDS_signature_markers_celltype_HCA.txt", quote = F, row.names = F, sep="\t") |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
#********************************** Genes expressed in MDS Blasts vs other blasts ************************************** |
|
|
31 |
markers=markers[markers$avg_logFC>0,] |
|
|
32 |
erythroid=markers$gene[markers$cluster%in%c("Erythrocytes")] |
|
|
33 |
HSC=markers$gene[markers$cluster%in%c("HSC", "MPP", "MEP")] |
|
|
34 |
HSC=HSC[!HSC%in%erythroid] |
|
|
35 |
|
|
|
36 |
scmat[["SingleR.label2"]]=factor(scmat[["SingleR.label"]][,1], levels=c("HSC","MPP","MEP", "CLP","CMP","GMP","Monocytes","DC","Macrophages","Macrophages M1","Macrophages M2","CD4+ Tn","CD4+ T-cells", "CD4+ Tcm", "CD4+ Tem","CD8+ Tn","CD8+ T-cells","CD8+ Tcm","CD8+ Tem","NK cells","Tregs","naive B-cells","Memory B-cells","Class-switched memory B-cells","Plasma cells","Endothelial cells","Neutrophils","Eosinophils","Fibroblasts","Smooth muscle","Erythrocytes","Megakaryocytes")) |
|
|
37 |
|
|
|
38 |
pdf("HCA_HSC_genes.pdf", width = 5, height = 4) |
|
|
39 |
plot.DotPlot(scmat[,grepl("HSC|MPP|MEP|CMP|GMP|Mono|Eryth", scmat[["SingleR.label2"]][,1])], group.by = "SingleR.label2", features = unique(HSC), cols = c("white", "red"), dot.scale = 5) |
|
|
40 |
dev.off() |
|
|
41 |
|
|
|
42 |
pdf("HCA_erythroid_genes.pdf", width = 5, height = 8) |
|
|
43 |
plot.DotPlot(scmat[,grepl("HSC|MPP|MEP|CMP|GMP|Mono|Eryth", scmat[["SingleR.label2"]][,1])], group.by = "SingleR.label2", features = unique(erythroid), cols = c("white", "red"), dot.scale = 5) |
|
|
44 |
dev.off() |
|
|
45 |
|
|
|
46 |
pdf("HCA_HSC_erythroid_genes_filt.pdf", width = 4, height = 3) |
|
|
47 |
plot.DotPlot(scmat[,grepl("HSC|MPP|MEP|CMP|GMP|Mono|Eryth", scmat[["SingleR.label2"]][,1])], group.by = "SingleR.label2", features = c("DPPA4","CRHBP","CSF3R","BEX1","EREG", "CA1", "HBD", "HEMGN", "MYL4", "SNCA"), cols = c("white", "red"), dot.scale = 6, scale.max = 50, scale.min = 0) |
|
|
48 |
dev.off() |
|
|
49 |
|
|
|
50 |
# same in FIMM MDS samples |
|
|
51 |
load("FIMM_AML_scRNA.Rdata") |
|
|
52 |
|
|
|
53 |
Idents(scmat)=scmat[["SingleR.label"]] |
|
|
54 |
markers=FindAllMarkers(scmat, features = MDS$MDS_signature_all_filt[MDS$MDS_signature_all_filt%in%rownames(scmat)], only.pos = T, logfc.threshold = 0.025) |
|
|
55 |
excl=table(scmat[["SingleR.label"]])<0.001*dim(scmat)[2] |
|
|
56 |
|
|
|
57 |
for(i in 1:5){ |
|
|
58 |
markers[,i]=prettyNum(signif(markers[,i],2)) |
|
|
59 |
} |
|
|
60 |
|
|
|
61 |
write.table(markers[markers$avg_logFC>0&!markers$cluster%in%names(excl)[excl],c("gene", "cluster", "avg_logFC", "pct.1", "pct.2", "p_val", "p_val_adj")], "TableS3_MDS_signature_markers_celltype_AML.txt", quote = F, row.names = F, sep="\t") |
|
|
62 |
|
|
|
63 |
scmat[["SingleR.label2"]]=factor(scmat[["SingleR.label"]][,1], levels=c("HSC","MPP","MEP", "CLP","CMP","GMP","Monocytes","DC","Macrophages","Macrophages M1","Macrophages M2","CD4+ Tn","CD4+ T-cells", "CD4+ Tcm", "CD4+ Tem","CD8+ Tn","CD8+ T-cells","CD8+ Tcm","CD8+ Tem","NK cells","Tregs","naive B-cells","Memory B-cells","Class-switched memory B-cells","Plasma cells","Endothelial cells","Neutrophils","Eosinophils","Fibroblasts","Smooth muscle","Erythrocytes","Megakaryocytes")) |
|
|
64 |
|
|
|
65 |
# pdf("FIMM_AML_HSC_genes.pdf", width = 5, height = 4) |
|
|
66 |
# plot.DotPlot(scmat[,grepl("HSC|MPP|MEP|CMP|GMP|Mono|Eryth", scmat[["SingleR.label2"]][,1])], group.by = "SingleR.label2", features = unique(HSC), cols = c("white", "red"), dot.scale = 5) |
|
|
67 |
# dev.off() |
|
|
68 |
# |
|
|
69 |
# pdf("FIMM_AML_erythroid_genes.pdf", width = 5, height = 8) |
|
|
70 |
# plot.DotPlot(scmat[,grepl("HSC|MPP|MEP|CMP|GMP|Mono|Eryth", scmat[["SingleR.label2"]][,1])], group.by = "SingleR.label2", features = unique(erythroid), cols = c("white", "red"), dot.scale = 5) |
|
|
71 |
# dev.off() |
|
|
72 |
|
|
|
73 |
pdf("FigureS3L.pdf", width = 4, height = 3) |
|
|
74 |
plot.DotPlot(scmat[,grepl("HSC|MPP|MEP|CMP|GMP|Mono|Eryth", scmat[["SingleR.label2"]][,1])], group.by = "SingleR.label2", features = c("DPPA4","CRHBP","CSF3R","BEX1","EREG", "CA1", "HBD", "HEMGN", "MYL4", "SNCA"), cols = c("white", "red"), dot.scale = 6, scale.max = 50, scale.min = 0) |
|
|
75 |
dev.off() |