Description Usage Arguments Value See Also Examples
Create a heatmap of OTU counts.
1 2 3 | otu_heatmap(otu_counts, assignments, threshold = 0, plot = T,
color = saturated_rainbow(100), breaks = c(0, 1e-10, seq(0.001, 1,
length.out = 100)), ...)
|
otu_counts |
A matrix of OTU counts, one row per OTU and one column per sample. |
assignments |
A character vector of OTU assignments. Length should match number of rows in otu_counts. |
threshold |
Minimum number of OTU counts necessary for an assignment to be included in the heatmap. Assignments are filtered after calculating the proportions, so the threshold setting does not affect the display of the remaining OTUs. |
plot |
If true, display a plot. If false, just return the computed abundances. |
color |
Vector of colors to use in the heatmap. |
breaks |
Vector of color breaks, one element greater in length than 'colors'. |
... |
Additional arguments are passed to the pheatmap function. |
A heatmap plot of the proportions of assignments in each sample, and invisibly returns a matrix of the proportions in the plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | data(relmbeta_assignments)
data(relmbeta_counts)
a <- simplify_assignments(split_assignments(relmbeta_assignments))
## Not run:
otu_heatmap(relmbeta_counts, a, threshold=10)
otu_heatmap(
relmbeta_counts, a, threshold=10,
cluster_rows=FALSE, cluster_cols=FALSE,
cellwidth=12, cellheight=12)
## End(Not run)
heatmap_data <- otu_heatmap(relmbeta_counts, a, threshold=10, plot=FALSE)
head(heatmap_data)
|
A1 A2 A3 A4 A5 B1 B2 B3
Bacteria 0.128 0.110 0.090 0.072 0.132 0.084 0.060 0.112
Bacteroidetes 0.686 0.692 0.704 0.700 0.552 0.356 0.556 0.652
Bacteroidetes Alistipes 0.054 0.022 0.066 0.048 0.112 0.100 0.030 0.038
Bacteroidetes Bacteroidales 0.018 0.020 0.024 0.024 0.010 0.034 0.072 0.030
Bacteroidetes Bacteroides 0.030 0.018 0.026 0.024 0.018 0.140 0.154 0.050
Bacteroidetes Odoribacter 0.000 0.010 0.004 0.000 0.012 0.002 0.002 0.020
B4 B5 C1 C2 C3 C4 C5 D1
Bacteria 0.080 0.076 0.176 0.144 0.188 0.074 0.030 0.212
Bacteroidetes 0.674 0.584 0.380 0.132 0.236 0.016 0.110 0.222
Bacteroidetes Alistipes 0.036 0.064 0.038 0.042 0.032 0.014 0.160 0.012
Bacteroidetes Bacteroidales 0.046 0.056 0.000 0.000 0.000 0.000 0.000 0.000
Bacteroidetes Bacteroides 0.050 0.098 0.098 0.006 0.050 0.004 0.048 0.090
Bacteroidetes Odoribacter 0.008 0.004 0.000 0.000 0.000 0.000 0.002 0.002
D2 D3 D4 D5
Bacteria 0.124 0.086 0.148 0.168
Bacteroidetes 0.154 0.136 0.336 0.232
Bacteroidetes Alistipes 0.014 0.016 0.034 0.048
Bacteroidetes Bacteroidales 0.000 0.000 0.000 0.000
Bacteroidetes Bacteroides 0.008 0.016 0.034 0.028
Bacteroidetes Odoribacter 0.000 0.000 0.000 0.000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.