Skip to main content
The Bar Chart module lets you inspect and compare the measured values of single compounds across metabolomic samples. Use it to check the quality of a measurement against its limits, to spot outlier samples, and to visually assess whether the amount of a compound is different across your groups of interest. This module generates a bar chart for each compound, with one bar per sample. Each chart shows how the amount of one compound varies across the samples of the current Data Table. To learn how metabolomics Data Tables are structured, see Metabolomics Data.

Run the analysis

1. Set Pre-processing parameters

Depending on the type of Metabolomics Data Table (targeted quantified or peak values, untargeted peak values ), set the pre-processing parameters, following the recommended parameters. See Pre-processing Metabolomics Data for more details on the pre-processing parameters for metabolomics.

2. Choose the value scale

Set Value scale to choose whether the y-axis of the bars reports the abundance of the compound in its original scale (raw) or after pre-processing (processed, after normalization, transformation and scaling). Each compound is measured on its own scale and in its own units, so the module draws one chart per compound.
  • Use raw to read amounts in their original units, for example the concentrations of a targeted panel, and to check each sample against the limits of detection and quantification of the compound.
  • Use processed when the raw values of different samples are not directly comparable, for example peak areas that also depend on the amount of sample extracted. It also shows the compound as the other metabolomics modules analyse it, which helps to explain their results.
Try both options in the interactive bar chart below.

raw (default)

The scale of the bar chart is as reported in the Data Table, for example concentrations in mM. Use it to read amounts in their original units and to compare them with the LOD.

processed

The values after Normalization, Transformation and Scaling, the same values that the other metabolomics modules analyse.
With raw, check Show LOD/LOQ/ULOQ reference lines to draw the limits of the compound on each chart.
Reference lines are drawn only with raw values. After normalization, each sample is divided by its own factor, so a single limit no longer sits at the same height for every sample.

3. Choose which compounds to show

A Metabolomics Data Table can hold measurements for thousands of compounds. The Bar Chart module displays charts for a limited number of top-ranked compounds.
  • Set Feature ranking method to choose how the compounds are ranked.
    • mean puts first the compounds with the highest average amount, the most abundant ones.
    • prevalence puts first the compounds detected in the most samples, above the LOD.
    • variance puts first the compounds whose amount varies most between samples, which are often those that differ between groups.
    • percentile puts first the compounds with the highest 90th percentile, which also catches compounds that are high in a subset of samples only.
  • Set Top features (N) to choose how many compounds, from the top of this ranking, get a chart. All N charts are created and exported.
  • Set Max Figures to Display to choose how many of these N charts are shown on screen. The charts that are not shown are still included in the export.
Example With Feature ranking method set to mean, Top features (N) set to 10 and Max Figures to Display set to 5, the module ranks the compounds by their mean across the cohort and creates charts for the top 10. It shows the first 5 on screen and exports all 10.

4. Annotate and arrange the samples

Set Sample Annotation to the metadata fields of your study design, such as treatment or time point. Each field becomes a coloured track above the bars, so you can tell at a glance whether high or low values of a compound come from one group, for example treated mice or a single visit. By default, the samples follow the order of the Data Table, so the samples of one group can be scattered along the x-axis. Arranging the samples by metadata places the samples of each group next to each other, which makes differences between groups and trends over time easier to see. Set Sample arrangement to:
  • sort to order the samples by the fields in Sample ordering metadata, for example by visit to follow a time course.
  • facet to split the samples into one panel per value of Metadata column for faceting, for example coffee drinkers and non-coffee drinkers. The samples are sorted within each panel, and all panels share the same y-axis, so their bars can be compared directly.

5. Customise the charts

Module outputs and how to read them

Bar charts

One chart per selected compound, with one bar per sample.

Selected features table

The compounds charted and their reference limits.

Exported files

The charts, the tables and the data behind them.

Bar charts

Change the parameters on the right of the chart to see how each one changes the bars, and hover over any part of the chart to see what it shows.
The chart uses example data from a targeted panel. Each sample also has its own sample amount, as if some extracts were more diluted than others, and this amount scales all its compounds. Set Value scale to processed and choose a Normalization to see how normalization removes this effect.

Why is this plot useful?

  • Check the quality of the measurement. See how many samples are close to or below the LOD before you analyse a compound.
  • Spot outlier samples. A sample with a value far above the others can drive a group difference on its own.
  • See patterns across samples. Sort or facet the samples by group or time point to see whether the amount of a compound follows them.
  • Explain a result from another module. Look at the values of a compound found by Univariate comparison or by a model, sample by sample.

