Commit e07d1f25 authored by vpodpecan's avatar vpodpecan

updated Biomine search for plants

parent 2e6e9c8c
......@@ -565,7 +565,7 @@
"parameter_type": "text",
"variable": "maxnodes",
"parameter": true,
"order": 1,
"order": 2,
"description": "Search parameter maxnodes"
}
},
......@@ -578,12 +578,12 @@
"short_name": "dbs",
"uid": "cbdafcda-e0a8-4e8d-9684-f65023ec5b5b",
"default": "",
"required": false,
"required": true,
"multi": false,
"parameter_type": "text",
"parameter_type": null,
"variable": "dbname",
"parameter": true,
"order": 1,
"parameter": false,
"order": 3,
"description": "Name of the database to use"
}
},
......@@ -3004,6 +3004,46 @@
"description": "Rules as rows, their terms as columns."
}
},
{
"pk": 435,
"model": "workflows.abstractwidget",
"fields": {
"category": 44,
"treeview_image": "",
"windows_queue": false,
"name": "Select Biomine database",
"is_streaming": false,
"uid": "91b39cdf-e6b2-4b4f-b5c9-38ecf2ba01bf",
"interaction_view": "segmine_selectBMdatabase",
"image": "",
"package": "segmine",
"static_image": "",
"post_interact_action": "segmine_selectBMdatabase_finished",
"user": null,
"visualization_view": "",
"streaming_visualization_view": "",
"action": "segmine_selectBMdatabase",
"wsdl_method": "",
"wsdl": "",
"interactive": true,
"has_progress_bar": false,
"order": 1,
"description": "Calls the API of the new Biomine service to get the list of available databases."
}
},
{
"pk": 472,
"model": "workflows.abstractoutput",
"fields": {
"widget": 435,
"name": "Database name",
"short_name": "db",
"variable": "database",
"uid": "658dc964-06d2-4db9-8a82-f8d3947137ff",
"order": 1,
"description": "Name of the selected database"
}
},
{
"pk": 424,
"model": "workflows.abstractwidget",
......
......@@ -58,4 +58,22 @@ def segmine_hclustering(request, input_dict, output_dict, widget):
djson = hclustering2json(hcluster)
return render(request, 'interactions/segmine_hierarchical_clustering.html', {'widget': widget,
'dendrogram_json': djson,
'nexamples': len(hcluster)})
\ No newline at end of file
'nexamples': len(hcluster)})
# end
def segmine_selectBMdatabase(request, input_dict, output_dict, widget):
from urllib2 import urlopen
from json import loads
listdb_url = 'http://biomine.ijs.si/list_databases'
try:
result = loads(urlopen(listdb_url).read())
dbs = [str(x) for x in result['databases']]
except:
raise IOError('Error while calling Biomine API.')
return render(request, 'interactions/segmine_selectBMdatabase.html', {'widget': widget,
'databases': dbs})
# end
......@@ -902,4 +902,15 @@ def segmine_biomine_search_plants(input_dict):
if 'error' in result:
raise Exception(result['error'])
return {'bmgraph': result['graph']}
\ No newline at end of file
return {'bmgraph': result['graph']}
# end
def segmine_selectBMdatabase(input_dict):
return {'database': None}
def segmine_selectBMdatabase_finished(postdata, input_dict, output_dict):
dbid = str(postdata['selected_database'][0])
return {'database': dbid}
# end
<div id="widgetinteract-{{ widget.pk }}"
rel="{{ widget.pk }}"
class="widgetinteractdialog"
title="{{ widget.name }} wants your input!"
width=320 height=160>
<form id="interactionform-{{ widget.pk }}" name="interactionform-{{ widget.pk }}">
<label><strong>Available databases:</strong></label>
<select id="dbselect">
{% for dbid in databases %}
{% if forloop.counter0 == 0 %}
<option value="{{ dbid }}" selected>{{ dbid }}</option>
{% else %}
<option value="{{ dbid }}">{{ dbid }}</option>
{% endif %}
{% endfor %}
</select>
<input type="hidden" name="widget_id" value="{{ widget.pk }}">
{% for dbid in databases %}
{% if forloop.counter0 == 0 %}
<input type="hidden" id="dbInput" name="selected_database" value="{{ dbid }}">
{% endif %}
{% empty %}
<input type="hidden" id="dbInput" name="selected_database" value="">
{% endfor %}
</form>
</div>
<style type="text/css">
</style>
<script>
$("#dbselect").change(function () {
$("#dbInput").val($("#dbselect").val());
});
</script>
......@@ -7,6 +7,7 @@ from django.shortcuts import render
import os
import json
def segmine_biomine_visualizer(request, input_dict, output_dict, widget):
from mothra.settings import MEDIA_ROOT
from workflows.helpers import ensure_dir
......@@ -19,8 +20,9 @@ def segmine_biomine_visualizer(request, input_dict, output_dict, widget):
return render(request, 'visualizations/segmine_biomine_visualizer.html',
{'widget':widget, 'filename' : filename})
def segmine_rank_plotter(request, input_dict, output_dict, widget):
scores = input_dict['ranks']
scores = zip(*scores)[1]
return render(request, 'visualizations/segmine_rank_plotter.html',
{'widget':widget, 'gene_ranks' : json.dumps(scores)})
\ No newline at end of file
{'widget': widget, 'gene_ranks': json.dumps(scores)})
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