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

compute_core_microbiome.py fails in plotting step. #642

Closed walterst closed 11 years ago

walterst commented 11 years ago

Will get an error like the one posted at the end of this post if the OTU table has some non-shared OTUs (i.e. no shared OTUs across 95% of the samples).

This is due to otu_counts and fraction_for_core not having the same length. otu_counts has nothing appended to it when no OTUs are shared, and ends up being shorter than the fraction_for_core variable.

Quick fix: add: otu_counts.append(0) at line 109 of scripts/compute_core_microbiome.py

File "/home/fireantlabbfl/qiime_software/qiime-1.6.0-release/bin/compute_core_microbiome.py", line 148, in main() File "/home/fireantlabbfl/qiime_software/qiime-1.6.0-release/bin/compute_core_microbiome.py", line 135, in main plot(fractions_for_core, otu_counts) File "/home/fireantlabbfl/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/pyplot.py", line 2458, in plot ret = ax.plot(_args, _kwargs) File "/home/fireantlabbfl/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/axes.py", line 3848, in plot for line in self._get_lines(_args, _kwargs): File "/home/fireantlabbfl/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/axes.py", line 323, in _grab_next_args for seg in self._plot_args(remaining, kwargs): File "/home/fireantlabbfl/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/axes.py", line 300, in _plot_args x, y = self._xy_from_xy(x, y) File "/home/fireantlabbfl/qiime_software/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/axes.py", line 240, in _xy_from_xy raise ValueError("x and y must have same first dimension") ValueError: x and y must have same first dimension

insectnate commented 11 years ago

Thanks Greg works great!

gregcaporaso commented 11 years ago

@walterst, any chance you have a test file for this one?

walterst commented 11 years ago

Here is an OTU table that will fail without the fix: http://tajmahal.colorado.edu/tmp/tmpmoPGaeST7Aotu_table.biom.zip

walterst commented 11 years ago

Slight problem with this one-the unit test does do a test for a case where there isn't a core microbiome-but the scripts/compute_core_microbiome.py has the actual bug in how the output data are built before being written, which isn't tested.

gregcaporaso commented 11 years ago

OK, thanks! I'll work on this.