Learn R Programming

RAM (version 1.2.1.3)

dissim.heatmap: Plot Distance Matrix Heatmap for OTU Samples

Description

This function consumes an OTU table, along with some optional parameters, and creates a heatmap showing the distance matrix for the samples of the given OTU table.

Usage

dissim.heatmap(data, is.OTU=TRUE, meta=NULL, row.factor=NULL, col.factor=NULL, stand.method="chi.square", dissim.method="euclidean", file=NULL, ext=NULL, height=8, width=9, leg.x=-0.05, leg.y=0)

Arguments

data
the OTU table to be used.
is.OTU
logical. Whether or not the data is an OTU table.
meta
the metadata table to be used.
row.factor
a factor from the metadata to show along the rows of the heatmap (see Details below).
col.factor
a factor from the metadata to show along the columns of the heatmap (see Details below).
stand.method
a method used to standardize the OTU table. One of "total", "max", "freq", "normalize", "range", "standardize", "pa", "chi.square", "hellinger" or "log" (see ?decostand).
dissim.method
the dissimilarity index to be used; one of "manhattan", "euclidean", "canberra", "bray", "kulczynski", "jaccard", "gower", "altGower","morisita", "horn", "mountford", "raup", "binomial", "chao", or "cao" (see ?vegdist).
file
the file path where the image should be created (see ?RAM.plotting).
ext
the file type to be used; one of "pdf", "png", "tiff", "bmp", "jpg", or "svg".
height
the height of the image to be created (in inches).
width
the width of the image to be created (in inches).
leg.x
how far the legend should be inset, on the x axis.
leg.y
how far the legend should be inset, on the y axis.

Details

Both row.factor and col.factor should be named character vectors specifying the names of the rows to be used from meta (see RAM.factors). They should also be factors; if they are not, a warning is raised and they are coerced to factors (see factor). A warning is also raised when a factor has more than 8 levels, as that is the most colours the current palettes support. The factor must also correspond to the OTU table; i.e. they should have the same samples. If not, an error is raised.

See Also

decostand, vegdist, factor, heatmap.2, RAM.factors

Examples

Run this code
data(ITS1, meta)
# plot to the screen with one meta factor and standard
# calculation methods
dissim.heatmap(ITS1, is.OTU=TRUE, meta=meta, 
               row.factor=c(Plot="Plots"))
## Not run: 
# # plot the heatmap to a .tiff file using Hellinger 
# # standardization and Manhattan distances
# dissim.heatmap(ITS1, dissim.method="manhattan",
#                stand.method="hellinger",
#                file="my/sample/path", ext="tiff")## End(Not run)

Run the code above in your browser using DataLab