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

ZeroDivisionError: float division by zero, new "old" error #87

Open
cbossu opened this issue Apr 4, 2024 · 1 comment
Open

ZeroDivisionError: float division by zero, new "old" error #87

cbossu opened this issue Apr 4, 2024 · 1 comment

Comments

@cbossu
Copy link

cbossu commented Apr 4, 2024

Hello,
I know there was an older post related to this (it's currently closed), but this has only recently become an issue for us. My collaborators are getting the following error when running the newer version of pcangd (v1.21). We have converted an imputed vcf file (no missing data) to a bed file in plink, and we are running pcangsd --admix across multiple values of -e. The error, attached below, shows pcangsd is reading the plink file.

Parsing PLINK files.
Loaded 1872314 sites and 121 individuals.
Estimating minor allele frequencies.
Traceback (most recent call last):
File "/usr/local/Dist/anaconda-WGSassign/envs/WGSassign/bin/pcangsd", line 8, in
sys.exit(main())
File "/usr/local/Dist/anaconda-WGSassign/envs/WGSassign/lib/python3.10/site-packages/pcangsd/pcangsd.py", line 219, in main
f = shared.emMAF(L, args.maf_iter, args.maf_tole, args.threads)
File "/usr/local/Dist/anaconda-WGSassign/envs/WGSassign/lib/python3.10/site-packages/pcangsd/shared.py", line 50, in emMAF
alpha = -max(1.0, sqrt(sr2/sv2))
ZeroDivisionError: float division by zero

Note that I do not get this error when I run --admix on an earlier pcangsd version (1.11). We are using the same data set. Any ideas on why this would be happening with the newer version of pcangsd?

Thanks,

Christen

@Rosemeis
Copy link
Owner

Hi,

Sorry for the late reply. The issue arises after I added some speed-up, which assumes there are some missingness present. But I have just pushed an update here on GitHub. Let me know if it helped! :-)

Best,
Jonas

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

2 participants