--- name: tracking-taxonomy-updates description: Route genomes, bins, or contigs to domain classifiers with QuickClade (BBTools 40.05), Tiara, and geNomad, and track NCBI, GTDB, ICTV, and eukaryotic taxonomy releases. Use when assigning taxonomy, choosing a domain-specific tool, comparing releases, or resolving renamed taxa. disable-model-invocation: true --- # Tracking Taxonomy Updates Two separate jobs. Domain routing is the first gate for the omics stage skills. Release tracking reports taxonomy changes and shares no steps with routing. Shared pipeline rules: read `../omics-pipeline/SKILL.md` first. `SKILL_DIR` is the directory that contains this `SKILL.md`. `RUN_DIR` is the dated run directory (`results/_/`); stage outputs go to `$RUN_DIR/taxonomy/`. Only the shared routing table has a fixed path, `results/taxonomy/domain_routing.tsv`. ## Instructions ### Job 1: Domain routing (QuickClade 40.05 + Tiara + geNomad, then domain classifiers) 1. Run **QuickClade** first on any assembly, MAG, SAG, isolate genome, bin set, or contig FASTA using `bryce911/bbtools:40.05` with `percontig` and an explicit offline spectra file (`ref="$BIO_DB_ROOT/quickclade/refseqA48_with_ribo.spectra.gz"`; see [reference/tools.md](reference/tools.md)). Pair it with **Tiara** for eukaryotic contig identification and **geNomad** for viral/plasmid contigs on metagenomes. Skip triage only when the user supplies a trusted domain label and asks to skip it. QuickClade routes; it is not the final authority. 2. Convert QuickClade `format=machine` output (plus optional `--tiara` and `--genomad` tables) into the shared routing table, `results/taxonomy/domain_routing.tsv`: ```bash uv run --script "$SKILL_DIR/scripts/quickclade_to_routing.py" \ "$RUN_DIR/taxonomy/quickclade_percontig.tsv" \ --tiara "$RUN_DIR/taxonomy/tiara.tsv" \ --genomad "$RUN_DIR/taxonomy/genomad_virus_summary.tsv" \ --sample-id S1 --output results/taxonomy/domain_routing.tsv ``` - Reads BBTools `40.05` (21 columns) and legacy `39.85` (26 columns) by header name, keeping the first (best) hit per query. Rejects multi-contig queries unless `--per-bin` is passed. - Extracts the domain from `sk__` or `d__` prefixes (`Bacteria`, `Archaea`, `Eukaryota`, `Viruses`), or giant-virus phyla (`Nucleocytoviricota`, `Mirusviricota`, `Preplasmiviricota`). - **Calibrated filter (never filters on `Confidence`):** QuickClade's `Confidence` column returns `d:98-100` even on random and short sequences, so `quickclade_confidence` is stored for provenance only. Claims require `Q_Bases >= --min-length` (default `3000`) and `k3dif <= --max-k3dif` (default `0.055`, skipped under `--per-bin`). Rows failing calibration get `quickclade_filter` (`short`, `no_domain`, or `distant`) and route to `manual_review` unless Tiara or geNomad provides domain evidence. - **Multi-line merge:** `--tiara` confirms or rescues eukaryotic contigs (`eukarya`, `organelle`, `mitochondrion`, `plastid`) and flags prokaryote-vs-eukaryote conflicts as `manual_review`. `--genomad` routes giant viruses to `gvclass`, other viruses to `vcontact3`, and marks host-integrated proviruses (`provirus_excise_for_viromics`) without overwriting the host route. - Atomic lock-guarded writes refuse to overwrite; pass `--append` with a new `--sample-id` to add samples without duplicates. 3. Route each row to its domain classifier: - **Bacteria or Archaea:** **GTDB-Tk** on HPC (check `GTDBTK_DATA_PATH` and `gtdbtk check_install`), or QuickClade `40.05` + marker-gene phylogenies on RAM-limited workstations. - **Giant viruses** (`Nucleocytoviricota`, `Mirusviricota`, `Preplasmiviricota`): `bio-viromics` with **GVClass** + marker-gene phylogeny (`vConTACT3` is not required). - **Phage or prokaryotic virus:** `bio-viromics` with **vConTACT3** (+ optional **Phold**). - **Eukaryota:** **Tiara** (contig level) + **EukCC** (bin level; check low prokaryotic coding density `<0.85` as an extra bin screen) + eukaryote-aware gene calling; use **ViroSync** (`bio-viromics`) when screening eukaryotic genomes for endogenized viruses (EVEs). - **Mixed, short/distant, or conflicting domains (`review_flag` `true`):** inspect or split before running domain-specific tools. 4. Submit GTDB-Tk, EukCC, vConTACT3, or GVClass on Slurm via `hpc-slurm` from the project root: ```bash cd PROJECT_ROOT && SLURM_ACCOUNT= "$SKILL_DIR/scripts/submit_taxonomy.sh" gtdbtk bins "$RUN_DIR/taxonomy/gtdbtk" ``` The template [templates/taxonomy-tool.sbatch](templates/taxonomy-tool.sbatch) runs tools via `pixi run --frozen`, writes logs to `logs/taxonomy-.{out,err}`, and passes `$SLURM_CPUS_PER_TASK` as threads. Set `GTDBTK_EXTENSION` (without dot) or `EUKCC_SUFFIX` (with dot) when bins do not end in `.fa`. 5. Normalize identifiers and taxonomy strings across tools (TaxonKit v0.20+ with `lca -s ";"` before `lineage`), and flag disagreements between QuickClade, Tiara, domain classifiers, and NCBI. ### Job 2: Taxonomy release tracking 1. Fix the scope: domains, timeframe, and output type. 2. Pull release notes and current releases from [reference/sources.md](reference/sources.md). Re-check live sources for any "latest" claim; [reference/last-verified-snapshots.md](reference/last-verified-snapshots.md) holds dated examples only. 3. Extract versioned changes using stable identifiers ([reference/ranks-and-identifiers.md](reference/ranks-and-identifiers.md)); resolve names with TaxonKit and report merged/deleted taxid warnings. 4. Deliver a versioned report from [reference/report-template.md](reference/report-template.md), flagging any cross-source disagreements with provenance. ## Input Requirements - Domain routing: genome, bin, or contig FASTA; offline QuickClade spectra (`$BIO_DB_ROOT/quickclade/refseqA48_with_ribo.spectra.gz`); optional Tiara and geNomad outputs; downstream databases verified via `check_databases.py --stage domain-triage`. - Release tracking: domains, timeframe, and target authorities (NCBI, GTDB, ICTV, eukaryotic frameworks). ## Output - (agent-authored) `$RUN_DIR/taxonomy/quickclade_percontig.tsv`, `tiara.tsv`, `genomad_virus_summary.tsv`. - (agent-authored) `results/taxonomy/domain_routing.tsv` (written by `quickclade_to_routing.py`) with columns `sample_id`, `query_id`, `contig_id`, `quickclade_domain`, `quickclade_taxonomy`, `quickclade_confidence`, `contig_bases`, `k3dif`, `quickclade_filter`, `evidence_sources`, `route`, `downstream_tool`, `review_flag`, `notes`. - Downstream classifier outputs under `$RUN_DIR/taxonomy/{gtdbtk,eukcc,vcontact3,gvclass}/`. ## Quality Gates - [ ] QuickClade (`40.05`, offline `ref=`) ran first per contig, calibrated by length and `k3dif` (not `Confidence`), paired with Tiara for eukaryotic screening on metagenomes. - [ ] Bacterial/archaeal routes report GTDB-Tk output (HPC) or documented QuickClade/marker placement (workstation). - [ ] Giant-virus routes use GVClass without requiring vConTACT3; phage routes use vConTACT3. - [ ] Eukaryotic routes use Tiara/EukCC, not prokaryotic QC tools. - [ ] Provenance records tool versions, container tag/digest, database releases, and run dates. - [ ] Release tracking joins on stable IDs (NCBI taxids, GTDB IDs) and passes [reference/qa-checklist.md](reference/qa-checklist.md).