Heatmaps problem empty distance matrix

399 views
Skip to first unread message

Alice Lévesque

unread,
Apr 26, 2017, 9:53:10 PM4/26/17
to Qiime 1 Forum
Hello,

I want to produce a heatmap from a OTU table using a mapping file. 
However, I obtain that error message :
File "/prg/python/2.7/lib/python2.7/site-packages/scipy/spatial/distance.py", line 1718, in num_obs_y
    raise ValueError("The number of observations cannot be determined on "
ValueError: The number of observations cannot be determined on an empty distance matrix.

At first sight, I don't see any problem with my biom file (attached to that message)...

What do you think?

Thanks,

Alice Lévesque
g23_abund.biom

zhiying Guo

unread,
Apr 27, 2017, 12:10:52 AM4/27/17
to Qiime 1 Forum
Hello Alice,

your BIOM table does not contain any observation metadata (e.g., taxonomy). 
You can add metadata to it using the 'biom add-metadata' command.

Zhiying Guo

Alice Lévesque

unread,
Apr 27, 2017, 11:18:04 AM4/27/17
to Qiime 1 Forum
Hello,

I know, I did not add taxonomy to my data (neither any other metadata). I am using the OTU table with OTUs in row, and samples in column. 

I convert my OTU table (.txt)  into biom file using the biom convert command. It always worked this way. Here I put an exemple of one BIOM table that worked in previous analysis. 

What is the difference between those two tables? Because there might be a difference to cause an error message with the first table...

Thanks

Alice
g23.biom

Greg Caporaso

unread,
Apr 27, 2017, 8:05:27 PM4/27/17
to Qiime 1 Forum
Hi Alice,
I'm not able to reproduce this issue - make_otu_heatmap.py works for me on the file that you sent. I ran the following command, and it generated the attached heatmap.

make_otu_heatmap.py -i g23_abund.biom -o heatmap.pdf

Are you using QIIME 1.9.1? If not, I would recommend switching to QIIME 1.9.1 (you can follow our new conda install instructions, which make installation a lot easier) and trying this again. Or, if you are using QIIME 1.9.1, can you reply with the output of running print_qiime_config.py, and with the exact command that you ran? 

Best,
Greg
heatmap.pdf

Alice Lévesque

unread,
Apr 28, 2017, 1:43:37 PM4/28/17
to Qiime 1 Forum
Hi Greg, 

Yes, I am using QIIME v1.9.1. 

Actually, first I wanted to run the heatmap with a mapping file  and then it produced the error message.

make_otu_heatmaps.py -i g23_abund.biom -o g23_abund.pdf -m g23-mapping2.txt -c ORDER 

When I don't put any mapping file like you did (which I did not try before.. my bad...), there is no problem! So apparently, the "empty distance matrix" in the error message was from the mapping file, not the biom table as I thought...
I will try to find a different way to prepare my mapping file.

Thanks a lot!!

Best regards,

Alice Levesque
g23-mapping2.txt

Greg Caporaso

unread,
Apr 28, 2017, 9:59:16 PM4/28/17
to Qiime 1 Forum
Hi Alice,
Thanks for the additional information, I am able to reproduce this now. I've poked around a little bit, but I haven't yet figured out what the problem is. I need to run for the day, but I'll get back to you on this on Monday. Sorry for the trouble! 

Greg

Greg Caporaso

unread,
May 1, 2017, 7:36:07 PM5/1/17
to Qiime 1 Forum
Hi Alice,
I was able to take another look at this today. The sorting based on the mapping file column doesn't work exactly as you (and I) were thinking. This is intended to be used with a categorical variable, not a continuous variable, so your order column won't work for this.

I think what you're trying to do is sort the samples on the horizontal axis of your heatmap based on the "ORDER" column in your sample metadata file. To do this, you should use the -m option to make_otu_heatmap.py without the -c option (see the usage examples when you call make_otu_heatmap.py -h). The mapping file that you pass should be sorted in the reverse order that you want the samples to appear (there appears to be a bug in the script, where the first samples in the mapping file will be the rightmost samples on the horizontal axis of the heatmap). 

I've attached the mapping file that I created for this. The command I ran was as follows:

make_otu_heatmap.py -i g23_abund.biom -o g23_abund.pdf -m g23-mapping2.txt

I've also attached the resulting heatmap. 

Sorry for the trouble, I hope this gets you what you need! 

Best,
Greg
g23-mapping2.txt
g23_abund.pdf
Reply all
Reply to author
Forward
0 new messages