Hello community,
How do you add help function in a snakemake file such that it will print a description of the workflow when you enter:
snakemake --snakefile Snakefile help
I tried the following: import argparse
parser = argparse.ArgumentParser(
description='''ENTER DESCRIPTION HERE.''')
args = parser.parse_args()
rule invenU:
input: ["/home/bnextgen/reads/bngsa_nietinfected_1.fastq","/home/bnextgen/reads/bngsa_nietinfected_2.fastq"]
output: ["/home/s1104230/output/iutr1.fastq", "/home/s1104230/output/iutr2.fastq"]
script: "/home/s1104230/scripts/inven.py"
# input: ["/home/s1104230/data/bngsa1_24M.txt","/home/s1104230/data/bngsa2_24M.txt"]
# output: ["/home/s1104230/output/iutr1.fastq", "/home/s1104230/output/iutr2.fastq"]
# script: "/home/s1104230/scripts/inven.py"
I get the following error back:
Cedricks-MacBook-Pro:scripts cedrickagaser$ snakemake --snakefile Snakefile help
usage: snakemake [-h]
snakemake: error: unrecognized arguments: --snakefile Snakefile help
SystemExit in line 10 of /Users/cedrickagaser/Documents/bnextgen/scripts/Snakefile:
2
File "/Users/cedrickagaser/Documents/bnextgen/scripts/Snakefile", line 10, in <module>
File "/Users/cedrickagaser/miniconda3/lib/python3.6/argparse.py", line 1737, in parse_args
File "/Users/cedrickagaser/miniconda3/lib/python3.6/argparse.py", line 2393, in error
File "/Users/cedrickagaser/miniconda3/lib/python3.6/argparse.py", line 2380, in exit
the argeparse method works well with other python programs but with Snakefile not.
Thank you, I added a rule where I "cat" the help description from a file and it works fine.