查看原文
其他

Seurat 官网单细胞教程四 (细胞周期矫正)


人性和理性是一直斗争的过程

1引言

单细胞数据分析过程中,如果上游我们测序的 细胞明显处于不同的细胞周期中时, 那么将会对下游的细胞聚类分析,亚群鉴定等过程产生影响,以至于不能准确的区分细胞亚群。

seurat 官网提供了一个教程来去除细胞周期的影响, 对细胞周期相关基因的表达特征给每个细胞评分, 最后判断细胞处于那个时期

2分析

常规处理数据:

library(Seurat)

# load count data
exp.mat <- read.table(file = "./cell_cycle_vignette_files/nestorawa_forcellcycle_expressionMatrix.txt",
                      header = TRUE,
                      as.is = TRUE, row.names = 1)

# Create our Seurat object and complete the initalization steps
marrow <- CreateSeuratObject(counts = exp.mat)
marrow <- NormalizeData(marrow)
marrow <- FindVariableFeatures(marrow, selection.method = "vst")
marrow <- ScaleData(marrow, features = rownames(marrow))

获取细胞周期基因:

# A list of cell cycle markers, from Tirosh et al, 2015, is loaded with Seurat.  We can
# segregate this list into markers of G2/M phase and markers of S phase
s.genes <- cc.genes$s.genes
g2m.genes <- cc.genes$g2m.genes

这里是人的细胞周期基因,如果是小鼠或者其它物种,则需要转换基因名,可以参考: 单细胞学习之细胞周期分析

计算细胞周期评分:

使用 CellCycleScoring 即可计算评分,会在 metadata 里增加三列信息:

# assgin cell cycle scores
marrow <- CellCycleScoring(marrow,
                           s.features = s.genes,
                           g2m.features = g2m.genes,
                           set.ident = T)

# view cell cycle scores and phase assignments
head(marrow@meta.data)
#          orig.ident nCount_RNA nFeature_RNA     S.Score  G2M.Score Phase old.ident
# Prog_013       Prog    2563089        10211 -0.14248691 -0.4680395    G1      Prog
# Prog_019       Prog    3030620         9991 -0.16915786  0.5851766   G2M      Prog
# Prog_031       Prog    1293487        10192 -0.34627038 -0.3971879    G1      Prog
# Prog_037       Prog    1357987         9599 -0.44270212  0.6820229   G2M      Prog
# Prog_008       Prog    4079891        10540  0.55854051  0.1284359     S      Prog
# Prog_014       Prog    2569783        10788  0.07116218  0.3166073   G2M      Prog

对细胞周期基因降维聚类:

# Running a PCA on cell cycle genes reveals, unsurprisingly, that cells separate entirely by
# phase
marrow <- RunPCA(marrow, features = c(s.genes, g2m.genes))
DimPlot(marrow,reduction = 'pca')

可以看到细胞完全按照细胞周期基因聚成三个亚群, 说明细胞中细胞周期基因会影响细胞的聚类

回归拟合细胞周期基因:

可以使用 ScaleData 函数的 vars.to.regress 函数来达到目的,时间还挺慢:

# Regress out cell cycle scores during data scaling
marrow <- ScaleData(marrow,
                    vars.to.regress = c("S.Score""G2M.Score"),
                    features = rownames(marrow))

可视化:

我们再来看看聚类效果:

# When running a PCA on only cell cycle genes, cells no longer separate by cell-cycle phase
marrow <- RunPCA(marrow, features = c(s.genes, g2m.genes))
DimPlot(marrow)

效果好很多了。




  老俊俊生信交流群 (微信交流群需收取20元入群费用(防止骗子和便于管理))


老俊俊微信:


知识星球:



今天的分享就到这里了,敬请期待下一篇!

最后欢迎大家分享转发,您的点赞是对我的鼓励肯定

如果觉得对您帮助很大,赏杯快乐水喝喝吧!



  





跟着 Nature medicine 学单细胞数据分析

单细胞亚群分面可视化

跟着 Nature medicine 学画图-tSNE

单细胞亚群 Marker 基因热图重绘及均值展示

Seurat 官网单细胞教程四 (SCTransform 使用及 SCTransform V2 版本)

Seurat 官网单细胞教程三 (RPCA 快速整合数据)

ggplot 随心所欲的添加注释

Seurat 官网单细胞教程一 (数据整合)

NC 文章单细胞部分图复现

Seurat 官网单细胞教程一 (基础教程)

◀...

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存