From 7188d8e3fb54901a36abffa72f5bb63eed530b9c Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 13 Feb 2013 15:24:57 -0600 Subject: Got results for marker regression page displaying in table --- .../wqflask/marker_regression/marker_regression.py | 18 +++++++++++----- wqflask/wqflask/templates/marker_regression.html | 25 +++++++++++++++++++++- 2 files changed, 37 insertions(+), 6 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py index c9451154..c06ab7e8 100755 --- a/wqflask/wqflask/marker_regression/marker_regression.py +++ b/wqflask/wqflask/marker_regression/marker_regression.py @@ -308,7 +308,7 @@ class MarkerRegression(object): self.js_data = dict( qtl_results = self.pure_qtl_results, - lrs_array = self.lrs_array, + lrs_values = self.lrs_values, ) @@ -504,12 +504,20 @@ class MarkerRegression(object): self.lrs_values = [marker['lrs_value'] for marker in self.dataset.group.markers.markers] print("self.lrs_values is:", pf(self.lrs_values)) + lrs_values_sorted = sorted(self.lrs_values) + + print("lrs_values_sorted is:", pf(lrs_values_sorted)) print("int(self.num_perm*0.37-1)", pf(int(self.num_perm*0.37-1))) - + + lrs_values_length = len(lrs_values_sorted) + + def lrs_threshold(place): + return lrs_values_sorted[int((lrs_values_length * place) -1)] + self.lrs_thresholds = Bunch( - suggestive = self.lrs_values[int(self.num_perm*0.37-1)], - significant = self.lrs_values[int(self.num_perm*0.95-1)], - highly_significant = self.lrs_values[int(self.num_perm*0.99-1)] + suggestive = lrs_threshold(.37), + significant = lrs_threshold(.95), + highly_significant = lrs_threshold(.99), ) #self.lrs_thresholds = Bunch( diff --git a/wqflask/wqflask/templates/marker_regression.html b/wqflask/wqflask/templates/marker_regression.html index aeb05132..b5477070 100644 --- a/wqflask/wqflask/templates/marker_regression.html +++ b/wqflask/wqflask/templates/marker_regression.html @@ -18,9 +18,32 @@
Index | +LRS | +Chr | +Mb | +Locus | +
{{loop.index}} | +{{marker.lrs_value}} | +{{marker.chr}} | +{{marker.Mb}} | +{{marker.name}} | +