-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExample_MCA_Spleen.Rmd
99 lines (74 loc) · 3.32 KB
/
Example_MCA_Spleen.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
---
title: "sc2marker with MCA-spleen (Mouse)"
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)
suppressMessages(library(sc2marker))
```
# load data
```{r SeuratObject}
mca.spleen
Idents(mca.spleen) <- "anno"
ids <- c("T cell(Spleen)", "Macrophage(Spleen)", "NK cell(Spleen)", "Marginal zone B cell(Spleen)")
[email protected]$annotation_simplified <- [email protected]$anno
```
# Simplify the cell annotation
```{r}
ids <- c("T cell(Spleen)", "Macrophage(Spleen)", "NK cell(Spleen)", "Marginal zone B cell(Spleen)")
[email protected]$annotation_simplified <- ifelse([email protected]$annotation_simplified %in% ids, [email protected]$annotation_simplified, "Other")
[email protected]$annotation_simplified[[email protected]$annotation_simplified == "T cell(Spleen)"] <- "T Cell"
[email protected]$annotation_simplified[[email protected]$annotation_simplified == "Marginal zone B cell(Spleen)"] <- "B Cell"
[email protected]$annotation_simplified[[email protected]$annotation_simplified == "NK cell(Spleen)"] <- "NK Cell"
[email protected]$annotation_simplified[[email protected]$annotation_simplified == "Macrophage(Spleen)"] <- "Macro"
Idents(mca.spleen) <- "annotation_simplified"
```
# Markers identification for NK cell
To run sc2marker you need to execute the following command, providing a clustered single cell data sets (as Seurat object), the cell type of interest and the antibody databased (IHC, ICC or Flow).
```{r NK cell markers}
nk.markers <- Detect_single_marker(mca.spleen, id = "NK Cell", category = "Flow", org = "mouse", min.pct = 0.1)
get_antibody(nk.markers, org = "mouse")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of NK cells
plot_ridge(mca.spleen, id = "NK Cell", genes = nk.markers[1:9,]$gene, ncol = 3, assay = "RNA", aggr.other = F)
```
# Markers identification for B cell
```{r B cell markers}
b.markers <- Detect_single_marker(mca.spleen, id = "B Cell", category = "Flow", org = "mouse", min.pct = 0.1)
get_antibody(b.markers, org = "mouse")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of B cells
plot_ridge(mca.spleen, id = "B Cell", genes = b.markers[1:9,]$gene, ncol = 3, assay = "RNA", aggr.other = F)
```
# Markers identification for T cell
```{r T cell markers}
t.markers <- Detect_single_marker(mca.spleen, id = "T Cell", category = "Flow", org = "mouse", min.pct = 0.1)
get_antibody(t.markers, org = "mouse")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of T cells
plot_ridge(mca.spleen, id = "T Cell", genes = t.markers[1:9,]$gene, ncol = 3, assay = "RNA", aggr.other = F)
```
# Markers identification for Macrophages
```{r Macro cell markers}
Macro.markers <- Detect_single_marker(mca.spleen, id = "Macro", category = "Flow", org = "mouse", min.pct = 0.1)
get_antibody(Macro.markers, org = "mouse")
```
```{r message=F, warning=F, fig.height=9, fig.width=9}
# Ridge plot of top 9 markers of Macrophages
plot_ridge(mca.spleen, id = "Macro", genes = Macro.markers[1:9,]$gene, ncol = 3, assay = "RNA", aggr.other = F)
```
# Session Info
```{r}
sessionInfo()
```