heatmapdmn: Heatmap representation of samples assigned to Dirichlet...

Description Usage Arguments Details Author(s) Examples

View source: R/dmn.R

Description

Produce a heat map summarizing count data, grouped by Dirichlet component.

Usage

1
2
heatmapdmn(count, fit1, fitN, ntaxa = 30, ...,
    transform = sqrt, lblwidth = 0.2 * nrow(count), col = .gradient)

Arguments

count

A matrix of sample x taxon counts, as supplied to dmn.

fit1

An instance of class dmn, from a model fit to a single Dirichlet component, k=1 in dmn.

fitN

An instance of class dmn, from a model fit to N != 1 components, k=N in dmn.

ntaxa

The ntaxa most numerous taxa to display counts for.

...

Additional arguments, ignored.

transform

Transformation to apply to count data prior to visualization; this does not influence mixture membership or taxnomic ordering.

lblwidth

The proportion of the plot to dedicate to taxanomic labels, as a fraction of the number of samples to be plotted.

col

The colors used to display (possibly transformed, by transform) count data, as used by image.

Details

Columns of the heat map correspond to samples. Samples are grouped by Dirichlet component, with average (Dirichlet) components summarized as a separate wide column. Rows correspond to taxonomic groups, ordered based on contribution to Dirichlet components.

Author(s)

Martin Morgan mailto:mtmorgan@fhcrc.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## counts
fl <- system.file(package="DirichletMultinomial", "extdata",
                  "Twins.csv")
count <- t(as.matrix(read.csv(fl, row.names=1)))

## all and best-fit clustering
data(fit)
lplc <- sapply(fit, laplace)
best <- fit[[which.min(lplc)]]

heatmapdmn(count, fit[[1]], best, 30)

Example output

Loading required package: S4Vectors
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package:BiocGenericsThe following objects are masked frompackage:parallel:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, append, as.data.frame, basename, cbind, colnames,
    dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
    grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
    rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which.max, which.min


Attaching package:S4VectorsThe following object is masked frompackage:base:

    expand.grid

Loading required package: IRanges

DirichletMultinomial documentation built on Nov. 8, 2020, 7 p.m.