humann2_barplot ValueError

163 views
Skip to first unread message

brianf...@gmail.com

unread,
Jul 13, 2018, 2:49:17 PM7/13/18
to HUMAnN Users
Hello,

I am trying to create a barplot from a humann2 pathabundance.tsv and get the following error:

Traceback (most recent call last):
File "/Users/carlsonlab/anaconda2/bin/humann2_barplot", line 11, in <module>
load_entry_point('humann2==0.11.1', 'console_scripts', 'humann2_barplot')()
File "/Users/carlsonlab/anaconda2/lib/python2.7/site-packages/humann2/tools/humann2_barplot.py", line 336, in main
exclude_unclassified=args.exclude_unclassified,
File "/Users/carlsonlab/anaconda2/lib/python2.7/site-packages/humann2/tools/humann2_barplot.py", line 217, in __init__
self.update( )
File "/Users/carlsonlab/anaconda2/lib/python2.7/site-packages/humann2/tools/humann2_barplot.py", line 220, in update
self.nrows, self.ncols = self.data.shape
ValueError: need more than 1 value to unpack

It appears that for some samples the "values" variable in FeatureTable.__init__ is not being initialized properly and the resulting values passed to self.nrows, self.ncols = (0,)

Command Run:
humann2_barplot.py -i PWY-6126.tsv -f PWY-6126 -m Antibiotics -l Antibiotics -k PuBu -o PWY-6126.png


Thank you,
Brian

Eric Franzosa

unread,
Jul 16, 2018, 7:02:26 PM7/16/18
to humann...@googlegroups.com
Hi Brian,

It's not obvious to me from the error message alone what the root cause is. If you're willing to share your input file with me (feel free to reply individually) I would be happy to take a closer look.

Thanks,
Eric

Brian Fochtman

unread,
Jul 17, 2018, 10:45:52 AM7/17/18
to humann...@googlegroups.com
Thanks Eric. On the interface I could not find a way to attach a file.
I've attached one example that fails.
PWY-6126.tsv

Eric Franzosa

unread,
Jul 17, 2018, 10:55:03 AM7/17/18
to humann...@googlegroups.com
OK, I think I see the issue. The barplot script is specifically looking to plot the stratifications of a function, and it looks like you're only giving in the community total (possibly because there were no stratifications)? For example, if you have a function A:

Feature Abund
A          10   
A|1         6
A|2         4

The script would actually just be plotting the stratified values (6 and 4) and not using the total. I will fix the script so that it gives a more helpful error message in this case.

Thanks,
Eric

Brian Fochtman

unread,
Jul 17, 2018, 10:57:06 AM7/17/18
to humann...@googlegroups.com
Thank you for your help.
Reply all
Reply to author
Forward
0 new messages