Skip to content

Sample alleles without replacement in simulate_genotype_call_dataset - #1353

Merged
jeromekelleher merged 1 commit into
sgkit-dev:mainfrom
barlowa124:fix-simulate-unique-alleles-1221
Oct 12, 2026
Merged

jeromekelleher merged 1 commit into
sgkit-dev:mainfrom
barlowa124:fix-simulate-unique-alleles-1221

Conversation

@barlowa124

Copy link
Copy Markdown
Contributor

Closes #1221.

Per-variant alleles in simulate_genotype_call_dataset are drawn
independently, allowing the same base twice in one allele list. With
seed=1 two sites came out as [T, T], producing malformed variants
for downstream tooling.

When n_allele fits the base alphabet the draw now happens without
replacement. Larger requests keep the previous behavior. The new test
checks allele uniqueness per variant on the reporter's parameters and
test_testing.py passes.

rs.choice drew alleles independently, so a variant could repeat the
same allele (e.g. two "T" alleles with seed=1, sgkit-dev#1221). Draw without
replacement when n_allele fits the base alphabet; sampling stays
unchanged above it.
@mergify

mergify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7c20011) to head (0bfc4cc).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1353   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           46        46           
  Lines         2994      2998    +4     
=========================================
+ Hits          2994      2998    +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeromekelleher jeromekelleher 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.

LGTM, thanks @barlowa124 !

@jeromekelleher
jeromekelleher merged commit 9e7ac5a into sgkit-dev:main Oct 12, 2026
16 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.

simulate_genotype_call_dataset creates duplicate alleles

3 participants