aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask
diff options
context:
space:
mode:
authorzsloan2016-03-15 17:10:17 +0000
committerzsloan2016-03-15 17:10:17 +0000
commit8fbc009a157778615140ec08de3751e307dd3c31 (patch)
treedac7fd6de7abb1931fdc11ef45ae3b12c2681c50 /wqflask/wqflask
parent9b76cfbb1f1be0f140284c8d26a3f6c846691dec (diff)
parentbf599c2e873a619fc6e575fcfba29cd8f8c9a32d (diff)
downloadgenenetwork2-8fbc009a157778615140ec08de3751e307dd3c31.tar.gz
Merge branch 'master' of https://github.com/genenetwork/genenetwork2
Diffstat (limited to 'wqflask/wqflask')
-rwxr-xr-xwqflask/wqflask/show_trait/export_trait_data.py17
-rwxr-xr-xwqflask/wqflask/static/new/javascript/show_trait.js14
-rwxr-xr-xwqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js2
-rwxr-xr-xwqflask/wqflask/templates/show_trait_calculate_correlations.html2
-rwxr-xr-xwqflask/wqflask/views.py6
5 files changed, 34 insertions, 7 deletions
diff --git a/wqflask/wqflask/show_trait/export_trait_data.py b/wqflask/wqflask/show_trait/export_trait_data.py
index f7f2d6d4..f5d02e73 100755
--- a/wqflask/wqflask/show_trait/export_trait_data.py
+++ b/wqflask/wqflask/show_trait/export_trait_data.py
@@ -21,6 +21,19 @@ def export_sample_table(targs):
def dict_to_sorted_list(dictionary):
sorted_list = [item for item in dictionary.iteritems()]
- sorted_list = sorted(sorted_list, key=operator.itemgetter(0))
+ sorted_list = sorted(sorted_list, cmp=cmp_samples)
sorted_values = [item[1] for item in sorted_list]
- return sorted_values \ No newline at end of file
+ return sorted_values
+
+def cmp_samples(a, b):
+ if b[0] == 'name':
+ return 1
+ elif b[0] == 'value':
+ if a[0] == 'se':
+ return 1
+ else:
+ return -1
+ elif b[0] == 'se':
+ return -1
+ else:
+ return 0 \ No newline at end of file
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 1dd54e3a..8d5982b7 100755
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -310,6 +310,20 @@
}
};
$('select[name=corr_method]').change(on_corr_method_change);
+
+ submit_special = function(url) {
+ $("#trait_data_form").attr("action", url);
+ return $("#trait_data_form").submit();
+ };
+
+ $(".corr_compute").on("click", (function(_this) {
+ return function() {
+ var url;
+ url = "/corr_compute";
+ return submit_special(url);
+ };
+ })(this));
+
create_value_dropdown = function(value) {
return "<option val=" + value + ">" + value + "</option>";
};
diff --git a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
index 3637233e..68744aa9 100755
--- a/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait_mapping_tools.js
@@ -3,11 +3,9 @@
var block_outliers, composite_mapping_fields, do_ajax_post, get_progress, mapping_method_fields, open_mapping_results, outlier_text, showalert, submit_special, toggle_enable_disable, update_time_remaining;
submit_special = function(url) {
- //var url;
console.log("In submit_special");
console.log("this is:", this);
console.log("$(this) is:", $(this));
- //url = $(this).data("url");
console.log("url is:", url);
$("#trait_data_form").attr("action", url);
return $("#trait_data_form").submit();
diff --git a/wqflask/wqflask/templates/show_trait_calculate_correlations.html b/wqflask/wqflask/templates/show_trait_calculate_correlations.html
index a7edbc48..ed58b32c 100755
--- a/wqflask/wqflask/templates/show_trait_calculate_correlations.html
+++ b/wqflask/wqflask/templates/show_trait_calculate_correlations.html
@@ -102,7 +102,7 @@
<div class="form-group">
<label for="corr_sample_method" class="col-xs-1 control-label"></label>
<div class="col-xs-4 controls">
- <button class="btn submit_special btn-primary" data-url="/corr_compute" title="Compute Correlation">
+ <button class="btn corr_compute submit_special btn-primary" data-url="/corr_compute" title="Compute Correlation">
<i class="icon-ok-circle icon-white"></i> Compute
</button>
</div>
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 89b7ba43..b42e0d4c 100755
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -236,13 +236,15 @@ def export_trait_excel():
for i, row in enumerate(sample_data):
worksheet.write(i, 0, row[0])
worksheet.write(i, 1, row[1])
+ if len(row) > 2:
+ worksheet.write(i, 2, row[2])
workbook.close()
excel_data = buff.getvalue()
buff.close()
return Response(excel_data,
mimetype='application/vnd.ms-excel',
- headers={"Content-Disposition":"attachment;filename=test.xlsx"})
+ headers={"Content-Disposition":"attachment;filename=sample_data.xlsx"})
@app.route('/export_trait_csv', methods=('POST',))
def export_trait_csv():
@@ -262,7 +264,7 @@ def export_trait_csv():
return Response(csv_data,
mimetype='text/csv',
- headers={"Content-Disposition":"attachment;filename=test.csv"})
+ headers={"Content-Disposition":"attachment;filename=sample_data.csv"})
@app.route("/show_trait")
def show_trait_page():