Skip to content

Commit

Permalink
Improve logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fplazaonate committed Jun 5, 2024
1 parent 57c1ea3 commit 82098fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions crocodeel/conta_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,8 @@ def write_tsv(conta_events: list[ContaminationEvent], fh: TextIO) -> None:
),
file=fh,
)

logging.info(
"Contamination events saved in %s",
Path(fh.name).resolve(),
)
9 changes: 4 additions & 5 deletions crocodeel/crocodeel.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def get_arguments() -> argparse.Namespace:
)

test_install_parser.add_argument(
"--keep",
"--keep-results",
dest="keep_results",
action="store_true",
help="Keep all temporary results files.",
Expand All @@ -219,6 +219,9 @@ def main() -> None:
set_logging()
args = get_arguments()

if args.command == 'test_install':
logging.info("Running tests on the toy dataset")

# Add comment line in output file describing execution context
if args.command in ("easy_wf", "search_conta"):
exec_desc = ExecutionDescription(args.species_ab_table_fh, args.species_ab_table_fh_2)
Expand Down Expand Up @@ -246,10 +249,6 @@ def main() -> None:
ContaminationEventIO.write_tsv(conta_events, args.conta_events_fh)
args.conta_events_fh.close()

logging.info(
"Contamination events sorted by decreasing rate saved in %s",
Path(args.conta_events_fh.name).resolve(),
)
if args.command != "test_install":
logging.warning("Contamination events may be false positives, especially "
"when dealing with samples with similar species abundance profiles "
Expand Down

0 comments on commit 82098fb

Please sign in to comment.