Module output and customization
- Annotated Heatmap: a highly customizable heatmap to inspect patterns microbial feature abundances across your cohort.

Clustered heatmap of microbial species abundance across skin samples. Species are rows and samples are columns, with both clustered by profile similarity. Colour reports relative abundance, from dark for near zero to yellow for the highest values. The annotation bars above the heatmap label each sample by dermotype and body site, so clusters can be read against the metadata.
Read and customize the heatmap
Choose which features to show
A typical dataset can have hundreds or thousands of features, which makes it difficult to display them all on a single heatmap.- Limit how many rows appear by setting the Top features (N) parameter. For example, choosing 10 shows the top 10 features from the full matrix, ordered by your ranking method.
- Decide how features are ranked by choosing a criterion with the Feature Ranking Method parameter. This sorts the features and keeps the top N:
Set the cell values and colours
The cell is the basic unit of the heatmap. Each cell sits at the intersection of a microbial feature (rows by default) and a sample (columns by default), and its color indicates how abundant that feature is in that sample, with low and high values shown as opposite ends of the color scale.Setting the feature color palette
- Set the color palette for feature abundance using the Feature Color Palette dropdown.
Transforming abundance values
By default, when working with relative abundances (Analysis metric =relative_abundance), the color scale spans the full range (0 to 100%). This is intuitive, but microbiome data usually has a long tail of low-abundance features, where subtle - but informative - compostional patterns between your groups can be overshadowed by the high intensity of the dominant species.
The Value Scaling parameter transforms the values before they’re mapped to color. This is useful to ‘inflate’ low relative abundance values to make it easier to detect differences between low-abundance features:
Add sample and feature annotations
Annotations are colored bars above the sample columns that overlay metadata onto the heatmap, so you can track sample characteristics alongside the microbial data.Adding Sample (column) annotations
Use the Sample Annotation parameter to choose which metadata variables to add to the samples. Categorical variables (treatment group, body site, disease status) appear as distinct colors, and numerical variables (age, pH, BMI) appear as a graduated scale. The Drop samples with missing annotation option controls whether samples that lack the chosen annotation are removed.Adding Feature (row) annotations
You can also annotate the features (rows) to add context about the features themselves, such as taxonomic information or other feature-level attributes. Use the Feature Annotation parameter to choose which feature-level variables to display, and Drop features with missing annotation to decide whether unannotated features are kept.Order samples and features
The order of rows and columns decides which patterns you can see in the heatmap. You can order samples and features in two ways:- By annotation. Samples or features are sorted by the values of an annotation, or samples of the same group are merged into one column. Use it to read the heatmap against a variable you already know, for example treatment group or body site.
- By hierarchical clustering. The abundance profiles decide the order, so that similar samples or features sit next to each other. Use it to find groups you do not know in advance.
Order samples by annotation
Choose how samples are arranged with Sample Arrangement. This parameter appears after you select at least one Sample Annotation.Visit 10 before Visit 2, and capital letters before lowercase letters. When Drop samples with missing annotation is unchecked, missing values form a group called NaN_group, which is sorted with the other text values.Collapse samples by group
WithCollapse samples by group (mean), each column is a group of samples, and each cell shows the mean value of a feature across the samples of that group. The column label reports the group and its number of samples, for example caucasian (n=74), and the axis label changes to Sample groups. Samples In Ascending Order sets the order of the groups.
- The colour bar shows the mean, for example Mean Relative Abundance. With Value Scaling, the mean is calculated on the scaled values, for example the mean of the log10 values.
- With
Presence/Absencescaling, each cell shows the fraction of samples in the group where the feature is present. - The mean smooths extreme values, so the colour range is narrower than in a heatmap of single samples.
- Annotation bars whose values differ among the samples of a group are removed from the heatmap.
Order features by annotation
Choose how features are arranged with Feature Arrangement. This parameter appears after you select at least one Feature Annotation, which is available for taxonomic profiles.Order samples and features by hierarchical clustering
Clustering reorders rows and columns so that similar profiles sit next to each other, which reveals patterns that a fixed order would hide. The heatmap uses hierarchical clustering, a method that builds a tree (called a dendrogram) grouping samples or features by similarity. The Clustered Axis parameter sets whether you cluster samples, features, both, or neither. An axis that is sorted or collapsed by annotation is removed from the options.- Samples groups together samples with similar overall profiles. This is useful for seeing whether, for example, treatment and control samples separate. Paired with sample annotations, a cluster that matches a shared trait is a strong cue of a biological pattern.
- Features groups together features with similar abundance patterns across samples. This is useful for spotting co-occurring taxa that may share ecological niches or interactions.
- Samples and features reorganizes the heatmap so that co-abundant features align with similar samples, revealing blocks, which are sets of features that are characteristically high or low in a particular set of samples. This is often where the most informative patterns emerge, such as a microbial signature specific to a treatment or disease group.
Choosing the distance metric [Advanced]
Choose how the similarity between pairs of profiles or features should be measured in terms of beta-diversity by selecting Distance metric. To see which distance metrics are supported and how to choose, refer to Beta Diversity on the Cosmos-Hub 2.0Choose the linkage method [Advanced]
Choose Clustering method (linkage), which then sets how clusters are progressively merged into the tree. In hierarchical clustering, linkage defines how the distance between clusters is calculated at each step as they are merged into a tree (dendrogram). Different linkage methods use different rules for “cluster–cluster distance,” for exampleExport the heatmap
Scroll to the end of the output page and click Download Tables and Images to export the heatmap in .svg and .png format, and the data table with the numerical input used to plot it.Recommended parameters
Choose your profile. Hover an underlined value to see why it is recommended.Parameters by profile
- Kepler · WGS taxonomic
- CHAMP · WGS taxonomic
- 16S short-read taxonomic
- 16S long-read taxonomic
- Host-Agnostic functional
- CHAMP functional
Parameter reference
Features shown
Feature Ranking Method
Feature Ranking Method
mean, prevalence, variance, percentileDefault · meanSuggested ·percentileis a balanced option for features that are both abundant and informative.- Use
meanto prioritize highly abundant features prevalencefor features seen in many samplesvariancefor features that vary strongly across samples.
Top Features (N)
Top Features (N)
1 to 30Default · 10Suggested · 10 for a concise, readable heatmap; 20 to 30 for a broader exploratory view.Cell values and colours
Feature Color Palette
Feature Color Palette
viridisSuggested · Colorblind-friendly continuous palettes such as viridis for most heatmaps; alternatives like inferno when stronger contrast is needed.Value Scaling
Value Scaling
None, linear, log2, log10, asinh, clr, presence/absenceDefault · NoneSuggested ·None: display values as directly as possible, especially for relative abundance.log2/log10: reduce the visual dominance of highly abundant features.asinh: a log-like transform that handles zero values more easily.clr: a composition-aware transformation.presence/absence: reduces each cell to whether a feature is detected, ignoring how much.
Heatmap Orientation
Heatmap Orientation
features_rows, samples_rowsDefault · features_rowsSuggested · Use features_rows as standard. Use samples_rows when there are more features than samples, or when it improves readability.Annotations
Sample Annotation
Sample Annotation
NoneSuggested · Variables relevant to the biological question, such as treatment, disease status, body site, cohort, time point, age group, or sex. Annotations help interpret patterns, but selecting too many makes the figure harder to read.Drop samples with missing annotation
Drop samples with missing annotation
TRUE or FALSEDefault · TRUESuggested · Use TRUE when the annotation is essential and unannotated samples should be removed. Use FALSE to preserve sample size, or to see where unannotated samples cluster relative to annotated ones. With FALSE, unannotated samples are assigned to a default missing-value group.Feature Annotation
Feature Annotation
NoneSuggested · For taxonomic heatmaps, use a higher taxonomic level (phylum, class, family) to annotate lower-level features such as species.Drop Features with missing annotation
Drop Features with missing annotation
TRUE or FALSEDefault · FALSESuggested · Use FALSE for most taxonomic analyses, so unannotated features stay in the heatmap. Use TRUE to show only features that have an annotation.Order by annotation
Sample Arrangement
Sample Arrangement
None, Sort samples, Collapse samples by group (mean)Default · NoneSuggested · Sort samples to read the heatmap against a metadata variable while every sample stays visible. Collapse samples by group (mean) for a compact summary of a large cohort. None when you want to cluster the samples.Arrange Samples By
Arrange Samples By
None.Options · The columns selected in Sample AnnotationDefault · NoneSuggested · One categorical column, such as treatment, body site or disease status. Add a second column only to order the samples within the groups of the first one.Samples In Ascending Order
Samples In Ascending Order
TRUE (ascending) or FALSE (descending)Default · TRUEFeature Arrangement
Feature Arrangement
None, Sort featuresDefault · NoneSuggested · Sort features to place related taxa next to each other. None when you want to cluster the features.Arrange Features By
Arrange Features By
Sort features.Options · The columns selected in Feature AnnotationDefault · NoneSuggested · A taxonomic rank above the one displayed, for example genus or phylum for a heatmap of species.Features In Ascending Order
Features In Ascending Order
TRUE (ascending) or FALSE (descending)Default · TRUEClustering
Clustered Axis
Clustered Axis
None, Features, Samples, Samples and featuresDefault · NoneSuggested · Samples and features to find blocks of co-abundant features in groups of similar samples. Samples or Features to cluster one axis only, for example when the other axis is sorted by annotation. None to keep the original order or the order set by annotation.Distance Metric
Distance Metric
braycurtis, canberra, correlation, cosine, euclidean, jaccard, and othersDefault · euclideanClustering Method
Clustering Method
single, complete, average, centroid, median, ward, weightedDefault · singleReferences
- Jain, A. K., Murty, M. N. & Flynn, P. J. (1999). “Data clustering: a review.” ACM Computing Surveys, 31, 264-323. https://doi.org/10.1145/331499.331504