biocore / qiime

Official QIIME 1 software repository. QIIME 2 (https://qiime2.org) has succeeded QIIME 1 as of January 2018.
GNU General Public License v2.0
285 stars 268 forks source link

summarize_taxa_through_plots.py - fails on OTU table containing samples with zero OTUs #219

Closed gregcaporaso closed 11 years ago

gregcaporaso commented 11 years ago

summarize_taxa_through_plots.py fails with the following error message when given an OTU table that contains one or more samples with zero OTUs (i.e. zero seqs/sample):

Traceback (most recent call last):
  File "/home/ubuntu/qiime_software/qiime-1.5.0-release/bin/plot_taxa_summary.py", line 284, in <module>
    main()
  File "/home/ubuntu/qiime_software/qiime-1.5.0-release/bin/plot_taxa_summary.py", line 280, in main
    resize_nth_label,label_type,include_html_legend,include_html_counts)
  File "/home/ubuntu/qiime_software/qiime-1.5.0-release/lib/qiime/plot_taxa_summary.py", line 1143, in make_all_charts
    include_html_counts))
  File "/home/ubuntu/qiime_software/qiime-1.5.0-release/lib/qiime/plot_taxa_summary.py", line 1082, in get_counts
    label_type,include_html_legend,include_html_counts))
  File "/home/ubuntu/qiime_software/qiime-1.5.0-release/lib/qiime/plot_taxa_summary.py", line 847, in make_HTML_table
    props = {'title':title})
  File "/home/ubuntu/qiime_software/qiime-1.5.0-release/lib/qiime/plot_taxa_summary.py", line 622, in make_area_bar_chart
    facecolor=background_color)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/pyplot.py", line 471, in savefig
    return fig.savefig(*args, **kwargs)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/figure.py", line 1172, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2017, in print_figure
    **kwargs)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1789, in print_pdf
    return pdf.print_pdf(*args, **kwargs)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 2179, in print_pdf
    self.figure.draw(renderer)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/figure.py", line 884, in draw
    func(*args)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/axes.py", line 1983, in draw
    a.draw(renderer)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/patches.py", line 413, in draw
    renderer.draw_path(gc, tpath, affine, rgbFace)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 1425, in draw_path
    rgbFace is None and gc.get_hatch_path() is None)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 1255, in writePath
    cmds = self.pathOperations(path, transform, clip, simplify=simplify)
  File "/home/ubuntu/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 1232, in pathOperations
    raise ValueError, 'Path lacks initial MOVETO'
ValueError: Path lacks initial MOVETO

matplotlib has issues with rendering PDFs with empty datasets (in this case, a sample with no sequences and thus no taxonomic information).

The current workaround is to use filter_samples_from_otu_table.py to remove the offending samples.

gregcaporaso commented 11 years ago

Imported from trac issue 219. Created by jrideout on 2012-08-02T10:33:39, last modified: 2012-08-02T10:33:39

gregcaporaso commented 11 years ago

Not urgent as we have a workaround.

gregcaporaso commented 11 years ago

Just ran into this again, should definitely be fixed for 1.7.0.

gregcaporaso commented 11 years ago

Anyone have time to work on a fix for this?