ncbi / fcs

Foreign Contamination Screening caller scripts and documentation
Other
88 stars 12 forks source link

[BUG]: fix log output destination #63

Closed ptrebert closed 5 months ago

ptrebert commented 5 months ago

Describe the bug (this is subjective, but I considered this to be undesired behavior from the user perspective and hence opened a "bug" ticket) Cause of failure is not included in $OUTDIR/fcs_adaptor.log. It is not obvious that this log file does apparently not capture stderr and that this has to be done explicitly when running the adaptor script.

To Reproduce Run FCS-adaptor v0.4.0 on a FASTA file that contains a sequence <10 bp

The log output (see below) will report a completed permanentFail w/o stating the cause of the failure. The actual cause of the failure (= needed for debugging the run) is only included in a log file that captures stderr.

Software versions (please complete the following information): irrelevant; I am using FCS-adaptor v0.4.0

Log Files Content of $OUTDIR/fcs_adaptor.log

Executing: 

[2024-01-11 09:31:17] INFO [workflow ] start
[2024-01-11 09:31:17] INFO [workflow ] starting step ValidateInputSequences
[2024-01-11 09:31:17] INFO [step ValidateInputSequences] start
[2024-01-11 09:31:17] INFO [job ValidateInputSequences] /tmp/d34o2i6o$ validate_fasta \
    --jsonl \
    validate_fasta.log \
    --fasta-output \
    validated.fna \
    /tmp/75_92xj7/stg6e75a9e3-a5cf-44b1-a7ed-5fd16e5d9e6f/seq_len8.fasta > /tmp/d34o2i6o/validate_fasta.txt
[2024-01-11 09:31:18] WARNING [job ValidateInputSequences] completed permanentFail
[2024-01-11 09:31:18] WARNING [step ValidateInputSequences] completed permanentFail
[2024-01-11 09:31:18] INFO [workflow ] completed permanentFail

Content of captured stderr

[same as above plus the following]

Executing the workflow
Completed permanentFail
--------------------
/tmp/75_92xj7/stg6e75a9e3-a5cf-44b1-a7ed-5fd16e5d9e6f/seq_len8.fasta:
>test_seq_LEN8
        ERROR: Sequence is too short (<10 bp): 8 bp

1 FASTA validation error(s):
     Count  Description
         1  Sequence is too short (<10 bp)

Thanks.

etvedte commented 5 months ago

Hello,

That stderr is also captured in the output file validate_fasta.txt. We will update the documentation to direct users to look at this file for any FASTA validation errors.

ptrebert commented 5 months ago

Thanks. Checking a .txt output file that is sitting next to a - going by the name fcs_adaptor.log - dedicated pipeline log file did not occur to me.