make_discrete_ligand_target_matrix: Convert probabilistic ligand-target matrix to a discrete one.

View source: R/construct_ligand_to_target.R

make_discrete_ligand_target_matrixR Documentation

Convert probabilistic ligand-target matrix to a discrete one.

Description

make_discrete_ligand_target_matrix Convert probabilistic ligand-target matrix to a discrete one. This means that for every ligand, genes will be labeled as target (TRUE) or non-target (FALSE).

Usage

make_discrete_ligand_target_matrix(ligand_target_matrix, error_rate = 0.1, cutoff_method = "distribution", fdr_method = "global",ligands_position = "cols")

Arguments

ligand_target_matrix

A matrix of ligand-target probabilty scores.

error_rate

FDR for cutoff_method "fdrtool" and "distribution"; number between 0 and 1 indicating which top fraction of target genes should be returned for cutoff_method "quantile". Default: 0.1

cutoff_method

Method to determine which genes can be considered as a target of a ligand and which genes not, based on the ligand-target probability scores. Possible options: "distribution", "fdrtool" and "quantile". Default: "distribution".

fdr_method

Only relevant when cutoff_method is "fdrtool". Possible options: "global" and "local". Default: "global".

ligands_position

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

Value

A matrix of ligand-target assignments. TRUE: gene is a target of the ligand of interest; FALSE: gene is not a target of the ligand of interest.

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)
ligand_target_matrix = make_discrete_ligand_target_matrix(ligand_target_matrix, error_rate = 0.1, cutoff_method = "distribution", ligands_position = "cols")

## End(Not run)

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