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 in assignLongReadToSNPs when samLines < 100 #9

Open
a-lud opened this issue Sep 29, 2021 · 1 comment
Open

ZeroDivisionError in assignLongReadToSNPs when samLines < 100 #9

a-lud opened this issue Sep 29, 2021 · 1 comment

Comments

@a-lud
Copy link

a-lud commented Sep 29, 2021

Hi,

I've come across an edge case whilst messing around with the tool. When the number of reads in the long-read alignment file is less than 100, the following code in function assignLongReadToSNPs() will fail:

if i%(int(len(samLines)/100)) == 0:
        print(int(i/len(samLines)*100)+1,"%")

If len(samLines)/100 returns a value less than 1, int() will turn it to a 0, which results in a ZeroDivisionError in the if conditional.

Cheers
Alastair

nPhase version: nPhase pipeline 1.1.3
Downloaded through conda

@OmarOakheart
Copy link
Owner

Nice catch!

There are probably a few other errors that can be caused by the same edge case. I'll fix it for the next update

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