Skip to content

Commit

Permalink
Exposing snakemake's --rerun-triggers (#170).
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Jul 22, 2022
1 parent d9d208f commit 7216a9c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ biomedsheets >=0.11.1
termcolor==1.1.0

# Snakemake is used for providing the actual wrapper calling functionality
snakemake >=7.0.2
snakemake >=7.8.0
# Snakemake needs manual install of PyYAML to make YAML configuration loading work
PyYAML>=3.12

Expand Down
10 changes: 10 additions & 0 deletions snappy_pipeline/apps/snappy_snake.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import sys

from ruamel import yaml
from snakemake import RERUN_TRIGGERS
from snakemake import main as snakemake_main

from .. import __version__
Expand Down Expand Up @@ -169,6 +170,8 @@ def run(wrapper_args):
]
if wrapper_args.keep_going:
snakemake_argv.append("--keep-going")
if wrapper_args.rerun_triggers:
snakemake_argv += ["--rerun-triggers"] + wrapper_args.rerun_triggers
if wrapper_args.unlock:
snakemake_argv.append("--unlock")
if wrapper_args.rerun_incomplete:
Expand Down Expand Up @@ -285,6 +288,13 @@ def main(argv=None):
"not yet exist."
),
)
group.add_argument(
"--rerun-triggers",
nargs="+",
choices=RERUN_TRIGGERS,
default=["mtime"], # TODO: switch to RERUN_TRIGGERS,
help="Expose --rerun-triggers from snakemake but set to only mtime by default.",
)

group = parser.add_argument_group(
"Snakemake Verbosity / Debugging",
Expand Down
2 changes: 2 additions & 0 deletions tests/snappy_pipeline/apps/test_snappy_snake.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def test_snappy_snake_list_output(germline_sheet_fake_project_ngs_mapping_fs, mo
p + "/workflows/ngs_mapping/Snakefile",
"--jobscript",
p + "/apps/tpls/jobscript.sh",
"--rerun-triggers",
"mtime",
"-S",
"--verbose",
"--cores",
Expand Down

0 comments on commit 7216a9c

Please sign in to comment.