Skip to content

Commit

Permalink
Improve help messages
Browse files Browse the repository at this point in the history
  • Loading branch information
karel-brinda committed Mar 6, 2024
1 parent d94e6d3 commit 487262e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ BIG_TEST_PARAMS = --config protocol_pre=True protocol_post=True
## General commands ##
######################

all: ## Run everything
all: ## Run everything (the default subcommand)
snakemake $(SNAKEMAKE_PARAMS)

help: ## Print help messages
@echo "$$(grep -hE '^\S*(:.*)?##' $(MAKEFILE_LIST) \
| sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' -e 's/^\([^#]\)/ \1/g'\
@echo -e "$$(grep -hE '^\S*(:.*)?##' $(MAKEFILE_LIST) \
| sed \
-e 's/:.*##\s*/:/' \
-e 's/^\(.*\):\(.*\)/ \\x1b[36m\1\\x1b[m:\2/' \
-e 's/^\([^#]\)/\1/g' \
-e 's/: /:/g' \
-e 's/^#\(.*\)#/\\x1b[90m\1\\x1b[m/' \
| column -c2 -t -s : )"

conda: ## Create the conda environments
Expand Down Expand Up @@ -99,15 +104,13 @@ test: ## Run the workflow on test data (P1)
snakemake $(SNAKEMAKE_PARAMS); \
fi


bigtest: ## Run the workflow on test data (P1, P2, P3)
if [ -d ".test" ]; then \
$(MAKE) -C .test bigtest; \
else\
snakemake $(SNAKEMAKE_PARAMS) $(BIG_TEST_PARAMS); \
fi


format: ## Reformat all source code
snakefmt workflow
yapf -i --recursive workflow
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Here's a list of all implemented commands (to be executed as `make {command}`):
######################
## General commands ##
######################
all Run everything
all Run everything (the default subcommand)
help Print help messages
conda Create the conda environments
clean Clean all output archives and files with statistics
Expand All @@ -276,7 +276,8 @@ Here's a list of all implemented commands (to be executed as `make {command}`):
####################
## For developers ##
####################
test Run the workflow on test data
test Run the workflow on test data (P1)
bigtest Run the workflow on test data (P1, P2, P3)
format Reformat all source code
checkformat Check source code format
```
Expand All @@ -291,9 +292,10 @@ Here's a list of all implemented commands (to be executed as `make {command}`):
### 4e. Running on a cluster

Cluster-related parameters for Snakemake can be added via the `SMK_CLUSTER_ARGS` Make variable.

Example:
```bash
make SMK_CLUSTER_ARGS="--profile my_snakemake_cluster_profile"
make SMK_CLUSTER_ARGS="--profile my_snakemake_cluster_profile"
```


Expand Down

0 comments on commit 487262e

Please sign in to comment.