-
Notifications
You must be signed in to change notification settings - Fork 2
/
Example_human-PBMC&lung.Rmd
138 lines (105 loc) · 5.1 KB
/
Example_human-PBMC&lung.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---
title: "sc2marker with HCA-BM (Human)"
author: "sc2marker"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
toc: yes
toc_depth: 3
toc_float:
collapsed: false
smooth_scroll: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# load data
You can also download the R object in "https://zenodo.org/record/5854754" manually.
```{r SeuratObject, warning=F,message=F}
suppressMessages(library(Seurat))
suppressMessages(library(sc2marker))
savedir <- "save"
dir.create(file.path(savedir))
download.file(url = "https://zenodo.org/record/5854754/files/human-PBMC%26lung.rds?download=1",
destfile = file.path(savedir, "human_PBMC_lung.rds"), method = "curl")
human_PBMC_lung <- readRDS(file.path(savedir, "human_PBMC_lung.rds"))
# Rename Ident
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `0` = "CD4 T")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `3` = "CD4 T")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `14` = "T.Treg")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `2` = "CD8 T")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `7` = "CD8 T")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `10` = "CD8 T")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `16` = "T.Prolif")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `9` = "NK")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `6` = "B")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `13` = "B")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `8` = "B")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `20` = "B")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `11` = "Mono")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `15` = "mDC")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `17` = "pDC")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `12` = "Macro")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `1` = "Mono")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `4` = "Mono")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `5` = "Mono")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `19` = "mDC")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `18` = "Fibro")
human_PBMC_lung <- RenameIdents(object = human_PBMC_lung, `21` = "Epithelia")
[email protected]$anno <- [email protected]
UMAPPlot(human_PBMC_lung, label= T)
```
# Markers for mDC cell
```{r mDC cell markers}
mDC.markers <- Detect_single_marker(human_PBMC_lung, id = "mDC", category = "Flow", org = "human", assay = "RNA.kallisto")
get_antibody(mDC.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of mDC cells
plot_ridge(human_PBMC_lung, id = "mDC", genes = mDC.markers[1:9,]$gene, ncol = 3, assay = "RNA.kallisto", aggr.other = F)
```
# Markers for pDC cell
```{r pDC cell markers}
pDC.markers <- Detect_single_marker(human_PBMC_lung, id = "pDC", category = "Flow", org = "human", assay = "RNA.kallisto")
get_antibody(pDC.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of pDC cells
plot_ridge(human_PBMC_lung, id = "pDC", genes = pDC.markers[1:9,]$gene, ncol = 3, assay = "RNA.kallisto", aggr.other = F)
```
# Markers for B cell
```{r B cell markers}
b.markers <- Detect_single_marker(human_PBMC_lung, id = "B", category = "Flow", org = "human", assay = "RNA.kallisto")
get_antibody(b.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of B cells
plot_ridge(human_PBMC_lung, id = "B", genes = b.markers[1:9,]$gene, ncol = 3, assay = "RNA.kallisto", aggr.other = F)
```
# Markers for CD8 T cell
```{r T cell markers}
t.markers <- Detect_single_marker(human_PBMC_lung, id = "CD8 T", category = "Flow", org = "human", assay = "RNA.kallisto")
get_antibody(t.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of CD8 T cells
plot_ridge(human_PBMC_lung, id = "CD8 T", genes = t.markers[1:9,]$gene, ncol = 3, assay = "RNA.kallisto", aggr.other = F)
```
# Markers for Macro
```{r Macro cell markers}
Macro.markers <- Detect_single_marker(human_PBMC_lung, id = "Macro", category = "Flow", org = "human", assay = "RNA.kallisto")
get_antibody(Macro.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of Macro cells
plot_ridge(human_PBMC_lung, id = "Macro", genes = Macro.markers[1:9,]$gene, ncol = 3, assay = "RNA.kallisto", aggr.other = F)
```
# Markers for Epithelia
```{r Epithelia cell markers}
Epithelia.markers <- Detect_single_marker(human_PBMC_lung, id = "Epithelia", category = "Flow", org = "human", assay = "RNA.kallisto")
get_antibody(Epithelia.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of Epithelia cells
plot_ridge(human_PBMC_lung, id = "Epithelia", genes = Epithelia.markers[1:9,]$gene, ncol = 3, assay = "RNA.kallisto", aggr.other = F)
```