Metagenomics Fundamentals

Lesson 3 of 13 · 11 min

Study Design, Sampling, and DNA Extraction

Every decision you make before the sequencer runs sets a hard ceiling on what any downstream analysis can recover. Garbage in really does mean garbage out: no assembler, classifier, or statistical model can undo a biased extraction or a confounded design. This lesson covers the design and wet-lab choices that decide whether your metagenome is trustworthy.

Sample Size and Replication

Budget for biological replicates rather than technical ones, since resequencing one sample characterizes the machine, not the biology. Microbiome effect sizes are typically small, so a power calculation grounded in realistic between-subject variance matters more than piling on sequencing depth. Underpowered designs are the main source of differential-abundance results that fail to replicate.

Metadata and Batch Structure

text
sample_id	subject_id	group	body_site	collection_date	storage	extraction_batch	extraction_kit	seq_run	sample_type
S001	P01	treatment	stool	2026-03-04	-80C	B1	PowerSoil_Pro	R1	sample
S002	P02	control	stool	2026-03-04	-80C	B1	PowerSoil_Pro	R1	sample
S003	P03	treatment	stool	2026-03-05	-80C	B2	PowerSoil_Pro	R1	sample
S004	P04	control	stool	2026-03-05	-80C	B2	PowerSoil_Pro	R1	sample
BLK01	NA	NA	NA	2026-03-04	-80C	B1	PowerSoil_Pro	R1	blank
BLK02	NA	NA	NA	2026-03-05	-80C	B2	PowerSoil_Pro	R1	blank
MOCK01	NA	NA	NA	2026-03-05	-80C	B2	PowerSoil_Pro	R1	mock

Randomize samples across extraction batches and sequencing runs so each batch holds a mix of your groups, and include at least one extraction blank in every batch. A batch effect is only correctable when it is not perfectly confounded with the biological variable you are testing.

Controls and Extraction Bias

Carry negative controls through the whole pipeline: an extraction blank (kit reagents, no sample) and a no-template control reveal what the reagents alone contribute. Add a positive mock community of known composition, such as the ZymoBIOMICS Microbial Community Standard, to measure how faithfully your protocol recovers the truth. Blanks tell you what to subtract; the mock tells you how biased your quantification is.

Freeze samples at -80C quickly and avoid repeated freeze-thaw, because warm storage lets fast growers bloom and distorts the community. Kit chemistry and bead beating both bias the profile: too little beating leaves tough Gram-positive walls and spores intact and skews the profile toward easily-lysed cells, while over-beating shears DNA and degrades the fragments released earliest. In low-biomass samples the reagent kitome can dominate real signal, so the blanks you planned become the input to contaminant removal.

r
library(decontam)
library(phyloseq)

# ps: phyloseq object whose sample_data has a 'sample_type' column
sample_data(ps)$is_neg <- sample_data(ps)$sample_type == "blank"

contam <- isContaminant(ps, method = "prevalence",
                        neg = "is_neg", threshold = 0.5)

table(contam$contaminant)

# keep only the taxa flagged as real (non-contaminant)
ps_clean <- prune_taxa(!contam$contaminant, ps)
FALSE  TRUE 
 1893   142 

Try it yourself: take a phyloseq object with a 'sample_type' column, mark the blanks as negatives, then run isContaminant with method='prevalence' at threshold=0.1 and again at 0.5. Compare how many taxa each threshold flags, and inspect a few flagged genera to confirm they are plausible reagent contaminants such as Ralstonia, Bradyrhizobium, or Pseudomonas.