From 8d0f579e9bf97dc3fad866847cfa77a1cdc8a82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Plaza=20O=C3=B1ate?= Date: Sat, 9 Nov 2024 17:12:51 +0100 Subject: [PATCH] Improve warning messages --- crocodeel/crocodeel.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/crocodeel/crocodeel.py b/crocodeel/crocodeel.py index fa84e1c..9c4dcc2 100644 --- a/crocodeel/crocodeel.py +++ b/crocodeel/crocodeel.py @@ -249,13 +249,6 @@ def main() -> None: ContaminationEventIO.write_tsv(conta_events, args.conta_events_fh) args.conta_events_fh.close() - if args.command != "test_install": - logging.warning("Contamination events may be false positives, especially " - "when dealing with samples with similar species abundance profiles " - "(longitudinal data, animals raised together)") - logging.warning("Check each reported contamination event by inspecting " - "scatterplots generated by the plot_conta subcommand") - # Or load them if args.command == "plot_conta": conta_events = ContaminationEventIO.read_tsv(args.conta_events_fh) @@ -274,6 +267,17 @@ def main() -> None: args.color_conta_species, ) + if args.command in ("easy_wf", "search_conta") and conta_events: + logging.warning("Contamination events may be false positives, especially " + "when dealing with samples with similar species abundance profiles " + "(longitudinal data, animals raised together)") + if args.command == "search_conta": + logging.warning("Check each reported contamination event by inspecting " + "scatterplots generated by the plot_conta subcommand") + else: + logging.warning("Check each reported contamination event by inspecting " + "scatterplots in the PDF report %s", Path(args.pdf_report_fh.name).resolve()) + if args.command == "test_install": if filecmp.cmp(TestData.EXPECTED_CONTA_EVENTS_FILE, args.conta_events_fh.name): logging.info(