Shiny Microbiome Analysis

Are you a microbiome researcher? Did you do a microbiome experiment? Do you want a quick, first-pass analysis to find out what happened? This post is for you.

When I talk to my collaborators, I find that there is a point people encounter where they have a 16S dataset and they want a quick look at what happened. This is not to generate publication-quality figures and not to take the place of a real-life statistician, but just a rough pass over the data. To help make this possible, I worked with a talented student named Will Frohlich and made a small shinyApp for this first-pass microbiome analysis.

Where To Find It

You can access the app at The code for the app, example data, and documentation can be found at

What It Does

The shinyMicrobiome app only does a few basic things:

  • Plot stacked bar graphs showing relative abundance of taxa over samples

  • Plot the number of reads per sample, or group of samples

  • Plot the estimated total number of taxa (using breakaway)

  • Calculate and plot differential abundance by sample group (using corncob)

Disclaimers: Note that the differential abundance calculation is a very naive implementation of a sophisticated tool (corncob), and you will almost certainly get a more accurate answer by running corncob yourself and selecting parameters as appropriate for your study design. Also note that there is no False Discovery Rate correction in the app.

What You Need

The full description of input data for the app can be found in the GitHub repo, but the short description is that you will need:

  • A metadata sheet (in CSV format) describing what groups (treatment/control, etc) each sample is in. You must have the first column labeled “name” with the sample name, and then you can have as many additional columns as you like.

  • A taxon table (in CSV format) with the number of 16S reads assigned to each taxon for each sample. Each taxon is a row and the first column must be named “tax_name” with the name of the taxon. Each sample is a column, and the name of those columns must match the sample names in the metadata sheet.

Example data with this format can be found in the GitHub repo.

Need Help With Raw 16S Data?

Do you have raw 16S data which you would like to transform into these read-count taxon tables? The MaLiAmPi pipeline created by Jonathan Golob is a great way to process 16S data and make these sorts of tables. If you do use MaLiAmPi, the wide-form tables it produces (found in classify/tables/tallies_wide.genus.csv) are properly formatted for use as taxon tables by this app.

Having Problems With The App?

This app is very much a work-in-progress. Please don’t hesitate to reach out if you have any problems, or just file an issue if you think there are some bugs which might be impacting other people. However, there are many things that are really never going to work well for a simple app like this – axis labels will be misplaced, legends may overlap the plot area, statistical tests won’t be exactly suited for your experiment, etc. As long as you approach this app with those expectations, you may end up finding it to be useful.