山峦图,英文名叫做ridge plot,其本质上是密度图(density plot),其实中文并没有统一的称呼,但是由于其外貌高低不平,形似山川,一般称呼其为“山峦图”。山峦图的用法与小提琴图、箱形图相似,主要用于可视化数据的分布情况,而外形上却具有中国山水画的美感。
library(Seurat)
library(SeuratData)
AvailableData()
library(ggthemes)
library(ggimage)
library(pbmc3k.SeuratData)
pbmc3k.final
An object of class Seurat
13714 features across 2638 samples within 1 assay
Active assay: RNA (13714 features, 2000 variable features)
2 dimensional reductions calculated: pca, umap
先选一个作为好看的模板。
imcell <- 'cell.png'
classmk <-c("IL7R", "CCR7", "IL7R", "S100A4","CD14", "LYZ","MS4A1","CD8A","FCGR3A", "MS4A7", "GNLY",
"NKG7","FCER1A", "CST3","PPBP")
RidgePlot(pbmc3k.final,features =classmk)
看起来,这个几个基因不错:
qljs<- c("S100A4","LYZ","CST3","IL7R")
但是最好的还是LYZ,LaiYunZhou的首字母,就它了。
RidgePlot(pbmc3k.final,features ="LYZ") + # 画山
geom_jitter(width = .5,height =.4,alpha=0.5,colour="green",shape=21) + # 画雨
geom_image(image = imcell, size = .025,alpha=0.4)+ # 画水
theme_solarized(light = F ) + ggtitle("单细胞·千里江山图\n天街小雨润如酥\n草色遥看近却无") +
NoLegend()
网友评论