def _allele_from_index(variant, allele_index):
  """Gets the reference_bases or alternative_bases for allele_index."""
  if allele_index == 0:
    return variant.reference_bases
  else:
    return variant.alternate_bases[allele_index - 1]