From 6a2eceeab41ac845027263b983e56db7b51319da Mon Sep 17 00:00:00 2001 From: ctbus Date: Wed, 25 Oct 2023 16:23:43 -0400 Subject: [PATCH 01/13] Update workflow name --- .github/workflows/test_tar_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_tar_release.yml b/.github/workflows/test_tar_release.yml index c23ed4d7..62b61ee2 100755 --- a/.github/workflows/test_tar_release.yml +++ b/.github/workflows/test_tar_release.yml @@ -1,4 +1,4 @@ -name: Test Tarball on Release +name: Test Tar on: release: From 9392a9c49d45c855e86d00ef819ef2bfb48f9482 Mon Sep 17 00:00:00 2001 From: ctbus Date: Mon, 30 Oct 2023 19:41:05 -0400 Subject: [PATCH 02/13] Add rule for every rule with benchmark --- environment.yml | 2 +- workflow/Snakefile | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index f6824e76..26e605f2 100644 --- a/environment.yml +++ b/environment.yml @@ -2,6 +2,6 @@ channels: - conda-forge - bioconda dependencies: - - snakemake + - snakemake >=7.32.0 - git # Ensure sunbeam extend works even with tar installation of main pipeline - python =3.12.0 diff --git a/workflow/Snakefile b/workflow/Snakefile index 962e74c8..16006e85 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -141,6 +141,35 @@ rule samples: [print(sample) for sample in sorted(list(Samples.keys()))] +rules_dict = rules._rules +for n, r in rules_dict.items(): + print(n) + try: + rule: + name: n + "_benchmark" + input: + r.output, + r.benchmark, + run: + print(n) + except TypeError: + pass + +rule: + name: + str(rules.sample_intake.rule) + input: + rules.sample_intake.output, + #rules.sample_intake.benchmark, + output: + "TEST.txt" + shell: + "echo 'yea'" + + +sys.stderr.write(str(rules.sample_intake.rule)) + + onstart: try: shutil.rmtree(BENCHMARK_FP) From 2da8c7dff866021f7be80983408fc1e06dd5361d Mon Sep 17 00:00:00 2001 From: ctbus Date: Tue, 31 Oct 2023 11:09:13 -0400 Subject: [PATCH 03/13] Update to remove target_list, no longer needed --- src/sunbeamlib/post.py | 17 ++++++++++++++ src/sunbeamlib/script_run.py | 44 ++++++++++++------------------------ 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/sunbeamlib/post.py b/src/sunbeamlib/post.py index 92754b15..6ecf8e0b 100755 --- a/src/sunbeamlib/post.py +++ b/src/sunbeamlib/post.py @@ -33,3 +33,20 @@ def compile_benchmarks(benchmark_fp: str, stats_fp: str) -> None: reader = csv.reader(g, delimiter="\t") next(reader) # Headers line writer.writerow([fp[:-4]] + next(reader)) + +import sys +def update_benchmark(func): + # added arguments inside the inner1, + # if function takes any arguments, + # can be added like this. + def inner1(*args, **kwargs): + + # storing time before function execution + sys.stderr.write("B") + + func(*args, **kwargs) + + # storing time after function execution + sys.stderr.write("A") + + return inner1 diff --git a/src/sunbeamlib/script_run.py b/src/sunbeamlib/script_run.py index 99ded2f3..7da70b3b 100644 --- a/src/sunbeamlib/script_run.py +++ b/src/sunbeamlib/script_run.py @@ -33,9 +33,6 @@ def main(argv=sys.argv): action="store_true", help="Use mamba instead of conda to manage environments", ) - parser.add_argument( - "--target_list", nargs="+", default=[], help="List of sunbeam targets" - ) # The remaining args (after --) are passed to Snakemake args, remaining = parser.parse_known_args(argv) @@ -51,32 +48,19 @@ def main(argv=sys.argv): conda_cmd = "conda" if not args.mamba else "mamba" - cmds = list() - if args.target_list == []: - args.target_list = [""] - - for target in args.target_list: - if target: - print(f"Running sunbeam on target: {target}") - - # Including target when it's en empty string breaks stuff so the extra - # list comp avoids that - snakemake_args = [ - arg - for arg in [ - "snakemake", - "--snakefile", - str(snakefile), - "--conda-prefix", - str(conda_prefix), - "--conda-frontend", - conda_cmd, - target, - ] - if arg - ] + remaining - print("Running: " + " ".join(snakemake_args)) + snakemake_args = [ + "snakemake", + "--snakefile", + str(snakefile), + "--conda-prefix", + str(conda_prefix), + "--conda-frontend", + conda_cmd, + ] + remaining + [ + "all_post" + ] + print("Running: " + " ".join(snakemake_args)) - cmds.append(subprocess.run(snakemake_args)) + cmd = subprocess.run(snakemake_args) - sys.exit(cmds[0].returncode) + sys.exit(cmd.returncode) From f4bab3d02e6437b14a01d9b1dcf8d9af923d1df0 Mon Sep 17 00:00:00 2001 From: ctbus Date: Tue, 31 Oct 2023 11:09:24 -0400 Subject: [PATCH 04/13] Deeper down the rabbit hole --- workflow/Snakefile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/workflow/Snakefile b/workflow/Snakefile index 16006e85..e5aedd79 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -132,42 +132,42 @@ for sbx_path, wildcards in sbxs: rule all: input: TARGET_ALL, + localrule: True rule samples: message: "Samples to be processed:" + localrule: True run: [print(sample) for sample in sorted(list(Samples.keys()))] -rules_dict = rules._rules +rules_dict = {n: r for n, r in rules._rules.items()} for n, r in rules_dict.items(): - print(n) + wildcard_str = "" + if r.rule._wildcard_names: + wildcard_str = "_{" + "}_{".join(r.rule._wildcard_names) + "}" try: rule: - name: n + "_benchmark" + name: n + "_post" input: r.output, r.benchmark, + output: + BENCHMARK_FP / "post" / f".{n}{wildcard_str}.done" + localrule: True run: print(n) except TypeError: pass -rule: - name: - str(rules.sample_intake.rule) - input: - rules.sample_intake.output, - #rules.sample_intake.benchmark, - output: - "TEST.txt" - shell: - "echo 'yea'" - -sys.stderr.write(str(rules.sample_intake.rule)) +rule all_post: + input: + [BENCHMARK_FP / "post" / f".{n}.done" for n, r in rules_dict.items()] + localrule: True + onstart: From c3476f6e80620191b4359db704a28d13277f82c3 Mon Sep 17 00:00:00 2001 From: ctbus Date: Tue, 31 Oct 2023 12:40:38 -0400 Subject: [PATCH 05/13] Update .gitignore --- .gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4dfc9c78..150c3078 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ configs/config*.yml \#* output __pycache__ -.tests/data/hosts/*.fasta.* -.tests/data/raw/*.fasta.* +tests/data/hosts/*.fasta.* +tests/data/raw/*.fasta.* tests/sunbeam_output tests/bacteria tests/local @@ -19,3 +19,5 @@ docs/_build extensions/* !extensions/.placeholder build +.vscode/ +projects/ \ No newline at end of file From 03f68f3d64d1c9df1de76628f5870c8779b109e5 Mon Sep 17 00:00:00 2001 From: ctbus Date: Mon, 6 Nov 2023 20:11:37 -0500 Subject: [PATCH 06/13] Update filter reads rule name --- src/sunbeamlib/slurm_profile.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sunbeamlib/slurm_profile.yaml b/src/sunbeamlib/slurm_profile.yaml index a88c512c..381dc683 100755 --- a/src/sunbeamlib/slurm_profile.yaml +++ b/src/sunbeamlib/slurm_profile.yaml @@ -70,8 +70,8 @@ set-resources: - remove_low_complexity:runtime=120 - align_to_host:mem_mb=16000 - align_to_host:runtime=240 - - filter_unmapped_reads:mem_mb=24000 - - filter_unmapped_reads:runtime=240 + - filter_reads:mem_mb=24000 + - filter_reads:runtime=240 - megahit_paired:mem_mb=20000 - megahit_paired:runtime=720 - final_filter:mem_mb=4000 From f117a5208863b15df0f306bfd9df11de81c9ce44 Mon Sep 17 00:00:00 2001 From: ctbus Date: Mon, 6 Nov 2023 20:12:05 -0500 Subject: [PATCH 07/13] Fix run script --- src/sunbeamlib/script_run.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sunbeamlib/script_run.py b/src/sunbeamlib/script_run.py index 7da70b3b..d885cf6b 100644 --- a/src/sunbeamlib/script_run.py +++ b/src/sunbeamlib/script_run.py @@ -56,9 +56,7 @@ def main(argv=sys.argv): str(conda_prefix), "--conda-frontend", conda_cmd, - ] + remaining + [ - "all_post" - ] + ] + remaining print("Running: " + " ".join(snakemake_args)) cmd = subprocess.run(snakemake_args) From ede53a535bdba1be047a278f903c32dc54299ffa Mon Sep 17 00:00:00 2001 From: ctbus Date: Mon, 6 Nov 2023 20:12:40 -0500 Subject: [PATCH 08/13] Partially working solution for end file size collection --- src/sunbeamlib/post.py | 69 +++++++++++++++++++++++++++++------------- workflow/Snakefile | 31 ++----------------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/sunbeamlib/post.py b/src/sunbeamlib/post.py index 6ecf8e0b..36f7a186 100755 --- a/src/sunbeamlib/post.py +++ b/src/sunbeamlib/post.py @@ -1,10 +1,13 @@ import csv import datetime import os +from pathlib import Path +from typing import Dict -def compile_benchmarks(benchmark_fp: str, stats_fp: str) -> None: +def compile_benchmarks(benchmark_fp: str, Cfg: Dict[str, Dict | str]) -> None: """Aggregate all the benchmark files into one and put it in stats_fp""" + stats_fp = Path(Cfg["all"]["root"]) / "stats" benchmarks = [] try: benchmarks = os.listdir(benchmark_fp) @@ -21,10 +24,10 @@ def compile_benchmarks(benchmark_fp: str, stats_fp: str) -> None: if not os.path.exists(stats_fp): os.makedirs(stats_fp) - stats_file = os.path.join( - stats_fp, - f"{str(int(datetime.datetime.now().timestamp() * 1000))}_benchmarks.tsv", - ) + + dt = str(int(datetime.datetime.now().timestamp() * 1000)) + stats_file = os.path.join(stats_fp, f"{dt}_benchmarks.tsv") + with open(stats_file, "w") as f: writer = csv.writer(f, delimiter="\t") writer.writerow(headers) @@ -33,20 +36,44 @@ def compile_benchmarks(benchmark_fp: str, stats_fp: str) -> None: reader = csv.reader(g, delimiter="\t") next(reader) # Headers line writer.writerow([fp[:-4]] + next(reader)) + + compile_file_stats(stats_fp, Cfg, dt) + + +def compile_file_stats(stats_fp: str, Cfg: Dict[str, Dict | str], dt: str) -> None: + """Collect data on all inputs and outputs (as long as they still exist at this point) as well as dbs""" + file_stats = {} + output_fp = Path(Cfg["all"]["root"]) / Cfg["all"]["output_fp"] + + stats_file = os.path.join(stats_fp, f"{dt}_file_stats.tsv") -import sys -def update_benchmark(func): - # added arguments inside the inner1, - # if function takes any arguments, - # can be added like this. - def inner1(*args, **kwargs): - - # storing time before function execution - sys.stderr.write("B") - - func(*args, **kwargs) - - # storing time after function execution - sys.stderr.write("A") - - return inner1 + # Collect info on all files in output_fp + for root, dirs, files in os.walk(output_fp): + for file in files: + fp = Path(root) / file + file_stats[fp] = fp.stat().st_size + + # Collect info on all dbs in Cfg + for section, values in Cfg.items(): + if section == "all": + continue + print(values) + for v in values: + try: + vp = Path(v) + except TypeError: + continue + if vp.exists(): + if vp.is_file(): + file_stats[vp] = vp.stat().st_size + elif vp.is_dir(): + for file in os.listdir(vp): + fp = vp / file + file_stats[fp] = fp.stat().st_size + + # Write to file + with open(stats_file, "w") as f: + writer = csv.writer(f, delimiter="\t") + writer.writerow(["file", "size"]) + for fp, size in file_stats.items(): + writer.writerow([fp, size]) diff --git a/workflow/Snakefile b/workflow/Snakefile index e5aedd79..ea871cae 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -143,33 +143,6 @@ rule samples: [print(sample) for sample in sorted(list(Samples.keys()))] -rules_dict = {n: r for n, r in rules._rules.items()} -for n, r in rules_dict.items(): - wildcard_str = "" - if r.rule._wildcard_names: - wildcard_str = "_{" + "}_{".join(r.rule._wildcard_names) + "}" - try: - rule: - name: n + "_post" - input: - r.output, - r.benchmark, - output: - BENCHMARK_FP / "post" / f".{n}{wildcard_str}.done" - localrule: True - run: - print(n) - except TypeError: - pass - - -rule all_post: - input: - [BENCHMARK_FP / "post" / f".{n}.done" for n, r in rules_dict.items()] - localrule: True - - - onstart: try: shutil.rmtree(BENCHMARK_FP) @@ -180,9 +153,9 @@ onstart: onsuccess: print("Sunbeam finished!") - compile_benchmarks(BENCHMARK_FP, Cfg["all"]["root"] / "stats") + compile_benchmarks(BENCHMARK_FP, Cfg) onerror: print("Sunbeam failed with error.") - compile_benchmarks(BENCHMARK_FP, Cfg["all"]["root"] / "stats") + compile_benchmarks(BENCHMARK_FP, Cfg) From c109000df7f48cb8491a46f7003248f4c8846e7b Mon Sep 17 00:00:00 2001 From: ctbus Date: Tue, 7 Nov 2023 11:56:06 -0500 Subject: [PATCH 09/13] Working improved stats --- src/sunbeamlib/post.py | 43 +++++++++++++++++++++++++++++++++++++----- workflow/Snakefile | 4 ++-- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/sunbeamlib/post.py b/src/sunbeamlib/post.py index 36f7a186..fa581d53 100755 --- a/src/sunbeamlib/post.py +++ b/src/sunbeamlib/post.py @@ -2,10 +2,11 @@ import datetime import os from pathlib import Path +from snakemake.common import Rules from typing import Dict -def compile_benchmarks(benchmark_fp: str, Cfg: Dict[str, Dict | str]) -> None: +def compile_benchmarks(benchmark_fp: str, Cfg: Dict[str, Dict | str], rules: Rules) -> None: """Aggregate all the benchmark files into one and put it in stats_fp""" stats_fp = Path(Cfg["all"]["root"]) / "stats" benchmarks = [] @@ -37,16 +38,49 @@ def compile_benchmarks(benchmark_fp: str, Cfg: Dict[str, Dict | str]) -> None: next(reader) # Headers line writer.writerow([fp[:-4]] + next(reader)) - compile_file_stats(stats_fp, Cfg, dt) + compile_file_stats(stats_fp, Cfg, dt, rules) -def compile_file_stats(stats_fp: str, Cfg: Dict[str, Dict | str], dt: str) -> None: +def compile_file_stats(stats_fp: str, Cfg: Dict[str, Dict | str], dt: str, rules: Rules) -> None: """Collect data on all inputs and outputs (as long as they still exist at this point) as well as dbs""" file_stats = {} output_fp = Path(Cfg["all"]["root"]) / Cfg["all"]["output_fp"] stats_file = os.path.join(stats_fp, f"{dt}_file_stats.tsv") + # Collect info on all files in params + param_fps = set() + for n, r in rules._rules.items(): + if r.params: + for p in r.params: + if isinstance(p, dict): + for k, v in p.items(): + try: + param_fps.add(Path(v)) + except TypeError: + continue + elif isinstance(p, list): + for i in p: + try: + param_fps.add(Path(i)) + except TypeError: + continue + else: + try: + param_fps.add(Path(p)) + except TypeError: + continue + + for fp in param_fps: + if fp.exists(): + if fp.is_file(): + file_stats[fp] = fp.stat().st_size + elif fp.is_dir(): + for file in os.listdir(fp): + nfp = fp / file + if nfp.exists() and nfp.is_file(): + file_stats[nfp] = nfp.stat().st_size + # Collect info on all files in output_fp for root, dirs, files in os.walk(output_fp): for file in files: @@ -57,8 +91,7 @@ def compile_file_stats(stats_fp: str, Cfg: Dict[str, Dict | str], dt: str) -> No for section, values in Cfg.items(): if section == "all": continue - print(values) - for v in values: + for k, v in values.items(): try: vp = Path(v) except TypeError: diff --git a/workflow/Snakefile b/workflow/Snakefile index ea871cae..ee595d32 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -153,9 +153,9 @@ onstart: onsuccess: print("Sunbeam finished!") - compile_benchmarks(BENCHMARK_FP, Cfg) + compile_benchmarks(BENCHMARK_FP, Cfg, rules) onerror: print("Sunbeam failed with error.") - compile_benchmarks(BENCHMARK_FP, Cfg) + compile_benchmarks(BENCHMARK_FP, Cfg, rules) From 94ba5787976a5e77e0cab1237336b1911eb10a42 Mon Sep 17 00:00:00 2001 From: ctbus Date: Wed, 8 Nov 2023 11:51:55 -0500 Subject: [PATCH 10/13] Add back target_list but deprecated --- docs/commands.rst | 4 +++- src/sunbeamlib/script_run.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/commands.rst b/docs/commands.rst index 56894c8b..0b322e46 100755 --- a/docs/commands.rst +++ b/docs/commands.rst @@ -71,13 +71,15 @@ Usage examples: 1. To run all targets (not including extensions): ``sunbeam run --profile /path/to/project/`` 2. To specify multiple targets: + ``sunbeam run --profile /path/to/project/ all_decontam all_assembly all_annotation`` +3. The equivalent of 2, using the deprecated ``--target_list`` option: ``sunbeam run --profile /path/to/project/ --target_list all_decontam all_assembly all_annotation`` .. code-block:: shell -h/--help: Display help. -s/--sunbeam_dir: Path to sunbeam installation. - --target_list: A list of targets to run successively. + --target_list: A list of targets to run successively. (DEPRECATED) : You can pass further arguments to Snakemake after ``--``, e.g: ``$ sunbeam run -- --cores 12``. See http://snakemake.readthedocs.io for more information. .. tip:: diff --git a/src/sunbeamlib/script_run.py b/src/sunbeamlib/script_run.py index d885cf6b..53455753 100644 --- a/src/sunbeamlib/script_run.py +++ b/src/sunbeamlib/script_run.py @@ -33,6 +33,9 @@ def main(argv=sys.argv): action="store_true", help="Use mamba instead of conda to manage environments", ) + parser.add_argument( + "--target_list", nargs="+", default=[], help="List of sunbeam targets (DEPRECATED)" + ) # The remaining args (after --) are passed to Snakemake args, remaining = parser.parse_known_args(argv) @@ -56,7 +59,7 @@ def main(argv=sys.argv): str(conda_prefix), "--conda-frontend", conda_cmd, - ] + remaining + ] + remaining + args.target_list print("Running: " + " ".join(snakemake_args)) cmd = subprocess.run(snakemake_args) From 105a582f50112ab634e215a03ac1301c024ee817 Mon Sep 17 00:00:00 2001 From: ctbus Date: Wed, 8 Nov 2023 15:10:20 -0500 Subject: [PATCH 11/13] Reformat --- src/sunbeamlib/post.py | 14 +++++++++----- src/sunbeamlib/script_run.py | 27 +++++++++++++++++---------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/sunbeamlib/post.py b/src/sunbeamlib/post.py index fa581d53..6a09bee9 100755 --- a/src/sunbeamlib/post.py +++ b/src/sunbeamlib/post.py @@ -6,7 +6,9 @@ from typing import Dict -def compile_benchmarks(benchmark_fp: str, Cfg: Dict[str, Dict | str], rules: Rules) -> None: +def compile_benchmarks( + benchmark_fp: str, Cfg: Dict[str, Dict | str], rules: Rules +) -> None: """Aggregate all the benchmark files into one and put it in stats_fp""" stats_fp = Path(Cfg["all"]["root"]) / "stats" benchmarks = [] @@ -25,7 +27,7 @@ def compile_benchmarks(benchmark_fp: str, Cfg: Dict[str, Dict | str], rules: Rul if not os.path.exists(stats_fp): os.makedirs(stats_fp) - + dt = str(int(datetime.datetime.now().timestamp() * 1000)) stats_file = os.path.join(stats_fp, f"{dt}_benchmarks.tsv") @@ -37,11 +39,13 @@ def compile_benchmarks(benchmark_fp: str, Cfg: Dict[str, Dict | str], rules: Rul reader = csv.reader(g, delimiter="\t") next(reader) # Headers line writer.writerow([fp[:-4]] + next(reader)) - + compile_file_stats(stats_fp, Cfg, dt, rules) -def compile_file_stats(stats_fp: str, Cfg: Dict[str, Dict | str], dt: str, rules: Rules) -> None: +def compile_file_stats( + stats_fp: str, Cfg: Dict[str, Dict | str], dt: str, rules: Rules +) -> None: """Collect data on all inputs and outputs (as long as they still exist at this point) as well as dbs""" file_stats = {} output_fp = Path(Cfg["all"]["root"]) / Cfg["all"]["output_fp"] @@ -70,7 +74,7 @@ def compile_file_stats(stats_fp: str, Cfg: Dict[str, Dict | str], dt: str, rules param_fps.add(Path(p)) except TypeError: continue - + for fp in param_fps: if fp.exists(): if fp.is_file(): diff --git a/src/sunbeamlib/script_run.py b/src/sunbeamlib/script_run.py index 53455753..ce8b4928 100644 --- a/src/sunbeamlib/script_run.py +++ b/src/sunbeamlib/script_run.py @@ -34,7 +34,10 @@ def main(argv=sys.argv): help="Use mamba instead of conda to manage environments", ) parser.add_argument( - "--target_list", nargs="+", default=[], help="List of sunbeam targets (DEPRECATED)" + "--target_list", + nargs="+", + default=[], + help="List of sunbeam targets (DEPRECATED)", ) # The remaining args (after --) are passed to Snakemake @@ -51,15 +54,19 @@ def main(argv=sys.argv): conda_cmd = "conda" if not args.mamba else "mamba" - snakemake_args = [ - "snakemake", - "--snakefile", - str(snakefile), - "--conda-prefix", - str(conda_prefix), - "--conda-frontend", - conda_cmd, - ] + remaining + args.target_list + snakemake_args = ( + [ + "snakemake", + "--snakefile", + str(snakefile), + "--conda-prefix", + str(conda_prefix), + "--conda-frontend", + conda_cmd, + ] + + remaining + + args.target_list + ) print("Running: " + " ".join(snakemake_args)) cmd = subprocess.run(snakemake_args) From c93b2614b37cb6b9cd86b4cac8536d026d9bfb9e Mon Sep 17 00:00:00 2001 From: ctbus Date: Wed, 8 Nov 2023 15:27:24 -0500 Subject: [PATCH 12/13] Don't use localrule yet, snakefmt not up to date --- workflow/Snakefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/workflow/Snakefile b/workflow/Snakefile index ee595d32..a142c192 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -132,17 +132,20 @@ for sbx_path, wildcards in sbxs: rule all: input: TARGET_ALL, - localrule: True rule samples: message: "Samples to be processed:" - localrule: True run: [print(sample) for sample in sorted(list(Samples.keys()))] +localrules: + all, + samples, + + onstart: try: shutil.rmtree(BENCHMARK_FP) From a28619b43c987167e4766eaa9cf67c562bee521c Mon Sep 17 00:00:00 2001 From: ctbus Date: Thu, 9 Nov 2023 16:00:44 -0500 Subject: [PATCH 13/13] Deprecate --target_list message --- src/sunbeamlib/script_run.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sunbeamlib/script_run.py b/src/sunbeamlib/script_run.py index ce8b4928..88e8c2f9 100644 --- a/src/sunbeamlib/script_run.py +++ b/src/sunbeamlib/script_run.py @@ -54,6 +54,12 @@ def main(argv=sys.argv): conda_cmd = "conda" if not args.mamba else "mamba" + if args.target_list: + sys.stderr.write( + "Warning: passing targets to '--target_list' is deprecated. " + "Please use 'sunbeam run target1 target2 target3' instead.\n" + ) + snakemake_args = ( [ "snakemake",