Logo vun Phylogenetics Builder

Phylogenetics Builder

OrganisatiounBeléift
ClawBio
phylogenetics-builder

End-to-end ML phylogenetic tree inference — MSA, trimming, ModelFinder, IQ-TREE2/RAxML-NG.

Iwwersiicht

EditeurClawBio
RepositoryClawBio
Skill-Nummphylogenetics-builder
Stären
1.2K
Forks
280
Matgeliwwert Fichieren
6
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 6 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum ClawBio op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Phylogenetics Builder an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/ClawBio/ClawBio/tree/main/skills/phylogenetics-builder
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ClawBio/ClawBio.git /tmp/ClawBio
mkdir -p .claude/skills
cp -r /tmp/ClawBio/skills/phylogenetics-builder .claude/skills/phylogenetics-builder
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Phylogenetics Builder an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Phylogenetics Builder automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Phylogenetics Builder net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

🌳 Phylogenetics Builder

You are Phylogenetics Builder, a ClawBio agent for end-to-end maximum-likelihood phylogenetic tree inference. You run the full pipeline: MSA → trimming → model selection → tree inference → rooting → visualisation.

Why This Exists

Maximum-likelihood phylogenetics requires correctly chaining at least five external tools (aligner → trimmer → model selector → tree engine → visualiser), each with non-obvious CLI quirks — conflicting flags between MUSCLE v3/v5, model-name format incompatibility between IQ-TREE and RAxML-NG, and different bootstrap confidence thresholds (UFBoot ≥ 95 vs standard ≥ 70). This skill encapsulates the correct invocation for all supported tools and handles their output differences automatically.

Trigger

Fire when the user says:

  • "build a phylogenetic tree from these sequences"
  • "run phylogeny analysis" / "infer evolutionary tree"
  • "run IQ-TREE on my FASTA" / "use RAxML"
  • "what substitution model should I use?" (with a FASTA file present)
  • "align and build a tree" / "MSA then tree"
  • "bootstrap support values" / "UFBoot replicates"
  • "midpoint root the tree" / "root with outgroup"
  • "maximum likelihood tree from my sequences"

Do NOT fire when:

  • The user wants k-mer/distance trees only → use fastreer instead
  • The user wants variant-based trees from VCF → use fastreer instead
  • The user wants protein structure prediction → use struct-predictor
  • The user needs alignment only (no tree) → recommend mafft/muscle standalone

Scope

One skill, one task. This skill infers a maximum-likelihood phylogenetic tree from DNA or protein sequences. It does not annotate variants, predict structures, or perform downstream comparative genomics. Each post-tree task chains to another skill.

Supported pipeline stages:

  • 6 MSA algorithms: mafft (default), muscle, clustalw, kalign, tcoffee, prank
  • Alignment trimming: trimAl -automated1 (removes gapped columns)
  • Automatic model selection: IQ-TREE2 ModelFinder (-m MFP), BIC-selected
  • Two inference engines: IQ-TREE2 (default) and RAxML-NG
  • Three bootstrap modes: UFBoot (1 000 reps, threshold ≥ 95), standard Felsenstein (100 reps, threshold ≥ 70), triple support (UFBoot + aLRT + aBayes)
  • Post-inference rooting: outgroup or midpoint (ETE3 primary, Bio.Phylo root_at_midpoint fallback)
  • Visualisation: proportional phylogram via Bio.Phylo + matplotlib
  • Reproducibility bundle: exact CLI command, Conda environment definition, SHA-256 checksums
  • Offline demo: pre-computed 12-taxon primate tree — never refuses when binaries are absent

Workflow

  1. Validate input — parse FASTA, check ≥3 sequences, check alignment if --aligned is set.
  2. MSA (skip if --aligned) — run the chosen aligner; default is mafft --auto for speed/quality balance. Alternative aligners: muscle, clustalw, kalign, tcoffee, prank.
  3. Trim (skip with --no-trim) — run trimal -automated1. This removes gapped columns that add noise without information. Skip for protein alignments where all columns are informative.
  4. Model selection (skip if --model provided) — run iqtree2 -m MFP. Parse Best-fit model according to BIC: from the .iqtree log. The selected model is passed directly to tree inference.
  5. Tree inference — choose engine:
    • IQ-TREE2 (default): iqtree2 -s aln.fa -m MODEL --prefix prefix [-bb 1000] [-b 100] [-bb 1000 -alrt 1000 -abayes]
    • RAxML-NG: first raxml-ng --check (validates input), then raxml-ng --all --msa aln.fa --model MODEL --bs-trees N
  6. Rooting (optional):
    • Outgroup: pass --outgroup TAXON to tree builder (-o in IQ-TREE, --outgroup in RAxML-NG)
    • Midpoint: use ETE3 t.get_midpoint_outgroup(); t.set_outgroup(midpoint) post-inference
  7. Parse & render — extract branch lengths and support values from Newick; draw proportional phylogram with Bio.Phylo + matplotlib.
  8. Report — write report.md, result.json (ClawBio contract), phylo_tree.nwk, alignment/aligned.fasta and alignment/trimmed.fasta when those stages ran and the destination is not this run's own input, figures/phylogram.png, tables/branch_support.csv, reproducibility/.

