def test_sample_data_copes_with_mixed_missing_values_in_PL(self): sample_name = 'sample_name' sample_data = SampleData(['PL'], [sample_name]) sample_data.add_sample_data(sample_name, 'PL', [-0.1, '.', -0.2, None, -0.3]) self.assertEqual(sample_data.get_genotype_likelihoods(sample_name), [0.01, None, 0.02, None, 0.03])
def test_gets_list_of_none_if_key_is_GL(self): sample_name = 'sample_name' sample_data = SampleData(['GL'], [sample_name]) sample_data.add_sample_data(sample_name, 'GL', [None, None, None]) self.assertEqual(sample_data.get_genotype_likelihoods(sample_name), [None, None, None])
def test_gets_dot_if_key_is_PL(self): sample_name = 'sample_name' sample_data = SampleData(['PL'], [sample_name]) sample_data.add_sample_data(sample_name, 'PL', '.') self.assertEqual(sample_data.get_genotype_likelihoods(sample_name), '.')
def test_gets_exact_values_if_key_is_PL(self): sample_name = 'sample_name' sample_data = SampleData(['PL'], [sample_name]) sample_data.add_sample_data(sample_name, 'PL', [1, 2, 3]) self.assertEqual(sample_data.get_genotype_likelihoods(sample_name), [-0.1, -0.2, -0.3])