Skip to content

Commit

Permalink
Minor updates (#25)
Browse files Browse the repository at this point in the history
* Accept options as list

* Add snakemake report option
  • Loading branch information
percyfal authored Jan 10, 2025
1 parent b3eabe2 commit fd06552
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/nbis/snakemake.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ def directory_option():
)


def report_option() -> Callable[[FC], FC]:
"""Add snakemake report option"""
func = click.option(
"--report",
help=("generate snakemake report"),
is_flag=True,
default=False,
)
return func


def format_snakemake_help(smkfile, *, default=None):
"""Return docstring from snakemake file.
Expand Down
4 changes: 3 additions & 1 deletion src/nbis/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ def run(self, *args, **kwargs):
raise NotImplementedError


def snakemake(targets=None, options=None, snakefile=None):
def snakemake(*, targets=None, options=None, snakefile=None):
"""Run snakemake workflows."""
if isinstance(options, list):
options = " ".join(options)
cmdlist = [
"snakemake",
f"{'-s ' + str(snakefile) if snakefile else ''}",
Expand Down

0 comments on commit fd06552

Please sign in to comment.