Skip to main content
All CollectionsAnalysesComparing Samples
Visualizing microbiome data with Custom Plots
Visualizing microbiome data with Custom Plots

Learn how to compare samples and make common microbiome plots on the One Codex Platform

Denise Lynch avatar
Written by Denise Lynch
Updated over a year ago

Many microbiome scientists turn to certain metrics and plots to help them interpret their microbiome cohort results. We wanted to make it easier for you to generate some of these figures within our platform. For this, we have created our "Custom Plots" feature. You can find this feature under the "Compare Analyses" menu on the navigation bar to the left of your screen, or here.

Custom Plots provides you with a number of different plot types to choose from. If you're new to the microbiome and unsure of the types of plots available to you, take a look at this article. It describes some of the common terminology and metrics you'll see in microbiome publications.

Custom Plots utilizes the metadata you apply to your samples. Before you begin generating plots, you can apply metadata following the instructions in our metadata article.

Here, we'll walk through how to generate these plots and highlight some of the features that can help you to analyze and interpret your data. To begin, select a project or a tag that you have applied to your samples of interest. (Note: at launch, only projects or tags with 50 samples or fewer will be available for analysis. We plan on expanding this to support much larger projects in the near future!)

Taxa plots

As soon as you select your project or tag, we'll plot a bargraph of the top 10 genera for all of your samples. All remaining genera will be grouped together as "Other". In this example, we have selected a tag named "Human and Mouse".

In order to see some of the finer differences between these samples, we can modify the plot using the parameters in the right-hand sidebar. You can choose how many of the most abundant ("Top N") microbes you want to plot, and select the taxonomic rank to plot. Click "Render" to generate the new plot.

If you have added metadata to your samples, you can also use this to further annotate your plots. Facet your samples into panels based on a particular metadata variable, or filter your samples to only include those with a particular metadata value. You can also use your metadata to show different axis labels for your samples.

Using the above dataset, we're plotting the top 30 species faceted by "Sample source". In this case, "Sample source" is a metadata variable we've applied to these samples, which separates the samples into groups of "human" and "mouse".

You also have the option to visualize these top species as a heatmap by selecting "Heatmap" from the plot type buttons. In this example, we've filtered the above dataset to only include the human samples.

Alpha Diversity

Upon selecting "Alpha Diversity" on the top panel, a drop-down menu will appear, providing you with three alpha diversity metrics to plot: Shannon Index, Simpson's Index, and Observed Taxa.

If you do not select a metadata variable to group by, or if you select a continuous metadata variable (for example, the weight of your study participants), we will generate a point plot.

If you select to group by a categorical metadata variable, a boxplot will be generated. Here, we've faceted by Sample source (human or mouse), and grouped by time point for a particular treatment.

Beta Diversity

To visualize distances between samples, you can choose between PCA plots based on the taxa at your selected rank, or PCoA plots based on a selected beta diversity metric (choose between Bray-Curtis dissimilarity, Manhattan distance, Jaccard distance, Weighted UniFrac, and Unweighted UniFrac).

For PCA and PCoA plots, you can use your metadata to colour your samples, or for filters and labels. You can choose to label by multiple metadata variables. Hovering over a point will display those metadata variables for that sample. Clicking on a point will take you to the classification results page for that sample.

Our Beta Diversity plots also include a "Distance" plot type - a heat map of every sample compared to each other sample, based on the beta diversity metric you choose (the same metrics as available for PCoA plots). Here, we see just how dissimilar human and mice samples are by Bray-Curtis dissimilarity!

Functional Analyses

A recent addition to Custom Plots is the ability to plot functional data. If you have run our Functional Analysis job on your samples, you can now visualize a heatmap of up to 50 of the most abundant functions across your samples.

You can choose between one of the different functional annotation options (e.g. EggNOG terms, GO terms, KO, EC Number, PFAM), and explore CPM or RPK values for those annotations. Alternatively, you can look at either abundance or coverage values of pathways. You can also view abundances of pathways which are completely covered in at least 1 sample ("Abundance (complete only)" option).

With so many possible functions, we allow plotting of up to 50 different functions with the highest average values of your chosen annotation and metric.

Like other plot types, you can facet, filter, sort and label your samples by metadata. In addition to this, while we show function names by default, you can choose to label your functions by their IDs instead.

Functional plotting is a new addition to the Custom Plots tool. We are planning to expand on this feature over time. If you have any feedback, we would love to hear it! Feel free to message us through the chat box at the bottom-right of your page.

Saving Your Plots

Lastly, you can export your plots in both .svg and .png formats, ready for publication! You can also export the underlying data for a plot in .csv or .xlsx format. Just click on the "Export as..." menu at the top-right of your plot for saving options!

Next Steps

If you want to make more complicated plots, and are comfortable with coding in Python, check out Jupyter Notebooks!

For any questions or comments about our Custom Plots, reach out to us via email or by clicking the chat box at the bottom-right of your screen.

Did this answer your question?