From c9e1c1065342985f14ffa2606b20892682f0cab8 Mon Sep 17 00:00:00 2001 From: Lukas Forer Date: Wed, 20 Dec 2023 14:07:17 +0100 Subject: [PATCH] Fix issue with no excluded samples --- reports/report.Rmd | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/reports/report.Rmd b/reports/report.Rmd index d4349cb..1edae2e 100644 --- a/reports/report.Rmd +++ b/reports/report.Rmd @@ -38,7 +38,12 @@ contamination <- read.delim(params$haplocheck) haplogroups <- read.delim(params$haplogroups) statistics <- read.delim(params$statistics) pipeline_params <- read.delim(params$pipeline_parameters) -excluded_samples <- read.delim(params$excluded_samples, header = FALSE) + +excluded_samples <- try(read.delim(params$excluded_samples, header = FALSE, )) +if(inherits(excluded_samples, "try-error")) { + excluded_samples = data.frame(V1=c()) +} + mapping <- read.delim(params$mapping) mapping <- mapping %>% @@ -149,12 +154,16 @@ Row ### Mean Coverage per sample ```{r echo=FALSE, results='asis'} + +colors <- c("darkgreen", "red") +names(colors) <- c("PASSED", "FAILED") + ggplotly( ggplot(statistics) + geom_col(aes(x=Sample_Label, y=MeanCoverage, fill=qc), alpha=0.7) + theme(axis.text.x=element_text(angle=+90)) + geom_hline(yintercept=MIN_MEAN_DEPTH, color="black", linetype="dashed") + - scale_fill_manual(values=c("red", "darkgreen")) + + scale_fill_manual(values=colors) + xlab("Samples") + ylab("Mean Coverage") + labs(fill = "") @@ -169,7 +178,7 @@ ggplotly( geom_col(aes(x=Sample_Label, y=MeanBaseQuality, fill=qc), alpha=0.7) + theme(axis.text.x=element_text(angle=+90)) + geom_hline(yintercept=MIN_MEAN_BASE_QUALITY, color="black", linetype="dashed") + - scale_fill_manual(values=c("red", "darkgreen")) + + scale_fill_manual(values=colors) + xlab("Samples") + ylab("Mean Base Quality") + labs(fill = "")