Annotation¶
Annotations are Hail’s way of adding data fields to Hail’s tables and matrix tables.
Create a nested annotation¶
description: | Add a new field |
---|---|
code: | >>> mt = mt.annotate_rows(info=mt.info.annotate(gq_mean=hl.agg.mean(mt.GQ)))
|
dependencies: | |
understanding: | To add a new field Construct an expression |
Remove a nested annotation¶
description: | Drop a field AF , which is nested inside the info field. |
---|
To drop a nested field AF
, construct an expression mt.info.drop('AF')
which drops the field from its parent field, info
. Then, reassign this
expression to info
using MatrixTable.annotate_rows()
.
code: | >>> mt = mt.annotate_rows(info=mt.info.drop('AF'))
|
---|---|
dependencies: |