plot_SpaCCI_heatmap {SpaCCI} | R Documentation |
Plot SpaCCI Results on the heatmap Visualize inferred significant cell-cell interactions using a heatmap
plot_SpaCCI_heatmap(
SpaCCI_Result_List,
specific_celltypes = NULL,
pathways = NULL,
interaction = NULL,
log1p_transform = FALSE,
show_rownames = TRUE,
show_colnames = TRUE,
scale = "none",
cluster_cols = TRUE,
cluster_rows = TRUE,
border_color = "white",
fontsize_row = 11,
fontsize_col = 11,
family = "Arial",
main = "",
treeheight_col = 0,
treeheight_row = 0,
low_col = "dodgerblue4",
mid_col = "peachpuff",
high_col = "deeppink4",
alpha = 0.05,
return_tables = FALSE,
symmetrical = FALSE,
...
)
SpaCCI_Result_List |
A list containing the results from a SpaCCI |
specific_celltypes |
A vector of cell types to include in the heatmap, i.e c("Celltype_A","Celltype_B"). NOTE: the cell type names should match the names input in the SpaCCI analysis. |
pathways |
A vector of pathways to filter the interactions. Initially set to |
interaction |
A vector of interactions to filter. Initially set to |
log1p_transform |
Logical; whether to apply a log(1 + x) transformation to the count matrix. |
show_rownames |
Logical; whether to show row names in the heatmap. |
show_colnames |
Logical; whether to show column names in the heatmap. |
scale |
Character; whether to scale the data ("row", "column", "none"). |
cluster_cols |
Logical; whether to cluster columns. |
cluster_rows |
Logical; whether to cluster rows. |
border_color |
Character; color of the heatmap borders. |
fontsize_row |
Numeric; font size for row names. |
fontsize_col |
Numeric; font size for column names. |
family |
Character; font family for text in the heatmap. |
main |
Character; title of the heatmap. |
treeheight_col |
Numeric; height of the column dendrogram. |
treeheight_row |
Numeric; height of the row dendrogram. |
low_col |
Character; color for low values in the heatmap. |
mid_col |
Character; color for mid values in the heatmap. |
high_col |
Character; color for high values in the heatmap. |
alpha |
Numeric; significance threshold for p-values, initailly set to |
return_tables |
Logical; whether to return the count matrix and summary tables. |
symmetrical |
Logical; whether to make the heatmap symmetrical. |
... |
Additional arguments passed to 'pheatmap'. |
If 'return_tables' is FALSE
(default), the function returns a heatmap object created by pheatmap
, showing the count of significant cell-cell interactions. If 'return_tables' is TRUE
, the function returns a list containing:
The heatmap object showing the significant cell-cell interactions.
The matrix used to generate the heatmap, with cell types as rows and columns, and counts of significant interactions as values.
A data frame summarizing the counts of significant interactions between each ligand and receptor cell type combination.
library(SpaCCI)
library(dplyr)
library(reshape2)
library(grDevices)
library(pheatmap)
data(result_global)
celltypes <- c("beta" , "delta" , "ductal","macrophage",
"activated_stellate", "quiescent_stellate")
plot_SpaCCI_heatmap(SpaCCI_Result_List = result_global,
symmetrical = FALSE, cluster_cols = FALSE, return_tables = FALSE,
cluster_rows = FALSE, #cellheight = 10, cellwidth = 10,
specific_celltypes = c(celltypes),
main= "Cell-Cell Interaction Count")