Microbiome and metagenomics
A microbiome is the set of microbes living in one place, like the gut, the mouth or soil. In a note you can load microbiome data, look at it and test it, and the R code runs for you.
Prompts to try
Copy a prompt into a new note and send it. When the result is back, send the follow-up.
Check how many false finds a method makes. Send:
Load HMP_2012_16S_gingival_V13 from MicrobiomeBenchmarkData. Keep the supragingival samples from the first visit.Then:
If I split these samples into two random groups, how many genera should come out as differentially abundant?Find microbes that differ between patients and healthy people. Send:
Load BedarfJR_2017 from curatedMetagenomicData. It compares people with early Parkinson's disease and controls in Germany.Then:
Agglomerate to genus, keep genera present in at least 10% of samples, and run ANCOM-BC2 for Parkinson's versus control with age and sex as covariates.Look at a study from MGnify, a public library of microbiome studies:
Use MGnifyR to list the analyses in MGnify study MGYS00006110. It's 16S data from twelve French cheese varieties. Don't fetch any results yet.Read QIIME 2 files from Zenodo, a public site for research data. Send:
Download Zenodo record 5762485. It has QIIME 2 files from a study of the brown bear gut microbiome.Then:
Import the feature table, the taxonomy and the rooted tree .qza files into one TreeSummarizedExperiment.Check for something that could mislead the result. Send:
Load KarlssonFH_2013 from curatedMetagenomicData. It's 70-year-old European women with normal, impaired or diabetic glucose control.Then:
Which treatments are recorded? How many women take metformin?
What a note can do
Notes keep your data in a TreeSummarizedExperiment, one R object that holds the counts, the sample information and the names of the microbes together. They work on it with mia, a package for microbiome data, and follow the book Orchestrating Microbiome Analysis (OMA).
- Get data. Load public studies from curatedMetagenomicData, HMP16SData, microbiomeDataSets, MGnify or HoloFood, or download a Zenodo record. Bring your own tables, BIOM files, QIIME 2 files, DADA2 output, phyloseq objects, or MetaPhlAn and Kraken 2/Bracken profiles. See Add your own data.
- Clean and group. Drop rare microbes, and add up counts at a level such as genus.
- Diversity. Alpha diversity tells you how many kinds of microbes one sample has. Beta diversity tells you how different two samples are.
- Ordination. A plot that puts similar samples close together.
- Group tests. PERMANOVA and RDA test whether groups of samples differ as a whole.
- Differential abundance. Find which microbes are more common in one group than another, with LimROTS, MaAsLin3, ANCOM-BC2, ALDEx2 or lefser.
- More. Community types (DirichletMultinomial), networks of microbes that rise and fall together (NetCoMi, SpiecEasi, SPRING), changes over time (miaTime), removing differences between batches or studies (MMUPHin) and predicting a group from the microbes (SIAMCAT, mikropml).
Notes start from tables and profiles, not from raw reads. Raw reads are trimmed, classified and profiled in Reports on Roihu, with CSC tools such as fastp, Kraken 2, Bracken, MetaPhlAn and HUMAnN. The profiles can then go into a note.
Plots come from miaViz, the plotting package that goes with mia.
Example notes
Open one to see every question, the code and the figures.

- How many false positives?: tests two random halves of the same samples, where nothing should differ.
- Seasons in the Hadza gut: which microbes differ between two camps of hunter-gatherers.
- Parkinson’s disease and the gut with ANCOM-BC2: genera that differ in patients, taking age and sex into account.
- Confounding by metformin in type 2 diabetes: how a diabetes drug changes the answer.
- Why repeated samples need a random effect: what to do when one person gives several samples.
- Importing QIIME 2 artifacts: the brown bear gut: from QIIME 2 files to diversity values.
- MGnify: cheese rind and core: fetches part of an MGnify study and compares rind with core.
- Learning a microbial association network: a network of microbes that go up and down together.
Tips
- If you ask to compare groups and do not name a method, the note uses LimROTS when your design fits it. It sets a seed, so the result is the same next time, and reports adjusted q-values. If LimROTS does not fit, for example when the thing you compare is a number such as age, the note says why and picks another method. A method you name always comes first.
- Notes plot with miaViz. Ask for ggplot2 if you want to style a figure yourself.