# Combine locus and alleles into a row annotation

**URL:** <https://discuss.hail.is/t/combine-locus-and-alleles-into-a-row-annotation/2986>\
**Category:** Hail Query & hailctl\
**Created:** [December 12, 2022, 2:03pm UTC](https://discuss.hail.is/t/combine-locus-and-alleles-into-a-row-annotation/2986 "2022-12-12T14:03:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MsUTR](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@MsUTR](https://discuss.hail.is/u/MsUTR)\
**Post date:** [December 12, 2022, 2:03pm UTC](https://discuss.hail.is/t/combine-locus-and-alleles-into-a-row-annotation/2986/1 "2022-12-12T14:03:10Z")

</div>

Hi all,

I am trying to combine `mt.locus` and `mt.alleles` into a single row annotation, like this "chr1:12345-[“A”, “T”]. I did not get much success playing with the data types as it is quite different from Python, can I get some advice on how to do it?

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [December 12, 2022, 2:04pm UTC](https://discuss.hail.is/t/combine-locus-and-alleles-into-a-row-annotation/2986/2 "2022-12-12T14:04:54Z")

</div>

How about this function?

[https://hail.is/docs/0.2/functions/genetics.html#hail.expr.functions.variant\_str](https://hail.is/docs/0.2/functions/genetics.html#hail.expr.functions.variant_str)

If you want literally the string you wrote, I think `hl.str(mt.locus) + '-' + hl.str(mt.alleles)` will give you `chr1:12345-["A", "T"]`
