We will be offering an R workshop December 18-20, 2019. Learn more.


From mothur
Revision as of 18:34, 27 January 2010 by Westcott (Talk | contribs) (Options)

Jump to: navigation, search

The heatmap.sim command will generate a heatmap indicating the pairwise similarity between multiple samples using a variety of calculators comparing community membership and structure. As an example, we will use the example from the Sogin data analysis example.

Default settings

Before running the heatmap.sim command shared OTU data must be read into mothur by one of two methods:

mothur > read.otu(list=read.otu(list=sogin.unique.good.filter.fn.list, group=sogin.good.groups)


mothur > read.otu(shared=sogin.unique.good.filter.fn.shared)

Then running the following command will generate the heatmaps for the jest and thetayc calculators for each line in the list or shared file

mothur > heatmap.sim()



To read in a phylip-formatted distance matrix you need to use the phylip option:

mothur > read.dist(phylip=98_sq_phylip_amazon.dist)


mothur > read.dist(phylip=98_lt_phylip_amazon.dist)

Whereas dotur required you to indicate whether the matrix was square or lower-triangular, mothur is able to figure this out for you.

Once you execute the command, mothur reads in the matrix and generates a progress bar:

mothur > read.dist(phylip=98_lt_phylip_amazon.dist)
Reading matrix:    |||||||||||||||||||||||||||||||||||||||||||||||||||

At this point the distance matrix is stored into memory for downstream analyses.

column & name

To read in a column-formatted distance matrix you must provide a filename for the name option:


The calc parameter will allow you to use any of the similarity calculators provided within mothur to generate heatmaps comparing the membership or structure of your samples. For example, the following command will generate heatmaps for the classical Sorenson index, Yue & Clayton's theta, and the Morisita-Horn index:

mothur > heatmap.sim(calc=sorclass-thetayc-morisitahorn)


At this point, if you run the following command:

mothur > get.group()

You would have seen that there were 8 groups here: 112R, 115R, 137, 138, 53R, 55R, FS312, and FS396. Say you just wanted to generate a heatmap for the seawater samples without the diffuse flow samples (i.e. FS312 and FS396). You could then use the groups option:

mothur > heatmap.sim(groups=112R-115R-137-138-53R-55R)


There may only be a couple of lines in your OTU data that you are interested in generating a heatmap diagram for. There are two options. You could: (i) manually delete the lines you aren't interested in from you list or shared file; (ii) or use the label option. If you only want to read in the data for the lines labeled unique, 0.03, 0.05 and 0.10 you would enter:

mothur > heatmap.sim(label=unique-0.03-0.05-0.10)