Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hail] Fix pc_relate bug with non-default call_expr #5250

Merged
merged 5 commits into from Feb 6, 2019
Merged

Conversation

danking
Copy link
Contributor

@danking danking commented Feb 5, 2019

resolves #5263

@danking danking changed the title [hail] Fix pc_relate bug in non-default call_expr [hail] Fix pc_relate bug with non-default call_expr Feb 5, 2019
@@ -1774,7 +1774,8 @@ def pc_relate(call_expr, min_individual_maf, *, k=None, scores_expr=None,
mt = matrix_table_source('pc_relate/call_expr', call_expr)

if k and scores_expr is None:
_, scores, _ = hwe_normalized_pca(mt.GT, k, compute_loadings=False)
mt2 = mt.select_entries(call=call_expr)
_, scores, _ = hwe_normalized_pca(mt2.call, k, compute_loadings=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pass this directly into hwe_norm_pca:

_, scores, _ = hwe_normalized_pca(call_expr, k, compute_loadings=False)

Should also test this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was really hoping you didn't say that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make put this in the doctest or something?

@@ -278,7 +278,7 @@ task testPython(type: Exec, dependsOn: shadowJar) {
'-r a',
'--html=build/reports/pytest.html',
'--self-contained-html',
'python/test'
'-k', 'test_pcrelate_issue_5263', 'python/test'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

@danking
Copy link
Contributor Author

danking commented Feb 5, 2019

@tpoterba I added a test and an issue that described the problem. I verified the test fails on dcf43490c a recent master commit.

@danking
Copy link
Contributor Author

danking commented Feb 6, 2019

@jbloom22 can you give the latest commit on this PR a second set of eyes? I had to fiddle with some tolerances due to https://storage.googleapis.com/hail-ci-0-1/ci/7a0732726e6873e2c0d85fed5183324ac9441d52/194ea22cd9f744a5463340130e799c8a65ca885e/index.html . I expected the test I added (test_pcrelate_issue_5263) to be exactly the same but it differed out at the 10th or so position.

@jbloom22
Copy link
Contributor

jbloom22 commented Feb 6, 2019

Will do!

@danking danking merged commit 4440e07 into master Feb 6, 2019
@danking
Copy link
Contributor Author

danking commented Feb 7, 2019

@jbloom22 here

@jbloom22
Copy link
Contributor

jbloom22 commented Feb 7, 2019

if you cache the dataset (or set the global seed and generate it, both for the actual and the expected), do you get exactly the same result in your new test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pc_relate does not use the correct call for hwe_normalized_pca
3 participants