From e1bdb7a61a3c3caeefa3f0b3d73ac52e98b79807 Mon Sep 17 00:00:00 2001 From: Jeremy McRae Date: Thu, 23 Mar 2017 10:42:29 +0000 Subject: [PATCH] fix for scipy version difference in fisher exact p-values --- tests/test_site_deviations.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_site_deviations.py b/tests/test_site_deviations.py index 7dd7af1..a9061f0 100644 --- a/tests/test_site_deviations.py +++ b/tests/test_site_deviations.py @@ -73,8 +73,12 @@ def test_site_strand_bias(self): # check that values which would ordinarily give out of bounds errors # instead are converted to a p-value of 1.0. Some versions of scipy have # fixed this bug, and give a correct value, which we need to check too. + # A later scipy version (0.19.0) changed how the hypergeometric + # distribution is estimated, which shifts the Fisher exact p-value from + # the 7th significant figure onwards. site = {'ref_F': 1, 'ref_R': 2, 'alt_F': 9, 'alt_R': 84419233} - self.assertIn(site_strand_bias(site), (1.0, 3.5536923140874242e-07)) + self.assertIn(site_strand_bias(site), (1.0, 3.5536923140874242e-07, + 3.5536916732288063e-07)) def test_test_sites(self): ''' check p-values from tests of strand and parental alt bias.