View source: R/application_prediction.R
predict_single_cell_ligand_activities | R Documentation |
predict_single_cell_ligand_activities
For every individual cell of interest, predict activities of ligands in regulating expression of genes that are stronger expressed in that cell compared to other cells (0.975 quantile). Ligand activities are defined as how well they predict the observed transcriptional response (i.e. gene set) according to the NicheNet model.
predict_single_cell_ligand_activities(cell_ids, expression_scaled,ligand_target_matrix, potential_ligands, single = TRUE,...)
cell_ids |
Identities of cells for which the ligand activities should be calculated. |
expression_scaled |
Scaled expression matrix of single-cells (scaled such that high values indicate that a gene is stronger expressed in that cell compared to others) |
ligand_target_matrix |
The NicheNet ligand-target matrix denoting regulatory potential scores between ligands and targets (ligands in columns). |
potential_ligands |
Character vector giving the gene symbols of the potentially active ligands you want to define ligand activities for. |
single |
TRUE if you want to calculate ligand activity scores by considering every ligand individually (recommended). FALSE if you want to calculate ligand activity scores as variable importances of a multi-ligand classification model. |
... |
Additional parameters for get_multi_ligand_importances if single = FALSE. |
A tibble giving several ligand activity scores for single cells. Following columns in the tibble: $setting, $test_ligand, $auroc, $aupr and $pearson.
## 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.