aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2016-11-02 21:54:41 +0000
committerzsloan2016-11-02 21:54:41 +0000
commitde58be0b8620032261f1f4699856994a4ee164d7 (patch)
tree1471365be3ff35e5ae423e78fe763c7bf67dd9b5 /wqflask
parentdaecb401ec470064cb69c11e0241fd14a915de8f (diff)
downloadgenenetwork2-de58be0b8620032261f1f4699856994a4ee164d7.tar.gz
Added toggleable short and long labels to correlation matrix
Fixed issue where I forgot to remove a parameter from jsonable_table_row in trait.py
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/trait.py2
-rw-r--r--wqflask/wqflask/static/new/javascript/create_corr_matrix.js22
-rw-r--r--wqflask/wqflask/templates/correlation_matrix.html26
3 files changed, 45 insertions, 5 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 8788d983..11a91d1d 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -120,7 +120,7 @@ class GeneralTrait(object):
else:
return dict()
- def jsonable_table_row(self, index, search_type):
+ def jsonable_table_row(self, index):
"""Return a list suitable for json and intended to be displayed in a table
Actual turning into json doesn't happen here though"""
diff --git a/wqflask/wqflask/static/new/javascript/create_corr_matrix.js b/wqflask/wqflask/static/new/javascript/create_corr_matrix.js
index a34fc408..44ed3c81 100644
--- a/wqflask/wqflask/static/new/javascript/create_corr_matrix.js
+++ b/wqflask/wqflask/static/new/javascript/create_corr_matrix.js
@@ -56,4 +56,26 @@ $('.corr_cell').each( function () {
else {
$(this).css('background-color', 'white')
}
+});
+
+$('#short_labels').click( function (){
+ $('.shortName').each( function() {
+ if ($(this).css("display") == "none"){
+ $(this).css("display", "block");
+ }
+ else {
+ $(this).css("display", "none");
+ }
+ });
+});
+
+$('#long_labels').click( function (){
+ $('.verboseName').each( function() {
+ if ($(this).css("display") == "none"){
+ $(this).css("display", "block");
+ }
+ else {
+ $(this).css("display", "none");
+ }
+ });
}); \ No newline at end of file
diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html
index d847614a..cd2aa35e 100644
--- a/wqflask/wqflask/templates/correlation_matrix.html
+++ b/wqflask/wqflask/templates/correlation_matrix.html
@@ -12,11 +12,12 @@
{{ header("Correlation Matrix") }}
+<div class="container">
{% if lowest_overlap < 8 %}
<div style="margin: 20px;" >Caution: This matrix of correlations contains some cells with small sample sizes of fewer than 8.</div>
{% endif %}
-<table class="matrix" border="1" cellpadding="5" cellspacing="1" style="margin: 20px;" width="80%">
+<table class="matrix" border="1" cellpadding="5" cellspacing="1" width="80%">
<tbody>
<tr>
<td style="background-color: royalblue;" ></td>
@@ -26,12 +27,26 @@
<td align="center" rowspan="{{traits|length + 1 }}" width="10" style="font-weight: Bold; border: 1px solid #999999; padding: 3px; color: #fff; background-color: royalblue;">P e a r s o n &nbsp;&nbsp;&nbsp; r</td>
<td width="300"></td>
{% for trait in traits %}
- <td align="center"><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait{{ loop.index }}</a></td>
+ <td align="center">
+ <a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait{{ loop.index }}</a>
+ </td>
{% endfor %}
</tr>
{% for trait in traits %}
<tr>
- <td><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait {{ loop.index }}: {{ trait.dataset.name }}::{{ trait.name }}</a><div id="shortName_0" style="display:none">Symbol: {{ trait.symbol }} </div><div id="verboseName_0" style="display:none">{{ trait_symbol }} on Chr {{ trait.chr }} @ {{ trait.mb }} Mb</div><div id="verboseName2_0" style="display:none">{{ trait.description }}</div><div id="verboseName3_0" style="display:none">{{ trait.probe_target_description }}</div></td>
+ <td>
+ <a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}" style="font-weight: Bold;">Trait {{ loop.index }}: {{ trait.dataset.name }}::{{ trait.name }}</a>
+ <div class="shortName" style="display:none">{% if trait.dataset.type == "ProbeSet" %}Symbol: {{ trait.symbol }}{% elif trait.dataset.type == "Publish" %}Phenotype: {{ trait.post_publication_abbreviation }}{% else %}Genotype{% endif %} </div>
+ <div class="verboseName" style="display: none;">
+ {% if trait.dataset.type == "ProbeSet" %}
+ <div>{{ trait.symbol }} on Chr {{ trait.chr }} @ {{ trait.mb }} Mb</div><div>{{ trait.description }}</div><div>{{ trait.probe_target_description }}</div>
+ {% elif trait.dataset.type == "Publish" %}
+ <div>PubMed {{ trait.pubmed_id }}: RecordID/{{ trait.name }}</div><div>Phenotype: {{ trait.description_display }}</div>
+ {% else %}
+ <div>Locus {{ trait.name }}</div><div>Chr {{ trait.chr }} @ {{ trait.mb }} Mb</div>
+ {% endif %}
+ </div>
+ </td>
{% for result in corr_results[loop.index-1] %}
{% if result[0].name == trait.name %}
<td nowrap="ON" align="center" bgcolor="#cccccc"><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}"><font style="font-size: 11px; color: #000000;" ><em>n</em><br>{{ result[2] }}</font></a></td>
@@ -43,7 +58,9 @@
{% endfor %}
</tbody>
</table>
-
+<br>
+<button class="btn btn-default" id="short_labels">Short Labels</button>
+<button class="btn btn-default" id="long_labels">Long Labels</button>
<br>
<div id="loadings_plot"></div>
@@ -79,6 +96,7 @@
</tbody>
</table>
+</div>
{% endblock %}