Sign in Get 3 free credits

Try a job or a niche: tiktok captions, study notes, excel formulas. Press Esc to close.

Gene flow detection

Tests for gene flow between species with Dsuite, TreeMix and ADMIXTOOLS, so your claims hold up to reviewers.

What we improved

Fixed the Dsuite SETS file: Dsuite expects no header line, outgroup samples labelled exactly Outgroup and excluded samples labelled xxx. The original example had a header and no note on the labels. Fixed the Dsuite output parser. The real c

Improved by YourAISkill from the original by GPTomics, under its MIT licence. The download includes the author's licence and a CHANGES.md listing every change. Both Claude reviews read the improved version.

Claude's review

9/10 Expert introgression workflow that separates gene flow from ILS, structure and rate variation, with correct Dsuite, TreeMix and ADMIXTOOLS usage, a converter script and reviewer responses.

We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.

In detail

Detect introgression and admixture between species or populations using Dsuite (Malinsky 2021 fast D-statistics), Patterson's D / ABBA-BABA test (Green 2010; Durand 2011), f4-ratio and f-branch statistic (Malinsky 2018), TreeMix (Pickrell & Pritchard 2012), HyDe (Blischak 2018), QuIBL (Edelman 2019), sprime (Browning 2018), Twisst (Martin 2017), PhyloNet (Than 2008) for explicit phylogenetic networks, and qpAdm / qpGraph (Patterson 2012). Distinguish introgression from incomplete lineage sorting (ILS), ancestral structure, ghost-lineage admixture, and rate variation. Use when testing inter-species gene flow, dating admixture events, identifying introgressed segments, building phylogenetic networks for reticulate evolution, or applying the ABBAclustering (Koppetsch-Malinsky-Matschiner 2024) framework for divergent-species gene flow.

How you use it

  1. Add it to your pack, then download your pack (1 credit).
  2. In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
  3. Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide

Safety check

Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.

An automated scan lowers risk but cannot promise zero risk. How we check skills

Preview

The first lines of SKILL.md
---
name: bio-comparative-genomics-introgression-detection
description: "Detect and interpret introgression and admixture between species or populations: Patterson's D (ABBA-BABA), f4-ratio and f-branch with Dsuite, windowed f_d and f_dM with Dsuite Dinvestigate, TreeMix with OptM, admixture f3, qpAdm and qpGraph with ADMIXTOOLS 2, HyDe, QuIBL, Twisst, DFOIL, PhyloNet or SNaQ networks, and Sprime for archaic segments. Centres on telling gene flow apart from incomplete lineage sorting, ancestral structure, ghost lineages and among-lineage rate variation. Use when testing for gene flow between taxa from a multi-sample VCF or gene trees, mapping signal to tree branches, locating introgressed regions, estimating admixture proportions, choosing between methods, or answering a reviewer who doubts an introgression claim."
tool_type: cli
primary_tool: Dsuite
---

<!-- Modified by YourAISkill (youraiskill.com) on 2 December 2026 from the original by GPTomics. See CHANGES.md. -->

## Version Compatibility

Written against Dsuite 0.5, TreeMix 1.13, the ADMIXTOOLS 2 R package `admixtools`, HyDe 0.4 (`phyde`), bcftools 1.2x and R 4.4. Flags change between releases: running `Dsuite Dtrios` or `treemix` with no arguments prints the options; `run_hyde.py -h`; `packageVersion('admixtools')` in R.

Most failures are input format problems:
- **Dsuite:** a VCF plus a SETS file of two tab separated columns (sample ID, population), **no header**. Outgroup samples are labelled exactly `Outgroup`; samples to ignore are labelled `xxx`. Names must match the VCF and the Newick tree exactly, and the tree must include `Outgroup`.
- **TreeMix:** a gzipped table, header of population names, then one line per SNP of `ref,alt` allele counts per population, in genome order, with no population at 0,0.
- **ADMIXTOOLS 2:** PLINK (bed/bim/fam) or EIGENSTRAT (geno/snp/ind) files; compute f2 blocks once and reuse them.

# Introgression and Admixture Detection

