Engage to Life Energy
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)
VlnPlot小提琴图
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)
地址:上海市松江区中心路1158号5幢5楼
电话:400-9200-612 传真:+86 21 6090 1207/1208-8154
dafabet手机黄金版技术(上海)有限公司 Copyright 2012 Genergy Inc. 沪ICP备10017363号
微信:genenergy