View source: R/Seurat.Utils.Visualization.R
plotAndSaveHeatmaps | R Documentation |
Generates and saves heatmap visualizations for each metric in the results obtained from metadata calculations, such as 'calculateAverageMetaData() - mean or median values of specified features across different categories.
plotAndSaveHeatmaps(
results,
path = getwd(),
file.prefix = "heatmap_",
scale = "column",
cluster_rows = FALSE,
display_numbers = TRUE,
show_rownames = TRUE,
show_colnames = TRUE,
rowname_column = 1,
...
)
results |
A list containing data frames with calculated metrics for each specified
metadata feature, grouped by categories. Typically, this is the output from a
function like |
path |
The directory path where the heatmap images will be saved.
Defaults to the current working directory ( |
file.prefix |
A prefix for the filenames of the saved heatmap images. Defaults to "heatmap_". |
scale |
Character indicating if the values should be scaled in the row direction, column direction, both ('row', 'column', 'none'). Defaults to "column". |
cluster_rows |
Logical indicating whether to cluster rows. Defaults to FALSE. |
show_rownames |
Logical indicating whether to show row names. Defaults to TRUE. |
show_colnames |
Logical indicating whether to show column names. Defaults to TRUE. |
... |
Additional arguments passed to |
This function loops through each metric in the results
, creates a heatmap
for it using pheatmap
, and saves the heatmap as a PNG file in the specified path.
The file names will start with the provided file.prefix
, followed by the metric name.
Invisible. The function primarily generates and saves files without returning data.
# Assuming `results` is the output from `calculateAverageMetaData`:
results <- calculateAverageMetaData(obj = combined.obj)
plotAndSaveHeatmaps(results, path = "path/to/save/heatmaps", file.prefix = "myData_")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.