aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2016-11-21 18:08:55 +0000
committerzsloan2016-11-21 18:08:55 +0000
commitc902f1817275dba8868904f2925c3b3f70b59a15 (patch)
treed4b42b7befb47a758b61ba3eff04f6346b4709f4
parent8e8cb3540565edb3d221ef08fe3863449c29c21d (diff)
downloadgenenetwork2-c902f1817275dba8868904f2925c3b3f70b59a15.tar.gz
Fixed correlation page so it correctly sorts by the scientific notation for sample p
Set default sort for correlation page to sample p Improved appearance of correlation matrix some by decreasing line height Added labels to each figure/table on the correlation page
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py2
-rw-r--r--wqflask/wqflask/templates/correlation_matrix.html8
-rw-r--r--wqflask/wqflask/templates/correlation_page.html26
3 files changed, 26 insertions, 10 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py
index 401059fd..cc21d1bf 100644
--- a/wqflask/wqflask/correlation/show_corr_results.py
+++ b/wqflask/wqflask/correlation/show_corr_results.py
@@ -216,7 +216,7 @@ class CorrelationResults(object):
for _trait_counter, trait in enumerate(self.correlation_data.keys()[:self.return_number]):
trait_object = GeneralTrait(dataset=self.target_dataset, name=trait, get_qtl_info=True, get_sample_info=False)
- if self.dataset.type == "ProbeSet" or self.dataset.type == "Geno":
+ if self.target_dataset.type == "ProbeSet" or self.target_dataset.type == "Geno":
#ZS: Convert trait chromosome to an int for the location range option
chr_as_int = 0
for order_id, chr_info in self.dataset.species.chromosomes.chromosomes.iteritems():
diff --git a/wqflask/wqflask/templates/correlation_matrix.html b/wqflask/wqflask/templates/correlation_matrix.html
index 65dd01e7..eb675568 100644
--- a/wqflask/wqflask/templates/correlation_matrix.html
+++ b/wqflask/wqflask/templates/correlation_matrix.html
@@ -49,9 +49,9 @@
</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>
+ <td nowrap="ON" align="center" bgcolor="#cccccc" style="line-height: 1.1;"><a href="/show_trait?trait_id={{ trait.name }}&dataset={{ trait.dataset.name }}"><font style="font-size: 12px; color: #000000;" ><em>n</em><br>{{ result[2] }}</font></a></td>
{% else %}
- <td nowrap="ON" align="middle" class="corr_cell"><a href="/corr_scatter_plot?dataset_1={{ trait.dataset.name }}&dataset_2={{ result[0].dataset.name }}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 12px; color: #000000;" ><span class="corr_value">{{ '%0.3f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
+ <td nowrap="ON" align="middle" class="corr_cell" style="line-height: 1.1;"><a href="/corr_scatter_plot?dataset_1={{ trait.dataset.name }}&dataset_2={{ result[0].dataset.name }}&trait_1={{ trait.name }}&trait_2={{ result[0].name }}"><font style="font-size: 12px; color: #000000;" ><span class="corr_value">{{ '%0.3f' % result[1] }}</span><br>{{ result[2] }}</font></a></td>
{% endif %}
{% endfor %}
</tr>
@@ -62,9 +62,11 @@
<button class="btn btn-default" id="short_labels">Short Labels</button>
<button class="btn btn-default" id="long_labels">Long Labels</button>
<br>
-
+<br>
+<h2>Factor Loadings Plot</h2>
<div id="loadings_plot"></div>
+<h2>Factor Loadings Table</h2>
<table class="table table-hover table-striped" border="1" id='trait_table' style="margin: 20px;" width="40%">
<thead>
<tr>
diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html
index dab196cb..cedb65a1 100644
--- a/wqflask/wqflask/templates/correlation_page.html
+++ b/wqflask/wqflask/templates/correlation_page.html
@@ -220,6 +220,20 @@
};
+ jQuery.fn.dataTableExt.oSort['scientific-asc'] = function ( a, b ) {
+ var x = parseFloat(a);
+ var y = parseFloat(b);
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));
+ };
+
+ jQuery.fn.dataTableExt.oSort['scientific-desc'] = function ( a, b ) {
+ var x = parseFloat(a);
+ var y = parseFloat(b);
+ return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+ };
+
+
+
$(document).ready( function () {
$('#trait_table tr').click(function(event) {
@@ -258,13 +272,13 @@
{ "type": "natural" },
{ "type": "natural" },
{ "type": "natural" },
- { "type": "numeric-html" },
{ "type": "natural" },
{ "type": "natural" },
+ { "type": "scientific" },
{ "type": "natural" },
{ "type": "natural" }
],
- "order": [[10, "desc" ]],
+ "order": [[12, "asc" ]],
"sDom": "Btir",
"autoWidth": false,
"bDeferRender": true,
@@ -304,9 +318,9 @@
{ "type": "natural" },
{ "type": "numeric-html" },
{ "type": "natural" },
- { "type": "natural" }
+ { "type": "scientific" }
],
- "order": [[9, "desc" ]],
+ "order": [[11, "asc" ]],
"sDom": "Btir",
"autoWidth": false,
"bDeferRender": true,
@@ -337,9 +351,9 @@
{ "type": "natural" },
{ "type": "numeric-html" },
{ "type": "natural" },
- { "type": "natural" }
+ { "type": "scientific" }
],
- "order": [[4, "desc" ]],
+ "order": [[6, "asc" ]],
"sDom": "Btir",
"autoWidth": false,
"bDeferRender": true,