View source: R/do_CellularStatesPlot.R
do_CellularStatesPlot | R Documentation |
This plot aims to show the relationships between distinct enrichment scores. If 3 variables are provided, the relationship is between the Y axis and the dual X axis. If 4 variables are provided, each corner of the plot represents how enriched the cells are in that given list. How to interpret this? In a 3-variable plot, the Y axis just means one variable. The higher the cells are in the Y axis the more enriched they are in that given variable. The X axis is a dual parameter one. Cells falling into each extreme of the axis are highly enriched for either x1 or x2, while cells falling in between are not enriched for any of the two. In a 4-variable plot, each corner shows the enrichment for one of the 4 given features. Cells will tend to locate in either of the four corners, but there will be cases of cells locating mid-way between two given corners (enriched in both features) or in the middle of the plot (not enriched for any).
do_CellularStatesPlot(
sample,
input_gene_list,
x1,
y1,
x2 = NULL,
y2 = NULL,
group.by = NULL,
colors.use = NULL,
legend.position = "bottom",
legend.icon.size = 4,
legend.ncol = NULL,
legend.nrow = NULL,
legend.byrow = FALSE,
plot.title = NULL,
plot.subtitle = NULL,
plot.caption = NULL,
font.size = 14,
font.type = "sans",
xlab = NULL,
ylab = NULL,
axis.ticks = TRUE,
axis.text = TRUE,
verbose = FALSE,
enforce_symmetry = FALSE,
plot_marginal_distributions = FALSE,
marginal.type = "density",
marginal.size = 5,
marginal.group = TRUE,
plot_cell_borders = TRUE,
plot_enrichment_scores = FALSE,
border.size = 2,
border.color = "black",
pt.size = 2,
raster = FALSE,
raster.dpi = 1024,
plot_features = FALSE,
features = NULL,
use_viridis = TRUE,
viridis.palette = "G",
viridis.direction = 1,
sequential.palette = "YlGnBu",
sequential.direction = -1,
nbin = 24,
ctrl = 100,
number.breaks = 5,
plot.title.face = "bold",
plot.subtitle.face = "plain",
plot.caption.face = "italic",
axis.title.face = "bold",
axis.text.face = "plain",
legend.title.face = "bold",
legend.text.face = "plain"
)
sample |
|
input_gene_list |
|
x1 |
|
y1 |
|
x2 |
|
y2 |
|
group.by |
|
colors.use |
|
legend.position |
|
legend.icon.size |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
plot.title , plot.subtitle , plot.caption |
|
font.size |
|
font.type |
|
xlab , ylab |
|
axis.ticks |
|
axis.text |
|
verbose |
|
enforce_symmetry |
|
plot_marginal_distributions |
|
marginal.type |
|
marginal.size |
|
marginal.group |
|
plot_cell_borders |
|
plot_enrichment_scores |
|
border.size |
|
border.color |
|
pt.size |
|
raster |
|
raster.dpi |
|
plot_features |
|
features |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
nbin |
|
ctrl |
|
number.breaks |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face |
|
This plots are based on the following publications:
Neftel, C. et al. An Integrative Model of Cellular States, Plasticity, and Genetics for Glioblastoma. Cell 178, 835-849.e21 (2019). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.cell.2019.06.024")}
Tirosh, I., Venteicher, A., Hebert, C. et al. Single-cell RNA-seq supports a developmental hierarchy in human oligodendroglioma. Nature 539, 309–313 (2016). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1038/nature20123")}
A ggplot2 object containing a butterfly plot.
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_CellularStatesPlot", passive = TRUE)
if (isTRUE(value)){
# Consult the full documentation in https://enblacar.github.io/SCpubr-book/
# Define your Seurat object.
sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr"))
# Define some gene sets to query. It has to be a named list.
gene_set <- list("A" = rownames(sample)[1:10],
"B" = rownames(sample)[11:20],
"C" = rownames(sample)[21:30],
"D" = rownames(sample)[31:40])
# Using two variables: A scatter plot X vs Y.
p <- SCpubr::do_CellularStatesPlot(sample = sample,
input_gene_list = gene_set,
x1 = "A",
y1 = "B",
nbin = 1,
ctrl = 10)
p
# Using three variables. Figure from: https://www.nature.com/articles/nature20123.
p <- SCpubr::do_CellularStatesPlot(sample = sample,
input_gene_list = gene_set,
x1 = "A",
y1 = "B",
x2 = "C",
nbin = 1,
ctrl = 10)
p
# Using four variables. Figure from: https://pubmed.ncbi.nlm.nih.gov/31327527/
p <- SCpubr::do_CellularStatesPlot(sample = sample,
input_gene_list = gene_set,
x1 = "A",
y1 = "C",
x2 = "B",
y2 = "D",
nbin = 1,
ctrl = 10)
p
} else if (base::isFALSE(value)){
message("This function can not be used without its suggested packages.")
message("Check out which ones are needed using `SCpubr::state_dependencies()`.")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.