Skip to contents

prepare_ligand_target_visualization Prepare heatmap visualization of the ligand-target links starting from a ligand-target tibble. Get regulatory potential scores between all pairs of ligands and targets documented in this tibble. For better visualization, we propose to define a quantile cutoff on the ligand-target scores.

Usage

prepare_ligand_target_visualization(ligand_target_df, ligand_target_matrix, cutoff = 0.25)

Arguments

ligand_target_df

Tibble with columns 'ligand', 'target' and 'weight' to indicate ligand-target regulatory potential scores of interest.

ligand_target_matrix

The NicheNet ligand-target matrix denoting regulatory potential scores between ligands and targets (ligands in columns).

cutoff

Quantile cutoff on the ligand-target scores of the input weighted ligand-target network. Scores under this cutoff will be set to 0.

Value

A matrix giving the ligand-target regulatory potential scores between ligands of interest and their targets genes part of the gene set of interest.

Examples

if (FALSE) { # \dontrun{
weighted_networks <- construct_weighted_networks(lr_network, sig_network, gr_network, source_weights_df)
ligands <- list("TNF", "BMP2", "IL4")
ligand_target_matrix <- construct_ligand_target_matrix(weighted_networks, lr_network, ligands, ltf_cutoff = 0, algorithm = "PPR", damping_factor = 0.5, secondary_targets = FALSE)
geneset <- c("SOCS2", "SOCS3", "IRF1")
background_expressed_genes <- c("SOCS2", "SOCS3", "IRF1", "ICAM1", "ID1", "ID2", "ID3")
active_ligand_target_links_df <- potential_ligands %>%
  lapply(get_weighted_ligand_target_links, geneset = geneset, ligand_target_matrix = ligand_target_matrix, n = 250) %>%
  bind_rows()
active_ligand_target_links <- prepare_ligand_target_visualization(ligand_target_df = active_ligand_target_links_df, ligand_target_matrix = ligand_target_matrix, cutoff = 0.25)
} # }