Title: | Generate Publication Ready Visualizations of Single Cell Transcriptomics Data |
---|---|
Description: | A system that provides a streamlined way of generating publication ready plots for known Single-Cell transcriptomics data in a “publication ready” format. This is, the goal is to automatically generate plots with the highest quality possible, that can be used right away or with minimal modifications for a research article. |
Authors: | Enrique Blanco-Carmona [cre, aut]
|
Maintainer: | Enrique Blanco-Carmona <[email protected]> |
License: | GPL-3 |
Version: | 2.0.2.9000 |
Built: | 2025-02-13 17:21:05 UTC |
Source: | https://github.com/enblacar/scpubr |
Major contributions to this function:
Marc Elosua Bayés for the core concept code and idea.
Pau Badia i Mompel for the network generation.
do_ActivityHeatmap( sample, input_gene_list, subsample = 2500, group.by = NULL, assay = NULL, slot = NULL, statistic = "ulm", number.breaks = 5, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, diverging.palette = "RdBu", diverging.direction = -1, enforce_symmetry = TRUE, legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", na.value = "grey75", font.size = 14, font.type = "sans", axis.text.x.angle = 45, flip = FALSE, colors.use = NULL, min.cutoff = NA, max.cutoff = NA, verbose = TRUE, return_object = FALSE, grid.color = "white", border.color = "black", flavor = "Seurat", nbin = 24, ctrl = 100, 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" )
do_ActivityHeatmap( sample, input_gene_list, subsample = 2500, group.by = NULL, assay = NULL, slot = NULL, statistic = "ulm", number.breaks = 5, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, diverging.palette = "RdBu", diverging.direction = -1, enforce_symmetry = TRUE, legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", na.value = "grey75", font.size = 14, font.type = "sans", axis.text.x.angle = 45, flip = FALSE, colors.use = NULL, min.cutoff = NA, max.cutoff = NA, verbose = TRUE, return_object = FALSE, grid.color = "white", border.color = "black", flavor = "Seurat", nbin = 24, ctrl = 100, 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 |
|
subsample |
|
group.by |
|
assay |
|
slot |
|
statistic |
|
number.breaks |
|
values.show |
|
values.threshold |
|
values.size |
|
values.round |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
diverging.palette |
|
diverging.direction |
|
enforce_symmetry |
|
legend.position |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
na.value |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
flip |
|
colors.use |
|
min.cutoff , max.cutoff
|
|
verbose |
|
return_object |
|
grid.color |
|
border.color |
|
flavor |
|
nbin |
|
ctrl |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A list containing different plots.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ActivityHeatmap", 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")) # Genes have to be unique. genes <- list("A" = rownames(sample)[1:5], "B" = rownames(sample)[6:10], "C" = rownames(sample)[11:15]) # Default parameters. p <- SCpubr::do_ActivityHeatmap(sample = sample, input_gene_list = genes, nbin = 1, ctrl = 5, flavor = "Seurat", subsample = NA, verbose = FALSE) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ActivityHeatmap", 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")) # Genes have to be unique. genes <- list("A" = rownames(sample)[1:5], "B" = rownames(sample)[6:10], "C" = rownames(sample)[11:15]) # Default parameters. p <- SCpubr::do_ActivityHeatmap(sample = sample, input_gene_list = genes, nbin = 1, ctrl = 5, flavor = "Seurat", subsample = NA, verbose = FALSE) 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()`.") }
This function is based on the ggalluvial package. It allows you to generate alluvial plots from a given Seurat object.
do_AlluvialPlot( sample, first_group, last_group, middle_groups = NULL, colors.use = NULL, colorblind = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, font.size = 14, font.type = "sans", xlab = NULL, ylab = "Number of cells", repel = FALSE, fill.by = last_group, use_labels = FALSE, stratum.color = "black", stratum.fill = "white", stratum.width = 1/3, stratum.fill.conditional = FALSE, use_geom_flow = FALSE, alluvium.color = "white", flow.color = "white", flip = FALSE, label.color = "black", curve_type = "sigmoid", use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, plot.grid = FALSE, grid.color = "grey75", grid.type = "dashed", na.value = "white", legend.position = "bottom", legend.title = NULL, 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" )
do_AlluvialPlot( sample, first_group, last_group, middle_groups = NULL, colors.use = NULL, colorblind = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, font.size = 14, font.type = "sans", xlab = NULL, ylab = "Number of cells", repel = FALSE, fill.by = last_group, use_labels = FALSE, stratum.color = "black", stratum.fill = "white", stratum.width = 1/3, stratum.fill.conditional = FALSE, use_geom_flow = FALSE, alluvium.color = "white", flow.color = "white", flip = FALSE, label.color = "black", curve_type = "sigmoid", use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, plot.grid = FALSE, grid.color = "grey75", grid.type = "dashed", na.value = "white", legend.position = "bottom", legend.title = NULL, 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 |
|
first_group |
|
last_group |
|
middle_groups |
|
colors.use |
|
colorblind |
|
plot.title , plot.subtitle , plot.caption
|
|
font.size |
|
font.type |
|
xlab , ylab
|
|
repel |
|
fill.by |
|
use_labels |
|
stratum.color , alluvium.color , flow.color
|
|
stratum.fill |
|
stratum.width |
|
stratum.fill.conditional |
|
use_geom_flow |
|
flip |
|
label.color |
|
curve_type |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
plot.grid |
|
grid.color |
|
grid.type |
|
na.value |
|
legend.position |
|
legend.title |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_AlluvialPlot", passive = TRUE) message(value) 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")) # Compute basic sankey plot. p <- SCpubr::do_AlluvialPlot(sample = sample, first_group = "orig.ident", last_group = "seurat_clusters") } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_AlluvialPlot", passive = TRUE) message(value) 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")) # Compute basic sankey plot. p <- SCpubr::do_AlluvialPlot(sample = sample, first_group = "orig.ident", last_group = "seurat_clusters") } 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()`.") }
Create Bar Plots.
do_BarPlot( sample, group.by, order = FALSE, add.n = FALSE, add.n.face = "bold", add.n.expand = c(0, 1.15), add.n.size = 4, order.by = NULL, split.by = NULL, facet.by = NULL, position = "stack", font.size = 14, font.type = "sans", legend.position = "bottom", legend.title = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, axis.text.x.angle = 45, xlab = NULL, ylab = NULL, colors.use = NULL, colorblind = FALSE, flip = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, plot.grid = FALSE, grid.color = "grey75", grid.type = "dashed", 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", strip.text.face = "bold", return_data = FALSE )
do_BarPlot( sample, group.by, order = FALSE, add.n = FALSE, add.n.face = "bold", add.n.expand = c(0, 1.15), add.n.size = 4, order.by = NULL, split.by = NULL, facet.by = NULL, position = "stack", font.size = 14, font.type = "sans", legend.position = "bottom", legend.title = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, axis.text.x.angle = 45, xlab = NULL, ylab = NULL, colors.use = NULL, colorblind = FALSE, flip = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, plot.grid = FALSE, grid.color = "grey75", grid.type = "dashed", 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", strip.text.face = "bold", return_data = FALSE )
sample |
|
group.by |
|
order |
|
add.n |
|
add.n.face |
|
add.n.expand |
|
add.n.size |
|
order.by |
|
split.by |
|
facet.by |
|
position |
|
font.size |
|
font.type |
|
legend.position |
|
legend.title |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
axis.text.x.angle |
|
xlab , ylab
|
|
colors.use |
|
colorblind |
|
flip |
|
plot.title , plot.subtitle , plot.caption
|
|
plot.grid |
|
grid.color |
|
grid.type |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
strip.text.face |
|
return_data |
|
A ggplot2 object containing a Bar plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_BarPlot", 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")) # Basic bar plot, horizontal. p1 <- SCpubr::do_BarPlot(sample = sample, group.by = "seurat_clusters", legend.position = "none", plot.title = "Number of cells per cluster") # Split by a second variable. sample$modified_orig.ident <- sample(x = c("Sample_A", "Sample_B", "Sample_C"), size = ncol(sample), replace = TRUE, prob = c(0.2, 0.7, 0.1)) p <- SCpubr::do_BarPlot(sample, group.by = "seurat_clusters", split.by = "modified_orig.ident", plot.title = "Number of cells per cluster in each sample", position = "stack") } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_BarPlot", 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")) # Basic bar plot, horizontal. p1 <- SCpubr::do_BarPlot(sample = sample, group.by = "seurat_clusters", legend.position = "none", plot.title = "Number of cells per cluster") # Split by a second variable. sample$modified_orig.ident <- sample(x = c("Sample_A", "Sample_B", "Sample_C"), size = ncol(sample), replace = TRUE, prob = c(0.2, 0.7, 0.1)) p <- SCpubr::do_BarPlot(sample, group.by = "seurat_clusters", split.by = "modified_orig.ident", plot.title = "Number of cells per cluster in each sample", position = "stack") } 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()`.") }
BeeSwarm plot.
do_BeeSwarmPlot( sample, feature_to_rank, group.by = NULL, assay = NULL, reduction = NULL, slot = NULL, continuous_feature = FALSE, order = FALSE, colors.use = NULL, colorblind = FALSE, legend.title = NULL, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.icon.size = 4, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, font.size = 14, font.type = "sans", remove_x_axis = FALSE, remove_y_axis = FALSE, flip = FALSE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, sequential.palette = "YlGnBu", sequential.direction = 1, verbose = TRUE, raster = FALSE, raster.dpi = 300, plot_cell_borders = TRUE, border.size = 1.5, border.color = "black", pt.size = 2, min.cutoff = NA, max.cutoff = NA, na.value = "grey75", 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" )
do_BeeSwarmPlot( sample, feature_to_rank, group.by = NULL, assay = NULL, reduction = NULL, slot = NULL, continuous_feature = FALSE, order = FALSE, colors.use = NULL, colorblind = FALSE, legend.title = NULL, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.icon.size = 4, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, font.size = 14, font.type = "sans", remove_x_axis = FALSE, remove_y_axis = FALSE, flip = FALSE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, sequential.palette = "YlGnBu", sequential.direction = 1, verbose = TRUE, raster = FALSE, raster.dpi = 300, plot_cell_borders = TRUE, border.size = 1.5, border.color = "black", pt.size = 2, min.cutoff = NA, max.cutoff = NA, na.value = "grey75", 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 |
|
feature_to_rank |
|
group.by |
|
assay |
|
reduction |
|
slot |
|
continuous_feature |
|
order |
|
colors.use |
|
colorblind |
|
legend.title |
|
legend.type |
|
legend.position |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.ncol |
|
legend.icon.size |
|
plot.title , plot.subtitle , plot.caption
|
|
xlab , ylab
|
|
font.size |
|
font.type |
|
remove_x_axis , remove_y_axis
|
|
flip |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
verbose |
|
raster |
|
raster.dpi |
|
plot_cell_borders |
|
border.size |
|
border.color |
|
pt.size |
|
min.cutoff , max.cutoff
|
|
na.value |
|
number.breaks |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object containing a Bee Swarm plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_BeeSwarmPlot", 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")) # Basic Bee Swarm plot - categorical coloring. # This will color based on the unique values of seurat_clusters. p <- SCpubr::do_BeeSwarmPlot(sample = sample, feature_to_rank = "PC_1", group.by = "seurat_clusters", continuous_feature = FALSE) # Basic Bee Swarm plot - continuous coloring. # This will color based on the PC_1 values. p <- SCpubr::do_BeeSwarmPlot(sample = sample, feature_to_rank = "PC_1", group.by = "seurat_clusters", continuous_feature = TRUE) } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_BeeSwarmPlot", 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")) # Basic Bee Swarm plot - categorical coloring. # This will color based on the unique values of seurat_clusters. p <- SCpubr::do_BeeSwarmPlot(sample = sample, feature_to_rank = "PC_1", group.by = "seurat_clusters", continuous_feature = FALSE) # Basic Bee Swarm plot - continuous coloring. # This will color based on the PC_1 values. p <- SCpubr::do_BeeSwarmPlot(sample = sample, feature_to_rank = "PC_1", group.by = "seurat_clusters", continuous_feature = TRUE) } 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()`.") }
Generate Box Plots.
do_BoxPlot( sample, feature, group.by = NULL, split.by = NULL, assay = NULL, slot = "data", font.size = 14, font.type = "sans", axis.text.x.angle = 45, colors.use = NULL, colorblind = FALSE, na.value = "grey75", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, legend.title = NULL, legend.title.position = "top", legend.position = "bottom", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, boxplot.line.color = "black", outlier.color = "black", outlier.alpha = 0.5, boxplot.linewidth = 0.5, boxplot.width = NULL, plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", flip = FALSE, order = FALSE, use_silhouette = FALSE, use_test = FALSE, comparisons = NULL, test = "wilcox.test", map_signif_level = c(`***` = 0.001, `**` = 0.01, `*` = 0.05), 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" )
do_BoxPlot( sample, feature, group.by = NULL, split.by = NULL, assay = NULL, slot = "data", font.size = 14, font.type = "sans", axis.text.x.angle = 45, colors.use = NULL, colorblind = FALSE, na.value = "grey75", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, legend.title = NULL, legend.title.position = "top", legend.position = "bottom", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, boxplot.line.color = "black", outlier.color = "black", outlier.alpha = 0.5, boxplot.linewidth = 0.5, boxplot.width = NULL, plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", flip = FALSE, order = FALSE, use_silhouette = FALSE, use_test = FALSE, comparisons = NULL, test = "wilcox.test", map_signif_level = c(`***` = 0.001, `**` = 0.01, `*` = 0.05), 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 |
|
feature |
|
group.by |
|
split.by |
|
assay |
|
slot |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
colors.use |
|
colorblind |
|
na.value |
|
plot.title , plot.subtitle , plot.caption
|
|
xlab , ylab
|
|
legend.title |
|
legend.title.position |
|
legend.position |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
boxplot.line.color |
|
outlier.color |
|
outlier.alpha |
|
boxplot.linewidth |
|
boxplot.width |
|
plot.grid |
|
grid.color |
|
grid.type |
|
flip |
|
order |
|
use_silhouette |
|
use_test |
|
comparisons |
A list of length-2 vectors. The entries in the vector are either the names of 2 values on the x-axis or the 2 integers that correspond to the index of the columns of interest. |
test |
the name of the statistical test that is applied to the values of
the 2 columns (e.g. |
map_signif_level |
Boolean value, if the p-value are directly written as
annotation or asterisks are used instead. Alternatively one can provide a
named numeric vector to create custom mappings from p-values to annotation:
For example: |
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_BoxPlot", 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")) # Basic box plot. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA") p # Use silhouette style. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", use_silhouette = TRUE) p # Order by mean values. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", order = TRUE) p # Apply second grouping. sample$orig.ident <- ifelse(sample$seurat_clusters %in% c("0", "1", "2", "3"), "A", "B") p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", split.by = "orig.ident") p # Apply statistical tests. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", group.by = "orig.ident", use_test = TRUE, comparisons = list(c("A", "B"))) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_BoxPlot", 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")) # Basic box plot. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA") p # Use silhouette style. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", use_silhouette = TRUE) p # Order by mean values. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", order = TRUE) p # Apply second grouping. sample$orig.ident <- ifelse(sample$seurat_clusters %in% c("0", "1", "2", "3"), "A", "B") p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", split.by = "orig.ident") p # Apply statistical tests. p <- SCpubr::do_BoxPlot(sample = sample, feature = "nCount_RNA", group.by = "orig.ident", use_test = TRUE, comparisons = list(c("A", "B"))) 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()`.") }
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, colorblind = FALSE, 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" )
do_CellularStatesPlot( sample, input_gene_list, x1, y1, x2 = NULL, y2 = NULL, group.by = NULL, colors.use = NULL, colorblind = FALSE, 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 |
|
colorblind |
|
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). 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). 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()`.") }
# 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()`.") }
Generate a Chord diagram.
do_ChordDiagramPlot( sample = NULL, from = NULL, to = NULL, colors.from = NULL, colors.to = NULL, colorblind = FALSE, big.gap = 10, small.gap = 1, link.border.color = NA, link.border.width = 1, highlight_group = NULL, alpha.highlight = 25, link.sort = NULL, link.decreasing = TRUE, z_index = FALSE, self.link = 1, symmetric = FALSE, directional = 1, direction.type = c("diffHeight", "arrows"), link.arr.type = "big.arrow", scale = FALSE, alignment = "default", annotationTrack = c("grid", "axis"), padding_labels = 4, font.size = 1, ... )
do_ChordDiagramPlot( sample = NULL, from = NULL, to = NULL, colors.from = NULL, colors.to = NULL, colorblind = FALSE, big.gap = 10, small.gap = 1, link.border.color = NA, link.border.width = 1, highlight_group = NULL, alpha.highlight = 25, link.sort = NULL, link.decreasing = TRUE, z_index = FALSE, self.link = 1, symmetric = FALSE, directional = 1, direction.type = c("diffHeight", "arrows"), link.arr.type = "big.arrow", scale = FALSE, alignment = "default", annotationTrack = c("grid", "axis"), padding_labels = 4, font.size = 1, ... )
sample |
|
from , to
|
|
colors.from , colors.to
|
|
colorblind |
|
big.gap |
|
small.gap |
|
link.border.color |
|
link.border.width |
|
highlight_group |
|
alpha.highlight |
|
link.sort |
pass to |
link.decreasing |
pass to |
z_index |
|
self.link |
|
symmetric |
pass to |
directional |
|
direction.type |
|
link.arr.type |
|
scale |
|
alignment |
|
annotationTrack |
pass to |
padding_labels |
|
font.size |
|
... |
For internal use only. |
A circlize plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ChordDiagramPlot", 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")) # Basic chord diagram. sample$assignment <- ifelse(sample$seurat_clusters %in% c("0", "4", "7"), "A", "B") sample$assignment[sample$seurat_clusters %in% c("1", "2")] <- "C" sample$assignment[sample$seurat_clusters %in% c("10", "5")] <- "D" sample$assignment[sample$seurat_clusters %in% c("8", "9")] <- "E" p <- SCpubr::do_ChordDiagramPlot(sample = sample, from = "seurat_clusters", to = "assignment") 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ChordDiagramPlot", 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")) # Basic chord diagram. sample$assignment <- ifelse(sample$seurat_clusters %in% c("0", "4", "7"), "A", "B") sample$assignment[sample$seurat_clusters %in% c("1", "2")] <- "C" sample$assignment[sample$seurat_clusters %in% c("10", "5")] <- "D" sample$assignment[sample$seurat_clusters %in% c("8", "9")] <- "E" p <- SCpubr::do_ChordDiagramPlot(sample = sample, from = "seurat_clusters", to = "assignment") 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()`.") }
Display CNV scores from inferCNV as Feature Plots.
do_CNVHeatmap( sample, infercnv_object, chromosome_locations, group.by = NULL, using_metacells = FALSE, metacell_mapping = NULL, include_chr_arms = FALSE, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, legend.type = "colorbar", legend.position = "bottom", legend.length = 20, legend.width = 1, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", font.size = 14, pt.size = 1, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = TRUE, legend.title = NULL, na.value = "grey75", viridis.palette = "G", viridis.direction = 1, verbose = FALSE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = -1, use_viridis = TRUE, return_object = FALSE, grid.color = "white", border.color = "black", flip = FALSE, 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" )
do_CNVHeatmap( sample, infercnv_object, chromosome_locations, group.by = NULL, using_metacells = FALSE, metacell_mapping = NULL, include_chr_arms = FALSE, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, legend.type = "colorbar", legend.position = "bottom", legend.length = 20, legend.width = 1, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", font.size = 14, pt.size = 1, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = TRUE, legend.title = NULL, na.value = "grey75", viridis.palette = "G", viridis.direction = 1, verbose = FALSE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = -1, use_viridis = TRUE, return_object = FALSE, grid.color = "white", border.color = "black", flip = FALSE, 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 |
|
infercnv_object |
|
chromosome_locations |
|
group.by |
|
using_metacells |
|
metacell_mapping |
|
include_chr_arms |
|
values.show |
|
values.threshold |
|
values.size |
|
values.round |
|
legend.type |
|
legend.position |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
font.size |
|
pt.size |
|
font.type |
|
axis.text.x.angle |
|
enforce_symmetry |
|
legend.title |
|
na.value |
|
viridis.palette |
|
viridis.direction |
|
verbose |
|
min.cutoff , max.cutoff
|
|
number.breaks |
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
use_viridis |
|
return_object |
|
grid.color |
|
border.color |
|
flip |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A list containing Feature Plots for different chromosome regions and corresponding dot plots by groups..
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_CNVHeatmap", passive = TRUE) if (isTRUE(value)){ # Consult the full documentation in https://enblacar.github.io/SCpubr-book/ # This function expects that you have run inferCNV on your # own and you have access to the output object. # Define your Seurat object. sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr")) # Define your inferCNV object. infercnv_object <- readRDS(system.file("extdata/infercnv_object_example.rds", package = "SCpubr")) # Get human chromosome locations. chromosome_locations = SCpubr::human_chr_locations # Compute for a all chromosomes. p <- SCpubr::do_CNVHeatmap(sample = sample, infercnv_object = infercnv_object, using_metacells = FALSE, chromosome_locations = chromosome_locations) } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_CNVHeatmap", passive = TRUE) if (isTRUE(value)){ # Consult the full documentation in https://enblacar.github.io/SCpubr-book/ # This function expects that you have run inferCNV on your # own and you have access to the output object. # Define your Seurat object. sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr")) # Define your inferCNV object. infercnv_object <- readRDS(system.file("extdata/infercnv_object_example.rds", package = "SCpubr")) # Get human chromosome locations. chromosome_locations = SCpubr::human_chr_locations # Compute for a all chromosomes. p <- SCpubr::do_CNVHeatmap(sample = sample, infercnv_object = infercnv_object, using_metacells = FALSE, chromosome_locations = chromosome_locations) } 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()`.") }
This function generate colorblind variations of a provided color palette in order to check if it is colorblind friendly. Variations are generated using colorspace package.
do_ColorBlindCheck( colors.use, flip = FALSE, font.size = 14, font.type = "sans", plot.title.face = "bold", plot.subtitle.face = "plain", plot.caption.face = "italic", axis.title.face = "bold", axis.text.face = "plain", grid.color = "white", border.color = "black", axis.text.x.angle = 45 )
do_ColorBlindCheck( colors.use, flip = FALSE, font.size = 14, font.type = "sans", plot.title.face = "bold", plot.subtitle.face = "plain", plot.caption.face = "italic", axis.title.face = "bold", axis.text.face = "plain", grid.color = "white", border.color = "black", axis.text.x.angle = 45 )
colors.use |
|
flip |
|
font.size |
|
font.type |
|
grid.color |
|
border.color |
|
axis.text.x.angle |
|
A character vector with the desired color scale.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ColorBlindCheck", passive = TRUE) if (isTRUE(value)){ # Generate a color wheel based on a single value. colors <- c("red", "green", "blue") p <- SCpubr::do_ColorBlindCheck(colors.use = colors) } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ColorBlindCheck", passive = TRUE) if (isTRUE(value)){ # Generate a color wheel based on a single value. colors <- c("red", "green", "blue") p <- SCpubr::do_ColorBlindCheck(colors.use = colors) } 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()`.") }
This function is an adaptation of colortools package. As the package was removed from CRAN on 23-06-2022, this utility function came to existence in order to cover the gap. It is, on its basis, an adaptation of the package into a single function. Original code, developed by Gaston Sanchez, can be found in: https://github.com/gastonstat/colortools
do_ColorPalette( colors.use, n = 12, opposite = FALSE, adjacent = FALSE, triadic = FALSE, split_complementary = FALSE, tetradic = FALSE, square = FALSE, complete_output = FALSE, plot = FALSE, font.size = 14, font.type = "sans" )
do_ColorPalette( colors.use, n = 12, opposite = FALSE, adjacent = FALSE, triadic = FALSE, split_complementary = FALSE, tetradic = FALSE, square = FALSE, complete_output = FALSE, plot = FALSE, font.size = 14, font.type = "sans" )
colors.use |
|
n |
|
opposite |
|
adjacent |
|
triadic |
|
split_complementary |
|
tetradic |
|
square |
|
complete_output |
|
plot |
|
font.size |
|
font.type |
|
A character vector with the desired color scale.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ColorPalette", passive = TRUE) if (isTRUE(value)){ # Generate a color wheel based on a single value. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue") p <- SCpubr::do_ColorPalette(colors.use = "steelblue", plot = TRUE) # Generate a pair of opposite colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", opposite = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", opposite = TRUE, plot = TRUE) # Generate a trio of adjacent colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", adjacent = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", adjacent = TRUE, plot = TRUE) # Generate a trio of triadic colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", triadic = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", triadic = TRUE, plot = TRUE) # Generate a trio of split complementary colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", split_complementary = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", split_complementary = TRUE, plot = TRUE) # Generate a group of tetradic colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", tetradic = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", tetradic = TRUE, plot = TRUE) # Generate a group of square colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", square = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", square = TRUE, plot = TRUE) # Retrieve the output of all options. out <- SCpubr::do_ColorPalette(colors.use = "steelblue", complete_output = TRUE) ## Retrieve the colors. colors <- out$colors ## Retrieve the plots. plots <- out$plots ## Retrieve a combined plot with all the options. p <- out$combined_plot } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ColorPalette", passive = TRUE) if (isTRUE(value)){ # Generate a color wheel based on a single value. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue") p <- SCpubr::do_ColorPalette(colors.use = "steelblue", plot = TRUE) # Generate a pair of opposite colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", opposite = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", opposite = TRUE, plot = TRUE) # Generate a trio of adjacent colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", adjacent = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", adjacent = TRUE, plot = TRUE) # Generate a trio of triadic colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", triadic = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", triadic = TRUE, plot = TRUE) # Generate a trio of split complementary colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", split_complementary = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", split_complementary = TRUE, plot = TRUE) # Generate a group of tetradic colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", tetradic = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", tetradic = TRUE, plot = TRUE) # Generate a group of square colors based on a given one. colors <- SCpubr::do_ColorPalette(colors.use = "steelblue", square = TRUE) p <- SCpubr::do_ColorPalette(colors.use = "steelblue", square = TRUE, plot = TRUE) # Retrieve the output of all options. out <- SCpubr::do_ColorPalette(colors.use = "steelblue", complete_output = TRUE) ## Retrieve the colors. colors <- out$colors ## Retrieve the plots. plots <- out$plots ## Retrieve a combined plot with all the options. p <- out$combined_plot } 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()`.") }
Create correlation matrix heatmaps.
do_CorrelationHeatmap( sample = NULL, input_gene_list = NULL, cluster = TRUE, remove.diagonal = TRUE, mode = "hvg", values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, assay = NULL, group.by = NULL, legend.title = "Pearson coef.", enforce_symmetry = ifelse(mode == "hvg", TRUE, FALSE), font.size = 14, font.type = "sans", na.value = "grey75", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", legend.position = "bottom", min.cutoff = NA, max.cutoff = NA, number.breaks = 5, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, diverging.palette = "RdBu", diverging.direction = -1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, axis.text.x.angle = 45, grid.color = "white", border.color = "black", 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" )
do_CorrelationHeatmap( sample = NULL, input_gene_list = NULL, cluster = TRUE, remove.diagonal = TRUE, mode = "hvg", values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, assay = NULL, group.by = NULL, legend.title = "Pearson coef.", enforce_symmetry = ifelse(mode == "hvg", TRUE, FALSE), font.size = 14, font.type = "sans", na.value = "grey75", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", legend.position = "bottom", min.cutoff = NA, max.cutoff = NA, number.breaks = 5, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, diverging.palette = "RdBu", diverging.direction = -1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, axis.text.x.angle = 45, grid.color = "white", border.color = "black", 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 |
|
cluster |
|
remove.diagonal |
|
mode |
|
values.show |
|
values.threshold |
|
values.size |
|
values.round |
|
assay |
|
group.by |
|
legend.title |
|
enforce_symmetry |
|
font.size |
|
font.type |
|
na.value |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
legend.position |
|
min.cutoff , max.cutoff
|
|
number.breaks |
|
plot.title , plot.subtitle , plot.caption
|
|
diverging.palette |
|
diverging.direction |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
axis.text.x.angle |
|
grid.color |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_CorrelationHeatmap", 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")) # Default values. p <- SCpubr::do_CorrelationHeatmap(sample = sample) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_CorrelationHeatmap", 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")) # Default values. p <- SCpubr::do_CorrelationHeatmap(sample = sample) 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()`.") }
Wrapper for DimPlot.
do_DimPlot( sample, reduction = NULL, group.by = NULL, split.by = NULL, split.by.combined = TRUE, colors.use = NULL, colorblind = FALSE, shuffle = TRUE, order = NULL, raster = FALSE, pt.size = 1, label = FALSE, label.color = "black", label.fill = "white", label.size = 4, label.box = TRUE, repel = FALSE, cells.highlight = NULL, idents.highlight = NULL, idents.keep = NULL, sizes.highlight = 1, ncol = NULL, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.title = NULL, legend.position = "bottom", legend.title.position = "top", legend.ncol = NULL, legend.nrow = NULL, legend.icon.size = 4, legend.byrow = FALSE, legend.dot.border = TRUE, raster.dpi = 2048, dims = c(1, 2), font.size = 14, font.type = "sans", na.value = "grey75", plot_cell_borders = TRUE, border.size = 2, border.color = "black", border.density = 1, plot_marginal_distributions = FALSE, marginal.type = "density", marginal.size = 5, marginal.group = TRUE, plot.axes = FALSE, plot_density_contour = FALSE, contour.position = "bottom", contour.color = "grey90", contour.lineend = "butt", contour.linejoin = "round", contour_expand_axes = 0.25, 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" )
do_DimPlot( sample, reduction = NULL, group.by = NULL, split.by = NULL, split.by.combined = TRUE, colors.use = NULL, colorblind = FALSE, shuffle = TRUE, order = NULL, raster = FALSE, pt.size = 1, label = FALSE, label.color = "black", label.fill = "white", label.size = 4, label.box = TRUE, repel = FALSE, cells.highlight = NULL, idents.highlight = NULL, idents.keep = NULL, sizes.highlight = 1, ncol = NULL, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.title = NULL, legend.position = "bottom", legend.title.position = "top", legend.ncol = NULL, legend.nrow = NULL, legend.icon.size = 4, legend.byrow = FALSE, legend.dot.border = TRUE, raster.dpi = 2048, dims = c(1, 2), font.size = 14, font.type = "sans", na.value = "grey75", plot_cell_borders = TRUE, border.size = 2, border.color = "black", border.density = 1, plot_marginal_distributions = FALSE, marginal.type = "density", marginal.size = 5, marginal.group = TRUE, plot.axes = FALSE, plot_density_contour = FALSE, contour.position = "bottom", contour.color = "grey90", contour.lineend = "butt", contour.linejoin = "round", contour_expand_axes = 0.25, 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 |
|
reduction |
|
group.by |
|
split.by |
|
split.by.combined |
|
colors.use |
|
colorblind |
|
shuffle |
|
order |
|
raster |
|
pt.size |
|
label |
|
label.color |
|
label.fill |
|
label.size |
|
label.box |
|
repel |
|
cells.highlight , idents.highlight
|
|
idents.keep |
|
sizes.highlight |
|
ncol |
|
plot.title , plot.subtitle , plot.caption
|
|
legend.title |
|
legend.position |
|
legend.title.position |
|
legend.ncol |
|
legend.nrow |
|
legend.icon.size |
|
legend.byrow |
|
legend.dot.border |
|
raster.dpi |
|
dims |
|
font.size |
|
font.type |
|
na.value |
|
plot_cell_borders |
|
border.size |
|
border.color |
|
border.density |
|
plot_marginal_distributions |
|
marginal.type |
|
marginal.size |
|
marginal.group |
|
plot.axes |
|
plot_density_contour |
|
contour.position |
|
contour.color |
|
contour.lineend |
|
contour.linejoin |
|
contour_expand_axes |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object containing a DimPlot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_DimPlot", 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")) # Basic DimPlot. p <- SCpubr::do_DimPlot(sample = sample) # Restrict the amount of identities displayed. p <- SCpubr::do_DimPlot(sample = sample, idents.keep = c("1", "3", "5")) # Group by another variable rather than `Seurat::Idents(sample)` p <- SCpubr::do_DimPlot(sample = sample, group.by = "seurat_clusters") # Split the output in as many plots as unique identities. p <- SCpubr::do_DimPlot(sample = sample, split.by = "seurat_clusters") # Highlight given identities p <- SCpubr::do_DimPlot(sample, idents.highlight = c("1", "3")) } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_DimPlot", 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")) # Basic DimPlot. p <- SCpubr::do_DimPlot(sample = sample) # Restrict the amount of identities displayed. p <- SCpubr::do_DimPlot(sample = sample, idents.keep = c("1", "3", "5")) # Group by another variable rather than `Seurat::Idents(sample)` p <- SCpubr::do_DimPlot(sample = sample, group.by = "seurat_clusters") # Split the output in as many plots as unique identities. p <- SCpubr::do_DimPlot(sample = sample, split.by = "seurat_clusters") # Highlight given identities p <- SCpubr::do_DimPlot(sample, idents.highlight = c("1", "3")) } 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()`.") }
This function is a wrapper for DotPlot. It provides most of its functionalities while adding extra. You can
do_DotPlot( sample, features, assay = NULL, slot = "data", group.by = NULL, split.by = NULL, zscore.data = FALSE, min.cutoff = NA, max.cutoff = NA, enforce_symmetry = ifelse(base::isTRUE(zscore.data), TRUE, FALSE), legend.title = NULL, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, dot.scale = 8, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, font.size = 14, font.type = "sans", cluster = FALSE, flip = FALSE, axis.text.x.angle = 45, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, diverging.palette = "RdBu", diverging.direction = -1, na.value = "grey75", plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", 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" )
do_DotPlot( sample, features, assay = NULL, slot = "data", group.by = NULL, split.by = NULL, zscore.data = FALSE, min.cutoff = NA, max.cutoff = NA, enforce_symmetry = ifelse(base::isTRUE(zscore.data), TRUE, FALSE), legend.title = NULL, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, dot.scale = 8, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, font.size = 14, font.type = "sans", cluster = FALSE, flip = FALSE, axis.text.x.angle = 45, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, diverging.palette = "RdBu", diverging.direction = -1, na.value = "grey75", plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", 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 |
|
features |
|
assay |
|
slot |
|
group.by |
|
split.by |
|
zscore.data |
|
min.cutoff , max.cutoff
|
|
enforce_symmetry |
|
legend.title |
|
legend.type |
|
legend.position |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
dot.scale |
|
plot.title , plot.subtitle , plot.caption
|
|
xlab , ylab
|
|
font.size |
|
font.type |
|
cluster |
|
flip |
|
axis.text.x.angle |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
diverging.palette |
|
diverging.direction |
|
na.value |
|
plot.grid |
|
grid.color |
|
grid.type |
|
number.breaks |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object containing a Dot Plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_DotPlot", 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")) # Basic Dot plot. # genes <- rownames(sample)[1:14] # p <- SCpubr::do_DotPlot(sample = sample, # features = genes) } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_DotPlot", 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")) # Basic Dot plot. # genes <- rownames(sample)[1:14] # p <- SCpubr::do_DotPlot(sample = sample, # features = genes) } 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()`.") }
This function computes the enrichment scores for the cells using AddModuleScore and then aggregates the scores by the metadata variables provided by the user and displays it as a heatmap, computed by Heatmap.
do_EnrichmentHeatmap( sample, input_gene_list, features.order = NULL, groups.order = NULL, cluster = TRUE, scale_scores = FALSE, assay = NULL, slot = NULL, reduction = NULL, group.by = NULL, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, verbose = FALSE, na.value = "grey75", legend.position = "bottom", use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = FALSE, nbin = 24, ctrl = 100, flavor = "Seurat", legend.title = NULL, ncores = 1, storeRanks = TRUE, min.cutoff = NA, max.cutoff = NA, pt.size = 1, plot_cell_borders = TRUE, border.size = 2, return_object = FALSE, number.breaks = 5, sequential.palette = "YlGnBu", diverging.palette = "RdBu", diverging.direction = -1, sequential.direction = 1, flip = FALSE, grid.color = "white", border.color = "black", 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" )
do_EnrichmentHeatmap( sample, input_gene_list, features.order = NULL, groups.order = NULL, cluster = TRUE, scale_scores = FALSE, assay = NULL, slot = NULL, reduction = NULL, group.by = NULL, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, verbose = FALSE, na.value = "grey75", legend.position = "bottom", use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = FALSE, nbin = 24, ctrl = 100, flavor = "Seurat", legend.title = NULL, ncores = 1, storeRanks = TRUE, min.cutoff = NA, max.cutoff = NA, pt.size = 1, plot_cell_borders = TRUE, border.size = 2, return_object = FALSE, number.breaks = 5, sequential.palette = "YlGnBu", diverging.palette = "RdBu", diverging.direction = -1, sequential.direction = 1, flip = FALSE, grid.color = "white", border.color = "black", 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 |
|
features.order |
|
groups.order |
|
cluster |
|
scale_scores |
|
assay |
|
slot |
|
reduction |
|
group.by |
|
values.show |
|
values.threshold |
|
values.size |
|
values.round |
|
verbose |
|
na.value |
|
legend.position |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
enforce_symmetry |
|
nbin |
|
ctrl |
|
flavor |
|
legend.title |
|
ncores |
|
storeRanks |
|
min.cutoff , max.cutoff
|
|
pt.size |
|
plot_cell_borders |
|
border.size |
|
return_object |
|
number.breaks |
|
sequential.palette |
|
diverging.palette |
|
diverging.direction |
|
sequential.direction |
|
flip |
|
grid.color |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_EnrichmentHeatmap", 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")) # Genes have to be unique. genes <- list("A" = rownames(sample)[1:5], "B" = rownames(sample)[6:10], "C" = rownames(sample)[11:15]) # Default parameters. p <- SCpubr::do_EnrichmentHeatmap(sample = sample, input_gene_list = genes, 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_EnrichmentHeatmap", 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")) # Genes have to be unique. genes <- list("A" = rownames(sample)[1:5], "B" = rownames(sample)[6:10], "C" = rownames(sample)[11:15]) # Default parameters. p <- SCpubr::do_EnrichmentHeatmap(sample = sample, input_gene_list = genes, 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()`.") }
This function generates a heatmap with averaged expression values by the unique groups of the metadata variables provided by the user.
do_ExpressionHeatmap( sample, features, group.by = NULL, assay = NULL, cluster = TRUE, features.order = NULL, groups.order = NULL, slot = "data", values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, legend.title = "Avg. Expression", na.value = "grey75", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = FALSE, min.cutoff = NA, max.cutoff = NA, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, number.breaks = 5, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, flip = FALSE, grid.color = "white", border.color = "black", 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" )
do_ExpressionHeatmap( sample, features, group.by = NULL, assay = NULL, cluster = TRUE, features.order = NULL, groups.order = NULL, slot = "data", values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, legend.title = "Avg. Expression", na.value = "grey75", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = FALSE, min.cutoff = NA, max.cutoff = NA, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, number.breaks = 5, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, flip = FALSE, grid.color = "white", border.color = "black", 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 |
|
features |
|
group.by |
|
assay |
|
cluster |
|
features.order |
|
groups.order |
|
slot |
|
values.show |
|
values.threshold |
|
values.size |
|
values.round |
|
legend.title |
|
na.value |
|
legend.position |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
enforce_symmetry |
|
min.cutoff , max.cutoff
|
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
number.breaks |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
flip |
|
grid.color |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ExpressionHeatmap", 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 list of genes. genes <- rownames(sample)[1:10] # Default parameters. p <- SCpubr::do_ExpressionHeatmap(sample = sample, features = genes, viridis.direction = -1) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ExpressionHeatmap", 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 list of genes. genes <- rownames(sample)[1:10] # Default parameters. p <- SCpubr::do_ExpressionHeatmap(sample = sample, features = genes, viridis.direction = -1) 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()`.") }
Wrapper for FeaturePlot.
do_FeaturePlot( sample, features, assay = NULL, reduction = NULL, slot = NULL, order = FALSE, group.by = NULL, group.by.colors.use = NULL, colorblind = FALSE, group.by.legend = NULL, group.by.show.dots = TRUE, group.by.dot.size = 8, group.by.cell_borders = FALSE, group.by.cell_borders.alpha = 0.1, split.by = NULL, idents.keep = NULL, cells.highlight = NULL, idents.highlight = NULL, dims = c(1, 2), enforce_symmetry = FALSE, symmetry.type = "absolute", symmetry.center = NA, pt.size = 1, font.size = 14, font.type = "sans", legend.title = NULL, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, individual.titles = NULL, individual.subtitles = NULL, individual.captions = NULL, ncol = NULL, use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, raster = FALSE, raster.dpi = 1024, plot_cell_borders = TRUE, border.size = 2, border.color = "black", border.density = 1, na.value = "grey75", verbose = TRUE, plot.axes = FALSE, min.cutoff = rep(NA, length(features)), max.cutoff = rep(NA, length(features)), scale.limits = NULL, plot_density_contour = FALSE, contour.position = "bottom", contour.color = "grey90", contour.lineend = "butt", contour.linejoin = "round", contour_expand_axes = 0.25, label = FALSE, label.color = "black", label.size = 4, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, 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" )
do_FeaturePlot( sample, features, assay = NULL, reduction = NULL, slot = NULL, order = FALSE, group.by = NULL, group.by.colors.use = NULL, colorblind = FALSE, group.by.legend = NULL, group.by.show.dots = TRUE, group.by.dot.size = 8, group.by.cell_borders = FALSE, group.by.cell_borders.alpha = 0.1, split.by = NULL, idents.keep = NULL, cells.highlight = NULL, idents.highlight = NULL, dims = c(1, 2), enforce_symmetry = FALSE, symmetry.type = "absolute", symmetry.center = NA, pt.size = 1, font.size = 14, font.type = "sans", legend.title = NULL, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, individual.titles = NULL, individual.subtitles = NULL, individual.captions = NULL, ncol = NULL, use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, raster = FALSE, raster.dpi = 1024, plot_cell_borders = TRUE, border.size = 2, border.color = "black", border.density = 1, na.value = "grey75", verbose = TRUE, plot.axes = FALSE, min.cutoff = rep(NA, length(features)), max.cutoff = rep(NA, length(features)), scale.limits = NULL, plot_density_contour = FALSE, contour.position = "bottom", contour.color = "grey90", contour.lineend = "butt", contour.linejoin = "round", contour_expand_axes = 0.25, label = FALSE, label.color = "black", label.size = 4, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, 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 |
|
features |
|
assay |
|
reduction |
|
slot |
|
order |
|
group.by |
|
group.by.colors.use |
|
colorblind |
|
group.by.legend |
|
group.by.show.dots |
|
group.by.dot.size |
|
group.by.cell_borders |
|
group.by.cell_borders.alpha |
|
split.by |
|
idents.keep |
|
cells.highlight , idents.highlight
|
|
dims |
|
enforce_symmetry |
|
symmetry.type |
|
symmetry.center |
|
pt.size |
|
font.size |
|
font.type |
|
legend.title |
|
legend.type |
|
legend.position |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
plot.title , plot.subtitle , plot.caption
|
|
individual.titles , individual.subtitles , individual.captions
|
|
ncol |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
raster |
|
raster.dpi |
|
plot_cell_borders |
|
border.size |
|
border.color |
|
border.density |
|
na.value |
|
verbose |
|
plot.axes |
|
min.cutoff , max.cutoff
|
|
scale.limits |
|
plot_density_contour |
|
contour.position |
|
contour.color |
|
contour.lineend |
|
contour.linejoin |
|
contour_expand_axes |
|
label |
|
label.color |
|
label.size |
|
number.breaks |
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object containing a Feature Plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_FeaturePlot", 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")) # Regular FeaturePlot. p <- SCpubr::do_FeaturePlot(sample = sample, features = "nCount_RNA") # FeaturePlot with a subset of identities # (in Seurat::Idents(sample)) maintaining the original UMAP shape. idents.use <- levels(sample)[!(levels(sample) %in% c("2", "5", "8"))] p <- SCpubr::do_FeaturePlot(sample = sample, idents.highlight = idents.use, features = c("EPC1")) # Splitting the FeaturePlot by a variable and # maintaining the color scale and the UMAP shape. p <- SCpubr::do_FeaturePlot(sample = sample, features = "EPC1", split.by = "seurat_clusters") } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_FeaturePlot", 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")) # Regular FeaturePlot. p <- SCpubr::do_FeaturePlot(sample = sample, features = "nCount_RNA") # FeaturePlot with a subset of identities # (in Seurat::Idents(sample)) maintaining the original UMAP shape. idents.use <- levels(sample)[!(levels(sample) %in% c("2", "5", "8"))] p <- SCpubr::do_FeaturePlot(sample = sample, idents.highlight = idents.use, features = c("EPC1")) # Splitting the FeaturePlot by a variable and # maintaining the color scale and the UMAP shape. p <- SCpubr::do_FeaturePlot(sample = sample, features = "EPC1", split.by = "seurat_clusters") } 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()`.") }
Compute a dotplot with the results of a group-wise DE analysis.
do_GroupwiseDEHeatmap( sample, de_genes, group.by = NULL, assay = NULL, slot = "data", number.breaks = 5, dot.scale = 8, top_genes = 5, p.cutoff = 0.05, flip = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, use_viridis = FALSE, colors.use = NULL, colorblind = FALSE, viridis.direction = -1, viridis.palette = "G", sequential.direction = 1, sequential.palette = "YlGnBu", diverging.palette = "RdBu", diverging.direction = -1, legend.position = "bottom", legend.title = NULL, legend.width = 1, legend.length = 7.5, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, min.cutoff = NA, max.cutoff = NA, enforce_symmetry = FALSE, na.value = "grey75", border.color = "black", 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" )
do_GroupwiseDEHeatmap( sample, de_genes, group.by = NULL, assay = NULL, slot = "data", number.breaks = 5, dot.scale = 8, top_genes = 5, p.cutoff = 0.05, flip = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, use_viridis = FALSE, colors.use = NULL, colorblind = FALSE, viridis.direction = -1, viridis.palette = "G", sequential.direction = 1, sequential.palette = "YlGnBu", diverging.palette = "RdBu", diverging.direction = -1, legend.position = "bottom", legend.title = NULL, legend.width = 1, legend.length = 7.5, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, min.cutoff = NA, max.cutoff = NA, enforce_symmetry = FALSE, na.value = "grey75", border.color = "black", 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 |
|
de_genes |
|
group.by |
|
assay |
|
slot |
|
number.breaks |
|
dot.scale |
|
top_genes |
|
p.cutoff |
|
flip |
|
plot.title , plot.subtitle , plot.caption
|
|
xlab , ylab
|
|
use_viridis |
|
colors.use |
|
colorblind |
|
viridis.direction |
|
viridis.palette |
|
sequential.direction |
|
sequential.palette |
|
diverging.palette |
|
diverging.direction |
|
legend.position |
|
legend.title |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
min.cutoff , max.cutoff
|
|
enforce_symmetry |
|
na.value |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A dotplot composed of 3 main panels: -log10(adjusted p-value), log2(FC) and mean expression by cluster.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_GroupwiseDEHeatmap", 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")) # Compute DE genes and transform to a tibble. de_genes <- readRDS(system.file("extdata/de_genes_example.rds", package = "SCpubr")) # Default output. p <- SCpubr::do_GroupwiseDEHeatmap(sample = sample, de_genes = de_genes) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_GroupwiseDEHeatmap", 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")) # Compute DE genes and transform to a tibble. de_genes <- readRDS(system.file("extdata/de_genes_example.rds", package = "SCpubr")) # Default output. p <- SCpubr::do_GroupwiseDEHeatmap(sample = sample, de_genes = de_genes) 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()`.") }
This function takes the output of liana and generates a dot-plot visualization according to the user's specifications.
do_LigandReceptorPlot( liana_output, split.by = NULL, keep_source = NULL, keep_target = NULL, top_interactions = 25, top_interactions_by_group = FALSE, dot_border = TRUE, magnitude = "sca.LRscore", specificity = "aggregate_rank", sort.by = "E", sorting.type.specificity = "descending", sorting.type.magnitude = "descending", border.color = "black", axis.text.x.angle = 45, legend.position = "bottom", legend.type = "colorbar", legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.framewidth = 0.5, legend.tickwidth = 0.5, use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, sequential.palette = "YlGnBu", sequential.direction = 1, font.size = 14, dot.size = 1, font.type = "sans", plot.grid = TRUE, grid.color = "grey90", grid.type = "dotted", compute_ChordDiagrams = FALSE, sort_interactions_alphabetically = FALSE, 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", return_interactions = FALSE, invert_specificity = TRUE, invert_magnitude = FALSE, verbose = TRUE )
do_LigandReceptorPlot( liana_output, split.by = NULL, keep_source = NULL, keep_target = NULL, top_interactions = 25, top_interactions_by_group = FALSE, dot_border = TRUE, magnitude = "sca.LRscore", specificity = "aggregate_rank", sort.by = "E", sorting.type.specificity = "descending", sorting.type.magnitude = "descending", border.color = "black", axis.text.x.angle = 45, legend.position = "bottom", legend.type = "colorbar", legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", legend.framewidth = 0.5, legend.tickwidth = 0.5, use_viridis = FALSE, viridis.palette = "G", viridis.direction = 1, sequential.palette = "YlGnBu", sequential.direction = 1, font.size = 14, dot.size = 1, font.type = "sans", plot.grid = TRUE, grid.color = "grey90", grid.type = "dotted", compute_ChordDiagrams = FALSE, sort_interactions_alphabetically = FALSE, 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", return_interactions = FALSE, invert_specificity = TRUE, invert_magnitude = FALSE, verbose = TRUE )
liana_output |
|
split.by |
|
keep_source , keep_target
|
|
top_interactions |
|
top_interactions_by_group |
|
dot_border |
|
specificity , magnitude
|
|
sort.by |
|
sorting.type.specificity , sorting.type.magnitude
|
|
border.color |
|
axis.text.x.angle |
|
legend.position |
|
legend.type |
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.framewidth , legend.tickwidth
|
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
font.size |
|
dot.size |
|
font.type |
|
plot.grid |
|
grid.color |
|
grid.type |
|
compute_ChordDiagrams |
|
sort_interactions_alphabetically |
|
number.breaks |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
return_interactions |
|
invert_specificity , invert_magnitude
|
|
verbose |
|
A ggplot2 plot with the results of the Ligand-Receptor analysis.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_LigandReceptorPlot", passive = TRUE) if (isTRUE(value)){ liana_output <- readRDS(system.file("extdata/liana_output_example.rds", package = "SCpubr")) # Ligand Receptor analysis plot. p <- SCpubr::do_LigandReceptorPlot(liana_output = liana_output) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_LigandReceptorPlot", passive = TRUE) if (isTRUE(value)){ liana_output <- readRDS(system.file("extdata/liana_output_example.rds", package = "SCpubr")) # Ligand Receptor analysis plot. p <- SCpubr::do_LigandReceptorPlot(liana_output = liana_output) 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()`.") }
Compute a heatmap summary of the top and bottom genes in the PCA loadings for the desired PCs in a Seurat object.
do_LoadingsHeatmap( sample, group.by = NULL, subsample = NA, dims = 1:10, top_loadings = 5, assay = NULL, slot = "data", grid.color = "white", border.color = "black", number.breaks = 5, na.value = "grey75", legend.position = "bottom", legend.title = "Expression", legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", font.size = 14, font.type = "sans", axis.text.x.angle = 45, use_viridis = FALSE, sequential.direction = 1, sequential.palette = "YlGnBu", viridis.palette = "G", viridis.direction = -1, diverging.palette = "RdBu", diverging.direction = -1, min.cutoff.loadings = NA, max.cutoff.loadings = NA, min.cutoff.expression = NA, max.cutoff.expression = NA, 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" )
do_LoadingsHeatmap( sample, group.by = NULL, subsample = NA, dims = 1:10, top_loadings = 5, assay = NULL, slot = "data", grid.color = "white", border.color = "black", number.breaks = 5, na.value = "grey75", legend.position = "bottom", legend.title = "Expression", legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", font.size = 14, font.type = "sans", axis.text.x.angle = 45, use_viridis = FALSE, sequential.direction = 1, sequential.palette = "YlGnBu", viridis.palette = "G", viridis.direction = -1, diverging.palette = "RdBu", diverging.direction = -1, min.cutoff.loadings = NA, max.cutoff.loadings = NA, min.cutoff.expression = NA, max.cutoff.expression = NA, 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 |
|
group.by |
|
subsample |
|
dims |
|
top_loadings |
|
assay |
|
slot |
|
grid.color |
|
border.color |
|
number.breaks |
|
na.value |
|
legend.position |
|
legend.title |
|
legend.type |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
use_viridis |
|
sequential.direction |
|
sequential.palette |
|
viridis.palette |
|
viridis.direction |
|
diverging.palette |
|
diverging.direction |
|
min.cutoff.loadings , max.cutoff.loadings
|
|
min.cutoff.expression , max.cutoff.expression
|
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_LoadingsHeatmap", 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")) p <- SCpubr::do_LoadingsHeatmap(sample = sample, dims = 1:2) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_LoadingsHeatmap", 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")) p <- SCpubr::do_LoadingsHeatmap(sample = sample, dims = 1:2) 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()`.") }
The main use of this function is to generate a metadata heatmap of your categorical data, normally targeted to the different patient samples one has in the Seurat object. It requires that the metadata columns chosen have one and only one possible value for each of the values in group.by.
do_MetadataHeatmap( sample = NULL, group.by = NULL, metadata = NULL, from_df = FALSE, df = NULL, colors.use = NULL, colorblind = FALSE, cluster = FALSE, flip = TRUE, heatmap.gap = 1, axis.text.x.angle = 45, legend.position = "bottom", font.size = 14, legend.font.size = NULL, legend.symbol.size = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, na.value = "grey75", font.type = "sans", grid.color = "white", border.color = "black", 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", xlab = "", ylab = "" )
do_MetadataHeatmap( sample = NULL, group.by = NULL, metadata = NULL, from_df = FALSE, df = NULL, colors.use = NULL, colorblind = FALSE, cluster = FALSE, flip = TRUE, heatmap.gap = 1, axis.text.x.angle = 45, legend.position = "bottom", font.size = 14, legend.font.size = NULL, legend.symbol.size = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, na.value = "grey75", font.type = "sans", grid.color = "white", border.color = "black", 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", xlab = "", ylab = "" )
sample |
|
group.by |
|
metadata |
|
from_df |
|
df |
|
colors.use |
|
colorblind |
|
cluster |
|
flip |
|
heatmap.gap |
|
axis.text.x.angle |
|
legend.position |
|
font.size |
|
legend.font.size |
|
legend.symbol.size |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
na.value |
|
font.type |
|
grid.color |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
xlab , ylab
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_MetadataHeatmap", passive = TRUE) if (isTRUE(value)){ # Consult the full documentation in https://enblacar.github.io/SCpubr-book/ # Can also use a Seurat object. df <- data.frame(row.names = letters[1:5], "A" = as.character(seq(1, 5)), "B" = rev(as.character(seq(1, 5)))) p <- SCpubr::do_MetadataHeatmap(from_df = TRUE, df = df) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_MetadataHeatmap", passive = TRUE) if (isTRUE(value)){ # Consult the full documentation in https://enblacar.github.io/SCpubr-book/ # Can also use a Seurat object. df <- data.frame(row.names = letters[1:5], "A" = as.character(seq(1, 5)), "B" = rev(as.character(seq(1, 5)))) p <- SCpubr::do_MetadataHeatmap(from_df = TRUE, df = df) 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()`.") }
Wrapper for Nebulosa::plot_density in Seurat.
do_NebulosaPlot( sample, features, slot = NULL, dims = c(1, 2), pt.size = 1, reduction = NULL, combine = TRUE, method = c("ks", "wkde"), joint = FALSE, return_only_joint = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", font.size = 14, font.type = "sans", legend.position = "bottom", plot_cell_borders = TRUE, border.size = 2, border.color = "black", viridis.palette = "G", viridis.direction = 1, verbose = TRUE, na.value = "grey75", plot.axes = FALSE, number.breaks = 5, use_viridis = FALSE, sequential.palette = "YlGnBu", sequential.direction = 1, 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" )
do_NebulosaPlot( sample, features, slot = NULL, dims = c(1, 2), pt.size = 1, reduction = NULL, combine = TRUE, method = c("ks", "wkde"), joint = FALSE, return_only_joint = FALSE, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", font.size = 14, font.type = "sans", legend.position = "bottom", plot_cell_borders = TRUE, border.size = 2, border.color = "black", viridis.palette = "G", viridis.direction = 1, verbose = TRUE, na.value = "grey75", plot.axes = FALSE, number.breaks = 5, use_viridis = FALSE, sequential.palette = "YlGnBu", sequential.direction = 1, 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 |
|
features |
|
slot |
|
dims |
|
pt.size |
|
reduction |
|
combine |
|
method |
Kernel density estimation method:
|
joint |
|
return_only_joint |
|
plot.title , plot.subtitle , plot.caption
|
|
legend.type |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
font.size |
|
font.type |
|
legend.position |
|
plot_cell_borders |
|
border.size |
|
border.color |
|
viridis.palette |
|
viridis.direction |
|
verbose |
|
na.value |
|
plot.axes |
|
number.breaks |
|
use_viridis |
|
sequential.palette |
|
sequential.direction |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object containing a Nebulosa plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_NebulosaPlot", 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")) # Basic Nebulosa plot. p <- SCpubr::do_NebulosaPlot(sample = sample, features = "EPC1") # Compute joint density. p <- SCpubr::do_NebulosaPlot(sample = sample, features = c("EPC1", "TOX2"), joint = TRUE) } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_NebulosaPlot", 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")) # Basic Nebulosa plot. p <- SCpubr::do_NebulosaPlot(sample = sample, features = "EPC1") # Compute joint density. p <- SCpubr::do_NebulosaPlot(sample = sample, features = c("EPC1", "TOX2"), joint = TRUE) } 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()`.") }
This function generates a summary report of the installation status of SCpubr, which packages are still missing and which functions can or can not currently be used.
do_PackageReport(startup = FALSE, extended = FALSE)
do_PackageReport(startup = FALSE, extended = FALSE)
startup |
|
extended |
|
None
# Print a package report. SCpubr::do_PackageReport(startup = FALSE, extended = FALSE)
# Print a package report. SCpubr::do_PackageReport(startup = FALSE, extended = FALSE)
Plot Pathway Activities from decoupleR using Progeny prior knowledge.
do_PathwayActivityHeatmap( sample, activities, group.by = NULL, split.by = NULL, slot = "scale.data", statistic = "norm_wmean", pt.size = 1, border.size = 2, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, na.value = "grey75", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = TRUE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, flip = FALSE, return_object = FALSE, grid.color = "white", border.color = "black", 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" )
do_PathwayActivityHeatmap( sample, activities, group.by = NULL, split.by = NULL, slot = "scale.data", statistic = "norm_wmean", pt.size = 1, border.size = 2, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, na.value = "grey75", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = TRUE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, flip = FALSE, return_object = FALSE, grid.color = "white", border.color = "black", 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 |
|
activities |
|
group.by |
|
split.by |
|
slot |
|
statistic |
|
pt.size |
|
border.size |
|
values.show |
|
values.threshold |
|
values.size |
|
values.round |
|
na.value |
|
legend.position |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
enforce_symmetry |
|
min.cutoff , max.cutoff
|
|
number.breaks |
|
diverging.palette |
|
diverging.direction |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
flip |
|
return_object |
|
grid.color |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_PathwayActivityHeatmap", 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 your activities object. progeny_activities <- readRDS(system.file("extdata/progeny_activities_example.rds", package = "SCpubr")) # General heatmap. out <- SCpubr::do_PathwayActivityHeatmap(sample = sample, activities = progeny_activities) p <- out$heatmaps$average_scores 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_PathwayActivityHeatmap", 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 your activities object. progeny_activities <- readRDS(system.file("extdata/progeny_activities_example.rds", package = "SCpubr")) # General heatmap. out <- SCpubr::do_PathwayActivityHeatmap(sample = sample, activities = progeny_activities) p <- out$heatmaps$average_scores 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()`.") }
Compute a heatmap of enrichment of gene sets on the context of a dimensional reduction component.
do_RankedEnrichmentHeatmap( sample, input_gene_list, assay = NULL, slot = NULL, scale.enrichment = TRUE, dims = 1:2, subsample = 2500, reduction = NULL, group.by = NULL, colors.use = NULL, colorblind = FALSE, raster = FALSE, interpolate = FALSE, nbin = 24, ctrl = 100, flavor = "Seurat", main.heatmap.size = 0.95, enforce_symmetry = ifelse(isTRUE(scale.enrichment), TRUE, FALSE), use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, font.size = 14, font.type = "sans", na.value = "grey75", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", legend.position = "bottom", legend.nrow = NULL, legend.ncol = NULL, legend.byrow = FALSE, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, axis.text.x.angle = 45, border.color = "black", return_object = FALSE, verbose = FALSE, 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" )
do_RankedEnrichmentHeatmap( sample, input_gene_list, assay = NULL, slot = NULL, scale.enrichment = TRUE, dims = 1:2, subsample = 2500, reduction = NULL, group.by = NULL, colors.use = NULL, colorblind = FALSE, raster = FALSE, interpolate = FALSE, nbin = 24, ctrl = 100, flavor = "Seurat", main.heatmap.size = 0.95, enforce_symmetry = ifelse(isTRUE(scale.enrichment), TRUE, FALSE), use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, font.size = 14, font.type = "sans", na.value = "grey75", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", legend.position = "bottom", legend.nrow = NULL, legend.ncol = NULL, legend.byrow = FALSE, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, axis.text.x.angle = 45, border.color = "black", return_object = FALSE, verbose = FALSE, 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 |
|
assay |
|
slot |
|
scale.enrichment |
|
dims |
|
subsample |
|
reduction |
|
group.by |
|
colors.use |
|
colorblind |
|
raster |
|
interpolate |
|
nbin |
|
ctrl |
|
flavor |
|
main.heatmap.size |
|
enforce_symmetry |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
font.size |
|
font.type |
|
na.value |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
legend.position |
|
legend.nrow |
|
legend.ncol |
|
legend.byrow |
|
number.breaks |
|
diverging.palette |
|
diverging.direction |
|
axis.text.x.angle |
|
border.color |
|
return_object |
|
verbose |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A list of ggplot2 objects, one per dimensional reduction component, and a Seurat object if desired.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_RankedEnrichmentHeatmap", 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")) # Genes have to be unique. genes <- list("Gene set A" = rownames(sample)[1:5], "Gene set B" = rownames(sample)[6:10], "Gene set C" = rownames(sample)[11:15]) # This will query, for the provided components, the enrichment of the gene # sets for all cells and plot them in the context of the cells reordered by # the position alongside each dimensional reduction component. p <- SCpubr::do_RankedEnrichmentHeatmap(sample = sample, input_gene_list = genes, nbin = 1, ctrl = 5, flavor = "Seurat", subsample = NA, dims = 1:2, verbose = FALSE) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_RankedEnrichmentHeatmap", 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")) # Genes have to be unique. genes <- list("Gene set A" = rownames(sample)[1:5], "Gene set B" = rownames(sample)[6:10], "Gene set C" = rownames(sample)[11:15]) # This will query, for the provided components, the enrichment of the gene # sets for all cells and plot them in the context of the cells reordered by # the position alongside each dimensional reduction component. p <- SCpubr::do_RankedEnrichmentHeatmap(sample = sample, input_gene_list = genes, nbin = 1, ctrl = 5, flavor = "Seurat", subsample = NA, dims = 1:2, verbose = FALSE) 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()`.") }
Compute a heatmap of expression of genes on the context of a dimensional reduction component.
do_RankedExpressionHeatmap( sample, features, assay = NULL, slot = NULL, dims = 1:2, subsample = 2500, reduction = NULL, group.by = NULL, colors.use = NULL, colorblind = FALSE, raster = FALSE, interpolate = FALSE, nbin = 24, ctrl = 100, main.heatmap.size = 0.95, enforce_symmetry = TRUE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, font.size = 14, font.type = "sans", na.value = "grey75", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", legend.position = "bottom", legend.nrow = NULL, legend.ncol = NULL, legend.byrow = FALSE, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, axis.text.x.angle = 45, border.color = "black", return_object = FALSE, verbose = FALSE, 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" )
do_RankedExpressionHeatmap( sample, features, assay = NULL, slot = NULL, dims = 1:2, subsample = 2500, reduction = NULL, group.by = NULL, colors.use = NULL, colorblind = FALSE, raster = FALSE, interpolate = FALSE, nbin = 24, ctrl = 100, main.heatmap.size = 0.95, enforce_symmetry = TRUE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, font.size = 14, font.type = "sans", na.value = "grey75", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", legend.position = "bottom", legend.nrow = NULL, legend.ncol = NULL, legend.byrow = FALSE, number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, axis.text.x.angle = 45, border.color = "black", return_object = FALSE, verbose = FALSE, 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 |
|
features |
|
assay |
|
slot |
|
dims |
|
subsample |
|
reduction |
|
group.by |
|
colors.use |
|
colorblind |
|
raster |
|
interpolate |
|
nbin |
|
ctrl |
|
main.heatmap.size |
|
enforce_symmetry |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
font.size |
|
font.type |
|
na.value |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
legend.position |
|
legend.nrow |
|
legend.ncol |
|
legend.byrow |
|
number.breaks |
|
diverging.palette |
|
diverging.direction |
|
axis.text.x.angle |
|
border.color |
|
return_object |
|
verbose |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A list of ggplot2 objects, one per dimensional reduction component, and a Seurat object if desired.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_RankedExpressionHeatmap", 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")) # Genes have to be unique. genes <- rownames(sample)[1:15] # This will query, for the provided components, the expression of the genes # for all cells and plot them in the context of the cells reordered by # the position alongside each dimensional reduction component. p <- SCpubr::do_RankedExpressionHeatmap(sample = sample, features = genes, nbin = 1, ctrl = 5, subsample = NA, dims = 1:2, verbose = FALSE) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_RankedExpressionHeatmap", 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")) # Genes have to be unique. genes <- rownames(sample)[1:15] # This will query, for the provided components, the expression of the genes # for all cells and plot them in the context of the cells reordered by # the position alongside each dimensional reduction component. p <- SCpubr::do_RankedExpressionHeatmap(sample = sample, features = genes, nbin = 1, ctrl = 5, subsample = NA, dims = 1:2, verbose = FALSE) 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()`.") }
This function computes ridge plots based on the ggridges package.
do_RidgePlot( sample, feature, group.by = NULL, split.by = NULL, assay = "SCT", slot = "data", continuous_scale = FALSE, legend.title = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", colors.use = NULL, colorblind = FALSE, font.size = 14, font.type = "sans", axis.text.x.angle = 45, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, compute_quantiles = FALSE, compute_custom_quantiles = FALSE, quantiles = c(0.25, 0.5, 0.75), compute_distribution_tails = FALSE, prob_tails = 0.025, color_by_probabilities = FALSE, use_viridis = TRUE, viridis.palette = "G", viridis.direction = 1, sequential.palette = "YlGnBu", sequential.direction = 1, plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", flip = FALSE, 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" )
do_RidgePlot( sample, feature, group.by = NULL, split.by = NULL, assay = "SCT", slot = "data", continuous_scale = FALSE, legend.title = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", colors.use = NULL, colorblind = FALSE, font.size = 14, font.type = "sans", axis.text.x.angle = 45, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = NULL, ylab = NULL, compute_quantiles = FALSE, compute_custom_quantiles = FALSE, quantiles = c(0.25, 0.5, 0.75), compute_distribution_tails = FALSE, prob_tails = 0.025, color_by_probabilities = FALSE, use_viridis = TRUE, viridis.palette = "G", viridis.direction = 1, sequential.palette = "YlGnBu", sequential.direction = 1, plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", flip = FALSE, 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 |
|
feature |
|
group.by |
|
split.by |
|
assay |
|
slot |
|
continuous_scale |
|
legend.title |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
legend.position |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
colors.use |
|
colorblind |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
plot.title , plot.subtitle , plot.caption
|
|
xlab , ylab
|
|
compute_quantiles |
|
compute_custom_quantiles |
|
quantiles |
|
compute_distribution_tails |
|
prob_tails |
|
color_by_probabilities |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
plot.grid |
|
grid.color |
|
grid.type |
|
flip |
|
number.breaks |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_RidgePlot", 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")) # Compute the most basic ridge plot. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA") p # Use continuous color scale. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, viridis.direction = 1) p # Draw quantiles of the distribution. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, compute_quantiles = TRUE, compute_custom_quantiles = TRUE) p # Draw probability tails. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, compute_quantiles = TRUE, compute_distribution_tails = TRUE) p # Draw probability tails. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, compute_quantiles = TRUE, color_by_probabilities = TRUE) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_RidgePlot", 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")) # Compute the most basic ridge plot. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA") p # Use continuous color scale. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, viridis.direction = 1) p # Draw quantiles of the distribution. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, compute_quantiles = TRUE, compute_custom_quantiles = TRUE) p # Draw probability tails. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, compute_quantiles = TRUE, compute_distribution_tails = TRUE) p # Draw probability tails. p <- SCpubr::do_RidgePlot(sample = sample, feature = "nFeature_RNA", continuous_scale = TRUE, compute_quantiles = TRUE, color_by_probabilities = TRUE) 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()`.") }
Save a plot as png, pdf and svg.
do_SavePlot( plot, figure_path = NULL, create_path = TRUE, file_name = NULL, dpi = 300, output_format = "publication", width = 8, height = 8, limitsize = TRUE )
do_SavePlot( plot, figure_path = NULL, create_path = TRUE, file_name = NULL, dpi = 300, output_format = "publication", width = 8, height = 8, limitsize = TRUE )
plot |
Plot to save. |
figure_path |
|
create_path |
|
file_name |
|
dpi |
|
output_format |
|
width , height
|
|
Nothing.
## Not run: # Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_SavePlot", passive = TRUE) if (isTRUE(value)){ # Define your Seurat object. sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr")) # Generate a plot. p <- SCpubr::do_DimPlot(sample = sample) # Default parameters. SCpubr::do_SavePlot(plot = p) # Specifying the name and folder. SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure") # Specify to also create a new folder. SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure", create_path = TRUE) # Set dimensions for the figure. SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure", create_path = TRUE, width = 8, height = 8) # Set quality (dpi). SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure", create_path = TRUE, width = 8, height = 8, dpi = 300) } 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()`.") } ## End(Not run)
## Not run: # Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_SavePlot", passive = TRUE) if (isTRUE(value)){ # Define your Seurat object. sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr")) # Generate a plot. p <- SCpubr::do_DimPlot(sample = sample) # Default parameters. SCpubr::do_SavePlot(plot = p) # Specifying the name and folder. SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure") # Specify to also create a new folder. SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure", create_path = TRUE) # Set dimensions for the figure. SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure", create_path = TRUE, width = 8, height = 8) # Set quality (dpi). SCpubr::do_SavePlot(plot = p, figure_path = "/path/to/my/figures/", file_name = "my_figure", create_path = TRUE, width = 8, height = 8, dpi = 300) } 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()`.") } ## End(Not run)
This function is heavily inspired by DoHeatmap
.
do_SCEnrichmentHeatmap( sample, input_gene_list, assay = NULL, slot = NULL, group.by = NULL, features.order = NULL, metadata = NULL, metadata.colors = NULL, colorblind = FALSE, subsample = NA, cluster = TRUE, flavor = "Seurat", return_object = FALSE, ncores = 1, storeRanks = TRUE, interpolate = FALSE, nbin = 24, ctrl = 100, xlab = "Cells", ylab = "Gene set", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.position = "bottom", legend.title = NULL, legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", strip.text.color = "black", strip.text.angle = 0, strip.spacing = 10, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, main.heatmap.size = 0.95, enforce_symmetry = FALSE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, na.value = "grey75", diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, proportional.size = TRUE, verbose = FALSE, border.color = "black", 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" )
do_SCEnrichmentHeatmap( sample, input_gene_list, assay = NULL, slot = NULL, group.by = NULL, features.order = NULL, metadata = NULL, metadata.colors = NULL, colorblind = FALSE, subsample = NA, cluster = TRUE, flavor = "Seurat", return_object = FALSE, ncores = 1, storeRanks = TRUE, interpolate = FALSE, nbin = 24, ctrl = 100, xlab = "Cells", ylab = "Gene set", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.position = "bottom", legend.title = NULL, legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", strip.text.color = "black", strip.text.angle = 0, strip.spacing = 10, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, main.heatmap.size = 0.95, enforce_symmetry = FALSE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, na.value = "grey75", diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, proportional.size = TRUE, verbose = FALSE, border.color = "black", 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 |
|
assay |
|
slot |
|
group.by |
|
features.order |
|
metadata |
|
metadata.colors |
|
colorblind |
|
subsample |
|
cluster |
|
flavor |
|
return_object |
|
ncores |
|
storeRanks |
|
interpolate |
|
nbin |
|
ctrl |
|
xlab , ylab
|
|
font.size |
|
font.type |
|
plot.title , plot.subtitle , plot.caption
|
|
legend.position |
|
legend.title |
|
legend.type |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
strip.text.color |
|
strip.text.angle |
|
strip.spacing |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
min.cutoff , max.cutoff
|
|
number.breaks |
|
main.heatmap.size |
|
enforce_symmetry |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
na.value |
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
proportional.size |
|
verbose |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_SCEnrichmentHeatmap", 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")) # Genes have to be unique. genes <- list("A" = rownames(sample)[1:5], "B" = rownames(sample)[6:10], "C" = rownames(sample)[11:15]) p <- SCpubr::do_SCEnrichmentHeatmap(sample = sample, input_gene_list = genes, nbin = 1, ctrl = 5, flavor = "Seurat", subsample = NA) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_SCEnrichmentHeatmap", 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")) # Genes have to be unique. genes <- list("A" = rownames(sample)[1:5], "B" = rownames(sample)[6:10], "C" = rownames(sample)[11:15]) p <- SCpubr::do_SCEnrichmentHeatmap(sample = sample, input_gene_list = genes, nbin = 1, ctrl = 5, flavor = "Seurat", subsample = NA) 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()`.") }
This function is heavily inspired by DoHeatmap
.
do_SCExpressionHeatmap( sample, features, assay = NULL, slot = NULL, group.by = NULL, features.order = NULL, metadata = NULL, metadata.colors = NULL, colorblind = FALSE, subsample = NA, cluster = TRUE, interpolate = FALSE, xlab = "Cells", ylab = "Genes", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.position = "bottom", legend.title = "Expression", legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", strip.text.color = "black", strip.text.angle = 0, strip.spacing = 10, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, main.heatmap.size = 0.95, enforce_symmetry = FALSE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, na.value = "grey75", diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, proportional.size = TRUE, verbose = TRUE, border.color = "black", 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" )
do_SCExpressionHeatmap( sample, features, assay = NULL, slot = NULL, group.by = NULL, features.order = NULL, metadata = NULL, metadata.colors = NULL, colorblind = FALSE, subsample = NA, cluster = TRUE, interpolate = FALSE, xlab = "Cells", ylab = "Genes", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.position = "bottom", legend.title = "Expression", legend.type = "colorbar", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", strip.text.color = "black", strip.text.angle = 0, strip.spacing = 10, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, main.heatmap.size = 0.95, enforce_symmetry = FALSE, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, na.value = "grey75", diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, proportional.size = TRUE, verbose = TRUE, border.color = "black", 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 |
|
features |
|
assay |
|
slot |
|
group.by |
|
features.order |
|
metadata |
|
metadata.colors |
|
colorblind |
|
subsample |
|
cluster |
|
interpolate |
|
xlab , ylab
|
|
font.size |
|
font.type |
|
plot.title , plot.subtitle , plot.caption
|
|
legend.position |
|
legend.title |
|
legend.type |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
strip.text.color |
|
strip.text.angle |
|
strip.spacing |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
min.cutoff , max.cutoff
|
|
number.breaks |
|
main.heatmap.size |
|
enforce_symmetry |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
na.value |
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
proportional.size |
|
verbose |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_SCExpressionHeatmap", 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")) p <- SCpubr::do_SCExpressionHeatmap(sample = sample, features = rownames(sample)[1:2], subsample = NA) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_SCExpressionHeatmap", 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")) p <- SCpubr::do_SCExpressionHeatmap(sample = sample, features = rownames(sample)[1:2], subsample = NA) 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()`.") }
A strip plot is a scatter plot in which we plot continuous values on the Y axis grouped by a categorical value in the X. This is plotted as a dot plot, jittered so that the dots span all the way to the other groups. On top of this, the mean and .66 and .95 of the data is plotted, depicting the overall distribution of the dots. The cells can, then, be colored by a continuous variable (same as Y axis or different) or a categorical one (same as X axis or different).
do_StripPlot( sample, features, assay = NULL, slot = "data", group.by = NULL, split.by = NULL, enforce_symmetry = FALSE, scale_type = "continuous", order = TRUE, plot_cell_borders = TRUE, jitter = 0.45, pt.size = 1, border.size = 2, border.color = "black", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, viridis.palette = "G", viridis.direction = 1, colors.use = NULL, colorblind = FALSE, na.value = "grey75", legend.ncol = NULL, legend.nrow = NULL, legend.icon.size = 4, legend.byrow = FALSE, legend.title = NULL, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = "Groups", ylab = feature, flip = FALSE, min.cutoff = rep(NA, length(features)), max.cutoff = rep(NA, length(features)), number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, use_viridis = FALSE, 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" )
do_StripPlot( sample, features, assay = NULL, slot = "data", group.by = NULL, split.by = NULL, enforce_symmetry = FALSE, scale_type = "continuous", order = TRUE, plot_cell_borders = TRUE, jitter = 0.45, pt.size = 1, border.size = 2, border.color = "black", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, viridis.palette = "G", viridis.direction = 1, colors.use = NULL, colorblind = FALSE, na.value = "grey75", legend.ncol = NULL, legend.nrow = NULL, legend.icon.size = 4, legend.byrow = FALSE, legend.title = NULL, plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = "Groups", ylab = feature, flip = FALSE, min.cutoff = rep(NA, length(features)), max.cutoff = rep(NA, length(features)), number.breaks = 5, diverging.palette = "RdBu", diverging.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, use_viridis = FALSE, 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 |
|
features |
|
assay |
|
slot |
|
group.by |
|
split.by |
|
enforce_symmetry |
|
scale_type |
|
order |
|
plot_cell_borders |
|
jitter |
|
pt.size |
|
border.size |
|
border.color |
|
legend.position |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
viridis.palette |
|
viridis.direction |
|
colors.use |
|
colorblind |
|
na.value |
|
legend.ncol |
|
legend.nrow |
|
legend.icon.size |
|
legend.byrow |
|
legend.title |
|
plot.title , plot.subtitle , plot.caption
|
|
xlab , ylab
|
|
flip |
|
min.cutoff , max.cutoff
|
|
number.breaks |
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
use_viridis |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
Either a plot of a list of plots, depending on the number of features provided.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_StripPlot", 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")) # Geyser plot with categorical color scale. p <- SCpubr::do_StripPlot(sample = sample, features = "nCount_RNA", scale_type = "categorical") p # Geyser plot with continuous color scale. p <- SCpubr::do_StripPlot(sample = sample, features = "nCount_RNA", scale_type = "continuous") 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_StripPlot", 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")) # Geyser plot with categorical color scale. p <- SCpubr::do_StripPlot(sample = sample, features = "nCount_RNA", scale_type = "categorical") p # Geyser plot with continuous color scale. p <- SCpubr::do_StripPlot(sample = sample, features = "nCount_RNA", scale_type = "continuous") 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()`.") }
Display the enriched terms for a given list of genes.
do_TermEnrichmentPlot( mat, n.chars = 40, n.terms = 25, font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, dot.scale = 8, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", number.breaks = 5, xlab = NULL, ylab = NULL, na.value = "grey75", grid.color = "grey90", grid.type = "dashed", plot.title.face = "bold", plot.subtitle.face = "plain", plot.caption.face = "italic", axis.title.face = "bold", axis.text.face = "plain", axis.text.x.angle = 45, legend.title.face = "bold", legend.text.face = "plain" )
do_TermEnrichmentPlot( mat, n.chars = 40, n.terms = 25, font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, dot.scale = 8, legend.type = "colorbar", legend.position = "bottom", legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.length = 20, legend.width = 1, legend.framecolor = "grey50", legend.tickcolor = "white", number.breaks = 5, xlab = NULL, ylab = NULL, na.value = "grey75", grid.color = "grey90", grid.type = "dashed", plot.title.face = "bold", plot.subtitle.face = "plain", plot.caption.face = "italic", axis.title.face = "bold", axis.text.face = "plain", axis.text.x.angle = 45, legend.title.face = "bold", legend.text.face = "plain" )
mat |
|
n.chars |
|
n.terms |
|
font.size |
|
font.type |
|
plot.title , plot.subtitle , plot.caption
|
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
dot.scale |
|
legend.type |
|
legend.position |
|
legend.framewidth , legend.tickwidth
|
|
legend.length , legend.width
|
|
legend.framecolor |
|
legend.tickcolor |
|
number.breaks |
|
xlab , ylab
|
|
na.value |
|
grid.color |
|
grid.type |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
axis.text.x.angle |
|
A dotplot object with enriched terms.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_TermEnrichmentPlot", passive = TRUE) if (isTRUE(value)){ # Consult the full documentation in https://enblacar.github.io/SCpubr-book/ # Define your enriched terms. enriched_terms <- readRDS(system.file("extdata/enriched_terms_example.rds", package = "SCpubr")) # Default plot. p <- SCpubr::do_TermEnrichmentPlot(mat = enriched_terms) } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_TermEnrichmentPlot", passive = TRUE) if (isTRUE(value)){ # Consult the full documentation in https://enblacar.github.io/SCpubr-book/ # Define your enriched terms. enriched_terms <- readRDS(system.file("extdata/enriched_terms_example.rds", package = "SCpubr")) # Default plot. p <- SCpubr::do_TermEnrichmentPlot(mat = enriched_terms) } 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()`.") }
Plot TF Activities from decoupleR using Dorothea prior knowledge.
do_TFActivityHeatmap( sample, activities, n_tfs = 25, slot = "scale.data", statistic = "norm_wmean", tfs.use = NULL, group.by = NULL, split.by = NULL, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, na.value = "grey75", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = TRUE, diverging.palette = "RdBu", diverging.direction = -1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, flip = FALSE, return_object = FALSE, grid.color = "white", border.color = "black", 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" )
do_TFActivityHeatmap( sample, activities, n_tfs = 25, slot = "scale.data", statistic = "norm_wmean", tfs.use = NULL, group.by = NULL, split.by = NULL, values.show = FALSE, values.threshold = NULL, values.size = 3, values.round = 1, na.value = "grey75", legend.position = "bottom", legend.width = 1, legend.length = 20, legend.framewidth = 0.5, legend.tickwidth = 0.5, legend.framecolor = "grey50", legend.tickcolor = "white", legend.type = "colorbar", font.size = 14, font.type = "sans", axis.text.x.angle = 45, enforce_symmetry = TRUE, diverging.palette = "RdBu", diverging.direction = -1, use_viridis = FALSE, viridis.palette = "G", viridis.direction = -1, sequential.palette = "YlGnBu", sequential.direction = 1, min.cutoff = NA, max.cutoff = NA, number.breaks = 5, flip = FALSE, return_object = FALSE, grid.color = "white", border.color = "black", 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 |
|
activities |
|
n_tfs |
|
slot |
|
statistic |
|
tfs.use |
|
group.by |
|
split.by |
|
values.show |
|
values.threshold |
|
values.size |
|
values.round |
|
na.value |
|
legend.position |
|
legend.length , legend.width
|
|
legend.framewidth , legend.tickwidth
|
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
enforce_symmetry |
|
diverging.palette |
|
diverging.direction |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
min.cutoff , max.cutoff
|
|
number.breaks |
|
flip |
|
return_object |
|
grid.color |
|
border.color |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_TFActivityHeatmap", 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 your activities object. dorothea_activities <- readRDS(system.file("extdata/dorothea_activities_example.rds", package = "SCpubr")) # General heatmap. out <- SCpubr::do_TFActivityHeatmap(sample = sample, activities = dorothea_activities) p <- out$heatmaps$average_scores 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_TFActivityHeatmap", 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 your activities object. dorothea_activities <- readRDS(system.file("extdata/dorothea_activities_example.rds", package = "SCpubr")) # General heatmap. out <- SCpubr::do_TFActivityHeatmap(sample = sample, activities = dorothea_activities) p <- out$heatmaps$average_scores 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()`.") }
Wrapper for VlnPlot.
do_ViolinPlot( sample, features, assay = NULL, slot = NULL, group.by = NULL, split.by = NULL, colors.use = NULL, colorblind = FALSE, pt.size = 0, line_width = 0.5, y_cut = rep(NA, length(features)), plot_boxplot = TRUE, boxplot_width = 0.2, legend.position = "bottom", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = rep(NA, length(features)), ylab = rep(NA, length(features)), font.size = 14, font.type = "sans", axis.text.x.angle = 45, plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", order = TRUE, flip = FALSE, ncol = NULL, share.y.lims = FALSE, legend.title = NULL, legend.title.position = "top", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, 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" )
do_ViolinPlot( sample, features, assay = NULL, slot = NULL, group.by = NULL, split.by = NULL, colors.use = NULL, colorblind = FALSE, pt.size = 0, line_width = 0.5, y_cut = rep(NA, length(features)), plot_boxplot = TRUE, boxplot_width = 0.2, legend.position = "bottom", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, xlab = rep(NA, length(features)), ylab = rep(NA, length(features)), font.size = 14, font.type = "sans", axis.text.x.angle = 45, plot.grid = TRUE, grid.color = "grey75", grid.type = "dashed", order = TRUE, flip = FALSE, ncol = NULL, share.y.lims = FALSE, legend.title = NULL, legend.title.position = "top", legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, 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 |
|
features |
|
assay |
|
slot |
|
group.by |
|
split.by |
|
colors.use |
|
colorblind |
|
pt.size |
|
line_width |
|
y_cut |
|
plot_boxplot |
|
boxplot_width |
|
legend.position |
|
plot.title , plot.subtitle , plot.caption
|
|
xlab , ylab
|
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
plot.grid |
|
grid.color |
|
grid.type |
|
order |
|
flip |
|
ncol |
|
share.y.lims |
|
legend.title |
|
legend.title.position |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A ggplot2 object containing a Violin Plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ViolinPlot", 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")) # Basic violin plot. p <- SCpubr::do_ViolinPlot(sample = sample, feature = "nCount_RNA") p # Remove the box plots. p <- SCpubr::do_ViolinPlot(sample = sample, feature = "nCount_RNA", plot_boxplot = FALSE) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_ViolinPlot", 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")) # Basic violin plot. p <- SCpubr::do_ViolinPlot(sample = sample, feature = "nCount_RNA") p # Remove the box plots. p <- SCpubr::do_ViolinPlot(sample = sample, feature = "nCount_RNA", plot_boxplot = FALSE) 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()`.") }
Compute a Volcano plot out of DE genes.
do_VolcanoPlot( sample, de_genes, pval_cutoff = 0.05, FC_cutoff = 2, pt.size = 1, border.size = 1.5, border.color = "black", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, plot_lines = TRUE, line_color = "grey75", line_size = 0.5, add_gene_tags = TRUE, add_tag_side = "both", order_tags_by = "both", tag_size = 6, n_genes = 5, use_labels = FALSE, colors.use = NULL, 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" )
do_VolcanoPlot( sample, de_genes, pval_cutoff = 0.05, FC_cutoff = 2, pt.size = 1, border.size = 1.5, border.color = "black", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, plot_lines = TRUE, line_color = "grey75", line_size = 0.5, add_gene_tags = TRUE, add_tag_side = "both", order_tags_by = "both", tag_size = 6, n_genes = 5, use_labels = FALSE, colors.use = NULL, 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 |
|
de_genes |
|
pval_cutoff |
|
FC_cutoff |
|
pt.size |
|
border.size |
|
border.color |
|
font.size |
|
font.type |
|
plot.title , plot.subtitle , plot.caption
|
|
plot_lines |
|
line_color |
|
line_size |
|
add_gene_tags |
|
add_tag_side |
|
order_tags_by |
|
tag_size |
|
n_genes |
|
use_labels |
|
colors.use |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
A volcano plot as a ggplot2 object.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_VolcanoPlot", 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")) # Retrieve DE genes. de_genes <- readRDS(system.file("extdata/de_genes_example.rds", package = "SCpubr")) # Generate a volcano plot. p <- SCpubr::do_VolcanoPlot(sample = sample, de_genes = de_genes) 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_VolcanoPlot", 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")) # Retrieve DE genes. de_genes <- readRDS(system.file("extdata/de_genes_example.rds", package = "SCpubr")) # Generate a volcano plot. p <- SCpubr::do_VolcanoPlot(sample = sample, de_genes = de_genes) 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()`.") }
Display the enriched terms for a given list of genes.
do_WafflePlot( sample, group.by, waffle.size = 2, flip = TRUE, colors.use = NULL, colorblind = FALSE, na.value = "grey75", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.title = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, legend.position = "bottom", 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", strip.text.face = "bold" )
do_WafflePlot( sample, group.by, waffle.size = 2, flip = TRUE, colors.use = NULL, colorblind = FALSE, na.value = "grey75", font.size = 14, font.type = "sans", plot.title = NULL, plot.subtitle = NULL, plot.caption = NULL, legend.title = NULL, legend.ncol = NULL, legend.nrow = NULL, legend.byrow = FALSE, legend.position = "bottom", 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", strip.text.face = "bold" )
sample |
|
group.by |
|
waffle.size |
|
flip |
|
colors.use |
|
colorblind |
|
na.value |
|
font.size |
|
font.type |
|
plot.title , plot.subtitle , plot.caption
|
|
legend.title |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
legend.position |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face
|
|
strip.text.face |
|
A ggplot2 object with a Waffle Plot.
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_WafflePlot", 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")) # Basic Waffle plot. p <- SCpubr::do_WafflePlot(sample = sample, group.by = "seurat_clusters") } 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()`.") }
# Check Suggests. value <- SCpubr:::check_suggests(function_name = "do_WafflePlot", 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")) # Basic Waffle plot. p <- SCpubr::do_WafflePlot(sample = sample, group.by = "seurat_clusters") } 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()`.") }
A tibble containing the chromosome, arm and start and end coordinates.
data(human_chr_locations)
data(human_chr_locations)
A tibble with 48 rows and 4 columns:
Chromosome.
Chromosome arm.
Start coordinates.
End coordinates.