Пример #1
0
 def test_is_variant_call_apply_filter(self, genotype, filters,
                                       expected_when_applied,
                                       expected_when_not_applied):
   variant = test_utils.make_variant(gt=genotype, filters=filters)
   # The default is apply_filter=True.
   self.assertEqual(
       variant_utils.is_variant_call(variant), expected_when_applied)
   self.assertEqual(
       variant_utils.is_variant_call(variant, apply_filter=True),
       expected_when_applied)
   self.assertEqual(
       variant_utils.is_variant_call(variant, apply_filter=False),
       expected_when_not_applied)
Пример #2
0
  def test_is_variant_call(self, variant, expected_req_non_ref,
                           expected_any_genotype):
    # Check that default call checks for genotypes.
    self.assertEqual(
        variant_utils.is_variant_call(variant), expected_req_non_ref)
    # Ask explicitly for genotypes to be included.
    self.assertEqual(
        variant_utils.is_variant_call(variant, require_non_ref_genotype=True),
        expected_req_non_ref)
    # Don't require non_ref genotypes.
    self.assertEqual(
        variant_utils.is_variant_call(variant, require_non_ref_genotype=False),
        expected_any_genotype)

    with self.assertRaises(Exception):
      variant_utils.is_variant_call(None)
Пример #3
0
 def check_is_variant(variant, expected, **kwargs):
   self.assertEqual(
       variant_utils.is_variant_call(variant, **kwargs), expected)