Skip to contents

In order to better implement some of the changes that have been made in domino2, the structure of the domino object has been modified. Here, we describe the data that is stored in the domino object, as well as how best to access this data.

Object contents

The contents of the domino object class include a few broad groups: - input data, such as the L-R database used, counts, and z-scores - calculations, such as correlations or differential expression results - linkages, which show connections between TFs, receptors, and ligands across the data set and within clusters - signaling matrices, which show expression of ligands signaling to active receptors in clusters (or a summary of overall signaling) - build information, which includes the parameters used to build the object in the build_domino() functions

For commonly accessed information (the number of cells, clusters, and some build information), the show and print methods for domino objects can be used.

dom
#> A domino object of 2700 cells
#> Built with signaling between 9 clusters
print(dom)
#> A domino object of 2700 cells
#> Built with signaling between 9 clusters

Access functions

In order to facilitate access to the information stored in the domino object, we have provided a collection of functions to retrieve specific items. These functions begin with “dom_” and can be listed using ls().

ls("package:domino2", pattern = "^dom_")
#>  [1] "dom_clusters"      "dom_correlations"  "dom_counts"       
#>  [4] "dom_database"      "dom_de"            "dom_info"         
#>  [7] "dom_linkages"      "dom_network_items" "dom_signaling"    
#> [10] "dom_tf_activation" "dom_zscores"

Input data

When creating a domino object with the create_domino() function, several inputs are required which are then stored in the domino object itself. These include cluster labels, the counts matrix, z-scored counts matrix, transcription factor activation scores, and the R-L database used in create_rl_map_cellphonedb().

For example, to access the cluster names in the domino object:

dom_clusters(dom)
#> [1] "naive_CD4_T_cell"  "CD14_monocyte"     "memory_CD4_T_cell"
#> [4] "B_cell"            "CD8_T_cell"        "CD16_monocyte"    
#> [7] "NK_cell"           "dendritic_cell"    "platelet"

Setting an argument labels = TRUE will return the vector of cluster labels for each cell rather than the unique cluster names.

To access the counts:

count_matrix <- dom_counts(dom)
knitr::kable(count_matrix[1:5, 1:5])
AAACATACAACCAC-1 AAACATTGAGCTAC-1 AAACATTGATCAGC-1 AAACCGTGCTTCCG-1 AAACCGTGTATGCG-1
AL627309.1 0 0 0 0 0
AP006222.2 0 0 0 0 0
RP11-206L10.2 0 0 0 0 0
RP11-206L10.9 0 0 0 0 0
LINC00115 0 0 0 0 0

Or z-scored counts:

z_matrix <- dom_zscores(dom)
knitr::kable(z_matrix[1:5, 1:5])
AAACATACAACCAC-1 AAACATTGAGCTAC-1 AAACATTGATCAGC-1 AAACCGTGCTTCCG-1 AAACCGTGTATGCG-1
AL627309.1 -0.0574500 -0.0574500 -0.0574500 -0.0574500 -0.0574500
AP006222.2 -0.0331877 -0.0331877 -0.0331877 -0.0331877 -0.0331877
RP11-206L10.2 -0.0411864 -0.0411864 -0.0411864 -0.0411864 -0.0411864
RP11-206L10.9 -0.0332568 -0.0332568 -0.0332568 -0.0332568 -0.0332568
LINC00115 -0.0812841 -0.0812841 -0.0812841 -0.0812841 -0.0812841

The transcription factor activation scores can be similarly accessed:

activation_matrix <- dom_tf_activation(dom)
knitr::kable(activation_matrix[1:5, 1:5])
AAACATACAACCAC-1 AAACATTGAGCTAC-1 AAACATTGATCAGC-1 AAACCGTGCTTCCG-1 AAACCGTGTATGCG-1
ARID3A 0.0000000 0.0000000 0.0000000 0.1825397 0.0000000
ARNTL 0.0000000 0.0338921 0.0000000 0.0276239 0.0131924
ATF1 0.2017909 0.1039150 0.1261974 0.1303623 0.0000000
ATF2 0.0754373 0.0822400 0.1471088 0.0693635 0.0710641
ATF3 0.0678526 0.0763180 0.0774797 0.1279762 0.0527818