Selected features table

The module also shows a table with one row per charted compound. It reports the LOD, LOQ and ULOQ of each compound, when the Data Table has them, and whether reference lines were drawn on its chart. The table is exported as selected_features.csv.

Exported files

Click Export to download the charts together with the tables behind them.
Choose the type of your Data Table. Hover an underlined value to see why it is recommended. For the pre-processing parameters, see Recommended Pre-processing parameters.
Suitable and interpretable. Each compound is a known metabolite with its own LOD, LOQ and ULOQ, so the raw bars can be read directly against these limits.

Analysis parameter reference

Sets which values the bars show.Options
  • raw shows the values as reported in the Data Table, in their original units. Cells with a text code such as <LOD have no bar.
  • processed shows the values after Normalization, Transformation and Scaling.
Default · rawSuggested · raw for targeted quantified data and to compare values with the LOD. processed for peak areas, to correct for differences in sample amount.
Pre-processing decides which compounds and samples are charted with both options. The steps that replace values, such as Below LOD or NA handling, change only the processed values. Reference lines are hidden with processed.
Draws horizontal lines at the limits of each compound, the limit of detection (LOD, dotted), the limit of quantification (LOQ, dashed) and the upper limit of quantification (ULOQ, dash-dot). Available when Value scale is raw and Collapse features by is empty.Options · TRUE or FALSEDefault · TRUE
A line is drawn only when the Data Table has a value for that limit and compound. Targeted tables usually report LOD, LOQ and ULOQ for each compound. Untargeted tables can report an LOD only. Lines are hidden when features are collapsed, because a group of compounds has no single limit.
Shows one or more metadata fields as coloured tracks above the bars, one row per field. The fields chosen here are also the ones available to sort and facet the samples.Options · The metadata fields of the samples. Several fields can be selected.Default · NoneSuggested · The fields of your study design, such as treatment, time point or subject.
Removes the samples that have no value in the fields chosen in Sample Annotation. Available when a field is selected.Options · TRUE or FALSEDefault · TRUE
With FALSE, missing values are shown as a group called NaN_group. Removed samples are listed in excluded_samples.csv.
Sets how the compounds are ranked before the top N are charted.Options
  • mean ranks by the average value across samples.
  • prevalence ranks by the share of samples in which the compound is detected. A compound is not detected when its value is zero, below the LOD or missing.
  • variance ranks by how much the values vary between samples.
  • percentile ranks by the 90th percentile of the values, the value that 90% of the samples do not exceed.
Default · meanSuggested · mean for a targeted panel. variance to find the untargeted features that differ most between samples.
Sets how many top-ranked compounds get a chart.Options · Integer from 1 to 30Default · 10Suggested · The number of compounds in a targeted panel, or 10 to 20 for untargeted data.
Sets how many charts are shown on screen. The export always contains the charts of all the selected compounds.Options · Integer from 0 to 20Default · 5
Sets the colour palette of the bars. Each compound gets its own colour from the palette, so consecutive charts are easy to tell apart.Options · Qualitative palettes, such as tab20 or Set2, and sequential palettes, such as viridis or BluesDefault · tab20
Shows the sample names under the bars.Options · TRUE or FALSEDefault · TRUESuggested · FALSE when there are too many samples for the names to be readable.
Sets how the samples are arranged along the x-axis. Available when at least one field is selected in Sample Annotation.Options
  • None keeps the order of the samples in the Data Table.
  • sort orders the samples by the fields in Sample ordering metadata.
  • facet splits the samples into panels, one for each value of Metadata column for faceting, and sorts them within each panel. The panels share the same y-axis.
Default · None
sort and facet need at least one field in Sample ordering metadata. If the faceting field has only one value, the samples are sorted without panels.
Sets the fields used to order the samples, among those chosen in Sample Annotation. Available when Sample arrangement is sort or facet.Options · The fields selected in Sample Annotation. Several fields can be selected, and the samples are sorted by the first one, then by the next.Default · None
Sets the direction of the sorting. Available when a field is selected in Sample ordering metadata.Options · TRUE (ascending) or FALSE (descending)Default · TRUE
Sets the field that splits the samples into panels, among those chosen in Sample ordering metadata. Available when Sample arrangement is facet.Options · The fields selected in Sample ordering metadataDefault · None. When empty, the first field in Sample ordering metadata is used.