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

Behaviour of count_alleles() when all genotypes are missing #379

Open
alimanfoo opened this issue Apr 13, 2022 · 0 comments
Open

Behaviour of count_alleles() when all genotypes are missing #379

alimanfoo opened this issue Apr 13, 2022 · 0 comments

Comments

@alimanfoo
Copy link
Contributor

If a genotype array has only missing genotypes, current behaviour of count_alleles() may not be ideal, reported by a colleague...

I'm just running one of my scripts and noticed an odd behaviour in the allele.counts() function in scikit allele (v 1.3.5). If there are some rows with all missing data, then the allele count is reported as 0. But if the entire genotype array is all missing data, then instead of 0 counts for each row, I get an error ("ValueError: zero-size array to reduction operation maximum which has no identity").

PS: error doesn't seem to be thrown until you try to print the array. You can still assign it to an object, or query it's shape (which returns 0 columns). I can see why returning 0 columns would make sense, since count_alleles can't know how many alleles there would be, but error when trying to print seems odd.

Perhaps the resulting allele counts array should always have at least one column, as we know there will always be a reference allele.

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

No branches or pull requests

1 participant