Skip to content

Commit

Permalink
log task load_mudatas
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrue committed Apr 17, 2024
1 parent 59c287b commit 98cef48
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions panpipes/panpipes/pipeline_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@

import yaml

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


PARAMS = P.get_parameters(
["%s/pipeline.yml" % os.path.splitext(__file__)[0],
Expand Down Expand Up @@ -141,9 +149,17 @@ def load_mudatas(rna_path, outfile,
if bcr_path is not None and pd.notna(bcr_path):
cmd += " --bcr_filtered_contigs %(bcr_path)s"
cmd += " --bcr_filetype %(bcr_filetype)s"
logfile = f"logs/load_mudatas_{sample_id}.log"
cmd += " > logs/load_mudatas_%(sample_id)s.log"
# print(cmd)
job_kwargs["job_threads"] = PARAMS['resources_threads_medium']
L.info(
"Task: 'load_mudatas'" + "\n" +
f"sample_id: {sample_id}" + "\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)


Expand Down

0 comments on commit 98cef48

Please sign in to comment.