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

Fix setting sample genotype using .alleles property #1122

Conversation

BuysDB
Copy link
Contributor

@BuysDB BuysDB commented Jul 20, 2022

This is a fix for issue #891 .

The cause of the issue is that in libcbcf.pyx the @alleles.setter method is identical to the @allele_indices.setter method, while it should calculate the the allele indices and write these to the GT.
I have included a test to check the correct behavior.
Additionally there is some code to allow the GT to be reset by passing None an empty tuple or a (None,) tuple, and finally an assertion to check if no integers are passed to inform (potential) users which expect the old but incorrect behavior.

@AndreasHeger
Copy link
Contributor

Thanks, great stuff!

@AndreasHeger AndreasHeger merged commit 75bf541 into pysam-developers:master Oct 19, 2022
@jmarshall jmarshall mentioned this pull request Apr 6, 2023
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.

2 participants