From b9b4ae44fe9f81f903d7290446564944d9273085 Mon Sep 17 00:00:00 2001 From: Philipp Resl Date: Mon, 4 Apr 2022 10:13:12 +0200 Subject: [PATCH] report: If random seed is set, use this information also in the report-figure to get consistent colors --- bin/report_figure.R | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/report_figure.R b/bin/report_figure.R index 8a15b5a..f65761a 100644 --- a/bin/report_figure.R +++ b/bin/report_figure.R @@ -19,7 +19,13 @@ local_species_file <- "../results/statistics/local_species.txt" pars_sites <-config_data$filtering$min_parsimony_sites pars_sites <- strtoi(pars_sites) - + +# check if seed was specified or not: +if (is.null(config_data$seed) || config_data$seed == "") { + config_data$seed <- "random" +} else { + set.seed(strtoi(config_data$seed)) + } ## functions: @@ -590,10 +596,6 @@ align_text <- paste0( "\nMinimum number of sequences per alignment: ", config_data$filtering$minsp ) -# check if seed was specified or not: -if (is.null(config_data$seed) || config_data$seed == "") { - config_data$seed <- "random" -} reprod_text <- paste0( "\n\nAnalysis seed: ", config_data$seed )