# Annotate\_rows in Hail0.2 VS annotate\_variants\_expr(expr) in Hail0.1

**URL:** <https://discuss.hail.is/t/annotate-rows-in-hail0-2-vs-annotate-variants-expr-expr-in-hail0-1/1516>\
**Category:** Hail Query & hailctl\
**Created:** [July 8, 2020, 7:43pm UTC](https://discuss.hail.is/t/annotate-rows-in-hail0-2-vs-annotate-variants-expr-expr-in-hail0-1/1516 "2020-07-08T19:43:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shuang](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@shuang](https://discuss.hail.is/u/shuang)\
**Post date:** [July 8, 2020, 7:43pm UTC](https://discuss.hail.is/t/annotate-rows-in-hail0-2-vs-annotate-variants-expr-expr-in-hail0-1/1516/1 "2020-07-08T19:43:36Z")

</div>

Hi,

I am re-building Hail0.1 qc script with Hail0.2.  
I searched doc, but not sure about this:

In hail0.1, we tried to “Replace INFO field allele count with the corrected variant qc allele count value”  
vds.annotate\_variants\_expr(‘va.info.AC = va.qc.AC’)

In hail0.2, I try to do the same thing via: mt.annotate\_rows(mt.info.AC[0] = mt.variant\_qc.AC[0],mt.info.AC[1] = mt.variant\_qc.AC[1]), I am not 100% sure whether this command line will do what I need?

Any help are welcome. Thanks.

---

<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:** [July 8, 2020, 8:30pm UTC](https://discuss.hail.is/t/annotate-rows-in-hail0-2-vs-annotate-variants-expr-expr-in-hail0-1/1516/2 "2020-07-08T20:30:04Z")

</div>

The `annotate_rows` command doesn’t work quite like this.

```auto
mt.annotate_rows(mt.info.AC[0] = mt.variant_qc.AC[0],mt.info.AC[1] = mt.variant_qc.AC[1])

```

You can only annotate “fields” and you can only update one level of field at a time. Try this:

```auto
mt.annotate_rows(
    info = mt.info.annotate(AC = mt.variant_qc.AC)
)

```

Unfortunately, this is more verbose than the 0.1 syntax. My apologies! We have not yet discovered a succinct way to write this in Python 3.

The advantage of this style of syntax is that a Python IDE (such as PyCharm) can tell you what operations are available when you write `mt.info`! You should get a tooltip that lists all the available options.
