I am trying to annotate a MatrixTable with sample IDs written as integers, but I am encountering the key type mismatch error below. Is there a way to import the values into samples
as strings to avoid this error? Should I use hl.import_lines
? Thank you in advance.
samples = hl.import_table(args.sub_annot, key='SAMPLE', impute=True)
vcf = vcf.annotate_cols(
sa=samples[vcf.s]
)
Traceback (most recent call last):
File "/opt/notebooks/hail_variant_qc_V10.py, line 485, in <module> sa=samples [vcf.s]
File "/opt/conda/lib/python3.9/site-packages/hail/table-py, line 379, in getitem return self.index(*wrap_to_tuple(item))
File "/opt/conda/lib/python3.9/site-packages/hail/table-py", line 1840, in index
raise ExpressionException(f"Key type mismatch: cannot index table with given expressions: \n" hail.expr.expressions.base_expression. ExpressionException: Key type mismatch: cannot index table with given expressions:
Table key:
int32
Index Expressions: str