-
Notifications
You must be signed in to change notification settings - Fork 0
/
chips_automator.transfer.snakefile
77 lines (69 loc) · 2.13 KB
/
chips_automator.transfer.snakefile
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
66
67
68
69
70
71
72
73
74
75
76
77
import glob
def all_targets(wildcards):
"""Generates the targets for this module"""
ls = []
ls.append("atacseq_tx.analysis.report.txt")
ls.append("atacseq_tx.benchmarks.txt")
ls.append("atacseq_tx.src.txt")
ls.append("atacseq_tx.config_meta.txt")
ls.append("atacseq_tx.nohup.txt")
return ls
configfile: "config.yaml"
rule target:
input:
all_targets
rule transfer_report:
#input:
# "analysis/align/mapping.csv" #stub file b/c snkmk doesn't allow dirs
params:
transfer_path=config['transfer_path'],
output:
"atacseq_tx.analysis.report.txt"
shell:
"""gsutil -m cp analysis/report/report.zip {params.transfer_path} &&
touch {output}"""
rule transfer_benchmarks:
#input:
#"benchmarks/all_atacseq_targets.txt" #stub file b/c snkmk doesn't do dir
params:
transfer_path=config['transfer_path'],
output:
"atacseq_tx.benchmarks.txt"
shell:
"""gsutil -m cp -r analysis/Benchmark/ {params.transfer_path} &&
touch {output}"""
rule transfer_src:
#input:
# "cidc_atacseq/atacseq.snakefile" #stub file b/c snkmk doesn't allow dirs
params:
transfer_path=config['transfer_path'],
output:
"atacseq_tx.src.txt"
shell:
"""gsutil -m cp -r cidc_chips/ {params.transfer_path} &&
touch {output}"""
rule transfer_config_meta:
input:
conf="config.yaml",
meta="metasheet.csv",
params:
transfer_path=config['transfer_path']
output:
"atacseq_tx.config_meta.txt"
shell:
#NOTE: the *.yaml covers the config.yaml and the atacseq_auto config.yaml
"""gsutil -m cp -r *.yaml {params.transfer_path} &&
gsutil -m cp -r {input.meta} {params.transfer_path} &&
touch {output}"""
rule transfer_nohups:
input:
"nohup.out"
params:
transfer_path=config['transfer_path'],
files=lambda wildcards: glob.glob('nohup*.out*')
output:
"atacseq_tx.nohup.txt"
run:
for f in params.files:
shell("gsutil -m cp -r {f} {params.transfer_path}")
shell("touch {output}")