Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Taxonomic classification of ASVs using reference databases like SILVA, GTDB, or UNITE. Covers naive Bayes classifiers (DADA2, IDTAXA) and exact matching approaches. Use when assigning taxonomy to ASVs after DADA2 amplicon processing.
.claude/skills/bio-microbiome-taxonomy-assignment/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-06 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
| case-05 | ✓→✓ | = Same ✓ | — | — |
| case-15 | ✗→✗ | = Same ✗ | — | — |
| case-22 | ✗→✗ | = Same ✗ | — | — |
Reference examples tested with: DADA2 1.30+, QIIME2 2024.2+, phyloseq 1.46+, scanpy 1.10+, scikit-learn 1.4+
Before using code patterns, verify installed versions match. If versions differ:
packageVersion('<pkg>') then ?function_name to verify parameters<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Assign taxonomy to my ASVs" → Classify amplicon sequence variants against reference databases (SILVA, GTDB, UNITE) using naive Bayes or exact-matching approaches for taxonomic annotation.
dada2::assignTaxonomy() with SILVA/GTDB referenceqiime feature-classifier classify-sklearn for QIIME2 workflowsrlibrary(dada2) seqtab_nochim <- readRDS('seqtab_nochim.rds') # SILVA for 16S (download from https://zenodo.org/record/4587955) taxa <- assignTaxonomy(seqtab_nochim, 'silva_nr99_v138.1_train_set.fa.gz', multithread = TRUE) # Add species-level (exact matching) taxa <- addSpecies(taxa, 'silva_species_assignment_v138.1.fa.gz') # Check results head(taxa)
r# GTDB-formatted database (better for environmental samples) taxa_gtdb <- assignTaxonomy(seqtab_nochim, 'GTDB_bac120_arc53_ssu_r220_fullTaxo.fa.gz', multithread = TRUE)
r# UNITE database for fungal ITS taxa_its <- assignTaxonomy(seqtab_nochim, 'sh_general_release_dynamic_25.07.2023.fasta', multithread = TRUE)
bash# Train classifier (one-time) qiime feature-classifier fit-classifier-naive-bayes \ --i-reference-reads silva-138-99-seqs.qza \ --i-reference-taxonomy silva-138-99-tax.qza \ --o-classifier silva-138-99-nb-classifier.qza # Classify ASVs qiime feature-classifier classify-sklearn \ --i-classifier silva-138-99-nb-classifier.qza \ --i-reads rep-seqs.qza \ --o-classification taxonomy.qza
bash# Faster but requires exact or near-exact matches vsearch --usearch_global asv_seqs.fasta \ --db silva_138_SSURef_NR99.fasta \ --id 0.97 \ --blast6out taxonomy_vsearch.tsv \ --top_hits_only
rlibrary(dada2) # RDP training set (less detailed than SILVA) taxa_rdp <- assignTaxonomy(seqtab_nochim, 'rdp_train_set_18.fa.gz', multithread = TRUE)
Goal: Classify ASVs using DECIPHER's tree-based IDTAXA classifier, which provides more conservative and often more accurate assignments than naive Bayes.
Approach: Convert ASV sequences to DNAStringSet, classify against a pre-trained IDTAXA model, and convert the hierarchical output to a standard taxonomy matrix.
rlibrary(DECIPHER) # Load IDTAXA training set (download from http://www2.decipher.codes/Downloads.html) load('SILVA_SSU_r138_2019.RData') # Creates 'trainingSet' object # Convert ASV sequences to DNAStringSet dna <- DNAStringSet(getSequences(seqtab_nochim)) # Classify with IDTAXA ids <- IdTaxa(dna, trainingSet, strand = 'top', processors = NULL, verbose = TRUE) # Convert to matrix format like assignTaxonomy ranks <- c('domain', 'phylum', 'class', 'order', 'family', 'genus', 'species') taxa_idtaxa <- t(sapply(ids, function(x) { m <- match(ranks, x$rank) taxa <- x$taxon[m] taxa[startsWith(taxa, 'unclassified_')] <- NA taxa })) colnames(taxa_idtaxa) <- ranks
r# assignTaxonomy returns bootstrap confidence # Filter low-confidence assignments taxa_filtered <- taxa taxa_filtered[taxa_filtered < 80] <- NA # If using minBoot output # Or use confidence threshold during assignment taxa <- assignTaxonomy(seqtab_nochim, 'silva_nr99_v138.1_train_set.fa.gz', minBoot = 80, multithread = TRUE)
rlibrary(phyloseq) # Create phyloseq object ps <- phyloseq(otu_table(seqtab_nochim, taxa_are_rows = FALSE), tax_table(taxa)) # Add sample metadata sample_data(ps) <- read.csv('sample_metadata.csv', row.names = 1) # Rename ASVs for readability taxa_names(ps) <- paste0('ASV', seq(ntaxa(ps)))
| Database | Organisms | Taxonomy | Updated | |----------|-----------|----------|---------| | SILVA 138.1 | Bacteria, Archaea, Eukaryotes | 7 ranks | 2024 | | GTDB R220 | Bacteria, Archaea | 7 ranks (genome-based) | 2024 | | RDP 18 | Bacteria, Archaea | 6 ranks | 2016 | | UNITE 10.0 | Fungi | 7 ranks | 2024 | | PR2 5.0 | Protists | 8 ranks | 2024 |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-23 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-24 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +8 percentage points is the difference between those two pass rates over the 24 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.