diff options
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/correlation/show_corr_results.py | 22 | ||||
-rw-r--r-- | wqflask/wqflask/templates/correlation_page.html | 51 |
2 files changed, 58 insertions, 15 deletions
diff --git a/wqflask/wqflask/correlation/show_corr_results.py b/wqflask/wqflask/correlation/show_corr_results.py index 24432ad0..bb109f60 100644 --- a/wqflask/wqflask/correlation/show_corr_results.py +++ b/wqflask/wqflask/correlation/show_corr_results.py @@ -120,8 +120,15 @@ class CorrelationResults(object): self.min_expr = float(start_vars['min_expr']) else: self.min_expr = None - self.p_range_lower = float(start_vars['p_range_lower']) - self.p_range_upper = float(start_vars['p_range_upper']) + logger.debug("P RANGE:", start_vars['p_range_lower']) + try: + self.p_range_lower = float(start_vars['p_range_lower']) + except: + self.p_range_lower = -1.00 + try: + self.p_range_upper = float(start_vars['p_range_upper']) + except: + self.p_range_upper = 1.00 if ('loc_chr' in start_vars and 'min_loc_mb' in start_vars and @@ -1153,6 +1160,17 @@ class CorrelationResults(object): import math import reaper + def cmpOrder2(A,B): + try: + if A[-1] < B[-1]: + return -1 + elif A[-1] == B[-1]: + return 0 + else: + return 1 + except: + return 0 + def calCorrelation(dbdata,userdata,N): X = [] Y = [] diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html index fa9e3585..c7fb7cc6 100644 --- a/wqflask/wqflask/templates/correlation_page.html +++ b/wqflask/wqflask/templates/correlation_page.html @@ -1,9 +1,10 @@ {% extends "base.html" %} {% block css %} + <link rel="stylesheet" type="text/css" href="/static/new/packages/tabulator/css/tabulator.css" /> + <!-- <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/css/jquery.dataTables.css" /> - <link rel="stylesheet" type="text/css" href="/static/packages/DT_bootstrap/DT_bootstrap.css" /> - <link rel="stylesheet" type="text/css" href="/static/packages/TableTools/media/css/TableTools.css" /> <link rel="stylesheet" type="text/css" href="/static/new/packages/DataTables/extensions/buttons.bootstrap.css" /> + --> {% endblock %} {% block content %} @@ -63,15 +64,14 @@ </div> <div style="width: {% if target_dataset.type == "ProbeSet" %}1600px{% elif target_dataset.type == "Publish" %}1400px{% else %}800px{% endif %};"> - <table id="trait_table" class="display dataTable nowrap" style="float: left;"> + <table id="trait_table" class="display dataTable nowrap" style="font-size: 12px; float: left;"> <thead> <tr> - <th style="width: 30px;"></th> {% for header in target_dataset.header_fields %} {% if header == 'Year' %} <th>{{header}}</th> {% elif header == 'Max LRS' %} - <th>Max LRS<a href="http://genenetwork.org//glossary.html#L" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th>Max LRS</th> {% elif header == 'Max LRS Location' %} <th>{{header}}</th> {% elif header == 'Location' %} @@ -79,7 +79,7 @@ {% elif header == 'Mean' %} <th>{{header}}</th> {% elif header == 'Additive Effect' %} - <th>Additive Effect<a href="http://genenetwork.org//glossary.html#A" target="_blank"><sup style="color:#f00"> ?</sup></a></th> + <th>Additive Effect</th> {% elif header == 'Index' %} <th>{{header}}</th> {% elif header == 'N' %} @@ -91,7 +91,7 @@ {% if target_dataset.type == "ProbeSet" %} {% if corr_method == 'pearson' %} <th>Sample r</th> - <th> N</th> + <th>N</th> <th>Sample p(r)</th> <th>Lit r</th> <th>Tissue r</th> @@ -129,8 +129,7 @@ <tbody> {% for trait in correlation_results %} <tr> - <td style="padding-left: 8px; padding-right: 0px; padding-top: 4px; align: center;"><INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="padding-right: 0px;" VALUE="{{ data_hmac('{}:{}'.format(trait.name, trait.dataset.name)) }}"></td> - <td align="right">{{ loop.index }}</td> + <td style="padding-left: 8px; padding-right: 0px; padding-top: 4px; align: center;"><span style="white-space: nowrap;">{{ loop.index }}<INPUT TYPE="checkbox" NAME="searchResult" class="checkbox trait_checkbox" style="padding-right: 0px;" VALUE="{{ data_hmac('{}:{}'.format(trait.name, trait.dataset.name)) }}"></span></td> <td> <a href="{{ url_for('show_trait_page', trait_id = trait.name, @@ -191,13 +190,17 @@ {% block js %} <script type="text/javascript" src="/static/new/javascript/search_results.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> + <script language="javascript" type="text/javascript" src="/static/packages/underscore/underscore-min.js"></script> + <script language="javascript" type="text/javascript" src="/static/new/packages/tabulator/js/tabulator.js"></script> + <!-- <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/jquery.dataTables.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/dataTables.buttons.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.html5.min.js"></script> <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/buttons/1.0.0/js/buttons.bootstrap.min.js"></script> - <script language="javascript" type="text/javascript" src="/static/new/js_external/jszip.min.js"></script> <script language="javascript" type="text/javascript" src="/static/new/packages/DataTables/js/dataTables.naturalSort.js"></script> - <script language="javascript" type="text/javascript" src="/static/packages/underscore/underscore-min.js"></script> + --> + <script type="text/javascript" charset="utf-8"> function getValue(x) { if (x.indexOf('input') >= 0) { @@ -213,7 +216,8 @@ } return parseFloat(x); } - + +/* jQuery.fn.dataTableExt.oSort['numeric-html-asc'] = function(a,b) { a = Math.abs(parseFloat($(a).text())); b = Math.abs(parseFloat($(b).text())); @@ -259,10 +263,29 @@ var y = parseFloat(b); return ((x < y) ? 1 : ((x > y) ? -1 : 0)); }; - +*/ $(document).ready( function () { + $("#trait_table").tabulator({ + columns:[ + {title:"Index", formatter:"html"}, + {title:"Record", formatter:"html"}, + {title:"Symbol", formatter:"plaintext"}, + {title:"Description", formatter:"textarea", width:"25%"}, + {title:"Location", formatter:"plaintext"}, + {title:"Mean", formatter:"plaintext"}, + {title:"Max LRS", formatter:"plaintext"}, + {title:"Max LRS Location", formatter:"plaintext"}, + {title:"Additive Effect", formatter:"plaintext"}, + {title:"Sample r", formatter:"html"}, + {title:"N", formatter:"plaintext"}, + {title:"Sample p(r)", formatter:"plaintext"}, + {title:"Lit r", formatter:"plaintext"}, + {title:"Tissue r", formatter:"plaintext"} + ] + }); + $('#trait_table tr').click(function(event) { if (event.target.type !== 'checkbox') { $(':checkbox', this).trigger('click'); @@ -296,6 +319,7 @@ } } + /* console.time("Creating table"); {% if target_dataset.type == "ProbeSet" %} @@ -447,6 +471,7 @@ } ); {% endif %} console.timeEnd("Creating table"); + */ submit_special = function(url) { $("#correlation_form").attr("action", url); |