其他
单细胞转录组基础分析八:可视化工具总结
The following article is from 生信会客厅 Author Kinesin
Seurat自带一些优秀的可视化工具,之前的分析内容陆续展示过一些,本节内容将总结这些可视化函数的使用。
RidgePlot山脊图
library(Seurat)
library(tidyverse)
library(patchwork)
rm(list=ls())
dir.create("visual")
scRNA <- readRDS("scRNA.rds")
p1 = RidgePlot(scRNA, features = "FCN1")
p2 = RidgePlot(scRNA, features = "PC_2")
plotc = p1/p2 + plot_layout(guides = 'collect')
ggsave('visual/ridgeplot_eg.png', plotc, width = 8,height = 8)
VInPlot小提琴图
p1 = VlnPlot(scRNA, features = "nCount_RNA", pt.size = 0)
p2 = VlnPlot(scRNA, features = "CD8A", pt.size = 0)
plotc = p1/p2 + plot_layout(guides = 'collect')
ggsave('visual/vlnplot_eg.png', plotc, width = 8,height = 8)
FeaturePlot特征图
p1 <- FeaturePlot(scRNA,features = "CD8A", reduction = 'umap')
p2 <- FeaturePlot(scRNA,features = "CD79A", reduction = 'umap')
plotc = p1|p2
ggsave('visual/featureplot_eg.png', plotc, width = 10, height = 4)
DotPlot点图
genelist = c('LYZ','CD79A','CD8A','CD8B','GZMB','FCGR3A')
p = DotPlot(scRNA, features = genelist)
ggsave('visual/dotplot_eg.png', p, width = 7, height = 5)
DoHeatmap热图
genelist = read.csv("cell_identify/top10_diff_genes_wilcox.csv")
genelist <- pull(genelist, gene) %>% as.character
p = DoHeatmap(scRNA, features = genelist, group.by = "seurat_clusters")
ggsave('visual/heatmap_eg.png', p, width = 12, height = 9)
FeatureScatter散点图
p1 <- FeatureScatter(scRNA, feature1 = 'PC_1', feature2 = 'PC_2')
p2 <- FeatureScatter(scRNA, feature1 = 'nCount_RNA', feature2 = 'nFeature_RNA')
plotc = p1|p2
ggsave('visual/featurescatter_eg.png', plotc, width = 10, height = 4)
DimPlot降维图
p1 <- DimPlot(scRNA, reduction = 'tsne', group.by = "celltype", label=T)
p2 <- DimPlot(scRNA, reduction = 'umap', group.by = "Phase", label=T)
p3 <- DimPlot(scRNA, reduction = 'pca', group.by = "celltype", label=T)
p4 <- DimPlot(scRNA, reduction = 'umap', group.by = "seurat_clusters", label=T)
plotc = (p1|p2)/(p3|p4)
ggsave('visual/dimplot_eg.png', plotc, width = 10, height = 8)
获取帮助
本教程的目的在于把常用的单细胞分析流程串起来,适合有一定R语言基础的朋友参考。分析原理和代码我没有详细解释,官网有详细的教程和权威的解释,翻译好的中文教程也有多个版本,有兴趣的可以搜索一下。如果您学习本教程有一定困难,可以点击 “阅读原文” 找到作者联系方式,获取帮助。
如果你对单细胞转录组研究感兴趣,但又不知道如何入门,也许你可以关注一下下面的课程
生信爆款入门-第8期(线上直播4周,马拉松式陪伴,带你入门)你的生物信息入门课
数据挖掘学习班第6期(线上直播3周,马拉松式陪伴,带你入门) 医学生/医生首选技能提高课
生信技能树的2019年终总结 你的生物信息成长宝藏
看完记得顺手点个“在看”哦!
长按扫码可关注