aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/data_set.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/base/data_set.py')
-rwxr-xr-xwqflask/base/data_set.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index fbe78d5d..3deaa655 100755
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -168,13 +168,13 @@ class Markers(object):
for marker, p_value in itertools.izip(self.markers, p_values):
marker['p_value'] = p_value
- if math.isnan(marker['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
-
-
+ if math.isnan(marker['p_value']) or marker['p_value'] <= 0:
+ marker['lod_score'] = 0
+ marker['lrs_value'] = 0
+ else:
+ 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
class HumanMarkers(Markers):
@@ -184,6 +184,7 @@ class HumanMarkers(Markers):
self.markers = []
for line in marker_data_fh:
splat = line.strip().split()
+ #print("splat:", splat)
marker = {}
marker['chr'] = int(splat[0])
marker['name'] = splat[1]
@@ -203,6 +204,7 @@ class HumanMarkers(Markers):
# #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
+ print("p_values2:", p_values)
super(HumanMarkers, self).add_pvalues(p_values)
with Bench("deleting markers"):