Add AF to regression output

I would like to add a matrixtable row “new_AF” to my logistic regression output table by matching the locus and alleles. Both mt_rows and log_reg (ht) is keyed to locus and allele.

If I run
log_reg2 = log_reg.annotate(AF = mt.index_rows(log_reg.key).new_AF)
I get error
“ExpressionException: Key type mismatch: cannot index matrix table with given expressions:
MatrixTable row key: locus, array
Index expressions: str, array”

Not exactly certain what the error means or how to merge.

Thanks,

Kelly

This error is indicating that log_reg.row_key is not of type locus, alleles, but that the first field is a string. Did the locus field get converted into a string at some point?

Thank you. I must have been doing something odd.
log_reg2 = log_reg.annotate(AF = mt.index_rows(log_reg.key).new_AF) works now after I fixed by:

-Set key
log_reg = log_reg.key_by(‘locus’, ‘alleles’)