Commit 039b0661 authored by mmassaviol's avatar mmassaviol
Browse files

Add expand on wildcard in step_outputs when needed

parent 4d22e901
......@@ -80,13 +80,28 @@ def generate(name):
for step in yaml["steps_in"]:
if ("step_name" in step) and ("rule_name" in step):
# Check in tool yaml if {sample} in output files to add expand
tool_yaml = read_yaml("./tools/"+step["tool_name"]+"/"+step["tool_name"]+".yaml")
need_expand = False
for command in tool_yaml["commands"]:
if command["name"] == step["rule_name"]:
for output in command["outputs"]:
if "{sample}" in output["file"]:
need_expand = True
if need_expand:
expand_start = "expand("
expand_end = ", sample=SAMPLES)"
else:
expand_start = ""
expand_end = ""
add = ""
if ("_SE" in step["rule_name"]):
add = "and config['SeOrPe'] == 'SE'"
if ("_PE" in step["rule_name"]):
add = "and config['SeOrPe'] == 'PE'"
result += "\tif (step == \"" + step["step_name"] + "\" " + add + " ):\n"
result += "\t\toutputs = rules." + step["step_name"] + "__" + step["rule_name"] + ".output\n"
result += "\t\toutputs = " + expand_start + "rules." + step["step_name"] + "__" + step["rule_name"] + ".output " + expand_end + "\n"
result += "\t\t\n"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment