single_ligand_activity_score_regression: Perform a correlation and regression analysis between cells'...

View source: R/application_prediction.R View source: R/application_prediction.R

single_ligand_activity_score_regressionR Documentation

Perform a correlation and regression analysis between cells' ligand activities and property scores of interest

Description

single_ligand_activity_score_regression Performs a correlation and regression analysis between cells' ligand activities and property scores of interest.

Usage

single_ligand_activity_score_regression(ligand_activities, scores_tbl)

Arguments

ligand_activities

Output from the function 'normalize_single_cell_ligand_activities'.

scores_tbl

a tibble containing scores for every cell (columns: $cell and $score). The score should correspond to the property of interest

Value

A tibble giving for every ligand, the correlation/regression coefficients giving information about the relation between its activity and the property of interest.

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
ligand_activities = predict_single_cell_ligand_activities(cell_ids = cell_ids, expression_scaled = expression_scaled, ligand_target_matrix = ligand_target_matrix, potential_ligands = potential_ligands)
normalized_ligand_activities = normalize_single_cell_ligand_activities(ligand_activities)
cell_scores_tbl = tibble(cell = cell_ids, score = c(1,4))
regression_analysis_output = single_ligand_activity_score_regression(normalized_ligand_activities,cell_scores_tbl)

## End(Not run)


saeyslab/nichenetr documentation built on Sept. 7, 2024, 10:27 a.m.