-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsbx_template.smk
More file actions
65 lines (53 loc) · 1.85 KB
/
Copy pathsbx_template.smk
File metadata and controls
65 lines (53 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
try:
SBX_TEMPLATE_VERSION = get_ext_version("sbx_template")
except NameError:
# For backwards compatibility with older versions of Sunbeam
SBX_TEMPLATE_VERSION = "0.0.0"
try:
logger = get_extension_logger("sbx_template")
except NameError:
# For backwards compatibility with older versions of Sunbeam
import logging
logger = logging.getLogger("sunbeam.pipeline.extensions.sbx_template")
logger.info("Doing some extension specific setup...")
logger.info(f"Using sbx_template version {SBX_TEMPLATE_VERSION}.")
logger.error("Don't worry, this isn't a real error.")
localrules:
all_template,
rule all_template:
input:
QC_FP / "mush" / "big_file.txt",
rule example_rule:
"""Takes in decontaminated .fastq.gz and mushes them all together into a file"""
input:
expand(QC_FP / "decontam" / "{sample}_{rp}.fastq.gz", sample=Samples, rp=Pairs),
output:
QC_FP / "mush" / "big_file1.txt",
log:
LOG_FP / "example_rule.log",
benchmark:
BENCHMARK_FP / "example_rule.tsv"
params:
opts=Cfg["sbx_template"]["example_rule_options"],
conda:
"envs/sbx_template_env.yml"
container:
f"docker://sunbeamlabs/sbx_template:{SBX_TEMPLATE_VERSION}"
shell:
"(cat {params.opts} {input} > {output}) > {log} 2>&1"
rule example_with_script:
"""Take in big_file1 and then ignore it and write the results of `samtools --help` to the output using a python script"""
input:
QC_FP / "mush" / "big_file1.txt",
output:
QC_FP / "mush" / "big_file.txt",
log:
LOG_FP / "example_with_script.log",
benchmark:
BENCHMARK_FP / "example_with_script.tsv"
conda:
"envs/sbx_template_env.yml"
container:
f"docker://sunbeamlabs/sbx_template:{SBX_TEMPLATE_VERSION}"
script:
"scripts/example_with_script.py"