Пример #1
0
 def test_parse_freq_handles_missing(self):
     value = parser_utils.parse_allele_frequency(allele_count='NA', n_samples='100')
     assert value is None
Пример #2
0
 def test_parse_freq_given_counts(self):
     value = parser_utils.parse_allele_frequency(allele_count='25', n_samples='100')
     assert value == 0.125
Пример #3
0
 def test_parse_freq_given_counts_orients_to_alt(self):
     value = parser_utils.parse_allele_frequency(allele_count='75', n_samples='100', is_alt_effect=False)
     assert value == 0.625
Пример #4
0
 def test_parse_freq_given_frequency_handles_missing(self):
     value = parser_utils.parse_allele_frequency(freq='NA', is_alt_effect=True)
     assert value is None
Пример #5
0
 def test_parse_freq_given_frequency_orients_to_alt(self):
     value = parser_utils.parse_allele_frequency(freq='0.25', is_alt_effect=False)
     assert value == 0.75
Пример #6
0
 def test_parse_freq_given_frequency(self):
     value = parser_utils.parse_allele_frequency(freq='0.25', is_alt_effect=True)
     assert value == 0.25
Пример #7
0
 def test_parse_freq_out_of_range(self):
     with pytest.raises(ValueError):
         parser_utils.parse_allele_frequency(freq='42')
Пример #8
0
 def test_parse_freq_given_too_many_options(self):
     with pytest.raises(exceptions.ConfigurationException, match='mutually exclusive'):
         parser_utils.parse_allele_frequency(freq='0.1', allele_count='0.2', n_samples='0.3')