本文是参考学习 CNS图表复现03—单细胞区分免疫细胞和肿瘤细胞
的学习笔记。可能根据学习情况有所改动。
今天讲解第三步:根据一些基因的表达来区分细胞是否属于免疫细胞。
我在单细胞天地的教程:是否是免疫细胞很容易区分那是否是肿瘤细胞呢?提到过Cells were defined as non-immune if belonging to a cluster low for PTPRC (gene for CD45)
>rm(list=ls())
options(stringsAsFactors = F)
library(Seurat)
library(ggplot2)
load(file = 'first_sce.Rdata')
# Specify genes
genes_to_check = c("PTPRC","EPCAM","CD3G","CD3E", "CD79A", "BLNK","MS4A1", "CD68", "CSF1R",
"MARCO", "CD207", "PMEL", "ALB", "C1QB", "CLDN5", "FCGR3B", "COL1A1")
# All on Dotplot
p <- DotPlot(sce, features = genes_to_check) + coord_flip()
p
可以看到;
image.png不同标记基因在不同细胞亚群的表达情况
其中PTPRC基因代表的是CD45分子,是免疫细胞的标记,所以可以使用它来区分:
# Annotate Immune vs Nonimmune clusters
# At this point we dont care for a more detailed annotation as we will annotate immune and non-immune separately later
dat=p$data
cd45=dat[dat$features.plot=='PTPRC',]
fivenum(cd45$avg.exp.scaled)
imm=cd45[cd45$avg.exp.scaled > -0.5,]$id
imm
sce@meta.data$immune_annotation <-ifelse(sce@meta.data$RNA_snn_res.0.5 %in% imm ,'immune','non-immune')
# MAke a table
table(sce@meta.data$immune_annotation)
# Make and save relevant plots
接下来可以进行 TSNE plot 可视化,看到免疫细胞和非免疫细胞是泾渭分明:
p <- TSNEPlot(object = sce, group.by = 'immune_annotation')
p
image.png
TSNE plot 可视化看免疫细胞
网友评论