**"Has there been gene flow between these species or populations?"** Tests use site patterns (ABBA-BABA, f-statistics), gene tree topologies (QuIBL, Twisst, networks) or haplotype tracts (Sprime). Under a tree with no gene flow, incomplete lineage sorting (ILS) produces ABBA and BABA patterns in equal numbers, so D measures their imbalance. **A significant D is not proof of introgression.** It is also produced by ancestral population structure (Eriksson & Manica 2012), by gene flow from an unsampled ghost lineage, and by unequal substitution rates among lineages combined with homoplasy, especially with deep divergences or a distant outgroup (Frankel & Ané 2023; Koppetsch, Malinsky & Matschiner 2024). Treat D as the screen, then attribute the signal (f-branch), check it against locus level evidence (QuIBL, Twisst, Dinvestigate) and say which alternatives you have excluded and how.

**Usual order of work:** filter SNPs, Dsuite Dtrios, f-branch, multiple testing correction, then locus level checks (Dinvestigate, QuIBL) and a model based method (qpAdm, qpGraph or a network) chosen from the decision tree below.

## Algorithmic Taxonomy

| Tool / statistic | Gives | Main weakness |
|---|---|---|
| Patterson's D, ABBA-BABA (Green 2010; Durand 2011) | D = (ABBA - BABA)/(ABBA + BABA), jackknife Z, for ((P1,P2),P3),O | Not evidence of gene flow alone; no direction or amount |
| Dsuite Dtrios (Malinsky 2021) | D, Z, p, f4-ratio for all trios from a VCF | p-values uncorrected; trios share populations, so tests correlate |
| f4-ratio (Patterson 2012) | Admixture fraction | Valid only under the assumed tree and a single pulse |
| f-branch (Malinsky 2018) | Excess sharing per branch and population | Only as good as the tree; ghost donors appear on their nearest sampled relative |
| Dinvestigate: f_d (Martin 2015), f_dM, d_f | Admixture estimates in windows | Window choice; never raw D in small windows |
| ABBA clustering test (Koppetsch 2024) | Whether ABBA sites cluster along the genome, as introgression tracts do and homoplasy does not | Needs SNPs in genome order on long contigs; recent Dsuite only |
| TreeMix (Pickrell & Pritchard 2012) | Drift tree plus migration edges | Edge count is a judgement; easy to overfit |
| admixture f3 (Patterson 2012) | f3(Target; A, B) < 0 means Target is admixed | Later drift can hide admixture; positive f3 rules nothing out |
| qpAdm, qpGraph (ADMIXTOOLS 2; Maier 2023) | Source mixtures with weights; admixture graph fits | Depends on the right set; many graphs often fit equally well |
| HyDe (Blischak 2018) | Hybridisation gamma and Z per triple and per individual | Same confounders as D |
| QuIBL (Edelman 2019) | Per triplet, ILS only versus ILS plus introgression from gene tree branch lengths (BIC) | Needs reliable branch lengths |
| Twisst (Martin & Van Belleghem 2017) | Topology weights along the genome | Descriptive; topology counts alone do not separate ILS from introgression |
...

From GPTomics's repository, MIT licence.

Related skills

  • Checked

    RNA-seq analysis with PyDESeq2

    Runs bulk RNA-seq differential expression in PyDESeq2 with checks and plots, so your results hold up to review.

    by K-Dense-AI 59k
    8/101 credit
  • Checked

    Single cell ATAC analysis

    Takes 10x single cell ATAC data through QC, clustering and peak calling, so you end up with labelled cell types.

    by GPTomics 1.3k
    8/101 credit
  • Checked

    Single cell RNA seq pipeline

    Runs a full single cell RNA seq analysis in Seurat or Scanpy, so you go from 10x counts to cell types and results.

    by GPTomics 1.3k
    8/101 credit
  • Checked

    Molfeat Molecule Features

    Turns molecules into fingerprints and descriptors for chemistry machine learning, with no misaligned rows.

    by K-Dense-AI 59k
    7/101 credit
  • Checked

    Single Cell Omics Models

    Fits probabilistic single cell models with scvi-tools for batch integration, annotation and multimodal data.

    by K-Dense-AI 59k
    7/101 credit
  • Checked

    SceneKit 3D Product Scenes

    Builds polished 3D product animations in SwiftUI apps with SceneKit, with fixes for shadows, hitches and lighting.

    by dembsky 115
    7/101 credit

Secure checkout

Credits

AUD

  1. 1Choose
  2. 2Pay on Square
  3. 3Credits added