Skip to content

Commit

Permalink
add logginf for task filter_mudata
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrue committed Apr 17, 2024
1 parent 3c13a41 commit 37a4e9c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion panpipes/panpipes/pipeline_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

# import pandas as pd

import logging
L = logging.getLogger('panpipes')
L.setLevel(logging.INFO)
log_handler = logging.FileHandler("pipeline.log")
formatter = logging.Formatter('%(asctime)s: %(levelname)s - %(message)s')
log_handler.setFormatter(formatter)
L.addHandler(log_handler)

PARAMS = P.get_parameters(
["%s/pipeline.yml" % os.path.splitext(__file__)[0],
"pipeline.yml"])
Expand Down Expand Up @@ -52,8 +60,16 @@ def filter_mudata(outfile):
cmd += " --keep_barcodes %(filtering_keep_barcodes)s"
if PARAMS['intersect_mods'] is not None:
cmd += " --intersect_mods %(intersect_mods)s"
cmd += " > logs/filtering.log "
logfile = "logs/filtering.log"
cmd += f" > {logfile}"
job_kwargs["job_threads"] = PARAMS['resources_threads_low']
L.info(
"Task: 'filter_mudata'" + "\n" +
f"Input file(s): {unfiltered_obj}" + "\n" +
f"Output file(s): {outfile}" + "\n" +
f"Log file: {logfile}" + "\n" +
"In case of error, please refer to the log file(s) above for more information."
)
P.run(cmd, **job_kwargs)
else:
try:
Expand Down

0 comments on commit 37a4e9c

Please sign in to comment.