-
Notifications
You must be signed in to change notification settings - Fork 41
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
Popgen error AttributeError: 'str' object has no attribute 'decode' #492
Comments
Hello, thank you for pointing this out and for giving such a detailed bug report. The 'decode' error is an old py2.7/py3 compatibility issue, and yes the fix that you propose in the code snippet would be my suggested way to handle it. The divide by zero error is a different problem that's coming from some other part of the code, so if you could post the traceback for it that would be helpful. In general, the popgen module is not the most complete of the analysis tools, so I would not be surprised if there still were some bugs in it. |
|
Hm, well it looks like this would only ever happen if the number of loci that is being processed is zero. Can you show me the cell where you create the 'Popgen' instance and also the output from that cell? If you pass in an imap or minmap that is too restrictive it will cause all the loci to be removed, and then the run will crash. |
In:
out:
|
Yes, well you can see here this is exactly what's happening:
You have 0 loci that are shared among all samples (as from your stats file):
If you pass in a population map file and no 'minmap' then it defaults to 4 samples per population (a somewhat permissive lower bound for calculating popgen sumstats). More importantly than this, the popgen analysis tool will calculate population summary statistics, and if your 'populations' you are assigning have only one or 2 individuals, you're not really going to get meaningful results. |
I run popgen following the cookbook-popgen-sumstats.ipynb .
Then the error occured.
And as you said in https://github.com/eaton-lab/tetrad/issues/5#issuecomment-872811206 , I modified the similar lines, which contain ".decode", in the popgen.py and locus_extracter.py , because these line has the same AttributeError as above.
But, it is not useful, because I got a new error "ZeroDivisionError: float division by zero" Traceback in the utils.py lines 201.
So, is the script for this function not complete now?
The text was updated successfully, but these errors were encountered: