Visualises the spatial interaction matrix as a heatmap. Infinite scores are
displayed at colour scale endpoints with an explanatory caption; the raw
scores are preserved.
Usage
plot_interactions(interactions, title = NULL)
Arguments
- interactions
A data.table as returned by interaction_matrix().
- title
Character string or NULL. Plot title.
Examples
interactions <- data.table::data.table(
from = rep(c("CD3+", "CD8+"), each = 2),
to = rep(c("CD3+", "CD8+"), 2),
observed = c(50, 30, 25, 40),
expected = c(35, 35, 35, 35),
interaction_score = log2(c(50, 30, 25, 40) / 35)
)
plot_interactions(interactions)