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

Reduce run time for tests for diploid Viterbi implementations #65

Open
szhan opened this issue Jun 1, 2024 · 5 comments
Open

Reduce run time for tests for diploid Viterbi implementations #65

szhan opened this issue Jun 1, 2024 · 5 comments
Labels
enhancement New feature or request refactor test

Comments

@szhan
Copy link
Collaborator

szhan commented Jun 1, 2024

Some tests for the naive diploid Viterbi implementations are rather slow when the reference panel includes ancestral haplotypes and gets moderately large. For example, the tests took ~40 minutes to complete for PR #64, even when tests are skipped when the reference panel exceeds 100 haplotypes. Should we run tests that take this long?

@szhan
Copy link
Collaborator Author

szhan commented Jun 3, 2024

@jeromekelleher suggested to exclude running the naive implementations, since we will not be using them in the API. Also, we should aim for tests that don't run longer than 30 seconds or so.

@szhan
Copy link
Collaborator Author

szhan commented Jun 10, 2024

Naive diploid Viterbi takes rather long when run on ref. panels simulated from get_ts_simple_n8_high_recomb, because the number of haplotypes (including ancestors) can get about 150. A simple solution is to reduce the recombination rate when doing the simulation by half, so reducing it to 10 from 20, which gives ref. panels of about 30 haplotypes.

@szhan
Copy link
Collaborator Author

szhan commented Jun 10, 2024

By reducing the recombination rate to simulate ref. panels for get_ts_simple_n8_high_recomb and test_ts_larger and not running naive diploid Viterbi, I got the the total test run time to 12 minutes on my machine, down from 40 minutes.

@szhan
Copy link
Collaborator Author

szhan commented Jun 10, 2024

These tests take a long time to run:

  • ts_simple_n8_high_recomb
  • ts_simple_n16
  • ts_larger

@szhan
Copy link
Collaborator Author

szhan commented Jun 17, 2024

Ideally, we implement a naive version of diploid Viterbi that scales better, but that will take more work. For now, we can reduce the run times of the ts_larger tests in test_nontree_diploid.py by lowering the (1) ref. panel size; (2) recombination rate; and (3) max number of haplotypes in the ref. panel to decide whether to run naive diploid Viterbi or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor test
Projects
None yet
Development

No branches or pull requests

1 participant