Construct and evaluate a ligand-target model given input parameters (for application purposes + multi-ligand predictive model).
Source:R/characterization_data_sources.R
evaluate_model_application_multi_ligand.Rdevaluate_model_application_multi_ligand 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 application settings (only target gene prediction; multi-ligand classification).
Usage
evaluate_model_application_multi_ligand(parameters_setting, lr_network, sig_network, gr_network, settings, secondary_targets = FALSE, remove_direct_links = "no",classification_algorithm = "lda", ...)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.
- 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"
- classification_algorithm
The name of the classification algorithm to be applied. Should be supported by the caret package. Examples of algorithms we recommend: with embedded feature selection: "rf","glm","fda","glmnet","sdwd","gam","glmboost", "pls" (load "pls" package before!); without: "lda","naive_bayes", "pcaNNet". Please notice that not all these algorithms work when the features (i.e. ligand vectors) are categorical (i.e. discrete class assignments).
- ...
Optional arguments to
evaluate_multi_ligand_target_prediction.
Examples
if (FALSE) { # \dontrun{
library(dplyr)
settings <- convert_expression_settings_evaluation(expression_settings_validation$TGFB_IL6_timeseries) %>% list()
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_model_application_multi_ligand, lr_network, sig_network, gr_network, settings, classification_algorithm = "lda", var_imps = FALSE, cv_number = 5, cv_repeats = 4, parallel = TRUE, mc.cores = 3)
} # }