Taxonomy assignment classifies amplicon ASVs/OTUs (16S, ITS, 18S) against a reference database. The output label is a classifier + database + primer-region-conditioned hypothesis at a stated confidence, NOT an identification. The single most important honest message: a short 16S read (one hypervariable region, ~250 bp for V4) licenses GENUS at best - frequently only family for poorly resolved clades - and rarely species. The confidence/bootstrap score measures the model's certainty assuming the true taxon is in the database; it cannot detect when the true taxon is absent, in which case the classifier returns the nearest wrong relative. ITS (the fungal barcode) is the exception and does resolve to species; 18S resolves coarsely like 16S.
Three classifier families are covered: DADA2 assignTaxonomy + addSpecies (RDP naive Bayes, R), DECIPHER IDTAXA (conservative tree-descent, R), and QIIME2 q2-feature-classifier (classify-sklearn naive Bayes and classify-consensus-vsearch alignment-consensus, CLI). Shotgun read classification is a different category - see metagenomics/kraken-classification and metagenomics/metaphlan-profiling.
# R classifiers (DADA2 + DECIPHER IDTAXA)
# BiocManager::install(c('dada2', 'DECIPHER'))
# QIIME2 installs as its own conda environment; the release tag defines the plugin API and the
# .qza classifier format (e.g. qiime2-amplicon-2024.10). vsearch ships with the QIIME2 env.
# conda env create -n qiime2-amplicon-2024.10 --file <release env file>
Conceptual prerequisites:
- Inputs are per-feature SEQUENCES (a DADA2 seqtab_nochim, or a QIIME2 FeatureData[Sequence] of representative sequences) - ASV inference happens upstream in amplicon-processing.
- The reference database is matched to the marker: 16S -> SILVA / GTDB / Greengenes2; ITS -> UNITE; 18S -> PR2 or SILVA. GTDB has no Eukarya and cannot classify ITS/18S.
- The reference should be trimmed to the SAME primer region as the reads. A full-length classifier on V4 reads fabricates and erases calls.
- Reference database downloads are large (a full-length SILVA NB classifier is multi-GB).
- A pre-trained naive-Bayes .qza is a pickled scikit-learn model tied to the QIIME2 release that built it; a mismatched release errors out.
- Pick ONE database+release for all samples in a study; never merge labels across SILVA/GTDB/Greengenes2.
Tell your AI agent what you want to do: - "Assign taxonomy to my 16S V4 ASVs against SILVA and report the rank the data supports" - "Train a region-matched naive-Bayes classifier for my 515F/806R primers, then classify" - "Classify my fungal ITS sequences against UNITE" - "I am getting a scikit-learn version error on a pre-trained classifier - what are my options?" - "Use IDTAXA for a conservative, novelty-aware classification" - "Filter host mitochondria and chloroplast features out of my table before diversity and DA"
"I have 16S V4 (515F/806R) ASVs from DADA2. Assign taxonomy with SILVA, but make sure the classifier is matched to the V4 region rather than full-length, and report genus where species is not supported."
"These are environmental samples with many under-named bacteria. Should I use SILVA or GTDB, and what changes about the names if I switch?"
"Classify my ASVs two ways - naive Bayes and vsearch alignment-consensus - and tell me where they disagree and why one is immune to the scikit-learn version error."
"Run assignTaxonomy and tell me what minBoot you used, what it trades, and which ASVs you left unassigned at genus rather than force-filling."
"Can I report species for this 16S ASV? If not, what would it take to defend a species call?"
"My amplicon is fungal ITS. Classify against UNITE and explain why ITS can reach species when my 16S could not."
"My samples are plant-associated and a big fraction of ASVs are labelled Chloroplast or Mitochondria. Filter the host organelle features out of the feature table after assignment, before diversity and differential abundance, and tell me what fraction of reads that removed."
Unassigned/truncated features and label them honestly (e.g. g__; s__); do not silently drop or force-fill them. Unassigned at domain level usually means off-target (host, chimera, primer artifact) - filter, but document it.qiime taxa filter-table --p-exclude mitochondria,chloroplast or the phyloseq subset_taxa equivalent (the rank-equality form is SILVA-138-specific). Exception: in phototroph/aquatic/mat communities, chloroplast 16S can be the signal - inspect before excluding.| Method | Strength | Limitation |
|---|---|---|
| Naive Bayes (classify-sklearn / assignTaxonomy) | fast (train once), well-benchmarked default | over-classifies if confidence left low; pre-trained model is sklearn-pinned |
| Alignment-consensus (classify-consensus-vsearch) | no trained model, immune to sklearn pinning, transparent hits | slower; consensus thresholds are extra knobs |
| IDTAXA (DECIPHER) | conservative, novelty-aware, refuses to over-descend | needs a pre-trained DECIPHER trainingSet |
| addSpecies (DADA2, exact match) | high-precision species calls | exact-match only; low recall (most ASVs left NA) |
| Database | Marker / scope | Best for |
|---|---|---|
| SILVA 138.x | 16S + 18S; Bacteria, Archaea, Eukarya; curated rRNA taxonomy | general-purpose 16S/18S default |
| GTDB r220 | 16S; Bacteria + Archaea only; genome-based, rank-normalized | environmental / under-named bacteria (names differ from SILVA) |
| Greengenes2 | 16S (V4-focused) on a genome-backbone tree, GTDB-harmonized | unifying 16S with shotgun on one tree (closed-reference) |
| UNITE | fungal ITS; species hypotheses | fungi; resolves to species |
| PR2 5.x | protist/eukaryote 18S; curated | microeukaryote 18S |
| RDP | 16S; legacy | historical reproducibility only |