aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2016-06-03 16:59:25 +0000
committerzsloan2016-06-03 16:59:25 +0000
commitab133cc37015ea469f4d41155b58f0435d9001f3 (patch)
tree9942d840ea8283a7a6f23319bb1c971377a04211 /wqflask
parentda5268183ac424cf591ce2abb90a336b41009bb9 (diff)
downloadgenenetwork2-ab133cc37015ea469f4d41155b58f0435d9001f3.tar.gz
Changed appearance of tables to more easily differentiate them from the rest of the page (still not totally pleased with them though)
Fixed issue where some N/A lrs scores and additive effects were being changed to 0's, which was misleading and kept them from always being sorted at the bottom. They now appear as N/A.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/base/trait.py15
-rwxr-xr-xwqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js8
-rwxr-xr-xwqflask/wqflask/templates/base.html2
-rwxr-xr-xwqflask/wqflask/templates/collections/view.html20
-rwxr-xr-xwqflask/wqflask/templates/gsearch_gene.html53
-rwxr-xr-xwqflask/wqflask/templates/gsearch_pheno.html43
-rwxr-xr-xwqflask/wqflask/templates/search_result_page.html27
7 files changed, 109 insertions, 59 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 0c962331..a71d8157 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -444,9 +444,9 @@ class GeneralTrait(object):
self.locus_chr = result[0]
self.locus_mb = result[1]
else:
- self.locus = self.locus_chr = self.locus_mb = ""
+ self.locus = self.locus_chr = self.locus_mb = self.additive = ""
else:
- self.locus = self.locus_chr = self.locus_mb = ""
+ self.locus = self.locus_chr = self.locus_mb = self.additive = ""
else:
self.locus = self.locus_chr = self.locus_mb = self.lrs = self.pvalue = self.mean = self.additive = ""
@@ -476,9 +476,9 @@ class GeneralTrait(object):
self.locus_chr = result[0]
self.locus_mb = result[1]
else:
- self.locus = self.locus_chr = self.locus_mb = ""
+ self.locus = self.locus_chr = self.locus_mb = self.additive = ""
else:
- self.locus = self.locus_chr = self.locus_mb = ""
+ self.locus = self.locus_chr = self.locus_mb = self.additive = ""
else:
self.locus = self.lrs = self.additive = ""
@@ -492,9 +492,10 @@ class GeneralTrait(object):
else:
LRS_location_value = ord(str(self.locus_chr).upper()[0])*1000 + float(self.locus_mb)
- self.LRS_location_repr = LRS_location_repr = 'Chr%s: %.6f' % (self.locus_chr, float(self.locus_mb))
- self.LRS_score_repr = LRS_score_repr = '%3.1f' % self.lrs
- self.LRS_score_value = LRS_score_value = self.lrs
+ self.LRS_location_repr = LRS_location_repr = 'Chr%s: %.6f' % (self.locus_chr, float(self.locus_mb))
+ if self.lrs != "":
+ self.LRS_score_repr = LRS_score_repr = '%3.1f' % self.lrs
+ self.LRS_score_value = LRS_score_value = self.lrs
else:
raise KeyError, `self.name`+' information is not found in the database.'
diff --git a/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js b/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js
index 0198fd48..dbb40446 100755
--- a/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js
+++ b/wqflask/wqflask/static/new/packages/DataTables/js/dataTables.naturalSort.js
@@ -49,16 +49,16 @@ function naturalSort (a, b) {
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"natural-asc": function ( a, b ) {
// first check if null or n/a
- if (a == "N/A" || a == "NA") return 1;
- else if (b == "N/A" || b == "NA") return -1;
+ if (a == "N/A" || a == "NA" || a == "") return 1;
+ else if (b == "N/A" || b == "NA" || b == "") return -1;
else {
return naturalSort(a,b);
}
},
"natural-desc": function ( a, b ) {
- if (a == "N/A" || a == "NA") return 1;
- else if (b == "N/A" || b == "NA") return -1;
+ if (a == "N/A" || a == "NA" || a == "") return 1;
+ else if (b == "N/A" || b == "NA" || b == "") return -1;
else {
return naturalSort(a,b) * -1;
}
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index b4fdbd8e..759c4a8d 100755
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -19,7 +19,7 @@
</head>
-<body style="width: 1500px !important;">
+<body style="width: 100% !important;">
<!-- Navbar ================================================== -->
<div class="navbar navbar-inverse navbar-static-top pull-left" role="navigation">
diff --git a/wqflask/wqflask/templates/collections/view.html b/wqflask/wqflask/templates/collections/view.html
index c1563b9c..288207e7 100755
--- a/wqflask/wqflask/templates/collections/view.html
+++ b/wqflask/wqflask/templates/collections/view.html
@@ -92,18 +92,19 @@
<button class="btn" id="remove" disabled="disabled"><i class="icon-minus-sign"></i> Remove Record</button>
<br />
<br />
+ <div style="background-color: #eeeeee; border: 1px solid black;">
<table class="table table-hover table-striped" id='trait_table'>
<thead>
<tr>
- <th></th>
- <th>Index</th>
- <th>Record</th>
- <th>Description</th>
- <th>Location</th>
- <th>Mean</th>
- <th>Max LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
- <th>Max LRS Location</th>
- <th>Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;"></th>
+ <th style="background-color: #eeeeee;">Index</th>
+ <th style="background-color: #eeeeee;">Record</th>
+ <th style="background-color: #eeeeee;">Description</th>
+ <th style="background-color: #eeeeee;">Location</th>
+ <th style="background-color: #eeeeee;">Mean</th>
+ <th style="background-color: #eeeeee;">Max LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;">Max LRS Location</th>
+ <th style="background-color: #eeeeee;">Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</thead>
@@ -136,6 +137,7 @@
</tbody>
</table>
+ </div>
<br />
</div>
</div>
diff --git a/wqflask/wqflask/templates/gsearch_gene.html b/wqflask/wqflask/templates/gsearch_gene.html
index ff4254aa..70cafcfe 100755
--- a/wqflask/wqflask/templates/gsearch_gene.html
+++ b/wqflask/wqflask/templates/gsearch_gene.html
@@ -23,24 +23,24 @@
<br />
<br />
- <div style="width: 2000px;">
+ <div style="width: 2000px; background-color: #eeeeee; border: 1px solid black;">
<table width="2000px" id="trait_table" class="table table-hover table-striped" >
<thead>
<tr>
- <th></th>
- <th>Index</th>
- <th>Species</th>
- <th>Group</th>
- <th>Tissue</th>
- <th>Dataset</th>
- <th>Record</th>
- <th>Symbol</th>
- <th>Description</th>
- <th>Location</th>
- <th>Mean</th>
- <th>Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
- <th>Max LRS Location</th>
- <th>Additive<br>Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;"></th>
+ <th style="background-color: #eeeeee;">Index</th>
+ <th style="background-color: #eeeeee;">Species</th>
+ <th style="background-color: #eeeeee;">Group</th>
+ <th style="background-color: #eeeeee;">Tissue</th>
+ <th style="background-color: #eeeeee;">Dataset</th>
+ <th style="background-color: #eeeeee;">Record</th>
+ <th style="background-color: #eeeeee;">Symbol</th>
+ <th style="background-color: #eeeeee;">Description</th>
+ <th style="background-color: #eeeeee;">Location</th>
+ <th style="background-color: #eeeeee;">Mean</th>
+ <th style="background-color: #eeeeee;">Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;">Max LRS Location</th>
+ <th style="background-color: #eeeeee;">Additive<br>Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</thead>
<tbody>
@@ -57,11 +57,30 @@
<td>{{ this_trait.description_display }}</td>
<td align="right">{{ this_trait.location_repr }}</td>
<td align="right">{{ '%0.3f' % this_trait.mean|float }}</td>
- <td align="right">{{ '%0.1f' % this_trait.LRS_score_repr|float }}</td>
+ <td align="right">{% if this_trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % this_trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td>
<td align="right">{{ this_trait.LRS_location_repr }}</td>
- <td align="right">{{ '%0.3f' % this_trait.additive|float }}</td>
+ <td align="right">{% if this_trait.additive != "" %}{{ '%0.3f' % this_trait.additive|float }}{% else %}N/A{% endif %}</td>
</tr>
{% endfor %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <th style="background-color: #eeeeee;"></th>
+ <th style="background-color: #eeeeee;">Index</th>
+ <th style="background-color: #eeeeee;">Species</th>
+ <th style="background-color: #eeeeee;">Group</th>
+ <th style="background-color: #eeeeee;">Tissue</th>
+ <th style="background-color: #eeeeee;">Dataset</th>
+ <th style="background-color: #eeeeee;">Record</th>
+ <th style="background-color: #eeeeee;">Symbol</th>
+ <th style="background-color: #eeeeee;">Description</th>
+ <th style="background-color: #eeeeee;">Location</th>
+ <th style="background-color: #eeeeee;">Mean</th>
+ <th style="background-color: #eeeeee;">Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org/glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;">Max LRS Location</th>
+ <th style="background-color: #eeeeee;">Additive<br>Effect<a href="http://genenetwork.org/glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ </tr>
+ </tfoot>
</table>
</div>
</div>
diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html
index b1f86adc..9be0349f 100755
--- a/wqflask/wqflask/templates/gsearch_pheno.html
+++ b/wqflask/wqflask/templates/gsearch_pheno.html
@@ -25,21 +25,21 @@
<input type="text" id="select_top" class="form-control" style="width: 200px; display: inline;" placeholder="Select Top ...">
<br />
<br />
- <div style="width: 1500px;">
+ <div style="width: 1500px; background-color: #eeeeee; border: 1px solid black;">
<table width="1500px" id="trait_table" class="table table-hover table-striped">
<thead>
<tr>
- <th></th>
- <th>Index</th>
- <th>Species</th>
- <th>Group</th>
- <th>Record</th>
- <th>Description</th>
- <th>Authors</th>
- <th>Year</th>
- <th style="text-align: right;">Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
- <th>Max LRS Location</th>
- <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;"></th>
+ <th style="background-color: #eeeeee;">Index</th>
+ <th style="background-color: #eeeeee;">Species</th>
+ <th style="background-color: #eeeeee;">Group</th>
+ <th style="background-color: #eeeeee;">Record</th>
+ <th style="background-color: #eeeeee;">Description</th>
+ <th style="background-color: #eeeeee;">Authors</th>
+ <th style="background-color: #eeeeee;">Year</th>
+ <th style="background-color: #eeeeee; text-align: right;">Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;">Max LRS Location</th>
+ <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
</tr>
</thead>
<tbody>
@@ -53,12 +53,27 @@
<td>{{ this_trait.description_display }}</td>
<td>{{ this_trait.authors }}</td>
<td><a href="{{ this_trait.pubmed_link }}">{{ this_trait.pubmed_text }}</a></td>
- <td align="right">{{ '%0.1f' % this_trait.LRS_score_repr|float }}</td>
+ <td align="right">{% if this_trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % this_trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td>
<td align="right">{{ this_trait.LRS_location_repr }}</td>
- <td align="right">{{ '%0.3f' % this_trait.additive|float }}</td>
+ <td align="right">{% if this_trait.additive != "" %}{{ this_trait.additive }}{% else %}N/A{% endif %}</td>
</TR>
{% endfor %}
</tbody>
+ <tfoot>
+ <tr>
+ <th style="background-color: #eeeeee;"></th>
+ <th style="background-color: #eeeeee;">Index</th>
+ <th style="background-color: #eeeeee;">Species</th>
+ <th style="background-color: #eeeeee;">Group</th>
+ <th style="background-color: #eeeeee;">Record</th>
+ <th style="background-color: #eeeeee;">Description</th>
+ <th style="background-color: #eeeeee;">Authors</th>
+ <th style="background-color: #eeeeee;">Year</th>
+ <th style="background-color: #eeeeee; text-align: right;">Max&nbsp;&nbsp;<br>LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee;">Max LRS Location</th>
+ <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ </tr>
+ </tfoot>
</table>
</div>
</div>
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 7d852e42..7d25dc61 100755
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -89,18 +89,18 @@
{% endif %}
-->
- <div id="table_container">
+ <div id="table_container" style="background-color: #eeeeee; border: 1px solid black;">
<table class="table table-hover table-striped" id='trait_table' {% if dataset.type == 'Geno' %}width="400px"{% endif %} style="float: left;">
<thead>
<tr>
- <th style="width: 30px;"></th>
+ <th style="background-color: #eeeeee;"></th>
{% for header in header_fields %}
{% if header == 'Max LRS' %}
- <th style="text-align: right;">Max&nbsp;&nbsp;<br>LRS</th>
+ <th style="background-color: #eeeeee; text-align: right;">Max<br>LRS</th>
{% elif header == 'Additive Effect' %}
- <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ <th style="background-color: #eeeeee; text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
{% else %}
- <th>{{header}}</th>
+ <th style="background-color: #eeeeee;">{{header}}</th>
{% endif %}
{% endfor %}
</tr>
@@ -145,7 +145,20 @@
</TR>
{% endfor %}
</tbody>
-
+ <tfoot>
+ <tr>
+ <th style="width: 30px;"></th>
+ {% for header in header_fields %}
+ {% if header == 'Max LRS' %}
+ <th style="text-align: right;">Max<br>LRS</th>
+ {% elif header == 'Additive Effect' %}
+ <th style="text-align: right;">Additive<br>Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th>
+ {% else %}
+ <th>{{header}}</th>
+ {% endif %}
+ {% endfor %}
+ </tr>
+ </tfoot>
</table>
</div>
</div>
@@ -251,7 +264,7 @@
"iDisplayLength": -1,
"bDeferRender": true,
"bSortClasses": false,
- "scrollY": "700px",
+ "scrollY": true,
"scrollCollapse": false,
"paging": false
} );