extract_top_n_ligands: Get the predicted top n ligands of a target gene of interest

View source: R/use_ligand_to_target.R

extract_top_n_ligandsR Documentation

Get the predicted top n ligands of a target gene of interest

Description

extract_top_n_ligands Get the predicted top n ligands of a target gene of interest.

Usage

extract_top_n_ligands(target_oi,top_n,ligand_target_matrix,ligands_position = "cols")

Arguments

target_oi

The target gene of interest of which top upstream ligands should be returned

top_n

A number between 0 and the total nr of ligands indicating which top n of ligands should be returned.

ligand_target_matrix

A matrix of ligand-target probabilty scores.

ligands_position

Indicate whether the ligands in the ligand-target matrix are in the rows ("rows") or columns ("cols"). Default: "cols"

Value

A named numeric vector of ligand-target gene probability scores of the top ligands.

Examples

## Not run: 
## Generate the ligand-target matrix from loaded weighted_networks
weighted_networks = construct_weighted_networks(lr_network, sig_network, gr_network,source_weights_df)
ligands = list("TNF","BMP2",c("IL4","IL13"))
ligand_target_matrix = construct_ligand_target_matrix(weighted_networks, ligands)
targets = extract_top_n_ligands("BMP2",2,ligand_target_matrix)

## End(Not run)

saeyslab/nichenetr documentation built on March 26, 2024, 9:22 a.m.