aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2019-08-29 15:41:29 -0500
committerzsloan2019-08-29 15:41:29 -0500
commita437133ad8fa9d49e97866253dcec61c7cb05b9a (patch)
tree0327d92081279185c705d324887494a897a07a74 /wqflask
parent1caf7a443074cd400f9e62c4ce627f164bd63d14 (diff)
downloadgenenetwork2-a437133ad8fa9d49e97866253dcec61c7cb05b9a.tar.gz
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
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/correlation/show_corr_results.py73
-rw-r--r--wqflask/wqflask/templates/base.html8
-rw-r--r--wqflask/wqflask/templates/correlation_page.html76
-rwxr-xr-xwqflask/wqflask/templates/index_page_orig.html8
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 @@
</ul>
</li>
<li class="">
- <a href="/help" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Info <span class="caret"></a>
+ <a href="/help" class="dropdow-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Help <span class="caret"></a>
<ul class="dropdown-menu">
- <li><a href="/news">News</a></li>
- <li><a href="http://genenetwork.org/faq.html">FAQ</a></li>
- <li><a href="http://genenetwork.org/glossary.html">Glossary of Term</a></li>
<li><a href="/references">References</a></li>
+ <li><a href="http://genenetwork.org/glossary.html">Glossary of Term</a></li>
+ <li><a href="http://genenetwork.org/faq.html">FAQ</a></li>
<li><a href="/policies">Policies</a></li>
<li><a href="/links">Links</a></li>
<li><a href="/environments">Environments</a></li>
+ <li><a href="/news">GN1 News</a></li>
</ul>
</li>
<li class="">
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 @@
<thead>
<tr>
<th></th>
- {% for header in target_dataset.header_fields %}
- {% if header == 'Year' %}
+ {% for header in header_fields %}
<th>{{header}}</th>
- {% elif header == 'Max LRS' %}
- <th>Max LRS</th>
- {% elif header == 'Max LRS Location' %}
- <th>{{header}}</th>
- {% elif header == 'Location' %}
- <th>{{header}}</th>
- {% elif header == 'Mean' %}
- <th>{{header}}</th>
- {% elif header == 'Additive Effect' %}
- <th>Additive Effect</th>
- {% elif header == 'Index' %}
- <th>{{header}}</th>
- {% elif header == 'N' %}
- <th>{{header}}</th>
- {% else %}
- <th>{{header}}</th>
- {% endif %}
{% endfor %}
- {% if target_dataset.type == "ProbeSet" %}
- {% if corr_method == 'pearson' %}
- <th>Sample r</th>
- <th>N</th>
- <th>Sample p(r)</th>
- <th>Lit r</th>
- <th>Tissue r</th>
- <th>Tissue p(r)</th>
- {% else %}
- <th>Sample rho</th>
- <th>N</th>
- <th>Sample p(rho)</th>
- <th>Lit r</th>
- <th>Tissue rho</th>
- <th>Tissue p(rho)</th>
- {% endif %}
- {% elif target_dataset.type == "Publish" %}
- {% if corr_method == 'pearson' %}
- <th>Sample r</th>
- <th>&nbsp;&nbsp;N</th>
- <th>Sample p(r)</th>
- {% else %}
- <th>Sample rho</th>
- <th>&nbsp;&nbsp;N</th>
- <th>Sample p(rho)</th>
- {% endif %}
- {% elif target_dataset.type == "Geno" %}
- {% if corr_method == 'pearson' %}
- <th>Sample r</th>
- <th>N</th>
- <th>Sample p(r)</th>
- {% else %}
- <th>Sample rho</th>
- <th>N</th>
- <th>Sample p(rho)</th>
- {% endif %}
- {% endif %}
</tr>
</thead>
@@ -190,9 +135,6 @@
<td>{{ trait.description_display }}</TD>
<td style="white-space: nowrap;">{{ trait.location_repr }}</td>
<td align="right">{{ '%0.3f' % trait.mean|float }}</td>
- <td align="right">{% if trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td>
- <td align="right">{{ trait.LRS_location_repr }}</td>
- <td align="right">{% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %}</td>
<td align="right"><a target="_blank" href="corr_scatter_plot?dataset_1={{dataset.name}}&dataset_2={{trait.dataset.name}}&trait_1={{this_trait.name}}&trait_2={{trait.name}}">{{'%0.3f'|format(trait.sample_r)}}</a></td>
<td align="right">{{ trait.num_overlap }}</td>
<td align="right">{{'%0.3e'|format(trait.sample_p)}}</td>
@@ -208,6 +150,9 @@
<td align="right">{{'%0.3f'|format(trait.tissue_corr)}}</td>
<td align="right">{{'%0.3e'|format(trait.tissue_pvalue)}}</td>
{% endif %}
+ <td align="right">{% if trait.LRS_score_repr != "N/A" %}{{ '%0.1f' % trait.LRS_score_repr|float }}{% else %}N/A{% endif %}</td>
+ <td align="right">{{ trait.LRS_location_repr }}</td>
+ <td align="right">{% if trait.additive != "" %}{{ '%0.3f' % trait.additive|float }}{% else %}N/A{% endif %}</td>
{% elif target_dataset.type == "Publish" %}
<td>{{ trait.description_display }}</td>
<td>{{ trait.authors }}</td>
@@ -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 @@
<label for="species" class="col-xs-1 control-label" style="width: 65px !important;">Species:</label>
<div class="col-xs-10 controls input-append" style="display: flex; padding-left: 20px;">
<div class="col-8">
- <select name="species" id="species" class="form-control" style="width: 280px !important;"></select>
+ <select name="species" id="species" class="form-control" style="width: 280px !important;"><option>Loading...</option></select>
</div>
<div class="col-4" style="margin-left: 10px;">
<button type="button" id="make_default" class="btn btn-primary form-control">Make Default</button>
@@ -48,7 +48,7 @@
<label for="group" class="col-xs-1 control-label" style="width: 65px !important;">Group:</label>
<div class="col-xs-10 controls input-append" style="padding-left: 20px;">
<div class="col-8">
- <select name="group" id="group" class="form-control" style="width: 280px !important;"></select>
+ <select name="group" id="group" class="form-control" style="width: 280px !important;"><option>Loading...</option></select>
<i class="icon-question-sign"></i>
</div>
</div>
@@ -58,7 +58,7 @@
<label for="tissue" class="col-xs-1 control-label" style="width: 65px !important;">Type:</label>
<div class="col-xs-10 controls" style="padding-left: 20px;">
<div class="col-8">
- <select name="type" id="type" class="form-control" style="width: 280px !important;"></select>
+ <select name="type" id="type" class="form-control" style="width: 280px !important;"><option>Loading...</option></select>
</div>
</div>
</div>
@@ -67,7 +67,7 @@
<label for="dataset" class="col-xs-1 control-label" style="width: 65px !important;">Dataset:</label>
<div class="col-xs-10 controls input-append" style="display: flex; padding-left: 20px;">
<div class="col-9">
- <select name="dataset" id="dataset" class="form-control" style="width: 340px !important;"></select>
+ <select name="dataset" id="dataset" class="form-control" style="width: 340px !important;"><option>Loading...</option></select>
<i class="icon-question-sign"></i>
</div>
<div class="col-3" style="margin-left: 10px;">