hzi-bifo / RiboDetector

Accurate and rapid RiboRNA sequences Detector based on deep learning
GNU General Public License v3.0
99 stars 16 forks source link

Log file/progress formatting for better readability #52

Open mckellardw opened 6 months ago

mckellardw commented 6 months ago

Currently the progress prints with formatting to highlight the read counts. Could you add an option to remove this formatting so that the output log files are readable? This may be related to #33

I am using ribodetector version 0.3.1

Current:

2024-05-12 18:20:24 : INFO  Processed 250204238 sequences in total
2024-05-12 18:20:24 : INFO  Detected 188277238 non-rRNA sequences
2024-05-12 18:20:24 : INFO  Detected 61927000 rRNA sequences
``

Ideal:

2024-05-12 18:20:24 : INFO Processed 250204238 sequences in total 2024-05-12 18:20:24 : INFO Detected 188277238 non-rRNA sequences 2024-05-12 18:20:24 : INFO Detected 61927000 rRNA sequences

dawnmy commented 6 months ago

It seems the formatting does not display correctly for you. It should look normal in stdout also with cat or less on log file:

2024-01-10 23:16:30 : INFO  Writing output non-rRNA sequences into file: ../outputs/G78512_pe.nonrrna.1.fq, ../outputs/G78512_pe.nonrrna.2.fq
2024-01-10 23:18:47 : INFO  1048576 sequences finished!
2024-01-10 23:20:45 : INFO  1922725 sequences finished!
2024-01-10 23:20:45 : INFO  Processed 1922725 sequences in total
2024-01-10 23:20:45 : INFO  Detected 1903676 non-rRNA sequences
2024-01-10 23:20:45 : INFO  Detected 19049 rRNA sequences

The text editor like Vim will just show the actual ANSI escape sequences:

2024-01-10 23:18:47 : INFO  ^[[92m1048576^[[0m sequences finished!
2024-01-10 23:20:45 : INFO  ^[[92m1922725^[[0m sequences finished!
2024-01-10 23:20:45 : INFO  Processed ^[[1m^[[96m1922725^[[0m sequences in total
2024-01-10 23:20:45 : INFO  Detected ^[[1m^[[96m1903676^[[0m non-rRNA sequences
2024-01-10 23:20:45 : INFO  Detected ^[[1m^[[96m19049^[[0m rRNA sequences

What did you use to show the log? Do you want to parse the log file to generate report like multiqc? I will consider to add --noansi in the future release.

mckellardw commented 6 months ago

I just used tee to print & write the log info. --noansi sounds like a great fix!