What is Rarefaction?
Rarefaction describes how the number of features that are detected in a sequenced sample, whether distinct taxa, genes, or other units, changes as sequencing depth (i.e the number of sample reads) increases. A microbial community can comprise of hundreds to thousands of taxa (in complex environments), present at different abundances. If we extend the description of microbial profiles to functional genes, virulence factors or antimicrobial-resistance genes, the full feature space might extend well beyond thousands of features. In metagenomics, detecting a microbial species or genes encoding for an enzyme or AMR, regardless of the sequencing technology, requires enough reads originating from the corresponding genomic fragment in the sequenced sample. The probability of recovering enough reads to make a confident call on the presence of a feature depends mainly on two factors:- Feature abundance in the community: Read counts scale with the relative amount of the corresponding DNA in the sequenced library, which depends on the abundance of the organism, its genome size and target copy number, and on how the sample was processed before sequencing.
- Sequencing depth ( i.e the total number of reads ): deeper sequencing samples more DNA fragments from the library and increases the chance of recovering enough reads from low-abundance taxa and genes. The depth required depends on the study goals: broad community profiling can be feasible at lower depth, whereas detecting rare microbial features requires deeper sequencing.
- Whether, and to what extent, diversity estimates depend on sequencing depth
- How many samples would be retained at a chosen minimum read depth
- Whether differences between groups in downstream analyses may be driven by unequal sequencing depth rather than biological variation
Why would I do rarefaction?
Separating biology from sequencing depth
Two groups—for example, antibiotic-treated mice and untreated controls—can appear to differ in species richness simply because one group was systematically sequenced to a greater depth than the other. If the biological factor of interest (treatment) and the technical factor (sequencing depth) happen to push richness in the same direction, their effects are confounded: you cannot tell how much of the observed difference is biological versus technical without first correcting for depth.
Was my sequencing depth enough?
A rarefaction curve that is still rising at your maximum sequencing depth means the sampling has not reached saturation: additional reads would likely reveal more taxa, or genes that remain undetected. This is a sign that your current depth may be insufficient to fully characterize the community, particularly for rare or low-abundance members. The depth at which a rarefaction curve begins to plateau is a practical, data-driven target for how much sequencing effort is needed to adequately characterize a given sample type. This is especially useful when planning for larger studies: rarefaction curves from a pilot dataset can help you estimate the sequencing depth required per sample before scaling up, balancing the cost of additional sequencing against the marginal gain in detected diversity.How does it work?
On Cosmos-Hub 2.0, the input to rarefaction is a Feature Table describing feature abundances across samples of a cohort: the taxa or genes detected in each sample, given as read counts.1
Start from the microbial profiles
The input to rarefaction analysis is the Feature Table assembled when you build the cohort for a new Analysis Project with the Query Builder. For each sample in the cohort, the Feature Table records the abundance of each feature as the number of sequencing reads assigned to it, referred to as counts.
2
Subsample to increasing read depths
Reads are randomly subsampled without replacement to simulate sequencing of the same sample at series of increasing depths. At low sequencing depths, only the most abundant features tend to be observed; rare features appear only as the depth increases.
3
Count what is detected
At each sequencing depth, count how many features are detected at the chosen taxonomic rank, for example ASVs, genera or species, and compute the selected alpha diversity metric.
4
Build the rarefaction curve
Plot the alpha diversity metric against sequencing depth to generate a rarefaction curve. A curve that flattens means that most detectable features at that rank have been captured, while a curve that keeps rising means that deeper sequencing would still detect additional features.