예제 #1
0
 def test_split_genotype_likelihood_with_missing_genotype_likelihood_diploid(self, log):
     split_func = make_split_sample_alt_func("G", lambda x: x)
     self.assertEqual(
         [[None, None, None], [None, None, None]],
         split_func([1.0, 2.0, 3.0], 2, GenotypeCall("0/1"))
     )
     log.check(
         ('wecall.vcfutils.fieldmetadata', 'WARNING',
          "Incorrect number of values 'G' cardinality, expected 6, got 3"),
     )
예제 #2
0
 def test_split_genotype_likelihood_warns_for_non_haploid_diploid(self, log):
     split_func = make_split_sample_alt_func("G", lambda x: x)
     self.assertEqual(
         [[1.0, 2.0], [1.0, 2.0]],
         split_func([1.0, 2.0], 2, GenotypeCall("0/1/2"))
     )
     log.check(
         ('wecall.vcfutils.fieldmetadata', 'WARNING',
          "Unable to handle ploidy other than haploid or diploid."),
     )
예제 #3
0
 def test_split_genotype_likelihood_warns_for_no_genotype(self, log):
     split_func = make_split_sample_alt_func("G", lambda x: x)
     self.assertEqual(
         [[1.0, 2.0], [1.0, 2.0]],
         split_func([1.0, 2.0], 2, None)
     )
     log.check(
         ('wecall.vcfutils.fieldmetadata', 'WARNING',
          "Unknown ploidy when parsing genotype likelihood"),
     )
예제 #4
0
 def test_split_genotype_likelihood_with_correct_number_of_genotypes_diploid(self):
     split_func = make_split_sample_alt_func("G", lambda x: x)
     self.assertEqual([[1.0, 2.0, 3.0]], split_func(
         [1.0, 2.0, 3.0], 1, GenotypeCall("0/1")))