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

add background point layer in grid level to be compatable with the framework of ggsc #22

Merged
merged 5 commits into from
Apr 12, 2024

Conversation

xiangpin
Copy link
Member

library(Seurat)
library(SingleCellExperiment) |> suppressPackageStartupMessages()
library(ggsc)
library(ggplot2)
library(SpatialExperiment)

seu.pbmc <- readRDS('./pbmc_seurat.rds')

p1 <- sc_dim(seu.pbmc, pointsize=3, alpha=.7,
             bg_color='black', bg_line_width=.2, gap_line_width=.1)

p2 <- sc_dim(seu.pbmc, mapping=aes(color=ident, bg_color=ident),
       pointsize=3, alpha=.7, bg_line_width=.2, gap_line_width=.1)


p3 <- sc_dim(seu.pbmc, mapping=aes(color=ident, bg_color=seurat_clusters),
             pointsize=3, alpha=.7, bg_line_width=.2, gap_line_width=.1)

p1 + p2 + p3

捕获

f1 <- sc_feature(seu.pbmc, features="S100A9", pointsize = 2.5)

f2 <- sc_feature(seu.pbmc, features = 'S100A9', density = TRUE, pointsize = 2.5)

f3 <- sc_feature(seu.pbmc, features = 'S100A9', bg_colour = 'black', gap_line_width = .1, pointsize=2.5)

f4 <-  sc_feature(seu.pbmc, features = 'S100A9', bg_colour = 'black', density = TRUE, gap_line_width=.1, pointsize=2.5)

f5 <- sc_feature(seu.pbmc, features="S100A9",
                 mapping = aes(bg_colour = ident),
                 pointsize=2.5, gap_line_width=.1)

f6 <- sc_feature(seu.pbmc, features="S100A9", mapping = aes(bg_colour = ident),
                 pointsize=2.5, gap_line_width=.1, density=TRUE)

f1 + f2 + f3 + f4 + f5 + f6

features

spe <- readRDS('./spe_data.rds')


ff1 <- spe |> sc_spatial(features = 'ENSG00000168314', image.plot = F, pointsize=3.5)

ff2 <- ff1 +
       sc_geom_point(data = ggtree::td_filter(ground_truth=='WM'), pointsize = 3.5,
                     bg_colour = 'black', gap_line_width=.15)

ff1 + ff2

spatial

@GuangchuangYu GuangchuangYu merged commit b39eb82 into YuLab-SMU:devel Apr 12, 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