You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is any code prior to running the rules that creates directories, they may not have the correct paths. This is because snakeparse needs to "source" the snakefile prior to actually running it, and doing so without the parsed pipeline arguments.
For example:
from snakeparse.parser import argparser
from pathlib import Path
def snakeparser(**kwargs):
p = argparser(**kwargs)
p.parser.add_argument('-o', '--output-dir', help='The output directory.', default=Path('.'), type=Path)
return p
args = snakeparser().parse_config(config=config)
args.output_dir.mkdir(parents=True, exist_ok=True)
rule all:
str(args.output_dir / "dummy.txt")
rule dummy:
output: str(args.output_dir / "dummy.txt"
shell: """echo Hi > {output}"""
This should be instead:
from snakeparse.parser import argparser
from pathlib import Path
def snakeparser(**kwargs):
p = argparser(**kwargs)
p.parser.add_argument('-o', '--output-dir', help='The output directory.', default=Path('.'), type=Path)
return p
args = snakeparser().parse_config(config=config)
onstart:
args.output_dir.mkdir(parents=True, exist_ok=True)
rule all:
str(args.output_dir / "dummy.txt")
rule dummy:
output: str(args.output_dir / "dummy.txt"
shell: """echo Hi > {output}"""
The text was updated successfully, but these errors were encountered:
If there is any code prior to running the rules that creates directories, they may not have the correct paths. This is because
snakeparse
needs to "source" the snakefile prior to actually running it, and doing so without the parsed pipeline arguments.For example:
This should be instead:
The text was updated successfully, but these errors were encountered: