From c902f1817275dba8868904f2925c3b3f70b59a15 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 21 Nov 2016 18:08:55 +0000 Subject: 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 --- wqflask/wqflask/correlation/show_corr_results.py | 2 +- wqflask/wqflask/templates/correlation_matrix.html | 8 ++++--- wqflask/wqflask/templates/correlation_page.html | 26 +++++++++++++++++------ 3 files changed, 26 insertions(+), 10 deletions(-) (limited to 'wqflask') 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 @@ {% for result in corr_results[loop.index-1] %} {% if result[0].name == trait.name %} - n
{{ result[2] }}
+ n
{{ result[2] }}
{% else %} - {{ '%0.3f' % result[1] }}
{{ result[2] }}
+ {{ '%0.3f' % result[1] }}
{{ result[2] }}
{% endif %} {% endfor %} @@ -62,9 +62,11 @@
- +
+

Factor Loadings Plot

+

Factor Loadings Table

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, -- cgit v1.2.3