uclahs-cds / package-moPepGen

Multi-Omics Peptide Generator
https://uclahs-cds.github.io/package-moPepGen/
GNU General Public License v2.0
6 stars 1 forks source link

Swtich to use python's standard `logging` pacakge for logging #852

Closed zhuchcn closed 8 months ago

zhuchcn commented 8 months ago

Description

This is to make the logging message more standardized and professional. We now can use --debug-level in any moPepGen command. --debug-level INFO will print basic messages (those with the logger.info() call), and --debug-level DEBUG will print debug messages (logger.debug()). And setting --debug-level 0 or --quiet will show no message.

Here is an example output of callVariant:

python -m moPepGen.cli callVariant \
    -i \
        test/files/vep/vep_gSNP.gvf \
        test/files/vep/vep_gINDEL.gvf \
        test/files/fusion/star_fusion.gvf \
    --index-dir test/files/index \
    -o test/files/vep/test3.fasta \
    --debug-level DEBUG
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] moPepGen callVariant started
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] Reference indices loaded.
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] Using GVF file: test/files/vep/vep_gSNP.gvf
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] Using GVF file: test/files/vep/vep_gINDEL.gvf
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] Using GVF file: test/files/fusion/star_fusion.gvf
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] Variants sorted
[ 2024-02-29 18:11:47 ] [ moPepGen - DEBUG ] ['ENST00000614167.2']
[ 2024-02-29 18:11:47 ] [ moPepGen - DEBUG ] ['ENST00000614168.2']
[ 2024-02-29 18:11:47 ] [ moPepGen - DEBUG ] ['ENST00000622235.5']
[ 2024-02-29 18:11:47 ] [ moPepGen - DEBUG ] ['ENST00000642151.1']
[ 2024-02-29 18:11:47 ] [ moPepGen - DEBUG ] ['ENST00000624155.2']
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] Variant peptide FASTA file written to disk.
[ 2024-02-29 18:11:47 ] [ moPepGen - INFO ] rss=79.59 MiB, vms=395.6 MiB, wallclock=0:00:01.180000, system=0:00:00.720000, cpu_usage=101.2%

Closes #594

Checklist