From a437133ad8fa9d49e97866253dcec61c7cb05b9a Mon Sep 17 00:00:00 2001 From: zsloan Date: Thu, 29 Aug 2019 15:41:29 -0500 Subject: Added default Loading text for dropdowns Changed order of columns for correlatoin page and removed Y scrolling Changed name and order of top menu items some --- wqflask/wqflask/correlation/show_corr_results.py | 73 +++++++++++++++++++++++ wqflask/wqflask/templates/base.html | 8 +-- wqflask/wqflask/templates/correlation_page.html | 76 +++--------------------- wqflask/wqflask/templates/index_page_orig.html | 8 +-- 4 files changed, 90 insertions(+), 75 deletions(-) diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index b7b349d5..1fa47920 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -148,6 +148,8 @@ class CorrelationResults(object): self.target_dataset = data_set.create_dataset(start_vars['corr_dataset']) self.target_dataset.get_trait_data(self.sample_data.keys()) + self.header_fields = get_header_fields(self.target_dataset.type, self.corr_method) + self.correlation_results = [] self.correlation_data = {} @@ -537,3 +539,74 @@ def generate_corr_json(corr_results, this_trait, dataset, target_dataset, for_ap results_list.append(results_dict) return json.dumps(results_list) + +def get_header_fields(data_type, corr_method): + if data_type == "ProbeSet": + if corr_method == "pearson": + header_fields = ['Index', + 'Record', + 'Symbol', + 'Description', + 'Location', + 'Mean', + 'Sample r', + 'N', + 'Sample p(r)', + 'Lit r', + 'Tissue r', + 'Tissue p(r)', + 'Max LRS', + 'Max LRS Location', + 'Additive Effect'] + else: + header_fields = ['Index', + 'Record', + 'Symbol', + 'Description', + 'Location', + 'Mean', + 'Sample rho', + 'N', + 'Sample p(rho)', + 'Lit rho', + 'Tissue rho', + 'Tissue p(rho)', + 'Max LRS', + 'Max LRS Location', + 'Additive Effect'] + elif data_type == "Publish": + if corr_method == "pearson": + header_fields = ['Index', + 'Record', + 'Description', + 'Authors', + 'Year', + 'Sample r', + 'N', + 'Sample p(r)'] + else: + header_fields = ['Index', + 'Record', + 'Description', + 'Authors', + 'Year', + 'Sample rho', + 'N', + 'Sample p(rho)'] + else: + if corr_method == "pearson": + header_fields = ['Index', + 'ID', + 'Location' + 'Sample r', + 'N', + 'Sample p(r)'] + else: + header_fields = ['Index', + 'ID', + 'Location' + 'Sample rho', + 'N', + 'Sample p(rho)'] + + return header_fields \ No newline at end of file diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index f9bc1055..42e57523 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -49,15 +49,15 @@
  • - +
  • diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index 258936e1..fffdfd75 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -111,64 +111,9 @@ - {% for header in target_dataset.header_fields %} - {% if header == 'Year' %} + {% for header in header_fields %} {{header}} - {% elif header == 'Max LRS' %} - Max LRS - {% elif header == 'Max LRS Location' %} - {{header}} - {% elif header == 'Location' %} - {{header}} - {% elif header == 'Mean' %} - {{header}} - {% elif header == 'Additive Effect' %} - Additive Effect - {% elif header == 'Index' %} - {{header}} - {% elif header == 'N' %} - {{header}} - {% else %} - {{header}} - {% endif %} {% endfor %} - {% if target_dataset.type == "ProbeSet" %} - {% if corr_method == 'pearson' %} - Sample r - N - Sample p(r) - Lit r - Tissue r - Tissue p(r) - {% else %} - Sample rho - N - Sample p(rho) - Lit r - Tissue rho - Tissue p(rho) - {% endif %} - {% elif target_dataset.type == "Publish" %} - {% if corr_method == 'pearson' %} - Sample r -   N - Sample p(r) - {% else %} - Sample rho -   N - Sample p(rho) - {% endif %} - {% elif target_dataset.type == "Geno" %} - {% if corr_method == 'pearson' %} - Sample r - N - Sample p(r) - {% else %} - Sample rho - N - Sample p(rho) - {% endif %} - {% endif %} @@ -190,9 +135,6 @@ {{ trait.description_display }} {{ trait.location_repr }} {{ '%0.3f' % trait.mean|float }} - {% if trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % trait.LRS_score_repr|float }}{% else %}N/A{% endif %} - {{ trait.LRS_location_repr }} - {% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %} {{'%0.3f'|format(trait.sample_r)}} {{ trait.num_overlap }} {{'%0.3e'|format(trait.sample_p)}} @@ -208,6 +150,9 @@ {{'%0.3f'|format(trait.tissue_corr)}} {{'%0.3e'|format(trait.tissue_pvalue)}} {% endif %} + {% if trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % trait.LRS_score_repr|float }}{% else %}N/A{% endif %} + {{ trait.LRS_location_repr }} + {% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %} {% elif target_dataset.type == "Publish" %} {{ trait.description_display }} {{ trait.authors }} @@ -398,15 +343,15 @@ { "type": "natural", "width": "15%" }, { "type": "natural" }, { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" }, - { "type": "natural" }, { "orderDataType": "dom-innertext", 'orderSequence': [ "desc", "asc"] }, { "type": "natural" }, { "type": "scientific" }, { "type": "numeric-html", 'orderSequence': [ "desc", "asc"] }, { "type": "numeric-html", 'orderSequence': [ "desc", "asc"] }, - { "type": "scientific" } + { "type": "scientific" }, + { "type": "natural" }, + { "type": "natural" }, + { "type": "natural" } ], "createdRow": function ( row, data, index ) { $('td', row).eq(4).attr('title', $('td', row).eq(4).text()); @@ -416,14 +361,11 @@ } }, "order": [[12, "asc" ]], - "sDom": "BRZtir", + "sDom": "tir", "iDisplayLength": -1, "autoWidth": false, "deferRender": true, "bSortClasses": false, - "scrollY": "800px", - "scrollCollapse": false, - "scroller": true, "paging": false, "orderClasses": true } diff --git a/wqflask/wqflask/templates/index_page_orig.html b/wqflask/wqflask/templates/index_page_orig.html index 5706c870..48ed0ec5 100755 --- a/wqflask/wqflask/templates/index_page_orig.html +++ b/wqflask/wqflask/templates/index_page_orig.html @@ -36,7 +36,7 @@
    - +
    @@ -48,7 +48,7 @@
    - +
    @@ -58,7 +58,7 @@
    - +
    @@ -67,7 +67,7 @@
    - +
    -- cgit v1.2.3