aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Sloan2012-10-03 16:02:34 -0500
committerZachary Sloan2012-10-03 16:02:34 -0500
commitf309b5144bfedc4aeaab0193f5be24a71737fc28 (patch)
tree19797082603558af36fc49eeaf1869edb97ec9b3
parentfe9082941a9c3a7815fb986a4717144f3ae7c021 (diff)
downloadgenenetwork2-f309b5144bfedc4aeaab0193f5be24a71737fc28.tar.gz
Changed css classes used in trait data table and wrote coffeescript code that
grabs the list of samples with an attribute value matching the value the user chose to exclude by. Added HTML5 data properties to table cells as data-column_name to use when excluding samples.
-rwxr-xr-xweb/css/general_flask.css54
-rwxr-xr-xweb/webqtl/collection/ExportSelectionDetailInfoPage.py2
-rw-r--r--wqflask/wqflask/show_trait/SampleList.py13
-rwxr-xr-xwqflask/wqflask/show_trait/show_trait.py7
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.coffee38
-rw-r--r--wqflask/wqflask/static/new/javascript/show_trait.js41
-rw-r--r--wqflask/wqflask/templates/search_result_page.html14
-rw-r--r--wqflask/wqflask/templates/show_trait.html43
-rw-r--r--wqflask/wqflask/views.py1
9 files changed, 146 insertions, 67 deletions
diff --git a/web/css/general_flask.css b/web/css/general_flask.css
index d0cffbc4..d40fa267 100755
--- a/web/css/general_flask.css
+++ b/web/css/general_flask.css
@@ -10,6 +10,8 @@ Blockquote {
margin : 14px 18px 14px 18px;
}
+/********** All this font size stuff, etc. needs to be replaced/removed ********** /
+
/*Font size*/
.fs10 {font-size : 10px}
.fs11 {font-size : 11px}
@@ -218,27 +220,47 @@ color: #999999;
/*For font style and color of commands and keywords in the scriptable interface page*/
.keywords
{
-font-family : "CourierNew", Courier, mono;
-font-size : 15px;
-color : #0000FF;
-font-weight : Normal
+ font-family : "CourierNew", Courier, mono;
+ font-size : 15px;
+ color : #0000FF;
+ font-weight : Normal
}
+
/*For RIsample.html page*/
.strains
{
-border:1px solid #999999;
-border-top:1px solid #940;
-border-bottom:1px solid #940;
-padding:5;
-background-color:#ddf;
-font-family:verdana;
+ border:1px solid #999999;
+ border-top:1px solid #940;
+ border-bottom:1px solid #940;
+ padding:5;
+ background-color:#ddf;
+ font-family:verdana;
}
+
.values
{
-border:1px solid #999999;
-border-top:1px solid #940;
-border-bottom:1px solid #940;
-padding:5;
-background-color:#eee;
-font-family:courier;
+ border:1px solid #999999;
+ border-top:1px solid #940;
+ border-bottom:1px solid #940;
+ padding:5;
+ background-color:#eee;
+ font-family:courier;
}
+
+/*****************************************/
+
+/* Standard table cell */
+.std_cell
+{
+ border : 1px solid #999999;
+ color : #222;
+ font-size : 13px;
+ padding : 3px;
+}
+
+/*Input field used to enter sample values, SE, etc.*/
+.trait_value_input
+{
+ font-style : Italic
+}
+
diff --git a/web/webqtl/collection/ExportSelectionDetailInfoPage.py b/web/webqtl/collection/ExportSelectionDetailInfoPage.py
index a61b6f6e..7238c797 100755
--- a/web/webqtl/collection/ExportSelectionDetailInfoPage.py
+++ b/web/webqtl/collection/ExportSelectionDetailInfoPage.py
@@ -128,7 +128,7 @@ class ExportSelectionDetailInfoPage(templatePage):
count = count + 1
except:
pass
- if count = 0:
+ if count == 0:
mean = 0
else:
mean = sum/count
diff --git a/wqflask/wqflask/show_trait/SampleList.py b/wqflask/wqflask/show_trait/SampleList.py
index d39559d3..df0dc61e 100644
--- a/wqflask/wqflask/show_trait/SampleList.py
+++ b/wqflask/wqflask/show_trait/SampleList.py
@@ -112,19 +112,6 @@ class SampleList(object):
self.attributes[key].distinct_values.sort(key=natural_sort_key)
- # exclude_menu = HT.Select(name="exclude_menu")
- # dropdown_menus = [] #ZS: list of dropdown menus with the distinct values of each attribute (contained in DIVs so the style parameter can be edited and they can be hidden)
- # for this_attr_name in attribute_names:
- # exclude_menu.append((this_attr_name.capitalize(), this_attr_name))
- # attr_value_menu_div = HT.Div(style="display:none;", Class="attribute_values") #container used to show/hide dropdown menus
- # attr_value_menu = HT.Select(name=this_attr_name)
- # attr_value_menu.append(("None", "show_all"))
- # for value in distinct_values:
- # attr_value_menu.append((str(value[0]), value[0]))
- # attr_value_menu_div.append(attr_value_menu)
- # dropdown_menus.append(attr_value_menu_div)
-
-
def get_extra_attribute_values(self, sample_name):
attribute_values = {}
diff --git a/wqflask/wqflask/show_trait/show_trait.py b/wqflask/wqflask/show_trait/show_trait.py
index 9bad6154..d34ae9a6 100755
--- a/wqflask/wqflask/show_trait/show_trait.py
+++ b/wqflask/wqflask/show_trait/show_trait.py
@@ -161,7 +161,12 @@ class ShowTrait(templatePage):
self.sample_group_types['primary_only'] = fd.RISet + " Only"
self.sample_group_types['other_only'] = "Non-" + fd.RISet
self.sample_group_types['all_cases'] = "All Cases"
- js_data = dict(sample_groups = self.sample_group_types,
+ sample_lists = []
+ for group in self.sample_groups:
+ sample_lists.append(group.sample_list)
+ print("sample_lists is:", pf(sample_lists))
+ js_data = dict(sample_group_types = self.sample_group_types,
+ sample_lists = sample_lists,
attribute_names = self.sample_groups[0].attributes)
print("js_data:", pf(js_data))
self.js_data = js_data
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.coffee b/wqflask/wqflask/static/new/javascript/show_trait.coffee
index a91e9681..e22f1c21 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.coffee
+++ b/wqflask/wqflask/static/new/javascript/show_trait.coffee
@@ -68,8 +68,8 @@ $ ->
make_table = ->
header = "<thead><tr><th>&nbsp;</th>"
- console.log("js_data.sample_groups:", js_data.sample_groups)
- for own key, value of js_data.sample_groups
+ console.log("js_data.sample_group_types:", js_data.sample_group_types)
+ for own key, value of js_data.sample_group_types
console.log("aa key:", key)
console.log("aa value:", value)
the_id = process_id("column", key)
@@ -107,8 +107,8 @@ $ ->
console.log("rowing")
row_line = """<tr>"""
row_line += """<td id="#{ row.vn }">#{ row.pretty }</td>"""
- console.log("box - js_data.sample_groups:", js_data.sample_groups)
- for own key, value of js_data.sample_groups
+ console.log("box - js_data.sample_group_types:", js_data.sample_group_types)
+ for own key, value of js_data.sample_group_types
console.log("apple key:", key)
the_id = process_id(key, row.vn)
console.log("the_id:", the_id)
@@ -147,7 +147,7 @@ $ ->
console.log("Should be now Hide Outliers")
- #Calculate Correlations Code
+ ##Calculate Correlations Code
on_corr_method_change = ->
@@ -164,9 +164,9 @@ $ ->
$('select[name=corr_method]').change(on_corr_method_change)
- #End Calculate Correlations Code
+ ##End Calculate Correlations Code
- #Populate Samples Attribute Values Code
+ ##Populate Samples Attribute Values Code
create_value_dropdown = (value) ->
return """<option val=#{value}>#{value}</option>"""
@@ -187,9 +187,29 @@ $ ->
populate_sample_attributes_values_dropdown()
$('#exclude_menu').change(populate_sample_attributes_values_dropdown)
+ ##End Populate Samples Attribute Values Codess
+
+ ##Block Samples By Attribute Value Code
+ block_by_attribute_value = ->
+ console.log("in beginning of bbav code")
+ attribute_name = $('#exclude_menu').val()
+ console.log("attribute_name is:", attribute_name)
+ exclude_by_value = $('#attribute_values').val()
+ console.log("exclude_by_value is:", exclude_by_value)
+ sample_lists = js_data['sample_lists']
+ console.log("sample_lists is:", sample_lists)
+ for sample_list in sample_lists
+ for sample in sample_list
+ console.log("sample is:", sample)
+ if sample.extra_attributes[attribute_name] == exclude_by_value
+ console.log("is exclude_by_value")
+ sample_row = $('')
+
+
+
+ $('#exclude_group').click(block_by_attribute_value)
-
- #End Populate Samples Attribute Values Code
+ ##End Block Samples By Attribute Value Code
console.log("before registering show_hide_outliers")
$('#show_hide_outliers').click(show_hide_outliers)
diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js
index 039a5e04..65440427 100644
--- a/wqflask/wqflask/static/new/javascript/show_trait.js
+++ b/wqflask/wqflask/static/new/javascript/show_trait.js
@@ -11,7 +11,7 @@
};
$(function() {
- var change_stats_value, create_value_dropdown, edit_data_change, hide_tabs, make_table, on_corr_method_change, populate_sample_attributes_values_dropdown, process_id, show_hide_outliers, stats_mdp_change, update_stat_values;
+ var block_by_attribute_value, change_stats_value, create_value_dropdown, edit_data_change, hide_tabs, make_table, on_corr_method_change, populate_sample_attributes_values_dropdown, process_id, show_hide_outliers, stats_mdp_change, update_stat_values;
hide_tabs = function(start) {
var x, _i, _results;
_results = [];
@@ -94,8 +94,8 @@
make_table = function() {
var header, key, row, row_line, rows, table, the_id, the_rows, value, _i, _len, _ref, _ref1;
header = "<thead><tr><th>&nbsp;</th>";
- console.log("js_data.sample_groups:", js_data.sample_groups);
- _ref = js_data.sample_groups;
+ 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];
@@ -132,8 +132,8 @@
console.log("rowing");
row_line = "<tr>";
row_line += "<td id=\"" + row.vn + "\">" + row.pretty + "</td>";
- console.log("box - js_data.sample_groups:", js_data.sample_groups);
- _ref1 = js_data.sample_groups;
+ console.log("box - js_data.sample_group_types:", js_data.sample_group_types);
+ _ref1 = js_data.sample_group_types;
for (key in _ref1) {
if (!__hasProp.call(_ref1, key)) continue;
value = _ref1[key];
@@ -222,6 +222,37 @@
};
populate_sample_attributes_values_dropdown();
$('#exclude_menu').change(populate_sample_attributes_values_dropdown);
+ block_by_attribute_value = function() {
+ var attribute_name, exclude_by_value, sample, sample_list, sample_lists, sample_row, _i, _len, _results;
+ console.log("in beginning of bbav code");
+ attribute_name = $('#exclude_menu').val();
+ console.log("attribute_name is:", attribute_name);
+ exclude_by_value = $('#attribute_values').val();
+ console.log("exclude_by_value is:", exclude_by_value);
+ sample_lists = js_data['sample_lists'];
+ console.log("sample_lists is:", sample_lists);
+ _results = [];
+ for (_i = 0, _len = sample_lists.length; _i < _len; _i++) {
+ sample_list = sample_lists[_i];
+ _results.push((function() {
+ var _j, _len1, _results1;
+ _results1 = [];
+ for (_j = 0, _len1 = sample_list.length; _j < _len1; _j++) {
+ sample = sample_list[_j];
+ console.log("sample is:", sample);
+ if (sample.extra_attributes[attribute_name] === exclude_by_value) {
+ console.log("is exclude_by_value");
+ _results1.push(sample_row = $(''));
+ } else {
+ _results1.push(void 0);
+ }
+ }
+ return _results1;
+ })());
+ }
+ return _results;
+ };
+ $('#exclude_group').click(block_by_attribute_value);
console.log("before registering show_hide_outliers");
$('#show_hide_outliers').click(show_hide_outliers);
console.log("after registering show_hide_outliers");
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 572f7fcc..c20efe40 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -171,9 +171,9 @@
<TD class="fs12 fwn ffl b1 c222" nowrap="on">{{ loop.index }}
<INPUT TYPE="checkbox" NAME="searchResult" class="checkbox" VALUE="{{ thisTrait }}" onClick="highlight(this)">
</TD>
- <TD class="fs12 fwn b1 c222">
+ <TD class="stdcell">
{# <A HREF="javascript:showDatabase3('{{ thisFormName }}','{{thisTrait.db.name}}','{{ thisTrait.name }}','{{ thisTrait.cellid }}')" class="fs12 fwn"> - </a> #}
- <a href="{{ url_for('show_trait', database=thisTrait.db.name, ProbeSetID=thisTrait.name, incparentsf1='ON', RISet='BXD')}}" class="fs12 fwn">
+ <a href="{{ url_for('show_trait_page', database=thisTrait.db.name, ProbeSetID=thisTrait.name, incparentsf1='ON', RISet='BXD')}}" class="fs12 fwn">
{{ thisTrait.name.upper() }}
</a>
</TD>
@@ -182,11 +182,11 @@
{{ thisTrait.symbol }}
</A>
</TD>
- <TD class="fs12 fwn b1 c222">{{ thisTrait.description_display }}</TD>
- <TD class="fs12 fwn b1 c222" nowrap="on">{{ thisTrait.trait_location_repr }}</TD>
- <TD class="fs12 fwn b1 c222" nowrap="ON" align="right">{{ thisTrait.mean }}</TD>
- <TD class="fs12 fwn b1 c222" nowrap="on" align="right">{{ thisTrait.LRS_score_repr }}</TD>
- <TD class="fs12 fwn b1 c222" nowrap="on">{{ thisTrait.LRS_location_repr }}</TD>
+ <TD class="stdcell">{{ thisTrait.description_display }}</TD>
+ <TD class="stdcell" nowrap="on">{{ thisTrait.trait_location_repr }}</TD>
+ <TD class="stdcell" nowrap="ON" align="right">{{ thisTrait.mean }}</TD>
+ <TD class="stdcell" nowrap="on" align="right">{{ thisTrait.LRS_score_repr }}</TD>
+ <TD class="stdcell" nowrap="on">{{ thisTrait.LRS_location_repr }}</TD>
</TR>
{% endfor %}
</TABLE>
diff --git a/wqflask/wqflask/templates/show_trait.html b/wqflask/wqflask/templates/show_trait.html
index 3d24e738..0ef86685 100644
--- a/wqflask/wqflask/templates/show_trait.html
+++ b/wqflask/wqflask/templates/show_trait.html
@@ -1238,7 +1238,7 @@
<select id="attribute_values" size=1>
</select>
{% endif %}
- <input type="button" name="exclude_group" class="button" value=" Block ">
+ <input type="button" id="exclude_group" class="button" value=" Block ">
<br>
<strong>&nbsp;&nbsp;Options:</strong>
@@ -1253,9 +1253,14 @@
</span>
<br>
<br>
- <span>&nbsp;&nbsp;Outliers highlighted in <strong style="background-color:yellow;">&nbsp;yellow&nbsp;</strong> can be hidden using
- the <strong>Hide Outliers</strong> button,<br>
- &nbsp;&nbsp;and samples with no value (x) can be hidden by clicking <strong>Hide No Value</strong> .</span><br>
+ <span>&nbsp;&nbsp;Outliers highlighted in
+ <strong style="background-color:yellow;">&nbsp;yellow&nbsp;</strong>
+ can be hidden using
+ the <strong>Hide Outliers</strong> button,
+ <br>
+ &nbsp;&nbsp;and samples with no value (x) can be hidden by clicking
+ <strong>Hide No Value</strong>t.
+ </span><br>
</div><br>
<div style="width:80%;margin:0;padding:0;border:none;">
@@ -1280,36 +1285,44 @@
{% endif %}
{% for attribute in sample_type.attributes|sort() %}
- <th class="fs13 fwb ff1 b1 cw cbrb" align="right" width="60">{{ sample_type.attributes[attribute].name }}</th>
+ <th class="fs13 fwb ff1 b1 cw cbrb" align="right" width="60">
+ {{ sample_type.attributes[attribute].name }}
+ </th>
{% endfor %}
</tr>
{% for sample in sample_type.sample_list %}
<tr class="{{ sample.class_outlier }} value_se" id="{{ sample.this_id }}">
- <td class="fs13 b1 c222" align="right" width="45">
+ <td class="std_cell" data-column_name="Index" align="right" width="45">
{{ loop.index }}
- <input type="checkbox" name="selectCheck" class="checkbox edit_sample_checkbox" value="{{ sample.name }}" checked="checked">
+ <input type="checkbox" name="selectCheck"
+ class="checkbox edit_sample_checkbox"
+ value="{{ sample.name }}" checked="checked">
</td>
- <td class="fs13 b1 c222" align="right" width="100">
- <span class="fs14 fwn ffl edit_sample_sample_name">{{ sample.name }}</span>
+ <td class="std_cell" data-column_name="Sample" align="right" width="100">
+ <span class="fs14 fwn ffl edit_sample_sample_name">
+ {{ sample.name }}
+ </span>
</td>
{# Todo: Add IDs #}
- <td class="fs13 b1 c222" align="right" width="70">
- <input type="text" name="{{ sample.name }}" class="fs13 b1 c222 edit_sample_value valueField"
+ <td class="std_cell" data-column_name="Value" align="right" width="70">
+ <input type="text" name="{{ sample.name }}"
+ class="trait_value_input edit_sample_value"
value="{{ sample.display_value }}" size="8" maxlength="8"
style="text-align:right; background-color:#FFFFFF;">
</td>
{% if sample_type.se_exists() %}
- <td class="fs13 b1 c222" align="center" width="20">
+ <td class="std_cell" align="center" width="20">
±
</td>
{# Todo: Add IDs #}
- <td class="fs13 b1 c222" align="right" width="80">
- <input type="text" name=""{{ 'V' + sample.name}}" class="fs13 b1 c222 valueField edit_sample_se"
+ <td class="std_cell" data-column_name="SE" align="right" width="80">
+ <input type="text" name=""{{ 'V' + sample.name}}"
+ class="trait_value_input edit_sample_se"
value="{{ sample.display_variance }}"
size="8" maxlength="8" style="text-align:right">
</td>
@@ -1317,7 +1330,7 @@
{# Loop through each attribute type and input value #}
{% for attribute in sample_type.attributes|sort() %}
- <td class="fd13 b1 c222" align="right" width="80">
+ <td class="std_cell" data-column_name="{{ sample_type.attributes[attribute].name }}" align="right" width="80">
{{ sample.extra_attributes[sample_type.attributes[attribute].name] }}
</td>
{% endfor %}
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index c38ecb47..82a08c71 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -94,6 +94,7 @@ def corr_compute_page():
# Todo: Can we simplify this? -Sam
def sharing_info_page():
+ """Info page displayed when the user clicks the "Info" button next to the dataset selection"""
print("In sharing_info_page")
fd = webqtlFormData.webqtlFormData(request.args)
print("2Have fd")