Example #1
0
def _get_variant_type(variant):
  """Returns the type of variant as a string."""
  if variant_utils.is_variant_call(variant):
    biallelic = variant_utils.is_biallelic(variant)
    snp = variant_utils.is_snp(variant)
    insertion = variant_utils.variant_is_insertion(variant)
    deletion = variant_utils.variant_is_deletion(variant)

    if biallelic:
      if snp:
        return BIALLELIC_SNP
      elif insertion:
        return BIALLELIC_INSERTION
      elif deletion:
        return BIALLELIC_DELETION
      else:
        return BIALLELIC_MNP
    else:
      if snp:
        return MULTIALLELIC_SNP
      elif insertion:
        return MULTIALLELIC_INSERTION
      elif deletion:
        return MULTIALLELIC_DELETION
      else:
        return MULTIALLELIC_COMPLEX
  else:
    return REFCALL
Example #2
0
 def test_is_biallelic(self, variant, expected):
   self.assertEqual(variant_utils.is_biallelic(variant), expected)
Example #3
0
 def test_is_biallelic(self, variant, expected):
   self.assertEqual(variant_utils.is_biallelic(variant), expected)