Commit 67f14260 authored by Marc Duez's avatar Marc Duez

server : config save germline name

- save germline name in database
- change add form, edit form to handle germline
- task.py : worker use correct germline
parent afb0db33
......@@ -40,19 +40,23 @@ def add_form():
error += "info needed, "
if request.vars['config_command'] == "" :
error += "command needed, "
if request.vars['config_germline'] == "" :
error += "germline needed, "
if error=="" :
db.config.insert(name=request.vars['config_name'],
info=request.vars['config_info'],
command=request.vars['config_command'],
germline=request.vars['config_germline']
)
res = {"success": "true" }
res = {"redirect": "config/index",
"message": "config added"}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else :
res = {"success" : "false", "error" : error}
res = {"success" : "false", "message" : error}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
......@@ -78,13 +82,16 @@ def edit_form():
if request.vars['config_info'] == "" :
error += "info needed, "
if request.vars['config_command'] == "" :
error += "command needed, "
error += "command needed, "
if request.vars['config_germline'] == "" :
error += "germline needed, "
if error=="" :
db.config[request.vars["id"]] = dict(name=request.vars['config_name'],
info=request.vars['config_info'],
command=request.vars['config_command'],
germline=request.vars['config_germline']
)
res = {"redirect": "config/index",
......@@ -92,7 +99,7 @@ def edit_form():
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
else :
res = {"success" : "false", "error" : error}
res = {"success" : "false", "message" : error}
return gluon.contrib.simplejson.dumps(res, separators=(',',':'))
def confirm():
......
......@@ -117,7 +117,8 @@ db.define_table('standard_file',
db.define_table('config',
Field('name', 'string'),
Field('command', 'string'),
Field('info','text'))
Field('info','text'),
Field('germline', 'string'))
db.define_table('data_file',
......
......@@ -16,9 +16,10 @@ def run_vidjil(id_file, id_config):
## config de vidjil
vidjil_cmd = db.config[id_config].command
vidjil_cmd = db.config[id_config].germline
## commande complete
cmd = vidjil_path+'/vidjil ' + vidjil_cmd + ' -o ' + out_folder + ' -G ' + germline_folder + 'TRG ' + seq_file
cmd = vidjil_path+'/vidjil ' + vidjil_cmd + ' -o ' + out_folder + ' -G ' + germline_folder + vidjil_germline + ' '+ seq_file
## execute la commande vidjil
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
......
......@@ -31,6 +31,19 @@
</td>
</tr>
-->
<tr>
<td>
<label for="config_germline" id="config_germline__label"> germline: </label>
</td>
<td>
<select id="config_germline" name="config_germline">
<option value="TRG">TRG</option>
<option value="IGH">IGH</option>
</select>
</td>
<td>
</td>
</tr>
<tr>
<td>
<label for="config_command" id="config_command__label">Command: </label>
......
......@@ -32,6 +32,7 @@ info = db.config[request.vars["id"]]
<td> </td>
</tr>
-->
<tr>
<td> <label for="config_command" id="config_command__label">Command: </label> </td>
<td> <input class="string" id="config_command" name="config_command" type="text" value="{{=info.command}}"> </td>
......
......@@ -10,8 +10,9 @@
<table class="db_table" id="table">
<thead>
<tr><td class="column2"> name </td>
<td class="column2"> germline </td>
<td class="column2"> command </td>
<td> info </td>
<td> command </td>
<td class="column5"> </td>
<td class="column5"> </td>
</tr>
......@@ -23,8 +24,9 @@
for row in query :}}
<tr>
<td> {{=row.name }} </td>
<td> {{=row.info }} </td>
<td> {{=row.germline }} </td>
<td> {{=row.command }} </td>
<td> {{=row.info }} </td>
<td onclick="db.call('config/edit', {'id' :'{{=row.id}}'} )" > e </td>
<td onclick="db.call('config/confirm', {'id' :'{{=row.id}}'} )" > X </td>
</tr>
......
Markdown is supported
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