Closed janetrbarclay closed 2 years ago
Great idea! I just ran a small experiment and you can wrap rules in an if/else statement:
rule all:
input:
"my_output.txt"
upper = config['upper']
text_to_write = "More perFect UnION"
if upper:
rule write_upper:
output:
"my_output.txt"
run:
with open(output[0], 'w') as f:
f.write(text_to_write.upper())
else:
rule write_lower:
output:
"my_output.txt"
run:
with open(output[0], 'w') as f:
f.write(text_to_write.lower())
So we could just wrap the train
and train_model_local_or_cpu
in a similar if/else
statement conditional on a setting in the config.yml
This issue is outdated since dropping train_model_cli
in #177 .
Would it be beneficial to have a setting in config.yml that determines which training rule in the Snakefile is used? Seems easier than having to comment / uncomment each time a switch is made (especially since the config file is likely edited for each run but the Snakefile may not be).