diff --git a/DESCRIPTION b/DESCRIPTION index 9aaa7e4..db8b0c0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -13,7 +13,7 @@ Description: Domino2 is a package developed to analyze cell signaling through ligand - receptor - transcription factor networks in scRNAseq data. It takes as input information transcriptomic data, requiring counts, z-scored counts, and cluster labels, as well as information on transcription factor activation (such as from SCENIC) and a database of ligand and receptor pairings (such as from cellphoneDB). This package creates an object storing ligand - receptor - transcription factor linkages by cluster and provides several methods for exploring, summarizing, and visualizing the analysis. BugReports: https://github.com/FertigLab/domino_development/issues Depends: - R(>= 3.6.2), + R(>= 4.2.0), Imports: biomaRt, ComplexHeatmap, diff --git a/NAMESPACE b/NAMESPACE index ac9ddec..5b41425 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,9 +1,8 @@ # Generated by roxygen2: do not edit by hand +export(add_rl_column) export(build_domino) export(circos_ligand_receptor) -export(collate_network_items) -export(convert_genes) export(cor_heatmap) export(cor_scatter) export(count_linkage) @@ -17,6 +16,7 @@ export(dom_database) export(dom_de) export(dom_info) export(dom_linkages) +export(dom_network_items) export(dom_signaling) export(dom_tf_activation) export(dom_zscores) @@ -29,7 +29,6 @@ export(rename_clusters) export(signaling_heatmap) export(signaling_network) export(summarize_linkages) -export(table_convert_genes) export(test_differential_linkages) exportClasses(domino) exportClasses(linkage_summary) diff --git a/R/class_definitions.R b/R/class_definitions.R index 3190181..41a19b7 100644 --- a/R/class_definitions.R +++ b/R/class_definitions.R @@ -3,12 +3,12 @@ #' NULL #' The domino Class -#' +#' #' The domino class contains all information necessary to calculate receptor-ligand #' signaling. It contains z-scored expression, cell cluster labels, feature values, #' and a referenced receptor-ligand database formatted as a receptor-ligand map. #' Calculated intermediate values are also stored. -#' +#' #' @slot db_info List of data sets from lr database. #' @slot counts Raw count gene expression data #' @slot z_scores Matrix of z-scored expression data with cells as columns @@ -23,42 +23,42 @@ NULL #' @name domino-class #' @rdname domino-class #' @exportClass domino -#' +#' domino <- methods::setClass( Class = "domino", slots = c( - db_info="list", - z_scores="matrix", - counts="dgCMatrix", - clusters="factor", - features="matrix", - cor="matrix", - linkages="list", - clust_de="matrix", - misc="list", - cl_signaling_matrices="list", - signaling="matrix" + db_info = "list", + z_scores = "matrix", + counts = "dgCMatrix", + clusters = "factor", + features = "matrix", + cor = "matrix", + linkages = "list", + clust_de = "matrix", + misc = "list", + cl_signaling_matrices = "list", + signaling = "matrix" ), prototype = list( - misc = list("build"=FALSE) + misc = list("build" = FALSE) ) ) #' The domino linkage summary class -#' +#' #' The linkage summary class contains linkages established in multiple domino #' objects through gene regulatory network inference and reference to receptor- #' ligand data bases. A data frame summarizing meta features that describe the #' domino objects compared in the linkage summary facilitates comparisons of #' established linkages and differential signaling interactions across categorical #' sample covariates. -#' +#' #' @slot subject_names unique names for each domino result included in the summary #' @slot subject_meta data.frame with each row describing one subject and columns describing features of the subjects by which to draw comparisons of signaling networks #' @slot subject_linkages nested list of linkages inferred for each subject. Lists are stored in a heirarchical structure of subject-cluster-linkage where linkages include transcription factors (tfs), linkages between transcription factors and receptors (tfs_rec), active receptors (rec), possible receptor-ligand interactions (rec_lig), and incoming ligands (incoming_lig) #' @name linkage_summary-class #' @rdname linkage_summary-class #' @exportClass linkage_summary -#' +#' linkage_summary <- setClass( Class = "linkage_summary", slots = c( @@ -69,39 +69,53 @@ linkage_summary <- setClass( ) #' Print domino object -#' +#' #' Prints a summary of a domino object -#' +#' #' @param x Domino object #' @return a printed description of the number of cell clusters in the object #' @keywords internal +#' @examples +#' print(domino2:::pbmc_dom_built_tiny) +#' setMethod("print", "domino", function(x, ...) { if (x@misc$build) { - cat("A domino object of ", length(x@clusters), " cells + message( + "A domino object of ", length(x@clusters), " cells Contains signaling between", length(levels(x@clusters)), "clusters Built with a maximum of", as.integer(x@misc$build_vars["max_tf_per_clust"]), "TFs per cluster and a maximum of", as.integer(x@misc$build_vars["max_rec_per_tf"]), - "receptors per TF\n") + "receptors per TF\n" + ) } else { - cat(c("A domino object of ", length(x@clusters), " cells\n", "A signaling network has not been built\n"), - sep="") + message(c("A domino object of ", length(x@clusters), " cells\n", "A signaling network has not been built\n"), + sep = "" + ) } }) #' Show domino object information -#' +#' #' Shows content overview of domino object -#' +#' #' @param object Domino object #' @return a printed description of the number of cells in a domino object and its build status #' @keywords internal +#' @examples +#' domino2:::pbmc_dom_built_tiny +#' +#' show(domino2:::pbmc_dom_built_tiny) +#' setMethod("show", "domino", function(object) { if (object@misc$build) { - cat(c("A domino object of ", length(object@clusters), " cells\n", "Built with signaling between ", - length(levels(object@clusters)), " clusters\n"), sep = "") + cat(c( + "A domino object of ", length(object@clusters), " cells\n", "Built with signaling between ", + length(levels(object@clusters)), " clusters\n" + ), sep = "") } else { cat(c("A domino object of ", length(object@clusters), " cells\n", "A signaling network has not been built\n"), - sep = "") + sep = "" + ) } }) diff --git a/R/convenience_fxns.R b/R/convenience_fxns.R index d826ffd..985917d 100644 --- a/R/convenience_fxns.R +++ b/R/convenience_fxns.R @@ -1,24 +1,28 @@ #' @import plyr #' @import methods -#' +#' NULL #' Renames clusters in a domino object -#' -#' This function reads in a receptor ligand signaling database, cell level -#' features of some kind (ie. output from pySCENIC), z-scored single cell data, -#' and cluster id for single cell data, calculates a correlation matrix between -#' receptors and other features (this is transcription factor module scores if -#' using pySCENIC), and finds features enriched by cluster. It will return a -#' domino object prepared for [build_domino()], which will calculate a signaling +#' +#' This function reads in a receptor ligand signaling database, cell level +#' features of some kind (ie. output from pySCENIC), z-scored single cell data, +#' and cluster id for single cell data, calculates a correlation matrix between +#' receptors and other features (this is transcription factor module scores if +#' using pySCENIC), and finds features enriched by cluster. It will return a +#' domino object prepared for [build_domino()], which will calculate a signaling #' network. -#' +#' #' @param dom Domino object to rename clusters in #' @param clust_conv Named vector of conversions from old to new clusters. Values are taken as new clusters IDs and names as old cluster IDs. #' @return A domino object with clusters renamed in all applicable slots. #' @keywords internal -#' @export -#' +#' @export +#' @examples +#' new_clust <- c("CD8_T_cell" = "CD8+ T Cells", +#' "CD14_monocyte" = "CD14+ Monocytes", "B_cell" = "B Cells") +#' pbmc_dom_built_tiny <- rename_clusters(domino2:::pbmc_dom_built_tiny, new_clust) +#' rename_clusters <- function(dom, clust_conv) { if (is.null(dom@clusters)) { stop("There are no clusters in this domino object") @@ -43,58 +47,12 @@ rename_clusters <- function(dom, clust_conv) { } return(dom) } -#' Extracts all features, receptors, or ligands present in a signaling network. -#' -#' This function collates all of the features, receptors, or ligands found in a -#' signaling network anywhere in a list of clusters. This can be useful for -#' comparing signaling networks across two separate conditions. In order to run -#' this [build_domino()] must be run on the object previously. -#' -#' @param dom Domino object containing a signaling network (i.e. [build_domino()] run) -#' @param return String indicating where to collate 'features', 'receptors', or 'ligands'. If 'all' then a list of all three will be returned. -#' @param clusters Vector indicating clusters to collate network items from. If left as NULL then all clusters will be included. -#' @return A vector containing all features, receptors, or ligands in the data set or a list containing all three. -#' @export -#' -collate_network_items <- function(dom, clusters = NULL, return = NULL) { - if (!dom@misc[["build"]]) { - stop("Please run domino_build prior to generate signaling network.") - } - if (is.null(clusters) & is.null(dom@clusters)) { - stop("There are no clusters in this domino object. Please provide clusters.") - } - if (is.null(clusters)) { - clusters <- levels(dom@clusters) - } - # Get all enriched TFs and correlated + expressed receptors for specified clusters - all_recs <- c() - all_tfs <- c() - all_ligs <- c() - for (cl in clusters) { - all_recs <- c(all_recs, unlist(dom@linkages$clust_tf_rec[[cl]])) - tfs <- names(dom@linkages$clust_tf_rec[[cl]]) - tf_wo_rec <- which(sapply(dom@linkages$clust_tf_rec[[cl]], length) == 0) - if (length(tf_wo_rec > 0)) { - tfs <- tfs[-tf_wo_rec] - } - all_tfs <- c(all_tfs, tfs) - all_ligs <- c(all_ligs, rownames(dom@cl_signaling_matrices[[cl]])) - } - all_recs <- unique(all_recs) - all_tfs <- unique(all_tfs) - all_ligs <- unique(all_ligs) - # Make list and return whats asked for - list_out <- list(features = all_tfs, receptors = all_recs, ligands = all_ligs) - if (is.null(return)) { - return(list_out) - } else { - return(list_out[[return]]) - } -} + #' Convert Genes Using Table -#' -#' Takes a vector of gene inputs and returns converted gene table -#' +#' +#' Takes a vector of gene inputs and a conversion table ([an example]("http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt") +#' and returns converted gene table +#' #' @param genes The genes to convert. #' @param from Gene symbol type of the input (ENSG, ENSMUSG, HGNC, MGI) #' @param to Desired gene symbol type for the output (HGNC, MGI) @@ -102,17 +60,22 @@ collate_network_items <- function(dom, clusters = NULL, return = NULL) { #' and rows corresponding to the gene symbols themselves #' @return Data frame of genes with original and corresponding converted symbols #' @keywords internal -#' @export -#' +#' table_convert_genes <- function(genes, from, to, conversion_table) { # Check inputs: stopifnot(`Genes must be a vector of characters` = (is(genes, "character") & is(genes, "vector"))) - stopifnot(`From must be one of ENSMUSG, ENSG, MGI, or HGNC` = from %in% c("ENSMUSG", "ENSG", "MGI", - "HGNC")) + stopifnot(`From must be one of ENSMUSG, ENSG, MGI, or HGNC` = from %in% c( + "ENSMUSG", "ENSG", "MGI", + "HGNC" + )) stopifnot(`To must be one of MGI or HGNC` = to %in% c("MGI", "HGNC")) - stopifnot(`Conversion table must be provided with at least two of column names mm.ens, hs.ens, mgi and/or hgnc` = (is(conversion_table, - "data.frame") & length(which(colnames(conversion_table) %in% c("mm.ens", "hs.ens", "mgi", - "hgnc"))) > 1)) + stopifnot(`Conversion table must be provided with at least two of column names mm.ens, hs.ens, mgi and/or hgnc` = (is( + conversion_table, + "data.frame" + ) & length(which(colnames(conversion_table) %in% c( + "mm.ens", "hs.ens", "mgi", + "hgnc" + ))) > 1)) if (from == "ENSMUSG") { col1 <- conversion_table$mm.ens } @@ -134,5 +97,3 @@ table_convert_genes <- function(genes, from, to, conversion_table) { genesV2 <- cbind(col1[which(col1 %in% genes)], col2[which(col1 %in% genes)]) return(genesV2) } -## Back up gene table for back up function: mouse_human_genes = -## read.csv('http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt',sep='\t') diff --git a/R/import_fxns.R b/R/import_fxns.R index c3621a9..ae48d57 100644 --- a/R/import_fxns.R +++ b/R/import_fxns.R @@ -7,9 +7,9 @@ NULL #' Create a receptor-ligand map from a cellphonedb signaling database -#' +#' #' Generates a data frame of ligand-receptor interactions from a CellPhoneDB database annotating the genes encoding the interacting ligands and receptors to be queried in transcriptomic data. -#' +#' #' @param genes dataframe or file path to table of gene names in uniprot, hgnc_symbol, or ensembl format in cellphonedb database format #' @param proteins dataframe or file path to table of protein features in cellphonedb format #' @param interactions dataframe or file path to table of protein-protein interactions in cellphonedb format @@ -21,28 +21,41 @@ NULL #' @param alternate_convert_table supplied table for non-ensembl method of conversion #' @return Data frame where each row describes a possible receptor-ligand interaction #' @export create_rl_map_cellphonedb +#' @examples +#' rl_map_tiny <- create_rl_map_cellphonedb(genes = domino2:::genes_tiny, +#' proteins = domino2:::proteins_tiny, interactions = domino2:::interactions_tiny, +#' complexes = domino2:::complexes_tiny) #' -create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = NULL, database_name = "CellPhoneDB", - gene_conv = NULL, gene_conv_host = "https://www.ensembl.org", alternate_convert = FALSE, alternate_convert_table = NULL) { +create_rl_map_cellphonedb <- function( + genes, proteins, interactions, complexes = NULL, database_name = "CellPhoneDB", + gene_conv = NULL, gene_conv_host = "https://www.ensembl.org", alternate_convert = FALSE, alternate_convert_table = NULL) { # Check input structures: - stopifnot(`genes argument must be file path or dataframe` = (is(genes, "data.frame") | is(genes, - "character"))) - stopifnot(`proteins argument must be file path or dataframe` = (is(proteins, "data.frame") | is(proteins, - "character"))) + stopifnot(`genes argument must be file path or dataframe` = (is(genes, "data.frame") | is( + genes, + "character" + ))) + stopifnot(`proteins argument must be file path or dataframe` = (is(proteins, "data.frame") | is( + proteins, + "character" + ))) stopifnot(`interactions argument must be file path or dataframe` = (is(interactions, "data.frame") | is(interactions, "character"))) - stopifnot(`complexes argument must be NULL, file path or dataframe` = (is.null(complexes) | is(complexes, - "data.frame") | is(complexes, "character"))) + stopifnot(`complexes argument must be NULL, file path or dataframe` = (is.null(complexes) | is( + complexes, + "data.frame" + ) | is(complexes, "character"))) stopifnot(`Database name must be a string` = is(database_name, "character") & length(database_name) == 1) stopifnot(`Gene conversion must be NULL or a character vector with 2 items` = (is.null(gene_conv) | (is(gene_conv, "character") & length(gene_conv) == 2))) stopifnot(`Gene conversion host must be a string` = is(gene_conv_host, "character") & length(gene_conv_host) == 1) - stopifnot(`Alternate conversion argument (not recommended) must be TRUE or FALSE` = is(alternate_convert, - "logical")) - if(alternate_convert & is.null(alternate_convert_table)) { - stop("If using alternate conversion table (not recommended), a table must be provided") + stopifnot(`Alternate conversion argument (not recommended) must be TRUE or FALSE` = is( + alternate_convert, + "logical" + )) + if (alternate_convert & is.null(alternate_convert_table)) { + stop("If using alternate conversion table (not recommended), a table must be provided") } # Read in files if needed: @@ -60,32 +73,42 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = } # replace empty cells in columns annotating gene properties with 'False' There are some # unannotated genes in database v2.0 that seem to have been fixed in v4.0 - gene_features <- c("transmembrane", "peripheral", "secreted", "secreted_highlight", "receptor", - "integrin", "other") + gene_features <- c( + "transmembrane", "peripheral", "secreted", "secreted_highlight", "receptor", + "integrin", "other" + ) proteins[proteins$receptor == "", colnames(proteins) %in% gene_features] <- "False" # change cases of True/False syntax from Python to TRUE/FALSE R syntax for (x in colnames(genes)) { - if (identical(unique(genes[[x]]), c("True", "False")) | identical(unique(genes[[x]]), c("False", - "True"))) { + if (identical(unique(genes[[x]]), c("True", "False")) | identical(unique(genes[[x]]), c( + "False", + "True" + ))) { genes[[x]] <- ifelse(genes[[x]] == "True", TRUE, FALSE) } } for (x in colnames(proteins)) { - if (identical(unique(proteins[[x]]), c("True", "False")) | identical(unique(proteins[[x]]), - c("False", "True"))) { + if (identical(unique(proteins[[x]]), c("True", "False")) | identical( + unique(proteins[[x]]), + c("False", "True") + )) { proteins[[x]] <- ifelse(proteins[[x]] == "True", TRUE, FALSE) } } for (x in colnames(interactions)) { - if (identical(unique(interactions[[x]]), c("True", "False")) | identical(unique(interactions[[x]]), - c("False", "True"))) { + if (identical(unique(interactions[[x]]), c("True", "False")) | identical( + unique(interactions[[x]]), + c("False", "True") + )) { interactions[[x]] <- ifelse(interactions[[x]] == "True", TRUE, FALSE) } } if (!is.null(complexes)) { for (x in colnames(complexes)) { - if (identical(unique(complexes[[x]]), c("True", "False")) | identical(unique(complexes[[x]]), - c("False", "True"))) { + if (identical(unique(complexes[[x]]), c("True", "False")) | identical( + unique(complexes[[x]]), + c("False", "True") + )) { complexes[[x]] <- ifelse(complexes[[x]] == "True", TRUE, FALSE) } } @@ -94,8 +117,10 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = if (!is.null(gene_conv) & !identical(gene_conv[1], gene_conv[2])) { # obtain conversion dictionary if (alternate_convert) { - conv_dict <- table_convert_genes(genes$gene_name, from = gene_conv[1], to = gene_conv[2], - alternate_convert_table) + conv_dict <- table_convert_genes(genes$gene_name, + from = gene_conv[1], to = gene_conv[2], + alternate_convert_table + ) } else { conv_dict <- convert_genes(genes$gene_name, from = gene_conv[1], to = gene_conv[2], host = gene_conv_host) } @@ -122,11 +147,11 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = # if the original gene trying to be converted is not in the gene dictionary the # interaction is not included in the final rl_map if (sum(g %in% conv_dict[, 1]) < length(g)) { - for (gn in g) { - conversion_flag[[gn]] <- TRUE - } + for (gn in g) { + conversion_flag[[gn]] <- TRUE + } } else { - g <- paste(unique(conv_dict[conv_dict[, 1] %in% g, 2]), collapse = ";") + g <- paste(unique(conv_dict[conv_dict[, 1] %in% g, 2]), collapse = ";") } } return(g) @@ -146,7 +171,7 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = # interaction is not included in the final rl_map if (sum(gene_a %in% conv_dict[, 1]) < length(gene_a)) { for (gn in gene_a) { - conversion_flag[[gn]] <- TRUE + conversion_flag[[gn]] <- TRUE } } else { gene_a <- unique(conv_dict[conv_dict[, 1] %in% gene_a, 2]) @@ -160,8 +185,8 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = next } if (length(conversion_flag)) { - print(paste("No gene orthologs found for:", names(conversion_flag), collapse = " ")) - print(paste("Skipping interaction:", partner_a, partner_b, collapse = " ")) + message(paste("No gene orthologs found for:", names(conversion_flag), collapse = " ")) + message(paste("Skipping interaction:", partner_a, partner_b, collapse = " ")) next } a_df <- as.data.frame(a_features) @@ -178,11 +203,11 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = # if the original gene trying to be converted is not in the gene dictionary the # interaction is not included in the final rl_map if (sum(g %in% conv_dict[, 1]) < length(g)) { - for (gn in g) { - conversion_flag[[gn]] <- TRUE - } + for (gn in g) { + conversion_flag[[gn]] <- TRUE + } } else { - g <- paste(unique(conv_dict[conv_dict[, 1] %in% g, 2]), collapse = ";") + g <- paste(unique(conv_dict[conv_dict[, 1] %in% g, 2]), collapse = ";") } } return(g) @@ -202,7 +227,7 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = # interaction is not included in the final rl_map if (sum(gene_b %in% conv_dict[, 1]) < length(gene_b)) { for (gn in gene_b) { - conversion_flag[[gn]] <- TRUE + conversion_flag[[gn]] <- TRUE } } else { gene_b <- unique(conv_dict[conv_dict[, 1] %in% gene_b, 2]) @@ -216,8 +241,8 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = next } if (length(conversion_flag)) { - print(paste("No gene orthologs found for:", names(conversion_flag), collapse = " ")) - print(paste("Skipping interaction:", partner_a, partner_b, collapse = " ")) + message(paste("No gene orthologs found for:", names(conversion_flag), collapse = " ")) + message(paste("Skipping interaction:", partner_a, partner_b, collapse = " ")) next } b_df <- as.data.frame(b_features) @@ -232,21 +257,25 @@ create_rl_map_cellphonedb <- function(genes, proteins, interactions, complexes = rl_map <- rl_map[!(rl_map$type_A == "R" & rl_map$type_B == "R") & !(rl_map$type_A == "L" & rl_map$type_B == "L"), ] # specify column order - rl_map <- rl_map[, c("int_pair", "name_A", "uniprot_A", "gene_A", "type_A", "name_B", "uniprot_B", - "gene_B", "type_B", "annotation_strategy", "source", "database_name")] + rl_map <- rl_map[, c( + "int_pair", "name_A", "uniprot_A", "gene_A", "type_A", "name_B", "uniprot_B", + "gene_B", "type_B", "annotation_strategy", "source", "database_name" + )] return(rl_map) } #' Create a list of genes in regulons inferred by SCENIC -#' +#' #' Generates a list of transcription factors and the genes targeted by the transcription factor as part of their regulon inferred by pySCENIC -#' +#' #' @param regulons Dataframe or file path to the table of the output of the grn (gene regulatory network) function from pySCENIC #' @return A list where names are transcription factors and the stored values are character vectors of genes in the inferred regulons #' @export create_regulon_list_scenic -#' +#' @examples +#' regulon_list_tiny <- create_regulon_list_scenic(regulons = domino2:::regulons_tiny) +#' create_regulon_list_scenic <- function(regulons) { - if (is(regulons, "character")){ + if (is(regulons, "character")) { regulons <- read.csv(regulons) } TFS <- unique(regulons[["TF"]]) @@ -270,15 +299,15 @@ create_regulon_list_scenic <- function(regulons) { } #' Create a domino object and prepare it for network construction -#' -#' This function reads in a receptor ligand signaling database, cell level -#' features of some kind (ie. output from pySCENIC), z-scored single cell data, -#' and cluster id for single cell data, calculates a correlation matrix between -#' receptors and other features (this is transcription factor module scores if -#' using pySCENIC), and finds features enriched by cluster. It will return a -#' domino object prepared for [build_domino()], which will calculate a signaling +#' +#' This function reads in a receptor ligand signaling database, cell level +#' features of some kind (ie. output from pySCENIC), z-scored single cell data, +#' and cluster id for single cell data, calculates a correlation matrix between +#' receptors and other features (this is transcription factor module scores if +#' using pySCENIC), and finds features enriched by cluster. It will return a +#' domino object prepared for [build_domino()], which will calculate a signaling #' network. -#' +#' #' @param rl_map Data frame where each row describes a receptor-ligand interaction with required columns gene_A & gene_B including the gene names for the receptor and ligand and type_A & type_B annotating if genes A and B are a ligand (L) or receptor (R) #' @param features Either a path to a csv containing cell level features of interest (ie. the auc matrix from pySCENIC) or named matrix with cells as columns and features as rows. #' @param ser Seurat object containing scaled RNA expression data in the RNA assay slot and cluster identity. Either a ser object OR z_scores and clusters must be provided. If ser is present z_scores and clusters will be ignored. @@ -295,21 +324,39 @@ create_regulon_list_scenic <- function(regulons) { #' @param tf_variance_quantile What proportion of variable features to take if using variance to threshold features. Default is 0.5. Higher numbers will keep more features. Ignored if tf_selection_method is not 'variable' #' @return A domino object #' @export create_domino -#' -create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores = NULL, clusters = NULL, - use_clusters = TRUE, tf_targets = NULL, verbose = TRUE, use_complexes = TRUE, rec_min_thresh = 0.025, - remove_rec_dropout = TRUE, tf_selection_method = "clusters", tf_variance_quantile = 0.5) { +#' @examples +#' pbmc_dom_tiny_all <- pbmc_dom_tiny <- create_domino(rl_map = domino2:::rl_map_tiny, +#' features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny, +#' clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny, use_clusters = FALSE, +#' use_complexes = FALSE, rec_min_thresh = 0.1, remove_rec_dropout = TRUE, +#' tf_selection_method = "all") +#' +#' pbmc_dom_tiny_clustered <- create_domino(rl_map = domino2:::rl_map_tiny, +#' features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny, +#' clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny, +#' use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE) +#' +create_domino <- function( + rl_map, features, ser = NULL, counts = NULL, z_scores = NULL, clusters = NULL, + use_clusters = TRUE, tf_targets = NULL, verbose = TRUE, use_complexes = TRUE, rec_min_thresh = 0.025, + remove_rec_dropout = TRUE, tf_selection_method = "clusters", tf_variance_quantile = 0.5) { # Check inputs: - stopifnot(`rl_map must be a data.frame with column names gene_A, gene_B, type_A, and type_B` = (is(rl_map, - "data.frame") & c("gene_A", "gene_B", "type_A", "type_B") %in% colnames(rl_map))) - stopifnot(`features must be either a file path or a named matrix with cells as columns and features as rows` = ((is(features, - "character") & length(features) == 1) | (is(features, "matrix") & !is.null(rownames(features)) & + stopifnot(`rl_map must be a data.frame with column names gene_A, gene_B, type_A, and type_B` = (is( + rl_map, + "data.frame" + ) & c("gene_A", "gene_B", "type_A", "type_B") %in% colnames(rl_map))) + stopifnot(`features must be either a file path or a named matrix with cells as columns and features as rows` = ((is( + features, + "character" + ) & length(features) == 1) | (is(features, "matrix") & !is.null(rownames(features)) & !is.null(colnames(features))) | (is(features, "data.frame") & !is.null(rownames(features)) & !is.null(colnames(features))))) stopifnot(`Either a Seurat object OR counts, z scores, and clusters must be provided` = (is(ser, "Seurat") | (!is.null(counts) & !is.null(rownames(counts)) & !is.null(colnames(counts)) & - is(z_scores, "matrix") & !is.null(rownames(z_scores)) & !is.null(colnames(z_scores)) & is(clusters, - "factor") & !is.null(names(clusters))))) + is(z_scores, "matrix") & !is.null(rownames(z_scores)) & !is.null(colnames(z_scores)) & is( + clusters, + "factor" + ) & !is.null(names(clusters))))) stopifnot(`rec_min_thresh must be a number between 0 and 1` = (is(rec_min_thresh, "numeric") & rec_min_thresh <= 1 & rec_min_thresh >= 0)) # Create object @@ -424,19 +471,20 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores rownames(p_vals) <- rownames(features) colnames(p_vals) <- levels(dom@clusters) if (verbose) { - print("Calculating feature enrichment by cluster") + message("Calculating feature enrichment by cluster") clust_n <- length(levels(dom@clusters)) } for (clust in levels(dom@clusters)) { if (verbose) { cur <- which(levels(dom@clusters) == clust) - print(paste0(cur, " of ", clust_n)) + message(paste0(cur, " of ", clust_n)) } cells <- which(dom@clusters == clust) for (feat in rownames(dom@features)) { p_vals[feat, clust] <- stats::wilcox.test( - dom@features[feat, cells], dom@features[feat, -cells], alternative = "g" - )$p.value + dom@features[feat, cells], dom@features[feat, -cells], + alternative = "g" + )$p.value } } dom@clust_de <- p_vals @@ -447,7 +495,7 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores if (tf_selection_method == "variable") { dom@clusters <- factor() variances <- apply(dom@features, 1, function(x) { - sd(x)/mean(x) + sd(x) / mean(x) }) keep_n <- length(variances) * tf_variance_quantile keep_id <- which(rank(variances) > keep_n) @@ -459,7 +507,7 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores warning("tf_targets is not a list. No regulons stored") } else { dom@linkages[["tf_targets"]] <- tf_targets - } + } # Calculate correlation matrix between features and receptors. dom@counts <- counts zero_sum <- rowSums(counts == 0) @@ -469,7 +517,7 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores rownames(rho) <- ser_receptors colnames(rho) <- rownames(dom@features) if (verbose) { - print("Calculating correlations") + message("Calculating correlations") n_tf <- nrow(dom@features) } for (module in rownames(dom@features)) { @@ -477,10 +525,10 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores # correlation equal to 0. if (verbose) { cur <- which(rownames(dom@features) == module) - print(paste0(cur, " of ", n_tf)) + message(paste0(cur, " of ", n_tf)) } if (!is.null(dom@linkages$tf_targets)) { - tf <- gsub(pattern = "\\.\\.\\.", replacement = "", module) # correction for AUC values from pySCENIC that append an elipses to TF names due to (+) characters in the orignial python output + tf <- gsub(pattern = "\\.\\.\\.", replacement = "", module) # correction for AUC values from pySCENIC that append an elipses to TF names due to (+) characters in the orignial python output module_targets <- tf_targets[[tf]] module_rec_targets <- intersect(module_targets, ser_receptors) } else { @@ -524,7 +572,7 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores r_genes <- r } if (sum(rownames(rho) %in% r_genes) != length(r_genes)) { - print(paste0(r, " has component genes that did not pass testing parameters")) + message(paste0(r, " has component genes that did not pass testing parameters")) cor_list[[r]] <- rep(0, ncol(rho)) next } @@ -547,7 +595,7 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores for (rec in ser_receptors) { rec_percent <- sapply(X = levels(dom@clusters), FUN = function(x) { # percentage of cells in cluster with non-zero expression of receptor gene - sum(dom@counts[rec, dom@clusters == x] > 0)/length(dom@counts[rec, dom@clusters == + sum(dom@counts[rec, dom@clusters == x] > 0) / length(dom@counts[rec, dom@clusters == x]) }) cl_rec_percent <- rbind(cl_rec_percent, rec_percent) @@ -559,23 +607,25 @@ create_domino <- function(rl_map, features, ser = NULL, counts = NULL, z_scores } #' Use biomaRt to convert genes -#' +#' #' This function reads in a vector of genes and converts the genes to specified symbol type -#' +#' #' @param genes Vector of genes to convert. #' @param from Format of gene input (ENSMUSG, ENSG, MGI, or HGNC) #' @param to Format of gene output (MGI, or HGNC) #' @param host Host to connect to. Defaults to https://www.ensembl.org following the useMart default, but can be changed to archived hosts if useMart fails to connect. #' @return A data frame with input genes as col 1 and output as col 2 #' @keywords internal -#' @export -#' -convert_genes <- function(genes, from = c("ENSMUSG", "ENSG", "MGI", "HGNC"), to = c("MGI", "HGNC"), - host = "https://www.ensembl.org") { +#' +convert_genes <- function( + genes, from = c("ENSMUSG", "ENSG", "MGI", "HGNC"), to = c("MGI", "HGNC"), + host = "https://www.ensembl.org") { # Check inputs: stopifnot(`Genes must be a vector of characters` = (is(genes, "character") & is(genes, "vector"))) - stopifnot(`From must be one of ENSMUSG, ENSG, MGI, or HGNC` = from %in% c("ENSMUSG", "ENSG", "MGI", - "HGNC")) + stopifnot(`From must be one of ENSMUSG, ENSG, MGI, or HGNC` = from %in% c( + "ENSMUSG", "ENSG", "MGI", + "HGNC" + )) stopifnot(`To must be one of MGI or HGNC` = to %in% c("MGI", "HGNC")) stopifnot(`Host must be web host to connect to` = (is(host, "character") & length(host) == 1)) if (from == "ENSMUSG") { @@ -602,21 +652,29 @@ convert_genes <- function(genes, from = c("ENSMUSG", "ENSG", "MGI", "HGNC"), to tarMart <- useMart("ensembl", dataset = "hsapiens_gene_ensembl", host = host) tarAtts <- "hgnc_symbol" } - genesV2 <- getLDS(attributes = sourceAtts, filters = sourceAtts, values = genes, mart = srcMart, - attributesL = tarAtts, martL = tarMart, uniqueRows = FALSE) + genesV2 <- getLDS( + attributes = sourceAtts, filters = sourceAtts, values = genes, mart = srcMart, + attributesL = tarAtts, martL = tarMart, uniqueRows = FALSE + ) return(genesV2) } + #' Adds a column to the RL signaling data frame. -#' -#' This function adds a column to the internal rl 'map' used to map all +#' +#' This function adds a column to the internal rl 'map' used to map all #' receptor and receptor complexes to all ligand and ligand complexes. -#' +#' #' @param map RL signaling data frame. #' @param map_ref Name of column to match new data to #' @param conv Data frame matching current data in map to new data. #' @param new_name Name of new column to be created in RL map #' @return An updated RL signaling data frame -#' +#' @export +#' @examples +#' lr_name <- data.frame("abbrev" = c("L", "R"), "full" = c("Ligand", "Receptor")) +#' rl_map_expanded <- add_rl_column(map = domino2:::rl_map_tiny, map_ref = "type_A", +#' conv = lr_name, new_name = "type_A_full") +#' add_rl_column <- function(map, map_ref, conv, new_name) { map_in_ref <- match(map[[map_ref]], conv[, 1]) not_in_ref <- which(is.na(map_in_ref)) @@ -643,10 +701,10 @@ add_rl_column <- function(map, map_ref, conv, new_name) { } #' Calculate mean ligand expression as a data.frame for plotting in circos plot -#' +#' #' Creates a data frame of mean ligand expression for use in plotting a circos #' plot of ligand expression and saving tables of mean expression. -#' +#' #' @param x Gene by cell expression matrix #' @param ligands Character vector of ligand genes to be quantified #' @param cell_ident Vector of cell type (identity) names for which to calculate mean ligand gene expression @@ -654,6 +712,11 @@ add_rl_column <- function(map, map_ref, conv, new_name) { #' @param destination Name of the receptor with which each ligand interacts #' @return A data frame of ligand expression targeting the specified receptor #' @export +#' @examples +#' counts <- dom_counts(domino2:::pbmc_dom_built_tiny) +#' mean_exp <- mean_ligand_expression(counts, +#' ligands = c("PTPRC", "FASLG"), cell_ident = "CD14_monocyte", +#' cell_barcodes = colnames(counts), destination = "FAS") #' mean_ligand_expression <- function(x, ligands, cell_ident, cell_barcodes, destination){ # initiate data frame to store results diff --git a/R/plot_fxns.R b/R/plot_fxns.R index 8e17c42..ad2d731 100644 --- a/R/plot_fxns.R +++ b/R/plot_fxns.R @@ -8,10 +8,10 @@ NULL #' Create a network heatmap -#' -#' Creates a heatmap of the signaling network. Alternatively, the network +#' +#' Creates a heatmap of the signaling network. Alternatively, the network #' matrix can be accessed directly in the signaling slot of a domino object. -#' +#' #' @param dom Domino object with network built ([build_domino()]) #' @param clusts Vector of clusters to be included. If NULL then all clusters are used. #' @param min_thresh Minimum signaling threshold for plotting. Defaults to -Inf for no threshold. @@ -29,8 +29,9 @@ NULL #' #normalize #' signaling_heatmap(domino2:::pbmc_dom_built_tiny, normalize = "rec_norm") #' -signaling_heatmap <- function(dom, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, scale = "none", - normalize = "none", ...) { +signaling_heatmap <- function( + dom, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, scale = "none", + normalize = "none", ...) { if (!dom@misc[["build"]]) { stop("Please run domino_build prior to generate signaling network.") } @@ -63,15 +64,16 @@ signaling_heatmap <- function(dom, clusts = NULL, min_thresh = -Inf, max_thresh ... ) } + #' Create a cluster incoming signaling heatmap -#' +#' #' Creates a heatmap of a cluster incoming signaling matrix. Each cluster has a #' list of ligands capable of activating its enriched transcription factors. The -#' function creates a heatmap of cluster average expression for all of those +#' function creates a heatmap of cluster average expression for all of those #' ligands. A list of all cluster incoming signaling matrices can be found in #' the cl_signaling_matrices slot of a domino option as an alternative to this #' plotting function. -#' +#' #' @param dom Domino object with network built ([build_domino()]) #' @param rec_clust Which cluster to select as the receptor. Must match naming of clusters in the domino object. #' @param clusts Vector of clusters to be included. If NULL then all clusters are used. @@ -86,9 +88,10 @@ signaling_heatmap <- function(dom, clusts = NULL, min_thresh = -Inf, max_thresh #' @examples #' #incoming signaling of the CD8 T cells #' incoming_signaling_heatmap(domino2:::pbmc_dom_built_tiny, "CD8_T_cell") -#' -incoming_signaling_heatmap <- function(dom, rec_clust, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, - scale = "none", normalize = "none", title = TRUE, ...) { +#' +incoming_signaling_heatmap <- function( + dom, rec_clust, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, + scale = "none", normalize = "none", title = TRUE, ...) { if (!dom@misc[["build"]]) { stop("Please run domino_build prior to generate signaling network.") } @@ -97,7 +100,7 @@ incoming_signaling_heatmap <- function(dom, rec_clust, clusts = NULL, min_thresh } mat <- dom@cl_signaling_matrices[[rec_clust]] if (dim(mat)[1] == 0) { - print("No signaling found for this cluster under build parameters.") + message("No signaling found for this cluster under build parameters.") return() } if (!is.null(clusts)) { @@ -151,12 +154,13 @@ incoming_signaling_heatmap <- function(dom, rec_clust, clusts = NULL, min_thresh ) } } + #' Create a cluster to cluster signaling network diagram -#' +#' #' Creates a network diagram of signaling between clusters. Nodes are clusters #' and directed edges indicate signaling from one cluster to another. Edges are #' colored based on the color scheme of the ligand expressing cluster. -#' +#' #' @param dom Domino object with network built ([build_domino()]) #' @param cols Named vector indicating the colors for clusters. Values are colors and names must match clusters in the domino object. If left as NULL then ggplot colors are generated for the clusters. #' @param edge_weight Weight for determining thickness of edges on plot. Signaling values are multiplied by this value. @@ -165,9 +169,9 @@ incoming_signaling_heatmap <- function(dom, rec_clust, clusts = NULL, min_thresh #' @param showIncomingSignalingClusts Vector of clusters to plot the incoming signaling on #' @param min_thresh Minimum signaling threshold. Values lower than the threshold will be set to the threshold. Defaults to -Inf for no threshold. #' @param max_thresh Maximum signaling threshold for plotting. Values higher than the threshold will be set to the threshold. Defaults to Inf for no threshold. -#' @param normalize Options to normalize the signaling matrix. Accepted inputs are 'none' for no normalization, 'rec_norm' to normalize to the maximum value with each receptor cluster, or 'lig_norm' to normalize to the maximum value within each ligand cluster +#' @param normalize Options to normalize the signaling matrix. Accepted inputs are 'none' for no normalization, 'rec_norm' to normalize to the maximum value with each receptor cluster, or 'lig_norm' to normalize to the maximum value within each ligand cluster #' @param scale How to scale the values (after thresholding). Options are 'none', 'sqrt' for square root, 'log' for log10, or 'sq' for square. -#' @param layout Type of layout to use. Options are 'random', 'sphere', 'circle', 'fr' for Fruchterman-Reingold force directed layout, and 'kk' for Kamada Kawai for directed layout. +#' @param layout Type of layout to use. Options are 'random', 'sphere', 'circle', 'fr' for Fruchterman-Reingold force directed layout, and 'kk' for Kamada Kawai for directed layout. #' @param scale_by How to size vertices. Options are 'lig_sig' for summed outgoing signaling, 'rec_sig' for summed incoming signaling, and 'none'. In the former two cases the values are scaled with asinh after summing all incoming or outgoing signaling. #' @param vert_scale Integer used to scale size of vertices with our without variable scaling from size_verts_by. #' @param plot_title Text for the plot's title. @@ -181,9 +185,10 @@ incoming_signaling_heatmap <- function(dom, rec_clust, clusts = NULL, min_thresh #' signaling_network(domino2:::pbmc_dom_built_tiny, showOutgoingSignalingClusts = "CD14_monocyte", scale = "none", #' norm = "none", layout = "fr", scale_by = "none", vert_scale = 5) #' -signaling_network <- function(dom, cols = NULL, edge_weight = 0.3, clusts = NULL, showOutgoingSignalingClusts = NULL, - showIncomingSignalingClusts = NULL, min_thresh = -Inf, max_thresh = Inf, normalize = "none", scale = "sq", - layout = "circle", scale_by = "rec_sig", vert_scale = 3, plot_title = NULL, ...) { +signaling_network <- function( + dom, cols = NULL, edge_weight = 0.3, clusts = NULL, showOutgoingSignalingClusts = NULL, + showIncomingSignalingClusts = NULL, min_thresh = -Inf, max_thresh = Inf, normalize = "none", scale = "sq", + layout = "circle", scale_by = "rec_sig", vert_scale = 3, plot_title = NULL, ...) { if (!length(dom@clusters)) { stop("This domino object was not built with clusters so there is no intercluster signaling.") } @@ -263,7 +268,7 @@ signaling_network <- function(dom, cols = NULL, edge_weight = 0.3, clusts = NULL # Get vert angle for labeling circos plot if (layout == "circle") { v_angles <- 1:length(igraph::V(graph)) - v_angles <- -2 * pi * (v_angles - 1)/length(v_angles) + v_angles <- -2 * pi * (v_angles - 1) / length(v_angles) igraph::V(graph)$label.degree <- v_angles } names(v_cols) <- c() @@ -295,17 +300,18 @@ signaling_network <- function(dom, cols = NULL, edge_weight = 0.3, clusts = NULL } plot(graph, layout = l, main = plot_title, ...) } + #' Create a gene association network -#' -#' Create a gene association network for genes from a given cluster. The +#' +#' Create a gene association network for genes from a given cluster. The #' selected cluster acts as the receptor for the gene association network, so #' only ligands, receptors, and features associated with the receptor cluster #' will be included in the plot. -#' +#' #' @param dom Domino object with network built ([build_domino()]) #' @param clust Receptor cluster to create the gene association network for. A vector of clusters may be provided. #' @param OutgoingSignalingClust Vector of clusters to plot the outgoing signaling from -#' @param class_cols Named vector of colors used to color classes of vertices. Values must be colors and names must be classes ('rec', 'lig', and 'feat' for receptors, ligands, and features.). +#' @param class_cols Named vector of colors used to color classes of vertices. Values must be colors and names must be classes ('rec', 'lig', and 'feat' for receptors, ligands, and features.). #' @param cols Named vector of colors for individual genes. Genes not included in this vector will be colored according to class_cols. #' @param lig_scale FALSE or a numeric value to scale the size of ligand vertices based on z-scored expression in the data set. #' @param layout Type of layout to use. Options are 'grid', 'random', 'sphere', 'circle', 'fr' for Fruchterman-Reingold force directed layout, and 'kk' for Kamada Kawai for directed layout. @@ -316,8 +322,9 @@ signaling_network <- function(dom, cols = NULL, edge_weight = 0.3, clusts = NULL #' #basic usage #' gene_network(domino2:::pbmc_dom_built_tiny, clust = "CD8_T_cell", OutgoingSignalingClust = "CD14_monocyte") #' -gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, class_cols = c(lig = "#FF685F", - rec = "#47a7ff", feat = "#39C740"), cols = NULL, lig_scale = 1, layout = "grid", ...) { +gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, + class_cols = c(lig = "#FF685F",rec = "#47a7ff", feat = "#39C740"), + cols = NULL, lig_scale = 1, layout = "grid", ...) { if (!dom@misc[["build"]]) { warning("Please build a signaling network with domino_build prior to plotting.") } @@ -334,7 +341,7 @@ gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, class # Check if signaling exists for target cluster mat <- dom@cl_signaling_matrices[[cl]] if (dim(mat)[1] == 0) { - print(paste("No signaling found for", cl, "under build parameters.")) + message(paste("No signaling found for", cl, "under build parameters.")) (next)() } all_sums <- c(all_sums, rowSums(mat)) @@ -344,7 +351,7 @@ gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, class all_sums <- all_sums[!duplicated(names(all_sums))] # If no signaling for target clusters then don't do anything if (length(tfs) == 0) { - print("No signaling found for provided clusters") + message("No signaling found for provided clusters") return() } } else { @@ -378,7 +385,7 @@ gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, class allowed_ligs <- names(mat[mat > 0]) all_sums <- mat[mat > 0] } else { - allowed_ligs <- rownames(mat[rowSums(mat) > 0, ]) #I remove any ligands with zeroes for all clusters + allowed_ligs <- rownames(mat[rowSums(mat) > 0, ]) # I remove any ligands with zeroes for all clusters all_sums <- rowSums(mat[rowSums(mat) > 0, ]) } } else { @@ -434,9 +441,9 @@ gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, class l[all_ligs, 1] <- -0.75 l[all_recs, 1] <- 0 l[all_tfs, 1] <- 0.75 - l[all_ligs, 2] <- (1:length(all_ligs)/mean(1:length(all_ligs)) - 1) * 2 - l[all_recs, 2] <- (1:length(all_recs)/mean(1:length(all_recs)) - 1) * 2 - l[all_tfs, 2] <- (1:length(all_tfs)/mean(1:length(all_tfs)) - 1) * 2 + l[all_ligs, 2] <- (1:length(all_ligs) / mean(1:length(all_ligs)) - 1) * 2 + l[all_recs, 2] <- (1:length(all_recs) / mean(1:length(all_recs)) - 1) * 2 + l[all_tfs, 2] <- (1:length(all_tfs) / mean(1:length(all_tfs)) - 1) * 2 rownames(l) <- c() } else if (layout == "random") { l <- igraph::layout_randomly(graph) @@ -452,11 +459,12 @@ gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, class plot(graph, layout = l, main = paste0("Signaling ", OutgoingSignalingClust, " to ", clust), ...) return(invisible(list(graph = graph, layout = l))) } + #' Create a heatmap of features organized by cluster -#' +#' #' Creates a heatmap of feature expression (typically transcription factor #' activation scores) by cells organized by cluster. -#' +#' #' @param dom Domino object with network built ([build_domino()]) #' @param bool Boolean indicating whether the heatmap should be continuous or boolean. If boolean then bool_thresh will be used to determine how to define activity as positive or negative. #' @param bool_thresh Numeric indicating the threshold separating 'on' or 'off' for feature activity if making a boolean heatmap. @@ -476,8 +484,9 @@ gene_network <- function(dom, clust = NULL, OutgoingSignalingClust = NULL, class #' #using thresholds #' feat_heatmap(domino2:::pbmc_dom_built_tiny, min_thresh = 0.1, max_thresh = 0.6, norm = TRUE, bool = FALSE) #' -feat_heatmap <- function(dom, feats = NULL, bool = FALSE, bool_thresh = 0.2, title = TRUE, norm = FALSE, - cols = NULL, ann_cols = TRUE, min_thresh = NULL, max_thresh = NULL, ...) { +feat_heatmap <- function( + dom, feats = NULL, bool = FALSE, bool_thresh = 0.2, title = TRUE, norm = FALSE, + cols = NULL, ann_cols = TRUE, min_thresh = NULL, max_thresh = NULL, ...) { if (!length(dom@clusters)) { warning("This domino object wasn't built with clusters. Cells will not be ordered.") ann_cols <- FALSE @@ -518,7 +527,7 @@ feat_heatmap <- function(dom, feats = NULL, bool = FALSE, bool_thresh = 0.2, tit na <- which(is.na(mid)) na_feats <- paste(feats[na], collapse = " ") if (length(na) != 0) { - print(paste("Unable to find", na_feats)) + message(paste("Unable to find", na_feats)) feats <- feats[-na] } } else if (feats == "all") { @@ -575,11 +584,12 @@ feat_heatmap <- function(dom, feats = NULL, bool = FALSE, bool_thresh = 0.2, tit ) } } + #' Create a heatmap of correlation between receptors and transcription factors -#' -#' Creates a heatmap of correlation values between receptors and transcription +#' +#' Creates a heatmap of correlation values between receptors and transcription #' factors either with boolean threshold or with continuous values displayed -#' +#' #' @param dom Domino object with network built ([build_domino()]) #' @param bool Boolean indicating whether the heatmap should be continuous or boolean. If boolean then bool_thresh will be used to determine how to define activity as positive or negative. #' @param bool_thresh Numeric indicating the threshold separating 'on' or 'off' for feature activity if making a boolean heatmap. @@ -597,9 +607,10 @@ feat_heatmap <- function(dom, feats = NULL, bool = FALSE, bool_thresh = 0.2, tit #' cor_heatmap(domino2:::pbmc_dom_built_tiny, bool = TRUE, bool_thresh = 0.25) #' #identify combinations that are connected #' cor_heatmap(domino2:::pbmc_dom_built_tiny, bool = FALSE, mark_connections = TRUE) -#' -cor_heatmap <- function(dom, bool = FALSE, bool_thresh = 0.15, title = TRUE, feats = NULL, recs = NULL, - mark_connections = FALSE, ...) { +#' +cor_heatmap <- function( + dom, bool = FALSE, bool_thresh = 0.15, title = TRUE, feats = NULL, recs = NULL, + mark_connections = FALSE, ...) { mat <- dom@cor if (bool) { cp <- mat @@ -622,7 +633,7 @@ cor_heatmap <- function(dom, bool = FALSE, bool_thresh = 0.15, title = TRUE, fea na <- which(is.na(mid)) na_feats <- paste(feats[na], collapse = " ") if (length(na) != 0) { - print(paste("Unable to find", na_feats)) + message(paste("Unable to find", na_feats)) feats <- feats[-na] } } else if (identical(feats, "all")) { @@ -673,10 +684,11 @@ cor_heatmap <- function(dom, bool = FALSE, bool_thresh = 0.15, title = TRUE, fea ) } } + #' Create a correlation plot between transcription factor activation score and receptor -#' +#' #' Create a correlation plot between transcription factor activation score and receptor -#' +#' #' @param dom Domino object with network built ([build_domino()]) #' @param tf Target TF module for plotting with receptor #' @param rec Target receptor for plotting with TF @@ -684,10 +696,9 @@ cor_heatmap <- function(dom, bool = FALSE, bool_thresh = 0.15, title = TRUE, fea #' @param ... Other parameters to pass to ggscatter. #' @return a ggplot object #' @export cor_scatter -#' @examples -#' #basic usage +#' @examples #' cor_scatter(domino2:::pbmc_dom_built_tiny, "ATF4","CD22") -#' +#' cor_scatter <- function(dom, tf, rec, remove_rec_dropout = TRUE, ...) { if (remove_rec_dropout) { keep_id <- which(dom@counts[rec, ] > 0) @@ -701,11 +712,12 @@ cor_scatter <- function(dom, tf, rec, remove_rec_dropout = TRUE, ...) { ggscatter(dat, x = "rec", y = "tf", add = "reg.line", conf.int = FALSE, cor.coef = FALSE, cor.method = "pearson", xlab = rec, ylab = tf, size = 0.25, ...) } + #' Plot expression of a receptor's ligands by other cell types as a chord plot -#' +#' #' Creates a chord plot of expression of ligands that can activate a specified #' receptor where chord widths correspond to mean ligand expression by the cluster. -#' +#' #' @param dom Domino object that has undergone network building with [build_domino()] #' @param receptor Name of a receptor active in at least one cell type in the domino object #' @param ligand_expression_threshold Minimum mean expression value of a ligand by a cell type for a chord to be rendered between the cell type and the receptor @@ -721,8 +733,9 @@ cor_scatter <- function(dom, tf, rec, remove_rec_dropout = TRUE, ...) { #' names(cols) = levels(domino2:::pbmc_dom_built_tiny@clusters) #' circos_ligand_receptor(domino2:::pbmc_dom_built_tiny, receptor = "FAS", cell_colors = cols) #' -circos_ligand_receptor <- function(dom, receptor, ligand_expression_threshold = 0.01, cell_idents = NULL, - cell_colors = NULL) { +circos_ligand_receptor <- function( + dom, receptor, ligand_expression_threshold = 0.01, cell_idents = NULL, + cell_colors = NULL) { ligands <- dom@linkages$rec_lig[[receptor]] signaling_df <- NULL if (is.null(cell_idents)) { @@ -749,7 +762,7 @@ circos_ligand_receptor <- function(dom, receptor, ligand_expression_threshold = signaling_df$mean.expression[is.na(signaling_df$mean.expression)] <- 0 # create a scaled mean expression plot for coord widths greater than 1 by dividing by the max # expression [range (0-1)] scaled.mean will only be used when the max expression is > 1 - signaling_df$scaled.mean.expression <- signaling_df$mean.expression/max(signaling_df$mean.expression) + signaling_df$scaled.mean.expression <- signaling_df$mean.expression / max(signaling_df$mean.expression) # exit function if no ligands are expressed above ligand expression threshold if (sum(signaling_df[["mean.expression"]] > ligand_expression_threshold) == 0) { stop(paste0("No ligands of ", receptor, " exceed ligand expression threshold.")) @@ -758,13 +771,14 @@ circos_ligand_receptor <- function(dom, receptor, ligand_expression_threshold = arc_df <- signaling_df[, c("origin", "destination")] arc_df["ligand.arc"] <- 1 # receptor arc will always sum to 4 no matter how many ligands and cell idents are plotted - arc_df["receptor.arc"] <- 4/(nrow(signaling_df)) + arc_df["receptor.arc"] <- 4 / (nrow(signaling_df)) # name grouping based on [cell_ident] nm <- c(receptor, arc_df$origin) group <- structure(c(nm[1], gsub("-.*", "", nm[-1])), names = nm) # order group as a factor with the receptor coming first - group <- factor(group, levels = c(receptor, sort(unique(gsub("-.*", "", nm))[-1]) # alphabetical order of the other cell idents -)) + group <- factor(group, levels = c( + receptor, sort(unique(gsub("-.*", "", nm))[-1]) # alphabetical order of the other cell idents + )) # colors for ligand chords lig_colors <- ggplot_col_gen(length(ligands)) names(lig_colors) <- ligands @@ -773,15 +787,17 @@ circos_ligand_receptor <- function(dom, receptor, ligand_expression_threshold = cell_colors <- ggplot_col_gen(length(cell_idents)) names(cell_colors) <- cell_idents } - grid_col <- c("#FFFFFF") # hide the arc corresponding to the receptor by coloring white + grid_col <- c("#FFFFFF") # hide the arc corresponding to the receptor by coloring white for (i in 1:length(ligands)) { grid_col <- c(grid_col, rep(lig_colors[i], length(cell_idents))) } names(grid_col) <- c(receptor, signaling_df$origin) circlize::circos.clear() circlize::circos.par(start.degree = 0) - circlize::chordDiagram(arc_df, group = group, grid.col = grid_col, link.visible = FALSE, annotationTrack = c("grid"), - preAllocateTracks = list(track.height = circlize::mm_h(4), track.margin = c(circlize::mm_h(2), 0)), big.gap = 2) + circlize::chordDiagram(arc_df, + group = group, grid.col = grid_col, link.visible = FALSE, annotationTrack = c("grid"), + preAllocateTracks = list(track.height = circlize::mm_h(4), track.margin = c(circlize::mm_h(2), 0)), big.gap = 2 + ) for (send in signaling_df$origin) { if (signaling_df[signaling_df$origin == send, ][["mean.expression"]] > ligand_expression_threshold) { if (max(signaling_df[["mean.expression"]]) > 1) { @@ -791,8 +807,10 @@ circos_ligand_receptor <- function(dom, receptor, ligand_expression_threshold = expr <- signaling_df[signaling_df$origin == send, ][["mean.expression"]] max_width <- 1 } - circlize::circos.link(send, c(0.5 - (expr/2), 0.5 + (expr/2)), receptor, 2, col = paste0(grid_col[[send]], - "88")) + circlize::circos.link(send, c(0.5 - (expr / 2), 0.5 + (expr / 2)), receptor, 2, col = paste0( + grid_col[[send]], + "88" + )) } } sector_names <- circlize::get.all.sector.index() @@ -800,41 +818,55 @@ circos_ligand_receptor <- function(dom, receptor, ligand_expression_threshold = for (cell in cell_sectors) { row_pick <- sector_names[grepl(paste0("^", cell), sector_names)] if (length(row_pick)) { - circlize::highlight.sector(sector_names[grepl(paste0("^", cell, "-"), sector_names)], track.index = 1, + circlize::highlight.sector(sector_names[grepl(paste0("^", cell, "-"), sector_names)], + track.index = 1, col = cell_colors[cell], text = cell, cex = 1, facing = "inside", text.col = "black", - niceFacing = FALSE, text.vjust = -1.5) + niceFacing = FALSE, text.vjust = -1.5 + ) } } # highlight receptor sector - circlize::highlight.sector(sector_names[grepl(paste0("^", receptor, "$"), sector_names)], track.index = 1, + circlize::highlight.sector(sector_names[grepl(paste0("^", receptor, "$"), sector_names)], + track.index = 1, col = "#FFFFFF", text = receptor, cex = 1.5, facing = "clockwise", text.col = "black", niceFacing = TRUE, - pos = 4) + pos = 4 + ) # create legends - lgd_cells <- ComplexHeatmap::Legend(at = as.character(cell_idents), type = "grid", legend_gp = grid::gpar(fill = cell_colors), - title_position = "topleft", title = "cell identity") - lgd_ligands <- ComplexHeatmap::Legend(at = ligands, type = "grid", legend_gp = grid::gpar(fill = lig_colors), title_position = "topleft", - title = "ligand") - chord_width <- 10/(4 + length(cell_idents) * length(ligands)) - lgd_chord <- ComplexHeatmap::Legend(at = c(ligand_expression_threshold, max_width), col_fun = circlize::colorRamp2(c(ligand_expression_threshold, - max_width), c("#DDDDDD", "#DDDDDD")), legend_height = grid::unit(chord_width, "in"), title_position = "topleft", - title = "ligand expression") + lgd_cells <- ComplexHeatmap::Legend( + at = as.character(cell_idents), type = "grid", legend_gp = grid::gpar(fill = cell_colors), + title_position = "topleft", title = "cell identity" + ) + lgd_ligands <- ComplexHeatmap::Legend( + at = ligands, type = "grid", legend_gp = grid::gpar(fill = lig_colors), title_position = "topleft", + title = "ligand" + ) + chord_width <- 10 / (4 + length(cell_idents) * length(ligands)) + lgd_chord <- ComplexHeatmap::Legend( + at = c(ligand_expression_threshold, max_width), col_fun = circlize::colorRamp2(c( + ligand_expression_threshold, + max_width + ), c("#DDDDDD", "#DDDDDD")), legend_height = grid::unit(chord_width, "in"), title_position = "topleft", + title = "ligand expression" + ) lgd_list_vertical <- ComplexHeatmap::packLegend(lgd_cells, lgd_ligands, lgd_chord) ComplexHeatmap::draw(lgd_list_vertical, x = grid::unit(0.02, "npc"), y = grid::unit(0.98, "npc"), just = c("left", "top")) } + #' Plot differential linkages among domino results ranked by a comparative statistic -#' +#' #' Plot differential linkages among domino results ranked by a comparative statistic -#' +#' #' @param differential_linkages a data.frame output from the test_differential_linkages function #' @param test_statistic column name of differential_linkages where the test statistic used for ranking linkages is stored (ex. 'p.value') #' @param stat_range a two value vector of the minimum and maximum values of test_statistic for plotting linkage features -#' @param stat_ranking 'ascending' (lowest value of test statisic is colored red and plotted at the top) or 'descending' (highest value of test statistic is colored red and plotted at the top). +#' @param stat_ranking 'ascending' (lowest value of test statisic is colored red and plotted at the top) or 'descending' (highest value of test statistic is colored red and plotted at the top). #' @param group_palette a named vector of colors to use for each group being compared #' @return a Heatmap-class object of features ranked by test_statistic annotated with the proportion of subjects that showed active linkage of the features. #' @export -#' -plot_differential_linkages <- function(differential_linkages, test_statistic, stat_range = c(0, 1), - stat_ranking = c("ascending", "descending"), group_palette = NULL) { +#' +plot_differential_linkages <- function( + differential_linkages, test_statistic, stat_range = c(0, 1), + stat_ranking = c("ascending", "descending"), group_palette = NULL) { if (!test_statistic %in% colnames(differential_linkages)) { stop(paste0("test statistic '", test_statistic, "' not present in colnames(differential_linkages)")) } @@ -865,20 +897,27 @@ plot_differential_linkages <- function(differential_linkages, test_statistic, st g_names_full <- colnames(df)[grepl("_n$", colnames(df)) & !grepl("^total_", colnames(df))] g_names <- gsub("_n", "", g_names_full) # proportion bar for linkage feature in all subjects - ha_subject <- ComplexHeatmap::HeatmapAnnotation(subjects = ComplexHeatmap::anno_barplot(matrix(ncol = 2, c(df[["total_count"]], - df[["total_n"]] - df[["total_count"]])), gp = grid::gpar(fill = c("black", "white"))), which = "row", - annotation_name_gp = grid::gpar(fontsize = 8)) + ha_subject <- ComplexHeatmap::HeatmapAnnotation( + subjects = ComplexHeatmap::anno_barplot(matrix(ncol = 2, c( + df[["total_count"]], + df[["total_n"]] - df[["total_count"]] + )), gp = grid::gpar(fill = c("black", "white"))), which = "row", + annotation_name_gp = grid::gpar(fontsize = 8) + ) ha_subject@anno_list$subjects@label <- "All\nSubjects" # row annotation of linkage feature names ha_name <- ComplexHeatmap::rowAnnotation(feat = ComplexHeatmap::anno_text(df[["feature"]], location = 0, rot = 0)) # plotted statistic for ordering results mat <- matrix(df[[test_statistic]], ncol = 1) rownames(mat) <- df[["feature"]] - plot <- ComplexHeatmap::Heatmap(matrix = mat, cluster_rows = FALSE, left_annotation = ha_name, cell_fun = function(j, - i, x, y, width, height, fill) { + plot <- ComplexHeatmap::Heatmap(matrix = mat, cluster_rows = FALSE, left_annotation = ha_name, cell_fun = function( + j, + i, x, y, width, height, fill) { grid::grid.text(sprintf("%.3f", mat[i, j]), x, y, gp = grid::gpar(fontsize = 6)) - }, column_title = paste0(cluster, ": ", test_statistic), name = test_statistic, col = circlize::colorRamp2(breaks = stat_range, - colors = stat_gradient), height = nrow(mat) * grid::unit(0.25, "in"), width = grid::unit(1, "in")) + ha_subject + }, column_title = paste0(cluster, ": ", test_statistic), name = test_statistic, col = circlize::colorRamp2( + breaks = stat_range, + colors = stat_gradient + ), height = nrow(mat) * grid::unit(0.25, "in"), width = grid::unit(1, "in")) + ha_subject # generate an heatmap annotation for each category if (is.null(group_palette)) { group_palette <- ggplot_col_gen(length(g_names)) @@ -888,43 +927,48 @@ plot_differential_linkages <- function(differential_linkages, test_statistic, st g <- g_names[i] g_count <- paste0(g, "_count") g_n <- paste0(g, "_n") - ha <- ComplexHeatmap::HeatmapAnnotation(group = ComplexHeatmap::anno_barplot(matrix(ncol = 2, c(df[[g_count]], df[[g_n]] - - df[[g_count]])), gp = grid::gpar(fill = c(group_palette[g], "#FFFFFF"))), name = g, which = "row", - annotation_name_gp = grid::gpar(fontsize = 8)) + ha <- ComplexHeatmap::HeatmapAnnotation( + group = ComplexHeatmap::anno_barplot(matrix(ncol = 2, c(df[[g_count]], df[[g_n]] - + df[[g_count]])), gp = grid::gpar(fill = c(group_palette[g], "#FFFFFF"))), name = g, which = "row", + annotation_name_gp = grid::gpar(fontsize = 8) + ) ha@anno_list$group@label <- g plot <- plot + ha } return(plot) } + #' Normalize a matrix to its max value by row or column -#' +#' #' Normalizes a matrix to its max value by row or column -#' +#' #' @param mat Matrix to be normalized -#' @param dir Direction to normalize the matrix c('row', 'col') +#' @param dir Direction to normalize the matrix c('row', 'col') #' @return A normalized matrix in the direction specified. #' @keywords internal -#' +#' do_norm <- function(mat, dir) { if (dir == "row") { mat <- t(apply(mat, 1, function(x) { - x/max(x) + x / max(x) })) return(mat) } else if (dir == "col") { mat <- apply(mat, 2, function(x) { - x/max(x) + x / max(x) }) return(mat) } } + #' Generate ggplot colors -#' +#' #' Accepts a number of colors to generate and generates a ggplot color spectrum. -#' +#' #' @param n Number of colors to generate #' @return A vector of colors according to ggplot color generation. #' @keywords internal +#' ggplot_col_gen <- function(n) { hues <- seq(15, 375, length = n + 1) return(grDevices::hcl(h = hues, l = 65, c = 100)[1:n]) diff --git a/R/processing_fxns.R b/R/processing_fxns.R index 2b147d3..66d4e08 100644 --- a/R/processing_fxns.R +++ b/R/processing_fxns.R @@ -1,9 +1,9 @@ #' Calculate a signaling network for a domino object -#' +#' #' This function calculates a signaling network. It requires a domino object -#' preprocessed from create_domino and returns a domino object prepared for +#' preprocessed from create_domino and returns a domino object prepared for #' plotting with the various plotting functions in this package. -#' +#' #' @param dom Domino object from create_domino. #' @param max_tf_per_clust Maximum number of transcription factors called active in a cluster. #' @param min_tf_pval Minimum p-value from differential feature score test to call a transcription factor active in a cluster. @@ -11,16 +11,22 @@ #' @param rec_tf_cor_threshold Minimum pearson correlation used to consider a receptor linked with a transcription factor. Increasing this will decrease the number of receptors linked to each transcription factor. #' @param min_rec_percentage Minimum percentage of cells in cluster expressing a receptor for the receptor to be linked to trancription factors in that cluster. #' @return A domino object with a signaling network built -#' @export +#' @export +#' @examples +#' pbmc_dom_tiny_built <- build_domino(dom = domino2:::pbmc_dom_tiny, min_tf_pval = .001, max_tf_per_clust = 25, +#' max_rec_per_tf = 25, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1) #' -build_domino <- function(dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_per_tf = 5, rec_tf_cor_threshold = 0.15, - min_rec_percentage = 0.1) { +build_domino <- function( + dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_per_tf = 5, rec_tf_cor_threshold = 0.15, + min_rec_percentage = 0.1) { if (dom@misc[["create"]] == FALSE) { stop("Please run domino_create to create the domino object.") } dom@misc[["build"]] <- TRUE - dom@misc[["build_vars"]] <- c(max_tf_per_clust = max_tf_per_clust, min_tf_pval = min_tf_pval, - max_rec_per_tf = max_rec_per_tf, rec_tf_cor_threshold = rec_tf_cor_threshold, min_rec_percentage = min_rec_percentage) + dom@misc[["build_vars"]] <- c( + max_tf_per_clust = max_tf_per_clust, min_tf_pval = min_tf_pval, + max_rec_per_tf = max_rec_per_tf, rec_tf_cor_threshold = rec_tf_cor_threshold, min_rec_percentage = min_rec_percentage + ) if (length(dom@clusters)) { # Get transcription factors for each cluster clust_tf <- list() @@ -31,8 +37,10 @@ build_domino <- function(dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_ zeros <- names(ordered)[which(ordered == 0)] fcs <- c() for (zero in zeros) { - fc <- mean(dom@features[zero, which(dom@clusters == clust)]) - mean(dom@features[zero, - which(dom@clusters != clust)]) + fc <- mean(dom@features[zero, which(dom@clusters == clust)]) - mean(dom@features[ + zero, + which(dom@clusters != clust) + ]) fcs <- c(fcs, fc) } names(fcs) <- zeros @@ -117,9 +125,9 @@ build_domino <- function(dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_ # if complexes were used inc_ligs_list <- lapply(inc_ligs, function(l) { if (l %in% names(dom@linkages$complexes)) { - return(dom@linkages$complexes[[l]]) + return(dom@linkages$complexes[[l]]) } else { - return(l) + return(l) } }) names(inc_ligs_list) <- inc_ligs @@ -151,12 +159,12 @@ build_domino <- function(dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_ # if complexes were used cl_sig_list <- lapply(seq_along(inc_ligs_list), function(x) { if (all(inc_ligs_list[[x]] %in% lig_genes)) { - # Some of the ligands in the list object may not be present in the data - if (length(inc_ligs_list[[x]]) > 1) { - return(colMeans(cl_sig_mat[inc_ligs_list[[x]], ])) - } else { - return(cl_sig_mat[inc_ligs_list[[x]], ]) - } + # Some of the ligands in the list object may not be present in the data + if (length(inc_ligs_list[[x]]) > 1) { + return(colMeans(cl_sig_mat[inc_ligs_list[[x]], ])) + } else { + return(cl_sig_mat[inc_ligs_list[[x]], ]) + } } }) names(cl_sig_list) <- names(inc_ligs_list) @@ -192,15 +200,16 @@ build_domino <- function(dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_ } return(dom) } + #' Pulls all items from a list pooled into a single vector -#' +#' #' Helper function to convert from a nested series of lists to a single vector. -#' +#' #' @param list List to pull items from #' @param list_names Names of items in list to pool #' @return A vector contaning all items in the list by list_names #' @keywords internal -#' +#' lc <- function(list, list_names) { vec <- c() for (name in list_names) { diff --git a/R/utils.R b/R/utils.R index cf6a1f9..efafb76 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,16 +1,19 @@ #' Access database -#' +#' #' A function to pull database information from a domino object -#' +#' #' @param dom A domino object that has been created -#' @param name_only A boolean for whether to return only the name of the database used +#' @param name_only A boolean for whether to return only the name of the database used #' or the entire database that is stored. Default TRUE. -#' @return A vector of unique databases used in building the domino object OR +#' @return A vector of unique databases used in building the domino object OR #' a data frame that includes the database information used in the domino object creation #' @export - +#' @examples +#' database_name <- dom_database(domino2:::pbmc_dom_built_tiny) +#' full_database <- dom_database(domino2:::pbmc_dom_built_tiny, name_only = FALSE) +#' dom_database <- function(dom, name_only = TRUE) { - db = slot(dom, "db_info") + db <- slot(dom, "db_info") if (name_only) { return(unique(db$database_name)) } else { @@ -19,39 +22,47 @@ dom_database <- function(dom, name_only = TRUE) { } #' Access z-scores -#' +#' #' A function to pull z-scored expression from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @return A matrix containing the z-scored gene expression values for each gene (row) by cell (column) #' @export - +#' @examples +#' zscores <- dom_zscores(domino2:::pbmc_dom_built_tiny) +#' dom_zscores <- function(dom) { slot(dom, "z_scores") } #' Access counts -#' +#' #' A function to pull gene expression from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @return A matrix containing the gene expression values for each gene (row) by cell (column) #' @export +#' @examples +#' counts <- dom_counts(domino2:::pbmc_dom_built_tiny) +#' dom_counts <- function(dom) { as.matrix(slot(dom, "counts")) } #' Access clusters -#' +#' #' A function to pull cluster information from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @param labels A boolean for whether to return the cluster labels for each cell or the clusters used for inferring communication #' @return A vector containing either the names of the clusters used OR factors of the cluster label for each individual cell #' @export - +#' @examples +#' cluster_names <- dom_clusters(domino2:::pbmc_dom_built_tiny) +#' cell_cluster_label <- dom_clusters(domino2:::pbmc_dom_built_tiny, labels = TRUE) +#' dom_clusters <- function(dom, labels = FALSE) { - clust = slot(dom, "clusters") + clust <- slot(dom, "clusters") if (labels) { return(clust) } else { @@ -60,41 +71,53 @@ dom_clusters <- function(dom, labels = FALSE) { } #' Access transcription factor activation -#' +#' #' A function to pull transcription factor activation scores from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @return A matrix containing the transcription factor activation scores for each feature (row) by cell (column) #' @export +#' @examples +#' tf_activation <- dom_tf_activation(domino2:::pbmc_dom_built_tiny) +#' dom_tf_activation <- function(dom) { slot(dom, "features") } #' Access correlations -#' +#' #' A function to pull receptor-transcription factor correlations from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @return A matrix containing the correlation values for each receptor (row) by transcription factor (column) #' @export +#' @examples +#' cor_matrix <- dom_correlations(domino2:::pbmc_dom_built_tiny) +#' dom_correlations <- function(dom) { slot(dom, "cor") } #' Access linkages -#' +#' #' A function to pull linkages from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] -#' @param link_type One value (out of "complexes", "receptor-ligand", +#' @param link_type One value (out of "complexes", "receptor-ligand", #' "tf-target", "tf-receptor", "receptor", "incoming-ligand") used #' to select the desired type of linkage #' @param by_cluster A boolean to indicate whether the linkages should be returned overall or by cluster #' @return A list containing linkages between some combination of receptors, ligands, transcription factors, and clusters #' @export -dom_linkages <- function(dom, link_type = c("complexes", "receptor-ligand", - "tf-target", "tf-receptor", "receptor", "incoming-ligand"), by_cluster = FALSE) { - links = slot(dom, "linkages") +#' @examples +#' complexes <- dom_linkages(domino2:::pbmc_dom_built_tiny, "complexes") +#' tf_rec_by_cluster <- dom_linkages(domino2:::pbmc_dom_built_tiny, "tf-receptor", TRUE) +#' +dom_linkages <- function(dom, link_type = c( + "complexes", "receptor-ligand", + "tf-target", "tf-receptor", "receptor", "incoming-ligand" + ), by_cluster = FALSE) { + links <- slot(dom, "linkages") if (by_cluster) { if (link_type == "tf-receptor") { return(links$clust_tf) @@ -110,9 +133,9 @@ dom_linkages <- function(dom, link_type = c("complexes", "receptor-ligand", return(links$complexes) } else if (link_type == "receptor-ligand") { return(links$rec_lig) - } else if (link_type == "tf_targets") { + } else if (link_type == "tf-target") { return(links$tf_targets) - } else if (link_type == "tf_receptor") { + } else if (link_type == "tf-receptor") { return(links$tf_rec) } else { stop("This linkage type is not available.") @@ -121,16 +144,19 @@ dom_linkages <- function(dom, link_type = c("complexes", "receptor-ligand", } #' Access signaling -#' +#' #' A function to pull signaling matrices from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @param cluster Either NULL to indicate global signaling or a specific cluster for which a #' @return A data.frame containing the signaling score through each ligand (row) by each cluster (column) OR #' a data.frame containing the global summed signaling scores between receptors (rows) and ligands (columns) of each cluster #' @export +#' @examples +#' monocyte_signaling <- dom_signaling(domino2:::pbmc_dom_built_tiny, cluster = "CD14_monocyte") +#' dom_signaling <- function(dom, cluster = NULL) { - if(is.null(cluster)) { + if (is.null(cluster)) { as.data.frame(slot(dom, "signaling")) } else { as.data.frame(slot(dom, "cl_signaling_matrices")[cluster]) @@ -138,26 +164,86 @@ dom_signaling <- function(dom, cluster = NULL) { } #' Access differential expression -#' +#' #' A function to pull differential expression p values from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @return A matrix containing the p values for differential expression of transcription factors (rows) in each cluster (columns) #' @export +#' @examples +#' de_mat <- dom_de(domino2:::pbmc_dom_built_tiny) +#' dom_de <- function(dom) { slot(dom, "clust_de") } #' Access build information -#' +#' #' A function to pull the parameters used when running [build_domino()] from a domino object -#' +#' #' @param dom A domino object that has been created with [create_domino()] #' @return A list containing booleans for whether the object has been created and build, and a list of the #' build parameters that were used in [build_domino()] to infer the signaling network #' @export +#' @examples +#' build_details <- dom_info(domino2:::pbmc_dom_built_tiny) +#' dom_info <- function(dom) { - info = slot(dom, "misc") - return(list("create" = info$create, "build"= info$build, - "build_variables"= info$build_vars)) -} \ No newline at end of file + info <- slot(dom, "misc") + return(list( + "create" = info$create, "build" = info$build, + "build_variables" = info$build_vars + )) +} + +#' Access all features, receptors, or ligands present in a signaling network. +#' +#' This function collates all of the features, receptors, or ligands found in a +#' signaling network anywhere in a list of clusters. This can be useful for +#' comparing signaling networks across two separate conditions. In order to run +#' this [build_domino()] must be run on the object previously. +#' +#' @param dom Domino object containing a signaling network (i.e. [build_domino()] was run) +#' @param return String indicating where to collate "features", "receptors", or "ligands". If "all" then a list of all three will be returned. +#' @param clusters Vector indicating clusters to collate network items from. If left as NULL then all clusters will be included. +#' @return A vector containing all features, receptors, or ligands in the data set or a list containing all three. +#' @export +#' @examples +#' monocyte_receptors <- dom_network_items(domino2:::pbmc_dom_built_tiny, "CD14_monocyte", "receptors") +#' all_tfs <- dom_network_items(domino2:::pbmc_dom_built_tiny, return = "features") +#' +dom_network_items <- function(dom, clusters = NULL, return = NULL) { + if (!dom@misc[["build"]]) { + stop("Please run domino_build prior to generate signaling network.") + } + if (is.null(clusters) & is.null(dom@clusters)) { + stop("There are no clusters in this domino object. Please provide clusters.") + } + if (is.null(clusters)) { + clusters <- levels(dom@clusters) + } + # Get all enriched TFs and correlated + expressed receptors for specified clusters + all_recs <- c() + all_tfs <- c() + all_ligs <- c() + for (cl in clusters) { + all_recs <- c(all_recs, unlist(dom@linkages$clust_tf_rec[[cl]])) + tfs <- names(dom@linkages$clust_tf_rec[[cl]]) + tf_wo_rec <- which(sapply(dom@linkages$clust_tf_rec[[cl]], length) == 0) + if (length(tf_wo_rec > 0)) { + tfs <- tfs[-tf_wo_rec] + } + all_tfs <- c(all_tfs, tfs) + all_ligs <- c(all_ligs, rownames(dom@cl_signaling_matrices[[cl]])) + } + all_recs <- unique(all_recs) + all_tfs <- unique(all_tfs) + all_ligs <- unique(all_ligs) + # Make list and return whats asked for + list_out <- list(features = all_tfs, receptors = all_recs, ligands = all_ligs) + if (is.null(return)) { + return(list_out) + } else { + return(list_out[[return]]) + } +} diff --git a/_pkgdown.yml b/_pkgdown.yml index 60ea17b..8b3e355 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -28,7 +28,6 @@ reference: contents: - domino-class - linkage_summary - - pbmc_dom - title: "Analysis Functions" desc: > Functions for performing cell-cell communication analysis @@ -68,14 +67,13 @@ reference: - dom_de - dom_info - dom_linkages + - dom_network_items - dom_signaling - dom_tf_activation - dom_zscores - subtitle: "Misc. utility functions" contents: - add_rl_column - - collate_network_items - - convert_genes - count_linkage - mean_ligand_expression - rename_clusters diff --git a/docs/articles/domino2.html b/docs/articles/domino2.html index 93a0495..eb48e90 100644 --- a/docs/articles/domino2.html +++ b/docs/articles/domino2.html @@ -98,67 +98,36 @@
-

Using domino2 v0.2.1 for cell-cell communication inference +

Using domino2 v0.2.2 for cell-cell communication inference

domino2 is a tool for analysis of intra- and intercellular signaling in single cell RNA sequencing (scRNAseq) data based on transcription factor (TF) activation. Here, we show a basic example pipeline for generating communication networks as a domino object. This vignette will demonstrate how to use domino2 on the 10X Genomics Peripheral Blood Mononuclear Cells (PBMC) data set of 2,700 cells. The data can be downloaded here.

Preprocessing scRNAseq data

-

Analysis of cell-cell communication with domino2 often follows initial processing and annotation of scRNAseq data. We are following the Satija Lab’s Guided Clustering Tutorial to prepare the data set for analysis with domino2.

+

Analysis of cell-cell communication with domino2 often follows initial processing and annotation of scRNAseq data. We used the Satija Lab’s Guided Clustering Tutorial to prepare the data set for analysis with domino2. The complete processing script is available in the data-raw directory of the domino2 package. The processed data can be downloaded from Zenodo.

-# Preprocessing of PBMC 3K tutorial data set using Seurat functions
-pbmc.data <- Read10X(data.dir = "../inst/extdata/pbmc3k_filtered_gene_bc_matrices")
-pbmc <- CreateSeuratObject(counts = pbmc.data, project = "pbmc3k", min.cells = 3, min.features = 200)
-pbmc[["percent.mt"]] <- PercentageFeatureSet(pbmc, pattern = "^MT-")
-pbmc <- NormalizeData(pbmc, normalization.method = "LogNormalize", scale.factor = 10000)
-pbmc <- FindVariableFeatures(pbmc, selection.method = "vst", nfeatures = 2000)
-pbmc <- ScaleData(pbmc, features = rownames(pbmc))
-pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc))
-pbmc <- FindNeighbors(pbmc, dims = 1:10)
-pbmc <- FindClusters(pbmc, resolution = 0.5)
-#> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck
-#> 
-#> Number of nodes: 2700
-#> Number of edges: 97892
-#> 
-#> Running Louvain algorithm...
-#> Maximum modularity in 10 random starts: 0.8719
-#> Number of communities: 9
-#> Elapsed time: 0 seconds
-pbmc <- RunUMAP(pbmc, dims = 1:10)
-# Annotate clusters with cell phenotypes
-cell_dict <- data.frame(
-  cluster = c(0:8),
-  cell_type = c(
-    "naive_CD4_T_cell", "CD14_monocyte", "memory_CD4_T_cell", "B_cell", "CD8_T_cell",
-    "CD16_monocyte", "NK_cell", "dendritic_cell", "platelet"
-  )
-)
-
-pbmc$cell_type <-
-  plyr::mapvalues(
-    pbmc$seurat_clusters,
-    from = cell_dict$cluster,
-    to = cell_dict$cell_type
-  )
+pbmc <- readRDS(paste0(pbmc_dir, "/pbmc_seurat.rds"))

Saving Preprocessed Data:

-

domino2 was designed to be compatible with Seurat objects in addition to accepting matrices and vectors of the data set as function inputs. Therefore, it’s a good idea to save the processed Seurat object for further analysis. However, pySCENIC is used for TF activation inference, and it requires as input a cell by gene matrix. This is the opposite orientation of Seurat objects but is the default for Python based tools such as scanpy. Saving our data as a loom file using loomR will be helpful for that step and is therefore recommended as well.

+

domino2 was designed to be compatible with Seurat objects in addition to accepting matrices and vectors of the data set as function inputs. Therefore, it’s a good idea to save the processed Seurat object for further analysis. However, pySCENIC is used for TF activation inference, and it requires as input a cell by gene matrix. This is the opposite orientation of Seurat objects but is the default for Python based tools such as scanpy. The RNA counts matrix can be saved as a tab-seperated value (.tsv) or comma-sperated value (.csv) file after transposing the matrix to cell by gene orientation.

 # save Seurat object as RDS
-save(pbmc, file = "../data/pbmc.rda")
+save(pbmc, file = paste0(input_dir, "/pbmc.rda"))
+
+pbmc_counts <- GetAssayData(object = pbmc, slot = "counts")
+write.table(t(as.matrix(pbmc_counts)), paste0(input_dir, "/pbmc3k_counts.tsv"), sep = "\t",
+    col.names = NA)
+

tsv and csv files are very inefficient for storing large matrices. As an alternative, the counts matrix can be saved as a loom file and directly passed to pySCENIC in this format. Generating a loom file in R requires use of the loomR package. The package automatically handles the transposition of the counts matrix to cell by gene orientation as well. We recommend this approach to passing a counts matrix to pySCENIC. However, users should be aware that loomR is not hosted on CRAN or BioConductor at the time of this vignette’s creation.

+
+library(loomR)
 
 # save loom counts matrix
 pbmc_counts <- GetAssayData(object = pbmc, slot = "counts")
-pbmc_loom <- loomR::create(filename = "../inst/extdata/pbmc3k_counts.loom", data = pbmc_counts)
-pbmc_loom$close_all() # Remember to manually close connection to loom files!
+pbmc_loom <- loomR::create(filename = paste0(input_dir, "/pbmc3k_counts.loom"), data = pbmc_counts) +# connection to the loom file must be closed to complete file creation +pbmc_loom$close_all()

The cell x gene counts matrix may also be saved as a tab-separated value (.tsv) file if loomR cannot be used on your computing resource, but be aware that dense formatting of a .tsv can lead to very large file sizes and slow processing for large data sets. We have provided the necessary code below, but due to the large file size, this .tsv file is not provided in our data directory.

-
-pbmc_counts <- GetAssayData(object = pbmc, slot = "counts")
-write.table(t(as.matrix(pbmc_counts)), "../data/pbmc3k_counts.tsv",
-  sep = "\t", col.names = NA
-)

If you would like to skip ahead to the rest of the analysis, the processed objects from these steps are available in the data directory of this package.

@@ -168,7 +137,7 @@

Installationremotes package. The current stable version is v0.2.2, so we will install that branch.

 if (!require(remotes)) {
-  install.packages("remotes")
+    install.packages("remotes")
 }
 remotes::install_github("FertigLab/domino2@v0.2.2")
@@ -179,52 +148,43 @@

Additional DownloadsDownloads for SCENIC:

A singularity image of SCENIC v0.12.1 can be installed from the DockerHub image as a source (example scripts for use with Docker are provided in the scenic_bash directory as well). SCENIC requires a list of TFs, motif annotations, and cisTarget motifs which are all available from the authors of SCENIC for human (HGNC), mouse (MGI), and fly. The following will download everything necessary for an analysis of a data set with HGNC gene labels for the hg38 genome.

-
SCENIC_DIR="../inst/extdata/scenic"
+
SCENIC_DIR="'temp_dir'/scenic"
 mkdir ${SCENIC_DIR}
 
 # Build singularity image
 singularity build "${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif" docker://aertslab/pyscenic:0.12.1
 
-# Matrix containing motifs as rows and genes as columns and ranking position for each gene and motif (based on CRM scores) as values
-# below is a feather v1 format link; feather v2 required for this version of pySCENIC
-# "https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather"
-# Feather v2 link:
-curl "https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather" \
-  -o "${SCENIC_DIR}/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather"
-
-# below is a feather v1 format link; feather v2 required for this version of pySCENIC
-# "https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather"
-# Feather v2 link:
-curl "https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather" \
-  -o "${SCENIC_DIR}/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather"
-
-# List of genes encoding TFs in the HG38 reference genome
-curl "https://resources.aertslab.org/cistarget/tf_lists/allTFs_hg38.txt" \
-  -o "${SCENIC_DIR}/allTFs_hg38.txt"
-
-# Motif annotations based on the 2017 cisTarget motif collection. Use these files if you are using the mc9nr databases.
-curl "https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl" \
-  -o "${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl"
+# Matrix containing motifs as rows and genes as columns and ranking position for each gene and motif (based on CRM scores) as values. URLs provided link to v2 feather files required for the 0.12.1 version of pySENIC. + +curl "https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather" \ + -o "${SCENIC_DIR}/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather" + +curl "https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather" \ + -o "${SCENIC_DIR}/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather" + +# List of genes encoding TFs in the HG38 reference genome +curl "https://resources.aertslab.org/cistarget/tf_lists/allTFs_hg38.txt" \ + -o "${SCENIC_DIR}/allTFs_hg38.txt" + +# Motif annotations based on the 2017 cisTarget motif collection. Use these files if you are using the mc9nr databases. +curl "https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl" \ + -o "${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl"
Downloads for CellPhoneDB:

Database files from CellPhoneDB v4.0.0 for human scRNAseq data can be installed from a public Github repository from the Tiechmann Group that developed CellPhoneDB.

-
CELLPHONE_DIR="../inst/extdata/cellphoneDB_v4"
-mkdir ${CELLPHONE_DIR}
-
-# Annotation of protein complexes
-curl "https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/complex_input.csv" \
-  -o "${CELLPHONE_DIR}/complex_input.csv"
-# Annotation of genes encoding database proteins
-curl "https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/gene_input.csv" \
-  -o "${CELLPHONE_DIR}/gene_input.csv"
-# Annotated protein interactions
-curl "https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/interaction_input.csv" \
-  -o "${CELLPHONE_DIR}/interaction_input.csv"
-# Annotated protein features
-curl "https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/protein_input.csv" \
-  -o "${CELLPHONE_DIR}/protein_input.csv"
+
+#
+cellphone_url <- "https://github.com/ventolab/cellphonedb-data/archive/refs/tags/v4.0.0.tar.gz"
+
+# download compressed database
+cellphone_tar <- paste0(temp_dir, "/cellphoneDB_v4.tar.gz")
+download.file(url = cellphone_url, destfile = cellphone_tar)
+
+# move contents of the compressed file to a new directory
+untar(tarfile = cellphone_tar, exdir = cellphone_dir)
+cellphone_data <- paste0(cellphone_dir, "/cellphonedb-data-4.0.0/data")
@@ -299,24 +259,19 @@

Loading SCENIC Results

The TF activities are a required input for domino2, and the regulons learned by SCENIC are an important but optional input needed to annotate TF-target interactions and to prune TF-receptor linkages where the receptor is a target of the TF. This prevents the distinction of receptor expression driving TF activity or the TF inducing the receptor’s expression.

-scenic_dir <- "../inst/extdata/scenic/"
-regulons <- read.csv(paste0(scenic_dir, "/regulons_pbmc_3k.csv"))
-auc <- read.table(paste0(scenic_dir, "/auc_pbmc_3k.csv"),
-  header = TRUE, row.names = 1,
-  stringsAsFactors = FALSE, sep = ","
-)
-

The initial regulons data frame read into R from the ctx function has 2 rows of column names that need to be replaced with one succinct description. domino2 has changed the input format for TF regulons to be a list storing vectors of target genes in each regulon, where the names of the list are the TF genes. This facilitates the use of alternative methods for TF activity quantification methods. We provide a helper function, create_regulon_list_scenic() for easy retrieval of TF regulons from the output of the pySCENIC ctx function.

+regulons <- read.csv(paste0(scenic_dir, "/regulons_pbmc_3k.csv")) +auc <- read.table(paste0(scenic_dir, "/auc_pbmc_3k.csv"), header = TRUE, row.names = 1, + stringsAsFactors = FALSE, sep = ",") +

The initial regulons data frame read into R from the ctx function has 2 rows of column names that need to be replaced with one succinct description. domino2 has changed the input format for TF regulons to be a list storing vectors of target genes in each regulon, where the names of the list are the TF genes. This facilitates the use of alternative methods for TF activity quantification. We provide a helper function, create_regulon_list_scenic() for easy retrieval of TF regulons from the output of the pySCENIC ctx function.

 regulons <- regulons[-1:-2, ]
-colnames(regulons) <- c(
-  "TF", "MotifID", "AUC", "NES", "MotifSimilarityQvalue", "OrthologousIdentity",
-  "Annotation", "Context", "TargetGenes", "RankAtMax"
-)
+colnames(regulons) <- c("TF", "MotifID", "AUC", "NES", "MotifSimilarityQvalue", "OrthologousIdentity",
+    "Annotation", "Context", "TargetGenes", "RankAtMax")
 regulon_list <- create_regulon_list_scenic(regulons = regulons)

Users should be aware that the AUC matrix from SCENIC is loaded in a cell x TF orientation and should be transposed to TF x cell orientation. pySCENIC also appends “(+)” to TF names that are converted to “…” upon loading into R. These characters can be included without affecting the results of domino2 analysis, but can be confusing when querying TF features in the data. We recommend comprehensive removal of the “…” characters using the gsub() function.

 auc_in <- as.data.frame(t(auc))
-# Remove pattern "..." from the end of all rownames:
+# Remove pattern '...' from the end of all rownames:
 rownames(auc_in) <- gsub("\\.\\.\\.$", "", rownames(auc_in))
@@ -333,37 +288,38 @@

Load CellPhoneDB DatabaseAdditional annotation columns can be provided such as name_A and name_B for ligands or receptors whose name in the interaction database does not match the names of their encoding genes. This formatting also allows for the consideration of ligand and receptor complexes comprised of a heteromeric combination of multiple proteins that must be co-expressed to function. In these cases, the “name_*” column shows the name of the protein complex, and the “gene_*” column shows the names of the genes encoding the components of the complex separated by commas “,”. When plotting results from the build domino object, the names of the interacting ligands and receptors will be used based on combinatorial expression of the complex components.

To facilitate the use of this formatting with the CellPhoneDB database, we include a helper function, create_rl_map_cellphonedb(), that automatically parses files from the cellPhoneDB database to arrive at the rl_map format.

-cellphonedb_2_path <- "../inst/extdata/cellphoneDB_v4/"
-complexes <- read.csv(paste0(cellphonedb_2_path, "/complex_input.csv"), stringsAsFactors = FALSE)
-genes <- read.csv(paste0(cellphonedb_2_path, "/gene_input.csv"), stringsAsFactors = FALSE)
-interactions <- read.csv(paste0(cellphonedb_2_path, "/interaction_input.csv"), stringsAsFactors = FALSE)
-proteins <- read.csv(paste0(cellphonedb_2_path, "/protein_input.csv"), stringsAsFactors = FALSE)
+complexes <- read.csv(paste0(cellphone_dir, "/cellphonedb-data-4.0.0/data/complex_input.csv"),
+    stringsAsFactors = FALSE)
+genes <- read.csv(paste0(cellphone_dir, "/cellphonedb-data-4.0.0/data/gene_input.csv"),
+    stringsAsFactors = FALSE)
+interactions <- read.csv(paste0(cellphone_dir, "/cellphonedb-data-4.0.0/data/interaction_input.csv"),
+    stringsAsFactors = FALSE)
+proteins <- read.csv(paste0(cellphone_dir, "/cellphonedb-data-4.0.0/data/protein_input.csv"),
+    stringsAsFactors = FALSE)
 
-rl_map <- create_rl_map_cellphonedb(
-  genes = genes,
-  proteins = proteins,
-  interactions = interactions,
-  complexes = complexes,
-  database_name = "CellPhoneDB_v4.0" # database version used
+rl_map <- create_rl_map_cellphonedb(genes = genes, proteins = proteins, interactions = interactions,
+    complexes = complexes, database_name = "CellPhoneDB_v4.0"  # database version used
 )
 
 knitr::kable(head(rl_map))
--++++++-----+-++ + @@ -379,87 +335,93 @@

Load CellPhoneDB Database

- - - - - - - - + + + + + - - + + + + + + - - - - + + + + + - - - + + + - + - - - - + + + + + - - - + + + - + - - - - - - - - + + + + + + + + + - + - - - - - - - - + + + + + + + + + - + - - - - - - - - + + + + + - - + + + + + + @@ -470,31 +432,30 @@
Optional: Adding interactions man

The change to use rl_map formatting also enables users to manually append interactions of interest that are not included in the interaction database if need be. This can be attained by formatting the desired interactions as a data.frame with the same column headers as the rl_map and using the rbind() function.

 # Integrin complexes are not annotated as receptors in CellPhoneDB_v4.0
-# collagen-integrin interactions between cells may be missed unless tables from the CellPhoneDB reference are edited or the interactions are manually added
+# collagen-integrin interactions between cells may be missed unless tables from
+# the CellPhoneDB reference are edited or the interactions are manually added
 
-col_int_df <- data.frame(
-  "int_pair" = "a11b1 complex & COLA1_HUMAN",
-  "name_A" = "a11b1 complex", "uniprot_A" = "P05556,Q9UKX5", "gene_A" = "ITB1,ITA11", "type_A" = "R",
-  "name_B" = "COLA1_HUMAN", "uniprot_B" = "P02452,P08123", "gene_B" = "COL1A1,COL1A2", "type_B" = "L",
-  "annotation_strategy" = "manual", "source" = "manual", "database_name" = "manual"
-)
+col_int_df <- data.frame(int_pair = "a11b1 complex & COLA1_HUMAN", name_A = "a11b1 complex",
+    uniprot_A = "P05556,Q9UKX5", gene_A = "ITB1,ITA11", type_A = "R", name_B = "COLA1_HUMAN",
+    uniprot_B = "P02452,P08123", gene_B = "COL1A1,COL1A2", type_B = "L", annotation_strategy = "manual",
+    source = "manual", database_name = "manual")
 rl_map_append <- rbind(col_int_df, rl_map)
 knitr::kable(head(rl_map_append))
int_pair name_A uniprot_A
FGF4 & FGFR1FGF4P08620FGF4LFGFR1P11362FGFR14RAreceptor_RXRG & atRetinoicAcid_byALDH1A3RAreceptor_RXRGP48443,P29373RXRG,CRABP2 RI2DatRetinoicAcid_byALDH1A3P47895ALDH1A3Lcurateduniprot;reactome CellPhoneDB_v4.0
ADORA3 & ENTPD1ADORA3P0DMS8ADORA35RAreceptor_RXRG & atRetinoicAcid_byALDH1A2RAreceptor_RXRGP48443,P29373RXRG,CRABP2 RENTPD1P49961ENTPD1atRetinoicAcid_byALDH1A2O94788ALDH1A2 L curateduniprotuniprot;reactome CellPhoneDB_v4.0
EPHB3 & EFNB1EPHB3P54753EPHB36RAreceptor_RXRG & atRetinoicAcid_byALDH1A1RAreceptor_RXRGP48443,P29373RXRG,CRABP2 REFNB1P98172EFNB1atRetinoicAcid_byALDH1A1P00352ALDH1A1 L curatedPMID: 15114347uniprot;reactome CellPhoneDB_v4.0
TNFSF18 & TNFRSF18TNFSF18Q9UNG2TNFSF18LTNFRSF18Q9Y5U5TNFRSF187RAreceptor_RXRB & atRetinoicAcid_byALDH1A3RAreceptor_RXRBP28702,P29373RXRB,CRABP2 RatRetinoicAcid_byALDH1A3P47895ALDH1A3L curateduniprotuniprot;reactome CellPhoneDB_v4.0
EFNA1 & EPHA1EFNA1P20827EFNA1LEPHA1P21709EPHA18RAreceptor_RXRB & atRetinoicAcid_byALDH1A2RAreceptor_RXRBP28702,P29373RXRB,CRABP2 RatRetinoicAcid_byALDH1A2O94788ALDH1A2L curatedPMID: 15114347uniprot;reactome CellPhoneDB_v4.0
PYY & NPY2RPYYP10082PYYLNPY2RP49146NPY2R9RAreceptor_RXRB & atRetinoicAcid_byALDH1A1RAreceptor_RXRBP28702,P29373RXRB,CRABP2 Rguidetopharmacology.orgatRetinoicAcid_byALDH1A1P00352ALDH1A1Lcurateduniprot;reactome CellPhoneDB_v4.0
---+++++----++ @@ -528,78 +489,78 @@
Optional: Adding interactions man
- - - - - - - - - + + + + + - - + + + + + + - - - - - + + + + + - - - + + + - + - - - - - + + + + + - - - + + + - + - - - - - - - - - + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - + @@ -639,37 +600,20 @@

Create Domino objectcreate_domino() function can be used to make the object. Parameters of note include “use_clusters” which is required to assess signaling between cell types rather than linkage of TFs and receptors broadly across the data set. “use_complexes” decides if receptors that function in heteromeric complexes will be considered in testing linkages between TFs and receptors. If TRUE, a receptor complex is only linked to a TF if a majority of the component genes meet the Spearman correlation threshold. “remove_rec_dropout” decides whether receptor values of 0 will be considered in correlation calculations; this measure is intended to reduce the effect of dropout on receptors with low expression.

To run create_domino() with matrix and vector inputs:

-pbmc_dom <- create_domino(
-  rl_map = rl_map,
-  features = auc_in,
-  counts = counts,
-  z_scores = z_scores,
-  clusters = clusters,
-  tf_targets = regulon_list,
-  use_clusters = TRUE,
-  use_complexes = TRUE,
-  remove_rec_dropout = FALSE
-)
-# rl_map: receptor-ligand map data frame
-# features: TF scores (AUC matrix)
-# counts: counts matrix
-# z_scores: scaled expression data
-# clusters: named vector of cell cluster assignments
-# tf_targets: list of TFs and their regulons
-# use_clusters: assess receptor activation and ligand expression on a per-cluster basis
-# use_complexes: include receptors and genes that function as a complex in results
-# remove_rec_dropout: whether to remove zeroes from correlation calculations
+pbmc_dom <- create_domino(rl_map = rl_map, features = auc_in, counts = counts, z_scores = z_scores, + clusters = clusters, tf_targets = regulon_list, use_clusters = TRUE, use_complexes = TRUE, + remove_rec_dropout = FALSE) +# rl_map: receptor-ligand map data frame features: TF scores (AUC matrix) +# counts: counts matrix z_scores: scaled expression data clusters: named vector +# of cell cluster assignments tf_targets: list of TFs and their regulons +# use_clusters: assess receptor activation and ligand expression on a +# per-cluster basis use_complexes: include receptors and genes that function as +# a complex in results remove_rec_dropout: whether to remove zeroes from +# correlation calculations

The above results will be equivalent to using the Seurat object directly. Note that inclusion of both the matrix inputs and the Seurat object will prioritize the Seurat object.

-pbmc_dom <- create_domino(
-  rl_map = rl_map,
-  features = auc_in,
-  ser = pbmc,
-  tf_targets = regulon_list,
-  use_clusters = TRUE,
-  use_complexes = TRUE,
-  remove_rec_dropout = FALSE
-)
+pbmc_dom <- create_domino(rl_map = rl_map, features = auc_in, ser = pbmc, tf_targets = regulon_list, + use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE)

For information on what is stored in a domino object and how to access it, please see our vignette on the structure of domino objects.

@@ -678,27 +622,15 @@

Build Dominobuild_domino() finalizes the construction of the domino object by setting parameters for identifying TFs with differential activation between clusters, receptor linkage with TFs based on magnitude of positive correlation, and the minimum percentage of cells within a cluster that have expression of a receptor for the receptor to be called as active.

There are also options for thresholds of the number of TFs that may be called active in a cluster and the number of receptors that may be linked to any one TF. For thresholds of n TFs and m receptors, the bottom n TFs by lowest p-values from the wilcoxon rank sum test and the top m receptors by Spearman correlation coefficient are chosen.

-pbmc_dom <- build_domino(
-  dom = pbmc_dom,
-  min_tf_pval = .001,
-  max_tf_per_clust = 25,
-  max_rec_per_tf = 25,
-  rec_tf_cor_threshold = .25,
-  min_rec_percentage = 0.1
-)
-# min_tf_pval: Threshold for p-value of DE for TFs
-# rec_tf_cor_threshold: Minimum correlation between receptor and TF
-# min_rec_percentage: Minimum percent of cells that must express receptor
+pbmc_dom <- build_domino(dom = pbmc_dom, min_tf_pval = 0.001, max_tf_per_clust = 25, + max_rec_per_tf = 25, rec_tf_cor_threshold = 0.25, min_rec_percentage = 0.1) +# min_tf_pval: Threshold for p-value of DE for TFs rec_tf_cor_threshold: +# Minimum correlation between receptor and TF min_rec_percentage: Minimum +# percent of cells that must express receptor

Both of the thresholds for the number of receptors and TFs can be sent to infinity (Inf) to collect all receptors and TFs that meet statistical significance thresholds.

-pbmc_dom_all <- build_domino(
-  dom = pbmc_dom,
-  min_tf_pval = .001,
-  max_tf_per_clust = Inf,
-  max_rec_per_tf = Inf,
-  rec_tf_cor_threshold = .25,
-  min_rec_percentage = 0.1,
-)
+pbmc_dom_all <- build_domino(dom = pbmc_dom, min_tf_pval = 0.001, max_tf_per_clust = Inf, + max_rec_per_tf = Inf, rec_tf_cor_threshold = 0.25, min_rec_percentage = 0.1)
@@ -710,8 +642,8 @@

Summarize TF Activity and Linkage

Enrichment of TF activities by cell types can be visualized by feat_heatmap() which plots data set-wide TF activity scores as a heatmap.

-feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE)
-

+feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE, use_raster = FALSE)

+

Cumulative signaling between cell types @@ -719,7 +651,7 @@

Cumulative signaling between ce

The cumulative degree of signaling between clusters is assessed as the sum of the scaled expression of ligands targeting active receptors on another cluster. This can be visualized in graph format using the signaling_network() function. Nodes represent each cell cluster and edges scale with the magnitude of signaling between the clusters. The color of the edge corresponds to the sender cluster for that signal.

 signaling_network(pbmc_dom, edge_weight = 1, max_thresh = 5)
-

+

Signaling networks can also be drawn with the edges only rendering the signals directed towards a given cell type or signals from one cell type directed to others. To see those options in use, as well as other plotting functions and their options, please see our plotting vignette.

@@ -728,22 +660,21 @@

Specific Signaling Int

Beyond the aggregated degree of signaling between cell types, the degrees of signaling through specific ligand-receptor interactions can be assessed. gene_network() provides a graph of linkages between active TFs in a cluster, the linked receptors in that cluster, and the possible ligands of these active receptors.

 gene_network(pbmc_dom, clust = "dendritic_cell", layout = "grid")
-

+

New to domino2, gene_network() can be used between two clusters to determine if any of the possible ligands for a given receptor are expressed by a putative outgoing signaling cluster.

-gene_network(pbmc_dom,
-  clust = "dendritic_cell", OutgoingSignalingClust = "CD14_monocyte",
-  layout = "grid"
-)
-

+gene_network(pbmc_dom, clust = "dendritic_cell", OutgoingSignalingClust = "CD14_monocyte", + layout = "grid")

+

A comprehensive assessment of ligand expression targeting active receptors on a given cluster can be assessed with incoming_signaling_heatmap().

-incoming_signaling_heatmap(pbmc_dom, rec_clust = "dendritic_cell", max_thresh = 2.5)
-

+incoming_signaling_heatmap(pbmc_dom, rec_clust = "dendritic_cell", max_thresh = 2.5, + use_raster = FALSE) +

Another form of comprehensive ligand expression assessment is available for individual active receptors in the form of circos plots new to domino2. The outer arcs correspond to clusters in the domino object with inner arcs representing each possible ligand of the plotted receptor. Arcs are drawn between ligands on a cell type and the receptor if the ligand is expressed above the specified threshold. Arc widths correspond to the mean express of the ligand by the cluster with the widest arc width scaling to the maximum expression of the ligand within the data.

 circos_ligand_receptor(pbmc_dom, receptor = "CD74")
-

+

@@ -753,7 +684,7 @@

Continued Development

Vignette Build Information Date last built and session information:

 Sys.Date()
-#> [1] "2023-11-13"
+#> [1] "2023-12-13"
 sessionInfo()
 #> R version 4.2.1 (2022-06-23)
 #> Platform: x86_64-pc-linux-gnu (64-bit)
@@ -776,68 +707,67 @@ 

Continued Development#> [8] base #> #> other attached packages: -#> [1] knitr_1.44 ComplexHeatmap_2.12.1 circlize_0.4.15 -#> [4] plyr_1.8.8 loomR_0.2.1.9000 hdf5r_1.3.8 -#> [7] R6_2.5.1 SeuratObject_5.0.0 Seurat_4.4.0 -#> [10] domino2_0.2.2 +#> [1] knitr_1.45 ComplexHeatmap_2.14.0 circlize_0.4.15 +#> [4] plyr_1.8.9 Seurat_5.0.1 SeuratObject_5.0.1 +#> [7] sp_2.1-1 domino2_0.2.2 #> #> loaded via a namespace (and not attached): -#> [1] utf8_1.2.3 spatstat.explore_3.2-3 reticulate_1.32.0 -#> [4] R.utils_2.12.2 tidyselect_1.2.0 RSQLite_2.3.1 -#> [7] AnnotationDbi_1.58.0 htmlwidgets_1.6.2 Rtsne_0.16 -#> [10] munsell_0.5.0 codetools_0.2-19 ragg_1.2.5 -#> [13] ica_1.0-3 future_1.33.0 miniUI_0.1.1.1 -#> [16] spatstat.random_3.1-6 colorspace_2.1-0 progressr_0.14.0 -#> [19] Biobase_2.56.0 filelock_1.0.2 stats4_4.2.1 +#> [1] utf8_1.2.4 spatstat.explore_3.2-5 reticulate_1.34.0 +#> [4] tidyselect_1.2.0 RSQLite_2.3.3 AnnotationDbi_1.60.2 +#> [7] htmlwidgets_1.6.2 Rtsne_0.16 munsell_0.5.0 +#> [10] codetools_0.2-19 ragg_1.2.6 ica_1.0-3 +#> [13] future_1.33.0 miniUI_0.1.1.1 spatstat.random_3.2-1 +#> [16] colorspace_2.1-0 progressr_0.14.0 Biobase_2.58.0 +#> [19] filelock_1.0.2 highr_0.10 stats4_4.2.1 #> [22] ROCR_1.0-11 tensor_1.5 ggsignif_0.6.4 -#> [25] listenv_0.9.0 GenomeInfoDbData_1.2.8 polyclip_1.10-4 -#> [28] bit64_4.0.5 rprojroot_2.0.3 parallelly_1.36.0 -#> [31] vctrs_0.6.3 generics_0.1.3 xfun_0.40 -#> [34] BiocFileCache_2.4.0 doParallel_1.0.17 GenomeInfoDb_1.32.4 -#> [37] clue_0.3-65 bitops_1.0-7 spatstat.utils_3.0-3 -#> [40] cachem_1.0.8 promises_1.2.1 scales_1.2.1 -#> [43] gtable_0.3.4 Cairo_1.6-1 globals_0.16.2 -#> [46] goftest_1.2-3 spam_2.9-1 rlang_1.1.1 -#> [49] systemfonts_1.0.4 GlobalOptions_0.1.2 splines_4.2.1 -#> [52] rstatix_0.7.2 lazyeval_0.2.2 spatstat.geom_3.2-5 -#> [55] broom_1.0.5 yaml_2.3.7 reshape2_1.4.4 -#> [58] abind_1.4-5 backports_1.4.1 httpuv_1.6.11 -#> [61] tools_4.2.1 ggplot2_3.4.4 ellipsis_0.3.2 -#> [64] jquerylib_0.1.4 RColorBrewer_1.1-3 BiocGenerics_0.42.0 -#> [67] ggridges_0.5.4 Rcpp_1.0.11 progress_1.2.2 -#> [70] zlibbioc_1.42.0 purrr_1.0.2 RCurl_1.98-1.12 -#> [73] prettyunits_1.2.0 deldir_1.0-9 ggpubr_0.6.0 -#> [76] pbapply_1.7-2 GetoptLong_1.0.5 cowplot_1.1.1 -#> [79] S4Vectors_0.34.0 zoo_1.8-12 ggrepel_0.9.3 -#> [82] cluster_2.1.4 fs_1.6.3 magrittr_2.0.3 -#> [85] magick_2.8.0 data.table_1.14.8 scattermore_1.2 -#> [88] lmtest_0.9-40 RANN_2.6.1 fitdistrplus_1.1-11 -#> [91] R.cache_0.16.0 matrixStats_1.0.0 hms_1.1.3 -#> [94] patchwork_1.1.3 mime_0.12 evaluate_0.21 -#> [97] xtable_1.8-4 XML_3.99-0.14 IRanges_2.30.1 -#> [100] gridExtra_2.3 shape_1.4.6 compiler_4.2.1 -#> [103] biomaRt_2.52.0 tibble_3.2.1 KernSmooth_2.23-22 -#> [106] crayon_1.5.2 R.oo_1.25.0 htmltools_0.5.6 -#> [109] later_1.3.1 tidyr_1.3.0 DBI_1.1.3 -#> [112] dbplyr_2.3.3 MASS_7.3-60 rappdirs_0.3.3 -#> [115] Matrix_1.6-1.1 car_3.1-2 cli_3.6.1 -#> [118] R.methodsS3_1.8.2 parallel_4.2.1 dotCall64_1.0-2 -#> [121] igraph_1.5.1 pkgconfig_2.0.3 pkgdown_2.0.7 -#> [124] sp_2.0-0 plotly_4.10.2 spatstat.sparse_3.0-2 +#> [25] listenv_0.9.0 GenomeInfoDbData_1.2.9 polyclip_1.10-6 +#> [28] bit64_4.0.5 rprojroot_2.0.4 parallelly_1.36.0 +#> [31] vctrs_0.6.4 generics_0.1.3 xfun_0.41 +#> [34] BiocFileCache_2.6.1 R6_2.5.1 doParallel_1.0.17 +#> [37] GenomeInfoDb_1.34.9 clue_0.3-65 bitops_1.0-7 +#> [40] spatstat.utils_3.0-4 cachem_1.0.8 promises_1.2.1 +#> [43] scales_1.3.0 gtable_0.3.4 Cairo_1.6-1 +#> [46] globals_0.16.2 goftest_1.2-3 spam_2.10-0 +#> [49] rlang_1.1.2 systemfonts_1.0.5 GlobalOptions_0.1.2 +#> [52] splines_4.2.1 rstatix_0.7.2 lazyeval_0.2.2 +#> [55] spatstat.geom_3.2-7 broom_1.0.5 yaml_2.3.7 +#> [58] reshape2_1.4.4 abind_1.4-5 backports_1.4.1 +#> [61] httpuv_1.6.12 tools_4.2.1 ggplot2_3.4.4 +#> [64] ellipsis_0.3.2 jquerylib_0.1.4 RColorBrewer_1.1-3 +#> [67] BiocGenerics_0.44.0 ggridges_0.5.4 Rcpp_1.0.11 +#> [70] progress_1.2.2 zlibbioc_1.44.0 purrr_1.0.2 +#> [73] RCurl_1.98-1.13 prettyunits_1.2.0 deldir_1.0-9 +#> [76] ggpubr_0.6.0 pbapply_1.7-2 GetoptLong_1.0.5 +#> [79] cowplot_1.1.1 S4Vectors_0.36.2 zoo_1.8-12 +#> [82] ggrepel_0.9.4 cluster_2.1.4 fs_1.6.3 +#> [85] magrittr_2.0.3 magick_2.8.1 data.table_1.14.8 +#> [88] RSpectra_0.16-1 scattermore_1.2 lmtest_0.9-40 +#> [91] RANN_2.6.1 fitdistrplus_1.1-11 matrixStats_1.1.0 +#> [94] hms_1.1.3 patchwork_1.1.3 mime_0.12 +#> [97] evaluate_0.23 xtable_1.8-4 XML_3.99-0.16 +#> [100] fastDummies_1.7.3 IRanges_2.32.0 gridExtra_2.3 +#> [103] shape_1.4.6 compiler_4.2.1 biomaRt_2.54.1 +#> [106] tibble_3.2.1 KernSmooth_2.23-22 crayon_1.5.2 +#> [109] htmltools_0.5.7 later_1.3.1 tidyr_1.3.0 +#> [112] DBI_1.1.3 formatR_1.14 dbplyr_2.4.0 +#> [115] MASS_7.3-60 rappdirs_0.3.3 Matrix_1.6-3 +#> [118] car_3.1-2 cli_3.6.1 parallel_4.2.1 +#> [121] dotCall64_1.1-0 igraph_1.5.1 pkgconfig_2.0.3 +#> [124] pkgdown_2.0.7 plotly_4.10.3 spatstat.sparse_3.0-3 #> [127] xml2_1.3.5 foreach_1.5.2 bslib_0.5.1 -#> [130] XVector_0.36.0 stringr_1.5.0 digest_0.6.33 -#> [133] sctransform_0.4.0 RcppAnnoy_0.0.21 spatstat.data_3.0-1 -#> [136] Biostrings_2.64.1 rmarkdown_2.25 leiden_0.4.3 -#> [139] uwot_0.1.16 curl_5.0.2 shiny_1.7.5 -#> [142] rjson_0.2.21 nlme_3.1-163 lifecycle_1.0.3 +#> [130] XVector_0.38.0 stringr_1.5.1 digest_0.6.33 +#> [133] sctransform_0.4.1 RcppAnnoy_0.0.21 spatstat.data_3.0-3 +#> [136] Biostrings_2.66.0 rmarkdown_2.25 leiden_0.4.3.1 +#> [139] uwot_0.1.16 curl_5.1.0 shiny_1.8.0 +#> [142] rjson_0.2.21 nlme_3.1-163 lifecycle_1.0.4 #> [145] jsonlite_1.8.7 carData_3.0-5 desc_1.4.2 -#> [148] viridisLite_0.4.2 fansi_1.0.4 pillar_1.9.0 -#> [151] lattice_0.21-8 KEGGREST_1.36.3 fastmap_1.1.1 +#> [148] viridisLite_0.4.2 fansi_1.0.5 pillar_1.9.0 +#> [151] lattice_0.22-5 KEGGREST_1.38.0 fastmap_1.1.1 #> [154] httr_1.4.7 survival_3.5-7 glue_1.6.2 #> [157] png_0.1-8 iterators_1.0.14 bit_4.0.5 -#> [160] stringi_1.7.12 sass_0.4.7 blob_1.2.4 -#> [163] textshaping_0.3.6 memoise_2.0.1 styler_1.10.2 -#> [166] dplyr_1.1.3 irlba_2.3.5.1 future.apply_1.11.0

+#> [160] stringi_1.8.2 sass_0.4.7 blob_1.2.4 +#> [163] textshaping_0.3.7 RcppHNSW_0.5.0 memoise_2.0.1 +#> [166] dplyr_1.1.4 irlba_2.3.5.1 future.apply_1.11.0

diff --git a/docs/articles/domino2_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/domino2_files/figure-html/unnamed-chunk-10-1.png index f858167..c5c5221 100644 Binary files a/docs/articles/domino2_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/domino2_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/docs/articles/domino2_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/domino2_files/figure-html/unnamed-chunk-5-1.png new file mode 100644 index 0000000..d04101c Binary files /dev/null and b/docs/articles/domino2_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/domino2_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/domino2_files/figure-html/unnamed-chunk-6-1.png new file mode 100644 index 0000000..a5a8a5c Binary files /dev/null and b/docs/articles/domino2_files/figure-html/unnamed-chunk-6-1.png differ diff --git a/docs/articles/domino2_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/domino2_files/figure-html/unnamed-chunk-7-1.png index dcb1541..85d99e5 100644 Binary files a/docs/articles/domino2_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/domino2_files/figure-html/unnamed-chunk-7-1.png differ diff --git a/docs/articles/domino2_files/figure-html/unnamed-chunk-8-1.png b/docs/articles/domino2_files/figure-html/unnamed-chunk-8-1.png index 4900a59..5c0febf 100644 Binary files a/docs/articles/domino2_files/figure-html/unnamed-chunk-8-1.png and b/docs/articles/domino2_files/figure-html/unnamed-chunk-8-1.png differ diff --git a/docs/articles/domino2_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/domino2_files/figure-html/unnamed-chunk-9-1.png index 3178711..5967f99 100644 Binary files a/docs/articles/domino2_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/domino2_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/articles/domino_object_vignette.html b/docs/articles/domino_object_vignette.html index 14d20da..c0a2614 100644 --- a/docs/articles/domino_object_vignette.html +++ b/docs/articles/domino_object_vignette.html @@ -97,49 +97,56 @@ +
+data_url <- "https://zenodo.org/records/10222767/files"
+temp_dir <- tempdir()
+
+download.file(
+  url = paste0(data_url, "/pbmc_domino_built.rds"),
+  destfile = paste0(temp_dir, "/pbmc_domino_built.rds")
+)
+dom <- readRDS(paste0(temp_dir, "/pbmc_domino_built.rds"))

The new domino object structure

-

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 it for any other use you may have in mind.

+

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 signaling from ligands to 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

+

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
-#>                 Contains signaling between 9 clusters
-#>                 Built with a maximum of 25 TFs per cluster
-#>                 and a maximum of 25 receptors per TF
+#> 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_signaling"     "dom_tf_activation"
-#> [10] "dom_zscores"
+#> [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])

manual
111FGF4 & FGFR1FGF4P08620FGF4LFGFR1P11362FGFR14RAreceptor_RXRG & atRetinoicAcid_byALDH1A3RAreceptor_RXRGP48443,P29373RXRG,CRABP2 RI2DatRetinoicAcid_byALDH1A3P47895ALDH1A3Lcurateduniprot;reactome CellPhoneDB_v4.0
2ADORA3 & ENTPD1ADORA3P0DMS8ADORA35RAreceptor_RXRG & atRetinoicAcid_byALDH1A2RAreceptor_RXRGP48443,P29373RXRG,CRABP2 RENTPD1P49961ENTPD1atRetinoicAcid_byALDH1A2O94788ALDH1A2 L curateduniprotuniprot;reactome CellPhoneDB_v4.0
3EPHB3 & EFNB1EPHB3P54753EPHB36RAreceptor_RXRG & atRetinoicAcid_byALDH1A1RAreceptor_RXRGP48443,P29373RXRG,CRABP2 REFNB1P98172EFNB1atRetinoicAcid_byALDH1A1P00352ALDH1A1 L curatedPMID: 15114347uniprot;reactome CellPhoneDB_v4.0
4TNFSF18 & TNFRSF18TNFSF18Q9UNG2TNFSF18LTNFRSF18Q9Y5U5TNFRSF187RAreceptor_RXRB & atRetinoicAcid_byALDH1A3RAreceptor_RXRBP28702,P29373RXRB,CRABP2 RatRetinoicAcid_byALDH1A3P47895ALDH1A3L curateduniprotuniprot;reactome CellPhoneDB_v4.0
5EFNA1 & EPHA1EFNA1P20827EFNA1LEPHA1P21709EPHA18RAreceptor_RXRB & atRetinoicAcid_byALDH1A2RAreceptor_RXRBP28702,P29373RXRB,CRABP2 RatRetinoicAcid_byALDH1A2O94788ALDH1A2L curatedPMID: 15114347uniprot;reactome CellPhoneDB_v4.0
@@ -203,7 +210,7 @@

Input data
+
 z_matrix <- dom_zscores(dom)
 knitr::kable(z_matrix[1:5, 1:5])

@@ -267,7 +274,7 @@

Input data
+
 activation_matrix <- dom_tf_activation(dom)
 knitr::kable(activation_matrix[1:5, 1:5])

@@ -330,12 +337,12 @@

Input datadom_database() function. By default, the function returns the name(s) of the database(s) used:

-
+

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"
-

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

-
+

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])

@@ -388,8 +395,8 @@

Input data

Calculations

-

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

-
+

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])

@@ -445,7 +452,7 @@

Calculationsdom_correlations() function.

-
+
 cor_matrix <- dom_correlations(dom)
 knitr::kable(cor_matrix[1:5, 1:5])

@@ -504,14 +511,14 @@

Calculations

Linkages

-

Linkages between various 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:

-
+

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
@@ -521,25 +528,24 @@ 

Linkages#> [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 collate_network_items() function. To pull all receptors associated with the dendritic cell cluster:

-
-collate_network_items(dom, "dendritic_cell", return = "features")
-#>  [1] "ZNF189" "KLF12"  "ETV7"   "IRF8"   "KLF6"   "FOS"    "SPI1"   "ATF3"  
-#>  [9] "KLF4"   "CEBPA"  "MAFG"   "CEBPD"  "ZBTB33" "SPIB"   "CEBPB"  "FOSB"  
-#> [17] "CREB5"  "RXRA"   "CUX1"   "ZNF516"
+

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)

@@ -679,7 +685,7 @@

Signaling Matrices
+
 dc_matrix <- dom_signaling(dom, "dendritic_cell")
 knitr::kable(dc_matrix)

@@ -883,7 +889,7 @@

Signaling MatricesBuild 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
@@ -903,9 +909,9 @@ 

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] "2023-11-13"
+#> [1] "2023-12-13"
 sessionInfo()
 #> R version 4.2.1 (2022-06-23)
 #> Platform: x86_64-pc-linux-gnu (64-bit)
@@ -927,55 +933,47 @@ 

Continued Development#> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: -#> [1] domino2_0.2.2 testthat_3.1.10 +#> [1] domino2_0.2.2 #> #> loaded via a namespace (and not attached): -#> [1] backports_1.4.1 circlize_0.4.15 BiocFileCache_2.4.0 -#> [4] systemfonts_1.0.4 plyr_1.8.8 igraph_1.5.1 -#> [7] usethis_2.2.2 GenomeInfoDb_1.32.4 ggplot2_3.4.4 -#> [10] digest_0.6.33 foreach_1.5.2 htmltools_0.5.6 -#> [13] fansi_1.0.4 magrittr_2.0.3 memoise_2.0.1 -#> [16] cluster_2.1.4 doParallel_1.0.17 remotes_2.4.2.1 -#> [19] ComplexHeatmap_2.12.1 Biostrings_2.64.1 matrixStats_1.0.0 -#> [22] R.utils_2.12.2 pkgdown_2.0.7 prettyunits_1.2.0 -#> [25] colorspace_2.1-0 blob_1.2.4 rappdirs_0.3.3 -#> [28] textshaping_0.3.6 xfun_0.40 dplyr_1.1.3 -#> [31] callr_3.7.3 crayon_1.5.2 RCurl_1.98-1.12 -#> [34] jsonlite_1.8.7 iterators_1.0.14 glue_1.6.2 -#> [37] gtable_0.3.4 zlibbioc_1.42.0 XVector_0.36.0 -#> [40] GetoptLong_1.0.5 R.cache_0.16.0 car_3.1-2 -#> [43] pkgbuild_1.4.2 shape_1.4.6 BiocGenerics_0.42.0 -#> [46] abind_1.4-5 scales_1.2.1 DBI_1.1.3 -#> [49] rstatix_0.7.2 miniUI_0.1.1.1 Rcpp_1.0.11 -#> [52] xtable_1.8-4 progress_1.2.2 clue_0.3-65 -#> [55] bit_4.0.5 stats4_4.2.1 profvis_0.3.8 -#> [58] htmlwidgets_1.6.2 httr_1.4.7 RColorBrewer_1.1-3 -#> [61] ellipsis_0.3.2 urlchecker_1.0.1 pkgconfig_2.0.3 -#> [64] XML_3.99-0.14 R.methodsS3_1.8.2 sass_0.4.7 -#> [67] dbplyr_2.3.3 utf8_1.2.3 tidyselect_1.2.0 -#> [70] rlang_1.1.1 later_1.3.1 AnnotationDbi_1.58.0 -#> [73] munsell_0.5.0 tools_4.2.1 cachem_1.0.8 -#> [76] cli_3.6.1 generics_0.1.3 RSQLite_2.3.1 -#> [79] devtools_2.4.5 broom_1.0.5 evaluate_0.21 -#> [82] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 -#> [85] ragg_1.2.5 processx_3.8.2 knitr_1.44 -#> [88] bit64_4.0.5 fs_1.6.3 purrr_1.0.2 -#> [91] KEGGREST_1.36.3 mime_0.12 R.oo_1.25.0 -#> [94] xml2_1.3.5 biomaRt_2.52.0 brio_1.1.3 -#> [97] compiler_4.2.1 rstudioapi_0.15.0 filelock_1.0.2 -#> [100] curl_5.0.2 png_0.1-8 ggsignif_0.6.4 -#> [103] tibble_3.2.1 bslib_0.5.1 stringi_1.7.12 -#> [106] ps_1.7.5 desc_1.4.2 lattice_0.21-8 -#> [109] Matrix_1.6-1.1 styler_1.10.2 vctrs_0.6.3 -#> [112] pillar_1.9.0 lifecycle_1.0.3 jquerylib_0.1.4 -#> [115] GlobalOptions_0.1.2 bitops_1.0-7 httpuv_1.6.11 -#> [118] R6_2.5.1 promises_1.2.1 IRanges_2.30.1 -#> [121] sessioninfo_1.2.2 codetools_0.2-19 pkgload_1.3.3 -#> [124] rprojroot_2.0.3 rjson_0.2.21 withr_2.5.1 -#> [127] S4Vectors_0.34.0 GenomeInfoDbData_1.2.8 parallel_4.2.1 -#> [130] hms_1.1.3 grid_4.2.1 tidyr_1.3.0 -#> [133] rmarkdown_2.25 carData_3.0-5 ggpubr_0.6.0 -#> [136] Biobase_2.56.0 shiny_1.7.5

+#> [1] bitops_1.0-7 matrixStats_1.1.0 fs_1.6.3 +#> [4] bit64_4.0.5 filelock_1.0.2 doParallel_1.0.17 +#> [7] RColorBrewer_1.1-3 progress_1.2.2 httr_1.4.7 +#> [10] rprojroot_2.0.4 GenomeInfoDb_1.34.9 R.cache_0.16.0 +#> [13] backports_1.4.1 tools_4.2.1 bslib_0.5.1 +#> [16] utf8_1.2.4 R6_2.5.1 DBI_1.1.3 +#> [19] BiocGenerics_0.44.0 colorspace_2.1-0 GetoptLong_1.0.5 +#> [22] tidyselect_1.2.0 prettyunits_1.2.0 bit_4.0.5 +#> [25] curl_5.1.0 compiler_4.2.1 textshaping_0.3.7 +#> [28] cli_3.6.1 Biobase_2.58.0 xml2_1.3.5 +#> [31] desc_1.4.2 sass_0.4.7 scales_1.3.0 +#> [34] rappdirs_0.3.3 pkgdown_2.0.7 systemfonts_1.0.5 +#> [37] stringr_1.5.1 digest_0.6.33 rmarkdown_2.25 +#> [40] R.utils_2.12.3 XVector_0.38.0 pkgconfig_2.0.3 +#> [43] htmltools_0.5.7 styler_1.10.2 dbplyr_2.4.0 +#> [46] fastmap_1.1.1 rlang_1.1.2 GlobalOptions_0.1.2 +#> [49] RSQLite_2.3.3 shape_1.4.6 jquerylib_0.1.4 +#> [52] generics_0.1.3 jsonlite_1.8.7 car_3.1-2 +#> [55] dplyr_1.1.4 R.oo_1.25.0 RCurl_1.98-1.13 +#> [58] magrittr_2.0.3 GenomeInfoDbData_1.2.9 Matrix_1.6-3 +#> [61] munsell_0.5.0 Rcpp_1.0.11 S4Vectors_0.36.2 +#> [64] fansi_1.0.5 abind_1.4-5 lifecycle_1.0.4 +#> [67] R.methodsS3_1.8.2 stringi_1.8.2 yaml_2.3.7 +#> [70] carData_3.0-5 zlibbioc_1.44.0 plyr_1.8.9 +#> [73] BiocFileCache_2.6.1 grid_4.2.1 blob_1.2.4 +#> [76] parallel_4.2.1 crayon_1.5.2 lattice_0.22-5 +#> [79] Biostrings_2.66.0 circlize_0.4.15 hms_1.1.3 +#> [82] KEGGREST_1.38.0 knitr_1.45 ComplexHeatmap_2.14.0 +#> [85] pillar_1.9.0 igraph_1.5.1 ggpubr_0.6.0 +#> [88] rjson_0.2.21 ggsignif_0.6.4 codetools_0.2-19 +#> [91] biomaRt_2.54.1 stats4_4.2.1 XML_3.99-0.16 +#> [94] glue_1.6.2 evaluate_0.23 png_0.1-8 +#> [97] vctrs_0.6.4 foreach_1.5.2 tidyr_1.3.0 +#> [100] gtable_0.3.4 purrr_1.0.2 clue_0.3-65 +#> [103] ggplot2_3.4.4 cachem_1.0.8 xfun_0.41 +#> [106] broom_1.0.5 rstatix_0.7.2 ragg_1.2.6 +#> [109] tibble_3.2.1 iterators_1.0.14 AnnotationDbi_1.60.2 +#> [112] memoise_2.0.1 IRanges_2.32.0 cluster_2.1.4

diff --git a/docs/articles/plotting_vignette.html b/docs/articles/plotting_vignette.html index 9d1eccb..91edab8 100644 --- a/docs/articles/plotting_vignette.html +++ b/docs/articles/plotting_vignette.html @@ -102,60 +102,65 @@

Visualizing domino2 data

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.

+

Loading example domino data +

+
+data_url <- "https://zenodo.org/records/10222767/files"
+temp_dir <- tempdir()
+
+download.file(url = paste0(data_url, "/pbmc_domino_built.rds"), destfile = paste0(temp_dir,
+    "/pbmc_domino_built.rds"))
+dom <- readRDS(paste0(temp_dir, "/pbmc_domino_built.rds"))
+
+

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")

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"
-)
+
+cor_heatmap(dom, cluster_rows = FALSE, cluster_columns = FALSE, column_title = "Heatmap Without Clustering")

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)

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 NMF::aheatmap(). 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
-)
-feat_heatmap(dom, bool = TRUE)
+
+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 NMF::aheatmap().

@@ -164,11 +169,11 @@

Heatmap of Incoming Signali

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")

@@ -181,37 +186,31 @@

Network PlotsNetwork 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"
-)
+
+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
-)
+
+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", vert_scale = 5
-)
+
+signaling_network(dom, showOutgoingSignalingClusts = "CD14_monocyte", scale = "none",
+    norm = "none", layout = "fr", scale_by = "none", vert_scale = 5)

@@ -222,16 +221,14 @@

Other Types of PlotChord 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) <- levels(dom@clusters)
+
+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)

@@ -239,7 +236,7 @@

Chord Diagrams Connecti

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.

@@ -250,9 +247,9 @@

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] "2023-11-13"
+#> [1] "2023-12-13"
 sessionInfo()
 #> R version 4.2.1 (2022-06-23)
 #> Platform: x86_64-pc-linux-gnu (64-bit)
@@ -278,46 +275,45 @@ 

Continued Development#> #> loaded via a namespace (and not attached): #> [1] colorspace_2.1-0 ggsignif_0.6.4 rjson_0.2.21 -#> [4] rprojroot_2.0.3 circlize_0.4.15 XVector_0.36.0 +#> [4] rprojroot_2.0.4 circlize_0.4.15 XVector_0.38.0 #> [7] GlobalOptions_0.1.2 fs_1.6.3 clue_0.3-65 -#> [10] farver_2.1.1 ggpubr_0.6.0 bit64_4.0.5 -#> [13] AnnotationDbi_1.58.0 fansi_1.0.4 xml2_1.3.5 -#> [16] codetools_0.2-19 splines_4.2.1 R.methodsS3_1.8.2 -#> [19] doParallel_1.0.17 cachem_1.0.8 knitr_1.44 -#> [22] jsonlite_1.8.7 Cairo_1.6-1 broom_1.0.5 -#> [25] cluster_2.1.4 dbplyr_2.3.3 png_0.1-8 -#> [28] R.oo_1.25.0 compiler_4.2.1 httr_1.4.7 -#> [31] backports_1.4.1 Matrix_1.6-1.1 fastmap_1.1.1 -#> [34] cli_3.6.1 htmltools_0.5.6 prettyunits_1.2.0 -#> [37] tools_4.2.1 igraph_1.5.1 gtable_0.3.4 -#> [40] glue_1.6.2 GenomeInfoDbData_1.2.8 dplyr_1.1.3 -#> [43] rappdirs_0.3.3 Rcpp_1.0.11 carData_3.0-5 -#> [46] Biobase_2.56.0 jquerylib_0.1.4 styler_1.10.2 -#> [49] pkgdown_2.0.7 vctrs_0.6.3 Biostrings_2.64.1 -#> [52] nlme_3.1-163 iterators_1.0.14 xfun_0.40 -#> [55] stringr_1.5.0 lifecycle_1.0.3 rstatix_0.7.2 -#> [58] XML_3.99-0.14 zlibbioc_1.42.0 scales_1.2.1 -#> [61] ragg_1.2.5 hms_1.1.3 parallel_4.2.1 -#> [64] RColorBrewer_1.1-3 ComplexHeatmap_2.12.1 yaml_2.3.7 -#> [67] curl_5.0.2 memoise_2.0.1 ggplot2_3.4.4 -#> [70] sass_0.4.7 biomaRt_2.52.0 stringi_1.7.12 -#> [73] RSQLite_2.3.1 S4Vectors_0.34.0 desc_1.4.2 -#> [76] foreach_1.5.2 BiocGenerics_0.42.0 filelock_1.0.2 -#> [79] shape_1.4.6 GenomeInfoDb_1.32.4 rlang_1.1.1 -#> [82] pkgconfig_2.0.3 systemfonts_1.0.4 matrixStats_1.0.0 -#> [85] bitops_1.0-7 evaluate_0.21 lattice_0.21-8 -#> [88] purrr_1.0.2 labeling_0.4.3 bit_4.0.5 -#> [91] tidyselect_1.2.0 plyr_1.8.8 magrittr_2.0.3 -#> [94] R6_2.5.1 IRanges_2.30.1 magick_2.8.0 -#> [97] generics_0.1.3 DBI_1.1.3 pillar_1.9.0 -#> [100] withr_2.5.1 mgcv_1.9-0 KEGGREST_1.36.3 -#> [103] abind_1.4-5 RCurl_1.98-1.12 tibble_3.2.1 -#> [106] crayon_1.5.2 car_3.1-2 utf8_1.2.3 -#> [109] BiocFileCache_2.4.0 rmarkdown_2.25 GetoptLong_1.0.5 -#> [112] progress_1.2.2 grid_4.2.1 blob_1.2.4 -#> [115] digest_0.6.33 R.cache_0.16.0 tidyr_1.3.0 -#> [118] R.utils_2.12.2 textshaping_0.3.6 stats4_4.2.1 -#> [121] munsell_0.5.0 bslib_0.5.1

+#> [10] ggpubr_0.6.0 farver_2.1.1 bit64_4.0.5 +#> [13] AnnotationDbi_1.60.2 fansi_1.0.5 xml2_1.3.5 +#> [16] codetools_0.2-19 splines_4.2.1 doParallel_1.0.17 +#> [19] cachem_1.0.8 knitr_1.45 jsonlite_1.8.7 +#> [22] Cairo_1.6-1 broom_1.0.5 cluster_2.1.4 +#> [25] dbplyr_2.4.0 png_0.1-8 compiler_4.2.1 +#> [28] httr_1.4.7 backports_1.4.1 Matrix_1.6-3 +#> [31] fastmap_1.1.1 cli_3.6.1 formatR_1.14 +#> [34] htmltools_0.5.7 prettyunits_1.2.0 tools_4.2.1 +#> [37] igraph_1.5.1 gtable_0.3.4 glue_1.6.2 +#> [40] GenomeInfoDbData_1.2.9 dplyr_1.1.4 rappdirs_0.3.3 +#> [43] Rcpp_1.0.11 carData_3.0-5 Biobase_2.58.0 +#> [46] jquerylib_0.1.4 pkgdown_2.0.7 vctrs_0.6.4 +#> [49] Biostrings_2.66.0 nlme_3.1-163 iterators_1.0.14 +#> [52] xfun_0.41 stringr_1.5.1 lifecycle_1.0.4 +#> [55] rstatix_0.7.2 XML_3.99-0.16 zlibbioc_1.44.0 +#> [58] scales_1.3.0 ragg_1.2.6 hms_1.1.3 +#> [61] parallel_4.2.1 RColorBrewer_1.1-3 ComplexHeatmap_2.14.0 +#> [64] yaml_2.3.7 curl_5.1.0 memoise_2.0.1 +#> [67] ggplot2_3.4.4 sass_0.4.7 biomaRt_2.54.1 +#> [70] stringi_1.8.2 RSQLite_2.3.3 highr_0.10 +#> [73] S4Vectors_0.36.2 desc_1.4.2 foreach_1.5.2 +#> [76] BiocGenerics_0.44.0 filelock_1.0.2 shape_1.4.6 +#> [79] GenomeInfoDb_1.34.9 rlang_1.1.2 pkgconfig_2.0.3 +#> [82] systemfonts_1.0.5 matrixStats_1.1.0 bitops_1.0-7 +#> [85] evaluate_0.23 lattice_0.22-5 purrr_1.0.2 +#> [88] labeling_0.4.3 bit_4.0.5 tidyselect_1.2.0 +#> [91] plyr_1.8.9 magrittr_2.0.3 R6_2.5.1 +#> [94] IRanges_2.32.0 magick_2.8.1 generics_0.1.3 +#> [97] DBI_1.1.3 pillar_1.9.0 withr_2.5.2 +#> [100] mgcv_1.9-0 KEGGREST_1.38.0 abind_1.4-5 +#> [103] RCurl_1.98-1.13 tibble_3.2.1 crayon_1.5.2 +#> [106] car_3.1-2 utf8_1.2.4 BiocFileCache_2.6.1 +#> [109] rmarkdown_2.25 GetoptLong_1.0.5 progress_1.2.2 +#> [112] grid_4.2.1 blob_1.2.4 digest_0.6.33 +#> [115] tidyr_1.3.0 textshaping_0.3.7 stats4_4.2.1 +#> [118] munsell_0.5.0 bslib_0.5.1

diff --git a/docs/articles/plotting_vignette_files/figure-html/corscatter-1.png b/docs/articles/plotting_vignette_files/figure-html/corscatter-1.png index b9204be..1c137be 100644 Binary files a/docs/articles/plotting_vignette_files/figure-html/corscatter-1.png and b/docs/articles/plotting_vignette_files/figure-html/corscatter-1.png differ diff --git a/docs/articles/plotting_vignette_files/figure-html/featheatmap-1.png b/docs/articles/plotting_vignette_files/figure-html/featheatmap-1.png index d5bec98..1bd4f8b 100644 Binary files a/docs/articles/plotting_vignette_files/figure-html/featheatmap-1.png and b/docs/articles/plotting_vignette_files/figure-html/featheatmap-1.png differ diff --git a/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-1.png b/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-1.png index b4705d0..b5d47c7 100644 Binary files a/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-1.png and b/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-1.png differ diff --git a/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-2.png b/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-2.png index be8e0b0..bbfbb92 100644 Binary files a/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-2.png and b/docs/articles/plotting_vignette_files/figure-html/featheatmap-options-2.png differ diff --git a/docs/articles/plotting_vignette_files/figure-html/signalingnet-clusts-1.png b/docs/articles/plotting_vignette_files/figure-html/signalingnet-clusts-1.png index ab593c0..5e67d9a 100644 Binary files a/docs/articles/plotting_vignette_files/figure-html/signalingnet-clusts-1.png and b/docs/articles/plotting_vignette_files/figure-html/signalingnet-clusts-1.png differ diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index afe6c12..52049c5 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -5,5 +5,5 @@ articles: domino2: domino2.html domino_object_vignette: domino_object_vignette.html plotting_vignette: plotting_vignette.html -last_built: 2023-11-13T20:27Z +last_built: 2023-12-13T17:26Z diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 0000000..d2f87df Binary files /dev/null and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/add_rl_column.html b/docs/reference/add_rl_column.html index b5b193f..52e1f6f 100644 --- a/docs/reference/add_rl_column.html +++ b/docs/reference/add_rl_column.html @@ -98,6 +98,14 @@

Value

An updated RL signaling data frame

+
+

Examples

+
lr_name <- data.frame("abbrev" = c("L", "R"), "full" = c("Ligand", "Receptor"))
+rl_map_expanded <- add_rl_column(map = domino2:::rl_map_tiny, map_ref = "type_A",
+ conv = lr_name, new_name = "type_A_full")
+
+
+
diff --git a/docs/reference/build_domino.html b/docs/reference/build_domino.html index 14a0477..13ef1f7 100644 --- a/docs/reference/build_domino.html +++ b/docs/reference/build_domino.html @@ -116,6 +116,13 @@

Value

A domino object with a signaling network built

+
+

Examples

+
pbmc_dom_tiny_built <- build_domino(dom = domino2:::pbmc_dom_tiny, min_tf_pval = .001, max_tf_per_clust = 25,
+ max_rec_per_tf = 25, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1)
+
+
+
diff --git a/docs/reference/circos_ligand_receptor-1.png b/docs/reference/circos_ligand_receptor-1.png new file mode 100644 index 0000000..27b513e Binary files /dev/null and b/docs/reference/circos_ligand_receptor-1.png differ diff --git a/docs/reference/circos_ligand_receptor.html b/docs/reference/circos_ligand_receptor.html index 0e3462b..fadf9a7 100644 --- a/docs/reference/circos_ligand_receptor.html +++ b/docs/reference/circos_ligand_receptor.html @@ -108,6 +108,22 @@

Value

renders a circos plot to the active graphics device

+
+

Examples

+
cols <- c(
+  "red", "orange", "green", "blue", "pink", "purple",
+  "slategrey", "firebrick", "hotpink"
+)
+names(cols) <- dom_clusters(domino2:::pbmc_dom_built_tiny, labels = FALSE)
+circos_ligand_receptor(domino2:::pbmc_dom_built_tiny, receptor = "FCER2", cell_colors = cols)
+#> There are more than one numeric columns in the data frame. Take the
+#> first two numeric columns and draw the link ends with unequal width.
+#> 
+#> Type `circos.par$message = FALSE` to suppress the message.
+
+
+
+
diff --git a/docs/reference/cor_heatmap-1.png b/docs/reference/cor_heatmap-1.png new file mode 100644 index 0000000..b547e3d Binary files /dev/null and b/docs/reference/cor_heatmap-1.png differ diff --git a/docs/reference/cor_heatmap.html b/docs/reference/cor_heatmap.html index bd9b58b..1b65e63 100644 --- a/docs/reference/cor_heatmap.html +++ b/docs/reference/cor_heatmap.html @@ -123,6 +123,15 @@

Value

a Heatmap rendered to the active graphics device

+
+

Examples

+
receptors <- c("FAS", "CD22", "FCER2")
+tfs <- c("ZNF257", "RUNX1")
+cor_heatmap(domino2:::pbmc_dom_built_tiny, feats = tfs, recs = receptors)
+
+
+
+
diff --git a/docs/reference/cor_scatter-1.png b/docs/reference/cor_scatter-1.png new file mode 100644 index 0000000..edeba3f Binary files /dev/null and b/docs/reference/cor_scatter-1.png differ diff --git a/docs/reference/cor_scatter.html b/docs/reference/cor_scatter.html index b178264..fe4e400 100644 --- a/docs/reference/cor_scatter.html +++ b/docs/reference/cor_scatter.html @@ -99,6 +99,13 @@

Value

a ggplot object

+
+

Examples

+
cor_scatter(domino2:::pbmc_dom_built_tiny, "RUNX1", "FAS")
+
+
+
+
diff --git a/docs/reference/create_domino.html b/docs/reference/create_domino.html index 0b46357..5711c51 100644 --- a/docs/reference/create_domino.html +++ b/docs/reference/create_domino.html @@ -168,6 +168,58 @@

Value

A domino object

+
+

Examples

+
pbmc_dom_tiny_all <- pbmc_dom_tiny <- create_domino(rl_map = domino2:::rl_map_tiny,
+ features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny,
+ clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny, use_clusters = FALSE,
+ use_complexes = FALSE, rec_min_thresh = 0.1, remove_rec_dropout = TRUE,
+ tf_selection_method = "all")
+#> Reading in and processing signaling database
+#> Database provided from source: CellPhoneDB
+#> Getting z_scores, clusters, and counts
+#> Calculating correlations
+#> 1 of 3
+#> 2 of 3
+#> 3 of 3
+#> FAS has component genes that did not pass testing parameters
+#> CD22 has component genes that did not pass testing parameters
+#> IGF1R has component genes that did not pass testing parameters
+
+pbmc_dom_tiny_clustered <- create_domino(rl_map = domino2:::rl_map_tiny,
+ features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny,
+ clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny,
+ use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE)
+#> Reading in and processing signaling database
+#> Database provided from source: CellPhoneDB
+#> Getting z_scores, clusters, and counts
+#> Calculating feature enrichment by cluster
+#> 1 of 3
+#> 2 of 3
+#> 3 of 3
+#> Calculating correlations
+#> 1 of 3
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> 2 of 3
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> 3 of 3
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> Warning: Cannot compute exact p-value with ties
+#> IGF1R has component genes that did not pass testing parameters
+
+
+
diff --git a/docs/reference/create_regulon_list_scenic.html b/docs/reference/create_regulon_list_scenic.html index d59d351..0f9428b 100644 --- a/docs/reference/create_regulon_list_scenic.html +++ b/docs/reference/create_regulon_list_scenic.html @@ -83,6 +83,12 @@

Value

A list where names are transcription factors and the stored values are character vectors of genes in the inferred regulons

+
+

Examples

+
regulon_list_tiny <- create_regulon_list_scenic(regulons = domino2:::regulons_tiny)
+
+
+
diff --git a/docs/reference/create_rl_map_cellphonedb.html b/docs/reference/create_rl_map_cellphonedb.html index 00f5139..e73cc0f 100644 --- a/docs/reference/create_rl_map_cellphonedb.html +++ b/docs/reference/create_rl_map_cellphonedb.html @@ -125,6 +125,14 @@

Value

Data frame where each row describes a possible receptor-ligand interaction

+
+

Examples

+
rl_map_tiny <- create_rl_map_cellphonedb(genes = domino2:::genes_tiny, 
+ proteins = domino2:::proteins_tiny, interactions = domino2:::interactions_tiny, 
+ complexes = domino2:::complexes_tiny)
+
+
+
diff --git a/docs/reference/dom_clusters.html b/docs/reference/dom_clusters.html index ab8dc96..78ca168 100644 --- a/docs/reference/dom_clusters.html +++ b/docs/reference/dom_clusters.html @@ -87,6 +87,13 @@

Value

A vector containing either the names of the clusters used OR factors of the cluster label for each individual cell

+
+

Examples

+
cluster_names <- dom_clusters(domino2:::pbmc_dom_built_tiny)
+cell_cluster_label <- dom_clusters(domino2:::pbmc_dom_built_tiny, labels = TRUE)
+
+
+
diff --git a/docs/reference/dom_correlations.html b/docs/reference/dom_correlations.html index 8f42726..ff0b838 100644 --- a/docs/reference/dom_correlations.html +++ b/docs/reference/dom_correlations.html @@ -83,6 +83,12 @@

Value

A matrix containing the correlation values for each receptor (row) by transcription factor (column)

+
+

Examples

+
cor_matrix <- dom_correlations(domino2:::pbmc_dom_built_tiny)
+
+
+
diff --git a/docs/reference/dom_counts.html b/docs/reference/dom_counts.html index 9c0944a..1a1220f 100644 --- a/docs/reference/dom_counts.html +++ b/docs/reference/dom_counts.html @@ -83,6 +83,12 @@

Value

A matrix containing the gene expression values for each gene (row) by cell (column)

+
+

Examples

+
counts <- dom_counts(domino2:::pbmc_dom_built_tiny)
+
+
+
diff --git a/docs/reference/dom_database.html b/docs/reference/dom_database.html index 019c307..0e406be 100644 --- a/docs/reference/dom_database.html +++ b/docs/reference/dom_database.html @@ -89,6 +89,13 @@

Value

+
+

Examples

+
database_name <- dom_database(domino2:::pbmc_dom_built_tiny)
+full_database <- dom_database(domino2:::pbmc_dom_built_tiny, name_only = FALSE)
+
+
+
diff --git a/docs/reference/dom_de.html b/docs/reference/dom_de.html index 387062c..4a9dc98 100644 --- a/docs/reference/dom_de.html +++ b/docs/reference/dom_de.html @@ -83,6 +83,12 @@

Value

A matrix containing the p values for differential expression of transcription factors (rows) in each cluster (columns)

+
+

Examples

+
de_mat <- dom_de(domino2:::pbmc_dom_built_tiny)
+
+
+
diff --git a/docs/reference/dom_info.html b/docs/reference/dom_info.html index 91a8182..9abfe42 100644 --- a/docs/reference/dom_info.html +++ b/docs/reference/dom_info.html @@ -84,6 +84,12 @@

Value

build_domino() to infer the signaling network

+
+

Examples

+
build_details <- dom_info(domino2:::pbmc_dom_built_tiny)
+
+
+
diff --git a/docs/reference/dom_linkages.html b/docs/reference/dom_linkages.html index 1de928e..fec08a5 100644 --- a/docs/reference/dom_linkages.html +++ b/docs/reference/dom_linkages.html @@ -98,6 +98,13 @@

Value

A list containing linkages between some combination of receptors, ligands, transcription factors, and clusters

+
+

Examples

+
complexes <- dom_linkages(domino2:::pbmc_dom_built_tiny, "complexes")
+tf_rec_by_cluster <- dom_linkages(domino2:::pbmc_dom_built_tiny, "tf-receptor", TRUE)
+
+
+
diff --git a/docs/reference/dom_network_items.html b/docs/reference/dom_network_items.html new file mode 100644 index 0000000..c817631 --- /dev/null +++ b/docs/reference/dom_network_items.html @@ -0,0 +1,129 @@ + +Access all features, receptors, or ligands present in a signaling network. — dom_network_items • domino2 + Skip to contents + + +
+
+
+ +
+

This function collates all of the features, receptors, or ligands found in a +signaling network anywhere in a list of clusters. This can be useful for +comparing signaling networks across two separate conditions. In order to run +this build_domino() must be run on the object previously.

+
+ +
+

Usage

+
dom_network_items(dom, clusters = NULL, return = NULL)
+
+ +
+

Arguments

+
dom
+

Domino object containing a signaling network (i.e. build_domino() was run)

+ + +
clusters
+

Vector indicating clusters to collate network items from. If left as NULL then all clusters will be included.

+ + +
return
+

String indicating where to collate "features", "receptors", or "ligands". If "all" then a list of all three will be returned.

+ +
+
+

Value

+ + +

A vector containing all features, receptors, or ligands in the data set or a list containing all three.

+
+ +
+

Examples

+
monocyte_receptors <- dom_network_items(domino2:::pbmc_dom_built_tiny, "CD14_monocyte", "receptors")
+all_tfs <- dom_network_items(domino2:::pbmc_dom_built_tiny, return = "features")
+
+
+
+
+ + +
+ + + +
+ + + + + + + diff --git a/docs/reference/dom_signaling.html b/docs/reference/dom_signaling.html index b5c936b..ac2313d 100644 --- a/docs/reference/dom_signaling.html +++ b/docs/reference/dom_signaling.html @@ -88,6 +88,12 @@

Value

+
+

Examples

+
monocyte_signaling <- dom_signaling(domino2:::pbmc_dom_built_tiny, cluster = "CD14_monocyte")
+
+
+
diff --git a/docs/reference/dom_tf_activation.html b/docs/reference/dom_tf_activation.html index 4ec50c3..cc748c6 100644 --- a/docs/reference/dom_tf_activation.html +++ b/docs/reference/dom_tf_activation.html @@ -83,6 +83,12 @@

Value

A matrix containing the transcription factor activation scores for each feature (row) by cell (column)

+
+

Examples

+
tf_activation <- dom_tf_activation(domino2:::pbmc_dom_built_tiny)
+
+
+
diff --git a/docs/reference/dom_zscores.html b/docs/reference/dom_zscores.html index 676b484..e090413 100644 --- a/docs/reference/dom_zscores.html +++ b/docs/reference/dom_zscores.html @@ -83,6 +83,12 @@

Value

A matrix containing the z-scored gene expression values for each gene (row) by cell (column)

+
+

Examples

+
zscores <- dom_zscores(domino2:::pbmc_dom_built_tiny)
+
+
+
diff --git a/docs/reference/feat_heatmap-1.png b/docs/reference/feat_heatmap-1.png new file mode 100644 index 0000000..4dcd592 Binary files /dev/null and b/docs/reference/feat_heatmap-1.png differ diff --git a/docs/reference/feat_heatmap.html b/docs/reference/feat_heatmap.html index 8c3a971..515bff5 100644 --- a/docs/reference/feat_heatmap.html +++ b/docs/reference/feat_heatmap.html @@ -138,6 +138,14 @@

Value

a Heatmap rendered to the active graphics device

+
+

Examples

+
feat_heatmap(domino2:::pbmc_dom_built_tiny, min_thresh = 0.1, max_thresh = 0.6, norm = TRUE)
+#> Warning: You are using norm with min_thresh and max_thresh. Note that values will be thresholded AFTER normalization.
+
+
+
+
diff --git a/docs/reference/gene_network-1.png b/docs/reference/gene_network-1.png new file mode 100644 index 0000000..c66720e Binary files /dev/null and b/docs/reference/gene_network-1.png differ diff --git a/docs/reference/gene_network.html b/docs/reference/gene_network.html index 784d406..9b64962 100644 --- a/docs/reference/gene_network.html +++ b/docs/reference/gene_network.html @@ -129,6 +129,13 @@

Value

an igraph rendered to the active graphics device

+
+

Examples

+
gene_network(domino2:::pbmc_dom_built_tiny, clust = "CD8_T_cell", OutgoingSignalingClust = "CD14_monocyte")
+
+
+
+
diff --git a/docs/reference/incoming_signaling_heatmap-1.png b/docs/reference/incoming_signaling_heatmap-1.png new file mode 100644 index 0000000..1acd2fc Binary files /dev/null and b/docs/reference/incoming_signaling_heatmap-1.png differ diff --git a/docs/reference/incoming_signaling_heatmap.html b/docs/reference/incoming_signaling_heatmap.html index d225985..02ede9a 100644 --- a/docs/reference/incoming_signaling_heatmap.html +++ b/docs/reference/incoming_signaling_heatmap.html @@ -140,6 +140,13 @@

Value

a Heatmap rendered to the active graphics device

+
+

Examples

+
incoming_signaling_heatmap(domino2:::pbmc_dom_built_tiny, "CD8_T_cell")
+
+
+
+
diff --git a/docs/reference/index.html b/docs/reference/index.html index f23e7b2..0e0794c 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -80,11 +80,6 @@

Domino Classeslinkage_summary-class linkage_summary
The domino linkage summary class
-
- - pbmc_dom -
-
Example domino object from pbmc3k data

Analysis Functions

@@ -264,6 +259,11 @@

Access functionsAccess linkages
+ dom_network_items() +
+
Access all features, receptors, or ligands present in a signaling network.
+
+ dom_signaling()
Access signaling
@@ -295,16 +295,6 @@

Misc. utility functionsAdds a column to the RL signaling data frame.

- collate_network_items() -
-
Extracts all features, receptors, or ligands present in a signaling network.
-
- - convert_genes() -
-
Use biomaRt to convert genes
-
- count_linkage()
Count occurrences of linkages across multiple domino results from a linkage summary
diff --git a/docs/reference/mean_ligand_expression.html b/docs/reference/mean_ligand_expression.html index cd51c86..20e05c4 100644 --- a/docs/reference/mean_ligand_expression.html +++ b/docs/reference/mean_ligand_expression.html @@ -102,6 +102,15 @@

Value

A data frame of ligand expression targeting the specified receptor

+
+

Examples

+
counts <- dom_counts(domino2:::pbmc_dom_built_tiny)
+mean_exp <- mean_ligand_expression(counts,
+ ligands = c("PTPRC", "FASLG"), cell_ident = "CD14_monocyte",
+ cell_barcodes = colnames(counts), destination = "FAS")
+
+
+
diff --git a/docs/reference/print-domino-method.html b/docs/reference/print-domino-method.html index c665c80..9750336 100644 --- a/docs/reference/print-domino-method.html +++ b/docs/reference/print-domino-method.html @@ -84,6 +84,14 @@

Value

a printed description of the number of cell clusters in the object

+
+

Examples

+
print(domino2:::pbmc_dom_built_tiny)
+#> A domino object of 360 cells
+#> Built with signaling between 3 clusters
+
+
+
diff --git a/docs/reference/rename_clusters.html b/docs/reference/rename_clusters.html index e04574c..c288e6e 100644 --- a/docs/reference/rename_clusters.html +++ b/docs/reference/rename_clusters.html @@ -105,6 +105,14 @@

Value

A domino object with clusters renamed in all applicable slots.

+
+

Examples

+
new_clust <- c("CD8_T_cell" = "CD8+ T Cells",
+ "CD14_monocyte" = "CD14+ Monocytes", "B_cell" = "B Cells")
+pbmc_dom_built_tiny <- rename_clusters(domino2:::pbmc_dom_built_tiny, new_clust)
+
+
+
diff --git a/docs/reference/show-domino-method.html b/docs/reference/show-domino-method.html index 25fc16d..c9b3da7 100644 --- a/docs/reference/show-domino-method.html +++ b/docs/reference/show-domino-method.html @@ -84,6 +84,18 @@

Value

a printed description of the number of cells in a domino object and its build status

+
+

Examples

+
domino2:::pbmc_dom_built_tiny
+#> A domino object of 360 cells
+#> Built with signaling between 3 clusters
+
+show(domino2:::pbmc_dom_built_tiny)
+#> A domino object of 360 cells
+#> Built with signaling between 3 clusters
+
+
+
diff --git a/docs/reference/signaling_heatmap-1.png b/docs/reference/signaling_heatmap-1.png new file mode 100644 index 0000000..b7d7fbb Binary files /dev/null and b/docs/reference/signaling_heatmap-1.png differ diff --git a/docs/reference/signaling_heatmap.html b/docs/reference/signaling_heatmap.html index 2d50581..4298e66 100644 --- a/docs/reference/signaling_heatmap.html +++ b/docs/reference/signaling_heatmap.html @@ -118,6 +118,13 @@

Value

a Heatmap rendered to the active graphics device

+
+

Examples

+
signaling_heatmap(domino2:::pbmc_dom_built_tiny)
+
+
+
+
diff --git a/docs/reference/signaling_network-1.png b/docs/reference/signaling_network-1.png new file mode 100644 index 0000000..0155020 Binary files /dev/null and b/docs/reference/signaling_network-1.png differ diff --git a/docs/reference/signaling_network.html b/docs/reference/signaling_network.html index 71e3bc1..7c03042 100644 --- a/docs/reference/signaling_network.html +++ b/docs/reference/signaling_network.html @@ -161,6 +161,13 @@

Value

an igraph rendered to the active graphics device

+
+

Examples

+
signaling_network(domino2:::pbmc_dom_built_tiny, layout = "fr")
+
+
+
+
diff --git a/docs/reference/table_convert_genes.html b/docs/reference/table_convert_genes.html index 5767c47..49e7359 100644 --- a/docs/reference/table_convert_genes.html +++ b/docs/reference/table_convert_genes.html @@ -1,5 +1,7 @@ -Convert Genes Using Table — table_convert_genes • domino2Convert Genes Using Table — table_convert_genes • domino2 @@ -62,7 +64,8 @@
-

Takes a vector of gene inputs and returns converted gene table

+

Takes a vector of gene inputs and a conversion table (an example +and returns converted gene table

diff --git a/docs/search.json b/docs/search.json index f4fbb55..88f68b1 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":"/articles/domino2.html","id":"using-domino2-v0-2-1-for-cell-cell-communication-inference","dir":"Articles","previous_headings":"","what":"Using domino2 v0.2.1 for cell-cell communication inference","title":"Get Started with domino2","text":"domino2 tool analysis intra- intercellular signaling single cell RNA sequencing (scRNAseq) data based transcription factor (TF) activation. , show basic example pipeline generating communication networks domino object. vignette demonstrate use domino2 10X Genomics Peripheral Blood Mononuclear Cells (PBMC) data set 2,700 cells. data can downloaded .","code":""},{"path":"/articles/domino2.html","id":"preprocessing-scrnaseq-data","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference","what":"Preprocessing scRNAseq data","title":"Get Started with domino2","text":"Analysis cell-cell communication domino2 often follows initial processing annotation scRNAseq data. following Satija Lab’s Guided Clustering Tutorial prepare data set analysis domino2.","code":"# Preprocessing of PBMC 3K tutorial data set using Seurat functions pbmc.data <- Read10X(data.dir = \"../inst/extdata/pbmc3k_filtered_gene_bc_matrices\") pbmc <- CreateSeuratObject(counts = pbmc.data, project = \"pbmc3k\", min.cells = 3, min.features = 200) pbmc[[\"percent.mt\"]] <- PercentageFeatureSet(pbmc, pattern = \"^MT-\") pbmc <- NormalizeData(pbmc, normalization.method = \"LogNormalize\", scale.factor = 10000) pbmc <- FindVariableFeatures(pbmc, selection.method = \"vst\", nfeatures = 2000) pbmc <- ScaleData(pbmc, features = rownames(pbmc)) pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc)) pbmc <- FindNeighbors(pbmc, dims = 1:10) pbmc <- FindClusters(pbmc, resolution = 0.5) #> Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck #> #> Number of nodes: 2700 #> Number of edges: 97892 #> #> Running Louvain algorithm... #> Maximum modularity in 10 random starts: 0.8719 #> Number of communities: 9 #> Elapsed time: 0 seconds pbmc <- RunUMAP(pbmc, dims = 1:10) # Annotate clusters with cell phenotypes cell_dict <- data.frame( cluster = c(0:8), cell_type = c( \"naive_CD4_T_cell\", \"CD14_monocyte\", \"memory_CD4_T_cell\", \"B_cell\", \"CD8_T_cell\", \"CD16_monocyte\", \"NK_cell\", \"dendritic_cell\", \"platelet\" ) ) pbmc$cell_type <- plyr::mapvalues( pbmc$seurat_clusters, from = cell_dict$cluster, to = cell_dict$cell_type )"},{"path":"/articles/domino2.html","id":"saving-preprocessed-data","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Preprocessing scRNAseq data","what":"Saving Preprocessed Data:","title":"Get Started with domino2","text":"domino2 designed compatible Seurat objects addition accepting matrices vectors data set function inputs. Therefore, ’s good idea save processed Seurat object analysis. However, pySCENIC used TF activation inference, requires input cell gene matrix. opposite orientation Seurat objects default Python based tools scanpy. Saving data loom file using loomR helpful step therefore recommended well. cell x gene counts matrix may also saved tab-separated value (.tsv) file loomR used computing resource, aware dense formatting .tsv can lead large file sizes slow processing large data sets. provided necessary code , due large file size, .tsv file provided data directory. like skip ahead rest analysis, processed objects steps available data directory package.","code":"# save Seurat object as RDS save(pbmc, file = \"../data/pbmc.rda\") # save loom counts matrix pbmc_counts <- GetAssayData(object = pbmc, slot = \"counts\") pbmc_loom <- loomR::create(filename = \"../inst/extdata/pbmc3k_counts.loom\", data = pbmc_counts) pbmc_loom$close_all() # Remember to manually close connection to loom files! pbmc_counts <- GetAssayData(object = pbmc, slot = \"counts\") write.table(t(as.matrix(pbmc_counts)), \"../data/pbmc3k_counts.tsv\", sep = \"\\t\", col.names = NA )"},{"path":"/articles/domino2.html","id":"installation","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference","what":"Installation","title":"Get Started with domino2","text":"Installation domino2 Github can achieved using remotes package. current stable version v0.2.2, install branch.","code":"if (!require(remotes)) { install.packages(\"remotes\") } remotes::install_github(\"FertigLab/domino2@v0.2.2\")"},{"path":"/articles/domino2.html","id":"additional-downloads","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Installation","what":"Additional Downloads","title":"Get Started with domino2","text":"tutorial, pySCENIC used method TF activity inference assessment ligand-receptor interactions based curated interactions CellPhoneDB v4.0.0. requires downloading files prior use analysis pipeline.","code":""},{"path":"/articles/domino2.html","id":"downloads-for-scenic","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for SCENIC:","title":"Get Started with domino2","text":"singularity image SCENIC v0.12.1 can installed DockerHub image source (example scripts use Docker provided scenic_bash directory well). SCENIC requires list TFs, motif annotations, cisTarget motifs available authors SCENIC human (HGNC), mouse (MGI), fly. following download everything necessary analysis data set HGNC gene labels hg38 genome.","code":"SCENIC_DIR=\"../inst/extdata/scenic\" mkdir ${SCENIC_DIR} # Build singularity image singularity build \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" docker://aertslab/pyscenic:0.12.1 # Matrix containing motifs as rows and genes as columns and ranking position for each gene and motif (based on CRM scores) as values # below is a feather v1 format link; feather v2 required for this version of pySCENIC # \"https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather\" # Feather v2 link: curl \"https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ -o \"${SCENIC_DIR}/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" # below is a feather v1 format link; feather v2 required for this version of pySCENIC # \"https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather\" # Feather v2 link: curl \"https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ -o \"${SCENIC_DIR}/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" # List of genes encoding TFs in the HG38 reference genome curl \"https://resources.aertslab.org/cistarget/tf_lists/allTFs_hg38.txt\" \\ -o \"${SCENIC_DIR}/allTFs_hg38.txt\" # Motif annotations based on the 2017 cisTarget motif collection. Use these files if you are using the mc9nr databases. curl \"https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ -o \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\""},{"path":"/articles/domino2.html","id":"downloads-for-cellphonedb","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for CellPhoneDB:","title":"Get Started with domino2","text":"Database files CellPhoneDB v4.0.0 human scRNAseq data can installed public Github repository Tiechmann Group developed CellPhoneDB.","code":"CELLPHONE_DIR=\"../inst/extdata/cellphoneDB_v4\" mkdir ${CELLPHONE_DIR} # Annotation of protein complexes curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/complex_input.csv\" \\ -o \"${CELLPHONE_DIR}/complex_input.csv\" # Annotation of genes encoding database proteins curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/gene_input.csv\" \\ -o \"${CELLPHONE_DIR}/gene_input.csv\" # Annotated protein interactions curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/interaction_input.csv\" \\ -o \"${CELLPHONE_DIR}/interaction_input.csv\" # Annotated protein features curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/protein_input.csv\" \\ -o \"${CELLPHONE_DIR}/protein_input.csv\""},{"path":"/articles/domino2.html","id":"scenic-analysis","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference","what":"SCENIC Analysis","title":"Get Started with domino2","text":"SCENIC lab’s preferred software TF activity scoring. recommend using Python implementation (pySCENIC) faster original R implementation. aware, use SCENIC often slowest memory intensive step analysis pipeline. SCENIC run computing resources access multi-core processing large amounts memory. described section saving preprocessed data, SCENIC requires RNA counts provided cell gene matrix format, using pbmc3k_counts.loom file stage analysis. pySCENIC initiated using bash scripting terminal. analysis consists 3 steps score genes TF motif enrichment, construct TF regulons consisting genes targeted TFs, arrive AUC scores enrichment regulon gene transcription within cell.","code":""},{"path":"/articles/domino2.html","id":"grn-construct-tf-modules","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > SCENIC Analysis","what":"grn: construct TF-modules","title":"Get Started with domino2","text":"Co-expression modules used quantify gene-TF adjacencies.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic grn \\ \"../data/pbmc3k_counts.loom\" \\ \"${SCENIC_DIR}/allTFs_hg38.txt\" \\ -o \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ --num_workers 6 \\ --seed 123 # Arguments: # path to the loom file # list of TFs # output directory for the adjacency matrix # number of CPUs to use if multi-core processing is available # specify a random seed for reproducibility"},{"path":"/articles/domino2.html","id":"ctx-construct-tf-regulons-with-pruning-based-on-tf-motif-enrichment","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > SCENIC Analysis","what":"ctx: construct TF regulons with pruning based on TF motif enrichment","title":"Get Started with domino2","text":"rankings genes based enrichment TF motifs transcription start site (TSS) considered construction regulons, target genes TF-modules removed lack motifs proximal TSS TF may bind.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic ctx \\ \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ \"${SCENIC_DIR}/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ \"${SCENIC_DIR}/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ --annotations_fname \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ --expression_mtx_fname \"data/pbmc3k_counts.loom\" \\ --mode \"dask_multiprocessing\" \\ --output \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ --num_workers 1 # Arguments: # adjacency matrix output from grn # target rankings of motif enrichment within 10 kb of TSS # target rankings of motif enrichment within 500 bp upstream and 100 bp downstream of TSS # TF motif features # counts matrix loom file # enable multi-core processing # output file of learned TF regulons # number of CPU cores"},{"path":"/articles/domino2.html","id":"aucell-calculate-tf-activity-scores","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > SCENIC Analysis","what":"aucell: calculate TF activity scores","title":"Get Started with domino2","text":"Enrichment regulon measured Area recovery Curve (AUC) genes define regulon.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic aucell \\ \"../data/pbmc3k_counts.loom\" \\ \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ -o \"${SCENIC_DIR}/pbmc_auc.csv\" # Arguments: # counts matrix loom file # regulon table output from ctx # cell x TF matrix of TF enrichment AUC values"},{"path":[]},{"path":"/articles/domino2.html","id":"loading-scenic-results","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Building a Signaling Network with domino2","what":"Loading SCENIC Results","title":"Get Started with domino2","text":"TF activities required input domino2, regulons learned SCENIC important optional input needed annotate TF-target interactions prune TF-receptor linkages receptor target TF. prevents distinction receptor expression driving TF activity TF inducing receptor’s expression. initial regulons data frame read R ctx function 2 rows column names need replaced one succinct description. domino2 changed input format TF regulons list storing vectors target genes regulon, names list TF genes. facilitates use alternative methods TF activity quantification methods. provide helper function, create_regulon_list_scenic() easy retrieval TF regulons output pySCENIC ctx function. Users aware AUC matrix SCENIC loaded cell x TF orientation transposed TF x cell orientation. pySCENIC also appends “(+)” TF names converted “…” upon loading R. characters can included without affecting results domino2 analysis, can confusing querying TF features data. recommend comprehensive removal “…” characters using gsub() function.","code":"scenic_dir <- \"../inst/extdata/scenic/\" regulons <- read.csv(paste0(scenic_dir, \"/regulons_pbmc_3k.csv\")) auc <- read.table(paste0(scenic_dir, \"/auc_pbmc_3k.csv\"), header = TRUE, row.names = 1, stringsAsFactors = FALSE, sep = \",\" ) regulons <- regulons[-1:-2, ] colnames(regulons) <- c( \"TF\", \"MotifID\", \"AUC\", \"NES\", \"MotifSimilarityQvalue\", \"OrthologousIdentity\", \"Annotation\", \"Context\", \"TargetGenes\", \"RankAtMax\" ) regulon_list <- create_regulon_list_scenic(regulons = regulons) auc_in <- as.data.frame(t(auc)) # Remove pattern \"...\" from the end of all rownames: rownames(auc_in) <- gsub(\"\\\\.\\\\.\\\\.$\", \"\", rownames(auc_in))"},{"path":"/articles/domino2.html","id":"load-cellphonedb-database","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Building a Signaling Network with domino2","what":"Load CellPhoneDB Database","title":"Get Started with domino2","text":"domino2 updated read ligand-receptor data bases uniform data.frame format referred receptor-ligand map (rl_map) enable use alternative updated reference databases opposed particular version CellPhoneDB’s database older versions Domino. row corresponds ligand-receptor interaction. Genes participating interaction referred “partner ” “partner B” without requirement fixed ordering whether B ligand vice versa. minimum required columns data frame : int_pair: names interacting ligand receptor separated \" & \" gene_A: gene genes encoding partner gene_B: gene genes encoding partner B type_A: (“L”, “R”) - indicates whether partner ligand (“L”) receptor (“R”) type_B: (“L”, “R”) - indicates whether partner B ligand (“L”) receptor (“R”) Additional annotation columns can provided name_A name_B ligands receptors whose name interaction database match names encoding genes. formatting also allows consideration ligand receptor complexes comprised heteromeric combination multiple proteins must co-expressed function. cases, “name_*” column shows name protein complex, “gene_*” column shows names genes encoding components complex separated commas “,”. plotting results build domino object, names interacting ligands receptors used based combinatorial expression complex components. facilitate use formatting CellPhoneDB database, include helper function, create_rl_map_cellphonedb(), automatically parses files cellPhoneDB database arrive rl_map format.","code":"cellphonedb_2_path <- \"../inst/extdata/cellphoneDB_v4/\" complexes <- read.csv(paste0(cellphonedb_2_path, \"/complex_input.csv\"), stringsAsFactors = FALSE) genes <- read.csv(paste0(cellphonedb_2_path, \"/gene_input.csv\"), stringsAsFactors = FALSE) interactions <- read.csv(paste0(cellphonedb_2_path, \"/interaction_input.csv\"), stringsAsFactors = FALSE) proteins <- read.csv(paste0(cellphonedb_2_path, \"/protein_input.csv\"), stringsAsFactors = FALSE) rl_map <- create_rl_map_cellphonedb( genes = genes, proteins = proteins, interactions = interactions, complexes = complexes, database_name = \"CellPhoneDB_v4.0\" # database version used ) knitr::kable(head(rl_map))"},{"path":"/articles/domino2.html","id":"optional-adding-interactions-manually","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Building a Signaling Network with domino2 > Load CellPhoneDB Database","what":"Optional: Adding interactions manually","title":"Get Started with domino2","text":"change use rl_map formatting also enables users manually append interactions interest included interaction database need . can attained formatting desired interactions data.frame column headers rl_map using rbind() function.","code":"# Integrin complexes are not annotated as receptors in CellPhoneDB_v4.0 # collagen-integrin interactions between cells may be missed unless tables from the CellPhoneDB reference are edited or the interactions are manually added col_int_df <- data.frame( \"int_pair\" = \"a11b1 complex & COLA1_HUMAN\", \"name_A\" = \"a11b1 complex\", \"uniprot_A\" = \"P05556,Q9UKX5\", \"gene_A\" = \"ITB1,ITA11\", \"type_A\" = \"R\", \"name_B\" = \"COLA1_HUMAN\", \"uniprot_B\" = \"P02452,P08123\", \"gene_B\" = \"COL1A1,COL1A2\", \"type_B\" = \"L\", \"annotation_strategy\" = \"manual\", \"source\" = \"manual\", \"database_name\" = \"manual\" ) rl_map_append <- rbind(col_int_df, rl_map) knitr::kable(head(rl_map_append))"},{"path":"/articles/domino2.html","id":"creating-the-domino-object","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference","what":"Creating the Domino Object","title":"Get Started with domino2","text":"domino2 analysis takes place two steps. 1. create_domino() initializes domino result object assesses differential TF activity across cell clusters wilcoxon rank-sum test establishes TF-receptor linkages based Spearman correlation TF activities receptor expression across queried data set. build_domino() sets parameters TFs receptors called active within cell cluster aggregates scaled expression ligands capable interacting active receptors assessment ligand type cellular source triggering activation receptor.","code":""},{"path":"/articles/domino2.html","id":"required-inputs-from-data-set","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Creating the Domino Object","what":"Required inputs from data set","title":"Get Started with domino2","text":"domino2 infers active receipt signals via receptors based correlation receptor’s expression TF activity across data set differential activity TF within cell cluster. Correlations conducted using scaled expression values rather raw counts normalized counts. assessment receptor activity per cell type basis, named vector cell cluster assignments, names cell barcodes matching expression matrix, provided. Assessing signaling based categorical groupings cells can achieved passing groupings “clusters” build_domino() place cell types. domino2 accepts either Seurat object counts, scaled counts, clusters included, requires matrix counts, matrix scaled counts, named vector cell cluster labels factors. Shown extract elements Seurat object. Note: Ligand receptor expression can assessed genes included z_scores matrix. Many scRNAseq analysis pipelines recommend storing genes high variance scaled expression slots data objects, thereby missing many genes encoding ligands receptors. Ensure genes interest included rows z_scores matrix. Scaled expression calculated genes PBMC data set removal genes expressed less 3 cells.","code":"counts <- GetAssayData(object = pbmc, slot = \"counts\") z_scores <- as.matrix(GetAssayData(object = pbmc, slot = \"scale.data\")) clusters <- pbmc$cell_type"},{"path":"/articles/domino2.html","id":"create-domino-object","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Creating the Domino Object","what":"Create Domino object","title":"Get Started with domino2","text":"point, create_domino() function can used make object. Parameters note include “use_clusters” required assess signaling cell types rather linkage TFs receptors broadly across data set. “use_complexes” decides receptors function heteromeric complexes considered testing linkages TFs receptors. TRUE, receptor complex linked TF majority component genes meet Spearman correlation threshold. “remove_rec_dropout” decides whether receptor values 0 considered correlation calculations; measure intended reduce effect dropout receptors low expression. run create_domino() matrix vector inputs: results equivalent using Seurat object directly. Note inclusion matrix inputs Seurat object prioritize Seurat object. information stored domino object access , please see vignette structure domino objects.","code":"pbmc_dom <- create_domino( rl_map = rl_map, features = auc_in, counts = counts, z_scores = z_scores, clusters = clusters, tf_targets = regulon_list, use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE ) # rl_map: receptor-ligand map data frame # features: TF scores (AUC matrix) # counts: counts matrix # z_scores: scaled expression data # clusters: named vector of cell cluster assignments # tf_targets: list of TFs and their regulons # use_clusters: assess receptor activation and ligand expression on a per-cluster basis # use_complexes: include receptors and genes that function as a complex in results # remove_rec_dropout: whether to remove zeroes from correlation calculations pbmc_dom <- create_domino( rl_map = rl_map, features = auc_in, ser = pbmc, tf_targets = regulon_list, use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE )"},{"path":"/articles/domino2.html","id":"build-domino","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Creating the Domino Object","what":"Build Domino","title":"Get Started with domino2","text":"build_domino() finalizes construction domino object setting parameters identifying TFs differential activation clusters, receptor linkage TFs based magnitude positive correlation, minimum percentage cells within cluster expression receptor receptor called active. also options thresholds number TFs may called active cluster number receptors may linked one TF. thresholds n TFs m receptors, bottom n TFs lowest p-values wilcoxon rank sum test top m receptors Spearman correlation coefficient chosen. thresholds number receptors TFs can sent infinity (Inf) collect receptors TFs meet statistical significance thresholds.","code":"pbmc_dom <- build_domino( dom = pbmc_dom, min_tf_pval = .001, max_tf_per_clust = 25, max_rec_per_tf = 25, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1 ) # min_tf_pval: Threshold for p-value of DE for TFs # rec_tf_cor_threshold: Minimum correlation between receptor and TF # min_rec_percentage: Minimum percent of cells that must express receptor pbmc_dom_all <- build_domino( dom = pbmc_dom, min_tf_pval = .001, max_tf_per_clust = Inf, max_rec_per_tf = Inf, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1, )"},{"path":"/articles/domino2.html","id":"visualization-of-domino-results","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference","what":"Visualization of Domino Results","title":"Get Started with domino2","text":"Multiple functions available visualize intracellular networks receptors TFs ligand-receptor mediated intercellular networks cell types.","code":""},{"path":"/articles/domino2.html","id":"summarize-tf-activity-and-linkage","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Visualization of Domino Results","what":"Summarize TF Activity and Linkage","title":"Get Started with domino2","text":"Enrichment TF activities cell types can visualized feat_heatmap() plots data set-wide TF activity scores heatmap.","code":"feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE)"},{"path":"/articles/domino2.html","id":"cumulative-signaling-between-cell-types","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Visualization of Domino Results","what":"Cumulative signaling between cell types","title":"Get Started with domino2","text":"cumulative degree signaling clusters assessed sum scaled expression ligands targeting active receptors another cluster. can visualized graph format using signaling_network() function. Nodes represent cell cluster edges scale magnitude signaling clusters. color edge corresponds sender cluster signal. Signaling networks can also drawn edges rendering signals directed towards given cell type signals one cell type directed others. see options use, well plotting functions options, please see plotting vignette.","code":"signaling_network(pbmc_dom, edge_weight = 1, max_thresh = 5)"},{"path":"/articles/domino2.html","id":"specific-signaling-interactions-between-clusters","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference > Visualization of Domino Results","what":"Specific Signaling Interactions between Clusters","title":"Get Started with domino2","text":"Beyond aggregated degree signaling cell types, degrees signaling specific ligand-receptor interactions can assessed. gene_network() provides graph linkages active TFs cluster, linked receptors cluster, possible ligands active receptors. New domino2, gene_network() can used two clusters determine possible ligands given receptor expressed putative outgoing signaling cluster. comprehensive assessment ligand expression targeting active receptors given cluster can assessed incoming_signaling_heatmap(). Another form comprehensive ligand expression assessment available individual active receptors form circos plots new domino2. outer arcs correspond clusters domino object inner arcs representing possible ligand plotted receptor. Arcs drawn ligands cell type receptor ligand expressed specified threshold. Arc widths correspond mean express ligand cluster widest arc width scaling maximum expression ligand within data.","code":"gene_network(pbmc_dom, clust = \"dendritic_cell\", layout = \"grid\") gene_network(pbmc_dom, clust = \"dendritic_cell\", OutgoingSignalingClust = \"CD14_monocyte\", layout = \"grid\" ) incoming_signaling_heatmap(pbmc_dom, rec_clust = \"dendritic_cell\", max_thresh = 2.5) circos_ligand_receptor(pbmc_dom, receptor = \"CD74\")"},{"path":"/articles/domino2.html","id":"continued-development","dir":"Articles","previous_headings":"Using domino2 v0.2.1 for cell-cell communication inference","what":"Continued Development","title":"Get Started with domino2","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, put together information plotting domino object structure like explore package’s functionality. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-11-13\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> 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/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] grid stats graphics grDevices utils datasets methods #> [8] base #> #> other attached packages: #> [1] knitr_1.44 ComplexHeatmap_2.12.1 circlize_0.4.15 #> [4] plyr_1.8.8 loomR_0.2.1.9000 hdf5r_1.3.8 #> [7] R6_2.5.1 SeuratObject_5.0.0 Seurat_4.4.0 #> [10] domino2_0.2.2 #> #> loaded via a namespace (and not attached): #> [1] utf8_1.2.3 spatstat.explore_3.2-3 reticulate_1.32.0 #> [4] R.utils_2.12.2 tidyselect_1.2.0 RSQLite_2.3.1 #> [7] AnnotationDbi_1.58.0 htmlwidgets_1.6.2 Rtsne_0.16 #> [10] munsell_0.5.0 codetools_0.2-19 ragg_1.2.5 #> [13] ica_1.0-3 future_1.33.0 miniUI_0.1.1.1 #> [16] spatstat.random_3.1-6 colorspace_2.1-0 progressr_0.14.0 #> [19] Biobase_2.56.0 filelock_1.0.2 stats4_4.2.1 #> [22] ROCR_1.0-11 tensor_1.5 ggsignif_0.6.4 #> [25] listenv_0.9.0 GenomeInfoDbData_1.2.8 polyclip_1.10-4 #> [28] bit64_4.0.5 rprojroot_2.0.3 parallelly_1.36.0 #> [31] vctrs_0.6.3 generics_0.1.3 xfun_0.40 #> [34] BiocFileCache_2.4.0 doParallel_1.0.17 GenomeInfoDb_1.32.4 #> [37] clue_0.3-65 bitops_1.0-7 spatstat.utils_3.0-3 #> [40] cachem_1.0.8 promises_1.2.1 scales_1.2.1 #> [43] gtable_0.3.4 Cairo_1.6-1 globals_0.16.2 #> [46] goftest_1.2-3 spam_2.9-1 rlang_1.1.1 #> [49] systemfonts_1.0.4 GlobalOptions_0.1.2 splines_4.2.1 #> [52] rstatix_0.7.2 lazyeval_0.2.2 spatstat.geom_3.2-5 #> [55] broom_1.0.5 yaml_2.3.7 reshape2_1.4.4 #> [58] abind_1.4-5 backports_1.4.1 httpuv_1.6.11 #> [61] tools_4.2.1 ggplot2_3.4.4 ellipsis_0.3.2 #> [64] jquerylib_0.1.4 RColorBrewer_1.1-3 BiocGenerics_0.42.0 #> [67] ggridges_0.5.4 Rcpp_1.0.11 progress_1.2.2 #> [70] zlibbioc_1.42.0 purrr_1.0.2 RCurl_1.98-1.12 #> [73] prettyunits_1.2.0 deldir_1.0-9 ggpubr_0.6.0 #> [76] pbapply_1.7-2 GetoptLong_1.0.5 cowplot_1.1.1 #> [79] S4Vectors_0.34.0 zoo_1.8-12 ggrepel_0.9.3 #> [82] cluster_2.1.4 fs_1.6.3 magrittr_2.0.3 #> [85] magick_2.8.0 data.table_1.14.8 scattermore_1.2 #> [88] lmtest_0.9-40 RANN_2.6.1 fitdistrplus_1.1-11 #> [91] R.cache_0.16.0 matrixStats_1.0.0 hms_1.1.3 #> [94] patchwork_1.1.3 mime_0.12 evaluate_0.21 #> [97] xtable_1.8-4 XML_3.99-0.14 IRanges_2.30.1 #> [100] gridExtra_2.3 shape_1.4.6 compiler_4.2.1 #> [103] biomaRt_2.52.0 tibble_3.2.1 KernSmooth_2.23-22 #> [106] crayon_1.5.2 R.oo_1.25.0 htmltools_0.5.6 #> [109] later_1.3.1 tidyr_1.3.0 DBI_1.1.3 #> [112] dbplyr_2.3.3 MASS_7.3-60 rappdirs_0.3.3 #> [115] Matrix_1.6-1.1 car_3.1-2 cli_3.6.1 #> [118] R.methodsS3_1.8.2 parallel_4.2.1 dotCall64_1.0-2 #> [121] igraph_1.5.1 pkgconfig_2.0.3 pkgdown_2.0.7 #> [124] sp_2.0-0 plotly_4.10.2 spatstat.sparse_3.0-2 #> [127] xml2_1.3.5 foreach_1.5.2 bslib_0.5.1 #> [130] XVector_0.36.0 stringr_1.5.0 digest_0.6.33 #> [133] sctransform_0.4.0 RcppAnnoy_0.0.21 spatstat.data_3.0-1 #> [136] Biostrings_2.64.1 rmarkdown_2.25 leiden_0.4.3 #> [139] uwot_0.1.16 curl_5.0.2 shiny_1.7.5 #> [142] rjson_0.2.21 nlme_3.1-163 lifecycle_1.0.3 #> [145] jsonlite_1.8.7 carData_3.0-5 desc_1.4.2 #> [148] viridisLite_0.4.2 fansi_1.0.4 pillar_1.9.0 #> [151] lattice_0.21-8 KEGGREST_1.36.3 fastmap_1.1.1 #> [154] httr_1.4.7 survival_3.5-7 glue_1.6.2 #> [157] png_0.1-8 iterators_1.0.14 bit_4.0.5 #> [160] stringi_1.7.12 sass_0.4.7 blob_1.2.4 #> [163] textshaping_0.3.6 memoise_2.0.1 styler_1.10.2 #> [166] dplyr_1.1.3 irlba_2.3.5.1 future.apply_1.11.0"},{"path":"/articles/domino_object_vignette.html","id":"the-new-domino-object-structure","dir":"Articles","previous_headings":"","what":"The new domino object structure","title":"Interacting with domino2 Objects","text":"order better implement changes made domino2, structure domino object modified. , describe data stored domino object, well best access use may mind.","code":""},{"path":"/articles/domino_object_vignette.html","id":"object-contents","dir":"Articles","previous_headings":"The new domino object structure","what":"Object contents","title":"Interacting with domino2 Objects","text":"contents domino object class include broad groups: - input data, L-R database used, counts, z-scores - calculations, correlations differential expression results - linkages, show connections TFs, receptors, ligands across data set within clusters - signaling matrices, show signaling ligands receptors clusters (summary overall signaling) - build information, includes parameters used build object build_domino() functions commonly accessed information (number cells, clusters, build information), show print methods domino objects can used.","code":"dom #> A domino object of 2700 cells #> Built with signaling between 9 clusters print(dom) #> A domino object of 2700 cells #> Contains signaling between 9 clusters #> Built with a maximum of 25 TFs per cluster #> and a maximum of 25 receptors per TF"},{"path":"/articles/domino_object_vignette.html","id":"access-functions","dir":"Articles","previous_headings":"The new domino object structure","what":"Access functions","title":"Interacting with domino2 Objects","text":"order facilitate access information stored domino object, provided collection functions retrieve specific items. functions begin “dom_” can listed using ls().","code":"ls(\"package:domino2\", pattern = \"^dom_\") #> [1] \"dom_clusters\" \"dom_correlations\" \"dom_counts\" #> [4] \"dom_database\" \"dom_de\" \"dom_info\" #> [7] \"dom_linkages\" \"dom_signaling\" \"dom_tf_activation\" #> [10] \"dom_zscores\""},{"path":"/articles/domino_object_vignette.html","id":"input-data","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Input data","title":"Interacting with domino2 Objects","text":"creating domino object create_domino() function, several inputs required stored domino object . include cluster labels, counts matrix, z-scored counts matrix, transcription factor activation scores, R-L database used create_rl_map_cellphonedb(). example, access cluster names domino object: Setting argument labels = TRUE return vector cluster labels cell rather unique cluster names. access counts: z-scored counts: transcription factor activation scores can similarly accessed: Information database inputted can extracted dom_database() function. default, function returns name(s) database(s) used: like view entire ligand-receptor map, set name_only = FALSE:","code":"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\" count_matrix <- dom_counts(dom) knitr::kable(count_matrix[1:5, 1:5]) z_matrix <- dom_zscores(dom) knitr::kable(z_matrix[1:5, 1:5]) activation_matrix <- dom_tf_activation(dom) knitr::kable(activation_matrix[1:5, 1:5]) dom_database(dom) #> [1] \"CellPhoneDB_v4.0\" db_matrix <- dom_database(dom, name_only = FALSE) knitr::kable(db_matrix[1:5, 1:5])"},{"path":"/articles/domino_object_vignette.html","id":"calculations","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Calculations","title":"Interacting with domino2 Objects","text":"Active transcription factors cluster determined conducting wilcoxon rank sum tests transcription factor trascription factor activity scores amongst cells cluster tested activity scores cells outside cluster. p-value one-sided test greater activity within cluster compared outside can accessed dom_de() function. Linkage receptors transcription factors assessed Spearman correlation transcription factor activity scores scaled expression receptor-encoding genes across cells data set. Spearman coefficients can accessed dom_correlations() function.","code":"de_matrix <- dom_de(dom) knitr::kable(de_matrix[1:5, 1:5]) cor_matrix <- dom_correlations(dom) knitr::kable(cor_matrix[1:5, 1:5])"},{"path":"/articles/domino_object_vignette.html","id":"linkages","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Linkages","title":"Interacting with domino2 Objects","text":"Linkages various ligands, receptors, transcription factors can accessed several different ways, depending specific link scope desired. dom_linkages() function three arguments - first, like access functions, domino object. second, link_type, used specify linkages desired (options complexes, receptor-ligand, tf-target, tf-receptor). third argument, by_cluster, determines whether linkages returned arranged cluster (though change available linkage types tf-receptor, receptor, incoming-ligand). example, access complexes used across dataset: view incoming ligands cluster: , reason, find need entire linkage structure (recommended), can accessed slot name; domino objects S4 objects. Alternately, obtain simplified list receptors, ligands, /features domino object, use collate_network_items() function. pull receptors associated dendritic cell cluster:","code":"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)\" 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\" 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\" collate_network_items(dom, \"dendritic_cell\", return = \"features\") #> [1] \"ZNF189\" \"KLF12\" \"ETV7\" \"IRF8\" \"KLF6\" \"FOS\" \"SPI1\" \"ATF3\" #> [9] \"KLF4\" \"CEBPA\" \"MAFG\" \"CEBPD\" \"ZBTB33\" \"SPIB\" \"CEBPB\" \"FOSB\" #> [17] \"CREB5\" \"RXRA\" \"CUX1\" \"ZNF516\""},{"path":"/articles/domino_object_vignette.html","id":"signaling-matrices","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Signaling Matrices","title":"Interacting with domino2 Objects","text":"averaged z-scored expression ligands receptors different clusters can accessed matrix form. view signaling specific cluster clusters, set cluster argument cluster name.","code":"signal_matrix <- dom_signaling(dom) knitr::kable(signal_matrix) dc_matrix <- dom_signaling(dom, \"dendritic_cell\") knitr::kable(dc_matrix)"},{"path":"/articles/domino_object_vignette.html","id":"build-information","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Build information","title":"Interacting with domino2 Objects","text":"keep track options set running build_domino(), stored within domino object . view options, use dom_info() function.","code":"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"},{"path":"/articles/domino_object_vignette.html","id":"continued-development","dir":"Articles","previous_headings":"The new domino object structure","what":"Continued Development","title":"Interacting with domino2 Objects","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, put together information plotting example analysis can viewed Getting Started page. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-11-13\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> 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/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] domino2_0.2.2 testthat_3.1.10 #> #> loaded via a namespace (and not attached): #> [1] backports_1.4.1 circlize_0.4.15 BiocFileCache_2.4.0 #> [4] systemfonts_1.0.4 plyr_1.8.8 igraph_1.5.1 #> [7] usethis_2.2.2 GenomeInfoDb_1.32.4 ggplot2_3.4.4 #> [10] digest_0.6.33 foreach_1.5.2 htmltools_0.5.6 #> [13] fansi_1.0.4 magrittr_2.0.3 memoise_2.0.1 #> [16] cluster_2.1.4 doParallel_1.0.17 remotes_2.4.2.1 #> [19] ComplexHeatmap_2.12.1 Biostrings_2.64.1 matrixStats_1.0.0 #> [22] R.utils_2.12.2 pkgdown_2.0.7 prettyunits_1.2.0 #> [25] colorspace_2.1-0 blob_1.2.4 rappdirs_0.3.3 #> [28] textshaping_0.3.6 xfun_0.40 dplyr_1.1.3 #> [31] callr_3.7.3 crayon_1.5.2 RCurl_1.98-1.12 #> [34] jsonlite_1.8.7 iterators_1.0.14 glue_1.6.2 #> [37] gtable_0.3.4 zlibbioc_1.42.0 XVector_0.36.0 #> [40] GetoptLong_1.0.5 R.cache_0.16.0 car_3.1-2 #> [43] pkgbuild_1.4.2 shape_1.4.6 BiocGenerics_0.42.0 #> [46] abind_1.4-5 scales_1.2.1 DBI_1.1.3 #> [49] rstatix_0.7.2 miniUI_0.1.1.1 Rcpp_1.0.11 #> [52] xtable_1.8-4 progress_1.2.2 clue_0.3-65 #> [55] bit_4.0.5 stats4_4.2.1 profvis_0.3.8 #> [58] htmlwidgets_1.6.2 httr_1.4.7 RColorBrewer_1.1-3 #> [61] ellipsis_0.3.2 urlchecker_1.0.1 pkgconfig_2.0.3 #> [64] XML_3.99-0.14 R.methodsS3_1.8.2 sass_0.4.7 #> [67] dbplyr_2.3.3 utf8_1.2.3 tidyselect_1.2.0 #> [70] rlang_1.1.1 later_1.3.1 AnnotationDbi_1.58.0 #> [73] munsell_0.5.0 tools_4.2.1 cachem_1.0.8 #> [76] cli_3.6.1 generics_0.1.3 RSQLite_2.3.1 #> [79] devtools_2.4.5 broom_1.0.5 evaluate_0.21 #> [82] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 #> [85] ragg_1.2.5 processx_3.8.2 knitr_1.44 #> [88] bit64_4.0.5 fs_1.6.3 purrr_1.0.2 #> [91] KEGGREST_1.36.3 mime_0.12 R.oo_1.25.0 #> [94] xml2_1.3.5 biomaRt_2.52.0 brio_1.1.3 #> [97] compiler_4.2.1 rstudioapi_0.15.0 filelock_1.0.2 #> [100] curl_5.0.2 png_0.1-8 ggsignif_0.6.4 #> [103] tibble_3.2.1 bslib_0.5.1 stringi_1.7.12 #> [106] ps_1.7.5 desc_1.4.2 lattice_0.21-8 #> [109] Matrix_1.6-1.1 styler_1.10.2 vctrs_0.6.3 #> [112] pillar_1.9.0 lifecycle_1.0.3 jquerylib_0.1.4 #> [115] GlobalOptions_0.1.2 bitops_1.0-7 httpuv_1.6.11 #> [118] R6_2.5.1 promises_1.2.1 IRanges_2.30.1 #> [121] sessioninfo_1.2.2 codetools_0.2-19 pkgload_1.3.3 #> [124] rprojroot_2.0.3 rjson_0.2.21 withr_2.5.1 #> [127] S4Vectors_0.34.0 GenomeInfoDbData_1.2.8 parallel_4.2.1 #> [130] hms_1.1.3 grid_4.2.1 tidyr_1.3.0 #> [133] rmarkdown_2.25 carData_3.0-5 ggpubr_0.6.0 #> [136] Biobase_2.56.0 shiny_1.7.5"},{"path":"/articles/plotting_vignette.html","id":"visualizing-domino2-data","dir":"Articles","previous_headings":"","what":"Visualizing domino2 data","title":"Plotting Functions and Options","text":"addition numerous plotting options available original Domino, domino2 added functionality new methods improve visualization interpretation analysis results. , go different plotting functions available, well different options can utilized, options customization. using domino object (loaded dom) example analysis Getting Started.","code":""},{"path":[]},{"path":"/articles/plotting_vignette.html","id":"correlations-between-receptors-and-transcription-factors","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Correlations between receptors and transcription factors","title":"Plotting Functions and Options","text":"cor_heatmap() can used show correlations calculated receptors transcription factors. addition displaying scores correlations, function can also used identify correlations certain value (using bool bool_thresh arguments) identify combinations receptors transcription factors (TFs) connected (argument mark_connections). subset receptors transcription factors interest, vector either () can passed function. heatmap functions domino2 based ComplexHeatmap::Heatmap() also accept additional arguments meant function. example, argument clustering rows columns heatmap explicitly stated, can still passed ComplexHeatmap::Heatmap() cor_heatmap().","code":"cor_heatmap(dom, title = \"PBMC R-TF Correlations\") cor_heatmap(dom, bool = TRUE, bool_thresh = 0.25) cor_heatmap(dom, bool = FALSE, mark_connections = TRUE) receptors <- c(\"CSF1R\", \"CSF3R\", \"CCR7\", \"FCER2\") tfs <- c(\"PAX5\", \"JUNB\", \"FOXJ3\", \"FOSB\") cor_heatmap(dom, feats = tfs, recs = receptors) cor_heatmap( dom, cluster_rows = FALSE, cluster_columns = FALSE, column_title = \"Heatmap Without Clustering\" )"},{"path":"/articles/plotting_vignette.html","id":"heatmap-of-transcription-factor-activation-scores","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Heatmap of Transcription Factor Activation Scores","title":"Plotting Functions and Options","text":"feat_heatmap() used show transcription factor activation features signaling network. functions similarly cor_heatmap(), arguments select specific vector features, use boolean view threshold, pass arguments NMF::aheatmap(). Specific function though arguments setting range values visualized one choose whether normalize scores max value.","code":"feat_heatmap(dom) feat_heatmap(dom, min_thresh = 0.1, max_thresh = 0.6, norm = TRUE, bool = FALSE ) feat_heatmap(dom, bool = TRUE)"},{"path":"/articles/plotting_vignette.html","id":"heatmap-of-incoming-signaling-for-a-cluster","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Heatmap of Incoming Signaling for a Cluster","title":"Plotting Functions and Options","text":"incoming_signaling_heatmap() can used visualize cluster average expression ligands capable activating TFs enriched cluster. example, view incoming signaling CD8 T cells: can also select specific clusters interest signaling CD8 T cells. interested viewing monocyte signaling: heatmap functions, options available minimum threshold, maximum threshold, whether scale values thresholding, whether normalize matrix, ability pass arguments NMF::aheatmap().","code":"incoming_signaling_heatmap(dom, \"CD8_T_cell\") incoming_signaling_heatmap(dom, \"CD8_T_cell\", clusts = c(\"CD14_monocyte\", \"CD16_monocyte\"))"},{"path":"/articles/plotting_vignette.html","id":"heatmap-of-signaling-between-clusters","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Heatmap of Signaling Between Clusters","title":"Plotting Functions and Options","text":"signaling_heatmap() makes heatmap showing signaling strength ligands cluster receptors cluster based averaged expression. functions, specific clusters can selected, thresholds can set, normalization methods can selected well.","code":"signaling_heatmap(dom) signaling_heatmap(dom, scale = \"sqrt\") signaling_heatmap(dom, normalize = \"rec_norm\")"},{"path":[]},{"path":"/articles/plotting_vignette.html","id":"network-showing-l-r-tf-signaling-between-clusters","dir":"Articles","previous_headings":"Visualizing domino2 data > Network Plots","what":"Network showing L-R-TF signaling between clusters","title":"Plotting Functions and Options","text":"gene_network() makes network plot display signaling selected clusters ligands, receptors features associated clusters displayed nodes edges linkages. look signaling CD16 Monocytes CD14 Monocytes: Options modify plot include adjusting scaling ligands different layouts (legible others). Additionally, colors can given select genes (example, highlight specific signaling path).","code":"gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\") gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", lig_scale = 25, layout = \"sphere\" ) gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", cols = c(\"CD1D\" = \"violet\", \"LILRB2\" = \"violet\", \"FOSB\" = \"violet\"), lig_scale = 10 )"},{"path":"/articles/plotting_vignette.html","id":"network-showing-interaction-strength-across-data","dir":"Articles","previous_headings":"Visualizing domino2 data > Network Plots","what":"Network Showing Interaction Strength Across Data","title":"Plotting Functions and Options","text":"signaling_network() can used create network plot nodes clusters edges indicate signaling one cluster another. addition changes scaling, thresholds, layouts, plot can modified selecting incoming outgoing clusters (!). example view signaling CD14 Monocytes cluster:","code":"signaling_network(dom) signaling_network(dom, showOutgoingSignalingClusts = \"CD14_monocyte\", scale = \"none\", norm = \"none\", layout = \"fr\", scale_by = \"none\", vert_scale = 5 )"},{"path":[]},{"path":"/articles/plotting_vignette.html","id":"chord-diagrams-connecting-ligands-and-receptors","dir":"Articles","previous_headings":"Visualizing domino2 data > Other Types of Plot","what":"Chord Diagrams Connecting Ligands and Receptors","title":"Plotting Functions and Options","text":"new addition domino2, circos_ligand_receptor() creates chord plot showing ligands can activate specific receptor, displaying mean cluster expression ligand width chord. function can given cluster colors match plots may make data. addition, plot can adjusted changing threshold ligand expression required linkage visualized selecting clusters interest.","code":"circos_ligand_receptor(dom, receptor = \"CD74\") cols <- c( \"red\", \"orange\", \"green\", \"blue\", \"pink\", \"purple\", \"slategrey\", \"firebrick\", \"hotpink\" ) names(cols) <- levels(dom@clusters) circos_ligand_receptor(dom, receptor = \"CD74\", cell_colors = cols)"},{"path":"/articles/plotting_vignette.html","id":"scatter-plot-to-visualize-correlation","dir":"Articles","previous_headings":"Visualizing domino2 data > Other Types of Plot","what":"Scatter Plot to Visualize Correlation","title":"Plotting Functions and Options","text":"cor_scatter() can used plot cell based expression selected TF receptor. produces scatter plot well line best fit look receptor-TF correlation. keep mind argument remove_rec_dropout match parameter used domino object built. case, use build parameter, leave value argument default value FALSE.","code":"cor_scatter(dom, \"FOSB\", \"CD74\")"},{"path":"/articles/plotting_vignette.html","id":"continued-development","dir":"Articles","previous_headings":"Visualizing domino2 data","what":"Continued Development","title":"Plotting Functions and Options","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, view example analysis, see Getting Started page, see domino object structure page get familiar object structure. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-11-13\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> 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/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] patchwork_1.1.3 domino2_0.2.2 #> #> loaded via a namespace (and not attached): #> [1] colorspace_2.1-0 ggsignif_0.6.4 rjson_0.2.21 #> [4] rprojroot_2.0.3 circlize_0.4.15 XVector_0.36.0 #> [7] GlobalOptions_0.1.2 fs_1.6.3 clue_0.3-65 #> [10] farver_2.1.1 ggpubr_0.6.0 bit64_4.0.5 #> [13] AnnotationDbi_1.58.0 fansi_1.0.4 xml2_1.3.5 #> [16] codetools_0.2-19 splines_4.2.1 R.methodsS3_1.8.2 #> [19] doParallel_1.0.17 cachem_1.0.8 knitr_1.44 #> [22] jsonlite_1.8.7 Cairo_1.6-1 broom_1.0.5 #> [25] cluster_2.1.4 dbplyr_2.3.3 png_0.1-8 #> [28] R.oo_1.25.0 compiler_4.2.1 httr_1.4.7 #> [31] backports_1.4.1 Matrix_1.6-1.1 fastmap_1.1.1 #> [34] cli_3.6.1 htmltools_0.5.6 prettyunits_1.2.0 #> [37] tools_4.2.1 igraph_1.5.1 gtable_0.3.4 #> [40] glue_1.6.2 GenomeInfoDbData_1.2.8 dplyr_1.1.3 #> [43] rappdirs_0.3.3 Rcpp_1.0.11 carData_3.0-5 #> [46] Biobase_2.56.0 jquerylib_0.1.4 styler_1.10.2 #> [49] pkgdown_2.0.7 vctrs_0.6.3 Biostrings_2.64.1 #> [52] nlme_3.1-163 iterators_1.0.14 xfun_0.40 #> [55] stringr_1.5.0 lifecycle_1.0.3 rstatix_0.7.2 #> [58] XML_3.99-0.14 zlibbioc_1.42.0 scales_1.2.1 #> [61] ragg_1.2.5 hms_1.1.3 parallel_4.2.1 #> [64] RColorBrewer_1.1-3 ComplexHeatmap_2.12.1 yaml_2.3.7 #> [67] curl_5.0.2 memoise_2.0.1 ggplot2_3.4.4 #> [70] sass_0.4.7 biomaRt_2.52.0 stringi_1.7.12 #> [73] RSQLite_2.3.1 S4Vectors_0.34.0 desc_1.4.2 #> [76] foreach_1.5.2 BiocGenerics_0.42.0 filelock_1.0.2 #> [79] shape_1.4.6 GenomeInfoDb_1.32.4 rlang_1.1.1 #> [82] pkgconfig_2.0.3 systemfonts_1.0.4 matrixStats_1.0.0 #> [85] bitops_1.0-7 evaluate_0.21 lattice_0.21-8 #> [88] purrr_1.0.2 labeling_0.4.3 bit_4.0.5 #> [91] tidyselect_1.2.0 plyr_1.8.8 magrittr_2.0.3 #> [94] R6_2.5.1 IRanges_2.30.1 magick_2.8.0 #> [97] generics_0.1.3 DBI_1.1.3 pillar_1.9.0 #> [100] withr_2.5.1 mgcv_1.9-0 KEGGREST_1.36.3 #> [103] abind_1.4-5 RCurl_1.98-1.12 tibble_3.2.1 #> [106] crayon_1.5.2 car_3.1-2 utf8_1.2.3 #> [109] BiocFileCache_2.4.0 rmarkdown_2.25 GetoptLong_1.0.5 #> [112] progress_1.2.2 grid_4.2.1 blob_1.2.4 #> [115] digest_0.6.33 R.cache_0.16.0 tidyr_1.3.0 #> [118] R.utils_2.12.2 textshaping_0.3.6 stats4_4.2.1 #> [121] munsell_0.5.0 bslib_0.5.1"},{"path":[]},{"path":"/articles/vignette.html","id":"preprocessing-scrnaseq-data","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Preprocessing scRNAseq data","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 tool analysis intra- intercellular signaling single cell RNA sequencing data based transcription factor activation. vignette intended demonstrate basic pipeline generating communication networks domino object using single cell RNA sequencing(scRNAseq) data. Analysis cell-cell communication (CCC) Domino2 often follows initial pre-processing annotation scRNAseq data. vignette demonstrate use Domino2 10X Genomics Peripheral Blood Mononuclear Cells (PBMC) data set 2,700 cells processed following Satija Lab’s Seurat tutorial. data can downloaded .","code":"# Preprocessing of PBMC 3K tutorial data set pbmc.data <- Read10X(data.dir = \"../data/pbmc3k_filtered_gene_bc_matrices\") pbmc <- CreateSeuratObject(counts = pbmc.data, project = \"pbmc3k\", min.cells = 3, min.features = 200) pbmc[[\"percent.mt\"]] <- PercentageFeatureSet(pbmc, pattern = \"^MT-\") pbmc <- NormalizeData(pbmc, normalization.method = \"LogNormalize\", scale.factor = 10000) pbmc <- FindVariableFeatures(pbmc, selection.method = \"vst\", nfeatures = 2000) pbmc <- ScaleData(pbmc, features = rownames(pbmc)) pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc)) pbmc <- FindNeighbors(pbmc, dims = 1:10) pbmc <- FindClusters(pbmc, resolution = 0.5) pbmc <- RunUMAP(pbmc, dims = 1:10) # Annotate clusters with cell phenotypes cell_dict <- data.frame( cluster = c(0:8), cell_type = c(\"naive_CD4_T_cell\", \"CD14_monocyte\", \"memory_CD4_T_cell\", \"B_cell\", \"CD8_T_cell\", \"CD16_monocyte\", \"NK_cell\", \"dendritic_cell\", \"platelet\") ) pbmc$cell_type <- plyr::mapvalues( pbmc$seurat_clusters, from = cell_dict$cluster, to = cell_dict$cell_type )"},{"path":"/articles/vignette.html","id":"saving-preprocessed-data","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Preprocessing scRNAseq data","what":"Saving Preprocessed Data:","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 designed compatible Seurat objects addition accepting matrices vectors data set function inputs. Therefore, ’s good idea save processed Seurat object analysis. However, pySCENIC used transcription factor activation inference, requires input cell gene matrix. opposite orientation Seurat objects default Python based tools scanpy. Saving data loom file using loomR helpful step therefore recommended well. cell x gene counts matrix may also saved tab-separated value (.tsv) file loomR used computing resource, aware dense formatting .tsv can lead large file sizes slow processing large data sets. provided necessary code , due large file size, .tsv file provided data directory. like skip ahead rest analysis, processed objects steps available data directory package.","code":"# save Seurat object as RDS saveRDS(pbmc, file = \"../data/pbmc3k_seurat.rds\") # save loom counts matrix pbmc_counts <- pbmc@assays$RNA@counts pbmc_loom <- loomR::create(filename = \"../data/pbmc3k_counts.loom\", data = pbmc_counts) pbmc_loom$close_all() # Remember to manually close connection to loom files! pbmc_counts <- pbmc@assays$RNA@counts write.table(t(as.matrix(pbmc_counts)), \"../data/pbmc3k_counts.tsv\", sep = \"\\t\", col.names = NA)"},{"path":"/articles/vignette.html","id":"installation","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Installation","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 undergoing active development aspects data used, analyzed, interpreted subject change new features fixes implemented. v0.2.1 Domino2 serves first stable development version active updates reproducible usage implemented fixes handling receptors ligands function heteromeric complexes, consideration receptor expression per-cluster basis linkage transcription factors, reformatting receptor-ligand database transcription factor regulon inputs enabling Domino2 use alternative data bases transcription factor activity inference methods. version currently hosted FertigLab GitHub branch v0.2.1 domino_development repository forked primary repository hosted Elisseeff-Lab GitHub, can installed using remotes package.","code":"if(!require(remotes)){ install.packages('remotes') } remotes::install_github('FertigLab/domino_development@v0.2.1')"},{"path":"/articles/vignette.html","id":"additional-downloads","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Installation","what":"Additional Downloads","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"tutorial, pySCENIC used method transcription factor activity inference assessment ligand-receptor interactions based curated interactions CellPhoneDB v4.0.0. requires downloading files prior use analysis pipeline.","code":""},{"path":"/articles/vignette.html","id":"downloads-for-scenic","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for SCENIC:","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"singularity image SCENIC v0.12.1 can installed DockerHub image source (example scripts use Docker provided scenic_bash directory well). SCENIC requires list transcription factors, motif annotations, cisTarget motifs available authors SCENIC human (HGNC), mouse (MGI), fly. following download everything necessary analysis data set HGNC gene labels hg38 genome.","code":"SCENIC_DIR=\"scenic\" mkdir ${SCENIC_DIR} # Build singularity image singularity build \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" docker://aertslab/pyscenic:0.12.1 # Matrix containing motifs as rows and genes as columns and ranking position for each gene and motif (based on CRM scores) as values curl \"https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather\" \\ -o \"${SCENIC_DIR}/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather\" curl \"https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather\" \\ -o \"${SCENIC_DIR}/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather\" # List of genes encoding transcription factors in the HG38 reference genome curl \"https://resources.aertslab.org/cistarget/tf_lists/allTFs_hg38.txt\" \\ -o \"${SCENIC_DIR}/allTFs_hg38.txt\" # Motif annotations based on the 2017 cisTarget motif collection. Use these files if you are using the mc9nr databases. curl \"https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ -o \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\""},{"path":"/articles/vignette.html","id":"downloads-for-cellphonedb","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for CellPhoneDB:","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Database files CellPhoneDB v4.0.0 human scRNA-seq data can installed public github repository Tiechmann Group developed CellPhoneDB.","code":"CELLPHONE_DIR=\"cellphonedb\" mkdir ${CELLPHONE_DIR} # Annotation of protein complexes curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/complex_input.csv\" \\ -o \"${CELLPHONE_DIR}/complex_input.csv\" # Annotation of genes encoding database proteins curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/gene_input.csv\" \\ -o \"${CELLPHONE_DIR}/gene_input.csv\" # Annotated protein interactions curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/interaction_input.csv\" \\ -o \"${CELLPHONE_DIR}/interaction_input.csv\" # Annotated protein features curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/protein_input.csv\" \\ -o \"${CELLPHONE_DIR}/protein_input.csv\""},{"path":"/articles/vignette.html","id":"scenic-analysis","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"SCENIC Analysis","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"SCENIC lab’s preferred software transcription factor activity scoring. recommend using Python implementation (pySCENIC) faster original R implementation. aware, use SCENIC often slowest memory intensive step analysis pipeline. SCENIC run computing resources access multi-core processing large amounts memory. described section saving preprocessed data, SCENIC requires RNA counts provided cell gene matrix format, using pbmc3k_counts.loom file stage analysis. pySCENIC initiated using bash scripting terminal. analysis consists 3 steps score genes transcription factor motif enrichment, construct transcription factor regulons consisting genes targeted transcription factors, arrive AUC scores enrichment regulon gene transcription within cell.","code":""},{"path":"/articles/vignette.html","id":"grn-construct-tf-modules","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > SCENIC Analysis","what":"grn: construct TF-modules","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Co-expression modules used quantify gene-transciption factor adjacencies.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic grn \\ \"../data/pbmc3k_counts.loom\" \\ # path to the loom file \"${SCENIC_DIR}/allTFs_hg38.txt\" \\ # list of transcription factors -o \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ # output directory for the adjacency matrix --num_workers 6 \\ # number of CPUs to use if multi-core processing is available --set_seed 123 # specify a random seed for reproducibility"},{"path":"/articles/vignette.html","id":"ctx-construct-tf-regulons-with-pruning-based-on-tf-motiff-enrichment","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > SCENIC Analysis","what":"ctx: construct TF regulons with pruning based on TF motiff enrichment","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"rankings genes based enrichment transcription factor motiffs transcription start site (TSS) considered construction regulons, target genes TF-modules removed lack motifs proximal TSS transcription factor may bind.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic ctx \\ \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ # adjacency matrix output from grn \"${SCENIC_DIR}/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather\" \\ # target rankings of motif enrichment within 10 kb of TSS \"${SCENIC_DIR}/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather\" \\ # target rankings of motif enrichment within 500 bp upstream and 100 bp downstream of TSS --annotations_fname \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ # TF motif features --expression_mtx_fname \"../data/pbmc3k_counts.loom\" \\ # counts matrix loom file --mode \"dask_multiprocessing\" \\ # enable multi-core processing --output \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ # output file of learned TF regulons --num_workers 6 # number of CPU cores"},{"path":"/articles/vignette.html","id":"aucell-calculate-tf-activity-scores","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > SCENIC Analysis","what":"aucell: calculate TF activity scores","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Enrichment regulon measured Area recovery Curve (AUC) genes define regulon.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic aucell \\ \"../data/pbmc3k_counts.loom\" \\ # counts matrix loom file \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ # regulon table output from ctx -o \"${SCENIC_DIR}/pbmc_auc.csv\" # cell x TF matrix of TF enrichment AUC values"},{"path":[]},{"path":"/articles/vignette.html","id":"loading-scenic-results","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Building a Signaling Network with Domino2","what":"Loading SCENIC Results","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"transcription factor activities required input Domino2, regulons learned SCENIC important optional input needed annotate transcription factor-target interactions prune transcription factor-receptor linkages receptor target transcription factor. prevents distinction receptor expression driving transcription factor activity transcription factor inducing receptor’s expression. initial regulons data frame read R ctx function 2 rows column names need replaced one succinct description. Domino2 changed input format transcription factor regulons list storing vectors target genes regulon, names list transcription factor genes. facilitates use alternative methods transcription factor activity quantification methods. provide helper function easy retreival transcription factor regulons output pySCENIC ctx function. Users aware AUC matrix SCENIC loaded cell x transcription factor orientation transposed transcription factor x cell orientation. pySCENIC also appends “(+)” transcription factor names converted “…” upon loading R. characters can included without affecting results Domino2 analysis, can confusing querying transcription factor features data. recommend comprehensive removal “…” characters using gsub() function.","code":"scenic_dir = \"scenic/\" regulons <- read.csv(paste0(scenic_dir, \"/pbmc_regulons.csv\")) auc <- read.table(paste0(scenic_dir, \"scenic/pbmc_auc.csv\"), header = TRUE, row.names = 1, stringsAsFactors = FALSE, sep = \",\") regulons <- regulons[-1:-2,] colnames(regulons) <- c(\"TF\", \"MotifID\", \"AUC\", \"NES\", \"MotifSimilarityQvalue\", \"OrthologousIdentity\", \"Annotation\", \"Context\", \"TargetGenes\", \"RankAtMax\") regulon_list <- create_regulon_list_scenic(regulons = regulons) auc_in <- as.data.frame(t(auc)) rownames(auc_in) <- gsub(\"\\\\.\\\\.\\\\.$\", \"\", rownames(auc_in)) # remove pattern \"...\" from the end of all rownames"},{"path":"/articles/vignette.html","id":"load-cellphonedb-database","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Building a Signaling Network with Domino2","what":"Load CellPhoneDB Database","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 updated read ligand-receptor data bases uniform data.frame format referred receptor-ligand map (rl_map) enable use alternative updated reference databases oppossed particular version CellPhoneDB’s database older versions Domino. row corresponds ligand-receptor interaction. Genes participating interaction referred “partner ” “partner B” without requirement fixed ordering whether B ligand vice versa. minimum required columns data frame : int_pair: names interacting ligand receptor seperated \" & \" gene_A: gene genes encoding partner gene_B: gene genes encoding partner B type_A: (“L”, “R”) whether partner ligand (“L”) receptor (“R”) type_B: (“L”, “R”) whether partner B ligand (“L”) receptor (“R”) Additional annotation columns can provided name_A name_B ligands receptors whose name interaction database match names encoding genes. formatting also allows consideration ligand receptor complexes comprised heteromeric combination multiple proteins must coexpressed function. cases, “name_*” column shows name protein complex, “gene_*” column shows names genes encoding components complex separated commas “,”. plotting results build domino object, names interacting ligands receptors used based combinatorial expression complex components. facilitate use formatting CellPhoneDB database, include helper function automatically parses files cellPhoneDB database arrive rl_map format.","code":"cellphonedb_2_path <- \"cellphonedb\" complexes <- read.csv(paste0(cellphonedb_2_path, \"/complex_input.csv\"), stringsAsFactors = FALSE) genes <- read.csv(paste0(cellphonedb_2_path, \"/gene_input.csv\"), stringsAsFactors = FALSE) interactions <- read.csv(paste0(cellphonedb_2_path, \"/interaction_input.csv\"), stringsAsFactors = FALSE) proteins <- read.csv(paste0(cellphonedb_2_path, \"/protein_input.csv\"), stringsAsFactors = FALSE) rl_map <- create_rl_map_cellphonedb( genes = genes, proteins = proteins, interactions = interactions, complexes = complexes, database_name = \"CellPhoneDB_v4.0\" # includes database version used ) knitr::kable(head(rl_map))"},{"path":"/articles/vignette.html","id":"optional-adding-interactions-manually","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Building a Signaling Network with Domino2 > Load CellPhoneDB Database","what":"Optional: Adding interactions manually","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"change use rl_map formatting also enables users manually append interactions interest included interaction database need . can attained formatting desired interactions data.frame column headers rl_map using rbind() function.","code":"# Integrin complexes are not annotated as receptors in CellPhoneDB_v4.0 # collagen-integrin interactions between cells may be missed unless tables from the CellPhoneDB reference are edited or the interactions are manually added col_int_df <- data.frame( \"int_pair\" = \"a11b1 complex & COLA1_HUMAN\", \"name_A\" = \"a11b1 complex\", \"uniprot_A\" = \"P05556,Q9UKX5\", \"gene_A\" = \"ITB1,ITA11\", \"type_A\" = \"R\", \"name_B\" = \"COLA1_HUMAN\", \"uniprot_B\" = \"P02452,P08123\", \"gene_B\" = \"COL1A1,COL1A2\", \"type_B\" = \"L\", \"annotation_strategy\" = \"manual\", \"source\" = \"manual\", \"database_name\" = \"manual\" ) rl_map_append <- rbind(col_int_df, rl_map) knitr::kable(head(rl_map_append))"},{"path":"/articles/vignette.html","id":"creating-the-domino-object","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Creating the Domino Object","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 analysis takes place two steps. 1. create_domino() . initializes domino result object b. assesses differential transcription factor activity across cell clusters wilcoxon rank-sum test c. establishes transcription factor-receptor linkages based Spearman correlation transcription factor activities receptor expression across queried data set. 2. build_domino() . sets parameters transcription factors receptors called active within cell cluster b. aggregates scaled expression ligands capable interacting active receptors assessment ligand type cellular source triggering activation receptor.","code":""},{"path":"/articles/vignette.html","id":"required-inputs-from-data-set","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Creating the Domino Object","what":"Required inputs from data set","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 infers active receipt signals via receptors based correlation receptor’s expression transcription factor activity across data set differential activity transcription factor within cell cluster. Correlations conducted using scaled expression values rather raw counts normalized counts. assessment receptor activity per cell type basis, named vector cell cluster assignments, names cell barcodes matching expression matrix, provided. Assessing signaling based categorical groupings cells can acheived passing groupings “clusters” build_domino() place cell types. Domino2 accepts either Seurat object counts, scaled counts, clusters included, requires matrix counts, matrix scaled counts, named vector cell cluster labels factors. Shown extract elements Seurat object. Note: Ligand receptor expression can assessed genes included z_scores matrix. Many scRNA-seq analysis pipelines recommend storing genes high variance scaled expression slots data objects, thereby missing many genes encoding ligands receptors. Ensure genes interest included rows z_scores matrix. Scaled expression calculated genes PBMC data set removal genes expressed less 3 cells.","code":"counts <- pbmc@assays$RNA@counts z_scores <- as.matrix(pbmc@assays$RNA@scale.data) clusters <- as.factor(pbmc$cell_type)"},{"path":"/articles/vignette.html","id":"create-domino-object","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Creating the Domino Object","what":"Create Domino object","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"point, create_domino() function can used make object. Parameters note include “use_clusters” required assess signaling cell types rather linkage transcription factors receptors broadly across data set. “use_complexes” decides receptors function heteromeric complexes considered testing linkages transcription factors receptors. TRUE, receptor complex linked transcription factor majority component genes meet Spearman correlation threshold. “remove_rec_dropout” decides whether receptor values 0 considered correlation calculations; measure intended reduce effect dropout receptors wiht low expression. run create_domino() matrix vector inputs: results equivalent using Seurat object directly. Note inclusion matrix inputs Seurat object prioritize Seurat objects. information stored domino object access , please see vignette structure domino objects.","code":"pbmc_dom <- create_domino( rl_map = rl_map, # receptor-ligand map data frame features = auc_in, # Transcription factor scores (AUC matrix) counts = counts, # counts matrix z_scores = z_scores, # scaled expression data clusters = clusters, # vector of cell cluster assignments tf_targets = regulon_list, # list of TFs and their reglons use_clusters = TRUE, # assess receptor activation and ligand expression on a per-cluster basis use_complexes = TRUE, # include receptors and genes that function as a complex in results remove_rec_dropout = FALSE # whether to remove zeroes from correlation calculations ) pbmc_dom <- create_domino( rl_map = rl_map, # receptor-ligand map data frame features = auc_in, # Transcription factor scores (AUC matrix) ser = pbmc, # Seurat object containing counts, scaled counts, and cell cluster assignments tf_targets = regulon_list, # list of TFs and their reglons use_clusters = TRUE, # assess receptor activation and ligand expression on a per-cluster basis use_complexes = TRUE, # include receptors and genes that function as a complex in results remove_rec_dropout = FALSE # whether to remove zeroes from correlation calculations )"},{"path":"/articles/vignette.html","id":"build-domino","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Creating the Domino Object","what":"Build Domino","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"build_domino() finalizes construction domino object setting parameters identifying transcription factors differential activation clusters, receptor linkage transcription factors based magnitude positive correlation, minimum percentage cells within cluster expression receptor receptor called active. also options thresholds number transcription factors may called active cluster number receptors may linked one transcription factor. thresholds n transcription factors m receptors, bottom n transcription factors lowest p-values wilcoxon rank sum test top m receptors Spearman correlation coefficient chosen. thresholds number receptors transcription factors can sent infinity (Inf) collect receptors transcription factors meet statistical significance thresholds.","code":"pbmc_dom <- build_domino( dom = pbmc_dom, min_tf_pval = .001, # Threshold for p-value of DE for TFs max_tf_per_clust = 5, max_rec_per_tf = 5, rec_tf_cor_threshold = .25, # Minimum correlation between receptor and TF min_rec_percentage = 0.1 # Minimum percent of cells that must express receptor ) dom_b <- build_domino( dom = dom, min_tf_pval = .001, max_tf_per_clust = Inf, max_rec_per_tf = Inf, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1 )"},{"path":"/articles/vignette.html","id":"visualization-of-domino-results","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Visualization of Domino Results","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Multiple functions available visualize intracellular networks receptors transcription factors ligand-receptor mediated intercellular networks cell types.","code":""},{"path":"/articles/vignette.html","id":"summarize-transcription-factor-activity-and-linkage","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Visualization of Domino Results","what":"Summarize Transcription Factor Activity and Linkage","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Enrichment transcription factor activities cell types can visualized feat_heatmap() plots data set-wide transcription factor activity scores pheatmap. mark_connections argument determines whether X used mark linked transcription factors receptors.","code":"feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE, mark_connections = TRUE)"},{"path":"/articles/vignette.html","id":"cumulative-signaling-between-cell-types","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Visualization of Domino Results","what":"Cumulative signaling between cell types","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"cummulative degree signaling clusters assessed sum scaled expressin ligands targeting active receptors another cluster. can visualized graph format using signaling_network() function. Nodes represent cell cluster edges scale magnitude signaling clusters. color edge corresponds sender cluster signal. Signaling networks can also drawn edges render signals directed towards given cell type signals one cell type directed others can also created. see options use, well plotting options, please see plotting vignette.","code":"signaling_network(pbmc_dom, edge_weight = .5, max_thresh = 2.5)"},{"path":"/articles/vignette.html","id":"specific-signaling-interactions-between-clusters","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Visualization of Domino Results","what":"Specific Signaling Interactions between Clusters","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Beyond aggregated degree signaling cell types, degrees signaling specific ligand-receptor interactions can assessed. gene_network() provides graph linkages active transcription factors cluster, linked receptors cluster, possible ligands active recptors New Domino2, gene_network() can used two clusters determine possible ligands given receptor expressed putative outgoing signaling cluster. comprehensive assessment ligand expression targeting active receptors given cluster can assessed incoming_signaling_heatmap(). Another form comprehensive ligand expression assessment available individual active receptors form circos plots new Domino2. outer arcs correspond clusters domino object inner arcs representing possible ligand plotted receptor. Arcs drawn ligands cell type receptor ligand expressed specified threshold. Arc widths correspond mean express ligand cluster widest arc width scaling maximum expression ligand within data.","code":"gene_network(pbmc_dom, clust = 'dendritic_cell', layout = 'grid') gene_network(pbmc_dom, clust = 'dendritic_cell', OutgoingSignalingClust = \"CD14_monocyte\", layout = 'grid') incoming_signaling_heatmap(pbmc_dom, rec_clust = 'dendritic_cell', max_thresh = 2.5) circos_ligand_receptor(pbmc_dom, receptor = \"CD74\")"},{"path":"/articles/vignette.html","id":"continued-development","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Continued Development","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Since Domino2 package still development, new functions features development. github repository contains branches changes implemented. Additionally, find bugs, questions, features like request, please let us know .","code":""},{"path":[]},{"path":"/articles/vignette.html","id":"vignette-build-info","dir":"Articles","previous_headings":"","what":"Cell Cell Communication with Domino2: v0.2.1 Vignette","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"","code":"sys.date() sessionInfo()"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christopher Cherry. Author. Jacob T Mitchell. Author, maintainer. Sushma Nagaraj. Author. Kavita Krishnan. Author. Elana Fertig. Contributor. Jennifer Elisseeff. Contributor.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Cherry C, Maestas D, Han J, Andorko J, Cahan P, Fertig E, Garmire L, Elisseeff J (2021). “Computational reconstruction signalling networks surrounding implanted biomaterials single-cell transcriptomics.” Nature Biomedical Engineering, 5(10), 1228-1238. doi:10.1038/s41551-021-00770-5, https://doi.org/10.1038%2Fs41551-021-00770-5. Cherry C, Mitchell J, Nagaraj S, Krishnan K, Fertig E, Elisseeff J (2023). domino2: Cell Communication Analysis Single Cell RNA Sequencing. R package version 0.2.1.","code":"@Article{, title = {Computational reconstruction of the signalling networks surrounding implanted biomaterials from single-cell transcriptomics}, author = {Christopher Cherry and David R. Maestas and Jin Han and James I. Andorko and Patrick Cahan and Elana J. Fertig and Lana X. Garmire and Jennifer H. Elisseeff}, journal = {Nature Biomedical Engineering}, year = {2021}, volume = {5}, number = {10}, pages = {1228-1238}, doi = {10.1038/s41551-021-00770-5}, url = {https://doi.org/10.1038%2Fs41551-021-00770-5}, } @Manual{, title = {domino2: Cell Communication Analysis for Single Cell RNA Sequencing}, author = {Christopher Cherry and Jacob T Mitchell and Sushma Nagaraj and Kavita Krishnan and Elana Fertig and Jennifer Elisseeff}, year = {2023}, note = {R package version 0.2.1}, }"},{"path":"/index.html","id":"introducing-domino2","dir":"","previous_headings":"","what":"Cell Communication from Single Cell RNA Sequencing Data","title":"Cell Communication from Single Cell RNA Sequencing Data","text":"domino2 updated version original domino R package published Nature Biomedical Engineering Computational reconstruction signalling networks surrounding implanted biomaterials single-cell transcriptomics. domino2 tool analysis intra- intercellular signaling single cell RNA sequencing data based transcription factor activation receptor ligand linkages.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Cell Communication from Single Cell RNA Sequencing Data","text":"domino2 undergoing active development aspects data used, analyzed, interpreted subject change new features fixes implemented. v0.2.2 domino2 serves first stable development version active updates reproducible usage (see News page information changes). version currently hosted FertigLab GitHub branch v0.2.2 domino_development repository forked primary repository hosted Elisseeff-Lab GitHub, can installed using remotes package.","code":"if(!require(remotes)){ install.packages('remotes') } remotes::install_github('FertigLab/domino2@v0.2.1')"},{"path":"/index.html","id":"usage-overview","dir":"","previous_headings":"","what":"Usage Overview","title":"Cell Communication from Single Cell RNA Sequencing Data","text":"overview domino2 might used analysis single cell RNA sequencing data set: Transcription factor activation scores calculated (recommend using pySCENIC, methods can used well) ligand-receptor database used map linkages ligands receptors (recommend using cellphoneDB, methods can used well). domino object created using counts, z-scored counts, clustering information, data steps 1 2. Parameters maximum number transcription factors receptors minimum correlation threshold (among others) used make cell communication network Communication networks can extracted within domino object visualized using variety plotting functions Please see Getting Started page example analysis includes steps detail, downloading running pySCENIC building visualizing domino results. articles include details plotting functions structure domino object.","code":""},{"path":[]},{"path":"/news/news-0.2.html","id":"updates-to-domino-object-construction-0-2-1","dir":"News","previous_headings":"domino2 v0.2.1","what":"Updates to domino object construction","title":"Version 0.2","text":"Uniform formats inputs receptor-ligand interaction databases, tf activity features, regulon gene lists operability alternative databases tf activity inference methods Helper functions reformatting pySCENIC outputs CellPhoneDB database files domino-readable uniform formats Assessment transcription factor linkage receptors function heteromeric complex based correlation transcription factor activity receptor component genes Assessment complex ligand expression mean component gene expression plotting functions Minimum threshold percentage cells cluster expressing receptor gene receptor called active within cluster Additional linkage slots active receptors cluster, transcription factor-receptor linkages cluster, incoming ligands active receptors cluster","code":""},{"path":"/news/news-0.2.html","id":"plotting-functions-0-2-1","dir":"News","previous_headings":"domino2 v0.2.1","what":"Plotting functions","title":"Version 0.2","text":"Circos plot ligand expression targeting specified receptor chord widths correspond quantity ligand expression cell cluster Signaling networks showing outgoing signaling specified cell clusters Gene networks two cell clusters","code":""},{"path":"/news/news-0.2.html","id":"bugfixes-0-2-1","dir":"News","previous_headings":"domino2 v0.2.1","what":"Bugfixes","title":"Version 0.2","text":"Added host option gene ortholog conversions using biomart access maintained mirrors Transcription factor-target linkages now properly stored receptors transcription factor’s regulon excluded linkage Ligand nodes sizes gene networks correspond quantity ligand expression create_domino() can run without providing regulon list References host GitHub repository updated “Elisseeff-Lab”","code":""},{"path":[]},{"path":"/news/news-0.2.html","id":"linkage-functions-0-2-2","dir":"News","previous_headings":"domino2 v0.2.2","what":"Linkage functions","title":"Version 0.2","text":"Addition new class summarize linkages objects Addition helper functions count linkages compare objects Plotting function differential linkages","code":""},{"path":"/news/news-0.2.html","id":"package-structure-0-2-2","dir":"News","previous_headings":"domino2 v0.2.2","what":"Package structure","title":"Version 0.2","text":"Adjustments made meet BioConductor standards","code":""},{"path":"/old.README.html","id":null,"dir":"","previous_headings":"","what":"Domino2","title":"Domino2","text":"Domino2 tool analysis intra- intercellular signaling single cell RNA sequencing data based transcription factor activation ligand receptor signaling.","code":""},{"path":"/old.README.html","id":"fertig-lab-development-branch","dir":"","previous_headings":"","what":"Fertig Lab Development Branch","title":"Domino2","text":"repository intended integration updates Domino2 Fertig Lab Elisseeff Lab. code may currently unstable currently recommended use. like use Domino, please use main repository hosted Elisseeff Lab https://github.com/Elisseeff-Lab/domino.","code":""},{"path":"/old.README.html","id":"branch-notes","dir":"","previous_headings":"Fertig Lab Development Branch","what":"Branch notes:","title":"Domino2","text":"Code used version Domino published 2021 archived branch domino_paper_archive. Changes, issues pull requests handled master branch easy use installation updated version. Added option use cells without receptor dropout calculating Pearson correlation.","code":""},{"path":"/old.README.html","id":"citation","dir":"","previous_headings":"Fertig Lab Development Branch","what":"Citation","title":"Domino2","text":"find Domino useful, please consider citing us. Cherry C, Maestas DR, Han J, Andorko JI, Cahan P, Fertig EJ, Garmire LX, Elisseeff JH. Computational reconstruction signalling networks surrounding implanted biomaterials single-cell transcriptomics. Nat Biomed Eng. 2021 Oct;5(10):1228-1238. doi: 10.1038/s41551-021-00770-5. Epub 2021 Aug 2. PMID: 34341534; PMCID: PMC9894531. make sure cite SCENIC use transcription factor scores. Aibar, Sara, et al. “SCENIC: single-cell regulatory network inference clustering.” Nature methods 14.11 (2017): 1083-1086.","code":""},{"path":"/old.README.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Domino2","text":"Domino can installed github repository. Domino requires ligand-receptor database. use cellphonedb. Domino look four files: complexes.csv genes.csv interactions.csv proteins.csv. like download terminal commands .","code":"if(!require(devtools)){ install.packages('devtools') } devtools::install_github('Elisseeff-Lab/domino') curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/sources/complex_curated.csv mv complex_curated.csv complexes.csv curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/sources/interaction_curated.csv mv interaction_curated.csv interactions.csv curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/sources/protein_curated.csv mv protein_curated.csv proteins.csv curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/gene_input.csv mv gene_input.csv genes.csv"},{"path":"/old.README.html","id":"setting-up-scenic","dir":"","previous_headings":"Installation","what":"Setting up SCENIC","title":"Domino2","text":"choose use SCENIC generate transcription factor activation scores, recommend Python implementation. ’s significantly faster R version SCENIC longest part analysis pipeline far. Docker/Singularity images available . tutorials, use bash script wrote run SCENIC Docker image. ’ll need set environment properly wish use script run SCENIC. First, need docker image SCENIC 0.10.0. Docker image need directory pull input files write output files . default, use ~/docker_scratch, feel free make whatever like change directory variable bash script. Put following reference files scratch folder using script. SCENIC requires list transcription factors, motif annotations, cisTarget motifs available authors SCENIC human (HGNC), mouse (MGI), fly. following download everything necessary analysis data set MGI gene labels mm9 genome. HGNC gene labels hg19 genome","code":"mkdir ~/docker_scratch curl -O https://raw.githubusercontent.com/aertslab/pySCENIC/master/resources/mm_mgi_tfs.txt curl -O https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.mgi-m0.001-o0.0.tbl curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-500bp-upstream-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-500bp-upstream-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-10kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-10kb-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-5kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-5kb-10species.mc9nr.feather curl -O https://raw.githubusercontent.com/aertslab/pySCENIC/master/resources/hs_hgnc_curated_tfs.txt curl -O https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-500bp-upstream-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-500bp-upstream-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-10kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-10kb-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-5kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-5kb-10species.mc9nr.feather"},{"path":"/old.README.html","id":"a-complete-basic-analysis-using-domino","dir":"","previous_headings":"","what":"A complete basic analysis using Domino","title":"Domino2","text":"run complete analysis Domino picking phenotypic assignment clusters. like see example Domino without using clusters check cluster free analysis vignette . First need get data. Seurat object contains cluster assignments Seurat 2,700 PBMC tutorial. wont need install Seurat don’t already - just pulling data object. create directory put stuff well.","code":"mkdir ~/work/domino_basic_example"},{"path":"/old.README.html","id":"running-scenic","dir":"","previous_headings":"A complete basic analysis using Domino","what":"Running SCENIC","title":"Domino2","text":"first step generate transcription factor activation scores SCENIC. following along, need created Docker scratch directory downloaded necessary HGNC reference files described Setting SCENIC section . First need write counts file Docker temporary directory R. Now simply need run SCENIC bash script data MGI symbols. data set 32-core EPYC Rome 7002 running step takes 40m. like skip step, necessary output files provided . Either way, move files working directory terminal file explorer.","code":"ser = readRDS('pbmc3k_final.rds') write.table(t(as.matrix(ser@assays$RNA@counts)), '~/docker_scratch/counts.tsv', sep = '\\t', col.names = NA) bash ~/my_software/domino/scenic_bash/hgnc_scenic.sh mv ~/docker_scratch/auc_mtx.csv ~/work/domino_basic_example mv ~/docker_scratch/regulons.csv ~/work/domino_basic_example"},{"path":"/old.README.html","id":"creating-the-domino-object","dir":"","previous_headings":"A complete basic analysis using Domino","what":"Creating the domino object","title":"Domino2","text":"Now SCENIC data can run domino. example’s sake, pull necessary information Seurat object first can also simply provide Seurat object create_domino function pull . also read AUC matrix SCENIC. Note must transposed SCENIC’s output. command generates domino object prepares (compiles LR database, calculates cluster TF enrichment, calculates TF - R correlation). Make sure put correct directory cellphonedb data sets .","code":"library(domino) ser = readRDS('pbmc3k_final.rds') counts = ser@assays$RNA@counts z_scores = ser@assays$RNA@scale.data clusters = ser@active.ident auc = t(read.table('auc_mtx.csv', header = TRUE, row.names = 1, stringsAsFactors = FALSE, sep = ',')) pbmc_dom = create_domino(signaling_db = '~/work/ref/human/cpdb/', features = auc, counts = counts, z_scores = z_scores, clusters = clusters, df = 'regulons.csv')"},{"path":"/old.README.html","id":"building-the-signaling-network-and-plotting-options","dir":"","previous_headings":"A complete basic analysis using Domino","what":"Building the signaling network and plotting options","title":"Domino2","text":"four major parameters can play buidling signaling network, two selecting TFs cluster two connecting TFs recs. min_tf_pval minimum p val TF assigned cluster max_tf_per_clust maximum number transcription factors allowed cluster. patter true rec_tf_cor_threshold max_rec_per_tf except thresholding Pearon correlation receptor transcription factor. Building signaling network takes little time feel free play around values. general prefer select pval cor threshold good portion TFs recs trimmed maximum number thresholds. Now just need visualize signaling network. First, visualize cluster-cluster signaling signaling_network. using max threshold (max_thresh) Mk cluster’s expression ITGA2B much higher clusters/ligands drowns relevant signaling . Give shot without max_thresh ’ll see mean. Intercluster signaling network default, nodes scaled based expression ligands targetting . larger cells data set expressing high amounts ligands targetting cluster. edges weighted based strength signaling two specific clusters. color edge match color ligand cluster. example, network teal line connecting CD8 T cells DCs represents signaling T cells DCs. order determine ligand-receptor-TF signaling patterns involved , can zoom gene network DCs. DC gene network default red nodes ligands, blue receptors, green transcription factors. Now lets look expression ligands targetting DCs. DC incoming signaling heatmap looks like CCL5 major component signaling T cells DCs. gene network looks like CCL5 predicted target LILRB1 activate IRF4 IRF8 DCs. can investigate expression patterns associated linkages. First, lets generate heatmap transcription factor activation scores. Transcription factor activation score heatmap look connections transcription factors receptores can create heatmap correlations two. Rec-TF correlation heatmap Finally, can visualize entire tf-r-l network including clusters gene_network. Note function return igraph object used make plot. important use force directed layout like make two versions plot. use default settings allow us see node labels reformat plot igraph options make less cluttered smaller formats. Thanks taking look software. questions please let us know .","code":"pbmc_dom = build_domino(pbmc_dom, max_tf_per_clust = 10, min_tf_pval = .001, max_rec_per_tf = 10, rec_tf_cor_threshold = .25) signaling_network(pbmc_dom, edge_weight = .5, max_thresh = 2.5) gene_network(pbmc_dom, clust = 'DC', layout = 'fr') incoming_signaling_heatmap(pbmc_dom, rec_clust = 'DC', max_thresh = 2.5) feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE) cor_heatmap(pbmc_dom, bool = FALSE, mark_connections = TRUE) info = gene_network(pbmc_dom, clust = levels(pbmc_dom@clusters), lig_scale = FALSE, layout = 'fr') plot(info$graph, layout = info$layout, vertex.size = 3, edge.color = 'grey', vertex.frame.color = 'black', vertex.label = NA)"},{"path":"/plotting_vignette.html","id":null,"dir":"","previous_headings":"","what":"Visualizing domino2 data","title":"Visualizing domino2 data","text":"addition numerous plotting options available original Domino, domino2 added functionality new methods improve visualization interpretation analysis results. , go different plotting functions available, well different options can utilized, options customization. using domino object (loaded dom) example analysis Getting Started.","code":""},{"path":[]},{"path":"/plotting_vignette.html","id":"correlations-between-receptors-and-transcription-factors","dir":"","previous_headings":"Heatmaps","what":"Correlations between receptors and transcription factors","title":"Visualizing domino2 data","text":"cor_heatmap() can used show correlations calculated receptors transcription factors. addition displaying scores correlations, function can also used identify correlations certain value (using bool bool_thresh arguments) identify combinations receptors transcription factors (TFs) connected (argument mark_connections). subset receptors transcription factors interest, vector either () can passed function. heatmap functions domino2 based NMF::aheatmap() also accept additional arguments meant function. example, argument clustering rows columns heatmap explicitly stated, can still passed NMF::aheatmap() cor_heatmap().","code":"cor_heatmap(dom, title = \"PBMC R-TF Correlations\") cor_heatmap(dom, bool = TRUE, bool_thresh = 0.25) cor_heatmap(dom, bool = FALSE, mark_connections = TRUE) receptors <- c(\"CSF1R\", \"CSF3R\", \"CCR7\", \"FCER2\") tfs <- c(\"PAX5\", \"JUNB\", \"FOXJ3\", \"FOSB\") cor_heatmap(dom, feats = tfs, recs = receptors) cor_heatmap(dom, title = FALSE, Rowv = NA, Colv = NA, main = \"Heatmap Without Clustering\" )"},{"path":"/plotting_vignette.html","id":"heatmap-of-transcription-factor-activation-scores","dir":"","previous_headings":"Heatmaps","what":"Heatmap of Transcription Factor Activation Scores","title":"Visualizing domino2 data","text":"feat_heatmap() used show transcription factor activation features signaling network. functions similarly cor_heatmap(), arguments select specific vector features, use boolean view threshold, pass arguments NMF::aheatmap(). Specific function though arguments setting range values visualized one choose whether normalize scores max value.","code":"feat_heatmap(dom) feat_heatmap(dom, min_thresh = 0.1, max_thresh = 0.6, norm = TRUE, bool = FALSE ) feat_heatmap(dom, bool = TRUE)"},{"path":"/plotting_vignette.html","id":"heatmap-of-incoming-signaling-for-a-cluster","dir":"","previous_headings":"Heatmaps","what":"Heatmap of Incoming Signaling for a Cluster","title":"Visualizing domino2 data","text":"incoming_signaling_heatmap() can used visualize cluster average expression ligands capable activating TFs enriched cluster. example, view incoming signaling CD8 T cells: can also select specific clusters interest signaling CD8 T cells. interested viewing monocyte signaling: heatmap functions, options available minimum threshold, maximum threshold, whether scale values thresholding, whether normalize matrix, ability pass arguments NMF::aheatmap().","code":"incoming_signaling_heatmap(dom, \"CD8_T_cell\") incoming_signaling_heatmap(dom, \"CD8_T_cell\", clusts = c(\"CD14_monocyte\", \"CD16_monocyte\"))"},{"path":"/plotting_vignette.html","id":"heatmap-of-signaling-between-clusters","dir":"","previous_headings":"Heatmaps","what":"Heatmap of Signaling Between Clusters","title":"Visualizing domino2 data","text":"signaling_heatmap() makes heatmap showing signaling strength ligands cluster receptors cluster based averaged expression. functions, specific clusters can selected, thresholds can set, normalization methods can selected well.","code":"signaling_heatmap(dom) signaling_heatmap(dom, scale = \"sqrt\") signaling_heatmap(dom, normalize = \"rec_norm\")"},{"path":[]},{"path":"/plotting_vignette.html","id":"network-showing-l-r-tf-signaling-between-clusters","dir":"","previous_headings":"Network Plots","what":"Network showing L-R-TF signaling between clusters","title":"Visualizing domino2 data","text":"gene_network() makes network plot display signaling selected clusters ligands, receptors features associated clusters displayed nodes edges linkages. look signaling CD16 Monocytes CD14 Monocytes: Options modify plot include adjusting scaling ligands different layouts (legible others). Additionally, colors can given select genes (example, highlight specific signaling path).","code":"gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\") gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", lig_scale = 25, layout = \"sphere\" ) gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", cols = c(\"CD1D\" = \"violet\", \"LILRB2\" = \"violet\", \"FOSB\" = \"violet\"), lig_scale = 10 )"},{"path":"/plotting_vignette.html","id":"network-showing-interaction-strength-across-data","dir":"","previous_headings":"Network Plots","what":"Network Showing Interaction Strength Across Data","title":"Visualizing domino2 data","text":"signaling_network() can used create network plot nodes clusters edges indicate signaling one cluster another. addition changes scaling, thresholds, layouts, plot can modified selecting incoming outgoing clusters (!). example view signaling CD14 Monocytes cluster:","code":"signaling_network(dom) signaling_network(dom, showOutgoingSignalingClusts = \"CD14_monocyte\", scale = \"none\", norm = \"none\", layout = \"fr\", scale_by = \"none\", vert_scale = 5 )"},{"path":[]},{"path":"/plotting_vignette.html","id":"chord-diagrams-connecting-ligands-and-receptors","dir":"","previous_headings":"Other Types of Plot","what":"Chord Diagrams Connecting Ligands and Receptors","title":"Visualizing domino2 data","text":"new addition domino2, circos_ligand_receptor() creates chord plot showing ligands can activate specific receptor, displaying mean cluster expression ligand width chord. function can given cluster colors match plots may make data. addition, plot can adjusted changing threshold ligand expression required linkage visualized selecting clusters interest.","code":"circos_ligand_receptor(dom, receptor = \"CD74\") cols <- c( \"red\", \"orange\", \"green\", \"blue\", \"pink\", \"purple\", \"slategrey\", \"firebrick\", \"hotpink\" ) names(cols) <- levels(dom@clusters) circos_ligand_receptor(dom, receptor = \"CD74\", cell_colors = cols)"},{"path":"/plotting_vignette.html","id":"scatter-plot-to-visualize-correlation","dir":"","previous_headings":"Other Types of Plot","what":"Scatter Plot to Visualize Correlation","title":"Visualizing domino2 data","text":"cor_scatter() can used plot cell based expression selected TF receptor. produces scatter plot well line best fit look receptor-TF correlation. keep mind argument remove_rec_dropout match parameter used domino object built. case, use build parameter, leave value argument default value FALSE.","code":"cor_scatter(dom, \"FOSB\", \"CD74\")"},{"path":"/plotting_vignette.html","id":"continued-development","dir":"","previous_headings":"","what":"Continued Development","title":"Visualizing domino2 data","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, view example analysis, see Getting Started page, see domino object structure page get familiar object structure. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-10-05\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> Platform: x86_64-pc-linux-gnu (64-bit) #> Running under: Ubuntu 22.04.2 LTS #> #> Matrix products: default #> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] grid stats graphics grDevices utils datasets methods #> [8] base #> #> other attached packages: #> [1] ComplexHeatmap_2.12.1 circlize_0.4.15 patchwork_1.1.3 #> [4] RColorBrewer_1.1-3 Biobase_2.56.0 BiocGenerics_0.42.0 #> [7] domino2_0.2.1 #> #> loaded via a namespace (and not attached): #> [1] utf8_1.2.3 R.utils_2.12.2 spatstat.explore_3.2-3 #> [4] reticulate_1.32.0 tidyselect_1.2.0 RSQLite_2.3.1 #> [7] AnnotationDbi_1.58.0 htmlwidgets_1.6.2 Rtsne_0.16 #> [10] munsell_0.5.0 codetools_0.2-19 ica_1.0-3 #> [13] future_1.33.0 miniUI_0.1.1.1 withr_2.5.1 #> [16] spatstat.random_3.1-6 colorspace_2.1-0 progressr_0.14.0 #> [19] filelock_1.0.2 knitr_1.44 rstudioapi_0.15.0 #> [22] Seurat_4.3.0.1 stats4_4.2.1 ROCR_1.0-11 #> [25] ggsignif_0.6.4 tensor_1.5 listenv_0.9.0 #> [28] NMF_0.26 labeling_0.4.3 GenomeInfoDbData_1.2.8 #> [31] polyclip_1.10-4 farver_2.1.1 bit64_4.0.5 #> [34] rprojroot_2.0.3 parallelly_1.36.0 vctrs_0.6.3 #> [37] generics_0.1.3 xfun_0.40 BiocFileCache_2.4.0 #> [40] R6_2.5.1 doParallel_1.0.17 GenomeInfoDb_1.32.4 #> [43] clue_0.3-65 bitops_1.0-7 spatstat.utils_3.0-3 #> [46] cachem_1.0.8 promises_1.2.1 scales_1.2.1 #> [49] gtable_0.3.4 downlit_0.4.3 globals_0.16.2 #> [52] processx_3.8.2 goftest_1.2-3 rlang_1.1.1 #> [55] GlobalOptions_0.1.2 splines_4.2.1 rstatix_0.7.2 #> [58] lazyeval_0.2.2 broom_1.0.5 spatstat.geom_3.2-5 #> [61] BiocManager_1.30.22 yaml_2.3.7 reshape2_1.4.4 #> [64] abind_1.4-5 backports_1.4.1 httpuv_1.6.11 #> [67] tools_4.2.1 gridBase_0.4-7 ggplot2_3.4.3 #> [70] ellipsis_0.3.2 ggridges_0.5.4 Rcpp_1.0.11 #> [73] plyr_1.8.8 progress_1.2.2 zlibbioc_1.42.0 #> [76] purrr_1.0.2 RCurl_1.98-1.12 ps_1.7.5 #> [79] prettyunits_1.2.0 ggpubr_0.6.0 deldir_1.0-9 #> [82] pbapply_1.7-2 GetoptLong_1.0.5 cowplot_1.1.1 #> [85] S4Vectors_0.34.0 zoo_1.8-12 SeuratObject_4.1.3 #> [88] ggrepel_0.9.3 cluster_2.1.4 fs_1.6.3 #> [91] magrittr_2.0.3 data.table_1.14.8 scattermore_1.2 #> [94] lmtest_0.9-40 RANN_2.6.1 whisker_0.4.1 #> [97] R.cache_0.16.0 fitdistrplus_1.1-11 matrixStats_1.0.0 #> [100] pkgload_1.3.3 hms_1.1.3 mime_0.12 #> [103] evaluate_0.21 xtable_1.8-4 XML_3.99-0.14 #> [106] IRanges_2.30.1 gridExtra_2.3 shape_1.4.6 #> [109] compiler_4.2.1 biomaRt_2.52.0 tibble_3.2.1 #> [112] KernSmooth_2.23-22 crayon_1.5.2 R.oo_1.25.0 #> [115] htmltools_0.5.6 mgcv_1.9-0 later_1.3.1 #> [118] tidyr_1.3.0 DBI_1.1.3 dbplyr_2.3.3 #> [121] MASS_7.3-60 rappdirs_0.3.3 car_3.1-2 #> [124] Matrix_1.6-1.1 cli_3.6.1 R.methodsS3_1.8.2 #> [127] parallel_4.2.1 igraph_1.5.1 pkgconfig_2.0.3 #> [130] pkgdown_2.0.7 registry_0.5-1 sp_2.0-0 #> [133] plotly_4.10.2 spatstat.sparse_3.0-2 xml2_1.3.5 #> [136] roxygen2_7.2.3 foreach_1.5.2 rngtools_1.5.2 #> [139] XVector_0.36.0 stringr_1.5.0 callr_3.7.3 #> [142] digest_0.6.33 sctransform_0.4.0 RcppAnnoy_0.0.21 #> [145] spatstat.data_3.0-1 Biostrings_2.64.1 rmarkdown_2.25 #> [148] leiden_0.4.3 uwot_0.1.16 curl_5.0.2 #> [151] shiny_1.7.5 commonmark_1.9.0 rjson_0.2.21 #> [154] lifecycle_1.0.3 nlme_3.1-163 jsonlite_1.8.7 #> [157] carData_3.0-5 desc_1.4.2 viridisLite_0.4.2 #> [160] fansi_1.0.4 pillar_1.9.0 lattice_0.21-8 #> [163] KEGGREST_1.36.3 fastmap_1.1.1 httr_1.4.7 #> [166] pkgbuild_1.4.2 survival_3.5-7 glue_1.6.2 #> [169] png_0.1-8 iterators_1.0.14 bit_4.0.5 #> [172] stringi_1.7.12 blob_1.2.4 memoise_2.0.1 #> [175] styler_1.10.2 dplyr_1.1.3 irlba_2.3.5.1 #> [178] future.apply_1.11.0"},{"path":"/reference/add_rl_column.html","id":null,"dir":"Reference","previous_headings":"","what":"Adds a column to the RL signaling data frame. — add_rl_column","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"function adds column internal rl 'map' used map receptor receptor complexes ligand ligand complexes.","code":""},{"path":"/reference/add_rl_column.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"","code":"add_rl_column(map, map_ref, conv, new_name)"},{"path":"/reference/add_rl_column.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"map RL signaling data frame. map_ref Name column match new data conv Data frame matching current data map new data. new_name Name new column created RL map","code":""},{"path":"/reference/add_rl_column.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"updated RL signaling data frame","code":""},{"path":"/reference/build_domino.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate a signaling network for a domino object — build_domino","title":"Calculate a signaling network for a domino object — build_domino","text":"function calculates signaling network. requires domino object preprocessed create_domino returns domino object prepared plotting various plotting functions package.","code":""},{"path":"/reference/build_domino.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate a signaling network for a domino object — build_domino","text":"","code":"build_domino( dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_per_tf = 5, rec_tf_cor_threshold = 0.15, min_rec_percentage = 0.1 )"},{"path":"/reference/build_domino.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate a signaling network for a domino object — build_domino","text":"dom Domino object create_domino. max_tf_per_clust Maximum number transcription factors called active cluster. min_tf_pval Minimum p-value differential feature score test call transcription factor active cluster. max_rec_per_tf Maximum number receptors link transcription factor. rec_tf_cor_threshold Minimum pearson correlation used consider receptor linked transcription factor. Increasing decrease number receptors linked transcription factor. min_rec_percentage Minimum percentage cells cluster expressing receptor receptor linked trancription factors cluster.","code":""},{"path":"/reference/build_domino.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate a signaling network for a domino object — build_domino","text":"domino object signaling network built","code":""},{"path":"/reference/circos_ligand_receptor.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"Creates chord plot expression ligands can activate specified receptor chord widths correspond mean ligand expression cluster.","code":""},{"path":"/reference/circos_ligand_receptor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"","code":"circos_ligand_receptor( dom, receptor, ligand_expression_threshold = 0.01, cell_idents = NULL, cell_colors = NULL )"},{"path":"/reference/circos_ligand_receptor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"dom Domino object undergone network building build_domino() receptor Name receptor active least one cell type domino object ligand_expression_threshold Minimum mean expression value ligand cell type chord rendered cell type receptor cell_idents Vector cell types cluster assignments domino object included plot. cell_colors Named vector color names hex codes names correspond plotted cell types color values","code":""},{"path":"/reference/circos_ligand_receptor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"renders circos plot active graphics device","code":""},{"path":"/reference/collate_network_items.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"function collates features, receptors, ligands found signaling network anywhere list clusters. can useful comparing signaling networks across two separate conditions. order run build_domino() must run object previously.","code":""},{"path":"/reference/collate_network_items.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"","code":"collate_network_items(dom, clusters = NULL, return = NULL)"},{"path":"/reference/collate_network_items.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"dom Domino object containing signaling network (.e. build_domino() run) clusters Vector indicating clusters collate network items . left NULL clusters included. return String indicating collate 'features', 'receptors', 'ligands'. '' list three returned.","code":""},{"path":"/reference/collate_network_items.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"vector containing features, receptors, ligands data set list containing three.","code":""},{"path":"/reference/convert_genes.html","id":null,"dir":"Reference","previous_headings":"","what":"Use biomaRt to convert genes — convert_genes","title":"Use biomaRt to convert genes — convert_genes","text":"function reads vector genes converts genes specified symbol type","code":""},{"path":"/reference/convert_genes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use biomaRt to convert genes — convert_genes","text":"","code":"convert_genes( genes, from = c(\"ENSMUSG\", \"ENSG\", \"MGI\", \"HGNC\"), to = c(\"MGI\", \"HGNC\"), host = \"https://www.ensembl.org\" )"},{"path":"/reference/convert_genes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use biomaRt to convert genes — convert_genes","text":"genes Vector genes convert. Format gene input (ENSMUSG, ENSG, MGI, HGNC) Format gene output (MGI, HGNC) host Host connect . Defaults https://www.ensembl.org following useMart default, can changed archived hosts useMart fails connect.","code":""},{"path":"/reference/convert_genes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Use biomaRt to convert genes — convert_genes","text":"data frame input genes col 1 output col 2","code":""},{"path":"/reference/cor_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"Creates heatmap correlation values receptors transcription factors either boolean threshold continuous values displayed","code":""},{"path":"/reference/cor_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"","code":"cor_heatmap( dom, bool = FALSE, bool_thresh = 0.15, title = TRUE, feats = NULL, recs = NULL, mark_connections = FALSE, ... )"},{"path":"/reference/cor_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"dom Domino object network built (build_domino()) bool Boolean indicating whether heatmap continuous boolean. boolean bool_thresh used determine define activity positive negative. bool_thresh Numeric indicating threshold separating '' '' feature activity making boolean heatmap. title Either string use title boolean describing whether include title. order pass 'main' parameter ComplexHeatmap::Heatmap() must set title FALSE. feats Either vector features include heatmap '' features. left NULL features selected signaling network shown. recs Either vector receptors include heatmap '' receptors. left NULL receptors selected signaling network connected features plotted shown. mark_connections Boolean indicating whether add 'x' cells connected receptor TF. Default FALSE. ... parameters pass ComplexHeatmap::Heatmap() . Note use 'main' parameter ComplexHeatmap::Heatmap() must set title = FALSE use 'annCol' 'annColors' ann_cols must FALSE.","code":""},{"path":"/reference/cor_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/cor_scatter.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"Create correlation plot transcription factor activation score receptor","code":""},{"path":"/reference/cor_scatter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"","code":"cor_scatter(dom, tf, rec, remove_rec_dropout = TRUE, ...)"},{"path":"/reference/cor_scatter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"dom Domino object network built (build_domino()) tf Target TF module plotting receptor rec Target receptor plotting TF remove_rec_dropout Whether remove cells zero expression plot. match setting build_domino. ... parameters pass ggscatter.","code":""},{"path":"/reference/cor_scatter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"ggplot object","code":""},{"path":"/reference/count_linkage.html","id":null,"dir":"Reference","previous_headings":"","what":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"Count occurrences linkages across multiple domino results linkage summary","code":""},{"path":"/reference/count_linkage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"","code":"count_linkage( linkage_summary, cluster, group.by = NULL, linkage = \"rec_lig\", subject_names = NULL )"},{"path":"/reference/count_linkage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"linkage_summary linkage_summary object cluster name cell cluster compared across multiple domino results group.name column linkage_summary\\@subject_meta group subjects counting. NULL, total counts linkages linkages cluster across subjects given. linkage stored linkage domino object. Can compare ('tfs', 'rec', 'incoming_lig', 'tfs_rec', 'rec_lig') subject_names vector subject_names linkage_summary compared. NULL, subject_names linkage summary included counting.","code":""},{"path":"/reference/count_linkage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"data frame columns unique linkage features counts many times linkage occured across compared domino results. group.used, counts linkages also provided columns named unique values group.variable.","code":""},{"path":"/reference/create_domino.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a domino object and prepare it for network construction — create_domino","title":"Create a domino object and prepare it for network construction — create_domino","text":"function reads receptor ligand signaling database, cell level features kind (ie. output pySCENIC), z-scored single cell data, cluster id single cell data, calculates correlation matrix receptors features (transcription factor module scores using pySCENIC), finds features enriched cluster. return domino object prepared build_domino(), calculate signaling network.","code":""},{"path":"/reference/create_domino.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a domino object and prepare it for network construction — create_domino","text":"","code":"create_domino( rl_map, features, ser = NULL, counts = NULL, z_scores = NULL, clusters = NULL, use_clusters = TRUE, tf_targets = NULL, verbose = TRUE, use_complexes = TRUE, rec_min_thresh = 0.025, remove_rec_dropout = TRUE, tf_selection_method = \"clusters\", tf_variance_quantile = 0.5 )"},{"path":"/reference/create_domino.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a domino object and prepare it for network construction — create_domino","text":"rl_map Data frame row describes receptor-ligand interaction required columns gene_A & gene_B including gene names receptor ligand type_A & type_B annotating genes B ligand (L) receptor (R) features Either path csv containing cell level features interest (ie. auc matrix pySCENIC) named matrix cells columns features rows. ser Seurat object containing scaled RNA expression data RNA assay slot cluster identity. Either ser object z_scores clusters must provided. ser present z_scores clusters ignored. counts Counts matrix data. Seurat object provided ignored. used threshold receptors dropout. z_scores Matrix containing z-scored expression data cells cells columns features rows. Either z_scores clusters must provided ser object. ser present z_scores clusters ignored. clusters Named factor containing cell cluster names cells. Either clusters z_scores ser must provided. ser present z_scores clusters ignored. use_clusters Boolean indicating whether use clusters Seurat object. Seurat object provided parameter ignored. tf_targets Optional. list names transcription factors stored values character vectors genes transcription factor's regulon. verbose Boolean indicating whether print progress computation. use_complexes Boolean indicating whether wish use receptor/ligand complexes receptor ligand signaling database. FALSE, receptor/ligand pairs either functions protein complex considered constructing signaling network. rec_min_thresh Minimum expression level receptors cell. Default 0.025 2.5 percent cells data set. important calculating correlation connect receptors transcription activation. threshold low correlation calculations proceed cells non-zero expression. remove_rec_dropout Whether remove receptors 0 expression counts calculating correlations. can reduce false positive correlation calculations receptors high dropout rates. tf_selection_method Selection method target transcription factors. 'clusters' differential expression clusters calculated. 'variable' variable transcription factors selected. '' transcription factors feature matrix used. Default 'clusters'. Note wish use clusters intercellular signaling downstream MUST choose clusters. tf_variance_quantile proportion variable features take using variance threshold features. Default 0.5. Higher numbers keep features. Ignored tf_selection_method 'variable'","code":""},{"path":"/reference/create_domino.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a domino object and prepare it for network construction — create_domino","text":"domino object","code":""},{"path":"/reference/create_regulon_list_scenic.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"Generates list transcription factors genes targeted transcription factor part regulon inferred pySCENIC","code":""},{"path":"/reference/create_regulon_list_scenic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"","code":"create_regulon_list_scenic(regulons)"},{"path":"/reference/create_regulon_list_scenic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"regulons Dataframe file path table output grn (gene regulatory network) function pySCENIC","code":""},{"path":"/reference/create_regulon_list_scenic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"list names transcription factors stored values character vectors genes inferred regulons","code":""},{"path":"/reference/create_rl_map_cellphonedb.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"Generates data frame ligand-receptor interactions CellPhoneDB database annotating genes encoding interacting ligands receptors queried transcriptomic data.","code":""},{"path":"/reference/create_rl_map_cellphonedb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"","code":"create_rl_map_cellphonedb( genes, proteins, interactions, complexes = NULL, database_name = \"CellPhoneDB\", gene_conv = NULL, gene_conv_host = \"https://www.ensembl.org\", alternate_convert = FALSE, alternate_convert_table = NULL )"},{"path":"/reference/create_rl_map_cellphonedb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"genes dataframe file path table gene names uniprot, hgnc_symbol, ensembl format cellphonedb database format proteins dataframe file path table protein features cellphonedb format interactions dataframe file path table protein-protein interactions cellphonedb format complexes optional: dataframe file path table protein complexes cellphonedb format database_name name database used, stored output gene_conv tuple (, ) (source, target) gene conversion orthologs desired; options ENSMUSG, ENSG, MGI, HGNC gene_conv_host host conversion; default ensembl, also use mirrors desired alternate_convert boolean like use non-ensembl method conversion (must supply table; recommended, use ensembl ) alternate_convert_table supplied table non-ensembl method conversion","code":""},{"path":"/reference/create_rl_map_cellphonedb.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"Data frame row describes possible receptor-ligand interaction","code":""},{"path":"/reference/do_norm.html","id":null,"dir":"Reference","previous_headings":"","what":"Normalize a matrix to its max value by row or column — do_norm","title":"Normalize a matrix to its max value by row or column — do_norm","text":"Normalizes matrix max value row column","code":""},{"path":"/reference/do_norm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Normalize a matrix to its max value by row or column — do_norm","text":"","code":"do_norm(mat, dir)"},{"path":"/reference/do_norm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Normalize a matrix to its max value by row or column — do_norm","text":"mat Matrix normalized dir Direction normalize matrix c('row', 'col')","code":""},{"path":"/reference/do_norm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Normalize a matrix to its max value by row or column — do_norm","text":"normalized matrix direction specified.","code":""},{"path":"/reference/dom_clusters.html","id":null,"dir":"Reference","previous_headings":"","what":"Access clusters — dom_clusters","title":"Access clusters — dom_clusters","text":"function pull cluster information domino object","code":""},{"path":"/reference/dom_clusters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access clusters — dom_clusters","text":"","code":"dom_clusters(dom, labels = FALSE)"},{"path":"/reference/dom_clusters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access clusters — dom_clusters","text":"dom domino object created create_domino() labels boolean whether return cluster labels cell clusters used inferring communication","code":""},{"path":"/reference/dom_clusters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access clusters — dom_clusters","text":"vector containing either names clusters used factors cluster label individual cell","code":""},{"path":"/reference/dom_correlations.html","id":null,"dir":"Reference","previous_headings":"","what":"Access correlations — dom_correlations","title":"Access correlations — dom_correlations","text":"function pull receptor-transcription factor correlations domino object","code":""},{"path":"/reference/dom_correlations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access correlations — dom_correlations","text":"","code":"dom_correlations(dom)"},{"path":"/reference/dom_correlations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access correlations — dom_correlations","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_correlations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access correlations — dom_correlations","text":"matrix containing correlation values receptor (row) transcription factor (column)","code":""},{"path":"/reference/dom_counts.html","id":null,"dir":"Reference","previous_headings":"","what":"Access counts — dom_counts","title":"Access counts — dom_counts","text":"function pull gene expression domino object","code":""},{"path":"/reference/dom_counts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access counts — dom_counts","text":"","code":"dom_counts(dom)"},{"path":"/reference/dom_counts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access counts — dom_counts","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_counts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access counts — dom_counts","text":"matrix containing gene expression values gene (row) cell (column)","code":""},{"path":"/reference/dom_database.html","id":null,"dir":"Reference","previous_headings":"","what":"Access database — dom_database","title":"Access database — dom_database","text":"function pull database information domino object","code":""},{"path":"/reference/dom_database.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access database — dom_database","text":"","code":"dom_database(dom, name_only = TRUE)"},{"path":"/reference/dom_database.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access database — dom_database","text":"dom domino object created name_only boolean whether return name database used entire database stored. Default TRUE.","code":""},{"path":"/reference/dom_database.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access database — dom_database","text":"vector unique databases used building domino object data frame includes database information used domino object creation","code":""},{"path":"/reference/dom_de.html","id":null,"dir":"Reference","previous_headings":"","what":"Access differential expression — dom_de","title":"Access differential expression — dom_de","text":"function pull differential expression p values domino object","code":""},{"path":"/reference/dom_de.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access differential expression — dom_de","text":"","code":"dom_de(dom)"},{"path":"/reference/dom_de.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access differential expression — dom_de","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_de.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access differential expression — dom_de","text":"matrix containing p values differential expression transcription factors (rows) cluster (columns)","code":""},{"path":"/reference/dom_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Access build information — dom_info","title":"Access build information — dom_info","text":"function pull parameters used running build_domino() domino object","code":""},{"path":"/reference/dom_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access build information — dom_info","text":"","code":"dom_info(dom)"},{"path":"/reference/dom_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access build information — dom_info","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access build information — dom_info","text":"list containing booleans whether object created build, list build parameters used build_domino() infer signaling network","code":""},{"path":"/reference/dom_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Access linkages — dom_linkages","title":"Access linkages — dom_linkages","text":"function pull linkages domino object","code":""},{"path":"/reference/dom_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access linkages — dom_linkages","text":"","code":"dom_linkages( dom, link_type = c(\"complexes\", \"receptor-ligand\", \"tf-target\", \"tf-receptor\", \"receptor\", \"incoming-ligand\"), by_cluster = FALSE )"},{"path":"/reference/dom_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access linkages — dom_linkages","text":"dom domino object created create_domino() link_type One value (\"complexes\", \"receptor-ligand\", \"tf-target\", \"tf-receptor\", \"receptor\", \"incoming-ligand\") used select desired type linkage by_cluster boolean indicate whether linkages returned overall cluster","code":""},{"path":"/reference/dom_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access linkages — dom_linkages","text":"list containing linkages combination receptors, ligands, transcription factors, clusters","code":""},{"path":"/reference/dom_signaling.html","id":null,"dir":"Reference","previous_headings":"","what":"Access signaling — dom_signaling","title":"Access signaling — dom_signaling","text":"function pull signaling matrices domino object","code":""},{"path":"/reference/dom_signaling.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access signaling — dom_signaling","text":"","code":"dom_signaling(dom, cluster = NULL)"},{"path":"/reference/dom_signaling.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access signaling — dom_signaling","text":"dom domino object created create_domino() cluster Either NULL indicate global signaling specific cluster ","code":""},{"path":"/reference/dom_signaling.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access signaling — dom_signaling","text":"data.frame containing signaling score ligand (row) cluster (column) data.frame containing global summed signaling scores receptors (rows) ligands (columns) cluster","code":""},{"path":"/reference/dom_tf_activation.html","id":null,"dir":"Reference","previous_headings":"","what":"Access transcription factor activation — dom_tf_activation","title":"Access transcription factor activation — dom_tf_activation","text":"function pull transcription factor activation scores domino object","code":""},{"path":"/reference/dom_tf_activation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access transcription factor activation — dom_tf_activation","text":"","code":"dom_tf_activation(dom)"},{"path":"/reference/dom_tf_activation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access transcription factor activation — dom_tf_activation","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_tf_activation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access transcription factor activation — dom_tf_activation","text":"matrix containing transcription factor activation scores feature (row) cell (column)","code":""},{"path":"/reference/dom_zscores.html","id":null,"dir":"Reference","previous_headings":"","what":"Access z-scores — dom_zscores","title":"Access z-scores — dom_zscores","text":"function pull z-scored expression domino object","code":""},{"path":"/reference/dom_zscores.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access z-scores — dom_zscores","text":"","code":"dom_zscores(dom)"},{"path":"/reference/dom_zscores.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access z-scores — dom_zscores","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_zscores.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access z-scores — dom_zscores","text":"matrix containing z-scored gene expression values gene (row) cell (column)","code":""},{"path":"/reference/domino-class.html","id":null,"dir":"Reference","previous_headings":"","what":"The domino Class — domino-class","title":"The domino Class — domino-class","text":"domino class contains information necessary calculate receptor-ligand signaling. contains z-scored expression, cell cluster labels, feature values, referenced receptor-ligand database formatted receptor-ligand map. Calculated intermediate values also stored.","code":""},{"path":"/reference/domino-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"The domino Class — domino-class","text":"db_info List data sets lr database. counts Raw count gene expression data z_scores Matrix z-scored expression data cells columns clusters Named factor cluster identity cell features Matrix features correlate receptor-ligand expression . Cells columns features rows. cor Correlation matrix receptor expression features. linkages List lists containing info linking cluster->tf->rec->lig clust_de Data frame containing differential expression results features cluster. misc List miscellaneous info pertaining run parameters etc. cl_signaling_matrices Incoming signaling matrix cluster signaling Signaling matrix clusters.","code":""},{"path":"/reference/feat_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a heatmap of features organized by cluster — feat_heatmap","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"Creates heatmap feature expression (typically transcription factor activation scores) cells organized cluster.","code":""},{"path":"/reference/feat_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"","code":"feat_heatmap( dom, feats = NULL, bool = FALSE, bool_thresh = 0.2, title = TRUE, norm = FALSE, cols = NULL, ann_cols = TRUE, min_thresh = NULL, max_thresh = NULL, ... )"},{"path":"/reference/feat_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"dom Domino object network built (build_domino()) feats Either vector features include heatmap '' features. left NULL features selected signaling network shown. bool Boolean indicating whether heatmap continuous boolean. boolean bool_thresh used determine define activity positive negative. bool_thresh Numeric indicating threshold separating '' '' feature activity making boolean heatmap. title Either string use title boolean describing whether include title. order pass 'main' parameter ComplexHeatmap::Heatmap() must set title FALSE. norm Boolean indicating whether normalize transcrption factors max value. cols Named vector colors annotate cells cluster color. Values taken colors names cluster. left NULL default ggplot colors generated. ann_cols Boolean indicating whether include cell cluster column annotation. Colors can defined cols. FALSE custom annotations can passed NMF. min_thresh Minimum threshold color scaling boolean heatmap max_thresh Maximum threshold color scaling boolean heatmap ... parameters pass ComplexHeatmap::Heatmap() . Note use 'main' parameter ComplexHeatmap::Heatmap() must set title = FALSE use 'annCol' 'annColors' ann_cols must FALSE.","code":""},{"path":"/reference/feat_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/gene_network.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a gene association network — gene_network","title":"Create a gene association network — gene_network","text":"Create gene association network genes given cluster. selected cluster acts receptor gene association network, ligands, receptors, features associated receptor cluster included plot.","code":""},{"path":"/reference/gene_network.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a gene association network — gene_network","text":"","code":"gene_network( dom, clust = NULL, OutgoingSignalingClust = NULL, class_cols = c(lig = \"#FF685F\", rec = \"#47a7ff\", feat = \"#39C740\"), cols = NULL, lig_scale = 1, layout = \"grid\", ... )"},{"path":"/reference/gene_network.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a gene association network — gene_network","text":"dom Domino object network built (build_domino()) clust Receptor cluster create gene association network . vector clusters may provided. OutgoingSignalingClust Vector clusters plot outgoing signaling class_cols Named vector colors used color classes vertices. Values must colors names must classes ('rec', 'lig', 'feat' receptors, ligands, features.). cols Named vector colors individual genes. Genes included vector colored according class_cols. lig_scale FALSE numeric value scale size ligand vertices based z-scored expression data set. layout Type layout use. Options 'grid', 'random', 'sphere', 'circle', 'fr' Fruchterman-Reingold force directed layout, 'kk' Kamada Kawai directed layout. ... parameters pass plot() igraph object. See igraph manual options.","code":""},{"path":"/reference/gene_network.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a gene association network — gene_network","text":"igraph rendered active graphics device","code":""},{"path":"/reference/ggplot_col_gen.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate ggplot colors — ggplot_col_gen","title":"Generate ggplot colors — ggplot_col_gen","text":"Accepts number colors generate generates ggplot color spectrum.","code":""},{"path":"/reference/ggplot_col_gen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate ggplot colors — ggplot_col_gen","text":"","code":"ggplot_col_gen(n)"},{"path":"/reference/ggplot_col_gen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate ggplot colors — ggplot_col_gen","text":"n Number colors generate","code":""},{"path":"/reference/ggplot_col_gen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate ggplot colors — ggplot_col_gen","text":"vector colors according ggplot color generation.","code":""},{"path":"/reference/incoming_signaling_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"Creates heatmap cluster incoming signaling matrix. cluster list ligands capable activating enriched transcription factors. function creates heatmap cluster average expression ligands. list cluster incoming signaling matrices can found cl_signaling_matrices slot domino option alternative plotting function.","code":""},{"path":"/reference/incoming_signaling_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"","code":"incoming_signaling_heatmap( dom, rec_clust, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, scale = \"none\", normalize = \"none\", title = TRUE, ... )"},{"path":"/reference/incoming_signaling_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"dom Domino object network built (build_domino()) rec_clust cluster select receptor. Must match naming clusters domino object. clusts Vector clusters included. NULL clusters used. min_thresh Minimum signaling threshold plotting. Defaults -Inf threshold. max_thresh Maximum signaling threshold plotting. Defaults Inf threshold. scale scale values (thresholding). Options 'none', 'sqrt' square root, 'log' log10. normalize Options normalize matrix. Accepted inputs 'none' normalization, 'rec_norm' normalize maximum value receptor cluster, 'lig_norm' normalize maximum value within ligand cluster title Either string use title boolean describing whether include title. order pass 'main' parameter ComplexHeatmap::Heatmap() must set title FALSE. ... parameters pass ComplexHeatmap::Heatmap(). Note use 'column_title' parameter ComplexHeatmap::Heatmap() must set title = FALSE","code":""},{"path":"/reference/incoming_signaling_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/lc.html","id":null,"dir":"Reference","previous_headings":"","what":"Pulls all items from a list pooled into a single vector — lc","title":"Pulls all items from a list pooled into a single vector — lc","text":"Helper function convert nested series lists single vector.","code":""},{"path":"/reference/lc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pulls all items from a list pooled into a single vector — lc","text":"","code":"lc(list, list_names)"},{"path":"/reference/lc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pulls all items from a list pooled into a single vector — lc","text":"list List pull items list_names Names items list pool","code":""},{"path":"/reference/lc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pulls all items from a list pooled into a single vector — lc","text":"vector contaning items list list_names","code":""},{"path":"/reference/linkage_summary-class.html","id":null,"dir":"Reference","previous_headings":"","what":"The domino linkage summary class — linkage_summary-class","title":"The domino linkage summary class — linkage_summary-class","text":"linkage summary class contains linkages established multiple domino objects gene regulatory network inference reference receptor- ligand data bases. data frame summarizing meta features describe domino objects compared linkage summary facilitates comparisons established linkages differential signaling interactions across categorical sample covariates.","code":""},{"path":"/reference/linkage_summary-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"The domino linkage summary class — linkage_summary-class","text":"subject_names unique names domino result included summary subject_meta data.frame row describing one subject columns describing features subjects draw comparisons signaling networks subject_linkages nested list linkages inferred subject. Lists stored heirarchical structure subject-cluster-linkage linkages include transcription factors (tfs), linkages transcription factors receptors (tfs_rec), active receptors (rec), possible receptor-ligand interactions (rec_lig), incoming ligands (incoming_lig)","code":""},{"path":"/reference/mean_ligand_expression.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"Creates data frame mean ligand expression use plotting circos plot ligand expression saving tables mean expression.","code":""},{"path":"/reference/mean_ligand_expression.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"","code":"mean_ligand_expression(x, ligands, cell_ident, cell_barcodes, destination)"},{"path":"/reference/mean_ligand_expression.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"x Gene cell expression matrix ligands Character vector ligand genes quantified cell_ident Vector cell type (identity) names calculate mean ligand gene expression cell_barcodes Vector cell barcodes (colnames x) belonging cell_ident calculate mean expression across destination Name receptor ligand interacts","code":""},{"path":"/reference/mean_ligand_expression.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"data frame ligand expression targeting specified receptor","code":""},{"path":"/reference/pbmc.html","id":null,"dir":"Reference","previous_headings":"","what":"PBMC3K single cell RNA sequencing data — pbmc","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"small example single cell data set 10x genomcs","code":""},{"path":"/reference/pbmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"","code":"pbmc"},{"path":[]},{"path":"/reference/pbmc.html","id":"pbmc","dir":"Reference","previous_headings":"","what":"pbmc","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"Seurat object preliminary analysis, including normalization, scaling, PCA, UMAP, clustering, cluster annotation","code":""},{"path":"/reference/pbmc.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"https://cf.10xgenomics.com/samples/cell/pbmc3k/pbmc3k_filtered_gene_bc_matrices.tar.gz","code":""},{"path":"/reference/pbmc_dom.html","id":null,"dir":"Reference","previous_headings":"","what":"Example domino object from pbmc3k data — pbmc_dom","title":"Example domino object from pbmc3k data — pbmc_dom","text":"small example single cell data set 10x Genomics preliminary analysis, including normalization, scaling, PCA, UMAP, clustering, cluster annotation used example domino2 analysis.","code":""},{"path":"/reference/pbmc_dom.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example domino object from pbmc3k data — pbmc_dom","text":"","code":"data(pbmc_dom)"},{"path":[]},{"path":"/reference/pbmc_dom.html","id":"pbmc-dom","dir":"Reference","previous_headings":"","what":"pbmc_dom","title":"Example domino object from pbmc3k data — pbmc_dom","text":"domino object based 10x Genomics pbmc3k data set serves example tutorials can also used explore object structure functionality.","code":""},{"path":"/reference/plot_differential_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"Plot differential linkages among domino results ranked comparative statistic","code":""},{"path":"/reference/plot_differential_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"","code":"plot_differential_linkages( differential_linkages, test_statistic, stat_range = c(0, 1), stat_ranking = c(\"ascending\", \"descending\"), group_palette = NULL )"},{"path":"/reference/plot_differential_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"differential_linkages data.frame output test_differential_linkages function test_statistic column name differential_linkages test statistic used ranking linkages stored (ex. 'p.value') stat_range two value vector minimum maximum values test_statistic plotting linkage features stat_ranking 'ascending' (lowest value test statisic colored red plotted top) 'descending' (highest value test statistic colored red plotted top). group_palette named vector colors use group compared","code":""},{"path":"/reference/plot_differential_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"Heatmap-class object features ranked test_statistic annotated proportion subjects showed active linkage features.","code":""},{"path":"/reference/print-domino-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Print domino object — print,domino-method","title":"Print domino object — print,domino-method","text":"Prints summary domino object","code":""},{"path":"/reference/print-domino-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print domino object — print,domino-method","text":"","code":"# S4 method for domino print(x, ...)"},{"path":"/reference/print-domino-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print domino object — print,domino-method","text":"x Domino object","code":""},{"path":"/reference/print-domino-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print domino object — print,domino-method","text":"printed description number cell clusters object","code":""},{"path":"/reference/rename_clusters.html","id":null,"dir":"Reference","previous_headings":"","what":"Renames clusters in a domino object — rename_clusters","title":"Renames clusters in a domino object — rename_clusters","text":"function reads receptor ligand signaling database, cell level features kind (ie. output pySCENIC), z-scored single cell data, cluster id single cell data, calculates correlation matrix receptors features (transcription factor module scores using pySCENIC), finds features enriched cluster. return domino object prepared build_domino(), calculate signaling network.","code":""},{"path":"/reference/rename_clusters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Renames clusters in a domino object — rename_clusters","text":"","code":"rename_clusters(dom, clust_conv)"},{"path":"/reference/rename_clusters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Renames clusters in a domino object — rename_clusters","text":"dom Domino object rename clusters clust_conv Named vector conversions old new clusters. Values taken new clusters IDs names old cluster IDs.","code":""},{"path":"/reference/rename_clusters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Renames clusters in a domino object — rename_clusters","text":"domino object clusters renamed applicable slots.","code":""},{"path":"/reference/show-domino-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Show domino object information — show,domino-method","title":"Show domino object information — show,domino-method","text":"Shows content overview domino object","code":""},{"path":"/reference/show-domino-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show domino object information — show,domino-method","text":"","code":"# S4 method for domino show(object)"},{"path":"/reference/show-domino-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show domino object information — show,domino-method","text":"object Domino object","code":""},{"path":"/reference/show-domino-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show domino object information — show,domino-method","text":"printed description number cells domino object build status","code":""},{"path":"/reference/signaling_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a network heatmap — signaling_heatmap","title":"Create a network heatmap — signaling_heatmap","text":"Creates heatmap signaling network. Alternatively, network matrix can accessed directly signaling slot domino object.","code":""},{"path":"/reference/signaling_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a network heatmap — signaling_heatmap","text":"","code":"signaling_heatmap( dom, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, scale = \"none\", normalize = \"none\", ... )"},{"path":"/reference/signaling_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a network heatmap — signaling_heatmap","text":"dom Domino object network built (build_domino()) clusts Vector clusters included. NULL clusters used. min_thresh Minimum signaling threshold plotting. Defaults -Inf threshold. max_thresh Maximum signaling threshold plotting. Defaults Inf threshold. scale scale values (thresholding). Options 'none', 'sqrt' square root, 'log' log10. normalize Options normalize matrix. Normalization done thresholding scaling. Accepted inputs 'none' normalization, 'rec_norm' normalize maximum value receptor cluster, 'lig_norm' normalize maximum value within ligand cluster ... parameters pass ComplexHeatmap::Heatmap()","code":""},{"path":"/reference/signaling_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a network heatmap — signaling_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/signaling_network.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a cluster to cluster signaling network diagram — signaling_network","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"Creates network diagram signaling clusters. Nodes clusters directed edges indicate signaling one cluster another. Edges colored based color scheme ligand expressing cluster.","code":""},{"path":"/reference/signaling_network.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"","code":"signaling_network( dom, cols = NULL, edge_weight = 0.3, clusts = NULL, showOutgoingSignalingClusts = NULL, showIncomingSignalingClusts = NULL, min_thresh = -Inf, max_thresh = Inf, normalize = \"none\", scale = \"sq\", layout = \"circle\", scale_by = \"rec_sig\", vert_scale = 3, plot_title = NULL, ... )"},{"path":"/reference/signaling_network.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"dom Domino object network built (build_domino()) cols Named vector indicating colors clusters. Values colors names must match clusters domino object. left NULL ggplot colors generated clusters. edge_weight Weight determining thickness edges plot. Signaling values multiplied value. clusts Vector clusters included network plot. showOutgoingSignalingClusts Vector clusters plot outgoing signaling showIncomingSignalingClusts Vector clusters plot incoming signaling min_thresh Minimum signaling threshold. Values lower threshold set threshold. Defaults -Inf threshold. max_thresh Maximum signaling threshold plotting. Values higher threshold set threshold. Defaults Inf threshold. normalize Options normalize signaling matrix. Accepted inputs 'none' normalization, 'rec_norm' normalize maximum value receptor cluster, 'lig_norm' normalize maximum value within ligand cluster scale scale values (thresholding). Options 'none', 'sqrt' square root, 'log' log10, 'sq' square. layout Type layout use. Options 'random', 'sphere', 'circle', 'fr' Fruchterman-Reingold force directed layout, 'kk' Kamada Kawai directed layout. scale_by size vertices. Options 'lig_sig' summed outgoing signaling, 'rec_sig' summed incoming signaling, 'none'. former two cases values scaled asinh summing incoming outgoing signaling. vert_scale Integer used scale size vertices without variable scaling size_verts_by. plot_title Text plot's title. ... parameters passed plot used {igraph} object.","code":""},{"path":"/reference/signaling_network.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"igraph rendered active graphics device","code":""},{"path":"/reference/summarize_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize linkages from multiple domino objects — summarize_linkages","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"Creates linkage_summary object storing linkages learned different domino objects nested lists facilitate comparisons networks learned domino across subject covariates.","code":""},{"path":"/reference/summarize_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"","code":"summarize_linkages(domino_results, subject_meta, subject_names = NULL)"},{"path":"/reference/summarize_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"domino_results list domino result one domino object per subject. Names list must match subject_names. subject_meta dataframe includes subject features objects grouped. first column must subject names subject_names vector subject names domino_results. NULL, defaults first column subject_meta.","code":""},{"path":"/reference/summarize_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"linkage summary class object consisting nested lists active transcription factors, active receptors, incoming ligands cluster across multiple domino results.","code":""},{"path":"/reference/table_convert_genes.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Genes Using Table — table_convert_genes","title":"Convert Genes Using Table — table_convert_genes","text":"Takes vector gene inputs returns converted gene table","code":""},{"path":"/reference/table_convert_genes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Genes Using Table — table_convert_genes","text":"","code":"table_convert_genes(genes, from, to, conversion_table)"},{"path":"/reference/table_convert_genes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Genes Using Table — table_convert_genes","text":"genes genes convert. Gene symbol type input (ENSG, ENSMUSG, HGNC, MGI) Desired gene symbol type output (HGNC, MGI) conversion_table data.frame column names corresponding gene symbol types (mm.ens, hs.ens, mgi, hgnc) rows corresponding gene symbols ","code":""},{"path":"/reference/table_convert_genes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Genes Using Table — table_convert_genes","text":"Data frame genes original corresponding converted symbols","code":""},{"path":"/reference/test_differential_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"Statistical test differential linkages across multiple domino results","code":""},{"path":"/reference/test_differential_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"","code":"test_differential_linkages( linkage_summary, cluster, group.by, linkage = \"rec_lig\", subject_names = NULL, test_name = \"fishers.exact\" )"},{"path":"/reference/test_differential_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"linkage_summary linkage_summary object cluster name cell cluster compared across multiple domino results group.name column linkage_summary\\@subject_meta group subjects counting. linkage stored linkage domino object. Can compare ('tfs', 'rec', 'incoming_lig', 'tfs_rec', 'rec_lig') subject_names vector subject_names linkage_summary compared. NULL, subject_names linkage summary included counting. test_name statistical test used comparison. 'fishers.exact' : Fisher's exact test dependence proportion subjects active linkage cluster group subject belongs group.variable. Provides odds ratio, p-value, Benjamini-Hochberg FDR-adjusted p-value (p.adj) linkage tested.","code":""},{"path":"/reference/test_differential_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"data frame results test differential linkages. Rows correspond linkage tested. Columns correspond : 'cluster' : name cell cluster compared 'linkage' : type linkage compared 'group.' : grouping variable 'test_name' : test used comparison 'feature' : individual linkages compared 'test statistics' : test statistics provided based test method. 'fishers.exact' provides odds ratio, p-value, fdr-adjusted p-value. 'total_count' : total number subjects linkage active 'X_count' : number subjects category group.(X) linkage active 'total_n' : number total subjects compared 'X_n' : total number subjects category group.(X)","code":""}] +[{"path":"/articles/domino2.html","id":"using-domino2-v0-2-2-for-cell-cell-communication-inference","dir":"Articles","previous_headings":"","what":"Using domino2 v0.2.2 for cell-cell communication inference","title":"Get Started with domino2","text":"domino2 tool analysis intra- intercellular signaling single cell RNA sequencing (scRNAseq) data based transcription factor (TF) activation. , show basic example pipeline generating communication networks domino object. vignette demonstrate use domino2 10X Genomics Peripheral Blood Mononuclear Cells (PBMC) data set 2,700 cells. data can downloaded .","code":""},{"path":"/articles/domino2.html","id":"preprocessing-scrnaseq-data","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference","what":"Preprocessing scRNAseq data","title":"Get Started with domino2","text":"Analysis cell-cell communication domino2 often follows initial processing annotation scRNAseq data. used Satija Lab’s Guided Clustering Tutorial prepare data set analysis domino2. complete processing script available data-raw directory domino2 package. processed data can downloaded Zenodo.","code":"pbmc <- readRDS(paste0(pbmc_dir, \"/pbmc_seurat.rds\"))"},{"path":"/articles/domino2.html","id":"saving-preprocessed-data","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Preprocessing scRNAseq data","what":"Saving Preprocessed Data:","title":"Get Started with domino2","text":"domino2 designed compatible Seurat objects addition accepting matrices vectors data set function inputs. Therefore, ’s good idea save processed Seurat object analysis. However, pySCENIC used TF activation inference, requires input cell gene matrix. opposite orientation Seurat objects default Python based tools scanpy. RNA counts matrix can saved tab-seperated value (.tsv) comma-sperated value (.csv) file transposing matrix cell gene orientation. tsv csv files inefficient storing large matrices. alternative, counts matrix can saved loom file directly passed pySCENIC format. Generating loom file R requires use loomR package. package automatically handles transposition counts matrix cell gene orientation well. recommend approach passing counts matrix pySCENIC. However, users aware loomR hosted CRAN BioConductor time vignette’s creation. cell x gene counts matrix may also saved tab-separated value (.tsv) file loomR used computing resource, aware dense formatting .tsv can lead large file sizes slow processing large data sets. provided necessary code , due large file size, .tsv file provided data directory. like skip ahead rest analysis, processed objects steps available data directory package.","code":"# save Seurat object as RDS save(pbmc, file = paste0(input_dir, \"/pbmc.rda\")) pbmc_counts <- GetAssayData(object = pbmc, slot = \"counts\") write.table(t(as.matrix(pbmc_counts)), paste0(input_dir, \"/pbmc3k_counts.tsv\"), sep = \"\\t\", col.names = NA) library(loomR) # save loom counts matrix pbmc_counts <- GetAssayData(object = pbmc, slot = \"counts\") pbmc_loom <- loomR::create(filename = paste0(input_dir, \"/pbmc3k_counts.loom\"), data = pbmc_counts) # connection to the loom file must be closed to complete file creation pbmc_loom$close_all()"},{"path":"/articles/domino2.html","id":"installation","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference","what":"Installation","title":"Get Started with domino2","text":"Installation domino2 Github can achieved using remotes package. current stable version v0.2.2, install branch.","code":"if (!require(remotes)) { install.packages(\"remotes\") } remotes::install_github(\"FertigLab/domino2@v0.2.2\")"},{"path":"/articles/domino2.html","id":"additional-downloads","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Installation","what":"Additional Downloads","title":"Get Started with domino2","text":"tutorial, pySCENIC used method TF activity inference assessment ligand-receptor interactions based curated interactions CellPhoneDB v4.0.0. requires downloading files prior use analysis pipeline.","code":""},{"path":"/articles/domino2.html","id":"downloads-for-scenic","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for SCENIC:","title":"Get Started with domino2","text":"singularity image SCENIC v0.12.1 can installed DockerHub image source (example scripts use Docker provided scenic_bash directory well). SCENIC requires list TFs, motif annotations, cisTarget motifs available authors SCENIC human (HGNC), mouse (MGI), fly. following download everything necessary analysis data set HGNC gene labels hg38 genome.","code":"SCENIC_DIR=\"'temp_dir'/scenic\" mkdir ${SCENIC_DIR} # Build singularity image singularity build \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" docker://aertslab/pyscenic:0.12.1 # Matrix containing motifs as rows and genes as columns and ranking position for each gene and motif (based on CRM scores) as values. URLs provided link to v2 feather files required for the 0.12.1 version of pySENIC. curl \"https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ -o \"${SCENIC_DIR}/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" curl \"https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg38/refseq_r80/mc_v10_clust/gene_based/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ -o \"${SCENIC_DIR}/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" # List of genes encoding TFs in the HG38 reference genome curl \"https://resources.aertslab.org/cistarget/tf_lists/allTFs_hg38.txt\" \\ -o \"${SCENIC_DIR}/allTFs_hg38.txt\" # Motif annotations based on the 2017 cisTarget motif collection. Use these files if you are using the mc9nr databases. curl \"https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ -o \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\""},{"path":"/articles/domino2.html","id":"downloads-for-cellphonedb","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for CellPhoneDB:","title":"Get Started with domino2","text":"Database files CellPhoneDB v4.0.0 human scRNAseq data can installed public Github repository Tiechmann Group developed CellPhoneDB.","code":"# cellphone_url <- \"https://github.com/ventolab/cellphonedb-data/archive/refs/tags/v4.0.0.tar.gz\" # download compressed database cellphone_tar <- paste0(temp_dir, \"/cellphoneDB_v4.tar.gz\") download.file(url = cellphone_url, destfile = cellphone_tar) # move contents of the compressed file to a new directory untar(tarfile = cellphone_tar, exdir = cellphone_dir) cellphone_data <- paste0(cellphone_dir, \"/cellphonedb-data-4.0.0/data\")"},{"path":"/articles/domino2.html","id":"scenic-analysis","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference","what":"SCENIC Analysis","title":"Get Started with domino2","text":"SCENIC lab’s preferred software TF activity scoring. recommend using Python implementation (pySCENIC) faster original R implementation. aware, use SCENIC often slowest memory intensive step analysis pipeline. SCENIC run computing resources access multi-core processing large amounts memory. described section saving preprocessed data, SCENIC requires RNA counts provided cell gene matrix format, using pbmc3k_counts.loom file stage analysis. pySCENIC initiated using bash scripting terminal. analysis consists 3 steps score genes TF motif enrichment, construct TF regulons consisting genes targeted TFs, arrive AUC scores enrichment regulon gene transcription within cell.","code":""},{"path":"/articles/domino2.html","id":"grn-construct-tf-modules","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > SCENIC Analysis","what":"grn: construct TF-modules","title":"Get Started with domino2","text":"Co-expression modules used quantify gene-TF adjacencies.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic grn \\ \"../data/pbmc3k_counts.loom\" \\ \"${SCENIC_DIR}/allTFs_hg38.txt\" \\ -o \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ --num_workers 6 \\ --seed 123 # Arguments: # path to the loom file # list of TFs # output directory for the adjacency matrix # number of CPUs to use if multi-core processing is available # specify a random seed for reproducibility"},{"path":"/articles/domino2.html","id":"ctx-construct-tf-regulons-with-pruning-based-on-tf-motif-enrichment","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > SCENIC Analysis","what":"ctx: construct TF regulons with pruning based on TF motif enrichment","title":"Get Started with domino2","text":"rankings genes based enrichment TF motifs transcription start site (TSS) considered construction regulons, target genes TF-modules removed lack motifs proximal TSS TF may bind.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic ctx \\ \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ \"${SCENIC_DIR}/hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ \"${SCENIC_DIR}/hg38_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather\" \\ --annotations_fname \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ --expression_mtx_fname \"data/pbmc3k_counts.loom\" \\ --mode \"dask_multiprocessing\" \\ --output \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ --num_workers 1 # Arguments: # adjacency matrix output from grn # target rankings of motif enrichment within 10 kb of TSS # target rankings of motif enrichment within 500 bp upstream and 100 bp downstream of TSS # TF motif features # counts matrix loom file # enable multi-core processing # output file of learned TF regulons # number of CPU cores"},{"path":"/articles/domino2.html","id":"aucell-calculate-tf-activity-scores","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > SCENIC Analysis","what":"aucell: calculate TF activity scores","title":"Get Started with domino2","text":"Enrichment regulon measured Area recovery Curve (AUC) genes define regulon.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic aucell \\ \"../data/pbmc3k_counts.loom\" \\ \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ -o \"${SCENIC_DIR}/pbmc_auc.csv\" # Arguments: # counts matrix loom file # regulon table output from ctx # cell x TF matrix of TF enrichment AUC values"},{"path":[]},{"path":"/articles/domino2.html","id":"loading-scenic-results","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Building a Signaling Network with domino2","what":"Loading SCENIC Results","title":"Get Started with domino2","text":"TF activities required input domino2, regulons learned SCENIC important optional input needed annotate TF-target interactions prune TF-receptor linkages receptor target TF. prevents distinction receptor expression driving TF activity TF inducing receptor’s expression. initial regulons data frame read R ctx function 2 rows column names need replaced one succinct description. domino2 changed input format TF regulons list storing vectors target genes regulon, names list TF genes. facilitates use alternative methods TF activity quantification. provide helper function, create_regulon_list_scenic() easy retrieval TF regulons output pySCENIC ctx function. Users aware AUC matrix SCENIC loaded cell x TF orientation transposed TF x cell orientation. pySCENIC also appends “(+)” TF names converted “…” upon loading R. characters can included without affecting results domino2 analysis, can confusing querying TF features data. recommend comprehensive removal “…” characters using gsub() function.","code":"regulons <- read.csv(paste0(scenic_dir, \"/regulons_pbmc_3k.csv\")) auc <- read.table(paste0(scenic_dir, \"/auc_pbmc_3k.csv\"), header = TRUE, row.names = 1, stringsAsFactors = FALSE, sep = \",\") regulons <- regulons[-1:-2, ] colnames(regulons) <- c(\"TF\", \"MotifID\", \"AUC\", \"NES\", \"MotifSimilarityQvalue\", \"OrthologousIdentity\", \"Annotation\", \"Context\", \"TargetGenes\", \"RankAtMax\") regulon_list <- create_regulon_list_scenic(regulons = regulons) auc_in <- as.data.frame(t(auc)) # Remove pattern '...' from the end of all rownames: rownames(auc_in) <- gsub(\"\\\\.\\\\.\\\\.$\", \"\", rownames(auc_in))"},{"path":"/articles/domino2.html","id":"load-cellphonedb-database","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Building a Signaling Network with domino2","what":"Load CellPhoneDB Database","title":"Get Started with domino2","text":"domino2 updated read ligand-receptor data bases uniform data.frame format referred receptor-ligand map (rl_map) enable use alternative updated reference databases opposed particular version CellPhoneDB’s database older versions Domino. row corresponds ligand-receptor interaction. Genes participating interaction referred “partner ” “partner B” without requirement fixed ordering whether B ligand vice versa. minimum required columns data frame : int_pair: names interacting ligand receptor separated \" & \" gene_A: gene genes encoding partner gene_B: gene genes encoding partner B type_A: (“L”, “R”) - indicates whether partner ligand (“L”) receptor (“R”) type_B: (“L”, “R”) - indicates whether partner B ligand (“L”) receptor (“R”) Additional annotation columns can provided name_A name_B ligands receptors whose name interaction database match names encoding genes. formatting also allows consideration ligand receptor complexes comprised heteromeric combination multiple proteins must co-expressed function. cases, “name_*” column shows name protein complex, “gene_*” column shows names genes encoding components complex separated commas “,”. plotting results build domino object, names interacting ligands receptors used based combinatorial expression complex components. facilitate use formatting CellPhoneDB database, include helper function, create_rl_map_cellphonedb(), automatically parses files cellPhoneDB database arrive rl_map format.","code":"complexes <- read.csv(paste0(cellphone_dir, \"/cellphonedb-data-4.0.0/data/complex_input.csv\"), stringsAsFactors = FALSE) genes <- read.csv(paste0(cellphone_dir, \"/cellphonedb-data-4.0.0/data/gene_input.csv\"), stringsAsFactors = FALSE) interactions <- read.csv(paste0(cellphone_dir, \"/cellphonedb-data-4.0.0/data/interaction_input.csv\"), stringsAsFactors = FALSE) proteins <- read.csv(paste0(cellphone_dir, \"/cellphonedb-data-4.0.0/data/protein_input.csv\"), stringsAsFactors = FALSE) rl_map <- create_rl_map_cellphonedb(genes = genes, proteins = proteins, interactions = interactions, complexes = complexes, database_name = \"CellPhoneDB_v4.0\" # database version used ) knitr::kable(head(rl_map))"},{"path":"/articles/domino2.html","id":"optional-adding-interactions-manually","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Building a Signaling Network with domino2 > Load CellPhoneDB Database","what":"Optional: Adding interactions manually","title":"Get Started with domino2","text":"change use rl_map formatting also enables users manually append interactions interest included interaction database need . can attained formatting desired interactions data.frame column headers rl_map using rbind() function.","code":"# Integrin complexes are not annotated as receptors in CellPhoneDB_v4.0 # collagen-integrin interactions between cells may be missed unless tables from # the CellPhoneDB reference are edited or the interactions are manually added col_int_df <- data.frame(int_pair = \"a11b1 complex & COLA1_HUMAN\", name_A = \"a11b1 complex\", uniprot_A = \"P05556,Q9UKX5\", gene_A = \"ITB1,ITA11\", type_A = \"R\", name_B = \"COLA1_HUMAN\", uniprot_B = \"P02452,P08123\", gene_B = \"COL1A1,COL1A2\", type_B = \"L\", annotation_strategy = \"manual\", source = \"manual\", database_name = \"manual\") rl_map_append <- rbind(col_int_df, rl_map) knitr::kable(head(rl_map_append))"},{"path":"/articles/domino2.html","id":"creating-the-domino-object","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference","what":"Creating the Domino Object","title":"Get Started with domino2","text":"domino2 analysis takes place two steps. 1. create_domino() initializes domino result object assesses differential TF activity across cell clusters wilcoxon rank-sum test establishes TF-receptor linkages based Spearman correlation TF activities receptor expression across queried data set. build_domino() sets parameters TFs receptors called active within cell cluster aggregates scaled expression ligands capable interacting active receptors assessment ligand type cellular source triggering activation receptor.","code":""},{"path":"/articles/domino2.html","id":"required-inputs-from-data-set","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Creating the Domino Object","what":"Required inputs from data set","title":"Get Started with domino2","text":"domino2 infers active receipt signals via receptors based correlation receptor’s expression TF activity across data set differential activity TF within cell cluster. Correlations conducted using scaled expression values rather raw counts normalized counts. assessment receptor activity per cell type basis, named vector cell cluster assignments, names cell barcodes matching expression matrix, provided. Assessing signaling based categorical groupings cells can achieved passing groupings “clusters” build_domino() place cell types. domino2 accepts either Seurat object counts, scaled counts, clusters included, requires matrix counts, matrix scaled counts, named vector cell cluster labels factors. Shown extract elements Seurat object. Note: Ligand receptor expression can assessed genes included z_scores matrix. Many scRNAseq analysis pipelines recommend storing genes high variance scaled expression slots data objects, thereby missing many genes encoding ligands receptors. Ensure genes interest included rows z_scores matrix. Scaled expression calculated genes PBMC data set removal genes expressed less 3 cells.","code":"counts <- GetAssayData(object = pbmc, slot = \"counts\") z_scores <- as.matrix(GetAssayData(object = pbmc, slot = \"scale.data\")) clusters <- pbmc$cell_type"},{"path":"/articles/domino2.html","id":"create-domino-object","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Creating the Domino Object","what":"Create Domino object","title":"Get Started with domino2","text":"point, create_domino() function can used make object. Parameters note include “use_clusters” required assess signaling cell types rather linkage TFs receptors broadly across data set. “use_complexes” decides receptors function heteromeric complexes considered testing linkages TFs receptors. TRUE, receptor complex linked TF majority component genes meet Spearman correlation threshold. “remove_rec_dropout” decides whether receptor values 0 considered correlation calculations; measure intended reduce effect dropout receptors low expression. run create_domino() matrix vector inputs: results equivalent using Seurat object directly. Note inclusion matrix inputs Seurat object prioritize Seurat object. information stored domino object access , please see vignette structure domino objects.","code":"pbmc_dom <- create_domino(rl_map = rl_map, features = auc_in, counts = counts, z_scores = z_scores, clusters = clusters, tf_targets = regulon_list, use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE) # rl_map: receptor-ligand map data frame features: TF scores (AUC matrix) # counts: counts matrix z_scores: scaled expression data clusters: named vector # of cell cluster assignments tf_targets: list of TFs and their regulons # use_clusters: assess receptor activation and ligand expression on a # per-cluster basis use_complexes: include receptors and genes that function as # a complex in results remove_rec_dropout: whether to remove zeroes from # correlation calculations pbmc_dom <- create_domino(rl_map = rl_map, features = auc_in, ser = pbmc, tf_targets = regulon_list, use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE)"},{"path":"/articles/domino2.html","id":"build-domino","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Creating the Domino Object","what":"Build Domino","title":"Get Started with domino2","text":"build_domino() finalizes construction domino object setting parameters identifying TFs differential activation clusters, receptor linkage TFs based magnitude positive correlation, minimum percentage cells within cluster expression receptor receptor called active. also options thresholds number TFs may called active cluster number receptors may linked one TF. thresholds n TFs m receptors, bottom n TFs lowest p-values wilcoxon rank sum test top m receptors Spearman correlation coefficient chosen. thresholds number receptors TFs can sent infinity (Inf) collect receptors TFs meet statistical significance thresholds.","code":"pbmc_dom <- build_domino(dom = pbmc_dom, min_tf_pval = 0.001, max_tf_per_clust = 25, max_rec_per_tf = 25, rec_tf_cor_threshold = 0.25, min_rec_percentage = 0.1) # min_tf_pval: Threshold for p-value of DE for TFs rec_tf_cor_threshold: # Minimum correlation between receptor and TF min_rec_percentage: Minimum # percent of cells that must express receptor pbmc_dom_all <- build_domino(dom = pbmc_dom, min_tf_pval = 0.001, max_tf_per_clust = Inf, max_rec_per_tf = Inf, rec_tf_cor_threshold = 0.25, min_rec_percentage = 0.1)"},{"path":"/articles/domino2.html","id":"visualization-of-domino-results","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference","what":"Visualization of Domino Results","title":"Get Started with domino2","text":"Multiple functions available visualize intracellular networks receptors TFs ligand-receptor mediated intercellular networks cell types.","code":""},{"path":"/articles/domino2.html","id":"summarize-tf-activity-and-linkage","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Visualization of Domino Results","what":"Summarize TF Activity and Linkage","title":"Get Started with domino2","text":"Enrichment TF activities cell types can visualized feat_heatmap() plots data set-wide TF activity scores heatmap.","code":"feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE, use_raster = FALSE)"},{"path":"/articles/domino2.html","id":"cumulative-signaling-between-cell-types","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Visualization of Domino Results","what":"Cumulative signaling between cell types","title":"Get Started with domino2","text":"cumulative degree signaling clusters assessed sum scaled expression ligands targeting active receptors another cluster. can visualized graph format using signaling_network() function. Nodes represent cell cluster edges scale magnitude signaling clusters. color edge corresponds sender cluster signal. Signaling networks can also drawn edges rendering signals directed towards given cell type signals one cell type directed others. see options use, well plotting functions options, please see plotting vignette.","code":"signaling_network(pbmc_dom, edge_weight = 1, max_thresh = 5)"},{"path":"/articles/domino2.html","id":"specific-signaling-interactions-between-clusters","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference > Visualization of Domino Results","what":"Specific Signaling Interactions between Clusters","title":"Get Started with domino2","text":"Beyond aggregated degree signaling cell types, degrees signaling specific ligand-receptor interactions can assessed. gene_network() provides graph linkages active TFs cluster, linked receptors cluster, possible ligands active receptors. New domino2, gene_network() can used two clusters determine possible ligands given receptor expressed putative outgoing signaling cluster. comprehensive assessment ligand expression targeting active receptors given cluster can assessed incoming_signaling_heatmap(). Another form comprehensive ligand expression assessment available individual active receptors form circos plots new domino2. outer arcs correspond clusters domino object inner arcs representing possible ligand plotted receptor. Arcs drawn ligands cell type receptor ligand expressed specified threshold. Arc widths correspond mean express ligand cluster widest arc width scaling maximum expression ligand within data.","code":"gene_network(pbmc_dom, clust = \"dendritic_cell\", layout = \"grid\") gene_network(pbmc_dom, clust = \"dendritic_cell\", OutgoingSignalingClust = \"CD14_monocyte\", layout = \"grid\") incoming_signaling_heatmap(pbmc_dom, rec_clust = \"dendritic_cell\", max_thresh = 2.5, use_raster = FALSE) circos_ligand_receptor(pbmc_dom, receptor = \"CD74\")"},{"path":"/articles/domino2.html","id":"continued-development","dir":"Articles","previous_headings":"Using domino2 v0.2.2 for cell-cell communication inference","what":"Continued Development","title":"Get Started with domino2","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, put together information plotting domino object structure like explore package’s functionality. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-12-13\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> 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/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] grid stats graphics grDevices utils datasets methods #> [8] base #> #> other attached packages: #> [1] knitr_1.45 ComplexHeatmap_2.14.0 circlize_0.4.15 #> [4] plyr_1.8.9 Seurat_5.0.1 SeuratObject_5.0.1 #> [7] sp_2.1-1 domino2_0.2.2 #> #> loaded via a namespace (and not attached): #> [1] utf8_1.2.4 spatstat.explore_3.2-5 reticulate_1.34.0 #> [4] tidyselect_1.2.0 RSQLite_2.3.3 AnnotationDbi_1.60.2 #> [7] htmlwidgets_1.6.2 Rtsne_0.16 munsell_0.5.0 #> [10] codetools_0.2-19 ragg_1.2.6 ica_1.0-3 #> [13] future_1.33.0 miniUI_0.1.1.1 spatstat.random_3.2-1 #> [16] colorspace_2.1-0 progressr_0.14.0 Biobase_2.58.0 #> [19] filelock_1.0.2 highr_0.10 stats4_4.2.1 #> [22] ROCR_1.0-11 tensor_1.5 ggsignif_0.6.4 #> [25] listenv_0.9.0 GenomeInfoDbData_1.2.9 polyclip_1.10-6 #> [28] bit64_4.0.5 rprojroot_2.0.4 parallelly_1.36.0 #> [31] vctrs_0.6.4 generics_0.1.3 xfun_0.41 #> [34] BiocFileCache_2.6.1 R6_2.5.1 doParallel_1.0.17 #> [37] GenomeInfoDb_1.34.9 clue_0.3-65 bitops_1.0-7 #> [40] spatstat.utils_3.0-4 cachem_1.0.8 promises_1.2.1 #> [43] scales_1.3.0 gtable_0.3.4 Cairo_1.6-1 #> [46] globals_0.16.2 goftest_1.2-3 spam_2.10-0 #> [49] rlang_1.1.2 systemfonts_1.0.5 GlobalOptions_0.1.2 #> [52] splines_4.2.1 rstatix_0.7.2 lazyeval_0.2.2 #> [55] spatstat.geom_3.2-7 broom_1.0.5 yaml_2.3.7 #> [58] reshape2_1.4.4 abind_1.4-5 backports_1.4.1 #> [61] httpuv_1.6.12 tools_4.2.1 ggplot2_3.4.4 #> [64] ellipsis_0.3.2 jquerylib_0.1.4 RColorBrewer_1.1-3 #> [67] BiocGenerics_0.44.0 ggridges_0.5.4 Rcpp_1.0.11 #> [70] progress_1.2.2 zlibbioc_1.44.0 purrr_1.0.2 #> [73] RCurl_1.98-1.13 prettyunits_1.2.0 deldir_1.0-9 #> [76] ggpubr_0.6.0 pbapply_1.7-2 GetoptLong_1.0.5 #> [79] cowplot_1.1.1 S4Vectors_0.36.2 zoo_1.8-12 #> [82] ggrepel_0.9.4 cluster_2.1.4 fs_1.6.3 #> [85] magrittr_2.0.3 magick_2.8.1 data.table_1.14.8 #> [88] RSpectra_0.16-1 scattermore_1.2 lmtest_0.9-40 #> [91] RANN_2.6.1 fitdistrplus_1.1-11 matrixStats_1.1.0 #> [94] hms_1.1.3 patchwork_1.1.3 mime_0.12 #> [97] evaluate_0.23 xtable_1.8-4 XML_3.99-0.16 #> [100] fastDummies_1.7.3 IRanges_2.32.0 gridExtra_2.3 #> [103] shape_1.4.6 compiler_4.2.1 biomaRt_2.54.1 #> [106] tibble_3.2.1 KernSmooth_2.23-22 crayon_1.5.2 #> [109] htmltools_0.5.7 later_1.3.1 tidyr_1.3.0 #> [112] DBI_1.1.3 formatR_1.14 dbplyr_2.4.0 #> [115] MASS_7.3-60 rappdirs_0.3.3 Matrix_1.6-3 #> [118] car_3.1-2 cli_3.6.1 parallel_4.2.1 #> [121] dotCall64_1.1-0 igraph_1.5.1 pkgconfig_2.0.3 #> [124] pkgdown_2.0.7 plotly_4.10.3 spatstat.sparse_3.0-3 #> [127] xml2_1.3.5 foreach_1.5.2 bslib_0.5.1 #> [130] XVector_0.38.0 stringr_1.5.1 digest_0.6.33 #> [133] sctransform_0.4.1 RcppAnnoy_0.0.21 spatstat.data_3.0-3 #> [136] Biostrings_2.66.0 rmarkdown_2.25 leiden_0.4.3.1 #> [139] uwot_0.1.16 curl_5.1.0 shiny_1.8.0 #> [142] rjson_0.2.21 nlme_3.1-163 lifecycle_1.0.4 #> [145] jsonlite_1.8.7 carData_3.0-5 desc_1.4.2 #> [148] viridisLite_0.4.2 fansi_1.0.5 pillar_1.9.0 #> [151] lattice_0.22-5 KEGGREST_1.38.0 fastmap_1.1.1 #> [154] httr_1.4.7 survival_3.5-7 glue_1.6.2 #> [157] png_0.1-8 iterators_1.0.14 bit_4.0.5 #> [160] stringi_1.8.2 sass_0.4.7 blob_1.2.4 #> [163] textshaping_0.3.7 RcppHNSW_0.5.0 memoise_2.0.1 #> [166] dplyr_1.1.4 irlba_2.3.5.1 future.apply_1.11.0"},{"path":"/articles/domino_object_vignette.html","id":"the-new-domino-object-structure","dir":"Articles","previous_headings":"","what":"The new domino object structure","title":"Interacting with domino2 Objects","text":"order better implement changes made domino2, structure domino object modified. , describe data stored domino object, well best access data.","code":""},{"path":"/articles/domino_object_vignette.html","id":"object-contents","dir":"Articles","previous_headings":"The new domino object structure","what":"Object contents","title":"Interacting with domino2 Objects","text":"contents domino object class include broad groups: - input data, L-R database used, counts, z-scores - calculations, correlations differential expression results - linkages, show connections TFs, receptors, ligands across data set within clusters - signaling matrices, show expression ligands signaling active receptors clusters (summary overall signaling) - build information, includes parameters used build object build_domino() functions commonly accessed information (number cells, clusters, build information), show print methods domino objects can used.","code":"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"},{"path":"/articles/domino_object_vignette.html","id":"access-functions","dir":"Articles","previous_headings":"The new domino object structure","what":"Access functions","title":"Interacting with domino2 Objects","text":"order facilitate access information stored domino object, provided collection functions retrieve specific items. functions begin “dom_” can listed using ls().","code":"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\""},{"path":"/articles/domino_object_vignette.html","id":"input-data","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Input data","title":"Interacting with domino2 Objects","text":"creating domino object create_domino() function, several inputs required stored domino object . include cluster labels, counts matrix, z-scored counts matrix, transcription factor activation scores, R-L database used create_rl_map_cellphonedb(). example, access cluster names domino object: Setting argument labels = TRUE return vector cluster labels cell rather unique cluster names. access counts: z-scored counts: transcription factor activation scores can similarly accessed: Information database referenced ligand-receptor pairs composition protien complexes can extracted dom_database() function. default, function returns name(s) database(s) used: like view entire ligand-receptor map, set name_only = FALSE:","code":"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\" count_matrix <- dom_counts(dom) knitr::kable(count_matrix[1:5, 1:5]) z_matrix <- dom_zscores(dom) knitr::kable(z_matrix[1:5, 1:5]) activation_matrix <- dom_tf_activation(dom) knitr::kable(activation_matrix[1:5, 1:5]) dom_database(dom) #> [1] \"CellPhoneDB_v4.0\" db_matrix <- dom_database(dom, name_only = FALSE) knitr::kable(db_matrix[1:5, 1:5])"},{"path":"/articles/domino_object_vignette.html","id":"calculations","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Calculations","title":"Interacting with domino2 Objects","text":"Active transcription factors cluster determined conducting wilcoxon rank sum tests transcription factor transcription factor activity scores amongst cells cluster tested activity scores cells outside cluster. p-values one-sided test greater activity within cluster compared outside can accessed dom_de() function. Linkage receptors transcription factors assessed Spearman correlation transcription factor activity scores scaled expression receptor-encoding genes across cells data set. Spearman coefficients can accessed dom_correlations() function.","code":"de_matrix <- dom_de(dom) knitr::kable(de_matrix[1:5, 1:5]) cor_matrix <- dom_correlations(dom) knitr::kable(cor_matrix[1:5, 1:5])"},{"path":"/articles/domino_object_vignette.html","id":"linkages","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Linkages","title":"Interacting with domino2 Objects","text":"Linkages ligands, receptors, transcription factors can accessed several different ways, depending specific link scope desired. dom_linkages() function three arguments - first, like access functions, domino object. second, link_type, used specify linkages desired (options complexes, receptor-ligand, tf-target, tf-receptor). third argument, by_cluster, determines whether linkages returned arranged cluster (though change available linkage types tf-receptor, receptor, incoming-ligand). example, access complexes used across dataset: view incoming ligands cluster: , reason, find need entire linkage structure (recommended), can accessed slot name; domino objects S4 objects. Alternately, obtain simplified list receptors, ligands, /features domino object, use dom_network_items() function. pull transcription factors associated dendritic cell cluster:","code":"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)\" 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\" 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\" dc_tfs <- dom_network_items(dom, \"dendritic_cell\", return = \"features\") head(dc_tfs) #> [1] \"ZNF189\" \"KLF12\" \"ETV7\" \"IRF8\" \"KLF6\" \"FOS\""},{"path":"/articles/domino_object_vignette.html","id":"signaling-matrices","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Signaling Matrices","title":"Interacting with domino2 Objects","text":"averaged z-scored expression ligands receptors different clusters can accessed matrix form. view signaling specific cluster clusters, set cluster argument cluster name.","code":"signal_matrix <- dom_signaling(dom) knitr::kable(signal_matrix) dc_matrix <- dom_signaling(dom, \"dendritic_cell\") knitr::kable(dc_matrix)"},{"path":"/articles/domino_object_vignette.html","id":"build-information","dir":"Articles","previous_headings":"The new domino object structure > Access functions","what":"Build information","title":"Interacting with domino2 Objects","text":"keep track options set running build_domino(), stored within domino object . view options, use dom_info() function.","code":"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"},{"path":"/articles/domino_object_vignette.html","id":"continued-development","dir":"Articles","previous_headings":"The new domino object structure","what":"Continued Development","title":"Interacting with domino2 Objects","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, put together information plotting example analysis can viewed Getting Started page. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-12-13\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> 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/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] domino2_0.2.2 #> #> loaded via a namespace (and not attached): #> [1] bitops_1.0-7 matrixStats_1.1.0 fs_1.6.3 #> [4] bit64_4.0.5 filelock_1.0.2 doParallel_1.0.17 #> [7] RColorBrewer_1.1-3 progress_1.2.2 httr_1.4.7 #> [10] rprojroot_2.0.4 GenomeInfoDb_1.34.9 R.cache_0.16.0 #> [13] backports_1.4.1 tools_4.2.1 bslib_0.5.1 #> [16] utf8_1.2.4 R6_2.5.1 DBI_1.1.3 #> [19] BiocGenerics_0.44.0 colorspace_2.1-0 GetoptLong_1.0.5 #> [22] tidyselect_1.2.0 prettyunits_1.2.0 bit_4.0.5 #> [25] curl_5.1.0 compiler_4.2.1 textshaping_0.3.7 #> [28] cli_3.6.1 Biobase_2.58.0 xml2_1.3.5 #> [31] desc_1.4.2 sass_0.4.7 scales_1.3.0 #> [34] rappdirs_0.3.3 pkgdown_2.0.7 systemfonts_1.0.5 #> [37] stringr_1.5.1 digest_0.6.33 rmarkdown_2.25 #> [40] R.utils_2.12.3 XVector_0.38.0 pkgconfig_2.0.3 #> [43] htmltools_0.5.7 styler_1.10.2 dbplyr_2.4.0 #> [46] fastmap_1.1.1 rlang_1.1.2 GlobalOptions_0.1.2 #> [49] RSQLite_2.3.3 shape_1.4.6 jquerylib_0.1.4 #> [52] generics_0.1.3 jsonlite_1.8.7 car_3.1-2 #> [55] dplyr_1.1.4 R.oo_1.25.0 RCurl_1.98-1.13 #> [58] magrittr_2.0.3 GenomeInfoDbData_1.2.9 Matrix_1.6-3 #> [61] munsell_0.5.0 Rcpp_1.0.11 S4Vectors_0.36.2 #> [64] fansi_1.0.5 abind_1.4-5 lifecycle_1.0.4 #> [67] R.methodsS3_1.8.2 stringi_1.8.2 yaml_2.3.7 #> [70] carData_3.0-5 zlibbioc_1.44.0 plyr_1.8.9 #> [73] BiocFileCache_2.6.1 grid_4.2.1 blob_1.2.4 #> [76] parallel_4.2.1 crayon_1.5.2 lattice_0.22-5 #> [79] Biostrings_2.66.0 circlize_0.4.15 hms_1.1.3 #> [82] KEGGREST_1.38.0 knitr_1.45 ComplexHeatmap_2.14.0 #> [85] pillar_1.9.0 igraph_1.5.1 ggpubr_0.6.0 #> [88] rjson_0.2.21 ggsignif_0.6.4 codetools_0.2-19 #> [91] biomaRt_2.54.1 stats4_4.2.1 XML_3.99-0.16 #> [94] glue_1.6.2 evaluate_0.23 png_0.1-8 #> [97] vctrs_0.6.4 foreach_1.5.2 tidyr_1.3.0 #> [100] gtable_0.3.4 purrr_1.0.2 clue_0.3-65 #> [103] ggplot2_3.4.4 cachem_1.0.8 xfun_0.41 #> [106] broom_1.0.5 rstatix_0.7.2 ragg_1.2.6 #> [109] tibble_3.2.1 iterators_1.0.14 AnnotationDbi_1.60.2 #> [112] memoise_2.0.1 IRanges_2.32.0 cluster_2.1.4"},{"path":"/articles/plotting_vignette.html","id":"visualizing-domino2-data","dir":"Articles","previous_headings":"","what":"Visualizing domino2 data","title":"Plotting Functions and Options","text":"addition numerous plotting options available original Domino, domino2 added functionality new methods improve visualization interpretation analysis results. , go different plotting functions available, well different options can utilized, options customization. using domino object (loaded dom) example analysis Getting Started.","code":""},{"path":"/articles/plotting_vignette.html","id":"loading-example-domino-data","dir":"Articles","previous_headings":"Visualizing domino2 data","what":"Loading example domino data","title":"Plotting Functions and Options","text":"","code":"data_url <- \"https://zenodo.org/records/10222767/files\" temp_dir <- tempdir() download.file(url = paste0(data_url, \"/pbmc_domino_built.rds\"), destfile = paste0(temp_dir, \"/pbmc_domino_built.rds\")) dom <- readRDS(paste0(temp_dir, \"/pbmc_domino_built.rds\"))"},{"path":[]},{"path":"/articles/plotting_vignette.html","id":"correlations-between-receptors-and-transcription-factors","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Correlations between receptors and transcription factors","title":"Plotting Functions and Options","text":"cor_heatmap() can used show correlations calculated receptors transcription factors. addition displaying scores correlations, function can also used identify correlations certain value (using bool bool_thresh arguments) identify combinations receptors transcription factors (TFs) connected (argument mark_connections). subset receptors transcription factors interest, vector either () can passed function. heatmap functions domino2 based ComplexHeatmap::Heatmap() also accept additional arguments meant function. example, argument clustering rows columns heatmap explicitly stated, can still passed ComplexHeatmap::Heatmap() cor_heatmap().","code":"cor_heatmap(dom, title = \"PBMC R-TF Correlations\") cor_heatmap(dom, bool = TRUE, bool_thresh = 0.25) cor_heatmap(dom, bool = FALSE, mark_connections = TRUE) receptors <- c(\"CSF1R\", \"CSF3R\", \"CCR7\", \"FCER2\") tfs <- c(\"PAX5\", \"JUNB\", \"FOXJ3\", \"FOSB\") cor_heatmap(dom, feats = tfs, recs = receptors) cor_heatmap(dom, cluster_rows = FALSE, cluster_columns = FALSE, column_title = \"Heatmap Without Clustering\")"},{"path":"/articles/plotting_vignette.html","id":"heatmap-of-transcription-factor-activation-scores","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Heatmap of Transcription Factor Activation Scores","title":"Plotting Functions and Options","text":"feat_heatmap() used show transcription factor activation features signaling network. functions similarly cor_heatmap(), arguments select specific vector features, use boolean view threshold, pass arguments NMF::aheatmap(). Specific function though arguments setting range values visualized one choose whether normalize scores max value.","code":"feat_heatmap(dom, use_raster = FALSE) 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)"},{"path":"/articles/plotting_vignette.html","id":"heatmap-of-incoming-signaling-for-a-cluster","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Heatmap of Incoming Signaling for a Cluster","title":"Plotting Functions and Options","text":"incoming_signaling_heatmap() can used visualize cluster average expression ligands capable activating TFs enriched cluster. example, view incoming signaling CD8 T cells: can also select specific clusters interest signaling CD8 T cells. interested viewing monocyte signaling: heatmap functions, options available minimum threshold, maximum threshold, whether scale values thresholding, whether normalize matrix, ability pass arguments NMF::aheatmap().","code":"incoming_signaling_heatmap(dom, \"CD8_T_cell\") incoming_signaling_heatmap(dom, \"CD8_T_cell\", clusts = c(\"CD14_monocyte\", \"CD16_monocyte\"))"},{"path":"/articles/plotting_vignette.html","id":"heatmap-of-signaling-between-clusters","dir":"Articles","previous_headings":"Visualizing domino2 data > Heatmaps","what":"Heatmap of Signaling Between Clusters","title":"Plotting Functions and Options","text":"signaling_heatmap() makes heatmap showing signaling strength ligands cluster receptors cluster based averaged expression. functions, specific clusters can selected, thresholds can set, normalization methods can selected well.","code":"signaling_heatmap(dom) signaling_heatmap(dom, scale = \"sqrt\") signaling_heatmap(dom, normalize = \"rec_norm\")"},{"path":[]},{"path":"/articles/plotting_vignette.html","id":"network-showing-l-r-tf-signaling-between-clusters","dir":"Articles","previous_headings":"Visualizing domino2 data > Network Plots","what":"Network showing L-R-TF signaling between clusters","title":"Plotting Functions and Options","text":"gene_network() makes network plot display signaling selected clusters ligands, receptors features associated clusters displayed nodes edges linkages. look signaling CD16 Monocytes CD14 Monocytes: Options modify plot include adjusting scaling ligands different layouts (legible others). Additionally, colors can given select genes (example, highlight specific signaling path).","code":"gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\") gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", lig_scale = 25, layout = \"sphere\") gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", cols = c(CD1D = \"violet\", LILRB2 = \"violet\", FOSB = \"violet\"), lig_scale = 10)"},{"path":"/articles/plotting_vignette.html","id":"network-showing-interaction-strength-across-data","dir":"Articles","previous_headings":"Visualizing domino2 data > Network Plots","what":"Network Showing Interaction Strength Across Data","title":"Plotting Functions and Options","text":"signaling_network() can used create network plot nodes clusters edges indicate signaling one cluster another. addition changes scaling, thresholds, layouts, plot can modified selecting incoming outgoing clusters (!). example view signaling CD14 Monocytes cluster:","code":"signaling_network(dom) signaling_network(dom, showOutgoingSignalingClusts = \"CD14_monocyte\", scale = \"none\", norm = \"none\", layout = \"fr\", scale_by = \"none\", vert_scale = 5)"},{"path":[]},{"path":"/articles/plotting_vignette.html","id":"chord-diagrams-connecting-ligands-and-receptors","dir":"Articles","previous_headings":"Visualizing domino2 data > Other Types of Plot","what":"Chord Diagrams Connecting Ligands and Receptors","title":"Plotting Functions and Options","text":"new addition domino2, circos_ligand_receptor() creates chord plot showing ligands can activate specific receptor, displaying mean cluster expression ligand width chord. function can given cluster colors match plots may make data. addition, plot can adjusted changing threshold ligand expression required linkage visualized selecting clusters interest.","code":"circos_ligand_receptor(dom, receptor = \"CD74\") 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)"},{"path":"/articles/plotting_vignette.html","id":"scatter-plot-to-visualize-correlation","dir":"Articles","previous_headings":"Visualizing domino2 data > Other Types of Plot","what":"Scatter Plot to Visualize Correlation","title":"Plotting Functions and Options","text":"cor_scatter() can used plot cell based expression selected TF receptor. produces scatter plot well line best fit look receptor-TF correlation. keep mind argument remove_rec_dropout match parameter used domino object built. case, use build parameter, leave value argument default value FALSE.","code":"cor_scatter(dom, \"FOSB\", \"CD74\")"},{"path":"/articles/plotting_vignette.html","id":"continued-development","dir":"Articles","previous_headings":"Visualizing domino2 data","what":"Continued Development","title":"Plotting Functions and Options","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, view example analysis, see Getting Started page, see domino object structure page get familiar object structure. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-12-13\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> 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/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: #> [1] patchwork_1.1.3 domino2_0.2.2 #> #> loaded via a namespace (and not attached): #> [1] colorspace_2.1-0 ggsignif_0.6.4 rjson_0.2.21 #> [4] rprojroot_2.0.4 circlize_0.4.15 XVector_0.38.0 #> [7] GlobalOptions_0.1.2 fs_1.6.3 clue_0.3-65 #> [10] ggpubr_0.6.0 farver_2.1.1 bit64_4.0.5 #> [13] AnnotationDbi_1.60.2 fansi_1.0.5 xml2_1.3.5 #> [16] codetools_0.2-19 splines_4.2.1 doParallel_1.0.17 #> [19] cachem_1.0.8 knitr_1.45 jsonlite_1.8.7 #> [22] Cairo_1.6-1 broom_1.0.5 cluster_2.1.4 #> [25] dbplyr_2.4.0 png_0.1-8 compiler_4.2.1 #> [28] httr_1.4.7 backports_1.4.1 Matrix_1.6-3 #> [31] fastmap_1.1.1 cli_3.6.1 formatR_1.14 #> [34] htmltools_0.5.7 prettyunits_1.2.0 tools_4.2.1 #> [37] igraph_1.5.1 gtable_0.3.4 glue_1.6.2 #> [40] GenomeInfoDbData_1.2.9 dplyr_1.1.4 rappdirs_0.3.3 #> [43] Rcpp_1.0.11 carData_3.0-5 Biobase_2.58.0 #> [46] jquerylib_0.1.4 pkgdown_2.0.7 vctrs_0.6.4 #> [49] Biostrings_2.66.0 nlme_3.1-163 iterators_1.0.14 #> [52] xfun_0.41 stringr_1.5.1 lifecycle_1.0.4 #> [55] rstatix_0.7.2 XML_3.99-0.16 zlibbioc_1.44.0 #> [58] scales_1.3.0 ragg_1.2.6 hms_1.1.3 #> [61] parallel_4.2.1 RColorBrewer_1.1-3 ComplexHeatmap_2.14.0 #> [64] yaml_2.3.7 curl_5.1.0 memoise_2.0.1 #> [67] ggplot2_3.4.4 sass_0.4.7 biomaRt_2.54.1 #> [70] stringi_1.8.2 RSQLite_2.3.3 highr_0.10 #> [73] S4Vectors_0.36.2 desc_1.4.2 foreach_1.5.2 #> [76] BiocGenerics_0.44.0 filelock_1.0.2 shape_1.4.6 #> [79] GenomeInfoDb_1.34.9 rlang_1.1.2 pkgconfig_2.0.3 #> [82] systemfonts_1.0.5 matrixStats_1.1.0 bitops_1.0-7 #> [85] evaluate_0.23 lattice_0.22-5 purrr_1.0.2 #> [88] labeling_0.4.3 bit_4.0.5 tidyselect_1.2.0 #> [91] plyr_1.8.9 magrittr_2.0.3 R6_2.5.1 #> [94] IRanges_2.32.0 magick_2.8.1 generics_0.1.3 #> [97] DBI_1.1.3 pillar_1.9.0 withr_2.5.2 #> [100] mgcv_1.9-0 KEGGREST_1.38.0 abind_1.4-5 #> [103] RCurl_1.98-1.13 tibble_3.2.1 crayon_1.5.2 #> [106] car_3.1-2 utf8_1.2.4 BiocFileCache_2.6.1 #> [109] rmarkdown_2.25 GetoptLong_1.0.5 progress_1.2.2 #> [112] grid_4.2.1 blob_1.2.4 digest_0.6.33 #> [115] tidyr_1.3.0 textshaping_0.3.7 stats4_4.2.1 #> [118] munsell_0.5.0 bslib_0.5.1"},{"path":[]},{"path":"/articles/vignette.html","id":"preprocessing-scrnaseq-data","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Preprocessing scRNAseq data","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 tool analysis intra- intercellular signaling single cell RNA sequencing data based transcription factor activation. vignette intended demonstrate basic pipeline generating communication networks domino object using single cell RNA sequencing(scRNAseq) data. Analysis cell-cell communication (CCC) Domino2 often follows initial pre-processing annotation scRNAseq data. vignette demonstrate use Domino2 10X Genomics Peripheral Blood Mononuclear Cells (PBMC) data set 2,700 cells processed following Satija Lab’s Seurat tutorial. data can downloaded .","code":"# Preprocessing of PBMC 3K tutorial data set pbmc.data <- Read10X(data.dir = \"../data/pbmc3k_filtered_gene_bc_matrices\") pbmc <- CreateSeuratObject(counts = pbmc.data, project = \"pbmc3k\", min.cells = 3, min.features = 200) pbmc[[\"percent.mt\"]] <- PercentageFeatureSet(pbmc, pattern = \"^MT-\") pbmc <- NormalizeData(pbmc, normalization.method = \"LogNormalize\", scale.factor = 10000) pbmc <- FindVariableFeatures(pbmc, selection.method = \"vst\", nfeatures = 2000) pbmc <- ScaleData(pbmc, features = rownames(pbmc)) pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc)) pbmc <- FindNeighbors(pbmc, dims = 1:10) pbmc <- FindClusters(pbmc, resolution = 0.5) pbmc <- RunUMAP(pbmc, dims = 1:10) # Annotate clusters with cell phenotypes cell_dict <- data.frame( cluster = c(0:8), cell_type = c(\"naive_CD4_T_cell\", \"CD14_monocyte\", \"memory_CD4_T_cell\", \"B_cell\", \"CD8_T_cell\", \"CD16_monocyte\", \"NK_cell\", \"dendritic_cell\", \"platelet\") ) pbmc$cell_type <- plyr::mapvalues( pbmc$seurat_clusters, from = cell_dict$cluster, to = cell_dict$cell_type )"},{"path":"/articles/vignette.html","id":"saving-preprocessed-data","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Preprocessing scRNAseq data","what":"Saving Preprocessed Data:","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 designed compatible Seurat objects addition accepting matrices vectors data set function inputs. Therefore, ’s good idea save processed Seurat object analysis. However, pySCENIC used transcription factor activation inference, requires input cell gene matrix. opposite orientation Seurat objects default Python based tools scanpy. Saving data loom file using loomR helpful step therefore recommended well. cell x gene counts matrix may also saved tab-separated value (.tsv) file loomR used computing resource, aware dense formatting .tsv can lead large file sizes slow processing large data sets. provided necessary code , due large file size, .tsv file provided data directory. like skip ahead rest analysis, processed objects steps available data directory package.","code":"# save Seurat object as RDS saveRDS(pbmc, file = \"../data/pbmc3k_seurat.rds\") # save loom counts matrix pbmc_counts <- pbmc@assays$RNA@counts pbmc_loom <- loomR::create(filename = \"../data/pbmc3k_counts.loom\", data = pbmc_counts) pbmc_loom$close_all() # Remember to manually close connection to loom files! pbmc_counts <- pbmc@assays$RNA@counts write.table(t(as.matrix(pbmc_counts)), \"../data/pbmc3k_counts.tsv\", sep = \"\\t\", col.names = NA)"},{"path":"/articles/vignette.html","id":"installation","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Installation","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 undergoing active development aspects data used, analyzed, interpreted subject change new features fixes implemented. v0.2.1 Domino2 serves first stable development version active updates reproducible usage implemented fixes handling receptors ligands function heteromeric complexes, consideration receptor expression per-cluster basis linkage transcription factors, reformatting receptor-ligand database transcription factor regulon inputs enabling Domino2 use alternative data bases transcription factor activity inference methods. version currently hosted FertigLab GitHub branch v0.2.1 domino_development repository forked primary repository hosted Elisseeff-Lab GitHub, can installed using remotes package.","code":"if(!require(remotes)){ install.packages('remotes') } remotes::install_github('FertigLab/domino_development@v0.2.1')"},{"path":"/articles/vignette.html","id":"additional-downloads","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Installation","what":"Additional Downloads","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"tutorial, pySCENIC used method transcription factor activity inference assessment ligand-receptor interactions based curated interactions CellPhoneDB v4.0.0. requires downloading files prior use analysis pipeline.","code":""},{"path":"/articles/vignette.html","id":"downloads-for-scenic","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for SCENIC:","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"singularity image SCENIC v0.12.1 can installed DockerHub image source (example scripts use Docker provided scenic_bash directory well). SCENIC requires list transcription factors, motif annotations, cisTarget motifs available authors SCENIC human (HGNC), mouse (MGI), fly. following download everything necessary analysis data set HGNC gene labels hg38 genome.","code":"SCENIC_DIR=\"scenic\" mkdir ${SCENIC_DIR} # Build singularity image singularity build \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" docker://aertslab/pyscenic:0.12.1 # Matrix containing motifs as rows and genes as columns and ranking position for each gene and motif (based on CRM scores) as values curl \"https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather\" \\ -o \"${SCENIC_DIR}/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather\" curl \"https://resources.aertslab.org/cistarget/databases/old/homo_sapiens/hg38/refseq_r80/mc9nr/gene_based/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather\" \\ -o \"${SCENIC_DIR}/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather\" # List of genes encoding transcription factors in the HG38 reference genome curl \"https://resources.aertslab.org/cistarget/tf_lists/allTFs_hg38.txt\" \\ -o \"${SCENIC_DIR}/allTFs_hg38.txt\" # Motif annotations based on the 2017 cisTarget motif collection. Use these files if you are using the mc9nr databases. curl \"https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ -o \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\""},{"path":"/articles/vignette.html","id":"downloads-for-cellphonedb","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Installation > Additional Downloads","what":"Downloads for CellPhoneDB:","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Database files CellPhoneDB v4.0.0 human scRNA-seq data can installed public github repository Tiechmann Group developed CellPhoneDB.","code":"CELLPHONE_DIR=\"cellphonedb\" mkdir ${CELLPHONE_DIR} # Annotation of protein complexes curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/complex_input.csv\" \\ -o \"${CELLPHONE_DIR}/complex_input.csv\" # Annotation of genes encoding database proteins curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/gene_input.csv\" \\ -o \"${CELLPHONE_DIR}/gene_input.csv\" # Annotated protein interactions curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/interaction_input.csv\" \\ -o \"${CELLPHONE_DIR}/interaction_input.csv\" # Annotated protein features curl \"https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/protein_input.csv\" \\ -o \"${CELLPHONE_DIR}/protein_input.csv\""},{"path":"/articles/vignette.html","id":"scenic-analysis","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"SCENIC Analysis","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"SCENIC lab’s preferred software transcription factor activity scoring. recommend using Python implementation (pySCENIC) faster original R implementation. aware, use SCENIC often slowest memory intensive step analysis pipeline. SCENIC run computing resources access multi-core processing large amounts memory. described section saving preprocessed data, SCENIC requires RNA counts provided cell gene matrix format, using pbmc3k_counts.loom file stage analysis. pySCENIC initiated using bash scripting terminal. analysis consists 3 steps score genes transcription factor motif enrichment, construct transcription factor regulons consisting genes targeted transcription factors, arrive AUC scores enrichment regulon gene transcription within cell.","code":""},{"path":"/articles/vignette.html","id":"grn-construct-tf-modules","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > SCENIC Analysis","what":"grn: construct TF-modules","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Co-expression modules used quantify gene-transciption factor adjacencies.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic grn \\ \"../data/pbmc3k_counts.loom\" \\ # path to the loom file \"${SCENIC_DIR}/allTFs_hg38.txt\" \\ # list of transcription factors -o \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ # output directory for the adjacency matrix --num_workers 6 \\ # number of CPUs to use if multi-core processing is available --set_seed 123 # specify a random seed for reproducibility"},{"path":"/articles/vignette.html","id":"ctx-construct-tf-regulons-with-pruning-based-on-tf-motiff-enrichment","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > SCENIC Analysis","what":"ctx: construct TF regulons with pruning based on TF motiff enrichment","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"rankings genes based enrichment transcription factor motiffs transcription start site (TSS) considered construction regulons, target genes TF-modules removed lack motifs proximal TSS transcription factor may bind.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic ctx \\ \"${SCENIC_DIR}/pbmc_adj.tsv\" \\ # adjacency matrix output from grn \"${SCENIC_DIR}/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.feather\" \\ # target rankings of motif enrichment within 10 kb of TSS \"${SCENIC_DIR}/hg38__refseq-r80__500bp_up_and_100bp_down_tss.mc9nr.feather\" \\ # target rankings of motif enrichment within 500 bp upstream and 100 bp downstream of TSS --annotations_fname \"${SCENIC_DIR}/motifs-v9-nr.hgnc-m0.001-o0.0.tbl\" \\ # TF motif features --expression_mtx_fname \"../data/pbmc3k_counts.loom\" \\ # counts matrix loom file --mode \"dask_multiprocessing\" \\ # enable multi-core processing --output \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ # output file of learned TF regulons --num_workers 6 # number of CPU cores"},{"path":"/articles/vignette.html","id":"aucell-calculate-tf-activity-scores","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > SCENIC Analysis","what":"aucell: calculate TF activity scores","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Enrichment regulon measured Area recovery Curve (AUC) genes define regulon.","code":"singularity exec \"${SCENIC_DIR}/aertslab-pyscenic-0.12.1.sif\" pyscenic aucell \\ \"../data/pbmc3k_counts.loom\" \\ # counts matrix loom file \"${SCENIC_DIR}/pbmc_regulons.csv\" \\ # regulon table output from ctx -o \"${SCENIC_DIR}/pbmc_auc.csv\" # cell x TF matrix of TF enrichment AUC values"},{"path":[]},{"path":"/articles/vignette.html","id":"loading-scenic-results","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Building a Signaling Network with Domino2","what":"Loading SCENIC Results","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"transcription factor activities required input Domino2, regulons learned SCENIC important optional input needed annotate transcription factor-target interactions prune transcription factor-receptor linkages receptor target transcription factor. prevents distinction receptor expression driving transcription factor activity transcription factor inducing receptor’s expression. initial regulons data frame read R ctx function 2 rows column names need replaced one succinct description. Domino2 changed input format transcription factor regulons list storing vectors target genes regulon, names list transcription factor genes. facilitates use alternative methods transcription factor activity quantification methods. provide helper function easy retreival transcription factor regulons output pySCENIC ctx function. Users aware AUC matrix SCENIC loaded cell x transcription factor orientation transposed transcription factor x cell orientation. pySCENIC also appends “(+)” transcription factor names converted “…” upon loading R. characters can included without affecting results Domino2 analysis, can confusing querying transcription factor features data. recommend comprehensive removal “…” characters using gsub() function.","code":"scenic_dir = \"scenic/\" regulons <- read.csv(paste0(scenic_dir, \"/pbmc_regulons.csv\")) auc <- read.table(paste0(scenic_dir, \"scenic/pbmc_auc.csv\"), header = TRUE, row.names = 1, stringsAsFactors = FALSE, sep = \",\") regulons <- regulons[-1:-2,] colnames(regulons) <- c(\"TF\", \"MotifID\", \"AUC\", \"NES\", \"MotifSimilarityQvalue\", \"OrthologousIdentity\", \"Annotation\", \"Context\", \"TargetGenes\", \"RankAtMax\") regulon_list <- create_regulon_list_scenic(regulons = regulons) auc_in <- as.data.frame(t(auc)) rownames(auc_in) <- gsub(\"\\\\.\\\\.\\\\.$\", \"\", rownames(auc_in)) # remove pattern \"...\" from the end of all rownames"},{"path":"/articles/vignette.html","id":"load-cellphonedb-database","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Building a Signaling Network with Domino2","what":"Load CellPhoneDB Database","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 updated read ligand-receptor data bases uniform data.frame format referred receptor-ligand map (rl_map) enable use alternative updated reference databases oppossed particular version CellPhoneDB’s database older versions Domino. row corresponds ligand-receptor interaction. Genes participating interaction referred “partner ” “partner B” without requirement fixed ordering whether B ligand vice versa. minimum required columns data frame : int_pair: names interacting ligand receptor seperated \" & \" gene_A: gene genes encoding partner gene_B: gene genes encoding partner B type_A: (“L”, “R”) whether partner ligand (“L”) receptor (“R”) type_B: (“L”, “R”) whether partner B ligand (“L”) receptor (“R”) Additional annotation columns can provided name_A name_B ligands receptors whose name interaction database match names encoding genes. formatting also allows consideration ligand receptor complexes comprised heteromeric combination multiple proteins must coexpressed function. cases, “name_*” column shows name protein complex, “gene_*” column shows names genes encoding components complex separated commas “,”. plotting results build domino object, names interacting ligands receptors used based combinatorial expression complex components. facilitate use formatting CellPhoneDB database, include helper function automatically parses files cellPhoneDB database arrive rl_map format.","code":"cellphonedb_2_path <- \"cellphonedb\" complexes <- read.csv(paste0(cellphonedb_2_path, \"/complex_input.csv\"), stringsAsFactors = FALSE) genes <- read.csv(paste0(cellphonedb_2_path, \"/gene_input.csv\"), stringsAsFactors = FALSE) interactions <- read.csv(paste0(cellphonedb_2_path, \"/interaction_input.csv\"), stringsAsFactors = FALSE) proteins <- read.csv(paste0(cellphonedb_2_path, \"/protein_input.csv\"), stringsAsFactors = FALSE) rl_map <- create_rl_map_cellphonedb( genes = genes, proteins = proteins, interactions = interactions, complexes = complexes, database_name = \"CellPhoneDB_v4.0\" # includes database version used ) knitr::kable(head(rl_map))"},{"path":"/articles/vignette.html","id":"optional-adding-interactions-manually","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Building a Signaling Network with Domino2 > Load CellPhoneDB Database","what":"Optional: Adding interactions manually","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"change use rl_map formatting also enables users manually append interactions interest included interaction database need . can attained formatting desired interactions data.frame column headers rl_map using rbind() function.","code":"# Integrin complexes are not annotated as receptors in CellPhoneDB_v4.0 # collagen-integrin interactions between cells may be missed unless tables from the CellPhoneDB reference are edited or the interactions are manually added col_int_df <- data.frame( \"int_pair\" = \"a11b1 complex & COLA1_HUMAN\", \"name_A\" = \"a11b1 complex\", \"uniprot_A\" = \"P05556,Q9UKX5\", \"gene_A\" = \"ITB1,ITA11\", \"type_A\" = \"R\", \"name_B\" = \"COLA1_HUMAN\", \"uniprot_B\" = \"P02452,P08123\", \"gene_B\" = \"COL1A1,COL1A2\", \"type_B\" = \"L\", \"annotation_strategy\" = \"manual\", \"source\" = \"manual\", \"database_name\" = \"manual\" ) rl_map_append <- rbind(col_int_df, rl_map) knitr::kable(head(rl_map_append))"},{"path":"/articles/vignette.html","id":"creating-the-domino-object","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Creating the Domino Object","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 analysis takes place two steps. 1. create_domino() . initializes domino result object b. assesses differential transcription factor activity across cell clusters wilcoxon rank-sum test c. establishes transcription factor-receptor linkages based Spearman correlation transcription factor activities receptor expression across queried data set. 2. build_domino() . sets parameters transcription factors receptors called active within cell cluster b. aggregates scaled expression ligands capable interacting active receptors assessment ligand type cellular source triggering activation receptor.","code":""},{"path":"/articles/vignette.html","id":"required-inputs-from-data-set","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Creating the Domino Object","what":"Required inputs from data set","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Domino2 infers active receipt signals via receptors based correlation receptor’s expression transcription factor activity across data set differential activity transcription factor within cell cluster. Correlations conducted using scaled expression values rather raw counts normalized counts. assessment receptor activity per cell type basis, named vector cell cluster assignments, names cell barcodes matching expression matrix, provided. Assessing signaling based categorical groupings cells can acheived passing groupings “clusters” build_domino() place cell types. Domino2 accepts either Seurat object counts, scaled counts, clusters included, requires matrix counts, matrix scaled counts, named vector cell cluster labels factors. Shown extract elements Seurat object. Note: Ligand receptor expression can assessed genes included z_scores matrix. Many scRNA-seq analysis pipelines recommend storing genes high variance scaled expression slots data objects, thereby missing many genes encoding ligands receptors. Ensure genes interest included rows z_scores matrix. Scaled expression calculated genes PBMC data set removal genes expressed less 3 cells.","code":"counts <- pbmc@assays$RNA@counts z_scores <- as.matrix(pbmc@assays$RNA@scale.data) clusters <- as.factor(pbmc$cell_type)"},{"path":"/articles/vignette.html","id":"create-domino-object","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Creating the Domino Object","what":"Create Domino object","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"point, create_domino() function can used make object. Parameters note include “use_clusters” required assess signaling cell types rather linkage transcription factors receptors broadly across data set. “use_complexes” decides receptors function heteromeric complexes considered testing linkages transcription factors receptors. TRUE, receptor complex linked transcription factor majority component genes meet Spearman correlation threshold. “remove_rec_dropout” decides whether receptor values 0 considered correlation calculations; measure intended reduce effect dropout receptors wiht low expression. run create_domino() matrix vector inputs: results equivalent using Seurat object directly. Note inclusion matrix inputs Seurat object prioritize Seurat objects. information stored domino object access , please see vignette structure domino objects.","code":"pbmc_dom <- create_domino( rl_map = rl_map, # receptor-ligand map data frame features = auc_in, # Transcription factor scores (AUC matrix) counts = counts, # counts matrix z_scores = z_scores, # scaled expression data clusters = clusters, # vector of cell cluster assignments tf_targets = regulon_list, # list of TFs and their reglons use_clusters = TRUE, # assess receptor activation and ligand expression on a per-cluster basis use_complexes = TRUE, # include receptors and genes that function as a complex in results remove_rec_dropout = FALSE # whether to remove zeroes from correlation calculations ) pbmc_dom <- create_domino( rl_map = rl_map, # receptor-ligand map data frame features = auc_in, # Transcription factor scores (AUC matrix) ser = pbmc, # Seurat object containing counts, scaled counts, and cell cluster assignments tf_targets = regulon_list, # list of TFs and their reglons use_clusters = TRUE, # assess receptor activation and ligand expression on a per-cluster basis use_complexes = TRUE, # include receptors and genes that function as a complex in results remove_rec_dropout = FALSE # whether to remove zeroes from correlation calculations )"},{"path":"/articles/vignette.html","id":"build-domino","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Creating the Domino Object","what":"Build Domino","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"build_domino() finalizes construction domino object setting parameters identifying transcription factors differential activation clusters, receptor linkage transcription factors based magnitude positive correlation, minimum percentage cells within cluster expression receptor receptor called active. also options thresholds number transcription factors may called active cluster number receptors may linked one transcription factor. thresholds n transcription factors m receptors, bottom n transcription factors lowest p-values wilcoxon rank sum test top m receptors Spearman correlation coefficient chosen. thresholds number receptors transcription factors can sent infinity (Inf) collect receptors transcription factors meet statistical significance thresholds.","code":"pbmc_dom <- build_domino( dom = pbmc_dom, min_tf_pval = .001, # Threshold for p-value of DE for TFs max_tf_per_clust = 5, max_rec_per_tf = 5, rec_tf_cor_threshold = .25, # Minimum correlation between receptor and TF min_rec_percentage = 0.1 # Minimum percent of cells that must express receptor ) dom_b <- build_domino( dom = dom, min_tf_pval = .001, max_tf_per_clust = Inf, max_rec_per_tf = Inf, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1 )"},{"path":"/articles/vignette.html","id":"visualization-of-domino-results","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Visualization of Domino Results","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Multiple functions available visualize intracellular networks receptors transcription factors ligand-receptor mediated intercellular networks cell types.","code":""},{"path":"/articles/vignette.html","id":"summarize-transcription-factor-activity-and-linkage","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Visualization of Domino Results","what":"Summarize Transcription Factor Activity and Linkage","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Enrichment transcription factor activities cell types can visualized feat_heatmap() plots data set-wide transcription factor activity scores pheatmap. mark_connections argument determines whether X used mark linked transcription factors receptors.","code":"feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE, mark_connections = TRUE)"},{"path":"/articles/vignette.html","id":"cumulative-signaling-between-cell-types","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Visualization of Domino Results","what":"Cumulative signaling between cell types","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"cummulative degree signaling clusters assessed sum scaled expressin ligands targeting active receptors another cluster. can visualized graph format using signaling_network() function. Nodes represent cell cluster edges scale magnitude signaling clusters. color edge corresponds sender cluster signal. Signaling networks can also drawn edges render signals directed towards given cell type signals one cell type directed others can also created. see options use, well plotting options, please see plotting vignette.","code":"signaling_network(pbmc_dom, edge_weight = .5, max_thresh = 2.5)"},{"path":"/articles/vignette.html","id":"specific-signaling-interactions-between-clusters","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference > Visualization of Domino Results","what":"Specific Signaling Interactions between Clusters","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Beyond aggregated degree signaling cell types, degrees signaling specific ligand-receptor interactions can assessed. gene_network() provides graph linkages active transcription factors cluster, linked receptors cluster, possible ligands active recptors New Domino2, gene_network() can used two clusters determine possible ligands given receptor expressed putative outgoing signaling cluster. comprehensive assessment ligand expression targeting active receptors given cluster can assessed incoming_signaling_heatmap(). Another form comprehensive ligand expression assessment available individual active receptors form circos plots new Domino2. outer arcs correspond clusters domino object inner arcs representing possible ligand plotted receptor. Arcs drawn ligands cell type receptor ligand expressed specified threshold. Arc widths correspond mean express ligand cluster widest arc width scaling maximum expression ligand within data.","code":"gene_network(pbmc_dom, clust = 'dendritic_cell', layout = 'grid') gene_network(pbmc_dom, clust = 'dendritic_cell', OutgoingSignalingClust = \"CD14_monocyte\", layout = 'grid') incoming_signaling_heatmap(pbmc_dom, rec_clust = 'dendritic_cell', max_thresh = 2.5) circos_ligand_receptor(pbmc_dom, receptor = \"CD74\")"},{"path":"/articles/vignette.html","id":"continued-development","dir":"Articles","previous_headings":"Introduction to using Domino2 for cell-cell communication inference","what":"Continued Development","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"Since Domino2 package still development, new functions features development. github repository contains branches changes implemented. Additionally, find bugs, questions, features like request, please let us know .","code":""},{"path":[]},{"path":"/articles/vignette.html","id":"vignette-build-info","dir":"Articles","previous_headings":"","what":"Cell Cell Communication with Domino2: v0.2.1 Vignette","title":"Cell Cell Communication with Domino2: v0.2.1 Vignette","text":"","code":"sys.date() sessionInfo()"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Christopher Cherry. Author. Jacob T Mitchell. Author, maintainer. Sushma Nagaraj. Author. Kavita Krishnan. Author. Elana Fertig. Contributor. Jennifer Elisseeff. Contributor.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Cherry C, Maestas D, Han J, Andorko J, Cahan P, Fertig E, Garmire L, Elisseeff J (2021). “Computational reconstruction signalling networks surrounding implanted biomaterials single-cell transcriptomics.” Nature Biomedical Engineering, 5(10), 1228-1238. doi:10.1038/s41551-021-00770-5, https://doi.org/10.1038%2Fs41551-021-00770-5. Cherry C, Mitchell J, Nagaraj S, Krishnan K, Fertig E, Elisseeff J (2023). domino2: Cell Communication Analysis Single Cell RNA Sequencing. R package version 0.2.1.","code":"@Article{, title = {Computational reconstruction of the signalling networks surrounding implanted biomaterials from single-cell transcriptomics}, author = {Christopher Cherry and David R. Maestas and Jin Han and James I. Andorko and Patrick Cahan and Elana J. Fertig and Lana X. Garmire and Jennifer H. Elisseeff}, journal = {Nature Biomedical Engineering}, year = {2021}, volume = {5}, number = {10}, pages = {1228-1238}, doi = {10.1038/s41551-021-00770-5}, url = {https://doi.org/10.1038%2Fs41551-021-00770-5}, } @Manual{, title = {domino2: Cell Communication Analysis for Single Cell RNA Sequencing}, author = {Christopher Cherry and Jacob T Mitchell and Sushma Nagaraj and Kavita Krishnan and Elana Fertig and Jennifer Elisseeff}, year = {2023}, note = {R package version 0.2.1}, }"},{"path":"/index.html","id":"introducing-domino2","dir":"","previous_headings":"","what":"Cell Communication from Single Cell RNA Sequencing Data","title":"Cell Communication from Single Cell RNA Sequencing Data","text":"domino2 updated version original domino R package published Nature Biomedical Engineering Computational reconstruction signalling networks surrounding implanted biomaterials single-cell transcriptomics. domino2 tool analysis intra- intercellular signaling single cell RNA sequencing data based transcription factor activation receptor ligand linkages.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Cell Communication from Single Cell RNA Sequencing Data","text":"domino2 undergoing active development aspects data used, analyzed, interpreted subject change new features fixes implemented. v0.2.2 domino2 serves first stable development version active updates reproducible usage (see News page information changes). version currently hosted FertigLab GitHub branch v0.2.2 domino_development repository forked primary repository hosted Elisseeff-Lab GitHub, can installed using remotes package.","code":"if(!require(remotes)){ install.packages('remotes') } remotes::install_github('FertigLab/domino2@v0.2.1')"},{"path":"/index.html","id":"usage-overview","dir":"","previous_headings":"","what":"Usage Overview","title":"Cell Communication from Single Cell RNA Sequencing Data","text":"overview domino2 might used analysis single cell RNA sequencing data set: Transcription factor activation scores calculated (recommend using pySCENIC, methods can used well) ligand-receptor database used map linkages ligands receptors (recommend using cellphoneDB, methods can used well). domino object created using counts, z-scored counts, clustering information, data steps 1 2. Parameters maximum number transcription factors receptors minimum correlation threshold (among others) used make cell communication network Communication networks can extracted within domino object visualized using variety plotting functions Please see Getting Started page example analysis includes steps detail, downloading running pySCENIC building visualizing domino results. articles include details plotting functions structure domino object.","code":""},{"path":[]},{"path":"/news/news-0.2.html","id":"updates-to-domino-object-construction-0-2-1","dir":"News","previous_headings":"domino2 v0.2.1","what":"Updates to domino object construction","title":"Version 0.2","text":"Uniform formats inputs receptor-ligand interaction databases, tf activity features, regulon gene lists operability alternative databases tf activity inference methods Helper functions reformatting pySCENIC outputs CellPhoneDB database files domino-readable uniform formats Assessment transcription factor linkage receptors function heteromeric complex based correlation transcription factor activity receptor component genes Assessment complex ligand expression mean component gene expression plotting functions Minimum threshold percentage cells cluster expressing receptor gene receptor called active within cluster Additional linkage slots active receptors cluster, transcription factor-receptor linkages cluster, incoming ligands active receptors cluster","code":""},{"path":"/news/news-0.2.html","id":"plotting-functions-0-2-1","dir":"News","previous_headings":"domino2 v0.2.1","what":"Plotting functions","title":"Version 0.2","text":"Circos plot ligand expression targeting specified receptor chord widths correspond quantity ligand expression cell cluster Signaling networks showing outgoing signaling specified cell clusters Gene networks two cell clusters","code":""},{"path":"/news/news-0.2.html","id":"bugfixes-0-2-1","dir":"News","previous_headings":"domino2 v0.2.1","what":"Bugfixes","title":"Version 0.2","text":"Added host option gene ortholog conversions using biomart access maintained mirrors Transcription factor-target linkages now properly stored receptors transcription factor’s regulon excluded linkage Ligand nodes sizes gene networks correspond quantity ligand expression create_domino() can run without providing regulon list References host GitHub repository updated “Elisseeff-Lab”","code":""},{"path":[]},{"path":"/news/news-0.2.html","id":"linkage-functions-0-2-2","dir":"News","previous_headings":"domino2 v0.2.2","what":"Linkage functions","title":"Version 0.2","text":"Addition new class summarize linkages objects Addition helper functions count linkages compare objects Plotting function differential linkages","code":""},{"path":"/news/news-0.2.html","id":"package-structure-0-2-2","dir":"News","previous_headings":"domino2 v0.2.2","what":"Package structure","title":"Version 0.2","text":"Adjustments made meet BioConductor standards","code":""},{"path":"/old.README.html","id":null,"dir":"","previous_headings":"","what":"Domino2","title":"Domino2","text":"Domino2 tool analysis intra- intercellular signaling single cell RNA sequencing data based transcription factor activation ligand receptor signaling.","code":""},{"path":"/old.README.html","id":"fertig-lab-development-branch","dir":"","previous_headings":"","what":"Fertig Lab Development Branch","title":"Domino2","text":"repository intended integration updates Domino2 Fertig Lab Elisseeff Lab. code may currently unstable currently recommended use. like use Domino, please use main repository hosted Elisseeff Lab https://github.com/Elisseeff-Lab/domino.","code":""},{"path":"/old.README.html","id":"branch-notes","dir":"","previous_headings":"Fertig Lab Development Branch","what":"Branch notes:","title":"Domino2","text":"Code used version Domino published 2021 archived branch domino_paper_archive. Changes, issues pull requests handled master branch easy use installation updated version. Added option use cells without receptor dropout calculating Pearson correlation.","code":""},{"path":"/old.README.html","id":"citation","dir":"","previous_headings":"Fertig Lab Development Branch","what":"Citation","title":"Domino2","text":"find Domino useful, please consider citing us. Cherry C, Maestas DR, Han J, Andorko JI, Cahan P, Fertig EJ, Garmire LX, Elisseeff JH. Computational reconstruction signalling networks surrounding implanted biomaterials single-cell transcriptomics. Nat Biomed Eng. 2021 Oct;5(10):1228-1238. doi: 10.1038/s41551-021-00770-5. Epub 2021 Aug 2. PMID: 34341534; PMCID: PMC9894531. make sure cite SCENIC use transcription factor scores. Aibar, Sara, et al. “SCENIC: single-cell regulatory network inference clustering.” Nature methods 14.11 (2017): 1083-1086.","code":""},{"path":"/old.README.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Domino2","text":"Domino can installed github repository. Domino requires ligand-receptor database. use cellphonedb. Domino look four files: complexes.csv genes.csv interactions.csv proteins.csv. like download terminal commands .","code":"if(!require(devtools)){ install.packages('devtools') } devtools::install_github('Elisseeff-Lab/domino') curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/sources/complex_curated.csv mv complex_curated.csv complexes.csv curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/sources/interaction_curated.csv mv interaction_curated.csv interactions.csv curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/sources/protein_curated.csv mv protein_curated.csv proteins.csv curl -O https://raw.githubusercontent.com/Teichlab/cellphonedb-data/master/data/gene_input.csv mv gene_input.csv genes.csv"},{"path":"/old.README.html","id":"setting-up-scenic","dir":"","previous_headings":"Installation","what":"Setting up SCENIC","title":"Domino2","text":"choose use SCENIC generate transcription factor activation scores, recommend Python implementation. ’s significantly faster R version SCENIC longest part analysis pipeline far. Docker/Singularity images available . tutorials, use bash script wrote run SCENIC Docker image. ’ll need set environment properly wish use script run SCENIC. First, need docker image SCENIC 0.10.0. Docker image need directory pull input files write output files . default, use ~/docker_scratch, feel free make whatever like change directory variable bash script. Put following reference files scratch folder using script. SCENIC requires list transcription factors, motif annotations, cisTarget motifs available authors SCENIC human (HGNC), mouse (MGI), fly. following download everything necessary analysis data set MGI gene labels mm9 genome. HGNC gene labels hg19 genome","code":"mkdir ~/docker_scratch curl -O https://raw.githubusercontent.com/aertslab/pySCENIC/master/resources/mm_mgi_tfs.txt curl -O https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.mgi-m0.001-o0.0.tbl curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-500bp-upstream-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-500bp-upstream-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-10kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-10kb-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-5kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/mus_musculus/mm9/refseq_r45/mc9nr/gene_based/mm9-tss-centered-5kb-10species.mc9nr.feather curl -O https://raw.githubusercontent.com/aertslab/pySCENIC/master/resources/hs_hgnc_curated_tfs.txt curl -O https://resources.aertslab.org/cistarget/motif2tf/motifs-v9-nr.hgnc-m0.001-o0.0.tbl curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-500bp-upstream-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-500bp-upstream-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-10kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-10kb-10species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-5kb-7species.mc9nr.feather curl -O https://resources.aertslab.org/cistarget/databases/homo_sapiens/hg19/refseq_r45/mc9nr/gene_based/hg19-tss-centered-5kb-10species.mc9nr.feather"},{"path":"/old.README.html","id":"a-complete-basic-analysis-using-domino","dir":"","previous_headings":"","what":"A complete basic analysis using Domino","title":"Domino2","text":"run complete analysis Domino picking phenotypic assignment clusters. like see example Domino without using clusters check cluster free analysis vignette . First need get data. Seurat object contains cluster assignments Seurat 2,700 PBMC tutorial. wont need install Seurat don’t already - just pulling data object. create directory put stuff well.","code":"mkdir ~/work/domino_basic_example"},{"path":"/old.README.html","id":"running-scenic","dir":"","previous_headings":"A complete basic analysis using Domino","what":"Running SCENIC","title":"Domino2","text":"first step generate transcription factor activation scores SCENIC. following along, need created Docker scratch directory downloaded necessary HGNC reference files described Setting SCENIC section . First need write counts file Docker temporary directory R. Now simply need run SCENIC bash script data MGI symbols. data set 32-core EPYC Rome 7002 running step takes 40m. like skip step, necessary output files provided . Either way, move files working directory terminal file explorer.","code":"ser = readRDS('pbmc3k_final.rds') write.table(t(as.matrix(ser@assays$RNA@counts)), '~/docker_scratch/counts.tsv', sep = '\\t', col.names = NA) bash ~/my_software/domino/scenic_bash/hgnc_scenic.sh mv ~/docker_scratch/auc_mtx.csv ~/work/domino_basic_example mv ~/docker_scratch/regulons.csv ~/work/domino_basic_example"},{"path":"/old.README.html","id":"creating-the-domino-object","dir":"","previous_headings":"A complete basic analysis using Domino","what":"Creating the domino object","title":"Domino2","text":"Now SCENIC data can run domino. example’s sake, pull necessary information Seurat object first can also simply provide Seurat object create_domino function pull . also read AUC matrix SCENIC. Note must transposed SCENIC’s output. command generates domino object prepares (compiles LR database, calculates cluster TF enrichment, calculates TF - R correlation). Make sure put correct directory cellphonedb data sets .","code":"library(domino) ser = readRDS('pbmc3k_final.rds') counts = ser@assays$RNA@counts z_scores = ser@assays$RNA@scale.data clusters = ser@active.ident auc = t(read.table('auc_mtx.csv', header = TRUE, row.names = 1, stringsAsFactors = FALSE, sep = ',')) pbmc_dom = create_domino(signaling_db = '~/work/ref/human/cpdb/', features = auc, counts = counts, z_scores = z_scores, clusters = clusters, df = 'regulons.csv')"},{"path":"/old.README.html","id":"building-the-signaling-network-and-plotting-options","dir":"","previous_headings":"A complete basic analysis using Domino","what":"Building the signaling network and plotting options","title":"Domino2","text":"four major parameters can play buidling signaling network, two selecting TFs cluster two connecting TFs recs. min_tf_pval minimum p val TF assigned cluster max_tf_per_clust maximum number transcription factors allowed cluster. patter true rec_tf_cor_threshold max_rec_per_tf except thresholding Pearon correlation receptor transcription factor. Building signaling network takes little time feel free play around values. general prefer select pval cor threshold good portion TFs recs trimmed maximum number thresholds. Now just need visualize signaling network. First, visualize cluster-cluster signaling signaling_network. using max threshold (max_thresh) Mk cluster’s expression ITGA2B much higher clusters/ligands drowns relevant signaling . Give shot without max_thresh ’ll see mean. Intercluster signaling network default, nodes scaled based expression ligands targetting . larger cells data set expressing high amounts ligands targetting cluster. edges weighted based strength signaling two specific clusters. color edge match color ligand cluster. example, network teal line connecting CD8 T cells DCs represents signaling T cells DCs. order determine ligand-receptor-TF signaling patterns involved , can zoom gene network DCs. DC gene network default red nodes ligands, blue receptors, green transcription factors. Now lets look expression ligands targetting DCs. DC incoming signaling heatmap looks like CCL5 major component signaling T cells DCs. gene network looks like CCL5 predicted target LILRB1 activate IRF4 IRF8 DCs. can investigate expression patterns associated linkages. First, lets generate heatmap transcription factor activation scores. Transcription factor activation score heatmap look connections transcription factors receptores can create heatmap correlations two. Rec-TF correlation heatmap Finally, can visualize entire tf-r-l network including clusters gene_network. Note function return igraph object used make plot. important use force directed layout like make two versions plot. use default settings allow us see node labels reformat plot igraph options make less cluttered smaller formats. Thanks taking look software. questions please let us know .","code":"pbmc_dom = build_domino(pbmc_dom, max_tf_per_clust = 10, min_tf_pval = .001, max_rec_per_tf = 10, rec_tf_cor_threshold = .25) signaling_network(pbmc_dom, edge_weight = .5, max_thresh = 2.5) gene_network(pbmc_dom, clust = 'DC', layout = 'fr') incoming_signaling_heatmap(pbmc_dom, rec_clust = 'DC', max_thresh = 2.5) feat_heatmap(pbmc_dom, norm = TRUE, bool = FALSE) cor_heatmap(pbmc_dom, bool = FALSE, mark_connections = TRUE) info = gene_network(pbmc_dom, clust = levels(pbmc_dom@clusters), lig_scale = FALSE, layout = 'fr') plot(info$graph, layout = info$layout, vertex.size = 3, edge.color = 'grey', vertex.frame.color = 'black', vertex.label = NA)"},{"path":"/plotting_vignette.html","id":null,"dir":"","previous_headings":"","what":"Visualizing domino2 data","title":"Visualizing domino2 data","text":"addition numerous plotting options available original Domino, domino2 added functionality new methods improve visualization interpretation analysis results. , go different plotting functions available, well different options can utilized, options customization. using domino object (loaded dom) example analysis Getting Started.","code":""},{"path":[]},{"path":"/plotting_vignette.html","id":"correlations-between-receptors-and-transcription-factors","dir":"","previous_headings":"Heatmaps","what":"Correlations between receptors and transcription factors","title":"Visualizing domino2 data","text":"cor_heatmap() can used show correlations calculated receptors transcription factors. addition displaying scores correlations, function can also used identify correlations certain value (using bool bool_thresh arguments) identify combinations receptors transcription factors (TFs) connected (argument mark_connections). subset receptors transcription factors interest, vector either () can passed function. heatmap functions domino2 based NMF::aheatmap() also accept additional arguments meant function. example, argument clustering rows columns heatmap explicitly stated, can still passed NMF::aheatmap() cor_heatmap().","code":"cor_heatmap(dom, title = \"PBMC R-TF Correlations\") cor_heatmap(dom, bool = TRUE, bool_thresh = 0.25) cor_heatmap(dom, bool = FALSE, mark_connections = TRUE) receptors <- c(\"CSF1R\", \"CSF3R\", \"CCR7\", \"FCER2\") tfs <- c(\"PAX5\", \"JUNB\", \"FOXJ3\", \"FOSB\") cor_heatmap(dom, feats = tfs, recs = receptors) cor_heatmap(dom, title = FALSE, Rowv = NA, Colv = NA, main = \"Heatmap Without Clustering\" )"},{"path":"/plotting_vignette.html","id":"heatmap-of-transcription-factor-activation-scores","dir":"","previous_headings":"Heatmaps","what":"Heatmap of Transcription Factor Activation Scores","title":"Visualizing domino2 data","text":"feat_heatmap() used show transcription factor activation features signaling network. functions similarly cor_heatmap(), arguments select specific vector features, use boolean view threshold, pass arguments NMF::aheatmap(). Specific function though arguments setting range values visualized one choose whether normalize scores max value.","code":"feat_heatmap(dom) feat_heatmap(dom, min_thresh = 0.1, max_thresh = 0.6, norm = TRUE, bool = FALSE ) feat_heatmap(dom, bool = TRUE)"},{"path":"/plotting_vignette.html","id":"heatmap-of-incoming-signaling-for-a-cluster","dir":"","previous_headings":"Heatmaps","what":"Heatmap of Incoming Signaling for a Cluster","title":"Visualizing domino2 data","text":"incoming_signaling_heatmap() can used visualize cluster average expression ligands capable activating TFs enriched cluster. example, view incoming signaling CD8 T cells: can also select specific clusters interest signaling CD8 T cells. interested viewing monocyte signaling: heatmap functions, options available minimum threshold, maximum threshold, whether scale values thresholding, whether normalize matrix, ability pass arguments NMF::aheatmap().","code":"incoming_signaling_heatmap(dom, \"CD8_T_cell\") incoming_signaling_heatmap(dom, \"CD8_T_cell\", clusts = c(\"CD14_monocyte\", \"CD16_monocyte\"))"},{"path":"/plotting_vignette.html","id":"heatmap-of-signaling-between-clusters","dir":"","previous_headings":"Heatmaps","what":"Heatmap of Signaling Between Clusters","title":"Visualizing domino2 data","text":"signaling_heatmap() makes heatmap showing signaling strength ligands cluster receptors cluster based averaged expression. functions, specific clusters can selected, thresholds can set, normalization methods can selected well.","code":"signaling_heatmap(dom) signaling_heatmap(dom, scale = \"sqrt\") signaling_heatmap(dom, normalize = \"rec_norm\")"},{"path":[]},{"path":"/plotting_vignette.html","id":"network-showing-l-r-tf-signaling-between-clusters","dir":"","previous_headings":"Network Plots","what":"Network showing L-R-TF signaling between clusters","title":"Visualizing domino2 data","text":"gene_network() makes network plot display signaling selected clusters ligands, receptors features associated clusters displayed nodes edges linkages. look signaling CD16 Monocytes CD14 Monocytes: Options modify plot include adjusting scaling ligands different layouts (legible others). Additionally, colors can given select genes (example, highlight specific signaling path).","code":"gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\") gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", lig_scale = 25, layout = \"sphere\" ) gene_network(dom, clust = \"CD16_monocyte\", OutgoingSignalingClust = \"CD14_monocyte\", cols = c(\"CD1D\" = \"violet\", \"LILRB2\" = \"violet\", \"FOSB\" = \"violet\"), lig_scale = 10 )"},{"path":"/plotting_vignette.html","id":"network-showing-interaction-strength-across-data","dir":"","previous_headings":"Network Plots","what":"Network Showing Interaction Strength Across Data","title":"Visualizing domino2 data","text":"signaling_network() can used create network plot nodes clusters edges indicate signaling one cluster another. addition changes scaling, thresholds, layouts, plot can modified selecting incoming outgoing clusters (!). example view signaling CD14 Monocytes cluster:","code":"signaling_network(dom) signaling_network(dom, showOutgoingSignalingClusts = \"CD14_monocyte\", scale = \"none\", norm = \"none\", layout = \"fr\", scale_by = \"none\", vert_scale = 5 )"},{"path":[]},{"path":"/plotting_vignette.html","id":"chord-diagrams-connecting-ligands-and-receptors","dir":"","previous_headings":"Other Types of Plot","what":"Chord Diagrams Connecting Ligands and Receptors","title":"Visualizing domino2 data","text":"new addition domino2, circos_ligand_receptor() creates chord plot showing ligands can activate specific receptor, displaying mean cluster expression ligand width chord. function can given cluster colors match plots may make data. addition, plot can adjusted changing threshold ligand expression required linkage visualized selecting clusters interest.","code":"circos_ligand_receptor(dom, receptor = \"CD74\") cols <- c( \"red\", \"orange\", \"green\", \"blue\", \"pink\", \"purple\", \"slategrey\", \"firebrick\", \"hotpink\" ) names(cols) <- levels(dom@clusters) circos_ligand_receptor(dom, receptor = \"CD74\", cell_colors = cols)"},{"path":"/plotting_vignette.html","id":"scatter-plot-to-visualize-correlation","dir":"","previous_headings":"Other Types of Plot","what":"Scatter Plot to Visualize Correlation","title":"Visualizing domino2 data","text":"cor_scatter() can used plot cell based expression selected TF receptor. produces scatter plot well line best fit look receptor-TF correlation. keep mind argument remove_rec_dropout match parameter used domino object built. case, use build parameter, leave value argument default value FALSE.","code":"cor_scatter(dom, \"FOSB\", \"CD74\")"},{"path":"/plotting_vignette.html","id":"continued-development","dir":"","previous_headings":"","what":"Continued Development","title":"Visualizing domino2 data","text":"Since domino2 package still developed, new functions features implemented future versions. meantime, view example analysis, see Getting Started page, see domino object structure page get familiar object structure. Additionally, find bugs, questions, want share idea, please let us know . Vignette Build Information Date last built session information:","code":"Sys.Date() #> [1] \"2023-10-05\" sessionInfo() #> R version 4.2.1 (2022-06-23) #> Platform: x86_64-pc-linux-gnu (64-bit) #> Running under: Ubuntu 22.04.2 LTS #> #> Matrix products: default #> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0 #> #> locale: #> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C #> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 #> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 #> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C #> #> attached base packages: #> [1] grid stats graphics grDevices utils datasets methods #> [8] base #> #> other attached packages: #> [1] ComplexHeatmap_2.12.1 circlize_0.4.15 patchwork_1.1.3 #> [4] RColorBrewer_1.1-3 Biobase_2.56.0 BiocGenerics_0.42.0 #> [7] domino2_0.2.1 #> #> loaded via a namespace (and not attached): #> [1] utf8_1.2.3 R.utils_2.12.2 spatstat.explore_3.2-3 #> [4] reticulate_1.32.0 tidyselect_1.2.0 RSQLite_2.3.1 #> [7] AnnotationDbi_1.58.0 htmlwidgets_1.6.2 Rtsne_0.16 #> [10] munsell_0.5.0 codetools_0.2-19 ica_1.0-3 #> [13] future_1.33.0 miniUI_0.1.1.1 withr_2.5.1 #> [16] spatstat.random_3.1-6 colorspace_2.1-0 progressr_0.14.0 #> [19] filelock_1.0.2 knitr_1.44 rstudioapi_0.15.0 #> [22] Seurat_4.3.0.1 stats4_4.2.1 ROCR_1.0-11 #> [25] ggsignif_0.6.4 tensor_1.5 listenv_0.9.0 #> [28] NMF_0.26 labeling_0.4.3 GenomeInfoDbData_1.2.8 #> [31] polyclip_1.10-4 farver_2.1.1 bit64_4.0.5 #> [34] rprojroot_2.0.3 parallelly_1.36.0 vctrs_0.6.3 #> [37] generics_0.1.3 xfun_0.40 BiocFileCache_2.4.0 #> [40] R6_2.5.1 doParallel_1.0.17 GenomeInfoDb_1.32.4 #> [43] clue_0.3-65 bitops_1.0-7 spatstat.utils_3.0-3 #> [46] cachem_1.0.8 promises_1.2.1 scales_1.2.1 #> [49] gtable_0.3.4 downlit_0.4.3 globals_0.16.2 #> [52] processx_3.8.2 goftest_1.2-3 rlang_1.1.1 #> [55] GlobalOptions_0.1.2 splines_4.2.1 rstatix_0.7.2 #> [58] lazyeval_0.2.2 broom_1.0.5 spatstat.geom_3.2-5 #> [61] BiocManager_1.30.22 yaml_2.3.7 reshape2_1.4.4 #> [64] abind_1.4-5 backports_1.4.1 httpuv_1.6.11 #> [67] tools_4.2.1 gridBase_0.4-7 ggplot2_3.4.3 #> [70] ellipsis_0.3.2 ggridges_0.5.4 Rcpp_1.0.11 #> [73] plyr_1.8.8 progress_1.2.2 zlibbioc_1.42.0 #> [76] purrr_1.0.2 RCurl_1.98-1.12 ps_1.7.5 #> [79] prettyunits_1.2.0 ggpubr_0.6.0 deldir_1.0-9 #> [82] pbapply_1.7-2 GetoptLong_1.0.5 cowplot_1.1.1 #> [85] S4Vectors_0.34.0 zoo_1.8-12 SeuratObject_4.1.3 #> [88] ggrepel_0.9.3 cluster_2.1.4 fs_1.6.3 #> [91] magrittr_2.0.3 data.table_1.14.8 scattermore_1.2 #> [94] lmtest_0.9-40 RANN_2.6.1 whisker_0.4.1 #> [97] R.cache_0.16.0 fitdistrplus_1.1-11 matrixStats_1.0.0 #> [100] pkgload_1.3.3 hms_1.1.3 mime_0.12 #> [103] evaluate_0.21 xtable_1.8-4 XML_3.99-0.14 #> [106] IRanges_2.30.1 gridExtra_2.3 shape_1.4.6 #> [109] compiler_4.2.1 biomaRt_2.52.0 tibble_3.2.1 #> [112] KernSmooth_2.23-22 crayon_1.5.2 R.oo_1.25.0 #> [115] htmltools_0.5.6 mgcv_1.9-0 later_1.3.1 #> [118] tidyr_1.3.0 DBI_1.1.3 dbplyr_2.3.3 #> [121] MASS_7.3-60 rappdirs_0.3.3 car_3.1-2 #> [124] Matrix_1.6-1.1 cli_3.6.1 R.methodsS3_1.8.2 #> [127] parallel_4.2.1 igraph_1.5.1 pkgconfig_2.0.3 #> [130] pkgdown_2.0.7 registry_0.5-1 sp_2.0-0 #> [133] plotly_4.10.2 spatstat.sparse_3.0-2 xml2_1.3.5 #> [136] roxygen2_7.2.3 foreach_1.5.2 rngtools_1.5.2 #> [139] XVector_0.36.0 stringr_1.5.0 callr_3.7.3 #> [142] digest_0.6.33 sctransform_0.4.0 RcppAnnoy_0.0.21 #> [145] spatstat.data_3.0-1 Biostrings_2.64.1 rmarkdown_2.25 #> [148] leiden_0.4.3 uwot_0.1.16 curl_5.0.2 #> [151] shiny_1.7.5 commonmark_1.9.0 rjson_0.2.21 #> [154] lifecycle_1.0.3 nlme_3.1-163 jsonlite_1.8.7 #> [157] carData_3.0-5 desc_1.4.2 viridisLite_0.4.2 #> [160] fansi_1.0.4 pillar_1.9.0 lattice_0.21-8 #> [163] KEGGREST_1.36.3 fastmap_1.1.1 httr_1.4.7 #> [166] pkgbuild_1.4.2 survival_3.5-7 glue_1.6.2 #> [169] png_0.1-8 iterators_1.0.14 bit_4.0.5 #> [172] stringi_1.7.12 blob_1.2.4 memoise_2.0.1 #> [175] styler_1.10.2 dplyr_1.1.3 irlba_2.3.5.1 #> [178] future.apply_1.11.0"},{"path":"/reference/add_rl_column.html","id":null,"dir":"Reference","previous_headings":"","what":"Adds a column to the RL signaling data frame. — add_rl_column","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"function adds column internal rl 'map' used map receptor receptor complexes ligand ligand complexes.","code":""},{"path":"/reference/add_rl_column.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"","code":"add_rl_column(map, map_ref, conv, new_name)"},{"path":"/reference/add_rl_column.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"map RL signaling data frame. map_ref Name column match new data conv Data frame matching current data map new data. new_name Name new column created RL map","code":""},{"path":"/reference/add_rl_column.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"updated RL signaling data frame","code":""},{"path":"/reference/add_rl_column.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Adds a column to the RL signaling data frame. — add_rl_column","text":"","code":"lr_name <- data.frame(\"abbrev\" = c(\"L\", \"R\"), \"full\" = c(\"Ligand\", \"Receptor\")) rl_map_expanded <- add_rl_column(map = domino2:::rl_map_tiny, map_ref = \"type_A\", conv = lr_name, new_name = \"type_A_full\")"},{"path":"/reference/build_domino.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate a signaling network for a domino object — build_domino","title":"Calculate a signaling network for a domino object — build_domino","text":"function calculates signaling network. requires domino object preprocessed create_domino returns domino object prepared plotting various plotting functions package.","code":""},{"path":"/reference/build_domino.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate a signaling network for a domino object — build_domino","text":"","code":"build_domino( dom, max_tf_per_clust = 5, min_tf_pval = 0.01, max_rec_per_tf = 5, rec_tf_cor_threshold = 0.15, min_rec_percentage = 0.1 )"},{"path":"/reference/build_domino.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate a signaling network for a domino object — build_domino","text":"dom Domino object create_domino. max_tf_per_clust Maximum number transcription factors called active cluster. min_tf_pval Minimum p-value differential feature score test call transcription factor active cluster. max_rec_per_tf Maximum number receptors link transcription factor. rec_tf_cor_threshold Minimum pearson correlation used consider receptor linked transcription factor. Increasing decrease number receptors linked transcription factor. min_rec_percentage Minimum percentage cells cluster expressing receptor receptor linked trancription factors cluster.","code":""},{"path":"/reference/build_domino.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate a signaling network for a domino object — build_domino","text":"domino object signaling network built","code":""},{"path":"/reference/build_domino.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate a signaling network for a domino object — build_domino","text":"","code":"pbmc_dom_tiny_built <- build_domino(dom = domino2:::pbmc_dom_tiny, min_tf_pval = .001, max_tf_per_clust = 25, max_rec_per_tf = 25, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1)"},{"path":"/reference/circos_ligand_receptor.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"Creates chord plot expression ligands can activate specified receptor chord widths correspond mean ligand expression cluster.","code":""},{"path":"/reference/circos_ligand_receptor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"","code":"circos_ligand_receptor( dom, receptor, ligand_expression_threshold = 0.01, cell_idents = NULL, cell_colors = NULL )"},{"path":"/reference/circos_ligand_receptor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"dom Domino object undergone network building build_domino() receptor Name receptor active least one cell type domino object ligand_expression_threshold Minimum mean expression value ligand cell type chord rendered cell type receptor cell_idents Vector cell types cluster assignments domino object included plot. cell_colors Named vector color names hex codes names correspond plotted cell types color values","code":""},{"path":"/reference/circos_ligand_receptor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"renders circos plot active graphics device","code":""},{"path":"/reference/circos_ligand_receptor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot expression of a receptor's ligands by other cell types as a chord plot — circos_ligand_receptor","text":"","code":"cols <- c( \"red\", \"orange\", \"green\", \"blue\", \"pink\", \"purple\", \"slategrey\", \"firebrick\", \"hotpink\" ) names(cols) <- dom_clusters(domino2:::pbmc_dom_built_tiny, labels = FALSE) circos_ligand_receptor(domino2:::pbmc_dom_built_tiny, receptor = \"FCER2\", cell_colors = cols) #> There are more than one numeric columns in the data frame. Take the #> first two numeric columns and draw the link ends with unequal width. #> #> Type `circos.par$message = FALSE` to suppress the message."},{"path":"/reference/collate_network_items.html","id":null,"dir":"Reference","previous_headings":"","what":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"function collates features, receptors, ligands found signaling network anywhere list clusters. can useful comparing signaling networks across two separate conditions. order run build_domino() must run object previously.","code":""},{"path":"/reference/collate_network_items.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"","code":"collate_network_items(dom, clusters = NULL, return = NULL)"},{"path":"/reference/collate_network_items.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"dom Domino object containing signaling network (.e. build_domino() run) clusters Vector indicating clusters collate network items . left NULL clusters included. return String indicating collate 'features', 'receptors', 'ligands'. '' list three returned.","code":""},{"path":"/reference/collate_network_items.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extracts all features, receptors, or ligands present in a signaling network. — collate_network_items","text":"vector containing features, receptors, ligands data set list containing three.","code":""},{"path":"/reference/convert_genes.html","id":null,"dir":"Reference","previous_headings":"","what":"Use biomaRt to convert genes — convert_genes","title":"Use biomaRt to convert genes — convert_genes","text":"function reads vector genes converts genes specified symbol type","code":""},{"path":"/reference/convert_genes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Use biomaRt to convert genes — convert_genes","text":"","code":"convert_genes( genes, from = c(\"ENSMUSG\", \"ENSG\", \"MGI\", \"HGNC\"), to = c(\"MGI\", \"HGNC\"), host = \"https://www.ensembl.org\" )"},{"path":"/reference/convert_genes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Use biomaRt to convert genes — convert_genes","text":"genes Vector genes convert. Format gene input (ENSMUSG, ENSG, MGI, HGNC) Format gene output (MGI, HGNC) host Host connect . Defaults https://www.ensembl.org following useMart default, can changed archived hosts useMart fails connect.","code":""},{"path":"/reference/convert_genes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Use biomaRt to convert genes — convert_genes","text":"data frame input genes col 1 output col 2","code":""},{"path":"/reference/cor_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"Creates heatmap correlation values receptors transcription factors either boolean threshold continuous values displayed","code":""},{"path":"/reference/cor_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"","code":"cor_heatmap( dom, bool = FALSE, bool_thresh = 0.15, title = TRUE, feats = NULL, recs = NULL, mark_connections = FALSE, ... )"},{"path":"/reference/cor_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"dom Domino object network built (build_domino()) bool Boolean indicating whether heatmap continuous boolean. boolean bool_thresh used determine define activity positive negative. bool_thresh Numeric indicating threshold separating '' '' feature activity making boolean heatmap. title Either string use title boolean describing whether include title. order pass 'main' parameter ComplexHeatmap::Heatmap() must set title FALSE. feats Either vector features include heatmap '' features. left NULL features selected signaling network shown. recs Either vector receptors include heatmap '' receptors. left NULL receptors selected signaling network connected features plotted shown. mark_connections Boolean indicating whether add 'x' cells connected receptor TF. Default FALSE. ... parameters pass ComplexHeatmap::Heatmap() . Note use 'main' parameter ComplexHeatmap::Heatmap() must set title = FALSE use 'annCol' 'annColors' ann_cols must FALSE.","code":""},{"path":"/reference/cor_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/cor_heatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a heatmap of correlation between receptors and transcription factors — cor_heatmap","text":"","code":"receptors <- c(\"FAS\", \"CD22\", \"FCER2\") tfs <- c(\"ZNF257\", \"RUNX1\") cor_heatmap(domino2:::pbmc_dom_built_tiny, feats = tfs, recs = receptors)"},{"path":"/reference/cor_scatter.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"Create correlation plot transcription factor activation score receptor","code":""},{"path":"/reference/cor_scatter.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"","code":"cor_scatter(dom, tf, rec, remove_rec_dropout = TRUE, ...)"},{"path":"/reference/cor_scatter.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"dom Domino object network built (build_domino()) tf Target TF module plotting receptor rec Target receptor plotting TF remove_rec_dropout Whether remove cells zero expression plot. match setting build_domino. ... parameters pass ggscatter.","code":""},{"path":"/reference/cor_scatter.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"ggplot object","code":""},{"path":"/reference/cor_scatter.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a correlation plot between transcription factor activation score and receptor — cor_scatter","text":"","code":"cor_scatter(domino2:::pbmc_dom_built_tiny, \"RUNX1\", \"FAS\")"},{"path":"/reference/count_linkage.html","id":null,"dir":"Reference","previous_headings":"","what":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"Count occurrences linkages across multiple domino results linkage summary","code":""},{"path":"/reference/count_linkage.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"","code":"count_linkage( linkage_summary, cluster, group.by = NULL, linkage = \"rec_lig\", subject_names = NULL )"},{"path":"/reference/count_linkage.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"linkage_summary linkage_summary object cluster name cell cluster compared across multiple domino results group.name column linkage_summary\\@subject_meta group subjects counting. NULL, total counts linkages linkages cluster across subjects given. linkage stored linkage domino object. Can compare ('tfs', 'rec', 'incoming_lig', 'tfs_rec', 'rec_lig') subject_names vector subject_names linkage_summary compared. NULL, subject_names linkage summary included counting.","code":""},{"path":"/reference/count_linkage.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count occurrences of linkages across multiple domino results from a linkage summary — count_linkage","text":"data frame columns unique linkage features counts many times linkage occured across compared domino results. group.used, counts linkages also provided columns named unique values group.variable.","code":""},{"path":"/reference/create_domino.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a domino object and prepare it for network construction — create_domino","title":"Create a domino object and prepare it for network construction — create_domino","text":"function reads receptor ligand signaling database, cell level features kind (ie. output pySCENIC), z-scored single cell data, cluster id single cell data, calculates correlation matrix receptors features (transcription factor module scores using pySCENIC), finds features enriched cluster. return domino object prepared build_domino(), calculate signaling network.","code":""},{"path":"/reference/create_domino.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a domino object and prepare it for network construction — create_domino","text":"","code":"create_domino( rl_map, features, ser = NULL, counts = NULL, z_scores = NULL, clusters = NULL, use_clusters = TRUE, tf_targets = NULL, verbose = TRUE, use_complexes = TRUE, rec_min_thresh = 0.025, remove_rec_dropout = TRUE, tf_selection_method = \"clusters\", tf_variance_quantile = 0.5 )"},{"path":"/reference/create_domino.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a domino object and prepare it for network construction — create_domino","text":"rl_map Data frame row describes receptor-ligand interaction required columns gene_A & gene_B including gene names receptor ligand type_A & type_B annotating genes B ligand (L) receptor (R) features Either path csv containing cell level features interest (ie. auc matrix pySCENIC) named matrix cells columns features rows. ser Seurat object containing scaled RNA expression data RNA assay slot cluster identity. Either ser object z_scores clusters must provided. ser present z_scores clusters ignored. counts Counts matrix data. Seurat object provided ignored. used threshold receptors dropout. z_scores Matrix containing z-scored expression data cells cells columns features rows. Either z_scores clusters must provided ser object. ser present z_scores clusters ignored. clusters Named factor containing cell cluster names cells. Either clusters z_scores ser must provided. ser present z_scores clusters ignored. use_clusters Boolean indicating whether use clusters Seurat object. Seurat object provided parameter ignored. tf_targets Optional. list names transcription factors stored values character vectors genes transcription factor's regulon. verbose Boolean indicating whether print progress computation. use_complexes Boolean indicating whether wish use receptor/ligand complexes receptor ligand signaling database. FALSE, receptor/ligand pairs either functions protein complex considered constructing signaling network. rec_min_thresh Minimum expression level receptors cell. Default 0.025 2.5 percent cells data set. important calculating correlation connect receptors transcription activation. threshold low correlation calculations proceed cells non-zero expression. remove_rec_dropout Whether remove receptors 0 expression counts calculating correlations. can reduce false positive correlation calculations receptors high dropout rates. tf_selection_method Selection method target transcription factors. 'clusters' differential expression clusters calculated. 'variable' variable transcription factors selected. '' transcription factors feature matrix used. Default 'clusters'. Note wish use clusters intercellular signaling downstream MUST choose clusters. tf_variance_quantile proportion variable features take using variance threshold features. Default 0.5. Higher numbers keep features. Ignored tf_selection_method 'variable'","code":""},{"path":"/reference/create_domino.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a domino object and prepare it for network construction — create_domino","text":"domino object","code":""},{"path":"/reference/create_domino.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a domino object and prepare it for network construction — create_domino","text":"","code":"pbmc_dom_tiny_all <- pbmc_dom_tiny <- create_domino(rl_map = domino2:::rl_map_tiny, features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny, clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny, use_clusters = FALSE, use_complexes = FALSE, rec_min_thresh = 0.1, remove_rec_dropout = TRUE, tf_selection_method = \"all\") #> Reading in and processing signaling database #> Database provided from source: CellPhoneDB #> Getting z_scores, clusters, and counts #> Calculating correlations #> 1 of 3 #> 2 of 3 #> 3 of 3 #> FAS has component genes that did not pass testing parameters #> CD22 has component genes that did not pass testing parameters #> IGF1R has component genes that did not pass testing parameters pbmc_dom_tiny_clustered <- create_domino(rl_map = domino2:::rl_map_tiny, features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny, clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny, use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE) #> Reading in and processing signaling database #> Database provided from source: CellPhoneDB #> Getting z_scores, clusters, and counts #> Calculating feature enrichment by cluster #> 1 of 3 #> 2 of 3 #> 3 of 3 #> Calculating correlations #> 1 of 3 #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> 2 of 3 #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> 3 of 3 #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> Warning: Cannot compute exact p-value with ties #> IGF1R has component genes that did not pass testing parameters"},{"path":"/reference/create_regulon_list_scenic.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"Generates list transcription factors genes targeted transcription factor part regulon inferred pySCENIC","code":""},{"path":"/reference/create_regulon_list_scenic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"","code":"create_regulon_list_scenic(regulons)"},{"path":"/reference/create_regulon_list_scenic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"regulons Dataframe file path table output grn (gene regulatory network) function pySCENIC","code":""},{"path":"/reference/create_regulon_list_scenic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"list names transcription factors stored values character vectors genes inferred regulons","code":""},{"path":"/reference/create_regulon_list_scenic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a list of genes in regulons inferred by SCENIC — create_regulon_list_scenic","text":"","code":"regulon_list_tiny <- create_regulon_list_scenic(regulons = domino2:::regulons_tiny)"},{"path":"/reference/create_rl_map_cellphonedb.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"Generates data frame ligand-receptor interactions CellPhoneDB database annotating genes encoding interacting ligands receptors queried transcriptomic data.","code":""},{"path":"/reference/create_rl_map_cellphonedb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"","code":"create_rl_map_cellphonedb( genes, proteins, interactions, complexes = NULL, database_name = \"CellPhoneDB\", gene_conv = NULL, gene_conv_host = \"https://www.ensembl.org\", alternate_convert = FALSE, alternate_convert_table = NULL )"},{"path":"/reference/create_rl_map_cellphonedb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"genes dataframe file path table gene names uniprot, hgnc_symbol, ensembl format cellphonedb database format proteins dataframe file path table protein features cellphonedb format interactions dataframe file path table protein-protein interactions cellphonedb format complexes optional: dataframe file path table protein complexes cellphonedb format database_name name database used, stored output gene_conv tuple (, ) (source, target) gene conversion orthologs desired; options ENSMUSG, ENSG, MGI, HGNC gene_conv_host host conversion; default ensembl, also use mirrors desired alternate_convert boolean like use non-ensembl method conversion (must supply table; recommended, use ensembl ) alternate_convert_table supplied table non-ensembl method conversion","code":""},{"path":"/reference/create_rl_map_cellphonedb.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"Data frame row describes possible receptor-ligand interaction","code":""},{"path":"/reference/create_rl_map_cellphonedb.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a receptor-ligand map from a cellphonedb signaling database — create_rl_map_cellphonedb","text":"","code":"rl_map_tiny <- create_rl_map_cellphonedb(genes = domino2:::genes_tiny, proteins = domino2:::proteins_tiny, interactions = domino2:::interactions_tiny, complexes = domino2:::complexes_tiny)"},{"path":"/reference/do_norm.html","id":null,"dir":"Reference","previous_headings":"","what":"Normalize a matrix to its max value by row or column — do_norm","title":"Normalize a matrix to its max value by row or column — do_norm","text":"Normalizes matrix max value row column","code":""},{"path":"/reference/do_norm.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Normalize a matrix to its max value by row or column — do_norm","text":"","code":"do_norm(mat, dir)"},{"path":"/reference/do_norm.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Normalize a matrix to its max value by row or column — do_norm","text":"mat Matrix normalized dir Direction normalize matrix c('row', 'col')","code":""},{"path":"/reference/do_norm.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Normalize a matrix to its max value by row or column — do_norm","text":"normalized matrix direction specified.","code":""},{"path":"/reference/dom_clusters.html","id":null,"dir":"Reference","previous_headings":"","what":"Access clusters — dom_clusters","title":"Access clusters — dom_clusters","text":"function pull cluster information domino object","code":""},{"path":"/reference/dom_clusters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access clusters — dom_clusters","text":"","code":"dom_clusters(dom, labels = FALSE)"},{"path":"/reference/dom_clusters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access clusters — dom_clusters","text":"dom domino object created create_domino() labels boolean whether return cluster labels cell clusters used inferring communication","code":""},{"path":"/reference/dom_clusters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access clusters — dom_clusters","text":"vector containing either names clusters used factors cluster label individual cell","code":""},{"path":"/reference/dom_clusters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access clusters — dom_clusters","text":"","code":"cluster_names <- dom_clusters(domino2:::pbmc_dom_built_tiny) cell_cluster_label <- dom_clusters(domino2:::pbmc_dom_built_tiny, labels = TRUE)"},{"path":"/reference/dom_correlations.html","id":null,"dir":"Reference","previous_headings":"","what":"Access correlations — dom_correlations","title":"Access correlations — dom_correlations","text":"function pull receptor-transcription factor correlations domino object","code":""},{"path":"/reference/dom_correlations.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access correlations — dom_correlations","text":"","code":"dom_correlations(dom)"},{"path":"/reference/dom_correlations.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access correlations — dom_correlations","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_correlations.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access correlations — dom_correlations","text":"matrix containing correlation values receptor (row) transcription factor (column)","code":""},{"path":"/reference/dom_correlations.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access correlations — dom_correlations","text":"","code":"cor_matrix <- dom_correlations(domino2:::pbmc_dom_built_tiny)"},{"path":"/reference/dom_counts.html","id":null,"dir":"Reference","previous_headings":"","what":"Access counts — dom_counts","title":"Access counts — dom_counts","text":"function pull gene expression domino object","code":""},{"path":"/reference/dom_counts.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access counts — dom_counts","text":"","code":"dom_counts(dom)"},{"path":"/reference/dom_counts.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access counts — dom_counts","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_counts.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access counts — dom_counts","text":"matrix containing gene expression values gene (row) cell (column)","code":""},{"path":"/reference/dom_counts.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access counts — dom_counts","text":"","code":"counts <- dom_counts(domino2:::pbmc_dom_built_tiny)"},{"path":"/reference/dom_database.html","id":null,"dir":"Reference","previous_headings":"","what":"Access database — dom_database","title":"Access database — dom_database","text":"function pull database information domino object","code":""},{"path":"/reference/dom_database.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access database — dom_database","text":"","code":"dom_database(dom, name_only = TRUE)"},{"path":"/reference/dom_database.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access database — dom_database","text":"dom domino object created name_only boolean whether return name database used entire database stored. Default TRUE.","code":""},{"path":"/reference/dom_database.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access database — dom_database","text":"vector unique databases used building domino object data frame includes database information used domino object creation","code":""},{"path":"/reference/dom_database.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access database — dom_database","text":"","code":"database_name <- dom_database(domino2:::pbmc_dom_built_tiny) full_database <- dom_database(domino2:::pbmc_dom_built_tiny, name_only = FALSE)"},{"path":"/reference/dom_de.html","id":null,"dir":"Reference","previous_headings":"","what":"Access differential expression — dom_de","title":"Access differential expression — dom_de","text":"function pull differential expression p values domino object","code":""},{"path":"/reference/dom_de.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access differential expression — dom_de","text":"","code":"dom_de(dom)"},{"path":"/reference/dom_de.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access differential expression — dom_de","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_de.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access differential expression — dom_de","text":"matrix containing p values differential expression transcription factors (rows) cluster (columns)","code":""},{"path":"/reference/dom_de.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access differential expression — dom_de","text":"","code":"de_mat <- dom_de(domino2:::pbmc_dom_built_tiny)"},{"path":"/reference/dom_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Access build information — dom_info","title":"Access build information — dom_info","text":"function pull parameters used running build_domino() domino object","code":""},{"path":"/reference/dom_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access build information — dom_info","text":"","code":"dom_info(dom)"},{"path":"/reference/dom_info.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access build information — dom_info","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access build information — dom_info","text":"list containing booleans whether object created build, list build parameters used build_domino() infer signaling network","code":""},{"path":"/reference/dom_info.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access build information — dom_info","text":"","code":"build_details <- dom_info(domino2:::pbmc_dom_built_tiny)"},{"path":"/reference/dom_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Access linkages — dom_linkages","title":"Access linkages — dom_linkages","text":"function pull linkages domino object","code":""},{"path":"/reference/dom_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access linkages — dom_linkages","text":"","code":"dom_linkages( dom, link_type = c(\"complexes\", \"receptor-ligand\", \"tf-target\", \"tf-receptor\", \"receptor\", \"incoming-ligand\"), by_cluster = FALSE )"},{"path":"/reference/dom_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access linkages — dom_linkages","text":"dom domino object created create_domino() link_type One value (\"complexes\", \"receptor-ligand\", \"tf-target\", \"tf-receptor\", \"receptor\", \"incoming-ligand\") used select desired type linkage by_cluster boolean indicate whether linkages returned overall cluster","code":""},{"path":"/reference/dom_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access linkages — dom_linkages","text":"list containing linkages combination receptors, ligands, transcription factors, clusters","code":""},{"path":"/reference/dom_linkages.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access linkages — dom_linkages","text":"","code":"complexes <- dom_linkages(domino2:::pbmc_dom_built_tiny, \"complexes\") tf_rec_by_cluster <- dom_linkages(domino2:::pbmc_dom_built_tiny, \"tf-receptor\", TRUE)"},{"path":"/reference/dom_network_items.html","id":null,"dir":"Reference","previous_headings":"","what":"Access all features, receptors, or ligands present in a signaling network. — dom_network_items","title":"Access all features, receptors, or ligands present in a signaling network. — dom_network_items","text":"function collates features, receptors, ligands found signaling network anywhere list clusters. can useful comparing signaling networks across two separate conditions. order run build_domino() must run object previously.","code":""},{"path":"/reference/dom_network_items.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access all features, receptors, or ligands present in a signaling network. — dom_network_items","text":"","code":"dom_network_items(dom, clusters = NULL, return = NULL)"},{"path":"/reference/dom_network_items.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access all features, receptors, or ligands present in a signaling network. — dom_network_items","text":"dom Domino object containing signaling network (.e. build_domino() run) clusters Vector indicating clusters collate network items . left NULL clusters included. return String indicating collate \"features\", \"receptors\", \"ligands\". \"\" list three returned.","code":""},{"path":"/reference/dom_network_items.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access all features, receptors, or ligands present in a signaling network. — dom_network_items","text":"vector containing features, receptors, ligands data set list containing three.","code":""},{"path":"/reference/dom_network_items.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access all features, receptors, or ligands present in a signaling network. — dom_network_items","text":"","code":"monocyte_receptors <- dom_network_items(domino2:::pbmc_dom_built_tiny, \"CD14_monocyte\", \"receptors\") all_tfs <- dom_network_items(domino2:::pbmc_dom_built_tiny, return = \"features\")"},{"path":"/reference/dom_signaling.html","id":null,"dir":"Reference","previous_headings":"","what":"Access signaling — dom_signaling","title":"Access signaling — dom_signaling","text":"function pull signaling matrices domino object","code":""},{"path":"/reference/dom_signaling.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access signaling — dom_signaling","text":"","code":"dom_signaling(dom, cluster = NULL)"},{"path":"/reference/dom_signaling.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access signaling — dom_signaling","text":"dom domino object created create_domino() cluster Either NULL indicate global signaling specific cluster ","code":""},{"path":"/reference/dom_signaling.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access signaling — dom_signaling","text":"data.frame containing signaling score ligand (row) cluster (column) data.frame containing global summed signaling scores receptors (rows) ligands (columns) cluster","code":""},{"path":"/reference/dom_signaling.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access signaling — dom_signaling","text":"","code":"monocyte_signaling <- dom_signaling(domino2:::pbmc_dom_built_tiny, cluster = \"CD14_monocyte\")"},{"path":"/reference/dom_tf_activation.html","id":null,"dir":"Reference","previous_headings":"","what":"Access transcription factor activation — dom_tf_activation","title":"Access transcription factor activation — dom_tf_activation","text":"function pull transcription factor activation scores domino object","code":""},{"path":"/reference/dom_tf_activation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access transcription factor activation — dom_tf_activation","text":"","code":"dom_tf_activation(dom)"},{"path":"/reference/dom_tf_activation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access transcription factor activation — dom_tf_activation","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_tf_activation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access transcription factor activation — dom_tf_activation","text":"matrix containing transcription factor activation scores feature (row) cell (column)","code":""},{"path":"/reference/dom_tf_activation.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access transcription factor activation — dom_tf_activation","text":"","code":"tf_activation <- dom_tf_activation(domino2:::pbmc_dom_built_tiny)"},{"path":"/reference/dom_zscores.html","id":null,"dir":"Reference","previous_headings":"","what":"Access z-scores — dom_zscores","title":"Access z-scores — dom_zscores","text":"function pull z-scored expression domino object","code":""},{"path":"/reference/dom_zscores.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Access z-scores — dom_zscores","text":"","code":"dom_zscores(dom)"},{"path":"/reference/dom_zscores.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Access z-scores — dom_zscores","text":"dom domino object created create_domino()","code":""},{"path":"/reference/dom_zscores.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Access z-scores — dom_zscores","text":"matrix containing z-scored gene expression values gene (row) cell (column)","code":""},{"path":"/reference/dom_zscores.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Access z-scores — dom_zscores","text":"","code":"zscores <- dom_zscores(domino2:::pbmc_dom_built_tiny)"},{"path":"/reference/domino-class.html","id":null,"dir":"Reference","previous_headings":"","what":"The domino Class — domino-class","title":"The domino Class — domino-class","text":"domino class contains information necessary calculate receptor-ligand signaling. contains z-scored expression, cell cluster labels, feature values, referenced receptor-ligand database formatted receptor-ligand map. Calculated intermediate values also stored.","code":""},{"path":"/reference/domino-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"The domino Class — domino-class","text":"db_info List data sets lr database. counts Raw count gene expression data z_scores Matrix z-scored expression data cells columns clusters Named factor cluster identity cell features Matrix features correlate receptor-ligand expression . Cells columns features rows. cor Correlation matrix receptor expression features. linkages List lists containing info linking cluster->tf->rec->lig clust_de Data frame containing differential expression results features cluster. misc List miscellaneous info pertaining run parameters etc. cl_signaling_matrices Incoming signaling matrix cluster signaling Signaling matrix clusters.","code":""},{"path":"/reference/feat_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a heatmap of features organized by cluster — feat_heatmap","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"Creates heatmap feature expression (typically transcription factor activation scores) cells organized cluster.","code":""},{"path":"/reference/feat_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"","code":"feat_heatmap( dom, feats = NULL, bool = FALSE, bool_thresh = 0.2, title = TRUE, norm = FALSE, cols = NULL, ann_cols = TRUE, min_thresh = NULL, max_thresh = NULL, ... )"},{"path":"/reference/feat_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"dom Domino object network built (build_domino()) feats Either vector features include heatmap '' features. left NULL features selected signaling network shown. bool Boolean indicating whether heatmap continuous boolean. boolean bool_thresh used determine define activity positive negative. bool_thresh Numeric indicating threshold separating '' '' feature activity making boolean heatmap. title Either string use title boolean describing whether include title. order pass 'main' parameter ComplexHeatmap::Heatmap() must set title FALSE. norm Boolean indicating whether normalize transcrption factors max value. cols Named vector colors annotate cells cluster color. Values taken colors names cluster. left NULL default ggplot colors generated. ann_cols Boolean indicating whether include cell cluster column annotation. Colors can defined cols. FALSE custom annotations can passed NMF. min_thresh Minimum threshold color scaling boolean heatmap max_thresh Maximum threshold color scaling boolean heatmap ... parameters pass ComplexHeatmap::Heatmap() . Note use 'main' parameter ComplexHeatmap::Heatmap() must set title = FALSE use 'annCol' 'annColors' ann_cols must FALSE.","code":""},{"path":"/reference/feat_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/feat_heatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a heatmap of features organized by cluster — feat_heatmap","text":"","code":"feat_heatmap(domino2:::pbmc_dom_built_tiny, min_thresh = 0.1, max_thresh = 0.6, norm = TRUE) #> Warning: You are using norm with min_thresh and max_thresh. Note that values will be thresholded AFTER normalization."},{"path":"/reference/gene_network.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a gene association network — gene_network","title":"Create a gene association network — gene_network","text":"Create gene association network genes given cluster. selected cluster acts receptor gene association network, ligands, receptors, features associated receptor cluster included plot.","code":""},{"path":"/reference/gene_network.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a gene association network — gene_network","text":"","code":"gene_network( dom, clust = NULL, OutgoingSignalingClust = NULL, class_cols = c(lig = \"#FF685F\", rec = \"#47a7ff\", feat = \"#39C740\"), cols = NULL, lig_scale = 1, layout = \"grid\", ... )"},{"path":"/reference/gene_network.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a gene association network — gene_network","text":"dom Domino object network built (build_domino()) clust Receptor cluster create gene association network . vector clusters may provided. OutgoingSignalingClust Vector clusters plot outgoing signaling class_cols Named vector colors used color classes vertices. Values must colors names must classes ('rec', 'lig', 'feat' receptors, ligands, features.). cols Named vector colors individual genes. Genes included vector colored according class_cols. lig_scale FALSE numeric value scale size ligand vertices based z-scored expression data set. layout Type layout use. Options 'grid', 'random', 'sphere', 'circle', 'fr' Fruchterman-Reingold force directed layout, 'kk' Kamada Kawai directed layout. ... parameters pass plot() igraph object. See igraph manual options.","code":""},{"path":"/reference/gene_network.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a gene association network — gene_network","text":"igraph rendered active graphics device","code":""},{"path":"/reference/gene_network.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a gene association network — gene_network","text":"","code":"gene_network(domino2:::pbmc_dom_built_tiny, clust = \"CD8_T_cell\", OutgoingSignalingClust = \"CD14_monocyte\")"},{"path":"/reference/ggplot_col_gen.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate ggplot colors — ggplot_col_gen","title":"Generate ggplot colors — ggplot_col_gen","text":"Accepts number colors generate generates ggplot color spectrum.","code":""},{"path":"/reference/ggplot_col_gen.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate ggplot colors — ggplot_col_gen","text":"","code":"ggplot_col_gen(n)"},{"path":"/reference/ggplot_col_gen.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate ggplot colors — ggplot_col_gen","text":"n Number colors generate","code":""},{"path":"/reference/ggplot_col_gen.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate ggplot colors — ggplot_col_gen","text":"vector colors according ggplot color generation.","code":""},{"path":"/reference/incoming_signaling_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"Creates heatmap cluster incoming signaling matrix. cluster list ligands capable activating enriched transcription factors. function creates heatmap cluster average expression ligands. list cluster incoming signaling matrices can found cl_signaling_matrices slot domino option alternative plotting function.","code":""},{"path":"/reference/incoming_signaling_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"","code":"incoming_signaling_heatmap( dom, rec_clust, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, scale = \"none\", normalize = \"none\", title = TRUE, ... )"},{"path":"/reference/incoming_signaling_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"dom Domino object network built (build_domino()) rec_clust cluster select receptor. Must match naming clusters domino object. clusts Vector clusters included. NULL clusters used. min_thresh Minimum signaling threshold plotting. Defaults -Inf threshold. max_thresh Maximum signaling threshold plotting. Defaults Inf threshold. scale scale values (thresholding). Options 'none', 'sqrt' square root, 'log' log10. normalize Options normalize matrix. Accepted inputs 'none' normalization, 'rec_norm' normalize maximum value receptor cluster, 'lig_norm' normalize maximum value within ligand cluster title Either string use title boolean describing whether include title. order pass 'main' parameter ComplexHeatmap::Heatmap() must set title FALSE. ... parameters pass ComplexHeatmap::Heatmap(). Note use 'column_title' parameter ComplexHeatmap::Heatmap() must set title = FALSE","code":""},{"path":"/reference/incoming_signaling_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/incoming_signaling_heatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a cluster incoming signaling heatmap — incoming_signaling_heatmap","text":"","code":"incoming_signaling_heatmap(domino2:::pbmc_dom_built_tiny, \"CD8_T_cell\")"},{"path":"/reference/lc.html","id":null,"dir":"Reference","previous_headings":"","what":"Pulls all items from a list pooled into a single vector — lc","title":"Pulls all items from a list pooled into a single vector — lc","text":"Helper function convert nested series lists single vector.","code":""},{"path":"/reference/lc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pulls all items from a list pooled into a single vector — lc","text":"","code":"lc(list, list_names)"},{"path":"/reference/lc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pulls all items from a list pooled into a single vector — lc","text":"list List pull items list_names Names items list pool","code":""},{"path":"/reference/lc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pulls all items from a list pooled into a single vector — lc","text":"vector contaning items list list_names","code":""},{"path":"/reference/linkage_summary-class.html","id":null,"dir":"Reference","previous_headings":"","what":"The domino linkage summary class — linkage_summary-class","title":"The domino linkage summary class — linkage_summary-class","text":"linkage summary class contains linkages established multiple domino objects gene regulatory network inference reference receptor- ligand data bases. data frame summarizing meta features describe domino objects compared linkage summary facilitates comparisons established linkages differential signaling interactions across categorical sample covariates.","code":""},{"path":"/reference/linkage_summary-class.html","id":"slots","dir":"Reference","previous_headings":"","what":"Slots","title":"The domino linkage summary class — linkage_summary-class","text":"subject_names unique names domino result included summary subject_meta data.frame row describing one subject columns describing features subjects draw comparisons signaling networks subject_linkages nested list linkages inferred subject. Lists stored heirarchical structure subject-cluster-linkage linkages include transcription factors (tfs), linkages transcription factors receptors (tfs_rec), active receptors (rec), possible receptor-ligand interactions (rec_lig), incoming ligands (incoming_lig)","code":""},{"path":"/reference/mean_ligand_expression.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"Creates data frame mean ligand expression use plotting circos plot ligand expression saving tables mean expression.","code":""},{"path":"/reference/mean_ligand_expression.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"","code":"mean_ligand_expression(x, ligands, cell_ident, cell_barcodes, destination)"},{"path":"/reference/mean_ligand_expression.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"x Gene cell expression matrix ligands Character vector ligand genes quantified cell_ident Vector cell type (identity) names calculate mean ligand gene expression cell_barcodes Vector cell barcodes (colnames x) belonging cell_ident calculate mean expression across destination Name receptor ligand interacts","code":""},{"path":"/reference/mean_ligand_expression.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"data frame ligand expression targeting specified receptor","code":""},{"path":"/reference/mean_ligand_expression.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate mean ligand expression as a data.frame for plotting in circos plot — mean_ligand_expression","text":"","code":"counts <- dom_counts(domino2:::pbmc_dom_built_tiny) mean_exp <- mean_ligand_expression(counts, ligands = c(\"PTPRC\", \"FASLG\"), cell_ident = \"CD14_monocyte\", cell_barcodes = colnames(counts), destination = \"FAS\")"},{"path":"/reference/pbmc.html","id":null,"dir":"Reference","previous_headings":"","what":"PBMC3K single cell RNA sequencing data — pbmc","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"small example single cell data set 10x genomcs","code":""},{"path":"/reference/pbmc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"","code":"pbmc"},{"path":[]},{"path":"/reference/pbmc.html","id":"pbmc","dir":"Reference","previous_headings":"","what":"pbmc","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"Seurat object preliminary analysis, including normalization, scaling, PCA, UMAP, clustering, cluster annotation","code":""},{"path":"/reference/pbmc.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"PBMC3K single cell RNA sequencing data — pbmc","text":"https://cf.10xgenomics.com/samples/cell/pbmc3k/pbmc3k_filtered_gene_bc_matrices.tar.gz","code":""},{"path":"/reference/pbmc_dom.html","id":null,"dir":"Reference","previous_headings":"","what":"Example domino object from pbmc3k data — pbmc_dom","title":"Example domino object from pbmc3k data — pbmc_dom","text":"small example single cell data set 10x Genomics preliminary analysis, including normalization, scaling, PCA, UMAP, clustering, cluster annotation used example domino2 analysis.","code":""},{"path":"/reference/pbmc_dom.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example domino object from pbmc3k data — pbmc_dom","text":"","code":"data(pbmc_dom)"},{"path":[]},{"path":"/reference/pbmc_dom.html","id":"pbmc-dom","dir":"Reference","previous_headings":"","what":"pbmc_dom","title":"Example domino object from pbmc3k data — pbmc_dom","text":"domino object based 10x Genomics pbmc3k data set serves example tutorials can also used explore object structure functionality.","code":""},{"path":"/reference/plot_differential_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"Plot differential linkages among domino results ranked comparative statistic","code":""},{"path":"/reference/plot_differential_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"","code":"plot_differential_linkages( differential_linkages, test_statistic, stat_range = c(0, 1), stat_ranking = c(\"ascending\", \"descending\"), group_palette = NULL )"},{"path":"/reference/plot_differential_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"differential_linkages data.frame output test_differential_linkages function test_statistic column name differential_linkages test statistic used ranking linkages stored (ex. 'p.value') stat_range two value vector minimum maximum values test_statistic plotting linkage features stat_ranking 'ascending' (lowest value test statisic colored red plotted top) 'descending' (highest value test statistic colored red plotted top). group_palette named vector colors use group compared","code":""},{"path":"/reference/plot_differential_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot differential linkages among domino results ranked by a comparative statistic — plot_differential_linkages","text":"Heatmap-class object features ranked test_statistic annotated proportion subjects showed active linkage features.","code":""},{"path":"/reference/print-domino-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Print domino object — print,domino-method","title":"Print domino object — print,domino-method","text":"Prints summary domino object","code":""},{"path":"/reference/print-domino-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Print domino object — print,domino-method","text":"","code":"# S4 method for domino print(x, ...)"},{"path":"/reference/print-domino-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Print domino object — print,domino-method","text":"x Domino object","code":""},{"path":"/reference/print-domino-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Print domino object — print,domino-method","text":"printed description number cell clusters object","code":""},{"path":"/reference/print-domino-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Print domino object — print,domino-method","text":"","code":"print(domino2:::pbmc_dom_built_tiny) #> A domino object of 360 cells #> Built with signaling between 3 clusters"},{"path":"/reference/rename_clusters.html","id":null,"dir":"Reference","previous_headings":"","what":"Renames clusters in a domino object — rename_clusters","title":"Renames clusters in a domino object — rename_clusters","text":"function reads receptor ligand signaling database, cell level features kind (ie. output pySCENIC), z-scored single cell data, cluster id single cell data, calculates correlation matrix receptors features (transcription factor module scores using pySCENIC), finds features enriched cluster. return domino object prepared build_domino(), calculate signaling network.","code":""},{"path":"/reference/rename_clusters.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Renames clusters in a domino object — rename_clusters","text":"","code":"rename_clusters(dom, clust_conv)"},{"path":"/reference/rename_clusters.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Renames clusters in a domino object — rename_clusters","text":"dom Domino object rename clusters clust_conv Named vector conversions old new clusters. Values taken new clusters IDs names old cluster IDs.","code":""},{"path":"/reference/rename_clusters.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Renames clusters in a domino object — rename_clusters","text":"domino object clusters renamed applicable slots.","code":""},{"path":"/reference/rename_clusters.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Renames clusters in a domino object — rename_clusters","text":"","code":"new_clust <- c(\"CD8_T_cell\" = \"CD8+ T Cells\", \"CD14_monocyte\" = \"CD14+ Monocytes\", \"B_cell\" = \"B Cells\") pbmc_dom_built_tiny <- rename_clusters(domino2:::pbmc_dom_built_tiny, new_clust)"},{"path":"/reference/show-domino-method.html","id":null,"dir":"Reference","previous_headings":"","what":"Show domino object information — show,domino-method","title":"Show domino object information — show,domino-method","text":"Shows content overview domino object","code":""},{"path":"/reference/show-domino-method.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Show domino object information — show,domino-method","text":"","code":"# S4 method for domino show(object)"},{"path":"/reference/show-domino-method.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Show domino object information — show,domino-method","text":"object Domino object","code":""},{"path":"/reference/show-domino-method.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Show domino object information — show,domino-method","text":"printed description number cells domino object build status","code":""},{"path":"/reference/show-domino-method.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Show domino object information — show,domino-method","text":"","code":"domino2:::pbmc_dom_built_tiny #> A domino object of 360 cells #> Built with signaling between 3 clusters show(domino2:::pbmc_dom_built_tiny) #> A domino object of 360 cells #> Built with signaling between 3 clusters"},{"path":"/reference/signaling_heatmap.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a network heatmap — signaling_heatmap","title":"Create a network heatmap — signaling_heatmap","text":"Creates heatmap signaling network. Alternatively, network matrix can accessed directly signaling slot domino object.","code":""},{"path":"/reference/signaling_heatmap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a network heatmap — signaling_heatmap","text":"","code":"signaling_heatmap( dom, clusts = NULL, min_thresh = -Inf, max_thresh = Inf, scale = \"none\", normalize = \"none\", ... )"},{"path":"/reference/signaling_heatmap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a network heatmap — signaling_heatmap","text":"dom Domino object network built (build_domino()) clusts Vector clusters included. NULL clusters used. min_thresh Minimum signaling threshold plotting. Defaults -Inf threshold. max_thresh Maximum signaling threshold plotting. Defaults Inf threshold. scale scale values (thresholding). Options 'none', 'sqrt' square root, 'log' log10. normalize Options normalize matrix. Normalization done thresholding scaling. Accepted inputs 'none' normalization, 'rec_norm' normalize maximum value receptor cluster, 'lig_norm' normalize maximum value within ligand cluster ... parameters pass ComplexHeatmap::Heatmap()","code":""},{"path":"/reference/signaling_heatmap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a network heatmap — signaling_heatmap","text":"Heatmap rendered active graphics device","code":""},{"path":"/reference/signaling_heatmap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a network heatmap — signaling_heatmap","text":"","code":"signaling_heatmap(domino2:::pbmc_dom_built_tiny)"},{"path":"/reference/signaling_network.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a cluster to cluster signaling network diagram — signaling_network","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"Creates network diagram signaling clusters. Nodes clusters directed edges indicate signaling one cluster another. Edges colored based color scheme ligand expressing cluster.","code":""},{"path":"/reference/signaling_network.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"","code":"signaling_network( dom, cols = NULL, edge_weight = 0.3, clusts = NULL, showOutgoingSignalingClusts = NULL, showIncomingSignalingClusts = NULL, min_thresh = -Inf, max_thresh = Inf, normalize = \"none\", scale = \"sq\", layout = \"circle\", scale_by = \"rec_sig\", vert_scale = 3, plot_title = NULL, ... )"},{"path":"/reference/signaling_network.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"dom Domino object network built (build_domino()) cols Named vector indicating colors clusters. Values colors names must match clusters domino object. left NULL ggplot colors generated clusters. edge_weight Weight determining thickness edges plot. Signaling values multiplied value. clusts Vector clusters included network plot. showOutgoingSignalingClusts Vector clusters plot outgoing signaling showIncomingSignalingClusts Vector clusters plot incoming signaling min_thresh Minimum signaling threshold. Values lower threshold set threshold. Defaults -Inf threshold. max_thresh Maximum signaling threshold plotting. Values higher threshold set threshold. Defaults Inf threshold. normalize Options normalize signaling matrix. Accepted inputs 'none' normalization, 'rec_norm' normalize maximum value receptor cluster, 'lig_norm' normalize maximum value within ligand cluster scale scale values (thresholding). Options 'none', 'sqrt' square root, 'log' log10, 'sq' square. layout Type layout use. Options 'random', 'sphere', 'circle', 'fr' Fruchterman-Reingold force directed layout, 'kk' Kamada Kawai directed layout. scale_by size vertices. Options 'lig_sig' summed outgoing signaling, 'rec_sig' summed incoming signaling, 'none'. former two cases values scaled asinh summing incoming outgoing signaling. vert_scale Integer used scale size vertices without variable scaling size_verts_by. plot_title Text plot's title. ... parameters passed plot used {igraph} object.","code":""},{"path":"/reference/signaling_network.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"igraph rendered active graphics device","code":""},{"path":"/reference/signaling_network.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a cluster to cluster signaling network diagram — signaling_network","text":"","code":"signaling_network(domino2:::pbmc_dom_built_tiny, layout = \"fr\")"},{"path":"/reference/summarize_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Summarize linkages from multiple domino objects — summarize_linkages","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"Creates linkage_summary object storing linkages learned different domino objects nested lists facilitate comparisons networks learned domino across subject covariates.","code":""},{"path":"/reference/summarize_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"","code":"summarize_linkages(domino_results, subject_meta, subject_names = NULL)"},{"path":"/reference/summarize_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"domino_results list domino result one domino object per subject. Names list must match subject_names. subject_meta dataframe includes subject features objects grouped. first column must subject names subject_names vector subject names domino_results. NULL, defaults first column subject_meta.","code":""},{"path":"/reference/summarize_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Summarize linkages from multiple domino objects — summarize_linkages","text":"linkage summary class object consisting nested lists active transcription factors, active receptors, incoming ligands cluster across multiple domino results.","code":""},{"path":"/reference/table_convert_genes.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert Genes Using Table — table_convert_genes","title":"Convert Genes Using Table — table_convert_genes","text":"Takes vector gene inputs conversion table (example returns converted gene table","code":""},{"path":"/reference/table_convert_genes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert Genes Using Table — table_convert_genes","text":"","code":"table_convert_genes(genes, from, to, conversion_table)"},{"path":"/reference/table_convert_genes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert Genes Using Table — table_convert_genes","text":"genes genes convert. Gene symbol type input (ENSG, ENSMUSG, HGNC, MGI) Desired gene symbol type output (HGNC, MGI) conversion_table data.frame column names corresponding gene symbol types (mm.ens, hs.ens, mgi, hgnc) rows corresponding gene symbols ","code":""},{"path":"/reference/table_convert_genes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert Genes Using Table — table_convert_genes","text":"Data frame genes original corresponding converted symbols","code":""},{"path":"/reference/test_differential_linkages.html","id":null,"dir":"Reference","previous_headings":"","what":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"Statistical test differential linkages across multiple domino results","code":""},{"path":"/reference/test_differential_linkages.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"","code":"test_differential_linkages( linkage_summary, cluster, group.by, linkage = \"rec_lig\", subject_names = NULL, test_name = \"fishers.exact\" )"},{"path":"/reference/test_differential_linkages.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"linkage_summary linkage_summary object cluster name cell cluster compared across multiple domino results group.name column linkage_summary\\@subject_meta group subjects counting. linkage stored linkage domino object. Can compare ('tfs', 'rec', 'incoming_lig', 'tfs_rec', 'rec_lig') subject_names vector subject_names linkage_summary compared. NULL, subject_names linkage summary included counting. test_name statistical test used comparison. 'fishers.exact' : Fisher's exact test dependence proportion subjects active linkage cluster group subject belongs group.variable. Provides odds ratio, p-value, Benjamini-Hochberg FDR-adjusted p-value (p.adj) linkage tested.","code":""},{"path":"/reference/test_differential_linkages.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Statistical test for differential linkages across multiple domino results — test_differential_linkages","text":"data frame results test differential linkages. Rows correspond linkage tested. Columns correspond : 'cluster' : name cell cluster compared 'linkage' : type linkage compared 'group.' : grouping variable 'test_name' : test used comparison 'feature' : individual linkages compared 'test statistics' : test statistics provided based test method. 'fishers.exact' provides odds ratio, p-value, fdr-adjusted p-value. 'total_count' : total number subjects linkage active 'X_count' : number subjects category group.(X) linkage active 'total_n' : number total subjects compared 'X_n' : total number subjects category group.(X)","code":""}] diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 3722c37..0ad6e8e 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -96,6 +96,9 @@ /reference/dom_linkages.html + + /reference/dom_network_items.html + /reference/dom_signaling.html diff --git a/man/add_rl_column.Rd b/man/add_rl_column.Rd index 9ce2bb4..1eae5d0 100644 --- a/man/add_rl_column.Rd +++ b/man/add_rl_column.Rd @@ -22,3 +22,9 @@ An updated RL signaling data frame This function adds a column to the internal rl 'map' used to map all receptor and receptor complexes to all ligand and ligand complexes. } +\examples{ +lr_name <- data.frame("abbrev" = c("L", "R"), "full" = c("Ligand", "Receptor")) +rl_map_expanded <- add_rl_column(map = domino2:::rl_map_tiny, map_ref = "type_A", + conv = lr_name, new_name = "type_A_full") + +} diff --git a/man/build_domino.Rd b/man/build_domino.Rd index 54902d5..576ce62 100644 --- a/man/build_domino.Rd +++ b/man/build_domino.Rd @@ -34,3 +34,8 @@ This function calculates a signaling network. It requires a domino object preprocessed from create_domino and returns a domino object prepared for plotting with the various plotting functions in this package. } +\examples{ +pbmc_dom_tiny_built <- build_domino(dom = domino2:::pbmc_dom_tiny, min_tf_pval = .001, max_tf_per_clust = 25, + max_rec_per_tf = 25, rec_tf_cor_threshold = .25, min_rec_percentage = 0.1) + +} diff --git a/man/cor_scatter.Rd b/man/cor_scatter.Rd index 743ca09..5f48cdc 100644 --- a/man/cor_scatter.Rd +++ b/man/cor_scatter.Rd @@ -24,6 +24,5 @@ a ggplot object Create a correlation plot between transcription factor activation score and receptor } \examples{ -#basic usage -cor_scatter(domino2:::pbmc_dom_built_tiny, "ATF4","CD22") +cor_scatter(domino2:::pbmc_dom_built_tiny, "RUNX1", "FAS") } diff --git a/man/create_domino.Rd b/man/create_domino.Rd index afaa728..574029e 100644 --- a/man/create_domino.Rd +++ b/man/create_domino.Rd @@ -62,3 +62,16 @@ using pySCENIC), and finds features enriched by cluster. It will return a domino object prepared for \code{\link[=build_domino]{build_domino()}}, which will calculate a signaling network. } +\examples{ +pbmc_dom_tiny_all <- pbmc_dom_tiny <- create_domino(rl_map = domino2:::rl_map_tiny, + features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny, + clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny, use_clusters = FALSE, + use_complexes = FALSE, rec_min_thresh = 0.1, remove_rec_dropout = TRUE, + tf_selection_method = "all") + +pbmc_dom_tiny_clustered <- create_domino(rl_map = domino2:::rl_map_tiny, + features = domino2:::auc_tiny, counts = domino2:::RNA_count_tiny, z_scores = domino2:::RNA_zscore_tiny, + clusters = domino2:::clusters_tiny, tf_targets = domino2:::regulon_list_tiny, + use_clusters = TRUE, use_complexes = TRUE, remove_rec_dropout = FALSE) + +} diff --git a/man/create_regulon_list_scenic.Rd b/man/create_regulon_list_scenic.Rd index 26b8418..bda1001 100644 --- a/man/create_regulon_list_scenic.Rd +++ b/man/create_regulon_list_scenic.Rd @@ -15,3 +15,7 @@ A list where names are transcription factors and the stored values are character \description{ Generates a list of transcription factors and the genes targeted by the transcription factor as part of their regulon inferred by pySCENIC } +\examples{ +regulon_list_tiny <- create_regulon_list_scenic(regulons = domino2:::regulons_tiny) + +} diff --git a/man/create_rl_map_cellphonedb.Rd b/man/create_rl_map_cellphonedb.Rd index 9156776..5f6389d 100644 --- a/man/create_rl_map_cellphonedb.Rd +++ b/man/create_rl_map_cellphonedb.Rd @@ -41,3 +41,9 @@ Data frame where each row describes a possible receptor-ligand interaction \description{ Generates a data frame of ligand-receptor interactions from a CellPhoneDB database annotating the genes encoding the interacting ligands and receptors to be queried in transcriptomic data. } +\examples{ +rl_map_tiny <- create_rl_map_cellphonedb(genes = domino2:::genes_tiny, + proteins = domino2:::proteins_tiny, interactions = domino2:::interactions_tiny, + complexes = domino2:::complexes_tiny) + +} diff --git a/man/dom_clusters.Rd b/man/dom_clusters.Rd index 0dccbe7..816331b 100644 --- a/man/dom_clusters.Rd +++ b/man/dom_clusters.Rd @@ -17,3 +17,8 @@ A vector containing either the names of the clusters used OR factors of the clus \description{ A function to pull cluster information from a domino object } +\examples{ +cluster_names <- dom_clusters(domino2:::pbmc_dom_built_tiny) +cell_cluster_label <- dom_clusters(domino2:::pbmc_dom_built_tiny, labels = TRUE) + +} diff --git a/man/dom_correlations.Rd b/man/dom_correlations.Rd index 761c05c..b2a0126 100644 --- a/man/dom_correlations.Rd +++ b/man/dom_correlations.Rd @@ -15,3 +15,7 @@ A matrix containing the correlation values for each receptor (row) by transcript \description{ A function to pull receptor-transcription factor correlations from a domino object } +\examples{ +cor_matrix <- dom_correlations(domino2:::pbmc_dom_built_tiny) + +} diff --git a/man/dom_counts.Rd b/man/dom_counts.Rd index d4275b3..5b96f6d 100644 --- a/man/dom_counts.Rd +++ b/man/dom_counts.Rd @@ -15,3 +15,7 @@ A matrix containing the gene expression values for each gene (row) by cell (colu \description{ A function to pull gene expression from a domino object } +\examples{ +counts <- dom_counts(domino2:::pbmc_dom_built_tiny) + +} diff --git a/man/dom_database.Rd b/man/dom_database.Rd index 73ea3a1..d45fdb4 100644 --- a/man/dom_database.Rd +++ b/man/dom_database.Rd @@ -19,3 +19,8 @@ a data frame that includes the database information used in the domino object cr \description{ A function to pull database information from a domino object } +\examples{ +database_name <- dom_database(domino2:::pbmc_dom_built_tiny) +full_database <- dom_database(domino2:::pbmc_dom_built_tiny, name_only = FALSE) + +} diff --git a/man/dom_de.Rd b/man/dom_de.Rd index 02a425d..87712d2 100644 --- a/man/dom_de.Rd +++ b/man/dom_de.Rd @@ -15,3 +15,7 @@ A matrix containing the p values for differential expression of transcription fa \description{ A function to pull differential expression p values from a domino object } +\examples{ +de_mat <- dom_de(domino2:::pbmc_dom_built_tiny) + +} diff --git a/man/dom_info.Rd b/man/dom_info.Rd index 153123b..455b6ff 100644 --- a/man/dom_info.Rd +++ b/man/dom_info.Rd @@ -16,3 +16,7 @@ build parameters that were used in \code{\link[=build_domino]{build_domino()}} t \description{ A function to pull the parameters used when running \code{\link[=build_domino]{build_domino()}} from a domino object } +\examples{ +build_details <- dom_info(domino2:::pbmc_dom_built_tiny) + +} diff --git a/man/dom_linkages.Rd b/man/dom_linkages.Rd index e11d9b1..42238c5 100644 --- a/man/dom_linkages.Rd +++ b/man/dom_linkages.Rd @@ -26,3 +26,8 @@ A list containing linkages between some combination of receptors, ligands, trans \description{ A function to pull linkages from a domino object } +\examples{ +complexes <- dom_linkages(domino2:::pbmc_dom_built_tiny, "complexes") +tf_rec_by_cluster <- dom_linkages(domino2:::pbmc_dom_built_tiny, "tf-receptor", TRUE) + +} diff --git a/man/collate_network_items.Rd b/man/dom_network_items.Rd similarity index 54% rename from man/collate_network_items.Rd rename to man/dom_network_items.Rd index bbf4ce8..85870b9 100644 --- a/man/collate_network_items.Rd +++ b/man/dom_network_items.Rd @@ -1,17 +1,17 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/convenience_fxns.R -\name{collate_network_items} -\alias{collate_network_items} -\title{Extracts all features, receptors, or ligands present in a signaling network.} +% Please edit documentation in R/utils.R +\name{dom_network_items} +\alias{dom_network_items} +\title{Access all features, receptors, or ligands present in a signaling network.} \usage{ -collate_network_items(dom, clusters = NULL, return = NULL) +dom_network_items(dom, clusters = NULL, return = NULL) } \arguments{ -\item{dom}{Domino object containing a signaling network (i.e. \code{\link[=build_domino]{build_domino()}} run)} +\item{dom}{Domino object containing a signaling network (i.e. \code{\link[=build_domino]{build_domino()}} was run)} \item{clusters}{Vector indicating clusters to collate network items from. If left as NULL then all clusters will be included.} -\item{return}{String indicating where to collate 'features', 'receptors', or 'ligands'. If 'all' then a list of all three will be returned.} +\item{return}{String indicating where to collate "features", "receptors", or "ligands". If "all" then a list of all three will be returned.} } \value{ A vector containing all features, receptors, or ligands in the data set or a list containing all three. @@ -22,3 +22,8 @@ signaling network anywhere in a list of clusters. This can be useful for comparing signaling networks across two separate conditions. In order to run this \code{\link[=build_domino]{build_domino()}} must be run on the object previously. } +\examples{ +monocyte_receptors <- dom_network_items(domino2:::pbmc_dom_built_tiny, "CD14_monocyte", "receptors") +all_tfs <- dom_network_items(domino2:::pbmc_dom_built_tiny, return = "features") + +} diff --git a/man/dom_signaling.Rd b/man/dom_signaling.Rd index c931617..6c189b5 100644 --- a/man/dom_signaling.Rd +++ b/man/dom_signaling.Rd @@ -18,3 +18,7 @@ a data.frame containing the global summed signaling scores between receptors (ro \description{ A function to pull signaling matrices from a domino object } +\examples{ +monocyte_signaling <- dom_signaling(domino2:::pbmc_dom_built_tiny, cluster = "CD14_monocyte") + +} diff --git a/man/dom_tf_activation.Rd b/man/dom_tf_activation.Rd index 1c96ff1..e1b756d 100644 --- a/man/dom_tf_activation.Rd +++ b/man/dom_tf_activation.Rd @@ -15,3 +15,7 @@ A matrix containing the transcription factor activation scores for each feature \description{ A function to pull transcription factor activation scores from a domino object } +\examples{ +tf_activation <- dom_tf_activation(domino2:::pbmc_dom_built_tiny) + +} diff --git a/man/dom_zscores.Rd b/man/dom_zscores.Rd index 28122a8..36ae0e9 100644 --- a/man/dom_zscores.Rd +++ b/man/dom_zscores.Rd @@ -15,3 +15,7 @@ A matrix containing the z-scored gene expression values for each gene (row) by c \description{ A function to pull z-scored expression from a domino object } +\examples{ +zscores <- dom_zscores(domino2:::pbmc_dom_built_tiny) + +} diff --git a/man/mean_ligand_expression.Rd b/man/mean_ligand_expression.Rd index 6cfad56..0345778 100644 --- a/man/mean_ligand_expression.Rd +++ b/man/mean_ligand_expression.Rd @@ -24,3 +24,10 @@ A data frame of ligand expression targeting the specified receptor Creates a data frame of mean ligand expression for use in plotting a circos plot of ligand expression and saving tables of mean expression. } +\examples{ +counts <- dom_counts(domino2:::pbmc_dom_built_tiny) +mean_exp <- mean_ligand_expression(counts, + ligands = c("PTPRC", "FASLG"), cell_ident = "CD14_monocyte", + cell_barcodes = colnames(counts), destination = "FAS") + +} diff --git a/man/print-domino-method.Rd b/man/print-domino-method.Rd index 471af3d..0ca717f 100644 --- a/man/print-domino-method.Rd +++ b/man/print-domino-method.Rd @@ -14,5 +14,9 @@ a printed description of the number of cell clusters in the object } \description{ Prints a summary of a domino object +} +\examples{ +print(domino2:::pbmc_dom_built_tiny) + } \keyword{internal} diff --git a/man/rename_clusters.Rd b/man/rename_clusters.Rd index 8411bed..3f73f45 100644 --- a/man/rename_clusters.Rd +++ b/man/rename_clusters.Rd @@ -22,5 +22,11 @@ receptors and other features (this is transcription factor module scores if using pySCENIC), and finds features enriched by cluster. It will return a domino object prepared for \code{\link[=build_domino]{build_domino()}}, which will calculate a signaling network. +} +\examples{ +new_clust <- c("CD8_T_cell" = "CD8+ T Cells", + "CD14_monocyte" = "CD14+ Monocytes", "B_cell" = "B Cells") +pbmc_dom_built_tiny <- rename_clusters(domino2:::pbmc_dom_built_tiny, new_clust) + } \keyword{internal} diff --git a/man/show-domino-method.Rd b/man/show-domino-method.Rd index c31166b..90eae3b 100644 --- a/man/show-domino-method.Rd +++ b/man/show-domino-method.Rd @@ -14,5 +14,11 @@ a printed description of the number of cells in a domino object and its build st } \description{ Shows content overview of domino object +} +\examples{ +domino2:::pbmc_dom_built_tiny + +show(domino2:::pbmc_dom_built_tiny) + } \keyword{internal} diff --git a/man/table_convert_genes.Rd b/man/table_convert_genes.Rd index 6bb7906..5736502 100644 --- a/man/table_convert_genes.Rd +++ b/man/table_convert_genes.Rd @@ -20,6 +20,7 @@ and rows corresponding to the gene symbols themselves} Data frame of genes with original and corresponding converted symbols } \description{ -Takes a vector of gene inputs and returns converted gene table +Takes a vector of gene inputs and a conversion table (\href{"http://www.informatics.jax.org/downloads/reports/HOM_MouseHumanSequence.rpt"}{an example} +and returns converted gene table } \keyword{internal} diff --git a/vignettes/domino2.Rmd b/vignettes/domino2.Rmd index 1622796..36086a6 100644 --- a/vignettes/domino2.Rmd +++ b/vignettes/domino2.Rmd @@ -14,9 +14,8 @@ knitr::opts_chunk$set( echo = TRUE, message = FALSE, warning = FALSE, - fig.cap="", - tidy = TRUE, - global.device = TRUE + fig.cap = "", + tidy = TRUE ) options(timeout=300) ``` @@ -250,16 +249,19 @@ The TF activities are a required input for domino2, and the regulons learned by ```{r Load SCENIC Results} regulons <- read.csv(paste0(scenic_dir, "/regulons_pbmc_3k.csv")) auc <- read.table(paste0(scenic_dir, "/auc_pbmc_3k.csv"), - header = TRUE, row.names = 1, - stringsAsFactors = FALSE, sep = ",") + header = TRUE, row.names = 1, + stringsAsFactors = FALSE, sep = "," +) ``` The initial regulons data frame read into R from the ctx function has 2 rows of column names that need to be replaced with one succinct description. domino2 has changed the input format for TF regulons to be a list storing vectors of target genes in each regulon, where the names of the list are the TF genes. This facilitates the use of alternative methods for TF activity quantification. We provide a helper function, `create_regulon_list_scenic()` for easy retrieval of TF regulons from the output of the [pySCENIC](https://pyscenic.readthedocs.io/en/latest/) ctx function. ```{r Create Regulon List} -regulons <- regulons[-1:-2,] -colnames(regulons) <- c("TF", "MotifID", "AUC", "NES", "MotifSimilarityQvalue", "OrthologousIdentity", - "Annotation", "Context", "TargetGenes", "RankAtMax") +regulons <- regulons[-1:-2, ] +colnames(regulons) <- c( + "TF", "MotifID", "AUC", "NES", "MotifSimilarityQvalue", "OrthologousIdentity", + "Annotation", "Context", "TargetGenes", "RankAtMax" +) regulon_list <- create_regulon_list_scenic(regulons = regulons) ``` @@ -300,8 +302,8 @@ proteins <- read.csv(paste0(cellphone_dir, stringsAsFactors = FALSE) rl_map <- create_rl_map_cellphonedb( - genes = genes, - proteins = proteins, + genes = genes, + proteins = proteins, interactions = interactions, complexes = complexes, database_name = "CellPhoneDB_v4.0" # database version used @@ -459,14 +461,16 @@ Signaling networks can also be drawn with the edges only rendering the signals d Beyond the aggregated degree of signaling between cell types, the degrees of signaling through specific ligand-receptor interactions can be assessed. `gene_network()` provides a graph of linkages between active TFs in a cluster, the linked receptors in that cluster, and the possible ligands of these active receptors. ```{r} -gene_network(pbmc_dom, clust = 'dendritic_cell', layout = 'grid') +gene_network(pbmc_dom, clust = "dendritic_cell", layout = "grid") ``` New to domino2, `gene_network()` can be used between two clusters to determine if any of the possible ligands for a given receptor are expressed by a putative outgoing signaling cluster. ```{r} -gene_network(pbmc_dom, clust = 'dendritic_cell', OutgoingSignalingClust = "CD14_monocyte", - layout = 'grid') +gene_network(pbmc_dom, + clust = "dendritic_cell", OutgoingSignalingClust = "CD14_monocyte", + layout = "grid" +) ``` A comprehensive assessment of ligand expression targeting active receptors on a given cluster can be assessed with `incoming_signaling_heatmap()`. diff --git a/vignettes/domino_object_vignette.Rmd b/vignettes/domino_object_vignette.Rmd index 964891e..188438a 100644 --- a/vignettes/domino_object_vignette.Rmd +++ b/vignettes/domino_object_vignette.Rmd @@ -14,9 +14,8 @@ knitr::opts_chunk$set( echo = TRUE, message = FALSE, warning = FALSE, - fig.cap="", - tidy = TRUE, - global.device = TRUE + fig.cap = "", + tidy = "styler" ) options(timeout=300) ``` @@ -153,10 +152,11 @@ all_linkages <- slot(dom, "linkages") names(all_linkages) ``` -Alternately, to obtain a simplified list of receptors, ligands, and\/or features in the domino object, use the `collate_network_items()` function. To pull all receptors associated with the dendritic cell cluster: +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: ```{r collate} -collate_network_items(dom, "dendritic_cell", return = "features") +dc_tfs <- dom_network_items(dom, "dendritic_cell", return = "features") +head(dc_tfs) ``` ### Signaling Matrices diff --git a/vignettes/plotting_vignette.Rmd b/vignettes/plotting_vignette.Rmd index 306e031..e1bb5b5 100644 --- a/vignettes/plotting_vignette.Rmd +++ b/vignettes/plotting_vignette.Rmd @@ -30,7 +30,7 @@ library(patchwork) In addition to the numerous plotting options available in the original [Domino](https://github.com/Elisseeff-Lab/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](vignette("domino2")). -### Loading example domino data +## Loading example domino data ```{r} data_url <- "https://zenodo.org/records/10222767/files" @@ -136,15 +136,19 @@ gene_network(dom, clust = "CD16_monocyte", OutgoingSignalingClust = "CD14_monocy Options to modify this plot include adjusting scaling for the ligands and different layouts (some of which are more legible than others). ```{r genenetwork-options} -gene_network(dom, clust = "CD16_monocyte", OutgoingSignalingClust = "CD14_monocyte", - lig_scale = 25, layout = "sphere") +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). ```{r genenetwork-cols} -gene_network(dom, clust = "CD16_monocyte", OutgoingSignalingClust = "CD14_monocyte", - cols = c("CD1D" = "violet", "LILRB2" = "violet", "FOSB" = "violet"), lig_scale = 10) +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 @@ -158,8 +162,10 @@ signaling_network(dom) 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: ```{r signalingnet-clusts} -signaling_network(dom, showOutgoingSignalingClusts = "CD14_monocyte", scale = "none", - norm = "none", layout = "fr", scale_by = "none", vert_scale = 5) +signaling_network(dom, + showOutgoingSignalingClusts = "CD14_monocyte", scale = "none", + norm = "none", layout = "fr", scale_by = "none", vert_scale = 5 +) ``` ## Other Types of Plot @@ -174,9 +180,11 @@ 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. ```{r circos-opt, fig.asp = 0.8, fig.width = 7} -cols = c("red", "orange", "green", "blue", "pink", "purple", - "slategrey", "firebrick", "hotpink") -names(cols) = levels(dom@clusters) +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) ```