View source: R/do_MetadataPlot.R
do_MetadataPlot | R Documentation |
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_MetadataPlot(
sample = NULL,
group.by = NULL,
metadata = NULL,
from_df = FALSE,
df = NULL,
colors.use = NULL,
cluster = TRUE,
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 |
|
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_MetadataPlot", 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_MetadataPlot(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()`.")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.