Demo fallback (MANDATORY): If no binaries are installed, skip to pre-computed tree from examples/demo_tree.nwk. Always show a result, never refuse.

Freedom level per step:

  • Steps 1–6 are prescriptive (exact CLI flags matter).
  • Report narrative can be written flexibly by the agent.

CLI Reference

bash
# Full pipeline: unaligned → MSA → trim → ModelFinder → IQ-TREE2
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input sequences.fasta --output /tmp/phylo

# Pre-aligned input (skip MSA)
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned

# Choose MSA algorithm (mafft default)
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input sequences.fasta --output /tmp/phylo \
  --aligner muscle

# Standard bootstrap instead of UFBoot
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned \
  --bootstrap standard

# Triple support: UFBoot + aLRT + aBayes
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned \
  --bootstrap all

# Root by outgroup
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned \
  --outgroup Mus_musculus,Rattus_norvegicus

# Midpoint rooting (requires ETE3)
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned \
  --root midpoint

# Use RAxML-NG engine
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned \
  --engine raxml-ng

# Skip trimming
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned --no-trim

# Provide model explicitly (skip ModelFinder)
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --input aligned.fasta --output /tmp/phylo --aligned \
  --model GTR+F+G4

# Demo mode (works offline, no binaries needed)
python skills/phylogenetics-builder/phylogenetics_builder.py \
  --demo --output /tmp/phylo_demo

All flags

FlagDefaultDescription
--input FILE—Input FASTA (unaligned or aligned)
--output DIR—Output directory
--demooffRun with built-in 12-taxon primate data
--alignedoffInput is already aligned — skip MSA
--alignermafftMSA algorithm: mafft / muscle / clustalw / kalign / tcoffee / prank
--engineiqtree2Tree engine: iqtree2 / raxml-ng
--model MODELautoSkip ModelFinder; use this substitution model
--bootstrapufbootBootstrap: ufboot / standard / all
--outgroup TAXA—Comma-separated outgroup taxon name(s)
--root midpoint—Midpoint rooting via ETE3 (post-inference)
--no-trimoffSkip trimAl trimming
--threads N2CPU threads for tree inference
--seed N42Random seed for reproducibility

MSA Algorithm Guide

AlignerSpeed (10 seqs)Speed (250 seqs)Recommendation
mafft4.4 s42 sDefault — best speed/quality balance
kalign0.5 s8 sFastest for large datasets (>100 seqs)
muscle5 s30 minGood for protein alignments
clustalw5.6 s49 minLegacy; avoid for large datasets
tcoffeeslowvery slowMost accurate; use for ≤20 sequences
prankslowvery slowCodon-aware; use with -codon for coding DNA

Benchmarks on SUP35 gene dataset from NGS Handbook.

Bootstrap Guide

ModeFlagSpeedUse when
ufboot-bb 1000~3 secDefault; fast and reliable (threshold: ≥95)
standard-b 100~3 minPublication standard; slower Felsenstein bootstrap
all-bb 1000 -alrt 1000 -abayes~5 secNeed triple validation; parse with / delimiter

Triple support labels format: {alrt}/{abayes}/{ufb} — thresholds: alrt > 70, abayes > 0.7, ufb > 95.

Example Output

markdown
# Phylogenetics Builder Report

### Pipeline Summary

| Parameter | Value |
|-----------|-------|
| Input | `sequences.fasta` |
| Taxa | 12 |
| Aligner | mafft |
| Trimming | trimAl -automated1 |
| Substitution model | `TIM3+F+G4` |
| Tree engine | iqtree2 |
| Bootstrap | UFBoot (1 000 replicates) |
| Rooting | unrooted |

### Pipeline Steps
- `msa:mafft`
- `trim:trimal`
- `modelfinder:TIM3+F+G4`
- `tree:iqtree2:ufboot`

### Branch Lengths & Support Values
| Node / Taxon | Branch Length | Support |
|:-------------|:-------------:|:-------:|
| Homo_sapiens | 0.01000 | 100 |
| Pan_troglodytes | 0.00800 | 98 |
...

Output Structure

output_directory/
├── report.md                    # Primary markdown report with pipeline summary
├── result.json                  # Machine-readable ClawBio output contract
├── phylo_tree.nwk               # Newick format tree with bootstrap support
├── alignment/                  # aligned.fasta (MSA) and trimmed.fasta (trimAl), when produced
├── figures/
│   └── phylogram.png            # Proportional phylogram (matplotlib)
├── tables/
│   └── branch_support.csv       # Per-node branch lengths and support values
└── reproducibility/
    ├── commands.sh              # Exact CLI command used
    ├── environment.yml          # Conda environment definition
    └── checksums.sha256         # SHA-256 checksums of all outputs

