library(rlang)
library(ggseurat)
#> Loading required package: ggplot2
#> Loading required package: SeuratObject
#> Loading required package: sp
#>
#> Attaching package: 'SeuratObject'
#> The following objects are masked from 'package:base':
#>
#> intersect, t
library(patchwork)
data("pbmc_small")
p <- ggplot(data = pbmc_small, mapping = aes(x = tSNE_1, y = tSNE_2)) +
cowplot::theme_cowplot()
# 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(color = !!var)) +
scale_color_gradientn(colors = c("lightgrey", "purple"))
}
wrap_plots(plots)