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

[qob] Fix IBD and enable tests #14062

Merged
merged 2 commits into from Jan 9, 2024
Merged

[qob] Fix IBD and enable tests #14062

merged 2 commits into from Jan 9, 2024

Conversation

jigold
Copy link
Collaborator

@jigold jigold commented Dec 1, 2023

CHANGELOG: Fixed bugs in the identity by descent implementation for Query on Batch

This PR fixes #14052. There were two bugs in how we compute IBD. In addition, the tests weren't running in QoB and the test dataset we were using doesn't have enough variability to catch errors. I used Balding Nichols generated data instead. Do we need to set the seed in the tests here?

@jigold jigold changed the title [WIP] Fix ibd [qob] Fix IBD and enable tests Jan 3, 2024
@jigold jigold marked this pull request as ready for review January 3, 2024 21:00
Copy link
Collaborator

@patrick-schultz patrick-schultz left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

Do we need to set the seed in the tests here?

No need. This ensures all tests using hail's randomness are deterministic.

@@ -45,11 +45,17 @@ def plinkify(ds, min=None, max=None):
return results


def random_dataset():
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest making this a fixture:

@pytest.fixture(scope=module)
def ds():
  ...

Then each test that wants to use it adds an argument of the same name:

def test_ibd_default_arguments(ds):
  plink_results = plinkify(ds)
  ...

The scope=module caches the result of the function to avoid recomputing it over the duration of the test module. In this case it doesn't save that much, because it's only caching the construction of the IR, but that's probably slightly better than recomputing it each time.

@danking danking merged commit 965f102 into hail-is:main Jan 9, 2024
8 checks passed
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.

[query] In Query-on-Batch, the calculation for IBD is incorrect
3 participants