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: division by zero #33

Open
seyfim opened this issue May 27, 2020 · 1 comment
Open

ZeroDivisionError: division by zero #33

seyfim opened this issue May 27, 2020 · 1 comment

Comments

@seyfim
Copy link

seyfim commented May 27, 2020

Hello @mdshw5 @ucpete @danielecook @tomsherborne @edawine , I am using python.2.7.12 and the following OS

CentOS release 6.5 (Final)
Cluster Manager v7.0
slave
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.5 (Final)
CentOS release 6.5 (Final)

I am getting the error

657,845,172 reads in input file.
Bin size (-s) set to 328.
Traceback (most recent call last):
  File "/cm/shared/apps/python/2.7.12/bin/fastqp", line 10, in <module>
    sys.exit(main())
  File "/cm/shared/apps/python/2.7.12/lib/python2.7/site-packages/fastqp/cli.py", line 412, in main
    run(arguments)
  File "/cm/shared/apps/python/2.7.12/lib/python2.7/site-packages/fastqp/cli.py", line 352, in run
    mismatchplot(positions, cycle_mismatch, zip_archive, fig_kw)
  File "/cm/shared/apps/python/2.7.12/lib/python2.7/site-packages/fastqp/plots.py", line 659, in mismatchplot
    for pos in positions
ZeroDivisionError: division by zero 

I checked the issues board, specifically the closed #26

(#26)

which had a "hack-ish" solution #28 . In the source code (current version) the plots.py does not contain the lines mentioned

(3648187)

. Please advise!

@mdshw5
Copy link
Owner

mdshw5 commented May 29, 2020

Hey @seyfim thanks for reporting this. I'll have to take a closer look and see what's causing your issue, but I do see that the change from #28 is still present in plots.py: https://github.com/mdshw5/fastqp/blob/master/fastqp/plots.py#L528-L529. Your error is coming from the "mismatch plot" code path (https://github.com/mdshw5/fastqp/blob/master/fastqp/plots.py#L648) which should only be called when SAM/BAM files are provided. I can see that I implemented a check for SAM input files (https://github.com/mdshw5/fastqp/blob/master/fastqp/cli.py#L216), and count mismatches when the SAM format records are mapped, but it looks like when I call the mismatch plot code I don't have a check to make sure we encountered some mapped reads. Are you by any chance passing unaligned SAM/BAM files to fastqp? If so that would be something I didn't properly account for.

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