From cc3bcedfd6271df2e8ca85c8b771f7faa914cd3d Mon Sep 17 00:00:00 2001 From: browaeysrobin Date: Thu, 23 Feb 2023 17:15:45 +0100 Subject: [PATCH] Fix hard-coded parameter bug --- R/application_prediction.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/application_prediction.R b/R/application_prediction.R index 9f88a28..a935648 100644 --- a/R/application_prediction.R +++ b/R/application_prediction.R @@ -351,7 +351,7 @@ get_top_predicted_genes = function(round,gene_prediction_list, quantile_cutoff = #' @export #' calculate_fraction_top_predicted = function(affected_gene_predictions, quantile_cutoff = 0.95){ - predicted_positive = affected_gene_predictions %>% arrange(-prediction) %>% filter(prediction >= quantile(prediction,0.95)) %>% group_by(response) %>% count() %>% rename(positive_prediction = n) %>% rename(true_target = response) + predicted_positive = affected_gene_predictions %>% arrange(-prediction) %>% filter(prediction >= quantile(prediction,quantile_cutoff)) %>% group_by(response) %>% count() %>% rename(positive_prediction = n) %>% rename(true_target = response) all = affected_gene_predictions %>% arrange(-prediction) %>% rename(true_target = response) %>% group_by(true_target) %>% count() inner_join(all,predicted_positive, by = "true_target") %>% mutate(fraction_positive_predicted = positive_prediction/n) }