I used Hail’s “hl.agg.linreg” function to run GWAS and would like to export the summary statistics into a .txt file. Specifically, here’s my code for GWAS:
mt = mt.annotate_rows(gwas = hl.agg.linreg(mt.quant_pheno, [1, mt.GT.n_alt_alleles()]))
And here’s my code to export the output:
I only have ~6000 SNPs in the summary statistics, but it took about 5 minutes to generate the output. Also, the “flatten” function didn’t work properly, as the statistics were clumped together instead of showing up in separate columns when I read the .txt file into R. May I ask if there’s any mistake in my code? Also, how could I improve the speed of exporting output? Thank you very much!