前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >UCell 计算单细胞gene signature score

UCell 计算单细胞gene signature score

作者头像
生信技能树jimmy
发布2021-09-15 16:22:58
5.9K0
发布2021-09-15 16:22:58
举报
文章被收录于专栏:单细胞天地

在做单细胞转录组数据分析时,我们经常遇到特定(通路/功能)基因集合的表达活性分析,目前比较常用的是GSVA以及Seurat软件包的AddModuleScore[1]函数。这里我们介绍一种新的方法UCell[2],它具有以下特点:

  • UCell scores 对数据集的大小和异质性具有鲁棒性 UCell评分基于基因排序,因此不受数据集组成的影响。 在不同的数据集中,相同的细胞群的分数分布几乎是相同的 (小的差异是由于秩关系的随机分布)
  • 能够处理大数据集(>10^5 cells),需要较少的计算时间和内存
  • 使用方便,细胞x基因矩阵和seurat对象都能方便处理

安装

UCell 是R包,目前存放在github[3],安装方式如下:

代码语言:javascript
复制
library(remotes)
remotes::install_github("carmonalab/UCell")

也可以从其github网址下载zip包到本地,通过以下命令安装

代码语言:javascript
复制
devtools::install_local("/path/UCell-master.zip")

使用

详细使用教程见网址 https://carmonalab.github.io/UCell/

测试数据

大多单细胞转录组数据用seurat软件进行处理,所以这里我们拿seurat处理的对象文件作为示例。

我们从Hao and Hao et al, bioRvix 2020[4]下载downsampled数据, pbmc_multimodal.downsampled20k.Tcell.seurat.RNA.rds[5]

读取seurat对象
代码语言:javascript
复制
library(Seurat)
library(ggplot2)
library(UCell)

cuscolors <-c('#E5D2DD','#53A85F','#F1BB72', 
             '#F3B1A0','#D6E7A3','#57C3F3', 
             '#476D87','#E95C59','#E59CC4',
             '#AB3282', '#23452F','#BD956A',
             '#8C549C', '#585658')

rds <- readRDS("pbmc_multimodal.downsampled20k.Tcell.seurat.RNA.rds")

head(rds@meta.data, 2)


options(repr.plot.width=8, repr.plot.height=6)
DimPlot(object = rds, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE,
        label.size = 3, repel = TRUE, cols=my36colors)
UCell计算signatures Score
代码语言:javascript
复制
# 构建UCell需要输入的gene sets
markers <- list()
markers$Tcell_CD4 <- c("CD4", "CD40LG")
markers$Tcell_CD8 <- c("CD8A", "CD8B")
markers$Tcell_Treg <- c("FOXP3", "IL2RA")
markers$Tcell_MAIT <- c("KLRB1", "SLC4A10", "NCR3")
markers$Tcell_gd <- c("TRDC", "TRGC1", "TRGC2", "TRDV1")
markers$Tcell_NK <- c("FGFBP2", "SPON2", "KLRF1", "FCGR3A", "KLRD1", "TRDC")

# 主函数
rds <- AddModuleScore_UCell(rds, features = markers)

signature.names <- paste0(names(markers), "_UCell")

options(repr.plot.width=6, repr.plot.height=4)
VlnPlot(rds, features = signature.names, 
        group.by = "celltype.l1", stack=TRUE, 
        cols=my36colors) + NoLegend()
代码语言:javascript
复制
options(repr.plot.width=12, repr.plot.height=4)

FeaturePlot(rds, reduction = "wnn.umap", features = c("Tcell_CD4_UCell", "Tcell_NK_UCell"), 
            ncol = 3, order = T,
            min.cutoff = "q03", max.cutoff = "q99",
            cols = c("#F5F5F5", "#333399"), pt.size = 0.1)
specify positive and negative (up- or down-regulated) genes in signatures
代码语言:javascript
复制
markers3 <- list()
markers3$Tcell_gd_pos <- c("TRDC+", "TRGC1+", "TRGC2+", "TRDV1+","TRAC+","TRBC1+","TRBC2+")
markers3$Tcell_NK_pos <- c("FGFBP2+", "SPON2+", "KLRF1+", "FCGR3A+", "CD3E+","CD3G+")

rds <- AddModuleScore_UCell(rds, features = markers3)

options(repr.plot.width=12, repr.plot.height=4)

FeaturePlot(rds, reduction = "wnn.umap", features = c("Tcell_gd_pos_UCell", "Tcell_NK_pos_UCell"), 
            ncol = 3, order = T,
            min.cutoff = "q03", max.cutoff = "q99",
            cols = c("#F5F5F5", "#333399"), pt.size = 0.1)

可以在gene后加上+或者-来表示signatures genes set中的gene是上调还是下调的模式。

  • 如果没有指定gene的+/-, 默认当作positive set
  • UCell score = max(0, U+ - w_neg * U-) where U+ and U- are respectively the U scores for the positive and negative set, and w_neg is a weight on the negative set.
  • 当没有negative set基因时, U = U+

[1]

AddModuleScore: http://events.jianshu.io/p/827143ce66fa

[2]

UCell: Andreatta M, Carmona S J. UCell: robust and scalable single-cell gene signature scoring[J]. Computational and Structural Biotechnology Journal, 2021. https://doi.org/10.1016/j.csbj.2021.06.043

[3]

github: https://github.com/carmonalab/UCell

[4]

Hao and Hao et al, bioRvix 2020: https://www.biorxiv.org/content/10.1101/2020.10.12.335331v1

[5]

pbmc_multimodal.downsampled20k.Tcell.seurat.RNA.rds: https://drive.switch.ch/index.php/s/3kM5PQ0tQaG6d6A/download

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-08-25,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 单细胞天地 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装
  • 使用
    • 测试数据
      • UCell计算signatures Score
        • specify positive and negative (up- or down-regulated) genes in signatures
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档