First, I haven't used the pheatmap package, but if Kyle recommends it, it is probably good. To extract the matrix of OTU counts after importing from BIOM, the accessor function to use is:
otuTable(x)
Where `x` is your imported object. `x` will be a class that inherits directly from the standard "matrix" class, so it might work directly in whatever function. For example, the base heatmap function in R would work:
heatmap(otuTable(x))
If some other function is not working because it has hard-coded the expected class (or some other class issue), you can coerce it using:
as(otuTable(x), "matrix")
Secondly, the tools for plotting heatmap(s) of OTU abundances (or some transformation thereof) is easy to do with the `plot_heatmap` function in phyloseq. More explanation on the approach, and examples with code/results is provided on the following wiki page:
https://github.com/joey711/phyloseq/wiki/plot_heatmap
Kyle is right that it does not include dendrograms, but that is by design. The `plot_heatmap` function uses the same approach as in the NeatMap package, using ordination methods to organize the heatmap, rather than hierarchical clustering. The authors of NeatMap explain this in more detail in the following article:
http://www.biomedcentral.com/1471-2105/11/45
Basically, the dendrogram/tree representation of distances is too flexible for representing the a complex heatmap, and can easily lead to either confusing or misleading ordering of the columns/rows.