From 91579340ad469553a3912c19df0719b442b9bcf5 Mon Sep 17 00:00:00 2001 From: Julian Libiseller-Egger Date: Wed, 6 Dec 2023 17:12:16 +0000 Subject: [PATCH] better wording for failed samples in report --- bin/workflow_glue/report.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/workflow_glue/report.py b/bin/workflow_glue/report.py index 6c1781a..6eb82a2 100755 --- a/bin/workflow_glue/report.py +++ b/bin/workflow_glue/report.py @@ -218,10 +218,12 @@ def populate_report(report, metadata, all_datasets, ref_fasta): html_tags.b("Warning:") html_tags.p( f"The {analysis_type} pipeline failed for the following ", - util.format_number_and_plural( - len(failed_assembly_aliases), "sample" + ( + "sample (and it" + if (n_failed := len(failed_assembly_aliases)) == 1 + else f"{n_failed} samples (and they" ), - " (and these will be omitted in some sections of the report):", + " will be omitted in some sections of the report):", html_tags.br(), ", ".join(failed_assembly_aliases), ) @@ -269,12 +271,13 @@ def populate_report(report, metadata, all_datasets, ref_fasta): if de_novo and d.sample_alias in failed_qc_aliases: html_tags.p( html_tags.b("Note: "), - "Consensus QC failed for this sample.") + "Consensus QC failed for this sample.", + ) else: html_tags.p( html_tags.b("Note: "), "The analysis pipeline failed for this sample " - "(e.g. potentially due to too few reads)." + "(e.g. potentially due to too few reads).", ) # add values + titles of cards for stats reported in both modes # (de-novo and variant calling) first