Can someone explain me how to use the “meta” information to more easily query for populations. Or more general, how to get names for the information stored in an array of a row-field ?
The gnomAD Hail Tables have a global field named freq_meta. Each entry in freq_meta describes the freq entry at the same index (freq_meta[0] contains information about freq[0], freq_meta[1] about freq[1], etc.).
To get freq_meta as a Python list, use hl.eval(ht.globals.freq_meta).
Thanks! That already helps. Again, sorry for the basic questions, but can you tell me how to combine this information to:
a) generate a ht with e.g. freq[0] and freq[2]
and
b) finally export it to a tab, tsv or csv delimited text file which looks like this:
I want to extract the counts but for the whole genome, not just few lociis. I downloaded gnomad v211 liftover ht and ran the command, I met the following error -
2021-03-02 17:09:23 Hail: ERROR: Analysis exception: 'Table.select': cannot overwrite key field 'locus' with annotate, select or drop; use key_by to modify keys.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<decorator-gen-970>", line 2, in select
File "/root/anaconda3/envs/hail/lib/python3.7/site-packages/hail/typecheck/check.py", line 614, in wrapper
return __original_func(*args_, **kwargs_)
File "/root/anaconda3/envs/hail/lib/python3.7/site-packages/hail/table.py", line 922, in select
self._row)
File "/root/anaconda3/envs/hail/lib/python3.7/site-packages/hail/utils/misc.py", line 423, in get_select_exprs
check_keys(caller, name, protected_key)
File "/root/anaconda3/envs/hail/lib/python3.7/site-packages/hail/utils/misc.py", line 397, in check_keys
raise ExpressionException(msg)
hail.expr.expressions.base_expression.ExpressionException: 'Table.select': cannot overwrite key field 'locus' with annotate, select or drop; use key_by to modify keys.
I get disk space error when I try the command without "locus","alleles" part, maybe need to set a tmp directory(?)