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

Replace contig with region in GWSS functions #691

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

leehart
Copy link
Collaborator

@leehart leehart commented Dec 6, 2024

Resolves #375

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@leehart leehart marked this pull request as ready for review December 9, 2024 17:45
Copy link
Collaborator

@jonbrenas jonbrenas left a comment

Choose a reason for hiding this comment

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

Maybe using a random region instead of a random contig in at least some of the tests would be better. The function random_region_str from tests/anoph/conftest.py exists and there are a few examples of use in test_snp_data.py, for instance.

@leehart
Copy link
Collaborator Author

leehart commented Dec 13, 2024

Just to note that there are other places in the code unrelated to this PR where a random contig is used for a region in testing, e.g.

  • test_biallelic_diplotype_pairwise_distance_with_metric
  • test_njt_with_metric
  • test_njt_with_algorithm
  • test_plot_njt
  • test_average_fst
  • test_average_fst_with_min_cohort_size
  • test_pca_plotting
  • test_pca_exclude_samples
  • test_pca_fit_exclude_samples
  • test_plink_converter

There might be a valid reason for choosing a random contig over a random region string, I'm not sure, but we could deal with those cases in another PR, in needs be.

@leehart
Copy link
Collaborator Author

leehart commented Dec 13, 2024

I'm getting IndexError: index 0 is out of bounds for axis 0 with size 0 in a few tests after switching to random region strings, so it seems worthwhile!

@leehart leehart marked this pull request as draft December 13, 2024 13:00
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.

Support region instead of contig parameter in H12, G123, IHS and Fst functions
2 participants