Skip to contents

In addition to the numerous plotting options available in the original Domino, domino2 has added more functionality and new methods to improve visualization and interpretation of analysis results. Here, we will go over the different plotting functions available, as well as different options that can be utilized, and options for customization. We will be using the domino object (loaded as dom) from our example analysis in Getting Started.

Heatmaps

Correlations between receptors and transcription factors

cor_heatmap() can be used to show the correlations calculated between receptors and transcription factors.

cor_heatmap(dom, title = "PBMC R-TF Correlations", column_names_gp = grid::gpar(fontsize = 8))

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 transcription factors (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 transcription factors 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 domino2 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().

cor_heatmap(dom, cluster_rows = FALSE, cluster_columns = FALSE, column_title = "Heatmap Without Clustering",
    column_names_gp = grid::gpar(fontsize = 4))

Heatmap of Transcription Factor Activation Scores

feat_heatmap() is used to show the transcription factor activation for features in the signaling network.

feat_heatmap(dom, use_raster = FALSE, row_names_gp = grid::gpar(fontsize = 4))

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 though are arguments for setting the range of values to be visualized and one to choose whether or not 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)

Heatmap of Incoming Signaling for a Cluster

incoming_signaling_heatmap() can be used to visualize the cluster average expression of the ligands capable of activating the TFs enriched in the cluster. For example, to view the incoming signaling of the CD8 T cells:

incoming_signaling_heatmap(dom, "CD8_T_cell")

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:

incoming_signaling_heatmap(dom, "CD8_T_cell", clusts = c("CD14_monocyte", "CD16_monocyte"))

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().

Heatmap of Signaling Between Clusters

signaling_heatmap() makes a heatmap showing the signaling strength of ligands from each cluster to receptors of each cluster based on averaged expression.

As with other functions, specific clusters can be selected, thresholds can be set, and normalization methods can be selected as well.

signaling_heatmap(dom, scale = "sqrt")
signaling_heatmap(dom, normalize = "rec_norm")

Network Plots

Network showing L-R-TF signaling between clusters

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:

gene_network(dom, clust = "CD16_monocyte", OutgoingSignalingClust = "CD14_monocyte")

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)

Network Showing Interaction Strength Across Data

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 cluster:

signaling_network(dom, showOutgoingSignalingClusts = "CD14_monocyte", scale = "none",
    norm = "none", layout = "fr", scale_by = "none", edge_weight = 2, vert_scale = 10)

Other Types of Plot

Chord Diagrams Connecting Ligands and Receptors

A new addition to domino2, 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.

circos_ligand_receptor(dom, receptor = "CD74")

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)

Scatter Plot to Visualize Correlation

cor_scatter() can be used to plot each cell based on expression of the selected TF and receptor. This produces a scatter plot as well as a line of best fit to look at receptor-TF correlation.

cor_scatter(dom, "FOSB", "CD74")

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 built. In this case, we did not use that build parameter, so we will leave the value in this argument as its default value of FALSE.

Continued Development

Since domino2 is a package still being developed, there are new functions and features that will be implemented in future versions. In the meantime, to view an example analysis, see our Getting Started page, or see our domino object structure page to get familiar with the object structure. Additionally, if you find any bugs, have further questions, or want to share an idea, please let us know here.

Vignette Build Information

Date last built and session information:

Sys.Date()
#> [1] "2024-02-02"
sessionInfo()
#> R version 4.3.2 (2023-10-31)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 22.04.3 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
#> 
#> locale:
#>  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
#>  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
#>  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
#> [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
#> 
#> time zone: UTC
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] patchwork_1.2.0 domino2_0.99.1 
#> 
#> loaded via a namespace (and not attached):
#>   [1] DBI_1.2.1               bitops_1.0-7            formatR_1.14           
#>   [4] biomaRt_2.58.2          rlang_1.1.3             magrittr_2.0.3         
#>   [7] clue_0.3-65             GetoptLong_1.0.5        matrixStats_1.2.0      
#>  [10] compiler_4.3.2          RSQLite_2.3.5           mgcv_1.9-0             
#>  [13] png_0.1-8               systemfonts_1.0.5       vctrs_0.6.5            
#>  [16] stringr_1.5.1           pkgconfig_2.0.3         shape_1.4.6            
#>  [19] crayon_1.5.2            fastmap_1.1.1           backports_1.4.1        
#>  [22] dbplyr_2.4.0            XVector_0.42.0          labeling_0.4.3         
#>  [25] utf8_1.2.4              rmarkdown_2.25          ragg_1.2.7             
#>  [28] purrr_1.0.2             bit_4.0.5               xfun_0.41              
#>  [31] zlibbioc_1.48.0         cachem_1.0.8            GenomeInfoDb_1.38.5    
#>  [34] jsonlite_1.8.8          progress_1.2.3          blob_1.2.4             
#>  [37] highr_0.10              broom_1.0.5             parallel_4.3.2         
#>  [40] prettyunits_1.2.0       cluster_2.1.4           R6_2.5.1               
#>  [43] bslib_0.6.1             stringi_1.8.3           RColorBrewer_1.1-3     
#>  [46] car_3.1-2               jquerylib_0.1.4         Rcpp_1.0.12            
#>  [49] iterators_1.0.14        knitr_1.45              IRanges_2.36.0         
#>  [52] splines_4.3.2           igraph_2.0.1.1          Matrix_1.6-5           
#>  [55] tidyselect_1.2.0        abind_1.4-5             yaml_2.3.8             
#>  [58] doParallel_1.0.17       codetools_0.2-19        curl_5.2.0             
#>  [61] lattice_0.21-9          tibble_3.2.1            plyr_1.8.9             
#>  [64] withr_3.0.0             Biobase_2.62.0          KEGGREST_1.42.0        
#>  [67] evaluate_0.23           desc_1.4.3              BiocFileCache_2.10.1   
#>  [70] xml2_1.3.6              circlize_0.4.15         Biostrings_2.70.2      
#>  [73] pillar_1.9.0            ggpubr_0.6.0            filelock_1.0.3         
#>  [76] carData_3.0-5           foreach_1.5.2           stats4_4.3.2           
#>  [79] generics_0.1.3          RCurl_1.98-1.14         S4Vectors_0.40.2       
#>  [82] hms_1.1.3               ggplot2_3.4.4           munsell_0.5.0          
#>  [85] scales_1.3.0            glue_1.7.0              tools_4.3.2            
#>  [88] ggsignif_0.6.4          fs_1.6.3                XML_3.99-0.16.1        
#>  [91] grid_4.3.2              tidyr_1.3.1             AnnotationDbi_1.64.1   
#>  [94] colorspace_2.1-0        nlme_3.1-163            GenomeInfoDbData_1.2.11
#>  [97] cli_3.6.2               rappdirs_0.3.3          textshaping_0.3.7      
#> [100] fansi_1.0.6             ComplexHeatmap_2.18.0   dplyr_1.1.4            
#> [103] gtable_0.3.4            rstatix_0.7.2           sass_0.4.8             
#> [106] digest_0.6.34           BiocGenerics_0.48.1     farver_2.1.1           
#> [109] rjson_0.2.21            memoise_2.0.1           htmltools_0.5.7        
#> [112] pkgdown_2.0.7           lifecycle_1.0.4         httr_1.4.7             
#> [115] GlobalOptions_0.1.2     bit64_4.0.5