From 63a6ab2f565611bbe1464d718acff4398de12a19 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Thu, 15 Aug 2013 17:08:20 -0500 Subject: Removed the markers with no variance (and thus no p-values) from the manhattan plot --- wqflask/base/data_set.py | 12 +++++++----- wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py index 091433a6..0b9b1ce0 100755 --- a/wqflask/base/data_set.py +++ b/wqflask/base/data_set.py @@ -168,11 +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 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 diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index 3743e77c..6ef1669b 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -396,7 +396,7 @@ def GWAS(pheno_vector, keep = True - v xs = x[keep,:] if xs.var() == 0: - p_values.append(np.nan) + p_values.append(0) t_statistics.append(np.nan) continue @@ -413,7 +413,7 @@ def GWAS(pheno_vector, ts, ps, beta, betaVar = lmm_ob_2.association(xs, REML=restricted_max_likelihood) else: if x.var() == 0: - p_values.append(np.nan) + p_values.append(0) t_statistics.append(np.nan) continue -- cgit v1.2.3