[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ECZEYZBHEGYVBYGJ73KRAC":3,"skill-same:01M7ECZEYZBHEGYVBYGJ73KRAC":68},{"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},"01M7ECZEYZBHEGYVBYGJ73KRAC","bio-ecological-genomics-species-delimitation",null,"Delimits putative species boundaries from molecular data within the de Queiroz 2007 unified-lineage framework using ASAP (Puillandre 2021 successor to ABGD), mPTP C++ (Kapli 2017 successor to bPTP; bPTP is Python NOT R), GMYC single\u002Fmulti-threshold (Pons 2006; Fujisawa 2013), multilocus BPP v4 with prior calibration from data (NOT defaults; Yang 2015), SNAPP + BFD* for SNP delimitation, DELINEATE (Sukumaran 2021) speciation-process modeling to address Sukumaran & Knowles 2017 PNAS critique that MSC delimits structure not species, integrative-taxonomy congruence (Padial 2010; Carstens 2013), Dsuite for introgression testing before sister claims (Malinsky 2021), and Meyer & Paulay 2005 barcoding-gap-absence caveat. Use when delineating species from DNA barcoding data, resolving cryptic complexes, choosing among ASAP\u002FmPTP\u002FBPP\u002FDELINEATE, calibrating BPP priors, distinguishing introgression from ILS, or applying the Sukumaran-Knowles oversplitting correction.","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-ecological-genomics-species-delimitation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-ecological-genomics-species-delimitation\ndescription: Delimits putative species boundaries from molecular data within the de Queiroz 2007 unified-lineage framework using ASAP (Puillandre 2021 successor to ABGD), mPTP C++ (Kapli 2017 successor to bPTP; bPTP is Python NOT R), GMYC single\u002Fmulti-threshold (Pons 2006; Fujisawa 2013), multilocus BPP v4 with prior calibration from data (NOT defaults; Yang 2015), SNAPP + BFD* for SNP delimitation, DELINEATE (Sukumaran 2021) speciation-process modeling to address Sukumaran & Knowles 2017 PNAS critique that MSC delimits structure not species, integrative-taxonomy congruence (Padial 2010; Carstens 2013), Dsuite for introgression testing before sister claims (Malinsky 2021), and Meyer & Paulay 2005 barcoding-gap-absence caveat. Use when delineating species from DNA barcoding data, resolving cryptic complexes, choosing among ASAP\u002FmPTP\u002FBPP\u002FDELINEATE, calibrating BPP priors, distinguishing introgression from ILS, or applying the Sukumaran-Knowles oversplitting correction.\ntool_type: mixed\nprimary_tool: ASAP\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"ecological-genomics\u002Fspecies-delimitation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: ASAP (current CLI), mPTP (current C++), bPTP (Python from github.com\u002Fzhangjiajie\u002FPTP), splits 1.0+ for GMYC, BPP 4.7+, SNAPP\u002FBEAST 2.7+, DELINEATE (current Python), Dsuite 0.5+, ape 5.7+, fossil 0.4+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Species Delimitation\n\n**\"Delineate species boundaries from my DNA barcoding or genomic data\"** -> Apply distance-based (ASAP) and tree-based (mPTP) methods for primary delimitation, multilocus coalescent (BPP) for genomic confirmation, DELINEATE for speciation-process modeling to address MSC oversplitting, integrative-taxonomy validation across multiple lines of evidence, and Dsuite to test introgression before claiming sister relationships.\n- CLI: `asap` (downloadable C binary) OR web (https:\u002F\u002Fbioinfo.mnhn.fr\u002Fabi\u002Fpublic\u002Fasap\u002F) for single-locus primary delimitation\n- CLI: `mptp` (https:\u002F\u002Fgithub.com\u002FPas-Kapli\u002Fmptp) for tree-based multi-rate PTP (faster than bPTP)\n- Python: `bPTP` (https:\u002F\u002Fgithub.com\u002Fzhangjiajie\u002FPTP) for legacy tree-based delimitation — NOTE: Python not R\n- R: `splits::gmyc()` for GMYC on ultrametric trees\n- CLI: `bpp` (https:\u002F\u002Fbpp.github.io) for multilocus MSC delimitation; control-file driven\n- CLI: `Dsuite` for D-statistics \u002F f4-ratio \u002F f-branch introgression testing\n\n## The Single Most Important Modern Insight -- MSC Methods Delimit Structure, NOT Species\n\nSukumaran & Knowles 2017 *PNAS* 114(7):1607-1612 established that BPP, BFD*, and other multispecies-coalescent methods **delimit genetic structure, not species**. The mathematical reason: the MSC model treats every panmictic population as a \"species\" in the parameterization. Applied to data with substructure (isolated demes within a species), MSC methods partition that structure into \"species\" — leading to systematic oversplitting in published literature, especially in lizards, frogs, geckos, and insects.\n\n**Modern best practice (post-2021):**\n1. Run MSC methods (BPP, BFD*) as PRELIMINARY enumeration of candidate population lineages\n2. Apply DELINEATE (Sukumaran 2021 *PLoS Comput Biol* 17:e1008924) to test which lineages have completed speciation vs are in the speciation process\n3. Validate via integrative taxonomy (Padial 2010; Carstens 2013) — morphological, ecological, geographic congruence\n\nA second cornerstone: **the barcoding gap is OFTEN absent in real data** (Meyer & Paulay 2005 *PLoS Biol* 3:e422). ABGD and ASAP are theoretically grounded in the gap; when the gap is absent, both fail gracefully but their output is unreliable. Always inspect the pairwise distance histogram.\n\nA third: **Dsuite-checked introgression must precede sister-species claims.** D-statistics, f4-ratio, and f-branch (Malinsky 2021) distinguish admixture from incomplete lineage sorting; without this check, ILS-driven discordance is misinterpreted as gene flow.\n\n## Algorithmic Taxonomy\n\n| Method | Input | Approach | Strength | Fails when |\n|--------|-------|----------|----------|------------|\n| ASAP (Puillandre 2021) | Aligned sequences | Hierarchical-clustering distance partitioning with new scoring | Fast; modern; web + CLI | Single locus; works only if barcoding gap exists |\n| ABGD (Puillandre 2012) | Aligned sequences | Distance gap-detection across priors | Legacy; superseded by ASAP | Less robust when gap is weak |\n| GMYC (Pons 2006) | Ultrametric tree | Yule-coalescent transition threshold | Theoretical foundation | Requires time-calibrated tree |\n| Multi-threshold GMYC (Fujisawa & Barraclough 2013) | Ultrametric tree | Per-lineage transition thresholds | Heterogeneous rates | Same; not always more powerful |\n| bPTP (Zhang 2013) | Rooted phylogeny | Bayesian PTP MCMC | Posterior support per partition | Single intraspecific rate assumption; slower than mPTP |\n| mPTP (Kapli 2017) | Rooted phylogeny | Multi-rate PTP, C++ | Faster (5+ orders); per-species intraspecific rates | Heterogeneity-friendly; for shallow phylogenies bPTP may be more powerful |\n| BPP A10\u002FA11 (Yang & Rannala) | Multi-locus alignments | Bayesian multispecies coalescent | Rigorous, multilocus | Computationally heavy; oversplits per Sukumaran-Knowles |\n| SNAPP (Bryant 2012) | Biallelic SNP data | Coalescent species-tree bypassing gene trees | High-power genomic | Cubic complexity; not for very large datasets |\n| BFD* (Leache 2014) | SNP data via SNAPP | Bayes-factor delimitation | Genomic-scale species hypothesis testing | Same oversplitting risk |\n| DELINEATE (Sukumaran 2021) | BPP output + guide tree | Speciation-process modeling | Distinguishes structure from species | Requires preliminary delimitation as input |\n| Dsuite (Malinsky 2021) | VCF + populations | D-statistic, f4-ratio, f-branch | Tests introgression vs ILS | Tree must accurately reflect history |\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|---------------------|-----|\n| Primary species hypothesis from single locus | ASAP first; cross-check with mPTP | ASAP is the modern successor to ABGD; faster and better-scoring |\n| Tree-based delimitation, heterogeneous intraspecific rates | mPTP | Per-species rate model; 5+ orders faster than bPTP |\n| Tree-based delimitation, shallow phylogeny | bPTP (single-rate) or mPTP | When rates are similar, single-rate model may be more powerful |\n| Time-calibrated tree from BEAST \u002F chronos | GMYC (single or multi-threshold) | Requires ultrametric; both threshold variants worth comparing |\n| Multilocus genomic delimitation | BPP A10\u002FA11 + DELINEATE | BPP alone oversplits per Sukumaran-Knowles 2017 |\n| SNP-based species hypothesis test | SNAPP + BFD* | Coalescent species-tree from biallelic SNPs |\n| Confirm BPP result is not oversplitting | DELINEATE (Sukumaran 2021) | Speciation-process modeling distinguishes structure from species |\n| Test introgression before sister-species claim | Dsuite (D, f4-ratio, f-branch) | Distinguishes admixture from ILS |\n| Cryptic species complex | Integrative taxonomy: genetic + morphological + ecological congruence | Single-method conclusion unreliable |\n| ABGD\u002FASAP returns no clear partition | Inspect pairwise distance histogram; do not force partition | Barcoding gap may be absent (Meyer & Paulay 2005) |\n| Recently-diverged populations (Ne*t \u003C\u003C 1) | Caution; MSC methods very prone to oversplit | Incomplete lineage sorting indistinguishable from shallow structure |\n| Conservation management unit definition | Moritz 1994 ESU\u002FMU framework, NOT MSC delimitation | Sukumaran-Knowles caveat applies |\n\n## ASAP — The Modern Successor to ABGD\n\n**Goal:** Primary species hypothesis from a single-locus alignment via hierarchical clustering of pairwise distances, scored by a new asap-score (Puillandre 2021).\n\n**Approach:** Run ASAP via the web interface (https:\u002F\u002Fbioinfo.mnhn.fr\u002Fabi\u002Fpublic\u002Fasap\u002F) OR the downloadable C binary. ASAP ranks candidate partitions by asap-score (lower = better); always inspect the top 5-10 partitions, not just the best, and check for large score gaps that signal robust partitioning. Output: ranked species partitions with asap-score, p-value, and threshold distance per partition.\n\n```bash\n# ASAP CLI (downloadable C binary)\n# Substitution model: K2P standard for COI; p-distance for very closely related; JC for general\n.\u002Fasap -d K2P -o asap_results\u002F aligned_sequences.fasta\n\n# Inspect output\n# - asap_output.csv: ranked partitions by asap-score (lower = better)\n# - Always look at top 5-10 partitions; large score gaps = robust partitioning\n# - The \"best\" partition is the top-ranked; report secondary partitions too\n```\n\n```python\n# Python ASAP-style analysis for inspection (NOT a substitute for ASAP)\n# Useful for understanding the distance landscape\nfrom Bio import AlignIO\nfrom Bio.Phylo.TreeConstruction import DistanceCalculator\nfrom scipy.cluster.hierarchy import fcluster, linkage\nfrom scipy.spatial.distance import squareform\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nalignment = AlignIO.read('aligned_sequences.fasta', 'fasta')\ncalc = DistanceCalculator('identity')  # use K2P-friendly model in practice\ndm = calc.get_distance(alignment)\n\nnames = [r.id for r in alignment]\nn = len(names)\ndist_array = np.zeros((n, n))\nfor i in range(n):\n    for j in range(n):\n        dist_array[i][j] = dm[names[i], names[j]]\n\n# Inspect distance histogram for barcoding gap (often ABSENT per Meyer & Paulay 2005)\nupper = dist_array[np.triu_indices(n, k=1)]\nplt.hist(upper, bins=50)\nplt.xlabel('Pairwise distance')\nplt.ylabel('Frequency')\nplt.title('Distance histogram — look for bimodality (gap)')\nplt.savefig('barcoding_gap_histogram.pdf')\n\n# Hierarchical clustering at threshold scan\ncondensed = squareform(dist_array)\nZ = linkage(condensed, method='average')\nthresholds = np.arange(0.01, 0.10, 0.005)\nfor t in thresholds:\n    clusters = fcluster(Z, t=t, criterion='distance')\n    print(f'Threshold {t:.3f}: {len(set(clusters))} groups')\n```\n\n## mPTP — Multi-Rate PTP for Heterogeneous Intraspecific Rates\n\n**Goal:** Delimit species from a phylogeny by detecting the transition from speciation to coalescent branching rates, allowing per-species intraspecific rates (Kapli 2017).\n\n**Approach:** Run mPTP on a rooted ML tree (e.g., from RAxML or IQ-TREE). mPTP's multi-rate model is more flexible than bPTP's single-rate; for shallow phylogenies with similar rates, bPTP may be competitive. mPTP is C++ (5+ orders of magnitude faster than bPTP), available from https:\u002F\u002Fgithub.com\u002FPas-Kapli\u002Fmptp.\n\n```bash\n# mPTP installation: build from C source\n# git clone https:\u002F\u002Fgithub.com\u002FPas-Kapli\u002Fmptp\n# cd mptp && .\u002Fautogen.sh && .\u002Fconfigure && make\n\n# Run mPTP ML inference\nmptp --ml --tree_file rooted_tree.nwk --output_file mptp_ml\n\n# MCMC for posterior support\nmptp --mcmc 1000000 --mcmc_sample 1000 --mcmc_burnin 100000 \\\n     --tree_file rooted_tree.nwk --output_file mptp_mcmc\n\n# Output: species partition with branch annotations\n# > 0.95 posterior support: strong; 0.80-0.95: moderate; \u003C 0.80: uncertain\n```\n\n## bPTP — Legacy Tree-Based Delimitation (Python, NOT R)\n\n**Goal:** Bayesian Poisson Tree Processes delimitation with single intraspecific rate (Zhang 2013).\n\n**Approach:** Run bPTP via the Python package from https:\u002F\u002Fgithub.com\u002Fzhangjiajie\u002FPTP (NOTE: this is a Python tool, NOT an R package; `install.packages('PTP')` does not exist). For heterogeneous-rate data, prefer mPTP.\n\n```bash\n# bPTP Python install (NOT R)\npip install git+https:\u002F\u002Fgithub.com\u002FiTaxoTools\u002FPTP-pyqt5\n\n# Run bPTP MCMC\npython -m PTP.PTP -t rooted_tree.nwk -o bptp_results \\\n    --type bayesian --ngen 100000 --burnin 0.1 --seed 42\n\n# Output: posterior support per species partition (> 0.95 strong)\n# bPTP over-splits when populations have strong geographic substructure\n# Cross-check with ASAP and\u002For mPTP for consensus\n```\n\n## GMYC with Mandatory Ultrametric Tree\n\n**Goal:** Detect the threshold on an ultrametric phylogeny where branching transitions from interspecific (Yule) to intraspecific (coalescent).\n\n**Approach:** Convert ML tree to ultrametric with `ape::chronos` (penalized likelihood) or BEAST (Bayesian time-calibration), then run GMYC. Single-threshold vs multi-threshold; multi-threshold handles heterogeneous rates across the tree.\n\n```r\nlibrary(splits)\nlibrary(ape)\n\ntree \u003C- read.tree('rooted_tree.nwk')\n\n# Convert to ultrametric (REQUIRED for GMYC)\n# chronos: penalized likelihood; lambda=1 mid-clock\n# For rigorous time-calibration, use BEAST2 instead\nultrametric_tree \u003C- chronos(tree, lambda = 1)\nclass(ultrametric_tree) \u003C- 'phylo'\nstopifnot(is.ultrametric(ultrametric_tree))\n\n# Single-threshold GMYC\ngmyc_single \u003C- gmyc(ultrametric_tree, method = 'single')\nsummary(gmyc_single)\ncat('GMYC species (single-threshold):', gmyc_single$entity[1], '\\n')\ncat('LR test p-value:', gmyc_single$p.value[1], '\\n')\n\n# Multi-threshold for heterogeneous rates\ngmyc_multi \u003C- gmyc(ultrametric_tree, method = 'multiple')\nsummary(gmyc_multi)\n\n# Compare single vs multi-threshold; report both\nspecies_single \u003C- spec.list(gmyc_single)\nspecies_multi \u003C- spec.list(gmyc_multi)\n```\n\n## BPP A10\u002FA11 — Multilocus MSC Delimitation with Calibrated Priors\n\n**Goal:** Bayesian multilocus species delimitation under the multispecies coalescent (Yang & Rannala 2010; current Flouri 2018 BPP v4).\n\n**Approach:** Configure BPP A10 (joint delimitation + species tree estimation) with priors on theta and tau ESTIMATED FROM DATA — NOT defaults. Yang 2015 *Curr Zool* 61:854-865 gives explicit guidance: `thetaprior = G(2, 2000)` for small\u002Fmoderate data; tighter for large genomic data. Wrong priors dominate the analysis.\n\n```text\n# BPP control file for A10 analysis\n# CRITICAL: priors below are CALIBRATED to data, not defaults\n# Defaults are tuned for primate-mammal data; insects\u002Ffish\u002Fplants need adjustment\n\nseed = 12345\n\nseqfile = alignment.phy\nImapfile = imap.txt                   # map individuals -> putative species\noutfile = bpp_results.txt\nmcmcfile = bpp_mcmc.txt\n\nspeciesdelimitation = 1 0 2 0.5       # 1 = delimitation mode; rjMCMC parameters\nspeciestree = 1                       # 1 = estimate species tree\nspeciesmodelprior = 1                 # 1 = uniform prior on rooted trees\n\nspecies&tree = 4  speciesA speciesB speciesC speciesD\n                  10 8 12 6\n                  ((speciesA, speciesB), (speciesC, speciesD));\n\n# CALIBRATED theta prior (per-locus nucleotide diversity)\n# G(2, 2000) -> mean = 0.001 (calibrate from observed per-locus pi)\n# Yang 2015 Curr Zool 61:854 has taxon-specific recommendations\nthetaprior = 2 2000\n\n# CALIBRATED tau prior (divergence times)\n# Calibrate from observed maximum genetic distance \u002F mutation rate\ntauprior = 2 2000\n\n# MCMC\nnsample = 100000\nsampfreq = 2\nburnin = 50000\n\n# Run multiple independent chains; check convergence\n```\n\n```bash\n# Run BPP with multiple independent chains\nfor i in 1 2 3 4; do\n    bpp --cfile bpp_control.bpp --seed $((1000 * i)) --out bpp_run_$i.txt &\ndone\nwait\n\n# Compare chains; posterior probabilities must agree across chains\n# PP > 0.95 for a delimitation: strong support\n# PP 0.50-0.95: moderate; integrate other evidence\n```\n\n## DELINEATE — Addressing the Sukumaran-Knowles Oversplitting\n\n**Goal:** Test whether candidate lineages from BPP represent fully-formed species OR incomplete-speciation structure (Sukumaran 2021).\n\n**Approach:** Provide DELINEATE with a guide tree of population lineages and a hypothesis about which are species. The output: probability that each population lineage is a true species vs an incipient lineage. THE post-2021 best practice complement to BPP.\n\n```bash\n# DELINEATE (https:\u002F\u002Fgithub.com\u002Fjsukumaran\u002Fdelineate)\n# Python tool\npip install delineate\n\n# Configure delineate input\n# - guide tree: rooted Newick with population lineages as tips\n# - constraint file: which tips are confirmed species, which to test\ndelineate-estimate partitions \\\n    --tree-file population_lineage_tree.nwk \\\n    --config-file delineate_config.json \\\n    --output-prefix delineate_run\n\n# Output: probability that each lineage is a species\n# Use ALONGSIDE BPP; do not claim species from BPP alone post-2021\n```\n\n## Dsuite — Introgression vs Incomplete Lineage Sorting\n\n**Goal:** Test for introgression before claiming sister-species relationships, distinguishing admixture from ILS.\n\n**Approach:** Compute D-statistic (ABBA-BABA), f4-ratio (admixture fraction), and f-branch (Malinsky 2021 *Mol Ecol Resour* 21:584-595) on a VCF with population assignments. Non-zero D indicates introgression between H3 and one of H1\u002FH2.\n\n```bash\n# Dsuite (https:\u002F\u002Fgithub.com\u002Fmillanek\u002FDsuite)\n# Sets file: 3 columns (sample_id, population\u002Fspecies, optional outgroup tag)\n# Tree file: Newick with population names matching the sets file\n\n# All-trio D-statistic\nDsuite Dtrios -t species_tree.nwk sets.txt input.vcf.gz\n\n# F-branch decomposition (more interpretable than raw D)\nDsuite Fbranch species_tree.nwk Dtrios_output_tree.txt > fbranch.txt\n\n# Plot f-branch matrix\ndtools.py fbranch.txt species_tree.nwk\n\n# D > 0 with |Z| > 3: significant ABBA-BABA imbalance -> introgression\n# f4-ratio gives the admixture fraction estimate\n```\n\n## Per-Method Failure Modes\n\n### MSC delimitation oversplits population structure as species\n\n**Trigger:** Running BPP, BFD*, or other multispecies-coalescent methods on data with within-species substructure (isolated demes), then claiming the delimited lineages are species.\n\n**Mechanism:** The MSC model treats every panmictic population as a \"species\" in its parameterization (Sukumaran & Knowles 2017). When applied to data with population substructure, MSC partitions that structure into \"species.\"\n\n**Symptom:** Many \"species\" delimited; each with low sample size; lineages defined by geography rather than morphology; BPP posterior support is high but biological reality is unclear.\n\n**Fix:** Run DELINEATE (Sukumaran 2021) on the BPP output to test which lineages have completed speciation. Validate via integrative taxonomy (Padial 2010): require congruence across genetic + morphological + ecological evidence before publishing species.\n\n### ABGD\u002FASAP forced to partition data without a barcoding gap\n\n**Trigger:** Reporting \"best partition\" from ABGD or ASAP when the pairwise distance histogram is unimodal (no gap).\n\n**Mechanism:** ABGD and ASAP detect a gap in the pairwise-distance distribution that separates intra- from inter-specific divergences. Meyer & Paulay 2005 *PLoS Biol* 3:e422 demonstrated the gap is frequently absent.\n\n**Symptom:** Distance histogram is unimodal (no clear bimodality); ASAP partitions have similar scores across many K values; ABGD priors disagree.\n\n**Fix:** Inspect the distance histogram first; if no clear gap, do NOT report ASAP\u002FABGD results as definitive; integrate other lines of evidence.\n\n### bPTP oversplit on populations with strong substructure\n\n**Trigger:** Running bPTP on a tree where the same biological species has multiple isolated demes contributing genetic structure.\n\n**Mechanism:** bPTP detects branching-rate shifts as species boundaries; isolated demes within a species show coalescent-rate branching that bPTP partitions as separate species.\n\n**Symptom:** More bPTP species than morphologically recognized; species correspond to geographic regions.\n\n**Fix:** Cross-check with ASAP (more conservative) and with mPTP at multi-rate option; treat bPTP\u002FmPTP as preliminary; require congruence with other lines of evidence.\n\n### BPP with default theta and tau priors\n\n**Trigger:** Running BPP without calibrating priors to the data; using priors copied from a primate\u002Fmammal example file.\n\n**Mechanism:** BPP results depend critically on theta (per-locus nucleotide diversity) and tau (divergence time) priors. Default priors are typically tuned for mammal data; for insects, fish, plants with different mutation-rate and Ne contexts, defaults can dominate the posterior.\n\n**Symptom:** Posterior support clusters at 1.0 OR 0.0; results inconsistent with morphological \u002F ecological data; sensitivity to alternative priors is very high.\n\n**Fix:** Calibrate priors from data per Yang 2015 *Curr Zool* 61:854: estimate per-locus heterozygosity for theta mean; estimate divergence times from observed maximum genetic distances and mutation rate.\n\n### Reporting D-statistic without f-branch\n\n**Trigger:** Reporting raw D-statistics for many taxa without decomposing introgression patterns.\n\n**Mechanism:** D-statistic measures asymmetric site-pattern counts; with taxon-rich datasets, D > 0 can be confounded by ancient introgression in the outgroup or by ghost lineages. f-branch (Malinsky 2018) decomposes admixture across the tree more interpretably.\n\n**Symptom:** Many trios with D > 0; difficult to identify which specific introgression event drives the pattern.\n\n**Fix:** Report f-branch decomposition alongside D; check for consistent patterns across phylogenetic levels.\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F rationale |\n|-----------|-------|-------------------|\n| COI K2P \"species\" cutoff | typically 2-3% pairwise distance (variable) | Animal barcoding convention; verify per taxon |\n| ASAP score gap signaling robust partition | Large drop between consecutive scores | Puillandre 2021; inspect top 5-10 partitions |\n| bPTP\u002FmPTP posterior support | > 0.95 strong; 0.80-0.95 moderate; \u003C 0.80 uncertain | Standard Bayesian inference |\n| GMYC LR test p-value | \u003C 0.05 detects significant transition | Pons 2006 |\n| BPP posterior probability | > 0.95 strong; 0.50-0.95 moderate; \u003C 0.50 uncertain | Yang 2015 |\n| BPP minimum independent chains | 4 with different seeds | Convergence check |\n| Dsuite D significance | |Z| > 3 | Standard test statistic |\n| Sukumaran-Knowles validation rule | DELINEATE OR integrative-taxonomy congruence required post-2021 | Modern best practice |\n| Integrative taxonomy congruence | Genetic + morphological + ecological all support hypothesis | Padial 2010; Carstens 2013 |\n\n## Common errors\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| ABGD\u002FASAP returns no clear partition | Barcoding gap absent in data | Inspect distance histogram; do not force partition |\n| bPTP install error in R | bPTP is Python, NOT R | `pip install git+https:\u002F\u002Fgithub.com\u002FiTaxoTools\u002FPTP-pyqt5` |\n| GMYC error \"not ultrametric\" | ML tree directly fed without chronos | Run `ape::chronos()` first or use BEAST output |\n| BPP all PP = 1.0 (oversplit) | Default priors too informative; population substructure | Calibrate priors from data; run DELINEATE alongside |\n| BPP no convergence across chains | Insufficient burnin or sampling | Increase nsample and burnin; multiple chains |\n| Dsuite format error | Sets file column ordering | First column = sample ID, second = species\u002Fpopulation |\n| mPTP not found | Build from source github.com\u002FPas-Kapli\u002Fmptp | `pip install mptp` does not exist |\n| ASAP web upload \"too many sequences\" | > 10^4 sequences | Use downloadable C binary instead of web |\n\n## References\n\n- de Queiroz K (2007) Species concepts and species delimitation. *Syst Biol* 56(6):879-886. doi:10.1080\u002F10635150701701083\n- Pons J, Barraclough TG, Gomez-Zurita J et al. (2006) GMYC original. *Syst Biol* 55(4):595-609. doi:10.1080\u002F10635150600852011\n- Fujisawa T, Barraclough TG (2013) Revised GMYC. *Syst Biol* 62(5):707-724. doi:10.1093\u002Fsysbio\u002Fsyt033\n- Puillandre N, Lambert A, Brouillet S, Achaz G (2012) ABGD original. *Mol Ecol* 21(8):1864-1877. doi:10.1111\u002Fj.1365-294X.2011.05239.x\n- Puillandre N, Brouillet S, Achaz G (2021) ASAP. *Mol Ecol Resour* 21(2):609-620. doi:10.1111\u002F1755-0998.13281\n- Zhang J, Kapli P, Pavlidis P, Stamatakis A (2013) PTP \u002F bPTP. *Bioinformatics* 29(22):2869-2876. doi:10.1093\u002Fbioinformatics\u002Fbtt499\n- Kapli P, Lutteropp S, Zhang J et al. (2017) mPTP. *Bioinformatics* 33(11):1630-1638. doi:10.1093\u002Fbioinformatics\u002Fbtx025\n- Yang Z, Rannala B (2010) BPP original. *Proc Natl Acad Sci USA* 107(20):9264-9269. doi:10.1073\u002Fpnas.0913022107\n- Yang Z (2015) BPP review with prior guidance. *Curr Zool* 61(5):854-865. doi:10.1093\u002Fczoolo\u002F61.5.854\n- Flouri T, Jiao X, Rannala B, Yang Z (2018) BPP v4 genomic-scale. *Mol Biol Evol* 35(10):2585-2593. doi:10.1093\u002Fmolbev\u002Fmsy147\n- Bryant D, Bouckaert R, Felsenstein J et al. (2012) SNAPP. *Mol Biol Evol* 29(8):1917-1932. doi:10.1093\u002Fmolbev\u002Fmss086\n- Leache AD, Fujita MK, Minin VN, Bouckaert RR (2014) BFD*. *Syst Biol* 63(4):534-542. doi:10.1093\u002Fsysbio\u002Fsyu018\n- Sukumaran J, Knowles LL (2017) MSC delimits structure, not species. *Proc Natl Acad Sci USA* 114(7):1607-1612. doi:10.1073\u002Fpnas.1607921114\n- Sukumaran J, Holder MT, Knowles LL (2021) DELINEATE (speciation-process modeling). *PLoS Comput Biol* 17(5):e1008924. doi:10.1371\u002Fjournal.pcbi.1008924\n- Padial JM, Miralles A, De la Riva I, Vences M (2010) Integrative future of taxonomy. *Front Zool* 7:16. doi:10.1186\u002F1742-9994-7-16\n- Carstens BC, Pelletier TA, Reid NM, Satler JD (2013) How to fail at species delimitation. *Mol Ecol* 22(17):4369-4383. doi:10.1111\u002Fmec.12413\n- Malinsky M, Matschiner M, Svardal H (2021) Dsuite. *Mol Ecol Resour* 21(2):584-595. doi:10.1111\u002F1755-0998.13265\n- Malinsky M, Svardal H, Tyers AM et al. (2018) Whole-genome sequences of Malawi cichlids reveal multiple radiations interconnected by gene flow (f-branch original). *Nat Ecol Evol* 2(12):1940-1955. doi:10.1038\u002Fs41559-018-0717-x\n- Meyer CP, Paulay G (2005) Barcoding-gap-absence critique. *PLoS Biol* 3(12):e422. doi:10.1371\u002Fjournal.pbio.0030422\n\n## Related Skills\n\n- ecological-genomics\u002Fedna-metabarcoding - Generate barcode sequences from environmental samples for primary delimitation\n- ecological-genomics\u002Fconservation-genetics - Population-level genetic assessment (use ESU\u002FMU framework, NOT species delimitation, for management units)\n- phylogenetics\u002Ftree-io - Tree input\u002Foutput for tree-based delimitation methods\n- phylogenetics\u002Fmodern-tree-inference - ML and Bayesian tree construction for delimitation input\n- database-access\u002Fentrez-fetch - Retrieve barcode sequences from GenBank for reference comparison\n","## Version Compatibility\n\nReference examples tested with: ASAP (current CLI), mPTP (current C++), bPTP (Python from github.com\u002Fzhangjiajie\u002FPTP), splits 1.0+ for GMYC, BPP 4.7+, SNAPP\u002FBEAST 2.7+, DELINEATE (current Python), Dsuite 0.5+, ape 5.7+, fossil 0.4+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Species Delimitation\n\n**\"Delineate species boundaries from my DNA barcoding or genomic data\"** -> Apply distance-based (ASAP) and tree-based (mPTP) methods for primary delimitation, multilocus coalescent (BPP) for genomic confirmation, DELINEATE for speciation-process modeling to address MSC oversplitting, integrative-taxonomy validation across multiple lines of evidence, and Dsuite to test introgression before claiming sister relationships.\n- CLI: `asap` (downloadable C binary) OR web (https:\u002F\u002Fbioinfo.mnhn.fr\u002Fabi\u002Fpublic\u002Fasap\u002F) for single-locus primary delimitation\n- CLI: `mptp` (https:\u002F\u002Fgithub.com\u002FPas-Kapli\u002Fmptp) for tree-based multi-rate PTP (faster than bPTP)\n- Python: `bPTP` (https:\u002F\u002Fgithub.com\u002Fzhangjiajie\u002FPTP) for legacy tree-based delimitation — NOTE: Python not R\n- R: `splits::gmyc()` for GMYC on ultrametric trees\n- CLI: `bpp` (https:\u002F\u002Fbpp.github.io) for multilocus MSC delimitation; control-file driven\n- CLI: `Dsuite` for D-statistics \u002F f4-ratio \u002F f-branch introgression testing\n\n## The Single Most Important Modern Insight -- MSC Methods Delimit Structure, NOT Species\n\nSukumaran & Knowles 2017 *PNAS* 114(7):1607-1612 established that BPP, BFD*, and other multispecies-coalescent methods **delimit genetic structure, not species**. The mathematical reason: the MSC model treats every panmictic population as a \"species\" in the parameterization. Applied to data with substructure (isolated demes within a species), MSC methods partition that structure into \"species\" — leading to systematic oversplitting in published literature, especially in lizards, frogs, geckos, and insects.\n\n**Modern best practice (post-2021):**\n1. Run MSC methods (BPP, BFD*) as PRELIMINARY enumeration of candidate population lineages\n2. Apply DELINEATE (Sukumaran 2021 *PLoS Comput Biol* 17:e1008924) to test which lineages have completed speciation vs are in the speciation process\n3. Validate via integrative taxonomy (Padial 2010; Carstens 2013) — morphological, ecological, geographic congruence\n\nA second cornerstone: **the barcoding gap is OFTEN absent in real data** (Meyer & Paulay 2005 *PLoS Biol* 3:e422). ABGD and ASAP are theoretically grounded in the gap; when the gap is absent, both fail gracefully but their output is unreliable. Always inspect the pairwise distance histogram.\n\nA third: **Dsuite-checked introgression must precede sister-species claims.** D-statistics, f4-ratio, and f-branch (Malinsky 2021) distinguish admixture from incomplete lineage sorting; without this check, ILS-driven discordance is misinterpreted as gene flow.\n\n## Algorithmic Taxonomy\n\n| Method | Input | Approach | Strength | Fails when |\n|--------|-------|----------|----------|------------|\n| ASAP (Puillandre 2021) | Aligned sequences | Hierarchical-clustering distance partitioning with new scoring | Fast; modern; web + CLI | Single locus; works only if barcoding gap exists |\n| ABGD (Puillandre 2012) | Aligned sequences | Distance gap-detection across priors | Legacy; superseded by ASAP | Less robust when gap is weak |\n| GMYC (Pons 2006) | Ultrametric tree | Yule-coalescent transition threshold | Theoretical foundation | Requires time-calibrated tree |\n| Multi-threshold GMYC (Fujisawa & Barraclough 2013) | Ultrametric tree | Per-lineage transition thresholds | Heterogeneous rates | Same; not always more powerful |\n| bPTP (Zhang 2013) | Rooted phylogeny | Bayesian PTP MCMC | Posterior support per partition | Single intraspecific rate assumption; slower than mPTP |\n| mPTP (Kapli 2017) | Rooted phylogeny | Multi-rate PTP, C++ | Faster (5+ orders); per-species intraspecific rates | Heterogeneity-friendly; for shallow phylogenies bPTP may be more powerful |\n| BPP A10\u002FA11 (Yang & Rannala) | Multi-locus alignments | Bayesian multispecies coalescent | Rigorous, multilocus | Computationally heavy; oversplits per Sukumaran-Knowles |\n| SNAPP (Bryant 2012) | Biallelic SNP data | Coalescent species-tree bypassing gene trees | High-power genomic | Cubic complexity; not for very large datasets |\n| BFD* (Leache 2014) | SNP data via SNAPP | Bayes-factor delimitation | Genomic-scale species hypothesis testing | Same oversplitting risk |\n| DELINEATE (Sukumaran 2021) | BPP output + guide tree | Speciation-process modeling | Distinguishes structure from species | Requires preliminary delimitation as input |\n| Dsuite (Malinsky 2021) | VCF + populations | D-statistic, f4-ratio, f-branch | Tests introgression vs ILS | Tree must accurately reflect history |\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended approach | Why |\n|----------|---------------------|-----|\n| Primary species hypothesis from single locus | ASAP first; cross-check with mPTP | ASAP is the modern successor to ABGD; faster and better-scoring |\n| Tree-based delimitation, heterogeneous intraspecific rates | mPTP | Per-species rate model; 5+ orders faster than bPTP |\n| Tree-based delimitation, shallow phylogeny | bPTP (single-rate) or mPTP | When rates are similar, single-rate model may be more powerful |\n| Time-calibrated tree from BEAST \u002F chronos | GMYC (single or multi-threshold) | Requires ultrametric; both threshold variants worth comparing |\n| Multilocus genomic delimitation | BPP A10\u002FA11 + DELINEATE | BPP alone oversplits per Sukumaran-Knowles 2017 |\n| SNP-based species hypothesis test | SNAPP + BFD* | Coalescent species-tree from biallelic SNPs |\n| Confirm BPP result is not oversplitting | DELINEATE (Sukumaran 2021) | Speciation-process modeling distinguishes structure from species |\n| Test introgression before sister-species claim | Dsuite (D, f4-ratio, f-branch) | Distinguishes admixture from ILS |\n| Cryptic species complex | Integrative taxonomy: genetic + morphological + ecological congruence | Single-method conclusion unreliable |\n| ABGD\u002FASAP returns no clear partition | Inspect pairwise distance histogram; do not force partition | Barcoding gap may be absent (Meyer & Paulay 2005) |\n| Recently-diverged populations (Ne*t \u003C\u003C 1) | Caution; MSC methods very prone to oversplit | Incomplete lineage sorting indistinguishable from shallow structure |\n| Conservation management unit definition | Moritz 1994 ESU\u002FMU framework, NOT MSC delimitation | Sukumaran-Knowles caveat applies |\n\n## ASAP — The Modern Successor to ABGD\n\n**Goal:** Primary species hypothesis from a single-locus alignment via hierarchical clustering of pairwise distances, scored by a new asap-score (Puillandre 2021).\n\n**Approach:** Run ASAP via the web interface (https:\u002F\u002Fbioinfo.mnhn.fr\u002Fabi\u002Fpublic\u002Fasap\u002F) OR the downloadable C binary. ASAP ranks candidate partitions by asap-score (lower = better); always inspect the top 5-10 partitions, not just the best, and check for large score gaps that signal robust partitioning. Output: ranked species partitions with asap-score, p-value, and threshold distance per partition.\n\n```bash\n# ASAP CLI (downloadable C binary)\n# Substitution model: K2P standard for COI; p-distance for very closely related; JC for general\n.\u002Fasap -d K2P -o asap_results\u002F aligned_sequences.fasta\n\n# Inspect output\n# - asap_output.csv: ranked partitions by asap-score (lower = better)\n# - Always look at top 5-10 partitions; large score gaps = robust partitioning\n# - The \"best\" partition is the top-ranked; report secondary partitions too\n```\n\n```python\n# Python ASAP-style analysis for inspection (NOT a substitute for ASAP)\n# Useful for understanding the distance landscape\nfrom Bio import AlignIO\nfrom Bio.Phylo.TreeConstruction import DistanceCalculator\nfrom scipy.cluster.hierarchy import fcluster, linkage\nfrom scipy.spatial.distance import squareform\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nalignment = AlignIO.read('aligned_sequences.fasta', 'fasta')\ncalc = DistanceCalculator('identity')  # use K2P-friendly model in practice\ndm = calc.get_distance(alignment)\n\nnames = [r.id for r in alignment]\nn = len(names)\ndist_array = np.zeros((n, n))\nfor i in range(n):\n    for j in range(n):\n        dist_array[i][j] = dm[names[i], names[j]]\n\n# Inspect distance histogram for barcoding gap (often ABSENT per Meyer & Paulay 2005)\nupper = dist_array[np.triu_indices(n, k=1)]\nplt.hist(upper, bins=50)\nplt.xlabel('Pairwise distance')\nplt.ylabel('Frequency')\nplt.title('Distance histogram — look for bimodality (gap)')\nplt.savefig('barcoding_gap_histogram.pdf')\n\n# Hierarchical clustering at threshold scan\ncondensed = squareform(dist_array)\nZ = linkage(condensed, method='average')\nthresholds = np.arange(0.01, 0.10, 0.005)\nfor t in thresholds:\n    clusters = fcluster(Z, t=t, criterion='distance')\n    print(f'Threshold {t:.3f}: {len(set(clusters))} groups')\n```\n\n## mPTP — Multi-Rate PTP for Heterogeneous Intraspecific Rates\n\n**Goal:** Delimit species from a phylogeny by detecting the transition from speciation to coalescent branching rates, allowing per-species intraspecific rates (Kapli 2017).\n\n**Approach:** Run mPTP on a rooted ML tree (e.g., from RAxML or IQ-TREE). mPTP's multi-rate model is more flexible than bPTP's single-rate; for shallow phylogenies with similar rates, bPTP may be competitive. mPTP is C++ (5+ orders of magnitude faster than bPTP), available from https:\u002F\u002Fgithub.com\u002FPas-Kapli\u002Fmptp.\n\n```bash\n# mPTP installation: build from C source\n# git clone https:\u002F\u002Fgithub.com\u002FPas-Kapli\u002Fmptp\n# cd mptp && .\u002Fautogen.sh && .\u002Fconfigure && make\n\n# Run mPTP ML inference\nmptp --ml --tree_file rooted_tree.nwk --output_file mptp_ml\n\n# MCMC for posterior support\nmptp --mcmc 1000000 --mcmc_sample 1000 --mcmc_burnin 100000 \\\n     --tree_file rooted_tree.nwk --output_file mptp_mcmc\n\n# Output: species partition with branch annotations\n# > 0.95 posterior support: strong; 0.80-0.95: moderate; \u003C 0.80: uncertain\n```\n\n## bPTP — Legacy Tree-Based Delimitation (Python, NOT R)\n\n**Goal:** Bayesian Poisson Tree Processes delimitation with single intraspecific rate (Zhang 2013).\n\n**Approach:** Run bPTP via the Python package from https:\u002F\u002Fgithub.com\u002Fzhangjiajie\u002FPTP (NOTE: this is a Python tool, NOT an R package; `install.packages('PTP')` does not exist). For heterogeneous-rate data, prefer mPTP.\n\n```bash\n# bPTP Python install (NOT R)\npip install git+https:\u002F\u002Fgithub.com\u002FiTaxoTools\u002FPTP-pyqt5\n\n# Run bPTP MCMC\npython -m PTP.PTP -t rooted_tree.nwk -o bptp_results \\\n    --type bayesian --ngen 100000 --burnin 0.1 --seed 42\n\n# Output: posterior support per species partition (> 0.95 strong)\n# bPTP over-splits when populations have strong geographic substructure\n# Cross-check with ASAP and\u002For mPTP for consensus\n```\n\n## GMYC with Mandatory Ultrametric Tree\n\n**Goal:** Detect the threshold on an ultrametric phylogeny where branching transitions from interspecific (Yule) to intraspecific (coalescent).\n\n**Approach:** Convert ML tree to ultrametric with `ape::chronos` (penalized likelihood) or BEAST (Bayesian time-calibration), then run GMYC. Single-threshold vs multi-threshold; multi-threshold handles heterogeneous rates across the tree.\n\n```r\nlibrary(splits)\nlibrary(ape)\n\ntree \u003C- read.tree('rooted_tree.nwk')\n\n# Convert to ultrametric (REQUIRED for GMYC)\n# chronos: penalized likelihood; lambda=1 mid-clock\n# For rigorous time-calibration, use BEAST2 instead\nultrametric_tree \u003C- chronos(tree, lambda = 1)\nclass(ultrametric_tree) \u003C- 'phylo'\nstopifnot(is.ultrametric(ultrametric_tree))\n\n# Single-threshold GMYC\ngmyc_single \u003C- gmyc(ultrametric_tree, method = 'single')\nsummary(gmyc_single)\ncat('GMYC species (single-threshold):', gmyc_single$entity[1], '\\n')\ncat('LR test p-value:', gmyc_single$p.value[1], '\\n')\n\n# Multi-threshold for heterogeneous rates\ngmyc_multi \u003C- gmyc(ultrametric_tree, method = 'multiple')\nsummary(gmyc_multi)\n\n# Compare single vs multi-threshold; report both\nspecies_single \u003C- spec.list(gmyc_single)\nspecies_multi \u003C- spec.list(gmyc_multi)\n```\n\n## BPP A10\u002FA11 — Multilocus MSC Delimitation with Calibrated Priors\n\n**Goal:** Bayesian multilocus species delimitation under the multispecies coalescent (Yang & Rannala 2010; current Flouri 2018 BPP v4).\n\n**Approach:** Configure BPP A10 (joint delimitation + species tree estimation) with priors on theta and tau ESTIMATED FROM DATA — NOT defaults. Yang 2015 *Curr Zool* 61:854-865 gives explicit guidance: `thetaprior = G(2, 2000)` for small\u002Fmoderate data; tighter for large genomic data. Wrong priors dominate the analysis.\n\n```text\n# BPP control file for A10 analysis\n# CRITICAL: priors below are CALIBRATED to data, not defaults\n# Defaults are tuned for primate-mammal data; insects\u002Ffish\u002Fplants need adjustment\n\nseed = 12345\n\nseqfile = alignment.phy\nImapfile = imap.txt                   # map individuals -> putative species\noutfile = bpp_results.txt\nmcmcfile = bpp_mcmc.txt\n\nspeciesdelimitation = 1 0 2 0.5       # 1 = delimitation mode; rjMCMC parameters\nspeciestree = 1                       # 1 = estimate species tree\nspeciesmodelprior = 1                 # 1 = uniform prior on rooted trees\n\nspecies&tree = 4  speciesA speciesB speciesC speciesD\n                  10 8 12 6\n                  ((speciesA, speciesB), (speciesC, speciesD));\n\n# CALIBRATED theta prior (per-locus nucleotide diversity)\n# G(2, 2000) -> mean = 0.001 (calibrate from observed per-locus pi)\n# Yang 2015 Curr Zool 61:854 has taxon-specific recommendations\nthetaprior = 2 2000\n\n# CALIBRATED tau prior (divergence times)\n# Calibrate from observed maximum genetic distance \u002F mutation rate\ntauprior = 2 2000\n\n# MCMC\nnsample = 100000\nsampfreq = 2\nburnin = 50000\n\n# Run multiple independent chains; check convergence\n```\n\n```bash\n# Run BPP with multiple independent chains\nfor i in 1 2 3 4; do\n    bpp --cfile bpp_control.bpp --seed $((1000 * i)) --out bpp_run_$i.txt &\ndone\nwait\n\n# Compare chains; posterior probabilities must agree across chains\n# PP > 0.95 for a delimitation: strong support\n# PP 0.50-0.95: moderate; integrate other evidence\n```\n\n## DELINEATE — Addressing the Sukumaran-Knowles Oversplitting\n\n**Goal:** Test whether candidate lineages from BPP represent fully-formed species OR incomplete-speciation structure (Sukumaran 2021).\n\n**Approach:** Provide DELINEATE with a guide tree of population lineages and a hypothesis about which are species. The output: probability that each population lineage is a true species vs an incipient lineage. THE post-2021 best practice complement to BPP.\n\n```bash\n# DELINEATE (https:\u002F\u002Fgithub.com\u002Fjsukumaran\u002Fdelineate)\n# Python tool\npip install delineate\n\n# Configure delineate input\n# - guide tree: rooted Newick with population lineages as tips\n# - constraint file: which tips are confirmed species, which to test\ndelineate-estimate partitions \\\n    --tree-file population_lineage_tree.nwk \\\n    --config-file delineate_config.json \\\n    --output-prefix delineate_run\n\n# Output: probability that each lineage is a species\n# Use ALONGSIDE BPP; do not claim species from BPP alone post-2021\n```\n\n## Dsuite — Introgression vs Incomplete Lineage Sorting\n\n**Goal:** Test for introgression before claiming sister-species relationships, distinguishing admixture from ILS.\n\n**Approach:** Compute D-statistic (ABBA-BABA), f4-ratio (admixture fraction), and f-branch (Malinsky 2021 *Mol Ecol Resour* 21:584-595) on a VCF with population assignments. Non-zero D indicates introgression between H3 and one of H1\u002FH2.\n\n```bash\n# Dsuite (https:\u002F\u002Fgithub.com\u002Fmillanek\u002FDsuite)\n# Sets file: 3 columns (sample_id, population\u002Fspecies, optional outgroup tag)\n# Tree file: Newick with population names matching the sets file\n\n# All-trio D-statistic\nDsuite Dtrios -t species_tree.nwk sets.txt input.vcf.gz\n\n# F-branch decomposition (more interpretable than raw D)\nDsuite Fbranch species_tree.nwk Dtrios_output_tree.txt > fbranch.txt\n\n# Plot f-branch matrix\ndtools.py fbranch.txt species_tree.nwk\n\n# D > 0 with |Z| > 3: significant ABBA-BABA imbalance -> introgression\n# f4-ratio gives the admixture fraction estimate\n```\n\n## Per-Method Failure Modes\n\n### MSC delimitation oversplits population structure as species\n\n**Trigger:** Running BPP, BFD*, or other multispecies-coalescent methods on data with within-species substructure (isolated demes), then claiming the delimited lineages are species.\n\n**Mechanism:** The MSC model treats every panmictic population as a \"species\" in its parameterization (Sukumaran & Knowles 2017). When applied to data with population substructure, MSC partitions that structure into \"species.\"\n\n**Symptom:** Many \"species\" delimited; each with low sample size; lineages defined by geography rather than morphology; BPP posterior support is high but biological reality is unclear.\n\n**Fix:** Run DELINEATE (Sukumaran 2021) on the BPP output to test which lineages have completed speciation. Validate via integrative taxonomy (Padial 2010): require congruence across genetic + morphological + ecological evidence before publishing species.\n\n### ABGD\u002FASAP forced to partition data without a barcoding gap\n\n**Trigger:** Reporting \"best partition\" from ABGD or ASAP when the pairwise distance histogram is unimodal (no gap).\n\n**Mechanism:** ABGD and ASAP detect a gap in the pairwise-distance distribution that separates intra- from inter-specific divergences. Meyer & Paulay 2005 *PLoS Biol* 3:e422 demonstrated the gap is frequently absent.\n\n**Symptom:** Distance histogram is unimodal (no clear bimodality); ASAP partitions have similar scores across many K values; ABGD priors disagree.\n\n**Fix:** Inspect the distance histogram first; if no clear gap, do NOT report ASAP\u002FABGD results as definitive; integrate other lines of evidence.\n\n### bPTP oversplit on populations with strong substructure\n\n**Trigger:** Running bPTP on a tree where the same biological species has multiple isolated demes contributing genetic structure.\n\n**Mechanism:** bPTP detects branching-rate shifts as species boundaries; isolated demes within a species show coalescent-rate branching that bPTP partitions as separate species.\n\n**Symptom:** More bPTP species than morphologically recognized; species correspond to geographic regions.\n\n**Fix:** Cross-check with ASAP (more conservative) and with mPTP at multi-rate option; treat bPTP\u002FmPTP as preliminary; require congruence with other lines of evidence.\n\n### BPP with default theta and tau priors\n\n**Trigger:** Running BPP without calibrating priors to the data; using priors copied from a primate\u002Fmammal example file.\n\n**Mechanism:** BPP results depend critically on theta (per-locus nucleotide diversity) and tau (divergence time) priors. Default priors are typically tuned for mammal data; for insects, fish, plants with different mutation-rate and Ne contexts, defaults can dominate the posterior.\n\n**Symptom:** Posterior support clusters at 1.0 OR 0.0; results inconsistent with morphological \u002F ecological data; sensitivity to alternative priors is very high.\n\n**Fix:** Calibrate priors from data per Yang 2015 *Curr Zool* 61:854: estimate per-locus heterozygosity for theta mean; estimate divergence times from observed maximum genetic distances and mutation rate.\n\n### Reporting D-statistic without f-branch\n\n**Trigger:** Reporting raw D-statistics for many taxa without decomposing introgression patterns.\n\n**Mechanism:** D-statistic measures asymmetric site-pattern counts; with taxon-rich datasets, D > 0 can be confounded by ancient introgression in the outgroup or by ghost lineages. f-branch (Malinsky 2018) decomposes admixture across the tree more interpretably.\n\n**Symptom:** Many trios with D > 0; difficult to identify which specific introgression event drives the pattern.\n\n**Fix:** Report f-branch decomposition alongside D; check for consistent patterns across phylogenetic levels.\n\n## Quantitative Thresholds\n\n| Threshold | Value | Source \u002F rationale |\n|-----------|-------|-------------------|\n| COI K2P \"species\" cutoff | typically 2-3% pairwise distance (variable) | Animal barcoding convention; verify per taxon |\n| ASAP score gap signaling robust partition | Large drop between consecutive scores | Puillandre 2021; inspect top 5-10 partitions |\n| bPTP\u002FmPTP posterior support | > 0.95 strong; 0.80-0.95 moderate; \u003C 0.80 uncertain | Standard Bayesian inference |\n| GMYC LR test p-value | \u003C 0.05 detects significant transition | Pons 2006 |\n| BPP posterior probability | > 0.95 strong; 0.50-0.95 moderate; \u003C 0.50 uncertain | Yang 2015 |\n| BPP minimum independent chains | 4 with different seeds | Convergence check |\n| Dsuite D significance | |Z| > 3 | Standard test statistic |\n| Sukumaran-Knowles validation rule | DELINEATE OR integrative-taxonomy congruence required post-2021 | Modern best practice |\n| Integrative taxonomy congruence | Genetic + morphological + ecological all support hypothesis | Padial 2010; Carstens 2013 |\n\n## Common errors\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| ABGD\u002FASAP returns no clear partition | Barcoding gap absent in data | Inspect distance histogram; do not force partition |\n| bPTP install error in R | bPTP is Python, NOT R | `pip install git+https:\u002F\u002Fgithub.com\u002FiTaxoTools\u002FPTP-pyqt5` |\n| GMYC error \"not ultrametric\" | ML tree directly fed without chronos | Run `ape::chronos()` first or use BEAST output |\n| BPP all PP = 1.0 (oversplit) | Default priors too informative; population substructure | Calibrate priors from data; run DELINEATE alongside |\n| BPP no convergence across chains | Insufficient burnin or sampling | Increase nsample and burnin; multiple chains |\n| Dsuite format error | Sets file column ordering | First column = sample ID, second = species\u002Fpopulation |\n| mPTP not found | Build from source github.com\u002FPas-Kapli\u002Fmptp | `pip install mptp` does not exist |\n| ASAP web upload \"too many sequences\" | > 10^4 sequences | Use downloadable C binary instead of web |\n\n## References\n\n- de Queiroz K (2007) Species concepts and species delimitation. *Syst Biol* 56(6):879-886. doi:10.1080\u002F10635150701701083\n- Pons J, Barraclough TG, Gomez-Zurita J et al. (2006) GMYC original. *Syst Biol* 55(4):595-609. doi:10.1080\u002F10635150600852011\n- Fujisawa T, Barraclough TG (2013) Revised GMYC. *Syst Biol* 62(5):707-724. doi:10.1093\u002Fsysbio\u002Fsyt033\n- Puillandre N, Lambert A, Brouillet S, Achaz G (2012) ABGD original. *Mol Ecol* 21(8):1864-1877. doi:10.1111\u002Fj.1365-294X.2011.05239.x\n- Puillandre N, Brouillet S, Achaz G (2021) ASAP. *Mol Ecol Resour* 21(2):609-620. doi:10.1111\u002F1755-0998.13281\n- Zhang J, Kapli P, Pavlidis P, Stamatakis A (2013) PTP \u002F bPTP. *Bioinformatics* 29(22):2869-2876. doi:10.1093\u002Fbioinformatics\u002Fbtt499\n- Kapli P, Lutteropp S, Zhang J et al. (2017) mPTP. *Bioinformatics* 33(11):1630-1638. doi:10.1093\u002Fbioinformatics\u002Fbtx025\n- Yang Z, Rannala B (2010) BPP original. *Proc Natl Acad Sci USA* 107(20):9264-9269. doi:10.1073\u002Fpnas.0913022107\n- Yang Z (2015) BPP review with prior guidance. *Curr Zool* 61(5):854-865. doi:10.1093\u002Fczoolo\u002F61.5.854\n- Flouri T, Jiao X, Rannala B, Yang Z (2018) BPP v4 genomic-scale. *Mol Biol Evol* 35(10):2585-2593. doi:10.1093\u002Fmolbev\u002Fmsy147\n- Bryant D, Bouckaert R, Felsenstein J et al. (2012) SNAPP. *Mol Biol Evol* 29(8):1917-1932. doi:10.1093\u002Fmolbev\u002Fmss086\n- Leache AD, Fujita MK, Minin VN, Bouckaert RR (2014) BFD*. *Syst Biol* 63(4):534-542. doi:10.1093\u002Fsysbio\u002Fsyu018\n- Sukumaran J, Knowles LL (2017) MSC delimits structure, not species. *Proc Natl Acad Sci USA* 114(7):1607-1612. doi:10.1073\u002Fpnas.1607921114\n- Sukumaran J, Holder MT, Knowles LL (2021) DELINEATE (speciation-process modeling). *PLoS Comput Biol* 17(5):e1008924. doi:10.1371\u002Fjournal.pcbi.1008924\n- Padial JM, Miralles A, De la Riva I, Vences M (2010) Integrative future of taxonomy. *Front Zool* 7:16. doi:10.1186\u002F1742-9994-7-16\n- Carstens BC, Pelletier TA, Reid NM, Satler JD (2013) How to fail at species delimitation. *Mol Ecol* 22(17):4369-4383. doi:10.1111\u002Fmec.12413\n- Malinsky M, Matschiner M, Svardal H (2021) Dsuite. *Mol Ecol Resour* 21(2):584-595. doi:10.1111\u002F1755-0998.13265\n- Malinsky M, Svardal H, Tyers AM et al. (2018) Whole-genome sequences of Malawi cichlids reveal multiple radiations interconnected by gene flow (f-branch original). *Nat Ecol Evol* 2(12):1940-1955. doi:10.1038\u002Fs41559-018-0717-x\n- Meyer CP, Paulay G (2005) Barcoding-gap-absence critique. *PLoS Biol* 3(12):e422. doi:10.1371\u002Fjournal.pbio.0030422\n\n## Related Skills\n\n- ecological-genomics\u002Fedna-metabarcoding - Generate barcode sequences from environmental samples for primary delimitation\n- ecological-genomics\u002Fconservation-genetics - Population-level genetic assessment (use ESU\u002FMU framework, NOT species delimitation, for management units)\n- phylogenetics\u002Ftree-io - Tree input\u002Foutput for tree-based delimitation methods\n- phylogenetics\u002Fmodern-tree-inference - ML and Bayesian tree construction for delimitation input\n- database-access\u002Fentrez-fetch - Retrieve barcode sequences from GenBank for reference comparison\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","mixed","2026-09-20","ecological-genomics\u002Fspecies-delimitation\u002FSKILL.md","ASAP","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-ecological-genomics-species-delimitation","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-ecological-genomics-species-delimitation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-ecological-genomics-species-delimitation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-ecological-genomics-species-delimitation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-species-delimitation\u002FSKILL.md",true,[50,56,62],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fasap_delimitation.py","SCRIPT","脚本",5511,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-species-delimitation\u002Fexamples\u002Fasap_delimitation.py",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"examples\u002Fgmyc_delimitation.R","OTHER","其他",3885,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-species-delimitation\u002Fexamples\u002Fgmyc_delimitation.R",{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"usage-guide.md","REFERENCE","参考文档",8809,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-ecological-genomics-species-delimitation\u002Fusage-guide.md",[69,77,84,91,98,105],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"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":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":76},"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":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":76},"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":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":76},"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":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":76},"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":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":76},"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",[],[]]