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

Check for duplicate alleles #960

Closed
wants to merge 1 commit into from

Conversation

hyanwong
Copy link
Member

@hyanwong hyanwong commented Sep 4, 2024

Fixes #927.

I assume we are happy to take the hit of looping through all the sites and doing a set(). An alternative would be to do an np.unique by row, but then we would need to remove the duplicate "" entries.

@jeromekelleher
Copy link
Member

How long does it take for a large file?

@hyanwong
Copy link
Member Author

hyanwong commented Sep 4, 2024

I'll test. Meanwhile, I messed up the GH commits with another PR, so will fix and force push

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.17%. Comparing base (a080e8f) to head (3421907).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #960   +/-   ##
=======================================
  Coverage   93.16%   93.17%           
=======================================
  Files          18       18           
  Lines        6337     6340    +3     
  Branches     1133     1135    +2     
=======================================
+ Hits         5904     5907    +3     
  Misses        294      294           
  Partials      139      139           
Flag Coverage Δ
C 93.17% <100.00%> (+<0.01%) ⬆️
python 95.53% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Also fix tests to create valid datasets with a given seed
@benjeffery
Copy link
Member

LGTM - I don't think the loop through the alleles will be that expensive for most cases - unless lots of sites have hundreds of alleles.

This has made me realise the vcfzarr spec should probably be more explicit that zero-length alleles are not allowed. It is currently there as implicit as it states "" is a fill value.

@hyanwong
Copy link
Member Author

hyanwong commented Sep 4, 2024

This has made me realise the vcfzarr spec should probably be more explicit that zero-length alleles are not allowed. It is currently there as implicit as it states "" is a fill value.

Zero-length alleles are not allowed in VCF files, so I guess that's another way in which it is implicit. However, we might want to allow representation of indels internally using a "", otherwise there are forms of genetic variation that can be represented in a VCF that can't be represented in the tsinfer input (see #893 (comment))

@hyanwong
Copy link
Member Author

Rolled into #963 as part of review, and tested with a large file.

@hyanwong hyanwong closed this Sep 10, 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.

Check all alleles at a site are unique before inference
3 participants