library(rlang)
library(ggseurat)
#> Loading required package: ggplot2
#> Loading required package: SeuratObject
#> Attaching sp
library(patchwork)
data("pbmc_small")
p <- ggplot(data = pbmc_small) +
cowplot::theme_cowplot()
p + geom_point(aes(x = tSNE_1, y = tSNE_2, color = ident))
# features <- c("LYZ", "CCL5", "IL32", "PTPRCAP", "FCGR3A", "PF4")
features <- c("LYZ", "CCL5", "IL32", "FCGR3A", "PF4")
plots <- vector("list", length = length(features))
for (i in seq_along(plots)) {
var <- sym(features[i])
plots[[i]] <- p +
geom_point(aes(x = tSNE_1, y = tSNE_2, color = !!var)) +
scale_color_gradientn(colors = c("lightgrey", "purple"))
}
wrap_plots(plots)
var <- sym("MS4A1")
p +
geom_point(aes(x = tSNE_1, y = tSNE_2, color = !!var)) +
scale_color_gradientn(colors = c("lightgrey", "purple")) +
facet_wrap(facets = "groups")