更改横轴顺序(根据实际需要)
sce.all$group <- factor(x =sce.all$group, levels = c("PB","ecrs","necrs"))
p <- DotPlot(sce.all,
features = unique(top3$gene),
group.by = "group",
assay='RNA' ) + coord_flip()
自带图美化一下
DimPlot(sce.all,
reduction = "umap", #聚类方式
label = F,
raster=FALSE,
group.by = "celltype", #按照组别设置
#cols= paletteer_d("ggsci::category20_d3"), # 颜色可以在这里设置,也可以在后面设置
pt.size = 0.8,#设置点的大小
repel = T)+#标注有点挤,repel=T可以让排列更加合理
#NoLegend()+
scale_color_manual(values = alpha(paletteer::paletteer_d('ggsci::category20c_d3'), 0.65)) + #此处设置颜色可以调节深浅
labs(x = "UMAP1", y = "UMAP2")+
theme(axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
axis.text.x = element_blank(),
axis.ticks.x = element_blank()) +
theme(panel.border = element_rect(fill=NA,color="black", size=1, linetype="solid"))
DoHeatmap(sce.all,
features = top10$gene,
group.by = "cluster",
size=3)+
scale_fill_gradientn(colors = c("navy","white","firebrick3"))
DotPlot(sce.all,
features = unique(top3$gene),
group.by = "cluster",
assay='RNA' ) +
coord_flip()+theme_bw()+#去除背景,旋转图片
theme(panel.grid = element_blank(),
axis.text.x=element_text(angle=90,hjust = 1,vjust=0.5))+#文字90度呈现
scale_color_gradientn(values = seq(0,1,0.2),colors = c('#330066','#336699','#66CC66','#FFCC33'))+#颜色渐变设置
labs(x=NULL,y=NULL)+guides(size=guide_legend(order=3))
VlnPlot(sce.all,
features = genes_to_check,
stack = T,#T 在同一张图上显示
flip = T,#倒置
pt.size = 0) #点的大小