Information about the database referenced for ligand-receptor pairs and composition of protien complexes can be extracted from the dom_database() function. By default, the function returns the name(s) of the database(s) used:

dom_database(dom)
#> [1] "CellPhoneDB_v4.0"

If you would like to view the entire ligand-receptor map, set name_only = FALSE:

db_matrix <- dom_database(dom, name_only = FALSE)
knitr::kable(db_matrix[1:5, 1:5])
int_pair name_A uniprot_A gene_A type_A
FGF4 & FGFR1 FGF4 P08620 FGF4 L
ADORA3 & ENTPD1 ADORA3 P0DMS8 ADORA3 R
EPHB3 & EFNB1 EPHB3 P54753 EPHB3 R
TNFSF18 & TNFRSF18 TNFSF18 Q9UNG2 TNFSF18 L
EFNA1 & EPHA1 EFNA1 P20827 EFNA1 L

Calculations

Active transcription factors in each cluster are determined by conducting wilcoxon rank sum tests for each transcription factor where the transcription factor activity scores amongst all cells in a cluster are tested against the activity scores of all cells outside of the cluster. The p-values for the one-sided test for greater activity within the cluster compared to outside can be accessed with the dom_de() function.

de_matrix <- dom_de(dom)
knitr::kable(de_matrix[1:5, 1:5])
naive_CD4_T_cell CD14_monocyte memory_CD4_T_cell B_cell CD8_T_cell
ARID3A 1.0000000 0.0000000 0.9999909 0.9999718 0.9999031
ARNTL 1.0000000 0.0000000 0.3287915 1.0000000 0.8408834
ATF1 0.0942821 0.7919584 0.0000000 0.9999999 0.8473444
ATF2 0.0000002 1.0000000 0.0000000 1.0000000 0.6222360
ATF3 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000

Linkage between receptors and transcription factors is assessed by Spearman correlation between transcription factor activity scores and scaled expression of receptor-encoding genes across all cells in the data set. Spearman coefficients can be accessed with the dom_correlations() function.

cor_matrix <- dom_correlations(dom)
knitr::kable(cor_matrix[1:5, 1:5])
ARID3A ARNTL ATF1 ATF2 ATF3
FGFR1 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
ADORA3 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
EPHB3 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
TNFRSF18 -0.0415026 0.0292465 0.0411616 0.0595802 -0.0560694
EPHA1 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000

Linkages

Linkages between ligands, receptors, and transcription factors can be accessed in several different ways, depending on the specific link and the scope desired. The dom_linkages() function has three arguments - the first, like all of our access functions, is for the domino object. The second, link_type, is used to specify which linkages are desired (options are complexes, receptor-ligand, tf-target, or tf-receptor). The third argument, by_cluster, determines whether the linkages returned are arranged by cluster (though this does change the available linkage types to tf-receptor, receptor, or incoming-ligand). For example, to access the complexes used across the dataset:

complex_links <- dom_linkages(dom, link_type = "complexes")
# Look for components of NODAL receptor complex
complex_links$NODAL_receptor
#> [1] "ACVR1B"       "ACVR2B"       "TDGF1"        "character(0)"

To view incoming ligands to each cluster:

incoming_links <- dom_linkages(dom, link_type = "incoming-ligand", by_cluster = TRUE)
# Check incoming signals to dendritic cells
incoming_links$dendritic_cell
#>  [1] "MIF"          "APP"          "COPA"         "CD99"         "CD1D"        
#>  [6] "HLA-F"        "INS"          "ANXA1"        "CXCL9"        "BMP8B"       
#> [11] "a4b1_complex" "aVb3_complex" "TG"           "CSF3"         "IL34"        
#> [16] "CSF1"         "CSF2"         "TNF"          "GRN"          "LTA"         
#> [21] "CTLA4"        "CD28"

If, for some reason, you find yourself in need of the entire linkage structure (not recommended), it can be accessed through its slot name; domino objects are S4 objects.

all_linkages <- slot(dom, "linkages")
# Names of all sub-structures:
names(all_linkages)
#> [1] "complexes"          "rec_lig"            "tf_targets"        
#> [4] "clust_tf"           "tf_rec"             "clust_tf_rec"      
#> [7] "clust_rec"          "clust_incoming_lig"

