get_active_ligand_target_matrix: Get active ligand-target matrix.

View source: R/application_network_extraction.R

get_active_ligand_target_matrixR Documentation

Get active ligand-target matrix.

Description

get_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.

Usage

get_active_ligand_target_matrix(response,ligand_target_matrix, ligands_position = "cols")

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

## Not run: 
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, ligands)
active_lt = get_active_ligand_target_matrix(setting[[1]] %>% .$response, ligand_target_matrix)

## End(Not run)

saeyslab/nichenetr documentation built on April 27, 2024, 9:24 p.m.