forked from Lekanville/bbt_research
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
198 lines (179 loc) · 7.63 KB
/
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#!python
#!/usr/bin/env python3
from variables_preprocessing import variables
from variables_learning import learning
rule targets:
input:
##variables.merged_decrypted["output_file"],
#variables.sel_cr_1["output_file"],
#variables.sel_cr_2["output_file"],
#variables.process_cycles["output_file"],
#variables.process_quest["output_file"],
#variables.cycle_level_data["model_cycle"],
#variables.cycle_level_data["output_file"],
#learning.get_learning_variables["output_file"],
learning.cycle_level_learning["output_folder"],
#learning.user_level_variables["output_file"],
learning.user_level_learning["output_folder"],
#learning.get_BMI["output_file"]
learning.quest_level_learning["output_folder"],
learning.user_and_quest_level_learning["output_folder"]
rule data_clean:
input:
input_folder = variables.data_cleaning["input_folder"],
output:
output_file = variables.data_cleaning["output_file"]
shell:"""
python -m dat_clean -i '{input.input_folder}' -o '{output.output_file}'
"""
rule data_decrypt:
input:
input_script_js = "code/decrypt.js",
input_file = variables.data_decryption["input_file"],
output:
output_folder = directory(variables.data_decryption["output_folder"]),
output_log = variables.data_decryption["log"]
shell:"""
node {input.input_script_js} {input.input_file} {output.output_folder} > {output.output_log}
"""
rule merged_decrypted:
input:
input_folder = variables.merged_decrypted["input_folder"]
output:
output_file = variables.merged_decrypted["output_file"]
shell:"""
python -m decrypt_merge_2 -i '{input.input_folder}' -o '{output.output_file}'
"""
rule sel_cr_1:
input:
input_file = variables.sel_cr_1["input_file"]
output:
output_file = variables.sel_cr_1["output_file"]
params:
cr_1_1 = variables.sel_cr_1["cr_1_1"],
cr_1_2 = variables.sel_cr_1["cr_1_2"],
shell:"""
python -m sel_crt_1 -i '{input.input_file}' -o '{output.output_file}' -x {params.cr_1_1} -y {params.cr_1_2} > {output.output_file}
"""
rule sel_cr_2:
input:
input_file = variables.sel_cr_2["input_file"]
output:
output_file = variables.sel_cr_2["output_file"]
params:
cr_2_1 = variables.sel_cr_2["cr_2_1"],
cr_2_2 = variables.sel_cr_2["cr_2_2"],
cr_2_3 = variables.sel_cr_2["cr_2_3"]
shell:"""
python -m sel_crt_2 -i '{input.input_file}' -o {output.output_file} -r {params.cr_2_1} -n {params.cr_2_2} -c {params.cr_2_3} > {output.output_file}
"""
rule process_cycles:
input:
input_folder = variables.process_cycles["input_folder"],
input_file = variables.process_cycles["input_file"]
output:
output_file = variables.process_cycles["output_file"]
shell:"""
python -m process_cycles -i '{input.input_folder}' -j '{input.input_file}' -o {output.output_file} > {output.output_file}
"""
rule process_quest:
input:
input_file = variables.process_quest["input_file"],
input_cycles = variables.process_quest["input_cycles"]
output:
output_temps_dur = variables.process_quest["output_file_1"],
output_quest = variables.process_quest["output_file_2"]
shell:"""
python -m process_quest -i '{input.input_file}' -j '{input.input_cycles}' -o {output.output_temps_dur} -q {output.output_quest}
"""
rule model_cycle:
input:
input_quest = variables.model_cycle_data["input_quest"],
input_cycles = variables.model_cycle_data["input_cycles"],
input_temps = variables.model_cycle_data["input_temps"],
output:
output_file = variables.model_cycle_data["output_file"]
shell:"""
python -m model_cycle_new -i '{input.input_quest}' -j '{input.input_cycles}' -k {input.input_temps} -o {output.output_file}
"""
rule cycle_level_data:
input:
input_temps = variables.cycle_level_data["input_temps"],
input_cycles = variables.cycle_level_data["input_cycles"],
model_cycle = variables.cycle_level_data["model_cycle"]
output:
output_file = variables.cycle_level_data["output_file"]
shell:"""
python -m nadirs_and_peaks -i '{input.input_temps}' -j '{input.input_cycles}' -m {input.model_cycle} -o {output.output_file}
"""
rule get_learning_variables:
input:
input_temps = learning.get_learning_variables["input_temps"],
input_quest = learning.get_learning_variables["input_quest"],
model_cycle = learning.get_learning_variables["model_cycle"]
output:
output_temps = learning.get_learning_variables["output_file_temps"],
output_quest = learning.get_learning_variables["output_file_quest"]
shell:"""
python -m learning_variables -i {input.input_temps} -j {input.input_quest} -k {input.model_cycle} -o {output.output_temps} -p {output.output_quest}
"""
rule cycle_level_learning:
input:
input_variables = learning.cycle_level_learning["input_file"]
params:
input_splits = learning.cycle_level_learning["number_of_splits"]
output:
output_file = directory(learning.cycle_level_learning["output_folder"])
#output_log = learning.cycle_level_learning_variable["log"]
shell:"""
python -m cycle_level_learning -i {input.input_variables} -k {params.input_splits} -o {output.output_file}
"""
rule user_level_variables:
input:
input_variables = learning.user_level_variables["input_file"]
output:
output_file = learning.user_level_variables["output_file"]
shell:"""
python -m user_level_variables -i {input.input_variables} -o {output.output_file}
"""
rule user_level_learning:
input:
input_variables = learning.user_level_learning["input_file"]
params:
input_splits = learning.user_level_learning["number_of_splits"]
output:
output_file = directory(learning.user_level_learning["output_folder"])
shell:"""
python -m user_level_learning -i {input.input_variables} -k {params.input_splits} -o {output.output_file}
"""
# rule preprocess_quest:
# input:
# input_quest = learning.preprocess_quest["input_quest"],
# model_cycle = learning.preprocess_quest["model_cycle"],
# input_temps = learning.preprocess_quest["input_temps"]
# output:
# output_file = learning.preprocess_quest["output_file"]
# shell:"""
# python -m quest_preprocess -i {input.input_quest} -j {input.model_cycle} -k {input.input_temps} -o {output.output_file}
# """
rule quest_level_learning:
input:
input_variables = learning.quest_level_learning["input_file"]
params:
input_splits = learning.quest_level_learning["number_of_splits"]
output:
output_file = directory(learning.quest_level_learning["output_folder"])
shell:"""
python -m quest_level_learning -i {input.input_variables} -k {params.input_splits} -o {output.output_file}
"""
rule user_and_quest_level_learning:
input:
input_variables_1 = learning.user_and_quest_level_learning["input_file_1"],
input_variables_2 = learning.user_and_quest_level_learning["input_file_2"]
params:
input_splits = learning.user_and_quest_level_learning["number_of_splits"]
output:
output_file = directory(learning.user_and_quest_level_learning["output_folder"])
shell:"""
python -m user_and_quest_learning -i {input.input_variables_1} -j {input.input_variables_2} -k {params.input_splits} -o {output.output_file}
"""