convert_single_cell_expression_to_settings: Prepare single-cell expression data to perform ligand...

View source: R/application_prediction.R

convert_single_cell_expression_to_settingsR Documentation

Prepare single-cell expression data to perform ligand activity analysis

Description

convert_single_cell_expression_to_settings Prepare single-cell expression data to perform ligand activity analysis

Usage

convert_single_cell_expression_to_settings(cell_id, expression_matrix, setting_name, setting_from, regression = FALSE)

Arguments

cell_id

Identity of the cell of interest

expression_matrix

Gene expression matrix of single-cells

setting_name

Name of the dataset

setting_from

Character vector giving the gene symbols of the potentially active ligands you want to define ligand activities for.

regression

Perform regression-based ligand activity analysis (TRUE) or classification-based ligand activity analysis (FALSE) by considering the genes expressed higher than the 0.975 quantiles as genes of interest. Default: FALSE.

Value

A list with slots $name, $from and $response respectively containing the setting name, potentially active ligands and the response to predict (whether genes belong to gene set of interest; i.e. most strongly expressed genes in a cell)

Examples

## Not run: 
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, ligands, ltf_cutoff = 0, algorithm = "PPR", damping_factor = 0.5, secondary_targets = FALSE)
potential_ligands = c("TNF","BMP2","IL4")
genes = c("SOCS2","SOCS3","IRF1","ICAM1","ID1","ID2","ID3")
cell_ids = c("cell1","cell2")
expression_scaled = matrix(rnorm(length(genes)*2, sd = 0.5, mean = 0.5), nrow = 2)
rownames(expression_scaled) = cell_ids
colnames(expression_scaled) = genes
settings = convert_single_cell_expression_to_settings(cell_id = cell_ids[1], expression_matrix = expression_scaled, setting_name = "test", setting_from = potential_ligands)

## End(Not run)


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