超酷炫!一文教你升级你的单细胞可视化!你心动了没?
继续升级你的单细胞可视化_scpubr包
Hi,大家好,我是晨曦今天这期推文,我们继续来升级我们的单细胞可视化结果,前面一期推文我们讲解了Scillus包可以绘制不同平常的scRNA-seq可视化结果,详细推文如下: “承包单细胞所有美图?这个R包就够了!” 然后今天这期我们继续介绍另一款单细胞美图的R包——scpubr包 scpubr包的详细帮助文档:About this package | SCpubr (enblacar.github.io)
library(dplyr)
library(Seurat)
library(patchwork)
library(Nebulosa)
library(SCpubr)
然后我们为了获得一个标准的Seurat对象,我们需要快速走一遍标准流程,这里我们使用的数据就是Seurat官网导学部分的数据
pbmc.data <- Read10X(data.dir = "pbmc3k_filtered_gene_bc_matrices/filtered_gene_bc_matrices/hg19/")
pbmc <- CreateSeuratObject(counts = pbmc.data, project = "pbmc3k", min.cells = 3, min.features = 200)
pbmc[["percent.mt"]] <- PercentageFeatureSet(pbmc, pattern = "^MT-")
pbmc <- subset(pbmc, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & percent.mt < 5)
pbmc <- NormalizeData(pbmc, normalization.method = "LogNormalize", scale.factor = 10000)
pbmc <- FindVariableFeatures(pbmc, selection.method = "vst", nfeatures = 2000)
all.genes <- rownames(pbmc)
pbmc <- ScaleData(pbmc, features = all.genes)
pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc))
pbmc <- FindNeighbors(pbmc, dims = 1:10)
pbmc <- FindClusters(pbmc, resolution = 0.5)
pbmc <- RunUMAP(pbmc, dims = 1:10)
new.cluster.ids <- c("Naive CD4 T", "CD14+ Mono", "Memory CD4 T", "B", "CD8 T", "FCGR3A+ Mono",
"NK", "DC", "Platelet")
names(new.cluster.ids) <- levels(pbmc)
pbmc <- RenameIdents(pbmc, new.cluster.ids)
DimPlot(pbmc, reduction = "umap", label = TRUE, pt.size = 0.5) + NoLegend()
p <- Nebulosa::plot_density(pbmc,
features = "CD14")
p
genes <- list("Naive CD4+ T" = c("IL7R", "CCR7"),
"CD14+ Mono" = c("CD14", "LYZ"),
"Memory CD4+" = c("S100A4"),
"B" = c("MS4A1"),
"CD8+ T" = c("CD8A"),
"FCGR3A+ Mono" = c("FCGR3A", "MS4A7"),
"NK" = c("GNLY", "NKG7"),
"DC" = c("FCER1A", "CST3"),
"Platelet" = c("PPBP"))
p <- SCpubr::do_DotPlot(sample = pbmc,
features = genes)
p
基于接口的选择可以达到修改参数即可以完成富集分析
genes <- c("ABCB1", "ABCG2", "AHR", "AKT1", "AR")
p <- SCpubr::do_TermEnrichmentPlot(genes = genes,
dbs_use = "C",
ncol = 2)
p
#参数解析
#dbs_use参数决定了向哪个富集分析数据库进行富集
#“A”: Will perform a query to 4 databases for cell types (Azimuth, Descartes, PanglaoDB and Descartes) and 4 databases for functional terms (MsigDB, GO-BP, GO-MF and KEGG). This is the default option if this parameter is not provided.
#“B”: Performs a query for the cell type databases (Azimuth, Descartes, PanglaoDB and Descartes).
#“C”: Performs a query for the functional terms (MsigDB, GO-BP, GO-MF and KEGG).
理解细胞的一个非常常见的方法是查询从文献中检索到的几个标记基因列表,并计算每个细胞在给定的基因列表中的富集程度。这是通过使用Seurat: : AddModuleScore实现的
genes <- list("Naive CD4+ T" = c("IL7R", "CCR7"),
"CD14+ Mono" = c("CD14", "LYZ"),
"Memory CD4+" = c("S100A4"),
"B" = c("MS4A1"),
"CD8+ T" = c("CD8A"),
"FCGR3A+ Mono" = c("FCGR3A", "MS4A7"),
"NK" = c("GNLY", "NKG7"),
"DC" = c("FCER1A", "CST3"),
"Platelet" = c("PPBP"))
# Default parameters.
p <- SCpubr::do_EnrichmentHeatmap(sample = sample,
list_genes = genes)
p
当然除了上述这些,还有很多基于Seurat本身可视化修改的个性化可视化展现形式,感兴趣的小伙伴可以查看下面的帮助文档进一步学习
Rasterized figures | SCpubr (enblacar.github.io)
那么,本期推文到这里就结束啦~
各位小伙伴有感兴趣的内容也可以在评论区留言,说不定下一期就是你感兴趣的内容哦~
我是晨曦,我们下期再见~
晨曦的混合效应模型系列传送门
晨曦的空间转录组笔记系列传送门
晨曦单细胞文献阅读系列传送门
1. 非肿瘤单细胞分析模板已到位!眼馋单细胞的小伙伴快来看!手把手教你产出第一篇单细胞SCI!
晨曦单细胞笔记系列传送门
晨曦单细胞数据库系列传送门
—
END—
撰文丨晨 曦
排版丨四金兄
主编丨小雪球
欢迎大家关注解螺旋生信频道-挑圈联靠公号~
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。