Skip to content

Commit

Permalink
Improve warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fplazaonate committed Nov 9, 2024
1 parent 041a686 commit 8d0f579
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions crocodeel/crocodeel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit 8d0f579

Please sign in to comment.