# Multiple trait GWAS?

**URL:** <https://discuss.hail.is/t/multiple-trait-gwas/2096>\
**Category:** Hail Query & hailctl\
**Created:** [June 22, 2021, 8:02am UTC](https://discuss.hail.is/t/multiple-trait-gwas/2096 "2021-06-22T08:02:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanbin973](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/hanbin973/32/607_2.png) [@hanbin973](https://discuss.hail.is/u/hanbin973)\
**Post date:** [June 22, 2021, 8:02am UTC](https://discuss.hail.is/t/multiple-trait-gwas/2096/1 "2021-06-22T08:02:25Z")

</div>

Hello,

After reading other discussions, I have found out that the regression functionality is suitable for any general regression regardless of the actual outcome/exposure (not only genetic variants).

My current analysis plan is to run a linear regression with the same set of exposure and covariates but with (many many) different outcomes. I’m actually trying to run a regression with all common variants as outcomes.

I tried to supply ‘mt.GT.n\_alt\_alleles()’ in the y variable but it didn’t work. After looking at the documentation, it seems that the regression function currently gets only 1d arrays as an input ([Hail | Statistics](https://hail.is/docs/0.2/methods/stats.html)).

Is there a solution? I think people who wants to run a PheWAS also require having multiple outcomes option when running a regression.

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [June 23, 2021, 9:57pm UTC](https://discuss.hail.is/t/multiple-trait-gwas/2096/2 "2021-06-23T21:57:06Z")

</div>

The `linear_regression_rows` and `logistic_regression_rows` methods support lists of outcome variables for `y`. However, using `mt.GT.n_alt_alleles` as an outcome variable doesn’t work because we restrict outcome variables to fields of a matrix table indexed by column, not entry (“sample” fields, not “genotype” fields) in order to apply some algorithmic tricks to improve performance. However, you might be interested in the general purpose [linreg aggregator](https://hail.is/docs/0.2/aggregators.html#hail.expr.aggregators.linreg) which doesn’t have the restrictions of linear\_regression\_rows (or its performance, be warned). Using this might look like:

```auto
mt = mt.annotate_rows(linreg_results = hl.agg.linreg(y=mt.GT.n_alt_alleles(), x=[...x and covs and intercept...]))

```
