美文网首页
GGPLOT: UMAP点云图-簇轮廓注释

GGPLOT: UMAP点云图-簇轮廓注释

作者: Norahd | 来源:发表于2023-06-26 10:17 被阅读0次

Code Deom

pacman::p_load(Seurat,dplyr,ggplot2)
remotes::install_github("sajuukLyu/ggunchull")

DimPlot(seurat.object)$data %>% ggplot(aes(UMAP_1,UMAP_2,color = ident,fill = ident)) +
    ggunchull::stat_unchull(alpha = .3, size = .8,linetype = 2,show.legend = F,
                            sfac = 1.8, nbin = 150 ,qval = .5
                            ) +
    geom_point(pch = 21,size = 3,color = "black",stroke = 0.1) +
    tidydr::theme_dr() + theme(panel.grid = element_blank(),
                               plot.margin = unit( c(0.1,0.15,0.1,0.1),"npc"),
                               plot.title = element_text(face = 2,size = 20,hjust = 0.5))  +
    guides(color = guide_legend(override.aes = list(size= 7))) +
    scale_color_brewer(palette = "Paired") +
    scale_fill_brewer(palette = "Paired") +
    labs(title = "UMAP")

Reference

sajuukLyu/ggunchull: A ggplot extension for drawing smooth non-convex circles around a set of points. (github.com)

相关文章

网友评论

      本文标题:GGPLOT: UMAP点云图-簇轮廓注释

      本文链接:https://www.haomeiwen.com/subject/suiwydtx.html