Closed marchoeppner closed 4 months ago
I cleaned up this script to have a well-formatted template. How does nextflow handles logging for scripts? Does it log stdout by default or do we need to add logging in the python scripts?
Since nextflow processes are, technically, wrapped "bash" calls, logging would work like you'd expect (abbreviated code example):
input:
path(foo.txt)
output:
path(faa.txt), emit: faa
path(my_log.txt), emit: log
script:
"""
python my_script.py --input foo.txt --output faa.txt 2> my_log.txt
"""
Or you could make the log file a command line argument also (--log my_log.txt).
Nextflow does capture STDOUT and STDERR by default - although it only stores them for debugging purposes inside the respective work directory as hidden files (.command.err and .command.log)
Most FooDMe scripts are integrated into the snakemake workflow and don't use traditional I/O interfacing. We need to re-write the relevant scripts to use.e.g argparse so files and options can be specified from the command line.
See: https://github.com/bio-raum/FooDMe2/blob/dev/bin/filter_blast.py