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

An ZeroDivisionError when I run fastqp.py #26

Closed
EnzoAndree opened this issue May 28, 2017 · 8 comments
Closed

An ZeroDivisionError when I run fastqp.py #26

EnzoAndree opened this issue May 28, 2017 · 8 comments
Assignees
Labels

Comments

@EnzoAndree
Copy link

EnzoAndree commented May 28, 2017

Dear, I just install fastqp and an error occurred when i run the script, this is the error.

fastqp Sanger_F_sample.fastq
At 2186 bytes per read of 1086 length we estimate 96 reads in input file.
Bin size (-s) set to 1.
Traceback (most recent call last):
File "/usr/local/bin/fastqp", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/fastqp/cli.py", line 370, in main
run(arguments)
File "/usr/local/lib/python2.7/site-packages/fastqp/cli.py", line 270, in run
cycle_nuc[i]['T']]) * 100 for i in positions]
ZeroDivisionError: integer division or modulo by zero

Any idea why this error occurred?
I use OSx, python 2.7.13 and a sample of the fastq file is on the attachment.

Regards
Sanger_F.fastq.zip

@EnzoAndree EnzoAndree changed the title An ZeroDivisionError when i run fastqp.py An ZeroDivisionError when I run fastqp.py May 28, 2017
@mdshw5
Copy link
Owner

mdshw5 commented May 29, 2017

Thanks for reporting this, and for sending the test data! I think I know what's going on here, but give me a day or two to push a new version with the fix.

@mdshw5 mdshw5 self-assigned this May 29, 2017
@mdshw5 mdshw5 added the bug label May 29, 2017
@mdshw5
Copy link
Owner

mdshw5 commented May 31, 2017

I've just pushed a fix, and a new version (0.3) to PyPI. You should update using python install --upgrade fastqp and then give it another shot. Here's an example plot from the test data you sent:
quality_score_quantiles

@EnzoAndree
Copy link
Author

WoW @mdshw5, it looks awesome. Nevertheless i can't get the full output of fastqp, I get this error.

Sanger_F.fastq NNNNN None 2748.42
/usr/local/lib/python2.7/site-packages/matplotlib/artist.py:879: MatplotlibDeprecationWarning: The set_axis_bgcolor function was deprecated in version 2.0. Use set_facecolor instead.
return func(v)
Traceback (most recent call last):
File "/usr/local/bin/fastqp", line 11, in
load_entry_point('fastqp==0.3.1', 'console_scripts', 'fastqp')()
File "/usr/local/lib/python2.7/site-packages/fastqp/cli.py", line 409, in main
run(arguments)
File "/usr/local/lib/python2.7/site-packages/fastqp/cli.py", line 348, in run
kmerplot(positions, cycle_kmers, zip_archive, [fields[0] for fields in bad_kmers], fig_kw)
File "/usr/local/lib/python2.7/site-packages/fastqp/plots.py", line 493, in kmerplot
'axis_bgcolor': 'white'}, **fig_kw)
File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 1211, in subplots
ax0 = fig.add_subplot(gs[0, 0], **subplot_kw)
File "/usr/local/lib/python2.7/site-packages/matplotlib/figure.py", line 1021, in add_subplot
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/axes/_subplots.py", line 73, in init
self._axes_class.init(self, fig, self.figbox, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 526, in init
self.spines = self._gen_axes_spines()
File "/usr/local/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 963, in _gen_axes_spines
('left', mspines.Spine.linear_spine(self, 'left')),
File "/usr/local/lib/python2.7/site-packages/matplotlib/spines.py", line 469, in linear_spine
result = cls(axes, spine_type, path, **kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/spines.py", line 54, in init
super(Spine, self).init(**kwargs)
File "/usr/local/lib/python2.7/site-packages/matplotlib/patches.py", line 126, in init
self.set_facecolor(facecolor)
File "/usr/local/lib/python2.7/site-packages/matplotlib/patches.py", line 334, in set_facecolor
self._set_facecolor(color)
File "/usr/local/lib/python2.7/site-packages/matplotlib/patches.py", line 324, in _set_facecolor
self._facecolor = colors.to_rgba(color, alpha)
File "/usr/local/lib/python2.7/site-packages/matplotlib/colors.py", line 139, in to_rgba
c = colors[int(c[1]) % len(colors)]
ZeroDivisionError: integer division or modulo by zero

and ONLY this plots:

cycle_specific_base_composition.png
cycle_specific_gc.png
gc_distribution.png
quality_score_distribution.png
quality_score_heatmap.png
quality_score_quantiles.png
read_length_distribution.png

dear @mdshw5, this error appear only to me?

Regards

@kdoroschak
Copy link

@EnzoAndree @mdshw5 I am running across the same (more recent) issue, and can reproduce it on the above sample fastq file on fastqp (0.3.1).

@mdshw5
Copy link
Owner

mdshw5 commented Sep 6, 2017

I'll take a look and see if I can reproduce it. Can I ask what python version you're running?

@kdoroschak
Copy link

python 2.7.13 Anaconda 64-bit

@ghost
Copy link

ghost commented Oct 7, 2017

@mdshw5 The problem is caused by an empty list if there are no "bad kmers". I have pushed a (hack-ish) solution #28 that will (temporarily) solve the problem until a better way is found.

@mdshw5
Copy link
Owner

mdshw5 commented Oct 8, 2017

Thanks @edawine for taking the time to look in to this. I'll merge your changes and push a new release! I do think an empty list is the correct solution, since I'm using a test of nonlinearity to define over-represented kmers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants