在非監(jiān)督的單細(xì)胞數(shù)據(jù)分析中扫腺,給定細(xì)胞cluster的均一性往往是不清楚的,也就是說我們并不知道分出的一個(gè)cluster中是否是一種細(xì)胞,還是依然包含了多種細(xì)胞烟很。因此有人提出了cluster purity的概念七问,并建立了一個(gè)新的方法ROGUE
來計(jì)算給定的細(xì)胞cluter是否是一個(gè)純度較高的均一細(xì)胞群蜓耻。
文章鏈接:An entropy-based metric for assessing the purity of single cell populations
1. R包安裝
install.packages("tidyverse")
if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")
devtools::install_github("PaulingLiu/ROGUE")
2. 演示數(shù)據(jù)下載
數(shù)據(jù)集來自文獻(xiàn)Single-Cell Transcriptomics of Human and Mouse Lung Cancers Reveals Conserved Myeloid Populations across Individuals and Species
演示數(shù)據(jù):expression matrix 和 meta information.
3. 分析
載入R包
suppressMessages(library(ROGUE))
suppressMessages(library(ggplot2))
suppressMessages(library(tidyverse))
導(dǎo)入數(shù)據(jù)
- 表達(dá)矩陣的格式:行是基因,列是細(xì)胞烂瘫。表達(dá)值應(yīng)該是UMI counts (droplet-based datasets) 或 TPM (full-length based datasets)媒熊。
- mata矩陣中的ct是細(xì)胞類型奇适,和第一列的病人一一對(duì)應(yīng)(也就是每個(gè)細(xì)胞是來自哪個(gè)病人的信息)
expr <- readRDS("DC.rds")
meta <- readRDS("info.rds")
expr[1:5, 1:4]
## _p1t1__bcGDSJ _p1t1__bcDRQX _p1t1__bcFPXB _p1t1__bcHVVV
## A2M 0 0 0 0
## A2ML1 0 0 0 0
## AAAS 0 0 0 0
## AACS 0 0 0 0
## AAGAB 0 0 0 0
head(meta)
### A tibble: 6 × 26
## Patient Tissue `Barcoding emulsion` Library Barcode `Total counts` `Percent counts from mi… `Most likely LM22 … `Major cell typ… ct
## <chr> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> <chr> <chr>
## 1 p1 tumor p1t p1t1 bcGDSJ 4731 6.47 Dendritic cells re… tMoMacDC tDC2
## 2 p1 tumor p1t p1t1 bcDRQX 1212 5.28 Monocytes tpDC tpDC
## 3 p1 tumor p1t p1t1 bcFPXB 2639 5.15 B cells memory tpDC tpDC
## 4 p1 tumor p1t p1t1 bcHVVV 2978 2.89 Eosinophils tpDC tpDC
## 5 p1 tumor p1t p1t1 bcGJVN 1509 5.04 B cells memory tpDC tpDC
## 6 p1 tumor p1t p1t1 bcFSSY 3369 5.05 Dendritic cells ac… tMoMacDC tDC3
過濾低質(zhì)量細(xì)胞
expr <- matr.filter(expr, min.cells = 10, min.genes = 10)
Expression entropy model
為了使用S-E模型,首先使用SE_fun
功能計(jì)算每個(gè)基因的expression entropy
ent.res <- SE_fun(expr)
head(ent.res)
## A tibble: 6 × 7
# Gene mean.expr entropy fit ds p.value p.adj
# <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
# 1 LYZ 1.65 0.762 1.27 0.510 0 0
# 2 HLA-DQB2 1.35 0.569 1.01 0.437 0 0
# 3 BIRC3 1.21 0.458 0.886 0.428 0 0
# 4 HSPA1A 1.54 0.766 1.17 0.406 0 0
# 5 HLA-DRB1 2.99 2.24 2.59 0.353 0 0
# 6 GZMB 1.26 0.586 0.931 0.345 0 0
S-E plot
使用SEplot
功能去可視化S和E的關(guān)系
SEplot(ent.res)
The identified highly informative genes could be applied to both clustering and pseudotime analyses.
ROGUE calculation
使用CalculateRogue
功能去計(jì)算VOGUE值以評(píng)估DC群的純度
rogue.value <- CalculateRogue(ent.res, platform = "UMI")
rogue.value
## [1] 0.7219202
這個(gè)細(xì)胞群的ROGUE值是0.72芦鳍,提示了它們的異質(zhì)性
Calculate the ROGUE value of each putative cluster for each sample
為了得到對(duì)各個(gè)cluster純度的精確評(píng)估嚷往,作者推薦區(qū)分樣本來源計(jì)算各細(xì)胞類型ROGUE值
rogue.res <- rogue(expr, labels = meta$ct, samples = meta$Patient, platform = "UMI", span = 0.6)
rogue.res
# tDC2 tpDC tDC3 tDC1
# p1 0.8376831 0.8604547 0.8494896 0.8481964
# p2 NA NA NA NA
# p3 0.8028900 0.8941508 0.8995863 0.9150546
# p4 0.8041421 0.8992421 0.8763108 0.8658948
# p5 0.8702724 0.9321946 0.9247687 NA
# p6 0.8596472 NA 0.8892388 0.9280764
# p7 0.9262411 0.9028763 0.8949111 0.9419589
ROGUE值 可視化
rogue.boxplot(rogue.res)
參考:
https://htmlpreview.github.io/?https://github.com/PaulingLiu/ROGUE/blob/master/vignettes/ROGUE_Tutorials.html
http://www.reibang.com/p/1ddf52885833