Commit 2a37f444 authored by mmassaviol's avatar mmassaviol
Browse files

Update snakfile generation (add stepname to tools)

parent 835be8c7
......@@ -59,18 +59,6 @@ def generate(name):
result += yaml["input"]+" = "+raw_inputs_yaml["function_call"]+"\n"
result += "config.update("+yaml["input"]+")\n"
result += "SAMPLES = "+yaml["input"]+"['samples']\n"
#else : # OLD (to replace for all workflows with input raw_reads)
# result += "# Generic input functions\n"
# result += "## get raw_reads\n"
# result += "def raw_reads():\n"
# result += "\tinputs = dict()\n"
# result += "\tif (config[\"SeOrPe\"] == \"PE\"):\n"
# result += "\t\tinputs[\"read\"] = config['sample_dir']+'/{sample}_R1'+config[\"sample_suffix\"]\n"
# result += "\t\tinputs[\"read2\"] = config['sample_dir']+'/{sample}_R2'+config[\"sample_suffix\"]\n"
# result += "\telse:\n"
# result += "\t\tinputs[\"read\"] = config['sample_dir']+'/{sample}'+config[\"sample_suffix\"]\n"
# result += "\treturn inputs\n"
# result += "raw_reads = raw_reads()\n"
result += "\n"
......@@ -82,7 +70,7 @@ def generate(name):
if "rule_name" in step:
result += "def " + step["rule_name"] + "_inputs():\n"
result += "def " + step["step_name"] + "_" + step["rule_name"] + "_inputs():\n"
result += "\tinputs = dict()\n"
if "params" in step:
......@@ -90,7 +78,7 @@ def generate(name):
if "raw_" in param["origin_command"] :
result += "\tinputs[\"" + param["input_name"] + "\"] = "+param["origin_command"]+"[\""+param["origin_name"]+"\"]\n"
else:
result += "\tinputs[\"" + param["input_name"] + "\"] = rules." + param["origin_command"] + ".output." + param["origin_name"] + "\n"
result += "\tinputs[\"" + param["input_name"] + "\"] = rules." + param["origin_step"] + "_" + param["origin_command"] + ".output." + param["origin_name"] + "\n"
result += "\treturn inputs\n"
result += "\n"
......@@ -123,7 +111,7 @@ def generate(name):
if ("_PE" in step["rule_name"]):
add = "and config['SeOrPe'] == 'PE'"
result += "\tif (step == \"" + step["step_name"] + "\" " + add + " ):\n"
result += "\t\toutputs = rules." + step["rule_name"] + ".output\n"
result += "\t\toutputs = rules." + step["step_name"] + "_" + step["rule_name"] + ".output\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