From a91c0c240e3534567f65b16578bcfaf72a9055c9 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 12 Feb 2018 17:08:58 +0000 Subject: Quick parallel correlation should work, though I'm not sure why the code suddenly decided to start running it when it wasn't in the past. Switched correlation table to tabulator --- wqflask/wqflask/correlation/show_corr_results.py | 22 +++++++++- wqflask/wqflask/templates/correlation_page.html | 51 ++++++++++++++++++------ 2 files changed, 58 insertions(+), 15 deletions(-) (limited to 'wqflask') 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 %} + + {% endblock %} {% block content %} @@ -63,15 +64,14 @@
{% for header in target_dataset.header_fields %} {% if header == 'Year' %} | {{header}} | {% elif header == 'Max LRS' %} -Max LRS ? | +Max LRS | {% elif header == 'Max LRS Location' %}{{header}} | {% elif header == 'Location' %} @@ -79,7 +79,7 @@ {% elif header == 'Mean' %}{{header}} | {% elif header == 'Additive Effect' %} -Additive Effect ? | +Additive Effect | {% elif header == 'Index' %}{{header}} | {% elif header == 'N' %} @@ -91,7 +91,7 @@ {% if target_dataset.type == "ProbeSet" %} {% if corr_method == 'pearson' %}Sample r | -N | +N | Sample p(r) | Lit r | Tissue r | @@ -129,8 +129,7 @@
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
- | {{ loop.index }} | +{{ loop.index }} | + + + + + |