Linear regression per column with entry fields

Hi all – I have a MatrixTable with genes as row key, phenotype as column key, and two entry fields, called X and Y. For each phenotype, I would like to regress Y on X (for example, if I have 100 genes and 2 phenotypes, then I would run 2 regressions, each with 100 (x,y) pairs).

I’m getting stuck on how to use linear_regression_rows on my particular MatrixTable for my analysis. I see linear_regression_rows looks for a column keyed response variable, and more generally a transposed-ish version of my MatrixTable. Since I understand transposition to be tricky with MatrixTables, any suggestions on how to implement this regression in Hail given the structure of my data described above?

Thanks a lot!

It’s true that you can’t use linear_regression_rows in this scenario without doing some sort of transpose. However, you can use the linear regression aggregator: Hail | Aggregators

Thank you!