Alternately, to obtain a simplified list of receptors, ligands, and/or features in the domino object, use the dom_network_items() function. To pull all transcription factors associated with the dendritic cell cluster:

dc_tfs <- dom_network_items(dom, "dendritic_cell", return = "features")
head(dc_tfs)
#> [1] "ZNF189" "KLF12"  "ETV7"   "IRF8"   "KLF6"   "FOS"

Signaling Matrices

The averaged z-scored expression of ligands and receptors between different clusters can be accessed in matrix form.

signal_matrix <- dom_signaling(dom)
knitr::kable(signal_matrix)
L_naive_CD4_T_cell L_CD14_monocyte L_memory_CD4_T_cell L_B_cell L_CD8_T_cell L_CD16_monocyte L_NK_cell L_dendritic_cell L_platelet
R_naive_CD4_T_cell 0.0000000 0.0000000 0.1711738 0.1142025 0.1316175 0.2223212 0.2429505 0.000000 0.00000
R_CD14_monocyte 0.9054293 2.2595922 1.8484199 0.4113900 1.2793445 1.6668345 2.0653175 4.629239 3.38459
R_memory_CD4_T_cell 0.0000000 0.0000000 0.1711738 0.1142025 0.1316175 0.2223212 0.2429505 0.000000 0.00000
R_B_cell 0.0513875 0.1920610 0.2819420 0.0000000 0.0000000 0.2508179 0.1639465 1.052996 2.47526
R_CD8_T_cell 0.0000000 0.0000000 0.1711738 0.1142025 0.1316175 0.2223212 0.2429505 0.000000 0.00000
R_CD16_monocyte 0.9054293 2.2595922 1.8484199 0.4113900 1.2793445 1.6668345 2.0653175 4.629239 3.38459
R_NK_cell 0.1127173 1.5182660 0.6536131 0.0000000 0.2272370 1.0199925 0.4168540 2.582174 2.47526
R_dendritic_cell 0.2412594 2.2595922 1.4862873 0.0583676 1.2793445 1.0699215 2.0653175 4.629239 3.38459
R_platelet 0.4466970 0.7381964 0.5150958 0.4113900 0.3264903 1.0468853 0.5332812 2.317655 2.47526

To view signaling to a specific cluster from the other clusters, set the cluster argument to the cluster name.

dc_matrix <- dom_signaling(dom, "dendritic_cell")
knitr::kable(dc_matrix)
dendritic_cell.L_naive_CD4_T_cell dendritic_cell.L_CD14_monocyte dendritic_cell.L_memory_CD4_T_cell dendritic_cell.L_B_cell dendritic_cell.L_CD8_T_cell dendritic_cell.L_CD16_monocyte dendritic_cell.L_NK_cell dendritic_cell.L_dendritic_cell dendritic_cell.L_platelet
MIF 0.0513875 0.0000000 0.2283356 0.0000000 0.0000000 0.0000000 0.1639465 0.3383730 0.0000000
APP 0.0000000 0.0910785 0.0478541 0.0000000 0.0000000 0.0000000 0.0000000 0.5651886 2.0283841
COPA 0.0000000 0.1009825 0.0057523 0.0000000 0.0000000 0.2508179 0.0000000 0.1494349 0.4468762
CD99 0.0000000 0.0249929 0.1941752 0.0000000 0.5222139 0.0000000 0.9530171 0.1656705 0.9093296
CD1D 0.0000000 0.5461355 0.0000000 0.0583676 0.0000000 0.1733057 0.0000000 1.2646585 0.0000000
HLA-F 0.0000000 0.0000000 0.0133417 0.0000000 0.3264903 0.0258488 0.3693347 0.0000000 0.0000000
ANXA1 0.0000000 0.1618442 0.4100748 0.0000000 0.2618538 0.0687405 0.5600050 0.6167362 0.0000000
CXCL9 0.0000000 0.0083536 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
CSF1 0.0000000 0.0000000 0.0487887 0.0000000 0.0000000 0.0043552 0.0090572 0.0000000 0.0000000
TNF 0.0000000 0.0000000 0.0543116 0.0000000 0.1574295 0.0589903 0.0000000 0.0061102 0.0000000
GRN 0.0000000 1.3262050 0.0000000 0.0000000 0.0000000 0.4878632 0.0000000 1.5230676 0.0000000
LTA 0.0613298 0.0000000 0.1746769 0.0000000 0.0000000 0.0000000 0.0099570 0.0000000 0.0000000
CTLA4 0.0000000 0.0000000 0.0638344 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
CD28 0.1285421 0.0000000 0.2451419 0.0000000 0.0113571 0.0000000 0.0000000 0.0000000 0.0000000

