Correct method to annotate_rows of matrix table with a table of VQSR scores

I have a matrix table of variants (behaving fine) and I have imported a table of VQSR scores. I cannot get around what must be a stupid problem: the table (row_qc) is keyed by a string (which looks like a locus). The matrix table (mt_split_annotated) has rows keyed by [locus, alleles]. When I attempt a simple join to bolt on the vqsr scores like so:

mt_split_annotated = mt_split_annotated.annotate_rows(vqsr = row_qc[])

I get this error:
ExpressionException: Key type mismatch: cannot index table with given expressions:
Table key: str
Index Expressions: locus

I can see there’s a clear type-mismatch, but my attempts to cast the string to a locus or convert the locus to a string are not working so far :frowning:
Any help appreciated!

the method you need is parse_locus:

row_qc = row_qc.key_by(locus = hl.parse_locus(, 

you can also specify the type on import:

row_qc = hl.import_table('file', types={'locus': 'locus<GRCh37>'})

Thank you! I imported with the correct type for the locus field, and that worked fine.