Agent skill

Bio Comparative Genomics Gene Tree Species Tree Reconciliation

by GPTomics in GPTomics/bioSkills

Reconcile gene trees against a species tree under probabilistic models of duplication, transfer, and loss (DTL) using ALE (Szöllősi 2013 amalgamated likelihood), GeneRax (Morel 2020 ML…

MITAuto-check passedBusiness, Finance & HR

Install Bio Comparative Genomics Gene Tree Species Tree Reconciliation

skills CLI
$ npx skills add GPTomics/bioSkills --skill bio-comparative-genomics-gene-tree-species-tree-reconciliation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install GPTomics/bioSkills bio-comparative-genomics-gene-tree-species-tree-reconciliation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/GPTomics/bioSkills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/comparative-genomics/gene-tree-species-tree-reconciliation .claude/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bio-comparative-genomics-gene-tree-species-tree-reconciliation
GitHub stars
1.2k
Used in
2 other repos
Token cost
~8.1k tokens
SKILL.md length
3,275 words
Files
3
Skills in repo
559
Repo updated
First seen
Licence
MIT

At a glance

Reconcile gene trees against a species tree under probabilistic models of duplication, transfer, and loss (DTL) using ALE (Szöllősi 2013 amalgamated likelihood), GeneRax (Morel 2020 ML…

  • Inferring ancestral gene-family content
  • SKILL.md covers Version Compatibility, Algorithmic Taxonomy, Decision Tree by Experimental… and Per-Tool Failure Modes, plus 12 more sections
  • Runs Shell scripts from its folder; calls git, conda and make; reaches github.com and compbio.engr.uconn.edu
  • Distinguishing duplication from horizontal transfer from differential loss

What it does

Bio Comparative Genomics Gene Tree Species Tree Reconciliation is an agent skill from GPTomics/bioSkills. Reconcile gene trees against a species tree under probabilistic models of duplication, transfer, and loss (DTL) using ALE (Szöllősi 2013 amalgamated likelihood), GeneRax (Morel 2020 ML reconciliation), AleRax (Morel 2024 co-estimation), Whale.jl (Bayesian DL+WGD), RANGER-DTL 2 parsimony, NOTUNG, ecceTERA, and Treerecs. Use when inferring ancestral gene-family content, distinguishing duplication from horizontal transfer from differential loss, rooting deep species trees from gene-content signals (STRIDE / Williams…

Its SKILL.md is about 8.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `examples/ale_dtl_reconciliation.sh` and `usage-guide.md`).

It sits in Business, Finance & HR, covering Accounting and bookkeeping and Bioinformatics. The repository describes itself as: a set of SKILLS.md for doing bioinformatics with agents like claude code. The licence is MIT.

When your agent uses it

  • Inferring ancestral gene-family content
  • Distinguishing duplication from horizontal transfer from differential loss
  • Rooting deep species trees from gene-content signals (STRIDE / Williams 2017 ALE-rooting)
  • Counting DTL events per branch

Example prompts

  • “/bio-comparative-genomics-gene-tree-species-tree-reconciliation”

Requirements

  • A Bash shell

What it can do on your machine

Read from SKILL.md and the folder at commit d91ed3d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • conda
    • make
    • wget
    • python
    • cmake
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com
    • compbio.engr.uconn.edu
    • cs.cmu.edu

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bio Comparative Genomics Gene Tree Species Tree Reconciliation loads about 8.1k tokens when it runs. Until then it costs about 204 tokens; SKILL.md has 3,275 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~204
When it runs · the whole SKILL.md, loaded when a task matches
~8.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from GPTomics/bioSkills at commit d91ed3d, republished under its MIT licence (© GPTomics). 3,275 words, ~8,102 tokens.

Download SKILL.mdSave it as .claude/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
bio-comparative-genomics-gene-tree-species-tree-reconciliation
description
Reconcile gene trees against a species tree under probabilistic models of duplication, transfer, and loss (DTL) using ALE (Szöllősi 2013 amalgamated likelihood), GeneRax (Morel 2020 ML reconciliation), AleRax (Morel 2024 co-estimation), Whale.jl (Bayesian DL+WGD), RANGER-DTL 2 parsimony, NOTUNG, ecceTERA, and Treerecs. Use when inferring ancestral gene-family content, distinguishing duplication from horizontal transfer from differential loss, rooting deep species trees from gene-content signals (STRIDE / Williams 2017 ALE-rooting), counting DTL events per branch, refining noisy gene trees against a species tree, modeling WGD events jointly with DTL, or producing publication-grade gene-family histories for phylogenomic / comparative analyses.
tool_type
cli
primary_tool
ALE

Version Compatibility

Reference examples tested with: ALE 1.0+ (ssolo/ALE github), GeneRax 2.1.3+ (BenoitMorel/GeneRax), AleRax 1.2.0+ (BenoitMorel/AleRax; Morel 2024 Bioinformatics 40:btae162), Whale.jl 2.0+ (arzwa/Whale.jl), RANGER-DTL 2.0+ (Bansal lab; Bansal 2018 Bioinformatics 34:3214), NOTUNG 2.9.1.5+ (Stolzer 2012; Chen 2000), ecceTERA 1.2.5+, Treerecs 1.2+, IQ-TREE 2.3.6+, MrBayes 3.2.7+, BUSCO 5.7+, ete4 4.1.0+, BioPython 1.84+. Open Tree of Life and NCBI Taxonomy reference databases at 2024-Q3 minimum for species-tree-aware inference.

Before using code patterns, verify installed versions match. If versions differ:

  • CLI: ALEml_undated --help, ALEml --help (dated), generax --help, alerax --help
  • Julia: using Whale; Whale.WhaleProblem; ]status for package versions
  • Python: pip show ete4; ete4 --help

If code throws species tree mismatch, gene tree taxa not in species tree, or MPI process pool failure, these reconciliation tools share strict label-consistency requirements: species labels must match exactly across the species tree and gene trees (case-sensitive, no whitespace), and gene IDs typically encode species via prefix (species|gene_id separator convention). Use sed / awk normalization scripts before reconciliation.

Gene Tree Species Tree Reconciliation

"Where did this gene family come from, and what events shaped its history?" -> Reconcile gene trees against species trees under explicit probabilistic models of duplication (D), horizontal transfer (T), and loss (L). The reconciliation framework converts gene-tree-species-tree discordance into a quantitative history of evolutionary events. Modern probabilistic methods (ALE, GeneRax, AleRax) distinguish gene-tree-error-driven discordance from biological discordance by integrating over gene-tree uncertainty -- a critical advance over parsimony reconciliation (NOTUNG, RANGER) which treats input gene trees as fixed and inflates duplication/loss counts from gene-tree noise (Boussau 2013 Genome Res 23:323; Morel 2020 MBE 37:2763).

  • CLI: ALEobserve + ALEml_undated -- Bayesian DTL on a sample of gene trees (amalgamated likelihood)
  • CLI: generax -- ML reconciliation; refines gene trees jointly with reconciliation
  • CLI: alerax -- co-estimation of gene and species trees + DTL rates (Morel 2024)
  • Julia: using Whale -- Bayesian DL + WGD modeling
  • CLI: ranger-dtl -- parsimony DTL with cost weights
  • CLI: notung -- duplication-loss only (DL); user-friendly GUI; legacy

Algorithmic Taxonomy

ToolApproachEvents modeledInferenceStrengthFails when
ALE undated (Szöllősi 2013 Syst Biol 62:901)Amalgamated likelihood over gene-tree distribution; species-tree-awareD, T, LBayesianPosterior over D/T/L events at every species-tree branch; integrates over gene-tree uncertaintyRequires gene-tree posterior sample (>= 100 bootstrap/UFBoot trees); slow for many families
ALE datedSame as undated but uses time-calibrated species treeD, T, LBayesianTime-aware; better donor inferenceRequires dated species tree (BEAST2 / RevBayes calibration)
GeneRax (Morel 2020 MBE 37:2763)ML reconciliation + joint gene-tree refinementD, T, LMLFaster than ALE; refines noisy gene trees; species-tree-awareLess uncertainty quantification than ALE
AleRax (Morel 2024 Bioinformatics 40:btae162)Co-estimation of gene tree, species tree, and DTL ratesD, T, LBayesian / ML hybridGold standard 2024; corrects gene-tree-error feedback into species treeComputationally heaviest; needs >= 20 species
Whale.jl (Zwaenepoel & Van de Peer 2019 MBE 36:1384)Bayesian DL + WGD via amalgamated likelihoodD, L, WGDBayesian (Turing.jl)Native WGD modeling; modern Bayesian frameworkJulia ecosystem dependency
RANGER-DTL 2.0 (Bansal 2018 Bioinformatics 34:3214)Parsimony DTL with user cost weights (D-cost, T-cost, L-cost)D, T, LParsimonyFast; deterministic; many gene families per minuteCost weights are user choices; results sensitive to costs
NOTUNG (Chen 2000 JCB 7:429; Stolzer 2012 Bioinformatics 28:i409)Parsimony DL; HGT extensionD, L (optional T)ParsimonyUser-friendly GUI; widely usedDL-only by default; HGT extension less rigorous than ALE
ecceTERA (Jacox 2016 Bioinformatics 32:2056)DTL on input set of trees; sampled + unsampled ("dead") lineagesD, T, LParsimony / DPTransfers from extinct/unsampled lineages; cost-sweep modeNo ILS model; less popular than ALE; smaller community
Treerecs (Comte 2020 Bioinformatics 36:4822)Gene-tree correction/rooting against a fixed species treeD, LMLRefines gene trees by species-tree constraintNo HGT; eukaryote-focused
DLCpar (Wu 2014 GR 24:475)DLC parsimony for DL + coalescence (ILS)D, L, CParsimonyModels ILS explicitlyNo HGT; older
GraphDTL (Tofigh 2011)Graph algorithm for DTLD, T, LParsimonyFast on small instancesLess used today
Phyldog (Boussau 2013 GR 23:323)Joint species-tree-gene-tree DL with site-rate variationD, LMLJoint inference; refines gene treesBacteria-unfriendly; eukaryote-only

Methodology evolves; verify the AleRax / ALE documentation before locking on a single approach. The probabilistic ALE / GeneRax / AleRax tools have largely superseded parsimony reconciliation for serious phylogenomic work; parsimony is fine for screening but not for publication-grade DTL inference.

Decision Tree by Experimental Scenario

ScenarioRecommended approachWhy
Bacterial / archaeal phylogenomics, 50-500 genomesGeneRax (refinement) -> ALE undated (posterior)Two-stage: GeneRax refines, ALE provides posterior
Eukaryote DL inference, no HGT expectedNOTUNG (legacy) or TreerecsDL is the dominant signal; HGT rare in animals
Mixed prokaryote/eukaryote with HGTALE undatedProbabilistic D/T/L; ALE-rooting (Williams 2017) for deep questions
Plant comparative genomics with WGDWhale.jlNative WGD modeling; Bayesian
Need uncertainty quantificationALE or AleRaxPosteriors on every branch; ML methods give point estimates only
Need fastest possible per-family analysisRANGER-DTL parsimonyDeterministic; multi-gene parallel
Co-estimate species tree from many gene familiesAleRaxModern gold-standard; corrects gene-tree-error
Root a deep species tree from DTL signalALE undated rooting (Williams 2017 method)Root inference from D/T/L event distribution
Detect ancient HGT in archaea / bacteriaALE undatedProbabilistic T detection at each branch; donor inferred
Identify ancestral gene family contentALE; report origination events per branchPosterior over presence/absence at internal nodes
Test specific HGT hypothesis (e.g. plant -> nematode)ALE on filtered OG set; manual gene tree inspectionQuantitative T posterior
Distinguish HGT from differential gene lossALE event posteriors (T vs L on candidate branch)Probabilistic ratio between alternatives
WGD detection alongside DTLWhale.jl explicit WGD modelingJoint inference; replaces post hoc Ks plotting
Refine noisy gene trees against species treeGeneRax --strategy SPRSpecies-tree-aware gene-tree refinement
Gene family birth-death modelingSee [[gene-family-evolution]] (CAFE5)Reconciliation is per-family; CAFE5 is across families
Single gene of interest, single speciesManual gene-tree placement; ALE not neededReconciliation framework is genome-scale

Per-Tool Failure Modes

Gene-tree-error feedback inflating duplications

Trigger: Using GeneRax or ALE with poorly-supported gene trees (low bootstrap, short alignments).

Mechanism: Noisy gene trees show spurious topology that, when reconciled, produces apparent duplications-followed-by-losses or transfers. The reconciliation framework cannot distinguish gene-tree noise from real DTL events; the output is biased toward more events (Boussau 2013).

Symptom: D + T + L event counts exceed reasonable rates (e.g. > 5 events per gene per Myr in eukaryotes); per-branch event posteriors are diffuse; ALE convergence (in _uTs files) is slow.

Fix: Use ALE (which integrates over gene-tree posterior sample) rather than GeneRax (which uses a single ML tree). For GeneRax users, provide UFBoot trees with high (-B 1000) bootstraps, and refine via --strategy SPR. AleRax (Morel 2024) co-estimates gene trees + species tree + DTL rates, addressing this feedback directly.

Species labels and gene IDs mismatch

Trigger: Different naming conventions across gene trees, species tree, and orthology files.

Mechanism: Reconciliation tools require species labels in the species tree to match a defined prefix or suffix in each gene ID. Inconsistencies cause silent failures or partial reconciliation.

Symptom: ALE fails with "taxon not in species tree"; or runs but produces zero reconciliation events; or reconciliation matrix is sparse.

Fix: Strict normalization before reconciliation. ALE convention: gene IDs as species|gene_id (pipe separator); species labels match the species tree leaf names exactly. Pre-process all gene trees with:

bash
for tree in gene_trees/*.nwk; do
    sed -i 's/_gene_/|/g' "$tree"   # adjust separator
done

Verify with nw_labels -I species_tree.nwk vs nw_labels -I gene_trees/OG0000001.nwk -- both species sets must be subsets of the species tree leaves.

Cost-weight sensitivity in parsimony reconciliation (RANGER)

Trigger: Running RANGER-DTL with default costs (D=2, T=3, L=1).

Mechanism: Parsimony reconciliation minimizes total cost; the inferred D / T / L event count depends linearly on these costs. Default costs are biased toward favoring duplication-loss explanations over transfer.

Symptom: RANGER reports fewer transfers than ALE/GeneRax on the same data; sensitivity-analysis varies event counts dramatically with cost changes.

Fix: Run RANGER with cost sensitivity sweep: D in {1, 2, 3, 4}, T in {1, 2, 3, 4, 5}, L = 1. Report consensus events appearing in all cost combinations. Or move to probabilistic ALE/GeneRax which infers rates from data, not user costs. ecceTERA also allows cost-sweep mode.

Root sensitivity in ALE undated

Trigger: ALE on a species tree with poorly-supported root.

Mechanism: ALE undated treats the species tree root as fixed; event posteriors at deepest branches depend on the root location. Wrong root flips D vs T inference at deep nodes.

Symptom: Running ALE under multiple candidate rootings (STRIDE, MAD, outgroup) produces qualitatively different event histories at deep branches.

Fix: Run ALE under multiple rootings; report only robust events. For deep phylogenomic questions, use ALE-rooting (Williams 2017 PNAS 114:E4602): run ALE under all possible rootings, choose the root maximizing the joint likelihood. AleRax can co-estimate the root, removing this issue.

WGD events misattributed as duplications

Trigger: Reconciliation on a clade with known WGD (vertebrates 2R, fish 3R, salmonids Ss4R, plant lineages).

Mechanism: Standard DTL models (ALE, GeneRax) treat WGD as a series of individual duplications; the posterior at the WGD branch is dominated by D events but the joint event is whole-genome.

Symptom: D events at the WGD branch are 10-100x higher than other branches; many "duplications" cluster temporally.

Fix: Use Whale.jl which natively models WGD as a single event with a flexible retention parameter (Zwaenepoel 2019 MBE 36:1384). Otherwise, post hoc identify clusters of synchronized duplications and label as WGD.

Saturation at deep timescales

Trigger: Reconciliation on extremely deep clades (>1 Gyr divergence in bacteria; >500 Myr in eukaryotes).

Mechanism: Gene families have undergone many cycles of D, T, L; the observed pattern is consistent with many DTL histories. Parameter identifiability is lost.

Symptom: ALE convergence requires hundreds of cycles; posterior on D/T/L rates is uninformative; branch event posteriors are diffuse.

Fix: Restrict to subclades with more recent divergence for quantitative DTL claims; for deep questions, qualitative event-class identification only (e.g. "transfers occurred along this branch" without precise count). Williams 2017 PNAS 114:E4602 demonstrates how ALE on deep archaeal phylogeny still resolves event class.

MPI parallelization failures in GeneRax

Trigger: Running GeneRax on cluster with many gene families.

Mechanism: GeneRax uses MPI to parallelize per-family analysis; misconfigured MPI environment (wrong srun/mpirun/mpiexec, wrong allocator) silently runs serial or hangs.

Symptom: GeneRax progresses through few families per hour; cluster CPU usage shows only 1 core per node.

Fix: Verify MPI: mpirun -n 8 hostname should show 8 different hostnames or threads. Use --per-family-rates and proper MPI launch: mpirun -n $SLURM_NTASKS generax .... Reduce --threads to 1 per family (let MPI handle parallelism). AleRax uses the same convention.

ILS misattributed as transfers

Trigger: Reconciliation on rapidly radiated clade (incomplete lineage sorting expected).

Mechanism: ILS produces gene-tree-species-tree discordance indistinguishable from HGT at short internodes. ALE / GeneRax cannot separate them.

Symptom: Many "transfers" at short internal branches; transfer rate per branch correlates with branch length (more transfers at short branches).

Fix: Use DLCpar, which models deep coalescence (ILS) jointly with duplication and loss; or pre-screen for ILS-likely loci via Dsuite ABBA-BABA (see [[introgression-detection]]); restrict ALE to gene families where ILS unlikely (long internodes). For phylogenomic-scale ILS, use an ASTRAL-Pro2 coalescent species tree as the fixed input to reconciliation.

Multifurcations in the species tree

Trigger: Using a species tree with polytomies (unresolved nodes).

Mechanism: ALE / GeneRax / AleRax assume strictly bifurcating species trees; multifurcations break the inference.

Symptom: Tool fails with "polytomy detected" or runs but produces nonsensical results at multifurcating nodes.

Fix: Resolve polytomies before reconciliation via ape::multi2di() (random resolution) or with an outgroup-informed resolution (RAxML / ASTRAL-Pro2 on more data). Document the resolution.

Show full SKILL.md (1,401 more words)Show less

Quantitative Thresholds

QuantityThresholdSource / Rationale
ALE gene-tree sample size>= 100 bootstrap or UFBoot trees per familyALE documentation; below this, posterior poorly resolved
Bacterial transfer rate (per gene per branch)typically 0.001-0.05 in ALE inferencesSzöllősi 2013; varies clade
Eukaryote duplication ratetypically 0.0001-0.005eukaryote-specific convention; calibrate per clade
Branch-wise DTL event posterior> 0.5 for "called" eventssolo/ALE convention
Minimum gene families for AleRax>= 100 families; >= 20 speciesMorel 2024
Minimum species for species-tree rooting via ALE>= 30 species across the cladeWilliams 2017
GeneRax --strategy choicesEVAL only (no refinement), SPR (refinement), HYBRID (random + SPR)GeneRax docs
RANGER cost weights defaultD=2, T=3, L=1 (Bansal 2018)Sensitivity sweep recommended
Whale.jl MCMC burn-in>= 1000 samples; convergence by ESS >= 200Whale.jl docs
Reasonable runtime per family (ALE)1-30 minutesModern CPU; varies with gene-tree count
Reasonable runtime per family (GeneRax)0.1-5 minutesModern CPU; SPR is slower than EVAL
Maximum families per AleRax run< 5000 (computational)Above this, partition
Species labels case-sensitivitystrict; case mismatch = silent failureUniversal convention
Gene-ID separatorALE / GeneRax accept a single-character separator via separators="X" (commonly `or_`); Whale.jl uses a mapping file. Verify per-tool.
Transfer branch detection minimum supportbranch posterior > 0.5 + AU test on alternative placementConservative publication-grade
Distinguish T from LT posterior - L posterior on candidate branchSubtraction approach; ALE outputs both

ALE Standard Workflow

Goal: Quantify D/T/L events per branch of a species tree, integrating gene-tree uncertainty.

Approach: Build UFBoot gene trees per orthogroup -> ALEobserve to encode tree samples -> ALEml_undated for reconciliation -> aggregate per-branch event posteriors.

bash
# 1. Build UFBoot gene trees per orthogroup
mkdir -p gene_trees
for og in orthogroups/*.fa; do
    base=$(basename $og .fa)
    iqtree2 -s $og -m TEST -B 1000 -nt 2 --prefix gene_trees/$base
done

# 2. Encode for ALE
for ufb in gene_trees/*.ufboot; do
    ALEobserve $ufb
done
# Produces gene_trees/*.ale files

# 3. Reconcile against species tree
mkdir -p reconciled
for ale in gene_trees/*.ale; do
    ALEml_undated species_tree.nwk $ale \
        separators="|" \
        sample=100 \
        output_format=newick
    mv ${ale%.*}_*.uml ${ale%.*}.uml
    mv ${ale%.*}_*.uTs ${ale%.*}.uTs
done

# 4. Aggregate branch-wise events
python aggregate_ale_events.py reconciled/ > branch_events.tsv
python
'''Aggregate ALE outputs per species-tree branch.'''
import glob
from collections import defaultdict
import pandas as pd


def parse_uts(path):
    '''ALE _uTs format: branch  duplications  transfers  losses  originations  speciations.'''
    rows = []
    with open(path) as fh:
        for ln in fh:
            if ln.startswith('#') or not ln.strip():
                continue
            parts = ln.split()
            if len(parts) >= 5:
                rows.append({
                    'branch_id': parts[0],
                    'duplications': float(parts[1]),
                    'transfers': float(parts[2]),
                    'losses': float(parts[3]),
                    'originations': float(parts[4]),
                })
    return pd.DataFrame(rows)


def aggregate(reconciled_dir):
    agg = defaultdict(lambda: defaultdict(float))
    for uts in glob.glob(f'{reconciled_dir}/*.uTs'):
        df = parse_uts(uts)
        family = uts.split('/')[-1].split('.')[0]
        for _, row in df.iterrows():
            for event in ('duplications', 'transfers', 'losses', 'originations'):
                agg[row['branch_id']][event] += row[event]
    return pd.DataFrame(agg).T.fillna(0)


branch_events = aggregate('reconciled')
print(branch_events.sort_values('transfers', ascending=False).head(20))

GeneRax for ML Reconciliation with Refinement

Goal: Reconcile gene trees against a species tree while jointly refining noisy gene trees.

Approach: Provide gene trees + alignments + species tree -> GeneRax SPR strategy refines each gene tree -> reconciliation produces D/T/L history.

bash
# Prepare families file (one line per family with paths)
cat > families.txt << 'EOF'
[FAMILIES]
- OG0000001
starting_gene_tree = gene_trees/OG0000001.nwk
alignment = alignments/OG0000001.fa
mapping = mapping.txt
subst_model = GTR+G
- OG0000002
starting_gene_tree = gene_trees/OG0000002.nwk
alignment = alignments/OG0000002.fa
mapping = mapping.txt
subst_model = GTR+G
EOF

# Mapping file: gene_id  species_label
# One line per gene
generate_mapping.py orthogroups.tsv > mapping.txt

# Run GeneRax with SPR refinement
mpirun -n 16 generax \
    --families families.txt \
    --species-tree species_tree.nwk \
    --rec-model UndatedDTL \
    --strategy SPR \
    --prefix generax_run \
    --per-family-rates \
    --max-spr-radius 5

# Output:
#   generax_run/results/<family>/inferredGeneTree.newick  refined gene tree
#   generax_run/results/<family>/reconciliation.nhx       reconciliation in NHX format
#   generax_run/species_trees/species_tree.newick         species tree (with optional re-rooting)
#   generax_run/families.txt                              refined families

AleRax Co-Estimation

Goal: Co-estimate gene trees, species tree, and DTL rates from gene-family alignments.

Approach: Provide alignments + initial species tree -> AleRax runs joint Bayesian / ML co-estimation.

bash
# Prepare AleRax families file (similar to GeneRax but with bootstrap trees)
cat > families.txt << 'EOF'
[FAMILIES]
- OG0000001
starting_gene_tree = gene_trees/OG0000001.ufboot
alignment = alignments/OG0000001.fa
mapping = mapping.txt
subst_model = GTR+G
EOF

mpirun -n 32 alerax \
    --families families.txt \
    --species-tree initial_species_tree.nwk \
    --rec-model UndatedDTL \
    --output alerax_run \
    --gene-tree-samples 100 \
    --species-tree-samples 1

AleRax outputs include alerax_run/inferred_species_tree.nwk (possibly re-rooted; D/T/L-aware) and per-family reconciled gene trees.

Whale.jl Bayesian DL + WGD

Goal: Bayesian DTL inference with explicit WGD modeling.

Approach: Define species tree with WGD nodes -> Whale.jl posterior over D/L + WGD retention.

julia
# IMPORTANT: Whale.jl public API evolves; verify against current docs at
# https://github.com/arzwa/Whale.jl before scripting. The sketch below is
# illustrative; introspect via `?WhaleModel`, `?WhaleProblem`, `?read_ale`.
using Whale, NewickTree, Distributions, DynamicHMC

# Read species tree (Whale uses readnw or SlicedTree)
species_tree = readnw(read("species_with_wgd.nwk", String))

# Define rates model and WGD retention parameters
# Whale parameterization: λ (duplication), μ (loss), q (WGD retention per WGD node), ρ (sampling)
# The exact constructor signature is package-version-dependent; see ?WhaleModel
rates = ConstantDLWGD(λ=0.1, μ=0.1, q=Dict(1=>0.3), η=0.66)

# Read amalgamated gene-tree distributions (a directory of .ale files)
ale_dir = "families/"
ale_data = read_ale(ale_dir, species_tree)

# Build problem and sample with DynamicHMC (verify with current Whale.jl examples)
problem = WhaleProblem(ale_data, species_tree, rates)
results = mcmc(problem, n=1000)

Operational note: the Whale.jl 2.x DSL has moved between releases; do NOT copy-paste this without verifying with ? on the actual installed version. Reference examples live in the upstream examples/ directory.

Reconciliation: When Methods Disagree

PatternLikely causeAction
ALE high transfer posterior, RANGER lowCost weights in RANGER bias against TTrust ALE; sensitivity-sweep RANGER costs
GeneRax fewer events than ALEGeneRax uses ML on single tree; ALE integrates over tree distributionTrust ALE; GeneRax may have underestimated due to gene-tree uncertainty
AleRax revises species tree from initial guessGene-tree-error feedback was biasing initial estimateTrust AleRax (co-estimation corrects feedback)
Whale.jl WGD posterior high; ALE shows duplication burstSame event; Whale models as WGD with retention parameterWhale.jl interpretation is more biological for clades with known WGD
NOTUNG DL reconciliation contradicts ALENOTUNG ignores T; ALE includes TTrust ALE for HGT-affected clades
Same family: D in one tool, T in anotherBoundary case; both events possibleReport both with explicit caveats; or use AleRax for joint co-estimation
Many "transfers" at short internal branchesILS confounded with TSwitch to DLCpar (or an ASTRAL-Pro2 coalescent species tree) for ILS-aware inference
ALE posterior diffuse across branchesSaturated; very ancient family or short treeRestrict to subclade; or report event class only
GeneRax fails on 1% of familiesSpecific orthology / alignment issueInspect failed families manually; often related to species-label mismatch

Operational rule for publication: ALE with 100+ bootstrap gene trees + Bayesian event posteriors > 0.5 + multiple-rooting robustness + biological corroboration (e.g. HGT predictions cross-checked with composition / [[hgt-detection]]) = publication-grade DTL inference. Single parsimony reconciliation (RANGER, NOTUNG) is appropriate for screening but should be backed by ALE for published claims.

Cohort Gotchas

  • Bacterial clades with rampant HGT (e.g. Enterobacteriaceae, Streptomyces): ALE transfer posteriors will dominate; calibrate expected per-branch transfer rate against published values (Szöllősi 2013; Williams 2017)
  • Endosymbionts with genome reduction (Buchnera, Wolbachia): rampant gene loss; loss rates may exceed all other events; calibrate against known biology
  • Salmonid 4R Ss4R WGD: add WGD node to species tree before reconciliation; use Whale.jl with native WGD parameter; treating Ss4R as duplication burst inflates DL counts
  • Plant tetraploids: subgenome assignment first ([[whole-genome-duplication]]); reconcile each subgenome lineage separately
  • Rapid radiations (cichlids, Drosophila species groups, hominoids): ILS confounded with transfers; use ASTRAL-Pro2 coalescent species tree as input; or apply DLCpar for explicit duplication-loss-coalescence reconciliation
  • Polyploid lineages with WGD-derived "extra" genes: appear as duplications in DTL methods; AleRax with WGD node specification handles this; Whale.jl native

Anticipated Reviewer Pushback

PushbackStandard response
"Gene-tree uncertainty?"ALE integrates over 100+ UFBoot trees per family; AleRax co-estimates
"Species tree rooting?"ALE-rooting (Williams 2017) under multiple candidate rooting hypotheses; events robust across rootings reported
"ILS vs HGT?"Tested via ABBA-BABA / Dsuite; or used DLCpar for joint duplication-loss-coalescence inference
"WGD vs DL?"Whale.jl native WGD modeling for known-WGD lineages; otherwise WGD node added explicitly
"Why ALE over RANGER?"RANGER is cost-sensitive parsimony; ALE provides posterior probabilities
"Why AleRax over ALE?"AleRax co-estimates gene tree + species tree + DTL rates, correcting gene-tree-error feedback; preferred for publication-grade work since 2024
"ILS at rapid radiation?"ILS-aware reconciliation (DLCpar); or restrict to gene families with long internodes
"Cost weight sensitivity (RANGER)?"If RANGER used, sensitivity sweep across cost weights performed; consensus events reported
"Contamination?"Pre-filtered with FCS-GX / BlobTools (cross-ref [[hgt-detection]])
"Gene-tree quality?"UFBoot bootstrap >= 95 average; PREQUAL / HmmCleaner alignment filter applied
"Species sampling?"At least 30 species for ALE-rooting; clade-balanced sampling reported

Common Errors

Error / symptomCauseSolution
ALEml "taxon not found"Species label mismatchNormalize labels exactly; verify with nw_labels
GeneRax MPI hangsWrong MPI launcher; per-thread vs per-process confusionUse mpirun -n $NTASKS generax --threads 1; check mpirun -n 4 hostname
ALE convergence slow / neverInsufficient gene-tree samplesIncrease UFBoot samples to 1000; verify each .ale file has >= 100 trees
Whale.jl Turing sampling failsNUTS step-size; tree dimension highTry HMC() with manual tuning; or scale down number of WGD nodes
RANGER outputs single most-parsimonious historyOne MPR returned by defaultRun with --explore-mpr for multiple equally parsimonious histories
AleRax species tree differs from initialCo-estimation revised it (intended)Use AleRax's tree; report initial vs refined
Reconciliation gives 1000 events on a 5-gene familyNumerical instability or bad inputInspect family for paralog confusion or sequence error
Per-branch event posterior > 1.0Multiple events on same branchExpected for high-DTL-rate branches; sum over event classes
NOTUNG DL counts vastly exceed ALE D + L countsNOTUNG attributes T events to L (no T model)Use ALE for HGT-affected clades
DLCpar over-calls deep coalescence (ILS) across many nodesILS/coalescence cost too permissiveRestrict ILS-aware analysis to known short-internode regions; re-check cost settings

Tool Installation Notes

bash
# ALE (C++)
git clone https://github.com/ssolo/ALE && cd ALE && mkdir build && cd build && cmake .. && make
# Or via bioconda
conda install -c bioconda ale

# GeneRax (with MPI)
git clone --recursive https://github.com/BenoitMorel/GeneRax && cd GeneRax && ./install.sh

# AleRax
git clone --recursive https://github.com/BenoitMorel/AleRax && cd AleRax && ./install.sh

# Whale.jl (Julia)
julia -e 'using Pkg; Pkg.add("Whale")'

# RANGER-DTL
wget https://compbio.engr.uconn.edu/software/RANGER-DTL/RANGER-DTL-Linux.tar.gz
tar xf RANGER-DTL-Linux.tar.gz

# NOTUNG
wget https://www.cs.cmu.edu/~durand/Notung/download/Notung-2.9.1.5.tar.gz

# ecceTERA
git clone https://github.com/cchauve/ecceTERA && cd ecceTERA && make

# Treerecs
conda install -c bioconda treerecs

# Newick utilities (label inspection)
conda install -c bioconda newick_utils

For cluster deployment, AleRax / GeneRax require MPI; verify mpicc --version and run a small hostname test before deploying to genome-scale data.

References

  • Szöllősi GJ et al 2013 Syst Biol 62:901 (ALE undated)
  • Szöllősi GJ et al 2015 Syst Biol 64:e42 (ALE rooting concept)
  • Morel B et al 2020 MBE 37:2763 (GeneRax)
  • Morel B et al 2024 Bioinformatics 40:btae162 (AleRax co-estimation)
  • Williams TA et al 2017 PNAS 114:E4602 (ALE-rooting of the archaeal tree of life)
  • Zwaenepoel A & Van de Peer Y 2019 MBE 36:1384 (Whale.jl Bayesian DL+WGD)
  • Bansal MS et al 2018 Bioinformatics 34:3214 (RANGER-DTL 2.0)
  • Chen K et al 2000 J Comp Biol 7:429 (NOTUNG)
  • Stolzer M et al 2012 Bioinformatics 28:i409 (NOTUNG-HGT extension)
  • Jacox E et al 2016 Bioinformatics 32:2056 (ecceTERA)
  • Comte N et al 2020 Bioinformatics 36:4822 (Treerecs)
  • Wu Y-C et al 2014 GR 24:475 (DLCpar)
  • Boussau B et al 2013 Genome Res 23:323 (Phyldog joint inference)
  • Sjöstrand J et al 2012 Bioinformatics 28:2994 (PrIME-DLRS Bayesian)
  • Tofigh A, Hallett M & Lagergren J 2011 IEEE/ACM TCBB 8:517 (DTL graph algorithm)
  • Maddison WP 1997 Syst Biol 46:523 (gene tree discordance causes)
  • Rabier C-E et al 2014 MBE 31:750 (rate inference under WGD)
  • Tria FDK et al 2017 Nat Eco Evo 1:0193 (MAD rooting alternative)
  • Emms DM & Kelly S 2017 MBE 34:3267 (STRIDE rooting)
  • comparative-genomics/hgt-detection - DTL reconciliation underlies probabilistic HGT inference
  • comparative-genomics/ortholog-inference - Orthogroups feed reconciliation pipeline
  • comparative-genomics/gene-family-evolution - CAFE5 birth-death across families (complementary to per-family reconciliation)
  • comparative-genomics/whole-genome-duplication - WGD modeling in Whale.jl
  • comparative-genomics/ancestral-reconstruction - DTL informs ancestral gene-content inference
  • phylogenetics/modern-tree-inference - UFBoot bootstrap gene trees for ALE input
  • phylogenetics/bayesian-inference - MrBayes / RevBayes alternative gene-tree posteriors
  • phylogenetics/species-trees - ASTRAL-Pro2 coalescent species tree as ALE/AleRax input
  • alignment/multiple-alignment - High-quality MSA precedes gene-tree inference
  • alignment/alignment-trimming - PREQUAL / HmmCleaner for clean gene trees

© GPTomics, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in comparative-genomics/gene-tree-species-tree-reconciliation of GPTomics/bioSkills.

  • SKILL.md
  • examples/ale_dtl_reconciliation.sh
  • usage-guide.md

Open the folder on GitHubat commit d91ed3d

Used in 2 other repositories

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in GPTomics/bioSkills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Bio Comparative Genomics Gene Tree Species Tree Reconciliation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bio Comparative Genomics Gene Tree Species Tree Reconciliation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bio Comparative Genomics Gene Tree Species Tree Reconciliation this skillGPTomics/bioSkills1.2k2 repos~8.1kAutomated safety check: PassMIT
Workflow OrchestrationAnastasiyaW/codex-claude-code-config154—~3.8kAutomated safety check: PassMIT
EtetoolkitK-Dense-AI/scientific-agent-skills48k1 repos~3.3kAutomated safety check: NotesGPL-3.0-or-later
Pharmacoeconomic EvaluationLeoYeAI/openclaw-master-skills2.2k—~4.2kAutomated safety check: PassMIT
En Journal Workflowfranklee16/academic-research-skills2231 repos~1.5kAutomated safety check: PassNone
Stata Accounting Researchwentorai/research-plugins2981 repos~4kAutomated safety check: PassMIT

Similar skills

  • Workflow Orchestration

    AnastasiyaW/codex-claude-code-config

    Написание и запуск Claude Code dynamic workflows (JS-оркестратор субагентов).

    154 GitHub stars~3.8k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Etetoolkit

    K-Dense-AI/scientific-agent-skills

    Analyzes, manipulates, compares, annotates, and visualizes phylogenetic or other hierarchical trees with ETE 4.

    48k GitHub starsUsed in 1 repo~3.3k tokens
    Research & ScienceAuto-check: notes
  • Pharmacoeconomic Evaluation

    LeoYeAI/openclaw-master-skills

    This skill provides comprehensive guidance and tools for conducting pharmacoeconomic evaluations including cost-effectiveness analysis (CEA), cost-utility analysis (CUA), cost-benefit analysis…

    2.2k GitHub stars~4.2k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • En Journal Workflow

    franklee16/academic-research-skills

    A skill your agent uses when deciding which English economics / finance / management / accounting / marketing / operations / information-systems journal skill to invoke next, comparing fit across…

    223 GitHub starsUsed in 1 repo~1.5k tokens
    Business, Finance & HRAuto-check passed
  • Stata Accounting Research

    wentorai/research-plugins

    STATA code patterns for empirical accounting and finance research

    298 GitHub starsUsed in 1 repo~4k tokens
    Business, Finance & HRAuto-check passed
  • Evidence Modules

    hh-health-AI/healthcare-equity

    A skill your agent uses for healthcare reimbursement, clinical catalysts, utilization, epidemiology, provider adoption or economics, procedure exposure, safety, IP/exclusivity, international access…

    101 GitHub stars~1k tokensUpdated 3 days ago
    Business, Finance & HRAuto-check passed

More from GPTomics/bioSkills

All 559 skills in this repo
  • Bio Alignment Io

    GPTomics/bioSkills

    Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO.

    1.2k GitHub starsUsed in 3 repos~4.9k tokens
    Auto-check passed
  • bioSkills Installer

    GPTomics/bioSkills

    Installs the bioSkills collection of 425 bioinformatics skills in one step, or only chosen categories, so sequencing, RNA-seq, single-cell and variant tasks get specialized help.

    1.2k GitHub starsUsed in 1 repo~789 tokens
    Auto-check passed
  • Bio Write Sequences

    GPTomics/bioSkills

    Write biological sequences to files (FASTA, FASTQ, GenBank, EMBL) using Biopython Bio.SeqIO.

    1.2k GitHub starsUsed in 3 repos~2.1k tokens
    Auto-check passed
  • Amplicon Primer Clipping

    GPTomics/bioSkills

    Soft- or hard-clips PCR primer footprints from aligned amplicon BAMs so primer bases stop masquerading as confirmed reference sequence.

    1.2k GitHub starsUsed in 2 repos~2.2k tokens
    Auto-check passed
  • Filters BAM alignments by FLAG bits, mapping quality and regions with samtools view or pysam, with recipes for common keep and drop cases.

    1.2k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check passed
  • Bio Alignment Indexing

    GPTomics/bioSkills

    Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam.

    1.2k GitHub starsUsed in 2 repos~2.4k tokens
    Auto-check passed

Questions about Bio Comparative Genomics Gene Tree Species Tree Reconciliation

What does Bio Comparative Genomics Gene Tree Species Tree Reconciliation do?

Reconcile gene trees against a species tree under probabilistic models of duplication, transfer, and loss (DTL) using ALE (Szöllősi 2013 amalgamated likelihood), GeneRax (Morel 2020 ML…. Bio Comparative Genomics Gene Tree Species Tree Reconciliation is an agent skill from GPTomics/bioSkills.jl (Bayesian DL+WGD), RANGER-DTL 2 parsimony, NOTUNG, ecceTERA, and Treerecs.

When should I use Bio Comparative Genomics Gene Tree Species Tree Reconciliation?

Bio Comparative Genomics Gene Tree Species Tree Reconciliation fits situations like: inferring ancestral gene-family content; distinguishing duplication from horizontal transfer from differential loss; rooting deep species trees from gene-content signals (STRIDE / Williams 2017 ALE-rooting); counting DTL events per branch.

How do I install Bio Comparative Genomics Gene Tree Species Tree Reconciliation in Claude Code?

Run `npx skills add GPTomics/bioSkills --skill bio-comparative-genomics-gene-tree-species-tree-reconciliation -a claude-code`. Or copy the skill folder (comparative-genomics/gene-tree-species-tree-reconciliation in GPTomics/bioSkills) into .claude/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation in your project. Claude Code loads it when a task matches its description.

How do I install Bio Comparative Genomics Gene Tree Species Tree Reconciliation in Codex?

Run `npx skills add GPTomics/bioSkills --skill bio-comparative-genomics-gene-tree-species-tree-reconciliation -a codex`. Or copy the skill folder (comparative-genomics/gene-tree-species-tree-reconciliation in GPTomics/bioSkills) into .agents/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation in your project. Codex loads it when a task matches its description.

Can I use Bio Comparative Genomics Gene Tree Species Tree Reconciliation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add GPTomics/bioSkills --skill bio-comparative-genomics-gene-tree-species-tree-reconciliation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation, .gemini/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation, .github/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation and .opencode/skills/bio-comparative-genomics-gene-tree-species-tree-reconciliation in your project.

What does Bio Comparative Genomics Gene Tree Species Tree Reconciliation need to run?

Going by SKILL.md and its folder, Bio Comparative Genomics Gene Tree Species Tree Reconciliation needs a shell for the scripts in its folder and the command-line tools its instructions call (git, conda, make, wget, python and cmake). Our summary lists: A Bash shell.

Does Bio Comparative Genomics Gene Tree Species Tree Reconciliation access the network?

SKILL.md names 3 domains. In commands or code: github.com, compbio.engr.uconn.edu and cs.cmu.edu; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Bio Comparative Genomics Gene Tree Species Tree Reconciliation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Bio Comparative Genomics Gene Tree Species Tree Reconciliation use?

Bio Comparative Genomics Gene Tree Species Tree Reconciliation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bio Comparative Genomics Gene Tree Species Tree Reconciliation use?

About 8.1k tokens (SKILL.md is roughly 32k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bio Comparative Genomics Gene Tree Species Tree Reconciliation?

Skills that share tags, products or a category with Bio Comparative Genomics Gene Tree Species Tree Reconciliation: Workflow Orchestration (AnastasiyaW/codex-claude-code-config, 154 stars), Etetoolkit (K-Dense-AI/scientific-agent-skills, 48k stars), Pharmacoeconomic Evaluation (LeoYeAI/openclaw-master-skills, 2.2k stars) and En Journal Workflow (franklee16/academic-research-skills, 223 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bio Comparative Genomics Gene Tree Species Tree Reconciliation?

GPTomics (a GitHub organization) maintains it in GPTomics/bioSkills, which has 1,218 GitHub stars. The repository holds 559 skills in this directory. The repository was last updated on August 15, 2026.

Source: GPTomics/bioSkills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.