Commit f5f465fa authored by mmassaviol's avatar mmassaviol
Browse files

Update scripts

parent d0ad4624
......@@ -3,7 +3,7 @@
# Accepts 1 parameter:
# Usage: ./generate_tool_snakefile.py tool_name
from tools import *
from tools import read_yaml
import sys
PATH_OUTPUT = "./"
......@@ -75,8 +75,8 @@ def generate(name):
if option['type'] == "input_file":
if "name" in option:
result += "\t\tinput_file_p" + str(count_input) + " = " + "config[\"" + option['name'] + "\"],\n"
result += "\t\t" + option['name'].replace(cmd["name"]+"_","").replace(name+"_","") + " = " + "config[\"" + option['name'] + "\"],\n"
#result += "\t\tinput_file_p" + str(count_input) + " = " + "config[\"" + option['name'] + "\"],\n"
count_input += 1
# output
......@@ -96,17 +96,17 @@ def generate(name):
if "name" in cmd:
result += "\t\t" + output_name + result_dir + " + \"/\" + " + "config[\""+cmd['name'] + "_output_dir\"]" + "\" + \"/" + output['file'] + "\",\n"
result += "\t\t" + output_name + result_dir + " + \"/\" + " + rule_dir + " + \"/" + output['file'] + "\",\n"
if "directory" in output:
if "name" in cmd:
result += "\t\tdirectory(" + result_dir + " + \"/\" + " + "config[\""+cmd['name'] + "_output_dir\"]" + "\" + \"/" + output['directory'] + "\"),\n"
result += "\t\tdirectory(" + result_dir + " + \"/\" + " + rule_dir + " + \"/" + output['directory'] + "\"),\n"
# params
result += "\n\tparam: \n"
result += "\n\tparams: \n"
sample_output = ""
......@@ -114,7 +114,7 @@ def generate(name):
if yaml['sample']:
sample_output = "{sample}"
result += "\t\toutput_dir = " + result_dir + " \" / \"" + "config[\""+cmd['name'] + "_output_dir\"]" + "\" + \"/" + sample_output + "\",\n"
result += "\t\toutput_dir = " + result_dir + " + \"/\" + " + rule_dir + "+ \"/" + sample_output + "\",\n"
if "options" in cmd:
......@@ -122,11 +122,13 @@ def generate(name):
for option in cmd_options:
if "name" in option:
if "type" in option and option["type"] != "input_file":
if "name" in option:
if option['name'] != (name + "_threads"):
if "_threads" not in option['name']:
result += "\t\t" + option['name'] + " = " + "\"\"" + ",\n"
result += "\t\t" + option['name'].replace(cmd["name"]+"_","").replace(name+"_","") + " = " + "config[\""+option['name']+"\"],\n"
# log
......@@ -135,7 +137,7 @@ def generate(name):
result += "\n\tlog: \n"
result += "\t\t" + result_dir + "/logs/" + cmd['name'] + "/" + sample + cmd['name'] + "_log.txt\n"
result += "\t\t" + result_dir + " + \"/logs/" + cmd['name'] + "/" + sample + cmd['name'] + "_log.txt\"\n"
# threads
......@@ -147,7 +149,7 @@ def generate(name):
if "name" in option:
if option['name'] == (name + "_threads"):
if "_threads" in option['name']:
result += "\n\t\tconfig[\"" + option['name'] + "\"]\n"
count_thread += 1
......@@ -163,9 +165,9 @@ def generate(name):
result += "\n\tshell: \n"
for shell in cmd_shell:
result += "\t\t\"" + shell + "\"\n"
#for shell in cmd_shell:
# result += "\t\t\"" + shell + "\"\n"
result += "\t\t\"" + cmd_shell + "\"\n"
# End cmd
......
......@@ -4,7 +4,7 @@
# Usage: ./generate_workflow_snakefile.py workflow_name
from tools import *
from tools import read_yaml
import sys
PATH_OUTPUT = "./"
......@@ -108,6 +108,7 @@ def generate(name):
result += "\tif (step == \"" + step["name"] + "\"):\n"
result += "\t\t# TODO Complete step\n"
result += "\t\t# outputs = rules.rule_name.output\n"
result += "\t\tpass\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