dominoSignal provides several functions for visualizing analysis results. Here, we go over the available plotting functions, their options, and ways to customize them.
In this tutorial, we will use the domino() object we
built on the Getting
Started page. If you have not yet built a domino()
object, you can do so by following the instructions on that page.
cor_heatmap() can be used to show the correlations
calculated between receptors and transcription factors (TFs).
In addition to displaying the scores for the correlations, this
function can also be used to identify correlations above a certain value
(using the bool and bool_thresh arguments) or
to identify the combinations of receptors and TFs that are connected
(with argument mark_connections).
cor_heatmap(dom, bool = TRUE, bool_thresh = 0.25)
cor_heatmap(dom, bool = FALSE, mark_connections = TRUE)If only a subset of receptors or TFs are of interest, a vector of either (or both) can be passed to the function.
receptors <- c("CSF1R", "CSF3R", "CCR7", "FCER2")
tfs <- c("PAX5", "JUNB", "FOXJ3", "FOSB")
cor_heatmap(dom, feats = tfs, recs = receptors)The heatmap functions in dominoSignal are based on
ComplexHeatmap::Heatmap() and will also accept additional
arguments meant for that function. For example, while an argument for
clustering rows or columns of the heatmap is not explicitly stated, they
can still be passed to ComplexHeatmap::Heatmap() through
cor_heatmap(). To set column_title directly,
set title = FALSE.
cor_heatmap(dom, title = FALSE, cluster_rows = FALSE, cluster_columns = FALSE, column_title = "Heatmap Without Clustering",
column_names_gp = grid::gpar(fontsize = 4))feat_heatmap() is used to show the activity of the TFs
in the signaling network.
It functions similarly to cor_heatmap(), with arguments
to select a specific vector of features, to use a boolean view with a
threshold, and to pass other arguments to
ComplexHeatmap::Heatmap(). Specific to this function are
arguments for setting the range of values to be visualized and an
argument to choose to normalize the scores to the max value.
feat_heatmap(dom, min_thresh = 0.1, max_thresh = 0.6, norm = TRUE, bool = FALSE,
use_raster = FALSE)
feat_heatmap(dom, bool = TRUE, use_raster = FALSE)incoming_signaling_heatmap() can be used to visualize
the mean expression, by sending cluster, of the ligands capable of
activating the TFs enriched in the cluster. For example, to view the
incoming signaling of the CD8 T cells:
We can also select for specific clusters of interest that are signaling to the CD8 T cells. If we are only interested in viewing the monocyte signaling:
As with our other heatmap functions, options are available for a
minimum threshold, maximum threshold, whether to scale the values after
thresholding, whether to normalize the matrix, and the ability to pass
further arguments to ComplexHeatmap::Heatmap().
signaling_heatmap() makes a heatmap showing the
signaling strength of ligands from each cluster to receptors of each
cluster based on mean expression.
As with other functions, specific clusters can be selected, thresholds can be set, and normalization methods can be selected as well.
gene_network() makes a network plot to display signaling
in selected clusters such that ligands, receptors and features
associated with those clusters are displayed as nodes with edges as
linkages. To look at signaling to the CD16 Monocytes from the CD14
Monocytes:
Options to modify this plot include adjusting scaling for the ligands and different layouts (some of which are more legible than others).
gene_network(dom, clust = "CD16_monocyte", OutgoingSignalingClust = "CD14_monocyte",
lig_scale = 25, layout = "sphere")Additionally, colors can be given for select genes (for example, to highlight a specific signaling path).
gene_network(dom, clust = "CD16_monocyte", OutgoingSignalingClust = "CD14_monocyte",
cols = c(CD1D = "violet", LILRB2 = "violet", FOSB = "violet"), lig_scale = 10)signaling_network() can be used to create a network plot
such that nodes are clusters and the edges indicate signaling from one
cluster to another.
In addition to changes such as scaling, thresholds, or layouts, this plot can be modified by selecting incoming or outgoing clusters (or both!). An example to view signaling from the CD14 Monocytes to other clusters:
signaling_network(dom, showOutgoingSignalingClusts = "CD14_monocyte", scale = "none",
normalize = "none", layout = "fr", scale_by = "none", edge_weight = 2, vert_scale = 10)As the edges in these plots do not show arrows to represent
directionality, the showOutgoingSignalingClusts and
showIncomingSignalingClusts arguments can be used to
specify which clusters are sending or receiving signaling to resolve any
ambiguity.
circos_ligand_receptor() creates a chord plot showing
ligands that can activate a specific receptor, displaying mean cluster
expression of the ligand with the width of the chord.
This function can be given cluster colors to match other plots you may make with your data. In addition, the plot can be adjusted by changing the threshold of ligand expression required for a linkage to be visualized or selecting clusters of interest.
cols <- c("red", "orange", "green", "blue", "pink", "purple", "slategrey", "firebrick",
"hotpink")
names(cols) <- dom_clusters(dom, labels = FALSE)
circos_ligand_receptor(dom, receptor = "CD74", cell_colors = cols)cor_scatter() can be used to plot each cell based on
activation of the selected TF and expression of the receptor. This
produces a scatter plot as well as a line of best fit to look at
receptor-TF correlation.
Do keep in mind that there is an argument for
remove_rec_dropout that should match the parameter that was
used when the domino() object was created. By default, the
function checks to see if the parameter was used when the
domino() object was created and will use that setting for
the plot (for older objects that may not store those parameters, it will
default to FALSE). If you want to override that setting, you can do so
by specifying the argument in the function call.