Skip to content

[qob] Fix IBD and enable tests - #14062

Merged
danking merged 2 commits into
hail-is:mainfrom
jigold:fix-ibd
Jan 9, 2024
Merged

[qob] Fix IBD and enable tests#14062
danking merged 2 commits into
hail-is:mainfrom
jigold:fix-ibd

Conversation

@jigold

@jigold jigold commented Dec 1, 2023

Copy link
Copy Markdown
Contributor

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

@patrick-schultz patrick-schultz left a comment

Copy link
Copy Markdown
Member

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.

return results


def random_dataset():

Copy link
Copy Markdown
Member

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
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