# Log of breaking changes in 0.2 beta

**URL:** <https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454>\
**Category:** Updates\
**Created:** [April 5, 2018, 3:42pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454 "2018-04-05T15:42:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [April 5, 2018, 3:42pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/1 "2018-04-05T15:42:35Z")

</div>

This thread documents breaking changes as we work toward stabilizing the development branch (i.e., master, 0.2 beta) as Hail 0.2 proper.

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [April 5, 2018, 3:49pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/2 "2018-04-05T15:49:17Z")

</div>

**Removed as\_array parameter from PCA**

[pca](https://hail.is/docs/devel/methods/stats.html?#hail.methods.pca) and [hwe\_normalized\_pca](https://hail.is/docs/devel/methods/genetics.html#hail.methods.hwe_normalized_pca) no longer take an `as_array` parameter. They now always return scores and loadings as arrays (formerly the `as_array=True` option).

See the [overview tutorial](https://hail.is/docs/devel/tutorials/01-genome-wide-association-study.html#Confounded!) for example usage in GWAS, where `PC1` becomes `scores[0]`.

[https://github.com/hail-is/hail/pull/3280](https://github.com/hail-is/hail/pull/3280)

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [April 5, 2018, 3:56pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/3 "2018-04-05T15:56:05Z")

</div>

**Removed dataset parameter from eight methods**

All [methods](https://hail.is/docs/devel/methods/index.html) that took a dataset and at least one required expression on that dataset no longer take a dataset parameter at all (the dataset is implicitly the source of the expression):

`grm`  
`linear_regression`  
`logistic_regression`  
`linear_mixed_regression`  
`pc_relate`  
`pca`  
`rrm`  
`skat`

[https://github.com/hail-is/hail/pull/3211](https://github.com/hail-is/hail/pull/3211)  
[https://github.com/hail-is/hail/pull/3262](https://github.com/hail-is/hail/pull/3262)

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [April 5, 2018, 4:12pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/4 "2018-04-05T16:12:45Z")

</div>

**Changed ys to y and schema in linear regression**

Consistent with the other statistics methods, the parameter `ys` on [linear\_regression](https://hail.is/docs/devel/methods/stats.html#hail.methods.linear_regression) is now `y`, and when `y` is an expression the `linreg` fields all have type `float64`. This is consistent with the other regression methods.

When `y` is a list of expressions (even a list of one expression) the behavior is the same as before: the the five y-dependent `linreg` fields have type `array[float64]`.

The field `n_complete_samples` is now just `n`.

See the [overview tutorial](https://hail.is/docs/devel/tutorials/01-genome-wide-association-study.html#Let%E2%80%99s-do-a-GWAS!) for example usage of the case where `y` is an expression. In particular, `linear_regression_results.linreg.p_value[0].collect()` no longer takes `[0]`.

[https://github.com/hail-is/hail/pull/3295](https://github.com/hail-is/hail/pull/3295)

---

<div class="post-metadata">

**Author:** ![wang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/wang/32/146_2.png) [@wang](https://discuss.hail.is/u/wang)\
**Post date:** [May 9, 2018, 5:26pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/5 "2018-05-09T17:26:21Z")

</div>

See:

> [@\[Breaking change\] New changes to select, annotate, key\_by interface for 0.2](http://discuss.hail.is/t/breaking-change-new-changes-to-select-annotate-key-by-interface-for-0-2/491):
>
> [https://github.com/hail-is/hail/pull/3297](https://github.com/hail-is/hail/pull/3297) This PR will change the way keys on Tables and MatrixTables are dealt with in certain functions. (The doc links will be updated once this pull request lands.) [key\_by(\*expr, \*\*named\_exprs)](https://hail.is/docs/devel/hail.Table.html#hail.Table.key_by) (and key\_rows\_by and key\_cols\_by) is the only method that can modify key fields. The interface is identical to the current select interface, where non-named exprs must be field references (not necessarily top-level), but non-field-reference expressions can still be u…

---

<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:** [May 9, 2018, 5:31pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/6 "2018-05-09T17:31:08Z")

</div>

Oops. See:

> [@\[Breaking change\] Filter alleles](http://discuss.hail.is/t/breaking-change-filter-alleles/489):
>
> Though we have reason to believe nobody has been using this method, we are committed to announcing all breaking changes! The interface for filter\_alleles has changed. Take a look at the new methods: [hl.filter\_alleles](https://hail.is/docs/devel/methods/genetics.html?highlight=filter_alleles#hail.methods.filter_alleles)[hl.filter\_alleles\_hts](https://hail.is/docs/devel/methods/genetics.html?highlight=filter_alleles#hail.methods.filter_alleles_hts)

---

<div class="post-metadata">

**Author:** ![Meredith\_Accum](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/meredith_accum/32/151_2.png) [@Meredith\_Accum](https://discuss.hail.is/u/Meredith_Accum)\
**Post date:** [May 11, 2018, 10:52pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/7 "2018-05-11T22:52:54Z")

</div>

`ld_prune` has changed to take a CallExpression instead of a matrix table. The new signature is `ld_prune(call_expr, r2=0.2, window=1000000, memory_per_core=256)`.

See: [https://github.com/hail-is/hail/pull/3518](https://github.com/hail-is/hail/pull/3518)

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [May 14, 2018, 8:20pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/8 "2018-05-14T20:20:25Z")

</div>

[ld\_prune](https://hail.is/docs/devel/methods/genetics.html#hail.methods.ld_prune) no longer requires unphased genotypes (though it still makes no use of phasing information). And the parameter `window` has been renamed `bp_window_size`.

See: [https://github.com/hail-is/hail/pull/3575](https://github.com/hail-is/hail/pull/3575)

---

<div class="post-metadata">

**Author:** ![konradjk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/konradjk/32/12_2.png) [@konradjk](https://discuss.hail.is/u/konradjk)\
**Post date:** [May 14, 2018, 8:33pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/9 "2018-05-14T20:33:25Z")

</div>

While we’re at it, it also returns a Table with just `('locus', 'alleles')` that is the set of independent variants at that threshold (rather than previously returning the MatrixTable filtered to that set).

---

<div class="post-metadata">

**Author:** ![cseed](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/cseed/32/361_2.png) [@cseed](https://discuss.hail.is/u/cseed)\
**Post date:** [June 18, 2018, 6:15pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/10 "2018-06-18T18:15:22Z")

</div>

See:

> [@\[Breaking change\] Hail 0.2 no longer supports BGEN 1.1](http://discuss.hail.is/t/breaking-change-hail-0-2-no-longer-supports-bgen-1-1/531):
>
> As of the PR [support only bgen12](https://github.com/hail-is/hail/pull/3743), Hail 0.2 no longer supports BGEN 1.1 and only supports BGEN 1.2 with the 8-bit genotype probability encoding. If you have BGEN 1.1 data (or 1.2 with non-8-bit encoding), you can use Hail 0.1 or use qctool to convert your data to BGEN 1.2.

---

<div class="post-metadata">

**Author:** ![danking](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/danking/32/43_2.png) [@danking](https://discuss.hail.is/u/danking)\
**Post date:** [July 12, 2018, 12:46am UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/11 "2018-07-12T00:46:41Z")

</div>

see:

> [@\[Breaking Change\] Hail 0.2 import\_bgen should be passed a min\_partitions parameter](http://discuss.hail.is/t/breaking-change-hail-0-2-import-bgen-should-be-passed-a-min-partitions-parameter/566):
>
> Previously, some Spark heuristics chose a reasonable number of partitions for import\_bgen. This logic has been removed while we improve bgen performance (we may add the logic back in before 0.2 release). In the meantime, you will notice that import\_bgen uses far fewer partitions than is appropriate. You can use the min\_partitions argument to force a higher number of partitions. For the UKBB dataset, try using around 18,000 partitions.

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [July 18, 2018, 1:25am UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/12 "2018-07-18T01:25:02Z")

</div>

see:

> [@\[Breaking Change\] Hail 0.2 removed KinshipMatrix, linear\_mixed\_regression](http://discuss.hail.is/t/breaking-change-hail-0-2-removed-kinshipmatrix-linear-mixed-regression/578):
>
> (Update: Hail 0.2 has a function linear\_mixed\_regression\_rows which most closely implements the old linear\_mixed\_regression function) The KinshipMatrix class is gone. Instead, [realized\_relationship\_matrix](https://hail.is/docs/devel/methods/genetics.html#hail.methods.realized_relationship_matrix) and [genetic\_relatedness\_matrix](https://hail.is/docs/devel/methods/genetics.html#hail.methods.genetic_relatedness_matrix) both return a BlockMatrix with improved performance. The gcta\_grm and gcta\_grm\_bin on KinshipMatrix are therefore gone as well. BlockMatrix supports [export](https://hail.is/docs/devel/linalg/hail.linalg.BlockMatrix.html#hail.linalg.BlockMatrix.export), as well as and conversion [to\_numpy](https://hail.is/docs/devel/linalg/hail.linalg.BlockMatrix.html#hail.linalg.BlockMatrix.to_numpy) for further processing if small enough (less than 46k samples, assuming…

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [July 31, 2018, 1:09pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/13 "2018-07-31T13:09:51Z")

</div>

see:

> [@\[Breaking Change\] Rename of methods/fields: ctt, chisq, hardy\_weinberg, hardy\_weinberg\_p, variant\_qc, transition\_disequilibrium\_test](http://discuss.hail.is/t/breaking-change-rename-of-methods-fields-ctt-chisq-hardy-weinberg-hardy-weinberg-p-variant-qc-transition-disequilibrium-test/590):
>
> For clarity and consistency, we’ve renamed the following: Functions: ctt =\> [contingency\_table\_test](https://hail.is/docs/devel/functions/stats.html#hail.expr.functions.contingency_table_test) chisq =\> [chi\_squared\_test](https://hail.is/docs/devel/functions/stats.html#hail.expr.functions.chi_squared_test) hardy\_weinberg =\> [hardy\_weinberg\_test](https://hail.is/docs/devel/functions/stats.html#hail.expr.functions.hardy_weinberg_test) Aggregator: hardy\_weinberg\_p =\> [hardy\_weinberg\_test](https://hail.is/docs/devel/aggregators.html#hail.expr.aggregators.hardy_weinberg_test) Fields in [hardy\_weinberg\_test](https://hail.is/docs/devel/functions/stats.html#hail.expr.functions.hardy_weinberg_test): p\_hwe =\> p\_value r\_expected\_het\_freq =\> het\_freq\_hwe (the expected frequency of het under HWE) Fields in [variant\_qc](https://hail.is/docs/devel/methods/genetics.html#hail.methods.variant_qc) result: p\_hwe =\> p\_value\_hwe r\_expected\_het\_freq =\> het\_freq\_hwe Field in [transition\_disequilibrium\_test](https://hail.is/docs/devel/methods/genetics.html#hail.methods.transmission_disequilibrium_test) result: chi2 =\> chi…

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [July 31, 2018, 1:10pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/14 "2018-07-31T13:10:11Z")

</div>

see:

> [@\[Breaking Change\] sample\_qc](http://discuss.hail.is/t/breaking-change-sample-qc/588):
>
> The following changes have been made to sample\_qc: The fields gq\_mean and gq\_stdev have been replaced with gq\_stats that is a struct with four fields: mean, stdev, min, and max. The fields dp\_mean and dp\_stdev have been replaced with dp\_stats that is a struct with four fields: mean, stdev, min, and max. n\_singleton now includes singleton alleles that are the reference allele.

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [July 31, 2018, 10:29pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/15 "2018-07-31T22:29:12Z")

</div>

see:

> [@\[Breaking Change\] overwrite parameter on BlockMatrix write and write\_from\_entry\_expr](http://discuss.hail.is/t/breaking-change-overwrite-parameter-on-blockmatrix-write-and-write-from-entry-expr/592):
>
> BlockMatrix [write](https://hail.is/docs/devel/linalg/hail.linalg.BlockMatrix.html#hail.linalg.BlockMatrix.write) and [write\_from\_entry\_expr](https://hail.is/docs/devel/linalg/hail.linalg.BlockMatrix.html#hail.linalg.BlockMatrix.write_from_entry_expr) now take an overwrite parameter, with default value False.

---

<div class="post-metadata">

**Author:** ![jbloom](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/jbloom/32/109_2.png) [@jbloom](https://discuss.hail.is/u/jbloom)\
**Post date:** [August 6, 2018, 1:44pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/16 "2018-08-06T13:44:44Z")

</div>

see:

> [@\[Breaking Change\] Intercept is now optional in regression and SKAT](http://discuss.hail.is/t/breaking-change-intercept-is-now-optional-in-regression-and-skat/597):
>
> To give users more control, we’ve changed inclusion of an intercept from implicit to explicit in linear regression, logistic regression, and SKAT. Consider the linear regression model y = b\*x + b0 + b1\*c1 + b2\*c2 + e where we are interested the effect size b on x per row of a matrix table mt, and b0 represents an intercept. BEFORE the intercept was implicitly added so you would write: hl.linear\_regression(y=mt.y, x=mt.x, covariates=[mt.c1, mt.c2]). NOW the intercept must be included explici…

---

<div class="post-metadata">

**Author:** ![konradjk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/konradjk/32/12_2.png) [@konradjk](https://discuss.hail.is/u/konradjk)\
**Post date:** [August 13, 2018, 10:07am UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/17 "2018-08-13T10:07:22Z")

</div>

Minor breaking change: `hl.min_rep()` now returns `struct` of `locus` (a `LocusExpression`) and `alleles` (an `ArrayExpression` of type `str`). This makes min\_rep and re-key much easier as in:

```auto
mt = mt.key_rows_by(**hl.min_rep(mt.locus, mt.alleles))

```

---

<div class="post-metadata">

**Author:** ![wang](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/wang/32/146_2.png) [@wang](https://discuss.hail.is/u/wang)\
**Post date:** [August 15, 2018, 6:30pm UTC](https://discuss.hail.is/t/log-of-breaking-changes-in-0-2-beta/454/18 "2018-08-15T18:30:40Z")

</div>

minor change:

the parameter names of `hl.rand_unif(min, max)` are changing to `lower` and `upper`.

[https://github.com/hail-is/hail/pull/4145](https://github.com/hail-is/hail/pull/4145)
