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(scRNA1, features = "nCount_RNA", pt.size = 0)
p2 = VlnPlot(scRNA1, features = "CD8A", pt.size = 0)
plotc = p1/p2 + plot_layout(guides = 'collect')
plotc

9.48.png
FeaturePlot特征图
p1 <- FeaturePlot(scRNA1,features = "CD8A", reduction = 'umap')
p2 <- FeaturePlot(scRNA1,features = "CD79A", reduction = 'umap')
plotc = p1|p2
plotc

9.50.png
DotPlot点图
genelist = c('LYZ','CD79A','CD8A','CD8B','GZMB','FCGR3A')
p = DotPlot(scRNA1, features = genelist)
p

9.51.png
DoHeatmap热图
genelist = read.csv("top10_diff_genes_wilcox.csv")
genelist <- pull(genelist, gene) %>% as.character
p = DoHeatmap(scRNA1, features = genelist, group.by = "seurat_clusters")
p

9.57.png
FeatureScatter散点图
p1 <- FeatureScatter(scRNA1, feature1 = 'PC_1', feature2 = 'PC_2')
p2 <- FeatureScatter(scRNA1, feature1 = 'nCount_RNA', feature2 = 'nFeature_RNA')
plotc = p1|p2
plotc

9.59.png
DimPlot降维图
p1 <- DimPlot(scRNA1, reduction = 'tsne', group.by = "celltype", label=T)
#p2 <- DimPlot(scRNA1, reduction = 'umap', group.by = "Phase", label=T) 报错了。。
p3 <- DimPlot(scRNA1, reduction = 'pca', group.by = "celltype", label=T)
p4 <- DimPlot(scRNA1, reduction = 'umap', group.by = "seurat_clusters", label=T)
plotc = p1|p3|p4
plotc

10.04.png
网友评论