Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colour mapping of sc_dim_geom_label and sc_dim_geom_ellipse work with sc_feature #32

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

xiangpin
Copy link
Member

This pr refines the #31

library(Seurat)
library(ggsc)
library(ggplot2)
library(ggnewscale)

pbmc <- readRDS("./pbmc_seurat.rds")

features = c("MS4A1", "GNLY", "CD3E",
            "CD14", "FCER1A", "FCGR3A",
            "LYZ", "PPBP", "CD8A")

sc_feature(pbmc,
           mapping = aes(bg_colour = RNA_snn_res.0.5),
           features = features,
           reduction = 'umap',
           geom = geom_bgpoint,
           pointsize = 1
  ) +
  ggnewscale::new_scale_color() +
  sc_dim_geom_ellipse(
     mapping = aes(group = RNA_snn_res.0.5, colour=RNA_snn_res.0.5),
  ) +
  sc_dim_geom_label(
     geom = shadowtext::geom_shadowtext,
     mapping = aes(label = RNA_snn_res.0.5, colour = RNA_snn_res.0.5),
     bg.color = 'white',
     size = 5
  )

image

…ith sc_features by adding new_scale_colour of ggnewscale
@GuangchuangYu GuangchuangYu merged commit 17fe232 into YuLab-SMU:devel Aug 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants