From 29b51444acbc6fa7c839bb588d7985c79364dc3d Mon Sep 17 00:00:00 2001
From: zsloan
Date: Fri, 5 Jun 2015 22:14:38 +0000
Subject: Added back in some of the options on the trait page; Add, Find, and
Verify now work. I'll get the other 4 working next.
---
wqflask/wqflask/show_trait/show_trait.py | 21 +--
.../static/new/javascript/show_trait.coffee | 8 +
.../wqflask/static/new/javascript/show_trait.js | 163 +++++++++++----------
wqflask/wqflask/templates/show_trait.html | 1 +
wqflask/wqflask/templates/show_trait_details.html | 24 +--
.../wqflask/templates/show_trait_edit_data.html | 8 +-
6 files changed, 123 insertions(+), 102 deletions(-)
(limited to 'wqflask')
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 7ad824fa..adb12b7b 100755
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -362,34 +362,35 @@ class ShowTrait(object):
#--------Hongqiang add this part in order to not only blat ProbeSet, but also blat Probe
blatsequence = '%3E'+this_trait.name+'%0A'+blatsequence+'%0A'
#XZ, 06/03/2009: ProbeSet name is not unique among platforms. We should use ProbeSet Id instead.
- self.cursor.execute("""SELECT Probe.Sequence, Probe.Name
+ query = """SELECT Probe.Sequence, Probe.Name
FROM Probe, ProbeSet, ProbeSetFreeze, ProbeSetXRef
WHERE ProbeSetXRef.ProbeSetFreezeId = ProbeSetFreeze.Id AND
ProbeSetXRef.ProbeSetId = ProbeSet.Id AND
- ProbeSetFreeze.Name = '%s' AND
- ProbeSet.Name = '%s' AND
- Probe.ProbeSetId = ProbeSet.Id order by Probe.SerialOrder""" % (this_trait.dataset.name, this_trait.name) )
+ ProbeSetFreeze.Name = '{}' AND
+ ProbeSet.Name = '{}' AND
+ Probe.ProbeSetId = ProbeSet.Id order by Probe.SerialOrder""".format(this_trait.dataset.name, this_trait.name)
+
+ seqs = g.db.execute(query).fetchall()
- seqs = self.cursor.fetchall()
for seqt in seqs:
if int(seqt[1][-1]) %2 == 1:
blatsequence += '%3EProbe_'+string.strip(seqt[1])+'%0A'+string.strip(seqt[0])+'%0A'
#XZ: Pay attention to the parameter of version (rn, mm, hg). They need to be changed if necessary.
if _Species == "rat":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', blatsequence)
+ self.UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('rat', 'rn3', blatsequence)
UTHSC_BLAT_URL = ""
elif _Species == "mouse":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', blatsequence)
+ self.UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('mouse', 'mm9', blatsequence)
UTHSC_BLAT_URL = webqtlConfig.UTHSC_BLAT % ('mouse', 'mm9', blatsequence)
elif _Species == "human":
- UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('human', 'hg19', blatsequence)
+ self.UCSC_BLAT_URL = webqtlConfig.UCSC_BLAT % ('human', 'hg19', blatsequence)
UTHSC_BLAT_URL = ""
else:
- UCSC_BLAT_URL = ""
+ self.UCSC_BLAT_URL = ""
UTHSC_BLAT_URL = ""
- if UCSC_BLAT_URL:
+ if self.UCSC_BLAT_URL != "":
verifyButton = HT.Href(url="#", onClick="javascript:openNewWin('%s'); return false;" % UCSC_BLAT_URL)
verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ",
title=" Check probe locations at UCSC ", style="border:none;")
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.coffee b/wqflask/wqflask/static/new/javascript/show_trait.coffee
index 3dedd7d5..91aa15ba 100755
--- a/wqflask/wqflask/static/new/javascript/show_trait.coffee
+++ b/wqflask/wqflask/static/new/javascript/show_trait.coffee
@@ -61,6 +61,14 @@ Stat_Table_Rows = [
]
$ ->
+
+ add = ->
+ trait = $("input[name=trait_hmac]").val()
+ console.log("trait is:", trait)
+ $.colorbox({href:"/collections/add?traits=#{trait}"})
+
+ $('#add_to_collection').click(add)
+
sample_lists = js_data.sample_lists
sample_group_types = js_data.sample_group_types
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 7311d0a8..302d5ec4 100755
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -1,8 +1,8 @@
-// Generated by CoffeeScript 1.9.2
+// Generated by CoffeeScript 1.8.0
(function() {
var Stat_Table_Rows, is_number,
- hasProp = {}.hasOwnProperty,
- slice = [].slice;
+ __hasProp = {}.hasOwnProperty,
+ __slice = [].slice;
console.log("start_b");
@@ -56,7 +56,16 @@
];
$(function() {
- var block_by_attribute_value, block_by_index, block_outliers, change_stats_value, create_value_dropdown, edit_data_change, export_sample_table_data, get_sample_table_data, hide_no_value, hide_tabs, make_table, on_corr_method_change, open_trait_selection, populate_sample_attributes_values_dropdown, process_id, redraw_bar_chart, redraw_histogram, redraw_prob_plot, reset_samples_table, sample_group_types, sample_lists, show_hide_outliers, stats_mdp_change, update_stat_values;
+ var add, block_by_attribute_value, block_by_index, block_outliers, change_stats_value, create_value_dropdown, edit_data_change, export_sample_table_data, get_sample_table_data, hide_no_value, hide_tabs, make_table, on_corr_method_change, open_trait_selection, populate_sample_attributes_values_dropdown, process_id, redraw_bar_chart, redraw_histogram, redraw_prob_plot, reset_samples_table, sample_group_types, sample_lists, show_hide_outliers, stats_mdp_change, update_stat_values;
+ add = function() {
+ var trait;
+ trait = $("input[name=trait_hmac]").val();
+ console.log("trait is:", trait);
+ return $.colorbox({
+ href: "/collections/add?traits=" + trait
+ });
+ };
+ $('#add_to_collection').click(add);
sample_lists = js_data.sample_lists;
sample_group_types = js_data.sample_group_types;
d3.select("#select_compare_trait").on("click", (function(_this) {
@@ -82,12 +91,12 @@
})(this));
};
hide_tabs = function(start) {
- var i, ref, results, x;
- results = [];
- for (x = i = ref = start; ref <= 10 ? i <= 10 : i >= 10; x = ref <= 10 ? ++i : --i) {
- results.push($("#stats_tabs" + x).hide());
+ var x, _i, _results;
+ _results = [];
+ for (x = _i = start; start <= 10 ? _i <= 10 : _i >= 10; x = start <= 10 ? ++_i : --_i) {
+ _results.push($("#stats_tabs" + x).hide());
}
- return results;
+ return _results;
};
stats_mdp_change = function() {
var selected;
@@ -124,36 +133,36 @@
}
};
update_stat_values = function(sample_sets) {
- var category, i, len, ref, results, row, show_effects;
+ var category, row, show_effects, _i, _len, _ref, _results;
show_effects = $(".tab-pane.active").attr("id") === "stats_tab";
- ref = ['samples_primary', 'samples_other', 'samples_all'];
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- category = ref[i];
- results.push((function() {
- var j, len1, results1;
- results1 = [];
- for (j = 0, len1 = Stat_Table_Rows.length; j < len1; j++) {
- row = Stat_Table_Rows[j];
+ _ref = ['samples_primary', 'samples_other', 'samples_all'];
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ category = _ref[_i];
+ _results.push((function() {
+ var _j, _len1, _results1;
+ _results1 = [];
+ for (_j = 0, _len1 = Stat_Table_Rows.length; _j < _len1; _j++) {
+ row = Stat_Table_Rows[_j];
console.log("Calling change_stats_value");
- results1.push(change_stats_value(sample_sets, category, row.vn, row.digits, show_effects));
+ _results1.push(change_stats_value(sample_sets, category, row.vn, row.digits, show_effects));
}
- return results1;
+ return _results1;
})());
}
- return results;
+ return _results;
};
redraw_histogram = function() {
var x;
return root.histogram.redraw((function() {
- var i, len, ref, results;
- ref = _.values(root.selected_samples[root.histogram_group]);
- results = [];
- for (i = 0, len = ref.length; i < len; i++) {
- x = ref[i];
- results.push(x.value);
+ var _i, _len, _ref, _results;
+ _ref = _.values(root.selected_samples[root.histogram_group]);
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ x = _ref[_i];
+ _results.push(x.value);
}
- return results;
+ return _results;
})());
};
redraw_bar_chart = function() {
@@ -163,13 +172,13 @@
return root.redraw_prob_plot_impl(root.selected_samples, root.prob_plot_group);
};
make_table = function() {
- var header, i, key, len, ref, ref1, row, row_line, table, the_id, the_rows, value;
+ var header, key, row, row_line, table, the_id, the_rows, value, _i, _len, _ref, _ref1;
header = " ";
console.log("windex header is:", header);
the_rows = " ";
console.log("js_data.sample_group_types:", js_data.sample_group_types);
- ref = js_data.sample_group_types;
- for (key in ref) {
- if (!hasProp.call(ref, key)) continue;
- value = ref[key];
+ _ref = js_data.sample_group_types;
+ for (key in _ref) {
+ if (!__hasProp.call(_ref, key)) continue;
+ value = _ref[key];
console.log("aa key:", key);
console.log("aa value:", value);
the_id = process_id("column", key);
@@ -178,8 +187,8 @@
header += "