get_slope_target_gene_popularity: Regression analysis between target gene popularity and target...

View source: R/calculate_popularity_bias.R

get_slope_target_gene_popularityR Documentation

Regression analysis between target gene popularity and target gene predictive performance

Description

get_slope_target_gene_popularity: Performs regression analysis to investigate the trend between a particular classficiation evaluation metric and the popularity of target genes.

Usage

get_slope_target_gene_popularity(metric,performances,method = "individual")

Arguments

metric

The name of the performance metric of which the trend with the popularity of the target genes should be calculated.

performances

A data.frame in which the performance measures for target gene predictions of ligands are denoted together with the popularity bin of the target genes for which predictions were evaluated (should contain at least following variables: target_bin_id and the metric of interest)

method

'All': calculate slope by considering all datasets in settings. 'Individual': calculate slope for every dataset in settings separately to investigate dataset-specific popularity bias. Default: 'individual'.

Value

A data.frame in which the regression coefficient estimate, p-value and corresponding R-squared value are shown for the regression analysis to investigate the trend between a particular classficiation evaluation metric and the popularity of the target genes.

Examples

## Not run: 
library(dplyr)
weighted_networks = construct_weighted_networks(lr_network, sig_network, gr_network, source_weights_df)
settings = lapply(expression_settings_validation[1:10],convert_expression_settings_evaluation)
ligands = extract_ligands_from_settings(settings)
ligand_target_matrix = construct_ligand_target_matrix(weighted_networks, ligands)
# ncitations = get_ncitations_genes()
performances_target_bins_popularity = evaluate_target_prediction_per_bin(5,settings,ligand_target_matrix,ncitations)
slopes_auroc = get_slope_target_gene_popularity("auroc",performances_target_bins_popularity)
slopes_df = performances_target_bins_popularity %>% select(-setting,-ligand,-target_bin_id) %>% colnames() %>% lapply(.,get_slope_target_gene_popularity,performances_target_bins_popularity,method = "individual") %>% bind_rows()
slopes_df2 = performances_target_bins_popularity %>% select(-setting,-ligand,-target_bin_id) %>% colnames() %>% lapply(.,get_slope_target_gene_popularity,performances_target_bins_popularity,method = "all") %>% bind_rows()

## End(Not run)


saeyslab/nichenetr documentation built on March 26, 2024, 9:22 a.m.