aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwqflask/base/data_set.py9
-rwxr-xr-xwqflask/wqflask/marker_regression/marker_regression.py6
2 files changed, 8 insertions, 7 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 182e15e6..d4e97370 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -22,8 +22,10 @@
from __future__ import absolute_import, print_function, division
import os
+import math
import json
+import itertools
from flask import Flask, g
@@ -70,12 +72,9 @@ class Markers(object):
"""Todo: Build in cacheing so it saves us reading the same file more than once"""
def __init__(self, name):
json_data_fh = open(os.path.join(webqtlConfig.NEWGENODIR + name + '.json'))
- self.markers = json.load(json_data)
+ self.markers = json.load(json_data_fh)
- def add_pvalues(p_values):
- #for count, marker in enumerate(self.markers):
- # marker['p_value'] = p_values[count]
-
+ def add_pvalues(self, p_values):
for marker, p_value in itertools.izip(self.markers, p_values):
marker['p_value'] = p_value
#Using -log(p) for the LRS; need to ask Rob how he wants to get LRS from p-values
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index 1d005df4..c9451154 100755
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -458,7 +458,7 @@ class MarkerRegression(object):
#json_data = open(os.path.join(webqtlConfig.NEWGENODIR + self.dataset.group.name + '.json'))
#markers = json.load(json_data)
- genotype_data = [marker['genotypes'] for marker in self.dataset.group.markers]
+ genotype_data = [marker['genotypes'] for marker in self.dataset.group.markers.markers]
no_val_samples = self.identify_empty_samples()
trimmed_genotype_data = self.trim_genotypes(genotype_data, no_val_samples)
@@ -502,7 +502,9 @@ class MarkerRegression(object):
# trait = self.vals,
# nperm=self.num_perm)
- self.lrs_values = [marker['lrs_value'] for marker in self.dataset.group.markers]
+ self.lrs_values = [marker['lrs_value'] for marker in self.dataset.group.markers.markers]
+ print("self.lrs_values is:", pf(self.lrs_values))
+ print("int(self.num_perm*0.37-1)", pf(int(self.num_perm*0.37-1)))
self.lrs_thresholds = Bunch(
suggestive = self.lrs_values[int(self.num_perm*0.37-1)],