karel-brinda / Phylign

Alignment against all pre-2019 bacteria on laptops within a few hours (former MOF-Search)
http://brinda.eu/mof
Other
25 stars 4 forks source link

ANSI colors in Make Help command are not being interpreted #248

Closed Francii-B closed 9 months ago

Francii-B commented 9 months ago

ANSI escape codes in the output of make help command are not being interpreted and this is what I get:

######################              
## General commands ##              
######################              
    \x1b[36mall\x1b[m               Run everything (the default rule)
    \x1b[36mtest\x1b[m              Quick test using 3 batches
    \x1b[36mhelp\x1b[m              Print help messages
    \x1b[36mclean\x1b[m             Clean intermediate search files
    \x1b[36mcleanall\x1b[m          Clean all generated and downloaded files
####################                
## Pipeline steps ##                
####################                
    \x1b[36mconda\x1b[m             Create the conda environments
    \x1b[36mdownload\x1b[m          Download the assemblies and COBS indexes
    \x1b[36mdownload_asms\x1b[m     Download only the assemblies
    \x1b[36mdownload_cobs\x1b[m     Download only the COBS indexes
    \x1b[36mmatch\x1b[m             Match queries using COBS (queries -> candidates)
    \x1b[36mmap\x1b[m               Map candidates to assemblies (candidates -> alignments)
###############                     
## Reporting ##                     
###############                     
    \x1b[36mviewconf\x1b[m          View configuration without comments
    \x1b[36mreport\x1b[m            Generate Snakemake report
##########                          
## Misc ##                          
##########                          
    \x1b[36mcluster_slurm\x1b[m     Submit to a SLURM cluster
    \x1b[36mcluster_lsf_test\x1b[m  Submit the test pipeline to LSF cluster
    \x1b[36mcluster_lsf\x1b[m       Submit to LSF cluster
    \x1b[36mformat\x1b[m            Reformat Python and Snakemake files

I am running the code on Fedora v.39.

karel-brinda commented 9 months ago

What happens if you run echo -e "\x1b[36mcluster_slurm\x1b[m"?

Francii-B commented 9 months ago

It works because echo does not interpret backslash escapes by default on Fedora v.39

karel-brinda commented 9 months ago

This is actually quite interesting. Apparently, on Mac the color codes are not used at all from some reason. (That's why we haven't seen any error).

@Francii-B Could you please run the following command?

grep -hE '^\S*(:.*)?##'  Makefile

My output is

######################
## General commands ##
######################
all: ## Run everything (the default rule)
test: ## Quick test using 3 batches
help: ## Print help messages
clean: ## Clean intermediate search files
cleanall: clean ## Clean all generated and downloaded files
####################
## Pipeline steps ##
####################
conda: ## Create the conda environments
download: ## Download the assemblies and COBS indexes
download_asms: ## Download only the assemblies
download_cobs: ## Download only the COBS indexes
match: ## Match queries using COBS (queries -> candidates)
map: ## Map candidates to assemblies (candidates -> alignments)
###############
## Reporting ##
###############
viewconf: ## View configuration without comments
report: ## Generate Snakemake report
##########
## Misc ##
##########
cluster_slurm: ## Submit to a SLURM cluster
cluster_lsf_test: ## Submit the test pipeline to LSF cluster
cluster_lsf: ## Submit to LSF cluster
format: ## Reformat Python and Snakemake files

and I assume yours will be quite different

Francii-B commented 9 months ago

@karel-brinda I get the same output as yours:

######################
## General commands ##
######################
all: ## Run everything (the default rule)
test: ## Quick test using 3 batches
help: ## Print help messages
clean: ## Clean intermediate search files
cleanall: clean ## Clean all generated and downloaded files
####################
## Pipeline steps ##
####################
conda: ## Create the conda environments
download: ## Download the assemblies and COBS indexes
download_asms: ## Download only the assemblies
download_cobs: ## Download only the COBS indexes
match: ## Match queries using COBS (queries -> candidates)
map: ## Map candidates to assemblies (candidates -> alignments)
###############
\## Reporting ##
###############
viewconf: ## View configuration without comments
report: ## Generate Snakemake report
##########
## Misc ##
##########
cluster_slurm: ## Submit to a SLURM cluster
cluster_lsf_test: ## Submit the test pipeline to LSF cluster
cluster_lsf: ## Submit to LSF cluster
format: ## Reformat Python and Snakemake files