Skip to content

Commit

Permalink
fix for scipy version difference in fisher exact p-values
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy McRae committed Mar 23, 2017
1 parent 3f059c4 commit e1bdb7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_site_deviations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e1bdb7a

Please sign in to comment.