You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following post was exported from discuss.hail.is, a forum for asking questions about Hail which has since been deprecated.
(Jan 03, 2024 at 20:51) alee9 said:
Hi All,
I would like to add a row-wise annotation (info field) to my matrix table called ‘NAL’ that contains the number of alleles at a site (the length of the alleles array).
I have attempted to achieve this using the command mt = mt.annotate_rows(info=mt.info.annotate(NAL=mt.alleles.aggregate(hl.agg.count())))
Note
The following post was exported from discuss.hail.is, a forum for asking questions about Hail which has since been deprecated.
(Jan 03, 2024 at 20:51) alee9 said:
Hi All,
I would like to add a row-wise annotation (info field) to my matrix table called ‘NAL’ that contains the number of alleles at a site (the length of the alleles array).
I have attempted to achieve this using the command
mt = mt.annotate_rows(info=mt.info.annotate(NAL=mt.alleles.aggregate(hl.agg.count())))
However, this results in the following error
I suspect that the command that I am using is not correct and would be grateful for any help in constructing the correct command.
Thanks in advance
(Jan 04, 2024 at 06:35) Benjamin_Blankenmeis said:
I’d maybe try something like:
mt.alleles
is usually a row field, so you actually don’t need to perform an aggregation over the samples/columns.(Jan 04, 2024 at 08:54) alee9 said:
Hi Benjamin, thanks for your swift reply. It works perfectly, and gives exactly what I wanted.
The text was updated successfully, but these errors were encountered: