Assess how well cells' ligand activities predict a binary property of interest of cells.
Source:R/application_prediction.R
single_ligand_activity_score_classification.Rdsingle_ligand_activity_score_classification Evaluates classification performances: it assesses how well cells' ligand activities can predict a binary property of interest.
Value
A tibble giving for every ligand, the classification performance metrics giving information about the relation between its activity and the property of interest.
Examples
if (FALSE) { # \dontrun{
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, lr_network, 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(TRUE, FALSE))
classification_analysis_output <- single_ligand_activity_score_classification(normalized_ligand_activities, cell_scores_tbl)
} # }