Skip to content

ZeroDivisionError in assignLongReadToSNPs when samLines < 100 #9

@a-lud

Description

@a-lud

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions