# Variant\_qc, AC, AF allele order

**URL:** <https://discuss.hail.is/t/variant-qc-ac-af-allele-order/2997>\
**Category:** Science\
**Created:** [December 16, 2022, 5:20pm UTC](https://discuss.hail.is/t/variant-qc-ac-af-allele-order/2997 "2022-12-16T17:20:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arm](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@arm](https://discuss.hail.is/u/arm)\
**Post date:** [December 16, 2022, 5:20pm UTC](https://discuss.hail.is/t/variant-qc-ac-af-allele-order/2997/1 "2022-12-16T17:20:27Z")

</div>

Hello!

Can someone please clarify whether the order of elements in the array at mt.variant\_qc.AC and mt.variant\_qc.AF produced by hl.variant\_qc has any significance?

The docs simply say that there is one element for each allele in the array. I would like to extract the AC and AF for the alternate allele.

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [December 16, 2022, 5:29pm UTC](https://discuss.hail.is/t/variant-qc-ac-af-allele-order/2997/2 "2022-12-16T17:29:11Z")

</div>

Yes the order is exactly the same as the order in the `alleles` array. Assuming you’ve imported a VCF with `import_vcf` or used the VDS combiner, your alleles array will have the reference allele in position 0, the first alternative in position 1, etc.

You can extract the AC for the first alternate like this:

```python
mt = mt.annotate_rows(
    AC_first_alt = mt.AC[1]
)

```

---

<div class="post-metadata">

**Author:** ![arm](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@arm](https://discuss.hail.is/u/arm)\
**Post date:** [December 16, 2022, 5:48pm UTC](https://discuss.hail.is/t/variant-qc-ac-af-allele-order/2997/3 "2022-12-16T17:48:16Z")

</div>

Great! Thank you!
