From 3bc5e361d135777c1c4cfc2cef5b6aca7a6fa984 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Fri, 3 Jun 2016 23:04:48 +0000
Subject: Made a bunch of changes to correlation and search result tables
(mainly the former) and made all tables a little more compact by lessenning
the padding
---
.../packages/DataTables/css/jquery.dataTables.css | 4 +-
.../DataTables/js/dataTables.naturalSort.js | 8 +-
wqflask/wqflask/templates/correlation_page.html | 252 +++++++++++----------
wqflask/wqflask/templates/search_result_page.html | 2 +
4 files changed, 145 insertions(+), 121 deletions(-)
diff --git a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
index 931ec6b3..6540d01f 100755
--- a/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
+++ b/wqflask/wqflask/static/new/packages/DataTables/css/jquery.dataTables.css
@@ -20,7 +20,7 @@ table.dataTable tfoot th {
}
table.dataTable thead th,
table.dataTable thead td {
- padding: 10px 18px;
+ padding: 10px 18px 10px 0px;
border-bottom: 1px solid #111;
}
table.dataTable thead th:active,
@@ -69,7 +69,7 @@ table.dataTable tbody tr.selected {
}
table.dataTable tbody th,
table.dataTable tbody td {
- padding: 8px 10px;
+ padding: 4px 5px;
}
table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td {
border-top: 1px solid #ddd;
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 dbb40446..8b7fa8fd 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" || a == "") return 1;
- else if (b == "N/A" || b == "NA" || b == "") return -1;
+ if (a == "N/A" || a == "NA" || a == "" || a == "--") return 1;
+ else if (b == "N/A" || b == "NA" || b == "" || b == "--") return -1;
else {
return naturalSort(a,b);
}
},
"natural-desc": function ( a, b ) {
- if (a == "N/A" || a == "NA" || a == "") return 1;
- else if (b == "N/A" || b == "NA" || b == "") return -1;
+ if (a == "N/A" || a == "NA" || a == "" || a == "--") return 1;
+ else if (b == "N/A" || b == "NA" || b == "" || b == "--") return -1;
else {
return naturalSort(a,b) * -1;
}
diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html
index efc94c42..c5b4477b 100755
--- a/wqflask/wqflask/templates/correlation_page.html
+++ b/wqflask/wqflask/templates/correlation_page.html
@@ -3,8 +3,6 @@
-
-
{% endblock %}
{% block content %}
@@ -34,55 +32,65 @@
-
+ | {% for header in target_dataset.header_fields %} - {% if header == 'Max LRS' %} - | Max LRS ? |
+ {% if header == 'Year' %}
+ {{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 ? |
+ Add Effect ? |
+ {% elif header == 'Index' %}
+ {{header}} | + {% elif header == 'N' %} +{{header}} | {% else %} -{{header}} | +{{header}} | {% endif %} {% endfor %} - {% if target_dataset.type == "ProbeSet" %} + {% if target_dataset.type == "ProbeSet" %} {% if corr_method == 'pearson' %} -Sample r | -N Cases | -Sample p(r) | -Lit Corr | -Tissue r | -Tissue p(r) | +Sample r | +N | +Sample p(r) | +Lit r | +Tissue r | {% else %} -Sample rho | -N Cases | -Sample p(rho) | -Lit Corr | -Tissue rho | -Tissue p(rho) | +Sample rho | +N | +Sample p(rho) | +Lit r | +Tissue rho | {% endif %} {% elif target_dataset.type == "Publish" %} {% if corr_method == 'pearson' %} -Sample r | -N Cases | -Sample p(r) | +Sample r | +N | +Sample p(r) | {% else %} -Sample rho | -N Cases | -Sample p(rho) | +Sample rho | +N | +Sample p(rho) | {% endif %} {% elif target_dataset.type == "Geno" %} {% if corr_method == 'pearson' %} -Sample r | -N Cases | -Sample p(r) | +Sample r | +N | +Sample p(r) | {% else %} -Sample rho | -N Cases | -Sample p(rho) | +Sample rho | +N | +Sample p(rho) | {% endif %} {% endif %}|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- | -{{ loop.index }} | -+ | + | {{ loop.index }} | +{{ trait.name }} - | + {% if target_dataset.type == 'ProbeSet' %} -{{ trait.symbol }} | -{{ trait.description_display }} | -{{ trait.location_repr }} | -{{ '%0.3f' % trait.mean|float }} | -{{ '%0.3f' % trait.LRS_score_repr|float }} | -{{ trait.LRS_location_repr }} | -{{ '%0.3f' % trait.additive|float }} | -{{'%0.3f'|format(trait.sample_r)}} | -{{ trait.num_overlap }} | -{{'%0.3e'|format(trait.sample_p)}} | +{{ trait.symbol }} | +{{ 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)}} | {% if trait.lit_corr == "" or trait.lit_corr == 0.000 %} --- | +-- | {% else %} -{{'%0.3f'|format(trait.lit_corr)}} | +{{'%0.3f'|format(trait.lit_corr)}} | {% endif %} {% if trait.tissue_corr == "" or trait.tissue_corr == 0.000 %} --- | +-- | {% else %} -{{'%0.3f'|format(trait.tissue_corr)}} | +{{'%0.3f'|format(trait.tissue_corr)}} | {% endif %} -{{'%0.3e'|format(trait.tissue_pvalue)}} | {% elif target_dataset.type == "Publish" %} -{{ trait.description_display }} | -{{ trait.authors }} | -+ | {{ trait.description_display }} | +{{ trait.authors }} | +{{ trait.pubmed_text }} - | -{{ trait.LRS_score_repr }} | -{{ trait.LRS_location_repr }} | -{{ '%0.3f' % trait.additive|float }} | -{{'%0.3f'|format(trait.sample_r)}} | -{{ trait.num_overlap }} | -{{'%0.3e'|format(trait.sample_p)}} | + +{{ trait.LRS_score_repr }} | +{{ 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)}} | {% elif target_dataset.type == "Geno" %} -{{ trait.location_repr }} | -{{'%0.3f'|format(trait.sample_r)}} | -{{ trait.num_overlap }} | -{{'%0.3e'|format(trait.sample_p)}} | +{{ trait.location_repr }} | +{{'%0.3f'|format(trait.sample_r)}} | +{{ trait.num_overlap }} | +{{'%0.3e'|format(trait.sample_p)}} | {% endif %}