Get active ligand-target matrix.
Source:R/application_network_extraction.R
get_active_ligand_target_matrix.Rdget_active_ligand_target_matrix Get active ligand-target matrix, meaning that only target genes part of the response of interest will be kept as target genes in the input ligand-target matrix.
Arguments
- response
A named logical vector indicating whether a gene is responding in a biological system or not (e.g. DE after cell-cell interaction)
- ligand_target_matrix
A matrix of ligand-target probabilty scores (or discrete target assignments).
- ligands_position
Indicate whether the ligands in the ligand-target matrix are in the rows ("rows") or columns ("cols"). Default: "cols"
Value
A matrix with ligand-target probability scores (or discrete ligand-target assignments) for the active target genes in the system of interest.
Examples
if (FALSE) { # \dontrun{
library(dplyr)
weighted_networks <- construct_weighted_networks(lr_network, sig_network, gr_network, source_weights_df)
setting <- lapply(expression_settings_validation[1:2], convert_expression_settings_evaluation)
ligands <- extract_ligands_from_settings(setting)
ligand_target_matrix <- construct_ligand_target_matrix(weighted_networks, lr_network, ligands)
active_lt <- get_active_ligand_target_matrix(setting[[1]] %>% .$response, ligand_target_matrix)
} # }