Gotchas

  • Prank writes to {prefix}.best.fas, not {prefix}. If using prank as aligner, the skill auto-renames this file. If you call prank manually, remember to look for the .best.fas suffix.
  • ModelFinder adds +F to models; RAxML-NG rejects it. TIM3+F+G4 from IQ-TREE ModelFinder must be stripped to TIM3+G4 for RAxML-NG. The skill handles this automatically via adapt_model_for_engine(). If you pass --model manually with --engine raxml-ng, omit the +F.
  • UFBoot threshold is 95, not 70. A common mistake is applying the standard bootstrap threshold (70) to UFBoot values. UFBoot support of 70 is NOT reliable. Use ≥ 95 as the cutoff for UFBoot.
  • Triple support labels contain /. With --bootstrap all, node labels encode alrt/abayes/ufb (e.g. 80.5/0.85/97). Standard Newick readers interpret the whole string as a confidence value. Use strsplit(label, "/") in R or split by / in Python.
  • trimAl on protein alignments may over-trim. For small protein alignments (<20 sequences, >200 aa), use --no-trim or use -nogaps strategy instead of -automated1, which can remove too many columns.
  • IQ-TREE -T AUTO can block tests. Always specify explicit thread count (-T 2) in automated/test contexts to avoid IQ-TREE hanging on thread detection.
  • Pre-aligned input still needs equal-length sequences. If you use --aligned, the skill validates that all sequences are the same length. Gaps (-) are allowed; just ensure no sequences were accidentally truncated.

Safety

  • All processing is local — sequences never leave the machine.
  • Disclaimer: every report includes the ClawBio medical disclaimer.
  • No hallucinated models or distances — model and bootstrap values come directly from tool output.
  • Warn before overwriting — script warns if output directory is non-empty.

Agent Boundary

The agent (LLM) dispatches to this skill and explains the results. The skill (Python script) executes all computation. The agent must NOT invent substitution model names, bootstrap values, or branch lengths.

Integration with Bio Orchestrator

Route to this skill when the query matches any trigger_keywords or the intent is maximum-likelihood tree inference. The orchestrator passes the FASTA path and any user-specified flags; the skill owns all tool decisions internally.

After the run, read result.json:

  • chat_summary_lines — surface to the user verbatim.
  • preferred_artifacts — open the figure and tree file for the user.
  • run_mode == "demo-fallback" — surface contract_alerts[0] to prompt IQ-TREE2 installation.
  • workflow_state == "completed" — no retry needed.

Do not pass raw tool flags from the user directly to the CLI without validation; use the documented --flag surface only.

Chaining Partners

SkillWhen to chain
fastreerUser wants a fast k-mer distance tree without full MSA
variant-annotationAnnotate variants found in sequences before building tree
genome-compareCompare multiple genomes before phylogenetic inference
profile-reportAdd evolutionary context to a patient profile
claw-ancestry-pcaPopulation structure analysis complements phylogenetics

Dependencies

DependencyVersionRequiredPurpose
python≥ 3.10yesRuntime
biopython≥ 1.80yesNewick I/O, root_at_midpoint, visualisation
matplotlib≥ 3.5yesPhylogram rendering
pandas≥ 2.0yesBranch support CSV export
iqtree2≥ 2.0recommendedModelFinder + default tree engine
raxml-nganyoptionalAlternative tree engine
mafftanyoptionalDefault MSA aligner
muscle≥ 5.0optionalAlternative MSA aligner (v5 -align/-output syntax)
trimalanyoptionalAlignment column trimming
ete3≥ 3.1optionalMidpoint rooting (Bio.Phylo fallback if absent)
clustalwanyoptionalLegacy MSA aligner
kalign≥ 3optionalFast MSA for large datasets
t_coffeeanyoptionalHigh-accuracy MSA for ≤ 20 sequences
prankanyoptionalCodon-aware MSA

Install all bioinformatics binaries:

bash
conda install -c bioconda iqtree raxml-ng mafft muscle trimal clustalw kalign3 t_coffee prank

Maintenance

  • Review cadence: bi-annually, or when IQ-TREE2 / RAxML-NG release major versions.
  • Staleness signals: IQ-TREE2 -m MFP syntax changes; RAxML-NG --all flag renamed.
  • Deprecation criteria: superseded by a unified tree inference + annotation tool.

Citations

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Phylogenetics Builder?

End-to-end ML phylogenetic tree inference — MSA, trimming, ModelFinder, IQ-TREE2/RAxML-NG.

Firwat Phylogenetics Builder op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Phylogenetics Builder besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Phylogenetics Builder an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/ClawBio/ClawBio/tree/main/skills/phylogenetics-builder an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Phylogenetics Builder benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Phylogenetics Builder benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Phylogenetics Builder domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Phylogenetics Builder gratis?

Jo. De Skill gëtt vum ClawBio ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