Build information

To keep track of the options set when running build_domino(), they are stored within the domino object itself. To view these options, use the dom_info() function.

dom_info(dom)
#> $create
#> [1] TRUE
#> 
#> $build
#> [1] TRUE
#> 
#> $build_variables
#>     max_tf_per_clust          min_tf_pval       max_rec_per_tf 
#>               25.000                0.001               25.000 
#> rec_tf_cor_threshold   min_rec_percentage 
#>                0.250                0.100

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, we have put together further information on plotting and an example analysis can be viewed on our Getting Started page. 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] 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           png_0.1-8              
#>  [13] systemfonts_1.0.5       vctrs_0.6.5             stringr_1.5.1          
#>  [16] pkgconfig_2.0.3         shape_1.4.6             crayon_1.5.2           
#>  [19] fastmap_1.1.1           backports_1.4.1         dbplyr_2.4.0           
#>  [22] XVector_0.42.0          utf8_1.2.4              rmarkdown_2.25         
#>  [25] ragg_1.2.7              purrr_1.0.2             bit_4.0.5              
#>  [28] xfun_0.41               zlibbioc_1.48.0         cachem_1.0.8           
#>  [31] GenomeInfoDb_1.38.5     jsonlite_1.8.8          progress_1.2.3         
#>  [34] blob_1.2.4              broom_1.0.5             parallel_4.3.2         
#>  [37] prettyunits_1.2.0       cluster_2.1.4           R6_2.5.1               
#>  [40] bslib_0.6.1             stringi_1.8.3           RColorBrewer_1.1-3     
#>  [43] car_3.1-2               jquerylib_0.1.4         Rcpp_1.0.12            
#>  [46] iterators_1.0.14        knitr_1.45              IRanges_2.36.0         
#>  [49] igraph_2.0.1.1          Matrix_1.6-5            tidyselect_1.2.0       
#>  [52] abind_1.4-5             yaml_2.3.8              doParallel_1.0.17      
#>  [55] codetools_0.2-19        curl_5.2.0              lattice_0.21-9         
#>  [58] tibble_3.2.1            plyr_1.8.9              withr_3.0.0            
#>  [61] Biobase_2.62.0          KEGGREST_1.42.0         evaluate_0.23          
#>  [64] desc_1.4.3              BiocFileCache_2.10.1    xml2_1.3.6             
#>  [67] circlize_0.4.15         Biostrings_2.70.2       pillar_1.9.0           
#>  [70] ggpubr_0.6.0            filelock_1.0.3          carData_3.0-5          
#>  [73] foreach_1.5.2           stats4_4.3.2            generics_0.1.3         
#>  [76] RCurl_1.98-1.14         S4Vectors_0.40.2        hms_1.1.3              
#>  [79] ggplot2_3.4.4           munsell_0.5.0           scales_1.3.0           
#>  [82] glue_1.7.0              tools_4.3.2             ggsignif_0.6.4         
#>  [85] fs_1.6.3                XML_3.99-0.16.1         grid_4.3.2             
#>  [88] tidyr_1.3.1             AnnotationDbi_1.64.1    colorspace_2.1-0       
#>  [91] GenomeInfoDbData_1.2.11 cli_3.6.2               rappdirs_0.3.3         
#>  [94] textshaping_0.3.7       fansi_1.0.6             ComplexHeatmap_2.18.0  
#>  [97] dplyr_1.1.4             gtable_0.3.4            rstatix_0.7.2          
#> [100] sass_0.4.8              digest_0.6.34           BiocGenerics_0.48.1    
#> [103] rjson_0.2.21            memoise_2.0.1           htmltools_0.5.7        
#> [106] pkgdown_2.0.7           lifecycle_1.0.4         httr_1.4.7             
#> [109] GlobalOptions_0.1.2     bit64_4.0.5