nPhase icon indicating copy to clipboard operation
nPhase copied to clipboard

ZeroDivisionError in assignLongReadToSNPs when samLines < 100

Open a-lud opened this issue 2 years ago • 1 comments

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

a-lud avatar Sep 29 '21 02:09 a-lud