-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExample_human_PBMC.Rmd
103 lines (79 loc) · 3.16 KB
/
Example_human_PBMC.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
---
title: "Cell marker identification with seurat samples"
author: "Ronghui"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
toc: yes
toc_depth: 3
toc_float:
collapsed: false
smooth_scroll: false
---
```{r echo=FALSE, message=FALSE, warning=F}
library(Seurat)
library(ggplot2)
require(sc2marker)
require(Seurat)
savedir <- "save"
dir.create(file.path(savedir))
download.file(url = "https://zenodo.org/record/5854754/files/human-PBMC.rds?download=1",
destfile = file.path(savedir, "pbmc_multimodal.rds"), method = "curl")
human_PBMC <- readRDS(file.path(savedir, "pbmc_multimodal.rds"))
Idents(human_PBMC) <- "celltype.l1"
table(human_PBMC@active.ident)
```
# Markers for B cell
```{r B cell markers}
b.markers <- Detect_single_marker(human_PBMC, id = "B", category = "Flow", min.pct = 0.06, assay = "SCT", min.fc = 0.02)
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, id = "B", genes = b.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)
```
# Markers for Mono cell
```{r Mono cell markers}
Mono.markers <- Detect_single_marker(human_PBMC, id = "Mono", category = "Flow", org = "human", assay = "SCT")
get_antibody(Mono.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of Mono cells
plot_ridge(human_PBMC, id = "Mono", genes = Mono.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)
```
# Markers for DC cell
```{r DC cell markers}
DC.markers <- Detect_single_marker(human_PBMC, id = "DC", category = "Flow", org = "human", assay = "SCT")
get_antibody(DC.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of DC cells
plot_ridge(human_PBMC, id = "DC", genes = DC.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)
```
# Markers for NK cell
```{r NK cell markers}
NK.markers <- Detect_single_marker(human_PBMC, id = "NK", category = "Flow", org = "human", assay = "SCT")
get_antibody(NK.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of NK cells
plot_ridge(human_PBMC, id = "NK", genes = NK.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)
```
# Markers for CD8 T cell
```{r cd8 T cell markers}
t.markers <- Detect_single_marker(human_PBMC, id = "CD8 T", category = "Flow", org = "human", assay = "SCT")
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, id = "CD8 T", genes = t.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)
```
# Markers for CD4 T cell
```{r cd4 T cell markers}
t.markers <- Detect_single_marker(human_PBMC, id = "CD4 T", category = "Flow", org = "human", min.pct = 0.06, assay = "SCT", min.fc = 0.02)
get_antibody(t.markers, org = "human")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of CD4 T cells
plot_ridge(human_PBMC, id = "CD4 T", genes = t.markers[1:9,]$gene, ncol = 3, assay = "SCT", aggr.other = F)
```