用ggplot来改善Seurat包的画图

您所在的位置:网站首页 专业课什么时候上 用ggplot来改善Seurat包的画图

用ggplot来改善Seurat包的画图

2023-03-24 16:09| 来源: 网络整理| 查看: 265

Seurat是分析单细胞数据一个非常好用的包,几句代码就可以出图,如feature plot,violin plot,heatmap等,但是图片有些地方需要改善的地方,默认的调整参数没有提供,好在Seurat的画图底层是用ggplot架构的,我们可以用ggplot的参数进行调整。

默认的feature plot是坐标轴形式

FeaturePlot(seurat.object,features = c("Thy1")) image.png

改成加框:

FeaturePlot(seurat.object,features = c("Thy1"))+annotate(geom = 'segment', y = Inf, yend = Inf, color = 'black', x = -Inf, xend = Inf, size = 1)+annotate(geom = 'segment', x = Inf, xend = Inf, color = 'black', y = -Inf, yend = Inf, size = 0.5) image.png

去掉框顺便改个颜色

FeaturePlot(object = seurat.object, features = c('Thy1'),cols = c("lightgrey" ,"#DE1F1F"),slot = "data",label.size = 6,pt.size = 1.2) + theme(axis.line = element_blank(), axis.text = element_blank(), axis.ticks = element_blank(), axis.title = element_blank()) + guides(color=F) image.png

可以将通过rgb颜色改个透明度

print(FeaturePlot(object = CDCs, features = c('Thy1'),cols = c(rgb(220,212,213,180,maxColorValue = 255),rgb(174,27,52,50, maxColorValue = 255)),slot = "scale.data",label.size = 6,pt.size = 1.5,min.cutoff = "q10", max.cutoff = "q90") + theme(axis.line = element_blank(), axis.text = element_blank(), axis.ticks = element_blank(), axis.title = element_blank())) image.png

欢迎关注~

image.png


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3