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

beta_diversity.py error #96

Open
Kamouyiaraki opened this issue Jun 4, 2024 · 0 comments
Open

beta_diversity.py error #96

Kamouyiaraki opened this issue Jun 4, 2024 · 0 comments

Comments

@Kamouyiaraki
Copy link

Hey,

I've got this error popping up when I run this:

python ../../bin/KrakenTools-master/DiversityTools/beta_diversity.py -i input1.kreport input2.kreport.... --type kreport2 --level G > betadiv.out

Traceback (most recent call last):
  File "/mnt/shared/scratch/PWD/../../bin/KrakenTools-master/DiversityTools/beta_diversity.py", line 242, in <module>
    main()
  File "/mnt/shared/scratch/PWD/../../bin/KrakenTools-master/DiversityTools/beta_diversity.py", line 209, in main
    bc_ij = 1.0 - (2.0*C_ij)/float(i_tot+j_tot))
ZeroDivisionError: float division by zero

It works fine when I remove --level G and when I remove samples with only a single hit to a lower level (S). I've attached an example. This leads me to believe that it's not collapsing lower levels into counts when you specify level. looks like when specifying level it doesn't include any counts from lower ranks.

Any chance there is a quick way to fix this or this has been encountered and solved before? I am losing out on counts when I want to collapse taxonomy to Genus level or Family level which is less than ideal.

Many thanks!
input1.kreport.txt

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