taxa_heatmap | R Documentation |
Display taxa abundances as a heatmap.
taxa_heatmap(
biom,
rank = -1,
taxa = 6,
grid = "bilbao",
color.by = NULL,
order.by = NULL,
other = FALSE,
unc = "singly",
lineage = FALSE,
label = TRUE,
label_size = NULL,
rescale = "none",
trees = TRUE,
clust = "complete",
dist = "euclidean",
asp = 1,
tree_height = 10,
track_height = 10,
legend = "right",
title = NULL,
xlab.angle = "auto",
...
)
biom |
An rbiom object, such as from |
rank |
What rank(s) of taxa to display. E.g. |
taxa |
Which taxa to display. An integer value will show the top n
most abundant taxa. A value 0 <= n < 1 will show any taxa with that
mean abundance or greater (e.g. |
grid |
Color palette name, or a list as expected |
color.by |
A character vector of metadata fields to display as tracks
at the top of the plot. Or, a list as expected by the |
other |
Sum all non-itemized taxa into an "Other" taxa. When
|
unc |
How to handle unclassified, uncultured, and similarly ambiguous taxa names. Options are:
Default: |
lineage |
Include all ranks in the name of the taxa. For instance,
setting to |
label |
Label the matrix rows and columns. You can supply a list
or logical vector of length two to control row labels and column
labels separately, for example
|
label_size |
The font size to use for the row and column labels. You
can supply a numeric vector of length two to control row label sizes
and column label sizes separately, for example
|
rescale |
Rescale rows or columns to all have a common min/max.
Options: |
trees |
Draw a dendrogram for rows (left) and columns (top). You can
supply a list or logical vector of length two to control the row tree
and column tree separately, for example
|
clust |
Clustering algorithm for reordering the rows and columns by
similarity. You can supply a list or character vector of length two to
control the row and column clustering separately, for example
Default: |
dist |
Distance algorithm to use when reordering the rows and columns
by similarity. You can supply a list or character vector of length
two to control the row and column clustering separately, for example
Default: |
asp |
Aspect ratio (height/width) for entire grid.
Default: |
tree_height , track_height |
The height of the dendrogram or annotation
tracks as a percentage of the overall grid size. Use a numeric vector
of length two to assign |
legend |
Where to place the legend. Options are: |
title |
Plot title. Set to |
xlab.angle |
Angle of the labels at the bottom of the plot.
Options are |
... |
Additional arguments to pass on to ggplot2::theme(). |
A ggplot2
plot.
The computed data points and ggplot
command are available as $data
and $code
,
respectively.
Other taxa_abundance:
taxa_boxplot()
,
taxa_corrplot()
,
taxa_stacked()
,
taxa_stats()
,
taxa_sums()
,
taxa_table()
Other visualization:
adiv_boxplot()
,
adiv_corrplot()
,
bdiv_boxplot()
,
bdiv_corrplot()
,
bdiv_heatmap()
,
bdiv_ord_plot()
,
plot_heatmap()
,
rare_corrplot()
,
rare_multiplot()
,
rare_stacked()
,
stats_boxplot()
,
stats_corrplot()
,
taxa_boxplot()
,
taxa_corrplot()
,
taxa_stacked()
library(rbiom)
# Keep and rarefy the 10 most deeply sequenced samples.
hmp10 <- rarefy(hmp50, n = 10)
taxa_heatmap(hmp10, rank = "Phylum", color.by = "Body Site")
taxa_heatmap(hmp10, rank = "Genus", color.by = c("Sex", "Body Site"))
taxa_heatmap(hmp10, rank = "Phylum", color.by = list(
'Sex' = list(colors = c(Male = "#0000FF", Female = "violetred")),
'Body Site' = list(colors = "muted", label = "Source") ))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.