Construct and evaluate a randomised ligand-target model given input parameters.
Source:R/characterization_data_sources.R
evaluate_random_model.Rdevaluate_random_model will take as input a setting of parameters (data source weights and hyperparameters) and layer-specific networks to construct a ligand-target matrix and evaluate its performance on input validation settings (both target gene prediction and ligand activity prediction) after randomisation of the networks by edge swapping.
Usage
evaluate_random_model(parameters_setting, lr_network, sig_network, gr_network, settings, calculate_popularity_bias_target_prediction,calculate_popularity_bias_ligand_prediction, ncitations = ncitations, secondary_targets = FALSE, remove_direct_links = "no", n_target_bins = 3,...)Arguments
- parameters_setting
A list containing following elements: $model_name, $source_weights, $lr_sig_hub, $gr_hub, $ltf_cutoff, $algorithm, $damping_factor, $correct_topology. See
prepare_settings_leave_one_in_characterizationandadd_hyperparameters_parameter_settings.- lr_network
A data frame / tibble containing ligand-receptor interactions (required columns: from, to, source)
- sig_network
A data frame / tibble containing signaling interactions (required columns: from, to, source)
- gr_network
A data frame / tibble containing gene regulatory interactions (required columns: from, to, source)
- settings
A list of lists for which each sub-list contains the following elements: .$name: name of the setting; .$from: name(s) of the ligand(s) active in the setting of interest; .$response: named logical vector indicating whether a target is a TRUE target of the possibly active ligand(s) or a FALSE.
- calculate_popularity_bias_target_prediction
Indicate whether popularity bias in target gene prediction performance should be calculated (TRUE or FALSE).
- calculate_popularity_bias_ligand_prediction
Indicate whether popularity bias in ligand activity prediction performance should be calculated (TRUE or FALSE).
- ncitations
A data frame denoting the number of times a gene is mentioned in the Pubmed literature. Should at least contain following variables: 'symbol' and 'ncitations'. Default: ncitations (variable contained in this package). See function
get_ncitations_genesfor a function that makes this data frame from current Pubmed information.- secondary_targets
Indicate whether a ligand-target matrix should be returned that explicitly includes putative secondary targets of a ligand (by means of an additional matrix multiplication step considering primary targets as possible regulators). Default: FALSE
- remove_direct_links
Indicate whether direct ligand-target and receptor-target links in the gene regulatory network should be kept or not. "no": keep links; "ligand": remove direct ligand-target links; "ligand-receptor": remove both direct ligand-target and receptor-target links. Default: "no"
- n_target_bins
Indicate the number of bins the target genes will be divided in according to popularity. Only relevant when calculate_popularity_bias_target_prediction and/or calculate_popularity_bias_ligand_prediction is/are TRUE. Default = 3.
- ...
Additional arguments to
make_discrete_ligand_target_matrix.
Value
A list containing following elements: $model_name, $performances_target_prediction, $performances_ligand_prediction, $performances_ligand_prediction_single
Examples
if (FALSE) { # \dontrun{
library(dplyr)
settings <- lapply(expression_settings_validation[1:4], convert_expression_settings_evaluation)
weights_settings_loi <- prepare_settings_leave_one_in_characterization(lr_network, sig_network, gr_network, source_weights_df)
weights_settings_loi <- lapply(weights_settings_loi, add_hyperparameters_parameter_settings, lr_sig_hub = 0.25, gr_hub = 0.5, ltf_cutoff = 0, algorithm = "PPR", damping_factor = 0.8, correct_topology = TRUE)
doMC::registerDoMC(cores = 8)
output_characterization <- parallel::mclapply(weights_settings_loi[1:3], evaluate_random_model, lr_network, sig_network, gr_network, settings, calculate_popularity_bias_target_prediction = TRUE, calculate_popularity_bias_ligand_prediction = TRUE, ncitations, mc.cores = 3)
} # }