[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EC8895RSX547ABSSSXM0ZM":3,"skill-same:01M7EC8895RSX547ABSSSXM0ZM":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EC8895RSX547ABSSSXM0ZM","bio-comparative-genomics-genome-distance-and-species-delineation",null,"Compute genome-to-genome distances (ANI, AAI, dDDH, k-mer Mash) and assign taxonomic classifications using skani (Shaw 2023), FastANI (Jain 2018), pyani \u002F pyANI ANIb \u002F ANIm, OrthoANI (Lee 2016), AAI (amino-acid identity), dDDH via TYGS \u002F GGDC, GTDB-Tk (Chaumeil 2020 standard prokaryote taxonomy), and Mash MinHash (Ondov 2016). Use when delineating prokaryote species (95% ANI threshold; Jain 2018 Nat Commun 9:5114), assigning genomes to GTDB taxonomy with ANI radius, computing genome similarity matrices for clustering, classifying archaea, evaluating MAG (metagenome-assembled genome) species assignment, applying skani for fast metagenomic ANI screening, or reconciling 16S rRNA-based taxonomy with whole-genome ANI.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-comparative-genomics-genome-distance-and-species-delineation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-comparative-genomics-genome-distance-and-species-delineation\ndescription: Compute genome-to-genome distances (ANI, AAI, dDDH, k-mer Mash) and assign taxonomic classifications using skani (Shaw 2023), FastANI (Jain 2018), pyani \u002F pyANI ANIb \u002F ANIm, OrthoANI (Lee 2016), AAI (amino-acid identity), dDDH via TYGS \u002F GGDC, GTDB-Tk (Chaumeil 2020 standard prokaryote taxonomy), and Mash MinHash (Ondov 2016). Use when delineating prokaryote species (95% ANI threshold; Jain 2018 Nat Commun 9:5114), assigning genomes to GTDB taxonomy with ANI radius, computing genome similarity matrices for clustering, classifying archaea, evaluating MAG (metagenome-assembled genome) species assignment, applying skani for fast metagenomic ANI screening, or reconciling 16S rRNA-based taxonomy with whole-genome ANI.\ntool_type: cli\nprimary_tool: skani\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"comparative-genomics\u002Fgenome-distance-and-species-delineation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: skani 0.2.5+ (Shaw & Yu 2023 Nat Methods 20:1661; bluenote-1577\u002Fskani), FastANI 1.34+ (Jain 2018 Nat Commun 9:5114), pyani 0.3.0+ (Pritchard 2016 Anal Methods 8:12), pyskani 0.1+ (Larralde 2025), OrthoANI 1.40+ (Lee 2016 Int J Syst Evol Microbiol 66:1100), OrthoANIu 1.2+, GTDB-Tk 2.7.1+ (Chaumeil 2022 Bioinformatics 38:5315), GTDB release 220 (2024-Q3+), TYGS web (Meier-Kolthoff & Goker 2019 Nat Commun 10:2182), GGDC v3.0 (web), Mash 2.3+ (Ondov 2016 Genome Biol 17:132), Dashing 2 (Baker & Langmead 2023 Genome Res 33:1218), CompareM 0.1.2+ for AAI (Parks\u002FCherubini), pyANI 0.3.1+, BLAT 36+, DIAMOND 2.1+. JSpeciesWS web (Richter et al 2016 Bioinformatics 32:929).\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `skani --version`; `fastANI --version`; `gtdbtk --version`; `mash --version`; `pyani --version`\n- Python: `pip show gtdbtk pyani`\n\nIf code throws `GTDB-Tk database not found`, `skani sketch incompatible`, `Mash sketch version`, these tools have database-version coupling: GTDB-Tk requires the GTDB release matched to the binary version; Mash\u002Fskani sketches are forward-compatible but not always backward. Check `gtdbtk check_install` for database completeness.\n\n# Genome Distance and Species Delineation\n\n**\"Are these genomes the same species, and what species are they?\"** -> Prokaryote species delineation has shifted from 16S rRNA identity (now considered insufficient at \u003C 98.7%) to **whole-genome ANI** at a 95% threshold (Jain 2018 Nat Commun 9:5114; corroborating Goris 2007 and Konstantinidis 2005). The modern operational standard for taxonomy is **GTDB-Tk** (Chaumeil 2020\u002F2022 Bioinformatics 38:5315), which assigns genomes to the Genome Taxonomy Database (GTDB) using ANI radius + marker-gene placement. **skani** (Shaw & Yu 2023 Nat Methods 20:1661) has replaced FastANI as the default ANI tool in GTDB-Tk 2.4+ for being 20-30x faster while maintaining accuracy. The 95% ANI threshold is robust but not absolute -- the species circumscription radius varies by genus (Parks 2018 Nat Biotech 36:996).\n\n- CLI: `skani dist genomes1.fa genomes2.fa -t 16` -- fast ANI computation\n- CLI: `fastANI -q query.fa -r reference.fa -o output.txt` -- standard ANI\n- CLI: `gtdbtk classify_wf --genome_dir genomes\u002F --out_dir gtdbtk_out --cpus 32` -- GTDB classification\n- CLI: `mash dist *.fa` -- k-mer MinHash distance\n- Web: TYGS (https:\u002F\u002Ftygs.dsmz.de\u002F) and GGDC (https:\u002F\u002Fggdc.dsmz.de\u002F) for dDDH\n\n## Algorithmic Taxonomy\n\n| Tool | Approach | Output | Strength | Fails when |\n|------|----------|--------|----------|------------|\n| skani (Shaw & Yu 2023 Nat Methods 20:1661) | Sparse chaining on minimizers; ANI estimation | ANI percent + alignment fraction | 20-30x faster than FastANI; default in GTDB-Tk 2.4+; supports MAGs | Currently no AAI; not for cross-domain (archaea vs bacteria) |\n| FastANI (Jain 2018 Nat Comm 9:5114) | Mashmap-based fragment alignment | ANI percent + orthologous fraction | Standard ANI tool 2018-2023; well-validated | Slower than skani; designed for >=80% identity |\n| pyani \u002F pyANI (Pritchard 2016 Anal Methods 8:12) | Multi-method ANI: ANIb (BLASTN), ANIm (MUMmer), TETRA | ANI matrix + visualization | Multiple algorithm consensus; reproducible | Slower than skani \u002F FastANI; legacy for many studies |\n| OrthoANI \u002F OrthoANIu (Lee 2016 IJSEM 66:1100) | Reciprocal-best-orthologs ANI | ANI percent (more robust than blast-based) | Considered more precise than ANIb | Slower; less integrated |\n| GTDB-Tk (Chaumeil 2020\u002F2022 Bioinformatics 38:5315) | Marker-gene phylogeny + ANI radius (skani; was FastANI v2.3.x) | Taxonomic classification at all ranks (GTDB nomenclature) | Modern prokaryote taxonomy standard | Specific to GTDB; some classifications differ from NCBI |\n| TYGS (Meier-Kolthoff & Goker 2019 Nat Commun 10:2182) | dDDH (digital DNA-DNA hybridization) | Pairwise dDDH + species delineation | Most rigorous species delineation (vs traditional DDH) | Web-only; rate-limited; specific platform |\n| GGDC (Auch 2010 Stand Genomic Sci 2:117; v3 web) | Digital DDH calculation | dDDH percent + thresholds | Validated against laboratory DDH | Web-only; computational cost |\n| Mash (Ondov 2016 Genome Biol 17:132) | MinHash k-mer sketches | Approximate distance (1 - similarity) | Extremely fast for large-scale clustering | k-mer-based; loses biological interpretation |\n| Dashing 2 (Baker & Langmead 2023 GR 33:1218) | Sketching with Bloom filter optimization | Same as Mash but faster | 5-10x faster than Mash | Newer; less broadly used |\n| pyskani (Larralde 2025 NAR Genom Bioinform) | Python wrapper around skani | ANI in Python | Programmatic access; CI\u002FCD friendly | Newer; ecosystem still developing |\n| CompareM | All-vs-all AAI (amino acid identity) | AAI percent | Cross-genus comparison via protein | Slow; needs all proteomes |\n| JSpeciesWS (web; Richter et al 2016) | ANIb \u002F ANIm | Web ANI + species delineation | Standard for clinical microbiology | Web rate limits; slow |\n| ANI Calculator (CGB Korea) | Web ANI | Web ANI | Quick check | Web-only |\n\nMethodology evolves; verify GTDB release (currently r220 \u002F 2024-Q3) and GTDB-Tk version compatibility. The 95% ANI species threshold has been confirmed across 90,000+ prokaryote genomes (Jain 2018; Parks 2018 demonstrating clear bimodality).\n\n## Decision Tree by Experimental Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|------------------------|-----|\n| Classify a bacterial genome to species | GTDB-Tk classify_wf | Standard prokaryote taxonomy; ANI + marker-gene placement |\n| Compute ANI between two genomes | skani | Fast (vs FastANI); accurate |\n| Compute ANI for 1000+ genome pairs | skani all-vs-all | Scales; preferred for screening |\n| Verify species delineation publication | TYGS + GGDC dDDH | Gold standard for novel species |\n| MAG species assignment | GTDB-Tk + skani; CheckM2 first for completeness | MAGs need quality assessment + taxonomy |\n| Bacterial strain typing | ANIb or dDDH; 99-99.99% for same strain | Strain resolution requires ANI > 99% |\n| Sub-species \u002F serotype level | ANI > 99.5% + epidemiological context | Sub-species requires biology + ANI |\n| Across deep prokaryote divergence | AAI (CompareM); ANI saturates below 75% | AAI better for cross-genus |\n| Cross-archaeal vs bacterial taxonomy | Skani-archaea-aware OR separate analysis | Default skani doesn't differentiate domains explicitly |\n| Fast metagenomic taxonomy screen | Mash or Dashing 2 | k-mer-based; sketches reusable |\n| Distance for genome clustering | skani matrix -> hierarchical clustering or NJ | Standard workflow |\n| Reconcile 16S vs genome taxonomy | Run both; check for inter-genus conflicts | 16S \u003C 98.7% typically inadequate |\n| Build a reference database for ANI lookup | skani sketches indexed; query against | Pre-sketched reference for repeated queries |\n| Phylogenetic placement | GTDB-Tk + IQ-TREE on extracted markers | Place new genome in known tree |\n| AAI for genera-level comparison | CompareM or aai.rb (KBase) | AAI \u003C ANI signal at deep divergence |\n| Subspecies-level pathogenicity | ANI > 99% + virulence-gene annotation | ANI alone insufficient |\n| Type-strain comparison | TYGS automatic type-strain matching | Built-in type-strain database |\n\n## Per-Tool Failure Modes\n\n### skani \u002F FastANI ANI saturating below 75%\n\n**Trigger:** Computing ANI between two genomes at \u003C 75% nucleotide identity.\n\n**Mechanism:** ANI is computed only on alignable regions; at \u003C 75% identity, alignment fraction drops dramatically (\u003C 50%); the few alignable regions are biased toward conserved regions, inflating apparent ANI.\n\n**Symptom:** Reported ANI 75-80% with alignment fraction \u003C 50%; meaningless biologically.\n\n**Fix:** Below 75% ANI, switch to AAI (amino-acid identity from translated proteins); AAI is more meaningful at deep divergence (~50% AAI between distant genera). For ANI matrix at long range, use Mash distance (k-mer-based, no alignment).\n\n### GTDB-Tk database version mismatch\n\n**Trigger:** Using GTDB-Tk binary with mismatched GTDB reference data version.\n\n**Mechanism:** GTDB releases (r207, r214, r220, ...) include reference trees, marker-gene HMMs, and ANI sketch files; GTDB-Tk versions are aligned to specific releases. Mismatch causes silent or loud failures.\n\n**Symptom:** GTDB-Tk fails with \"marker gene HMM not found\" or runs but produces inconsistent classifications.\n\n**Fix:** Check release compatibility: `gtdbtk check_install` shows the expected vs found versions. Pin via `conda env`. Download the matching release from data.gtdb.ecogenomic.org.\n\n### Below-95% ANI but same species (genus-specific radius)\n\n**Trigger:** Strict 95% ANI threshold; rejecting closely related genomes as different species.\n\n**Mechanism:** Parks 2018 demonstrated species-circumscription radius varies (typically 95-99% but tighter for some clonal lineages). For some genera (e.g., Pseudomonas), the species threshold is 94% per genus-specific analysis.\n\n**Symptom:** Two clearly biologically-related strains (epidemiologically connected outbreak) have ANI 94%; using strict 95% calls them different species.\n\n**Fix:** Use GTDB-Tk's species radius approach which uses genus-specific cutoffs. For novel-species naming, consider 95% as primary + ecology + biology. Report ANI alongside additional context (gene content, phenotype, ecology).\n\n### High alignment fraction required (AF >= 0.5)\n\n**Trigger:** ANI reported without alignment fraction; or AF \u003C 0.5.\n\n**Mechanism:** A 95% ANI with 20% AF (only 20% of genome alignable) is biologically meaningless; the comparison covers a small fraction of the genomes. Standard species delineation requires AF >= 0.5 + ANI >= 95%.\n\n**Symptom:** ANI calls \"same species\" but only 20-30% of genome aligned.\n\n**Fix:** Require AF >= 0.5 + ANI >= 95% for species call. Below this, classification is ambiguous; consider AAI or HGT (e.g. a phage-rich genome will have low AF to its actual species).\n\n### MAG contamination \u002F incompleteness\n\n**Trigger:** Running GTDB-Tk on MAGs without CheckM2 pre-screening.\n\n**Mechanism:** Low-completeness MAGs (\u003C 50%) may have marker-gene gaps that break GTDB-Tk's placement; high-contamination MAGs (> 5%) place anomalously.\n\n**Symptom:** GTDB-Tk reports \"no genome retained\" or makes implausible classifications.\n\n**Fix:** Pre-filter MAGs with CheckM2 (Chklovski 2023 Nat Methods 20:1203): require >= 70% completeness, \u003C 5% contamination, \u003C 10% strain heterogeneity for species-level. For lower-quality MAGs, report genus-level only or exclude.\n\n### Mash distance vs ANI inconsistency\n\n**Trigger:** Using Mash distance for species delineation directly.\n\n**Mechanism:** Mash distance = 1 - (Mash similarity) is correlated with 1 - ANI but is not the same metric. The 0.05 Mash distance threshold (sometimes cited as \"5% Mash = 95% ANI\") is approximate; exact ANI varies +-0.5%.\n\n**Symptom:** Genomes with Mash distance 0.04-0.06 inconsistently called \"same species\" or not.\n\n**Fix:** Use Mash for fast screening + clustering, but verify species delineation with ANI on candidate pairs. Mash 0.05 ~ ANI 95% is a rough heuristic; not a publishable threshold.\n\n### Ortholog-based ANI conservative vs alignment-based\n\n**Trigger:** Comparing OrthoANI \u002F OrthoANIu to FastANI \u002F skani.\n\n**Mechanism:** OrthoANI uses reciprocal-best-orthologs; FastANI uses fragment alignment. They differ by 0.5-2% systematically; OrthoANI is more conservative.\n\n**Symptom:** OrthoANI = 94.5%, FastANI = 96% on same pair; different \"same species\" calls.\n\n**Fix:** Document tool used; for taxonomy, use the tool aligned to the reference database (GTDB-Tk uses skani; NCBI uses FastANI). Cross-validation for unclear cases.\n\n### Tetranucleotide bias inflating Mash for low-GC genomes\n\n**Trigger:** Comparing genomes with extreme GC content (Streptomyces ~70% vs Mycoplasma ~25%) via Mash.\n\n**Mechanism:** k-mer frequency distributions are GC-dependent; Mash distance between extreme-GC genomes is inflated by background composition rather than biology.\n\n**Symptom:** Two unrelated extreme-GC genomes (e.g. Mycoplasma + Mycoplasma) appear closer than they biologically are.\n\n**Fix:** Use ANI \u002F AAI for cross-GC comparisons; Mash is reliable only within a GC-comparable range. Document GC range when reporting Mash distances.\n\n### Type strain conflicts in TYGS\n\n**Trigger:** Submitting genome to TYGS where type strain is missing or misclassified.\n\n**Mechanism:** TYGS depends on type strain database; if the type strain is genome-sequenced incompletely or misclassified, the placement may be incorrect.\n\n**Symptom:** TYGS reports unexpected nearest type strain.\n\n**Fix:** Cross-validate with GTDB-Tk; check type-strain genome quality. For novel-species naming, TYGS report should be supplemented with manual taxonomic check.\n\n## Quantitative Thresholds\n\n| Quantity | Threshold | Source \u002F Rationale |\n|----------|-----------|-------------------|\n| Species delineation ANI | >= 95% (Jain 2018) | Standard; based on 90,000 prokaryote genomes |\n| Genus-specific species ANI radius | 94-99% (varies by clade) | Parks 2018 Nat Biotech 36:996 |\n| Alignment fraction (AF) for ANI | >= 0.5 | Operational convention (GTDB-Tk \u002F skani); below this, comparison too small |\n| Strain delineation ANI | >= 99% (typical); >= 99.5% strict | Operational |\n| Sub-species delineation | >= 99% ANI + epidemiology | Manual |\n| AAI species delineation | >= 70% | Operational convention; varies clade |\n| AAI genus delineation | >= 60% | Standard |\n| dDDH species delineation | >= 70% | Goris 2007; matches ANI 95% |\n| dDDH genus delineation | >= 50% | Auch 2010 |\n| 16S rRNA species threshold (deprecated) | >= 98.7% | Stackebrandt 2006; superseded by ANI |\n| Mash distance ~ ANI heuristic | 0.05 ~ 95% ANI | Ondov 2016; rough |\n| GTDB-Tk completeness for placement | >= 50% (CheckM2 OBLIGATE >= 70%) | Chaumeil 2022 |\n| GTDB-Tk contamination | \u003C 10% (\u003C 5% for species-level) | Chaumeil 2022 |\n| MAG quality for taxonomy | CheckM2 >= 70% comp, \u003C 5% cont, \u003C 10% strain het | Chklovski 2023 |\n| skani CLI threads | up to 64; scales linearly | skani docs |\n| skani sketch size | default 1000 minimizers; tunable | skani docs |\n| FastANI default fragment | 3000 bp; varies | Jain 2018 default |\n| GTDB-Tk classify_wf time per genome | 2-30 min on 16 CPUs | Empirical |\n| Type strain ANI uncertainty | +- 1% | Operational |\n\n## skani Standard Workflow\n\n**Goal:** Compute ANI between query and reference set; classify species.\n\n**Approach:** Build skani sketch -> compute distances -> apply species delineation logic.\n\n```bash\n# 1. Pre-sketch reference set\nskani sketch reference_genomes\u002F*.fa -o reference_sketches\n\n# 2. Compute ANI for a single query\nskani dist query.fa reference_sketches\u002F* -t 16 \\\n    --robust --slow > query_distances.tsv\n\n# 3. Compute all-vs-all matrix (large set)\nskani triangle genomes\u002F*.fa -t 32 --robust --sparse -o ani_matrix.tsv\n# --sparse emits tabular Ref_file Query_file ANI Align_fraction_ref Align_fraction_query;\n# without --sparse, `skani triangle` emits a Phylip-style square matrix.\n\n# 4. Filter and visualize\nawk '$3 >= 95 && $5 >= 50' query_distances.tsv > species_matches.tsv\n```\n\n```python\n'''Apply 95% ANI species delineation with AF >= 0.5 constraint.'''\nimport pandas as pd\nimport numpy as np\n\n\ndef parse_skani(path):\n    '''skani output: Ref_file Query_file ANI Align_fraction_ref Align_fraction_query'''\n    df = pd.read_csv(path, sep='\\t')\n    df.columns = ['ref_file', 'query_file', 'ani', 'af_ref', 'af_query']\n    return df\n\n\ndef species_delineate(df, ani_threshold=95.0, af_threshold=0.5):\n    '''Return genome pairs called same species.'''\n    df['min_af'] = df[['af_ref', 'af_query']].min(axis=1)\n    same_species = df[(df['ani'] >= ani_threshold) & (df['min_af'] >= af_threshold)]\n    return same_species\n```\n\n## GTDB-Tk Classification Workflow\n\n**Goal:** Assign GTDB taxonomy (kingdom -> species) to a set of bacterial\u002Farchaeal genomes.\n\n**Approach:** GTDB-Tk classify_wf identifies markers, builds tree placement, calculates ANI radius, returns full taxonomy.\n\n```bash\n# Set environment\nexport GTDBTK_DATA_PATH=\u002Fpath\u002Fto\u002Frelease220_data\n\n# Verify install\ngtdbtk check_install\n\n# Run classify_wf\ngtdbtk classify_wf \\\n    --genome_dir genomes\u002F \\\n    --out_dir gtdbtk_out \\\n    --cpus 32 \\\n    --extension fa \\\n    --skip_ani_screen   # Skip if want phylogeny-based only\n\n# Output:\n#   gtdbtk_out\u002Fclassify\u002Fgtdbtk.bac120.summary.tsv   bacterial classifications\n#   gtdbtk_out\u002Fclassify\u002Fgtdbtk.ar53.summary.tsv     archaeal classifications\n#   gtdbtk_out\u002Fidentify\u002F                              marker gene tables\n#   gtdbtk_out\u002Falign\u002F                                 multiple sequence alignments\n```\n\n```python\n'''Parse GTDB-Tk summary for ranked classification.'''\nimport pandas as pd\n\n\ndef parse_gtdbtk_summary(path):\n    '''GTDB-Tk summary columns include: user_genome, classification, classification_method, ani, msa_percent'''\n    df = pd.read_csv(path, sep='\\t')\n    df['classification_split'] = df['classification'].str.split(';')\n    df['kingdom'] = df['classification_split'].str[0].str.replace('d__', '')\n    df['phylum'] = df['classification_split'].str[1].str.replace('p__', '')\n    df['class'] = df['classification_split'].str[2].str.replace('c__', '')\n    df['order'] = df['classification_split'].str[3].str.replace('o__', '')\n    df['family'] = df['classification_split'].str[4].str.replace('f__', '')\n    df['genus'] = df['classification_split'].str[5].str.replace('g__', '')\n    df['species'] = df['classification_split'].str[6].str.replace('s__', '')\n    return df\n\n\ndf = parse_gtdbtk_summary('gtdbtk_out\u002Fclassify\u002Fgtdbtk.bac120.summary.tsv')\ndf_species_level = df[df['species'] != '']  # Species-level classification\ndf_high_quality = df[df['msa_percent'] > 80]\n```\n\n## TYGS \u002F GGDC for dDDH\n\nFor publication-grade novel-species naming, dDDH is required. Use the TYGS web service (https:\u002F\u002Ftygs.dsmz.de\u002F) or GGDC (https:\u002F\u002Fggdc.dsmz.de\u002F). Submit FASTA -> receive dDDH against type strains + phylogeny.\n\n## Mash for Fast Clustering\n\n```bash\n# Sketch all genomes (do once)\nmash sketch -p 16 -o all_sketches genomes\u002F*.fa\n\n# All-vs-all distance\nmash dist -p 16 all_sketches.msh all_sketches.msh > mash_distances.tsv\n\n# Cluster via NJ or hierarchical clustering\npython -c \"\nimport pandas as pd\nfrom scipy.cluster import hierarchy\ndf = pd.read_csv('mash_distances.tsv', sep='\\t', header=None,\n                 names=['ref', 'query', 'distance', 'pvalue', 'shared_hashes'])\nmatrix = df.pivot('ref', 'query', 'distance').fillna(0)\nlinkage = hierarchy.linkage(matrix.values, method='average')\nhierarchy.dendrogram(linkage, labels=matrix.columns)\n\"\n```\n\n## Reconciliation: When Methods Disagree\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| skani says 96%, FastANI says 95.5% | Tool difference; both > 95% threshold | Consistent species call |\n| skani says 95.2%, FastANI says 94.8% | Borderline case, tool difference | Cross-validate with OrthoANI; check GTDB-Tk |\n| ANI = 94%, dDDH = 70% | Different metrics; both borderline same-species | Standard concordant ambiguous; report both |\n| 16S rRNA same; ANI \u003C 95% | 16S insufficient for species (Stackebrandt 2006) | Trust ANI; reclassify |\n| GTDB says species X, NCBI says species Y | GTDB taxonomy differs from NCBI for ~10% of species | Use GTDB for genome-based; cite both if external comparison |\n| ANI 96%, AF 0.3 | Insufficient alignment fraction | Same-species call invalid; report cautious |\n| ANI 99%, AF 0.9 | Same species, high confidence | Robust species call |\n| Mash 0.04 distance, FastANI 94.5% ANI | Different units; both around species threshold | Use ANI for definitive call |\n| OrthoANI 94%, FastANI 96% | Method variation | Cross-check with skani; report range |\n| GTDB-Tk classifies but MSA % \u003C 50 | Low-quality placement | Report at higher rank (genus) only |\n| TYGS gives unexpected nearest type strain | Type-strain database issue | Verify type-strain quality; cross-validate with GTDB |\n| MAG GTDB-Tk classify fails | Incomplete MAG; missing markers | Improve assembly; report at family or order only |\n\n**Operational rule for publication:** GTDB-Tk classify_wf as primary classification + ANI to nearest type strain (skani or FastANI) + AF >= 0.5 + report Tettelin partition where relevant + cross-validate with dDDH (TYGS) for novel-species claims.\n\n## Cohort Gotchas\n\n- **Archaea:** GTDB has separate ar53 marker set; specify `--archaea` or let GTDB-Tk auto-detect\n- **Cyanobacteria:** large genomes, sometimes split GTDB-Tk markers; cross-validate\n- **MAGs from metagenomes:** require CheckM2 quality filter first\n- **Strain-level resolution:** ANI > 99% needed; epidemiological context useful\n- **Endosymbionts:** small \u002F reduced genomes; ANI may be unreliable\n- **High-GC genomes (Streptomyces, Mycobacterium):** GTDB-Tk specific markers handle these\n- **Type strains:** authoritative anchor for taxonomy; TYGS automatic\n- **Pre-2017 ANI publications:** likely used 30-fold lower-precision tools; verify current ANI\n- **Sub-species naming:** ANI 99% + biology + epidemiology; not standardized\n- **Cross-domain comparisons (Bacteria vs Archaea):** rarely meaningful; AAI better\n\n## Anticipated Reviewer Pushback\n\n| Pushback | Standard response |\n|----------|-------------------|\n| \"Why 95% ANI?\" | Jain 2018 Nat Comm 9:5114; 90,000 prokaryote genomes demonstrate clear bimodality at 95% |\n| \"Genus-specific radius?\" | GTDB-Tk uses genus-specific ANI radius; ranges 94-99% per genus |\n| \"AF >= 0.5 reported?\" | Yes; standard convention; sub-0.5 invalidates species call |\n| \"Tool choice?\" | skani 2.4+ default in GTDB-Tk; FastANI for verification; OrthoANI as third check for borderline cases |\n| \"GTDB vs NCBI?\" | GTDB taxonomy is genome-based; NCBI is heritage; cite GTDB primary, NCBI secondary |\n| \"Type strain comparison?\" | TYGS automatic type-strain matching; reported alongside ANI |\n| \"MAG quality?\" | CheckM2 >= 70% completeness, \u003C 5% contamination required; reported per MAG |\n| \"dDDH for novel species?\" | TYGS performed; dDDH >= 70% threshold for same species |\n| \"Multiple methods agree?\" | skani + FastANI + OrthoANI converged within 1% on candidate pairs |\n| \"GTDB release version?\" | r220 (2024-Q3); database version pinned |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| skani \"sketch incompatible\" | Old sketch + new skani | Rebuild sketches; use same skani version |\n| GTDB-Tk \"marker not found\" | Wrong GTDB version | Update GTDB-Tk + database to matching release |\n| FastANI \"no alignment\" | \u003C 75% ANI | Switch to AAI or Mash |\n| pyani memory exhaustion | > 50 genomes | Use skani or pre-cluster with Mash |\n| Mash distance pvalue uninformative | Default | Use NA filter; trust distance directly |\n| TYGS web rate limit | Submitting too many genomes | Batch submissions; use offline GGDC if available |\n| GTDB-Tk classify_wf classification empty | Genomes \u003C 50% complete | Filter MAGs with CheckM2 first |\n| OrthoANI very slow | All-vs-all on > 50 genomes | Use skani for screening |\n| skani sketch GTDB databases | GTDB-Tk auto-sketches | Don't re-sketch separately |\n| Custom species ID needed | TYGS supports type-strain comparison + GGDC for dDDH | Use both |\n| ANI vs 16S contradict | 16S insufficient | Trust ANI |\n| Subspecies confusion | ANI > 99% + biology required | Standardize naming |\n\n## Tool Installation Notes\n\n```bash\n# skani\nconda install -c bioconda skani\n\n# FastANI\nconda install -c bioconda fastani\n\n# GTDB-Tk\nconda install -c bioconda gtdbtk\n# Download database\nwget https:\u002F\u002Fdata.gtdb.ecogenomic.org\u002Freleases\u002Frelease220\u002F220.0\u002Fauxillary_files\u002Fgtdbtk_r220_data.tar.gz\ntar xf gtdbtk_r220_data.tar.gz\nexport GTDBTK_DATA_PATH=$PWD\u002Frelease220\n\n# pyani \u002F pyANI\npip install pyani-plus\n\n# Mash + Dashing 2\nconda install -c bioconda mash\nconda install -c bioconda dashing2\n\n# CheckM2 for MAG QC\nconda install -c bioconda checkm2\n\n# OrthoANI \u002F OrthoANIu\ngit clone https:\u002F\u002Fgithub.com\u002FEzbioCloud-Bioinformatics-Team\u002FOrthoANIu\n```\n\nFor 1000+ genome scans, use cluster with 64+ cores; skani all-vs-all on 1000 genomes runs in ~10-30 minutes; GTDB-Tk classify_wf runs in ~20-60 min per 100 genomes.\n\n## References\n\n- Jain C et al 2018 Nat Commun 9:5114 (FastANI; 95% ANI threshold)\n- Shaw J & Yu YW 2023 Nat Methods 20:1661 (skani)\n- Chaumeil P-A et al 2020 Bioinformatics 36:1925 (GTDB-Tk v1)\n- Chaumeil P-A et al 2022 Bioinformatics 38:5315 (GTDB-Tk v2)\n- Parks DH et al 2018 Nat Biotech 36:996 (GTDB establishment)\n- Parks DH et al 2022 Nucleic Acids Res 50:D785 (GTDB r207)\n- Meier-Kolthoff JP & Goker M 2019 Nat Commun 10:2182 (TYGS)\n- Auch AF et al 2010 Stand Genomic Sci 2:117 (GGDC)\n- Ondov BD et al 2016 Genome Biol 17:132 (Mash MinHash)\n- Baker DN & Langmead B 2023 Genome Res 33:1218 (Dashing 2)\n- Pritchard L et al 2016 Anal Methods 8:12 (pyani)\n- Lee I et al 2016 IJSEM 66:1100 (OrthoANI)\n- Richter M et al 2016 Bioinformatics 32:929 (JSpeciesWS web server)\n- Goris J et al 2007 IJSEM 57:81 (ANI threshold validation)\n- Konstantinidis KT & Tiedje JM 2005 PNAS 102:2567 (species definition via ANI + gene content)\n- Stackebrandt E & Ebers J 2006 Microbiol Today 33:152 (16S thresholds; superseded)\n- Chklovski A et al 2023 Nat Methods 20:1203 (CheckM2)\n- Olm MR et al 2017 ISME J 11:2864 (dRep; ANI clustering)\n- Rodriguez-R LM & Konstantinidis KT 2014 Microbe 9:111 (ANI reference)\n- Yoon S-H et al 2017 IJSEM 67:1613 (EzBioCloud database)\n- Larralde M et al 2025 NAR Genom Bioinform 7:lqaf095 (pyskani, pyfastani, pyorthoani)\n\n## Related Skills\n\n- comparative-genomics\u002Fpangenome-analysis - ANI-based clustering precedes pangenome construction\n- comparative-genomics\u002Fortholog-inference - Cross-species ANI as orthology benchmark\n- comparative-genomics\u002Fhgt-detection - High-ANI same-species genomes for HGT context\n- comparative-genomics\u002Fgene-tree-species-tree-reconciliation - Species-tree construction precedes ANI species delineation\n- phylogenetics\u002Fspecies-trees - Marker-gene tree alongside ANI\n- metagenomics\u002Fkraken-classification - Metagenomic classification different problem\n- metagenomics\u002Fmetaphlan-profiling - Profile vs taxonomic placement\n- genome-assembly\u002Fassembly-qc - Quality before classification\n- read-qc\u002Fquality-reports - CheckM2 on MAGs\n- variant-calling\u002Fclinical-interpretation - Pathogen typing context\n","## Version Compatibility\n\nReference examples tested with: skani 0.2.5+ (Shaw & Yu 2023 Nat Methods 20:1661; bluenote-1577\u002Fskani), FastANI 1.34+ (Jain 2018 Nat Commun 9:5114), pyani 0.3.0+ (Pritchard 2016 Anal Methods 8:12), pyskani 0.1+ (Larralde 2025), OrthoANI 1.40+ (Lee 2016 Int J Syst Evol Microbiol 66:1100), OrthoANIu 1.2+, GTDB-Tk 2.7.1+ (Chaumeil 2022 Bioinformatics 38:5315), GTDB release 220 (2024-Q3+), TYGS web (Meier-Kolthoff & Goker 2019 Nat Commun 10:2182), GGDC v3.0 (web), Mash 2.3+ (Ondov 2016 Genome Biol 17:132), Dashing 2 (Baker & Langmead 2023 Genome Res 33:1218), CompareM 0.1.2+ for AAI (Parks\u002FCherubini), pyANI 0.3.1+, BLAT 36+, DIAMOND 2.1+. JSpeciesWS web (Richter et al 2016 Bioinformatics 32:929).\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `skani --version`; `fastANI --version`; `gtdbtk --version`; `mash --version`; `pyani --version`\n- Python: `pip show gtdbtk pyani`\n\nIf code throws `GTDB-Tk database not found`, `skani sketch incompatible`, `Mash sketch version`, these tools have database-version coupling: GTDB-Tk requires the GTDB release matched to the binary version; Mash\u002Fskani sketches are forward-compatible but not always backward. Check `gtdbtk check_install` for database completeness.\n\n# Genome Distance and Species Delineation\n\n**\"Are these genomes the same species, and what species are they?\"** -> Prokaryote species delineation has shifted from 16S rRNA identity (now considered insufficient at \u003C 98.7%) to **whole-genome ANI** at a 95% threshold (Jain 2018 Nat Commun 9:5114; corroborating Goris 2007 and Konstantinidis 2005). The modern operational standard for taxonomy is **GTDB-Tk** (Chaumeil 2020\u002F2022 Bioinformatics 38:5315), which assigns genomes to the Genome Taxonomy Database (GTDB) using ANI radius + marker-gene placement. **skani** (Shaw & Yu 2023 Nat Methods 20:1661) has replaced FastANI as the default ANI tool in GTDB-Tk 2.4+ for being 20-30x faster while maintaining accuracy. The 95% ANI threshold is robust but not absolute -- the species circumscription radius varies by genus (Parks 2018 Nat Biotech 36:996).\n\n- CLI: `skani dist genomes1.fa genomes2.fa -t 16` -- fast ANI computation\n- CLI: `fastANI -q query.fa -r reference.fa -o output.txt` -- standard ANI\n- CLI: `gtdbtk classify_wf --genome_dir genomes\u002F --out_dir gtdbtk_out --cpus 32` -- GTDB classification\n- CLI: `mash dist *.fa` -- k-mer MinHash distance\n- Web: TYGS (https:\u002F\u002Ftygs.dsmz.de\u002F) and GGDC (https:\u002F\u002Fggdc.dsmz.de\u002F) for dDDH\n\n## Algorithmic Taxonomy\n\n| Tool | Approach | Output | Strength | Fails when |\n|------|----------|--------|----------|------------|\n| skani (Shaw & Yu 2023 Nat Methods 20:1661) | Sparse chaining on minimizers; ANI estimation | ANI percent + alignment fraction | 20-30x faster than FastANI; default in GTDB-Tk 2.4+; supports MAGs | Currently no AAI; not for cross-domain (archaea vs bacteria) |\n| FastANI (Jain 2018 Nat Comm 9:5114) | Mashmap-based fragment alignment | ANI percent + orthologous fraction | Standard ANI tool 2018-2023; well-validated | Slower than skani; designed for >=80% identity |\n| pyani \u002F pyANI (Pritchard 2016 Anal Methods 8:12) | Multi-method ANI: ANIb (BLASTN), ANIm (MUMmer), TETRA | ANI matrix + visualization | Multiple algorithm consensus; reproducible | Slower than skani \u002F FastANI; legacy for many studies |\n| OrthoANI \u002F OrthoANIu (Lee 2016 IJSEM 66:1100) | Reciprocal-best-orthologs ANI | ANI percent (more robust than blast-based) | Considered more precise than ANIb | Slower; less integrated |\n| GTDB-Tk (Chaumeil 2020\u002F2022 Bioinformatics 38:5315) | Marker-gene phylogeny + ANI radius (skani; was FastANI v2.3.x) | Taxonomic classification at all ranks (GTDB nomenclature) | Modern prokaryote taxonomy standard | Specific to GTDB; some classifications differ from NCBI |\n| TYGS (Meier-Kolthoff & Goker 2019 Nat Commun 10:2182) | dDDH (digital DNA-DNA hybridization) | Pairwise dDDH + species delineation | Most rigorous species delineation (vs traditional DDH) | Web-only; rate-limited; specific platform |\n| GGDC (Auch 2010 Stand Genomic Sci 2:117; v3 web) | Digital DDH calculation | dDDH percent + thresholds | Validated against laboratory DDH | Web-only; computational cost |\n| Mash (Ondov 2016 Genome Biol 17:132) | MinHash k-mer sketches | Approximate distance (1 - similarity) | Extremely fast for large-scale clustering | k-mer-based; loses biological interpretation |\n| Dashing 2 (Baker & Langmead 2023 GR 33:1218) | Sketching with Bloom filter optimization | Same as Mash but faster | 5-10x faster than Mash | Newer; less broadly used |\n| pyskani (Larralde 2025 NAR Genom Bioinform) | Python wrapper around skani | ANI in Python | Programmatic access; CI\u002FCD friendly | Newer; ecosystem still developing |\n| CompareM | All-vs-all AAI (amino acid identity) | AAI percent | Cross-genus comparison via protein | Slow; needs all proteomes |\n| JSpeciesWS (web; Richter et al 2016) | ANIb \u002F ANIm | Web ANI + species delineation | Standard for clinical microbiology | Web rate limits; slow |\n| ANI Calculator (CGB Korea) | Web ANI | Web ANI | Quick check | Web-only |\n\nMethodology evolves; verify GTDB release (currently r220 \u002F 2024-Q3) and GTDB-Tk version compatibility. The 95% ANI species threshold has been confirmed across 90,000+ prokaryote genomes (Jain 2018; Parks 2018 demonstrating clear bimodality).\n\n## Decision Tree by Experimental Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|------------------------|-----|\n| Classify a bacterial genome to species | GTDB-Tk classify_wf | Standard prokaryote taxonomy; ANI + marker-gene placement |\n| Compute ANI between two genomes | skani | Fast (vs FastANI); accurate |\n| Compute ANI for 1000+ genome pairs | skani all-vs-all | Scales; preferred for screening |\n| Verify species delineation publication | TYGS + GGDC dDDH | Gold standard for novel species |\n| MAG species assignment | GTDB-Tk + skani; CheckM2 first for completeness | MAGs need quality assessment + taxonomy |\n| Bacterial strain typing | ANIb or dDDH; 99-99.99% for same strain | Strain resolution requires ANI > 99% |\n| Sub-species \u002F serotype level | ANI > 99.5% + epidemiological context | Sub-species requires biology + ANI |\n| Across deep prokaryote divergence | AAI (CompareM); ANI saturates below 75% | AAI better for cross-genus |\n| Cross-archaeal vs bacterial taxonomy | Skani-archaea-aware OR separate analysis | Default skani doesn't differentiate domains explicitly |\n| Fast metagenomic taxonomy screen | Mash or Dashing 2 | k-mer-based; sketches reusable |\n| Distance for genome clustering | skani matrix -> hierarchical clustering or NJ | Standard workflow |\n| Reconcile 16S vs genome taxonomy | Run both; check for inter-genus conflicts | 16S \u003C 98.7% typically inadequate |\n| Build a reference database for ANI lookup | skani sketches indexed; query against | Pre-sketched reference for repeated queries |\n| Phylogenetic placement | GTDB-Tk + IQ-TREE on extracted markers | Place new genome in known tree |\n| AAI for genera-level comparison | CompareM or aai.rb (KBase) | AAI \u003C ANI signal at deep divergence |\n| Subspecies-level pathogenicity | ANI > 99% + virulence-gene annotation | ANI alone insufficient |\n| Type-strain comparison | TYGS automatic type-strain matching | Built-in type-strain database |\n\n## Per-Tool Failure Modes\n\n### skani \u002F FastANI ANI saturating below 75%\n\n**Trigger:** Computing ANI between two genomes at \u003C 75% nucleotide identity.\n\n**Mechanism:** ANI is computed only on alignable regions; at \u003C 75% identity, alignment fraction drops dramatically (\u003C 50%); the few alignable regions are biased toward conserved regions, inflating apparent ANI.\n\n**Symptom:** Reported ANI 75-80% with alignment fraction \u003C 50%; meaningless biologically.\n\n**Fix:** Below 75% ANI, switch to AAI (amino-acid identity from translated proteins); AAI is more meaningful at deep divergence (~50% AAI between distant genera). For ANI matrix at long range, use Mash distance (k-mer-based, no alignment).\n\n### GTDB-Tk database version mismatch\n\n**Trigger:** Using GTDB-Tk binary with mismatched GTDB reference data version.\n\n**Mechanism:** GTDB releases (r207, r214, r220, ...) include reference trees, marker-gene HMMs, and ANI sketch files; GTDB-Tk versions are aligned to specific releases. Mismatch causes silent or loud failures.\n\n**Symptom:** GTDB-Tk fails with \"marker gene HMM not found\" or runs but produces inconsistent classifications.\n\n**Fix:** Check release compatibility: `gtdbtk check_install` shows the expected vs found versions. Pin via `conda env`. Download the matching release from data.gtdb.ecogenomic.org.\n\n### Below-95% ANI but same species (genus-specific radius)\n\n**Trigger:** Strict 95% ANI threshold; rejecting closely related genomes as different species.\n\n**Mechanism:** Parks 2018 demonstrated species-circumscription radius varies (typically 95-99% but tighter for some clonal lineages). For some genera (e.g., Pseudomonas), the species threshold is 94% per genus-specific analysis.\n\n**Symptom:** Two clearly biologically-related strains (epidemiologically connected outbreak) have ANI 94%; using strict 95% calls them different species.\n\n**Fix:** Use GTDB-Tk's species radius approach which uses genus-specific cutoffs. For novel-species naming, consider 95% as primary + ecology + biology. Report ANI alongside additional context (gene content, phenotype, ecology).\n\n### High alignment fraction required (AF >= 0.5)\n\n**Trigger:** ANI reported without alignment fraction; or AF \u003C 0.5.\n\n**Mechanism:** A 95% ANI with 20% AF (only 20% of genome alignable) is biologically meaningless; the comparison covers a small fraction of the genomes. Standard species delineation requires AF >= 0.5 + ANI >= 95%.\n\n**Symptom:** ANI calls \"same species\" but only 20-30% of genome aligned.\n\n**Fix:** Require AF >= 0.5 + ANI >= 95% for species call. Below this, classification is ambiguous; consider AAI or HGT (e.g. a phage-rich genome will have low AF to its actual species).\n\n### MAG contamination \u002F incompleteness\n\n**Trigger:** Running GTDB-Tk on MAGs without CheckM2 pre-screening.\n\n**Mechanism:** Low-completeness MAGs (\u003C 50%) may have marker-gene gaps that break GTDB-Tk's placement; high-contamination MAGs (> 5%) place anomalously.\n\n**Symptom:** GTDB-Tk reports \"no genome retained\" or makes implausible classifications.\n\n**Fix:** Pre-filter MAGs with CheckM2 (Chklovski 2023 Nat Methods 20:1203): require >= 70% completeness, \u003C 5% contamination, \u003C 10% strain heterogeneity for species-level. For lower-quality MAGs, report genus-level only or exclude.\n\n### Mash distance vs ANI inconsistency\n\n**Trigger:** Using Mash distance for species delineation directly.\n\n**Mechanism:** Mash distance = 1 - (Mash similarity) is correlated with 1 - ANI but is not the same metric. The 0.05 Mash distance threshold (sometimes cited as \"5% Mash = 95% ANI\") is approximate; exact ANI varies +-0.5%.\n\n**Symptom:** Genomes with Mash distance 0.04-0.06 inconsistently called \"same species\" or not.\n\n**Fix:** Use Mash for fast screening + clustering, but verify species delineation with ANI on candidate pairs. Mash 0.05 ~ ANI 95% is a rough heuristic; not a publishable threshold.\n\n### Ortholog-based ANI conservative vs alignment-based\n\n**Trigger:** Comparing OrthoANI \u002F OrthoANIu to FastANI \u002F skani.\n\n**Mechanism:** OrthoANI uses reciprocal-best-orthologs; FastANI uses fragment alignment. They differ by 0.5-2% systematically; OrthoANI is more conservative.\n\n**Symptom:** OrthoANI = 94.5%, FastANI = 96% on same pair; different \"same species\" calls.\n\n**Fix:** Document tool used; for taxonomy, use the tool aligned to the reference database (GTDB-Tk uses skani; NCBI uses FastANI). Cross-validation for unclear cases.\n\n### Tetranucleotide bias inflating Mash for low-GC genomes\n\n**Trigger:** Comparing genomes with extreme GC content (Streptomyces ~70% vs Mycoplasma ~25%) via Mash.\n\n**Mechanism:** k-mer frequency distributions are GC-dependent; Mash distance between extreme-GC genomes is inflated by background composition rather than biology.\n\n**Symptom:** Two unrelated extreme-GC genomes (e.g. Mycoplasma + Mycoplasma) appear closer than they biologically are.\n\n**Fix:** Use ANI \u002F AAI for cross-GC comparisons; Mash is reliable only within a GC-comparable range. Document GC range when reporting Mash distances.\n\n### Type strain conflicts in TYGS\n\n**Trigger:** Submitting genome to TYGS where type strain is missing or misclassified.\n\n**Mechanism:** TYGS depends on type strain database; if the type strain is genome-sequenced incompletely or misclassified, the placement may be incorrect.\n\n**Symptom:** TYGS reports unexpected nearest type strain.\n\n**Fix:** Cross-validate with GTDB-Tk; check type-strain genome quality. For novel-species naming, TYGS report should be supplemented with manual taxonomic check.\n\n## Quantitative Thresholds\n\n| Quantity | Threshold | Source \u002F Rationale |\n|----------|-----------|-------------------|\n| Species delineation ANI | >= 95% (Jain 2018) | Standard; based on 90,000 prokaryote genomes |\n| Genus-specific species ANI radius | 94-99% (varies by clade) | Parks 2018 Nat Biotech 36:996 |\n| Alignment fraction (AF) for ANI | >= 0.5 | Operational convention (GTDB-Tk \u002F skani); below this, comparison too small |\n| Strain delineation ANI | >= 99% (typical); >= 99.5% strict | Operational |\n| Sub-species delineation | >= 99% ANI + epidemiology | Manual |\n| AAI species delineation | >= 70% | Operational convention; varies clade |\n| AAI genus delineation | >= 60% | Standard |\n| dDDH species delineation | >= 70% | Goris 2007; matches ANI 95% |\n| dDDH genus delineation | >= 50% | Auch 2010 |\n| 16S rRNA species threshold (deprecated) | >= 98.7% | Stackebrandt 2006; superseded by ANI |\n| Mash distance ~ ANI heuristic | 0.05 ~ 95% ANI | Ondov 2016; rough |\n| GTDB-Tk completeness for placement | >= 50% (CheckM2 OBLIGATE >= 70%) | Chaumeil 2022 |\n| GTDB-Tk contamination | \u003C 10% (\u003C 5% for species-level) | Chaumeil 2022 |\n| MAG quality for taxonomy | CheckM2 >= 70% comp, \u003C 5% cont, \u003C 10% strain het | Chklovski 2023 |\n| skani CLI threads | up to 64; scales linearly | skani docs |\n| skani sketch size | default 1000 minimizers; tunable | skani docs |\n| FastANI default fragment | 3000 bp; varies | Jain 2018 default |\n| GTDB-Tk classify_wf time per genome | 2-30 min on 16 CPUs | Empirical |\n| Type strain ANI uncertainty | +- 1% | Operational |\n\n## skani Standard Workflow\n\n**Goal:** Compute ANI between query and reference set; classify species.\n\n**Approach:** Build skani sketch -> compute distances -> apply species delineation logic.\n\n```bash\n# 1. Pre-sketch reference set\nskani sketch reference_genomes\u002F*.fa -o reference_sketches\n\n# 2. Compute ANI for a single query\nskani dist query.fa reference_sketches\u002F* -t 16 \\\n    --robust --slow > query_distances.tsv\n\n# 3. Compute all-vs-all matrix (large set)\nskani triangle genomes\u002F*.fa -t 32 --robust --sparse -o ani_matrix.tsv\n# --sparse emits tabular Ref_file Query_file ANI Align_fraction_ref Align_fraction_query;\n# without --sparse, `skani triangle` emits a Phylip-style square matrix.\n\n# 4. Filter and visualize\nawk '$3 >= 95 && $5 >= 50' query_distances.tsv > species_matches.tsv\n```\n\n```python\n'''Apply 95% ANI species delineation with AF >= 0.5 constraint.'''\nimport pandas as pd\nimport numpy as np\n\n\ndef parse_skani(path):\n    '''skani output: Ref_file Query_file ANI Align_fraction_ref Align_fraction_query'''\n    df = pd.read_csv(path, sep='\\t')\n    df.columns = ['ref_file', 'query_file', 'ani', 'af_ref', 'af_query']\n    return df\n\n\ndef species_delineate(df, ani_threshold=95.0, af_threshold=0.5):\n    '''Return genome pairs called same species.'''\n    df['min_af'] = df[['af_ref', 'af_query']].min(axis=1)\n    same_species = df[(df['ani'] >= ani_threshold) & (df['min_af'] >= af_threshold)]\n    return same_species\n```\n\n## GTDB-Tk Classification Workflow\n\n**Goal:** Assign GTDB taxonomy (kingdom -> species) to a set of bacterial\u002Farchaeal genomes.\n\n**Approach:** GTDB-Tk classify_wf identifies markers, builds tree placement, calculates ANI radius, returns full taxonomy.\n\n```bash\n# Set environment\nexport GTDBTK_DATA_PATH=\u002Fpath\u002Fto\u002Frelease220_data\n\n# Verify install\ngtdbtk check_install\n\n# Run classify_wf\ngtdbtk classify_wf \\\n    --genome_dir genomes\u002F \\\n    --out_dir gtdbtk_out \\\n    --cpus 32 \\\n    --extension fa \\\n    --skip_ani_screen   # Skip if want phylogeny-based only\n\n# Output:\n#   gtdbtk_out\u002Fclassify\u002Fgtdbtk.bac120.summary.tsv   bacterial classifications\n#   gtdbtk_out\u002Fclassify\u002Fgtdbtk.ar53.summary.tsv     archaeal classifications\n#   gtdbtk_out\u002Fidentify\u002F                              marker gene tables\n#   gtdbtk_out\u002Falign\u002F                                 multiple sequence alignments\n```\n\n```python\n'''Parse GTDB-Tk summary for ranked classification.'''\nimport pandas as pd\n\n\ndef parse_gtdbtk_summary(path):\n    '''GTDB-Tk summary columns include: user_genome, classification, classification_method, ani, msa_percent'''\n    df = pd.read_csv(path, sep='\\t')\n    df['classification_split'] = df['classification'].str.split(';')\n    df['kingdom'] = df['classification_split'].str[0].str.replace('d__', '')\n    df['phylum'] = df['classification_split'].str[1].str.replace('p__', '')\n    df['class'] = df['classification_split'].str[2].str.replace('c__', '')\n    df['order'] = df['classification_split'].str[3].str.replace('o__', '')\n    df['family'] = df['classification_split'].str[4].str.replace('f__', '')\n    df['genus'] = df['classification_split'].str[5].str.replace('g__', '')\n    df['species'] = df['classification_split'].str[6].str.replace('s__', '')\n    return df\n\n\ndf = parse_gtdbtk_summary('gtdbtk_out\u002Fclassify\u002Fgtdbtk.bac120.summary.tsv')\ndf_species_level = df[df['species'] != '']  # Species-level classification\ndf_high_quality = df[df['msa_percent'] > 80]\n```\n\n## TYGS \u002F GGDC for dDDH\n\nFor publication-grade novel-species naming, dDDH is required. Use the TYGS web service (https:\u002F\u002Ftygs.dsmz.de\u002F) or GGDC (https:\u002F\u002Fggdc.dsmz.de\u002F). Submit FASTA -> receive dDDH against type strains + phylogeny.\n\n## Mash for Fast Clustering\n\n```bash\n# Sketch all genomes (do once)\nmash sketch -p 16 -o all_sketches genomes\u002F*.fa\n\n# All-vs-all distance\nmash dist -p 16 all_sketches.msh all_sketches.msh > mash_distances.tsv\n\n# Cluster via NJ or hierarchical clustering\npython -c \"\nimport pandas as pd\nfrom scipy.cluster import hierarchy\ndf = pd.read_csv('mash_distances.tsv', sep='\\t', header=None,\n                 names=['ref', 'query', 'distance', 'pvalue', 'shared_hashes'])\nmatrix = df.pivot('ref', 'query', 'distance').fillna(0)\nlinkage = hierarchy.linkage(matrix.values, method='average')\nhierarchy.dendrogram(linkage, labels=matrix.columns)\n\"\n```\n\n## Reconciliation: When Methods Disagree\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| skani says 96%, FastANI says 95.5% | Tool difference; both > 95% threshold | Consistent species call |\n| skani says 95.2%, FastANI says 94.8% | Borderline case, tool difference | Cross-validate with OrthoANI; check GTDB-Tk |\n| ANI = 94%, dDDH = 70% | Different metrics; both borderline same-species | Standard concordant ambiguous; report both |\n| 16S rRNA same; ANI \u003C 95% | 16S insufficient for species (Stackebrandt 2006) | Trust ANI; reclassify |\n| GTDB says species X, NCBI says species Y | GTDB taxonomy differs from NCBI for ~10% of species | Use GTDB for genome-based; cite both if external comparison |\n| ANI 96%, AF 0.3 | Insufficient alignment fraction | Same-species call invalid; report cautious |\n| ANI 99%, AF 0.9 | Same species, high confidence | Robust species call |\n| Mash 0.04 distance, FastANI 94.5% ANI | Different units; both around species threshold | Use ANI for definitive call |\n| OrthoANI 94%, FastANI 96% | Method variation | Cross-check with skani; report range |\n| GTDB-Tk classifies but MSA % \u003C 50 | Low-quality placement | Report at higher rank (genus) only |\n| TYGS gives unexpected nearest type strain | Type-strain database issue | Verify type-strain quality; cross-validate with GTDB |\n| MAG GTDB-Tk classify fails | Incomplete MAG; missing markers | Improve assembly; report at family or order only |\n\n**Operational rule for publication:** GTDB-Tk classify_wf as primary classification + ANI to nearest type strain (skani or FastANI) + AF >= 0.5 + report Tettelin partition where relevant + cross-validate with dDDH (TYGS) for novel-species claims.\n\n## Cohort Gotchas\n\n- **Archaea:** GTDB has separate ar53 marker set; specify `--archaea` or let GTDB-Tk auto-detect\n- **Cyanobacteria:** large genomes, sometimes split GTDB-Tk markers; cross-validate\n- **MAGs from metagenomes:** require CheckM2 quality filter first\n- **Strain-level resolution:** ANI > 99% needed; epidemiological context useful\n- **Endosymbionts:** small \u002F reduced genomes; ANI may be unreliable\n- **High-GC genomes (Streptomyces, Mycobacterium):** GTDB-Tk specific markers handle these\n- **Type strains:** authoritative anchor for taxonomy; TYGS automatic\n- **Pre-2017 ANI publications:** likely used 30-fold lower-precision tools; verify current ANI\n- **Sub-species naming:** ANI 99% + biology + epidemiology; not standardized\n- **Cross-domain comparisons (Bacteria vs Archaea):** rarely meaningful; AAI better\n\n## Anticipated Reviewer Pushback\n\n| Pushback | Standard response |\n|----------|-------------------|\n| \"Why 95% ANI?\" | Jain 2018 Nat Comm 9:5114; 90,000 prokaryote genomes demonstrate clear bimodality at 95% |\n| \"Genus-specific radius?\" | GTDB-Tk uses genus-specific ANI radius; ranges 94-99% per genus |\n| \"AF >= 0.5 reported?\" | Yes; standard convention; sub-0.5 invalidates species call |\n| \"Tool choice?\" | skani 2.4+ default in GTDB-Tk; FastANI for verification; OrthoANI as third check for borderline cases |\n| \"GTDB vs NCBI?\" | GTDB taxonomy is genome-based; NCBI is heritage; cite GTDB primary, NCBI secondary |\n| \"Type strain comparison?\" | TYGS automatic type-strain matching; reported alongside ANI |\n| \"MAG quality?\" | CheckM2 >= 70% completeness, \u003C 5% contamination required; reported per MAG |\n| \"dDDH for novel species?\" | TYGS performed; dDDH >= 70% threshold for same species |\n| \"Multiple methods agree?\" | skani + FastANI + OrthoANI converged within 1% on candidate pairs |\n| \"GTDB release version?\" | r220 (2024-Q3); database version pinned |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| skani \"sketch incompatible\" | Old sketch + new skani | Rebuild sketches; use same skani version |\n| GTDB-Tk \"marker not found\" | Wrong GTDB version | Update GTDB-Tk + database to matching release |\n| FastANI \"no alignment\" | \u003C 75% ANI | Switch to AAI or Mash |\n| pyani memory exhaustion | > 50 genomes | Use skani or pre-cluster with Mash |\n| Mash distance pvalue uninformative | Default | Use NA filter; trust distance directly |\n| TYGS web rate limit | Submitting too many genomes | Batch submissions; use offline GGDC if available |\n| GTDB-Tk classify_wf classification empty | Genomes \u003C 50% complete | Filter MAGs with CheckM2 first |\n| OrthoANI very slow | All-vs-all on > 50 genomes | Use skani for screening |\n| skani sketch GTDB databases | GTDB-Tk auto-sketches | Don't re-sketch separately |\n| Custom species ID needed | TYGS supports type-strain comparison + GGDC for dDDH | Use both |\n| ANI vs 16S contradict | 16S insufficient | Trust ANI |\n| Subspecies confusion | ANI > 99% + biology required | Standardize naming |\n\n## Tool Installation Notes\n\n```bash\n# skani\nconda install -c bioconda skani\n\n# FastANI\nconda install -c bioconda fastani\n\n# GTDB-Tk\nconda install -c bioconda gtdbtk\n# Download database\nwget https:\u002F\u002Fdata.gtdb.ecogenomic.org\u002Freleases\u002Frelease220\u002F220.0\u002Fauxillary_files\u002Fgtdbtk_r220_data.tar.gz\ntar xf gtdbtk_r220_data.tar.gz\nexport GTDBTK_DATA_PATH=$PWD\u002Frelease220\n\n# pyani \u002F pyANI\npip install pyani-plus\n\n# Mash + Dashing 2\nconda install -c bioconda mash\nconda install -c bioconda dashing2\n\n# CheckM2 for MAG QC\nconda install -c bioconda checkm2\n\n# OrthoANI \u002F OrthoANIu\ngit clone https:\u002F\u002Fgithub.com\u002FEzbioCloud-Bioinformatics-Team\u002FOrthoANIu\n```\n\nFor 1000+ genome scans, use cluster with 64+ cores; skani all-vs-all on 1000 genomes runs in ~10-30 minutes; GTDB-Tk classify_wf runs in ~20-60 min per 100 genomes.\n\n## References\n\n- Jain C et al 2018 Nat Commun 9:5114 (FastANI; 95% ANI threshold)\n- Shaw J & Yu YW 2023 Nat Methods 20:1661 (skani)\n- Chaumeil P-A et al 2020 Bioinformatics 36:1925 (GTDB-Tk v1)\n- Chaumeil P-A et al 2022 Bioinformatics 38:5315 (GTDB-Tk v2)\n- Parks DH et al 2018 Nat Biotech 36:996 (GTDB establishment)\n- Parks DH et al 2022 Nucleic Acids Res 50:D785 (GTDB r207)\n- Meier-Kolthoff JP & Goker M 2019 Nat Commun 10:2182 (TYGS)\n- Auch AF et al 2010 Stand Genomic Sci 2:117 (GGDC)\n- Ondov BD et al 2016 Genome Biol 17:132 (Mash MinHash)\n- Baker DN & Langmead B 2023 Genome Res 33:1218 (Dashing 2)\n- Pritchard L et al 2016 Anal Methods 8:12 (pyani)\n- Lee I et al 2016 IJSEM 66:1100 (OrthoANI)\n- Richter M et al 2016 Bioinformatics 32:929 (JSpeciesWS web server)\n- Goris J et al 2007 IJSEM 57:81 (ANI threshold validation)\n- Konstantinidis KT & Tiedje JM 2005 PNAS 102:2567 (species definition via ANI + gene content)\n- Stackebrandt E & Ebers J 2006 Microbiol Today 33:152 (16S thresholds; superseded)\n- Chklovski A et al 2023 Nat Methods 20:1203 (CheckM2)\n- Olm MR et al 2017 ISME J 11:2864 (dRep; ANI clustering)\n- Rodriguez-R LM & Konstantinidis KT 2014 Microbe 9:111 (ANI reference)\n- Yoon S-H et al 2017 IJSEM 67:1613 (EzBioCloud database)\n- Larralde M et al 2025 NAR Genom Bioinform 7:lqaf095 (pyskani, pyfastani, pyorthoani)\n\n## Related Skills\n\n- comparative-genomics\u002Fpangenome-analysis - ANI-based clustering precedes pangenome construction\n- comparative-genomics\u002Fortholog-inference - Cross-species ANI as orthology benchmark\n- comparative-genomics\u002Fhgt-detection - High-ANI same-species genomes for HGT context\n- comparative-genomics\u002Fgene-tree-species-tree-reconciliation - Species-tree construction precedes ANI species delineation\n- phylogenetics\u002Fspecies-trees - Marker-gene tree alongside ANI\n- metagenomics\u002Fkraken-classification - Metagenomic classification different problem\n- metagenomics\u002Fmetaphlan-profiling - Profile vs taxonomic placement\n- genome-assembly\u002Fassembly-qc - Quality before classification\n- read-qc\u002Fquality-reports - CheckM2 on MAGs\n- variant-calling\u002Fclinical-interpretation - Pathogen typing context\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","cli","2026-09-20","comparative-genomics\u002Fgenome-distance-and-species-delineation\u002FSKILL.md","skani","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-comparative-genomics-genome-distance-and-species-delineation","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-comparative-genomics-genome-distance-and-species-delineation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-comparative-genomics-genome-distance-and-species-delineation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-comparative-genomics-genome-distance-and-species-delineation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-comparative-genomics-genome-distance-and-species-delineation\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fskani_ani_species_delineation.sh","SCRIPT","脚本",3483,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-comparative-genomics-genome-distance-and-species-delineation\u002Fexamples\u002Fskani_ani_species_delineation.sh",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",4894,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-comparative-genomics-genome-distance-and-species-delineation\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]