aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base
diff options
context:
space:
mode:
authorZachary Sloan2013-04-05 19:35:28 +0000
committerZachary Sloan2013-04-05 19:35:28 +0000
commitcde27eb1f638eb4b769ba37202bb82b552ace44c (patch)
tree6d73e0f385b6dcc3788be94620b54ebfa61b36d3 /wqflask/base
parentae8b46b4b06a46b92fca5e6b567e6795f1b5dcca (diff)
downloadgenenetwork2-cde27eb1f638eb4b769ba37202bb82b552ace44c.tar.gz
Made changes to get pylmm code working with HMDP datasets
Diffstat (limited to 'wqflask/base')
-rwxr-xr-xwqflask/base/data_set.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index ab8554a0..16bc4ba4 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -74,16 +74,12 @@ class Markers(object):
self.markers = json.load(json_data_fh)
def add_pvalues(self, p_values):
- print("length of self.markers:", len(self.markers))
- print("length of p_values:", len(p_values))
-
# THIS IS only needed for the case when we are limiting the number of p-values calculated
if len(self.markers) > len(p_values):
self.markers = self.markers[:len(p_values)]
for marker, p_value in itertools.izip(self.markers, p_values):
marker['p_value'] = p_value
- print("p_value is:", marker['p_value'])
marker['lod_score'] = -math.log10(marker['p_value'])
#Using -log(p) for the LRS; need to ask Rob how he wants to get LRS from p-values
marker['lrs_value'] = -math.log10(marker['p_value']) * 4.61
@@ -99,9 +95,9 @@ class HumanMarkers(Markers):
for line in marker_data_fh:
splat = line.strip().split()
marker = {}
- marker['chr'] = int(splat[0])
+ marker['chr'] = splat[0]
marker['name'] = splat[1]
- marker['Mb'] = float(splat[3]) / 1000000
+ marker['Mb'] = str(float(splat[3]) / 1000000)
self.markers.append(marker)
#print("markers is: ", pf(self.markers))
@@ -122,7 +118,8 @@ class HumanMarkers(Markers):
with Bench("deleting markers"):
markers = []
for marker in self.markers:
- if not marker['Mb'] <= 0 and not marker['chr'] == 0:
+ #if not float(marker['Mb']) <= 0 or not float(marker['chr']) == 0:
+ if float(marker['Mb']) > 0 and marker['chr'] != "0":
markers.append(marker)
self.markers = markers