From bc0d017a1cc67118142711a2fc4fb0bb31218fe2 Mon Sep 17 00:00:00 2001 From: Felix Wiegand Date: Tue, 25 Jun 2024 20:26:30 +0200 Subject: [PATCH] fix: Fix missing output in spia.R when no significant genes are found (#103) --- workflow/scripts/spia.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/workflow/scripts/spia.R b/workflow/scripts/spia.R index cef0dc61..014609f6 100644 --- a/workflow/scripts/spia.R +++ b/workflow/scripts/spia.R @@ -45,6 +45,11 @@ if (nrow(sig_genes) == 0) { # the best hack for an empty tibble from a column specification I could find res <- read_csv("\n", col_names = columns) write_tsv(res, snakemake@output[["table"]]) + # Create empty plot + pdf(snakemake@output[["plots"]]) + plot.new() + text(0.5, 0.5, "No significant genes found", cex = 1.5) + dev.off() } else { # get logFC equivalent (the sum of beta scores of covariates of interest)