一键导入
phylogenetics-builder
End-to-end ML phylogenetic tree inference — MSA, trimming, ModelFinder, IQ-TREE2/RAxML-NG.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
End-to-end ML phylogenetic tree inference — MSA, trimming, ModelFinder, IQ-TREE2/RAxML-NG.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | phylogenetics-builder |
| description | End-to-end ML phylogenetic tree inference — MSA, trimming, ModelFinder, IQ-TREE2/RAxML-NG. |
| license | MIT |
| metadata | {"openclaw":{"requires":{"bins":["python3"]},"always":false,"emoji":"🌳","homepage":"https://github.com/ClawBio/ClawBio","os":["darwin","linux"],"install":[{"kind":"conda","package":"bioconda::iqtree"},{"kind":"conda","package":"bioconda::raxml-ng"},{"kind":"conda","package":"bioconda::mafft"},{"kind":"conda","package":"bioconda::muscle"},{"kind":"conda","package":"bioconda::trimal"}],"trigger_keywords":["phylogeny","phylogenetic tree","iqtree","raxml","maximum likelihood tree","mafft alignment","build tree from sequences","model selection","ModelFinder","bootstrap support","evolutionary tree","molecular phylogeny"]},"author":"ClawBio","version":"0.2.0","demo_data":[{"path":"demo_alignment.fasta","description":"Synthetic 12-taxon primate alignment (500 bp, pre-aligned)"}],"dependencies":{"python":">=3.10","packages":["pandas>=2.0","biopython>=1.80","matplotlib>=3.5"],"optional":["ete3>=3.1"]},"domain":"genomics","endpoints":{"cli":"python skills/phylogenetics-builder/phylogenetics_builder.py --input {input_file} --output {output_dir}"},"inputs":[{"name":"input_file","type":"file","format":["fasta","fa","aln"],"description":"DNA or protein sequences (unaligned for full pipeline, aligned with --aligned flag)","required":true}],"outputs":[{"name":"report","type":"file","format":["md"],"description":"Full analysis report with pipeline summary and branch table"},{"name":"result","type":"file","format":["json"],"description":"Machine-readable results (ClawBio output contract)"},{"name":"phylo_tree","type":"file","format":["nwk"],"description":"Newick format tree with bootstrap support values"}]} |
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.
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.
Fire when the user says:
Do NOT fire when:
fastreer insteadfastreer insteadstruct-predictorOne 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:
-automated1 (removes gapped columns)-m MFP), BIC-selectedroot_at_midpoint fallback)--aligned is set.--aligned) — run the chosen aligner; default is mafft --auto for speed/quality balance. Alternative aligners: muscle, clustalw, kalign, tcoffee, prank.--no-trim) — run trimal -automated1. This removes gapped columns that add noise without information. Skip for protein alignments where all columns are informative.--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.iqtree2 -s aln.fa -m MODEL --prefix prefix [-bb 1000] [-b 100] [-bb 1000 -alrt 1000 -abayes]raxml-ng --check (validates input), then raxml-ng --all --msa aln.fa --model MODEL --bs-trees N--outgroup TAXON to tree builder (-o in IQ-TREE, --outgroup in RAxML-NG)t.get_midpoint_outgroup(); t.set_outgroup(midpoint) post-inferencereport.md, result.json (ClawBio contract), phylo_tree.nwk, 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:
# 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
| Flag | Default | Description |
|---|---|---|
--input FILE | — | Input FASTA (unaligned or aligned) |
--output DIR | — | Output directory |
--demo | off | Run with built-in 12-taxon primate data |
--aligned | off | Input is already aligned — skip MSA |
--aligner | mafft | MSA algorithm: mafft / muscle / clustalw / kalign / tcoffee / prank |
--engine | iqtree2 | Tree engine: iqtree2 / raxml-ng |
--model MODEL | auto | Skip ModelFinder; use this substitution model |
--bootstrap | ufboot | Bootstrap: ufboot / standard / all |
--outgroup TAXA | — | Comma-separated outgroup taxon name(s) |
--root midpoint | — | Midpoint rooting via ETE3 (post-inference) |
--no-trim | off | Skip trimAl trimming |
--threads N | 2 | CPU threads for tree inference |
--seed N | 42 | Random seed for reproducibility |
| Aligner | Speed (10 seqs) | Speed (250 seqs) | Recommendation |
|---|---|---|---|
| mafft | 4.4 s | 42 s | Default — best speed/quality balance |
| kalign | 0.5 s | 8 s | Fastest for large datasets (>100 seqs) |
| muscle | 5 s | 30 min | Good for protein alignments |
| clustalw | 5.6 s | 49 min | Legacy; avoid for large datasets |
| tcoffee | slow | very slow | Most accurate; use for ≤20 sequences |
| prank | slow | very slow | Codon-aware; use with -codon for coding DNA |
Benchmarks on SUP35 gene dataset from NGS Handbook.
| Mode | Flag | Speed | Use when |
|---|---|---|---|
ufboot | -bb 1000 | ~3 sec | Default; fast and reliable (threshold: ≥95) |
standard | -b 100 | ~3 min | Publication standard; slower Felsenstein bootstrap |
all | -bb 1000 -alrt 1000 -abayes | ~5 sec | Need triple validation; parse with / delimiter |
Triple support labels format: {alrt}/{abayes}/{ufb} — thresholds: alrt > 70, abayes > 0.7, ufb > 95.
# 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_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
├── 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
{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.+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./. 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.--no-trim or use -nogaps strategy instead of -automated1, which can remove too many columns.-T AUTO can block tests. Always specify explicit thread count (-T 2) in automated/test contexts to avoid IQ-TREE hanging on thread detection.--aligned, the skill validates that all sequences are the same length. Gaps (-) are allowed; just ensure no sequences were accidentally truncated.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.
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.
| Skill | When to chain |
|---|---|
fastreer | User wants a fast k-mer distance tree without full MSA |
variant-annotation | Annotate variants found in sequences before building tree |
genome-compare | Compare multiple genomes before phylogenetic inference |
profile-report | Add evolutionary context to a patient profile |
claw-ancestry-pca | Population structure analysis complements phylogenetics |
| Dependency | Version | Required | Purpose |
|---|---|---|---|
| python | ≥ 3.10 | yes | Runtime |
| biopython | ≥ 1.80 | yes | Newick I/O, root_at_midpoint, visualisation |
| matplotlib | ≥ 3.5 | yes | Phylogram rendering |
| pandas | ≥ 2.0 | yes | Branch support CSV export |
| iqtree2 | ≥ 2.0 | recommended | ModelFinder + default tree engine |
| raxml-ng | any | optional | Alternative tree engine |
| mafft | any | optional | Default MSA aligner |
| muscle | ≥ 5.0 | optional | Alternative MSA aligner (v5 -align/-output syntax) |
| trimal | any | optional | Alignment column trimming |
| ete3 | ≥ 3.1 | optional | Midpoint rooting (Bio.Phylo fallback if absent) |
| clustalw | any | optional | Legacy MSA aligner |
| kalign | ≥ 3 | optional | Fast MSA for large datasets |
| t_coffee | any | optional | High-accuracy MSA for ≤ 20 sequences |
| prank | any | optional | Codon-aware MSA |
⚠ ete3 maintenance warning:
ete3(used above for midpoint rooting) has had no release since May 2023 (latest: 3.1.3) and is effectively unmaintained. The actively developed fork is ete4 (pip install ete4), which has a partially changed API (see ete4 migration docs). Since ete3 is optional here — Bio.Phylo'sroot_at_midpointis already the fallback — prefer relying on that fallback for new deployments rather than adding a fresh ete3 pin.
Install all bioinformatics binaries:
conda install -c bioconda iqtree raxml-ng mafft muscle trimal clustalw kalign3 t_coffee prank
-m MFP syntax changes; RAxML-NG --all flag renamed.Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects. Calculates CRAP scores per method and surfaces risk hotspots — complex code with low coverage that is dangerous to modify. Use to diagnose why coverage is stuck or plateaued, identify what methods block improvement, or get project-wide coverage analysis with risk ranking. USE FOR: coverage stuck, coverage plateau, can't increase coverage, what's blocking coverage, coverage gap, CRAP scores, risk hotspots, where to add tests, coverage analysis, coverage report. DO NOT USE FOR: targeted single-method CRAP analysis (use crap-score); auditing test code for coverage-touching or other anti-patterns (use test-anti-patterns); writing tests; running tests (use run-tests). Requires or produces coverage (Cobertura) and CRAP metrics.
Role-based multi-agent orchestration framework for building "Crews" of collaborating LLM agents (each with a role, goal, backstory, and optional tools) that execute sequential or hierarchical task pipelines, plus event-driven "Flows" for precise, single-LLM-call orchestration. Use when composing specialized agents (e.g. a research agent + an analysis agent + a writer agent) into a declarative pipeline for complex multi-step tasks like automated literature review or multi-agent research workflows. Distinct from LangGraph's explicit state-machine graphs and smolagents' minimal tool-calling loop — CrewAI is standalone (no LangChain dependency) and expresses orchestration as roles and delegated tasks rather than a graph or a single ReAct loop.
Adapter, primer, and poly-A/T trimming for high-throughput sequencing reads (FASTQ/FASTA). Use for ATAC-seq (Nextera adapter removal), ChIP-seq/CUT&RUN, small RNA-seq (preserving reads as short as ~18 nt), and amplicon/primer trimming where exact or linked adapter sequences matter more than fastp's heuristic auto-detection. Covers 3'/5'/linked adapters, IUPAC wildcards, paired-end synchronization, quality/length filtering, and demultiplexing by barcode.
Data Version Control (DVC) for tracking large datasets/models with Git-like semantics, defining reproducible data/ML pipelines (dvc.yaml stages that only re-run when their inputs change), and lightweight experiment tracking without a server. Use when large files (VCF/BAM/FASTQ, reference genomes, model weights) can't go in Git, when you need Make/Snakemake-style selective re-execution driven by data, or when comparing many training runs locally before promoting one. Pairs with Git (code), cloud object storage (data), and Snakemake/Nextflow (compute graph).
Fast Python I/O for BigWig (continuous genome signal) and BigBed (interval annotation) files via libBigWig. Use for random-access signal queries at specific genomic coordinates (bw.values, bw.stats), computing per-region summary statistics (mean/max/coverage) over a BED file of regions, writing custom BigWig tracks from numpy arrays, and loading ChIP-seq/ATAC-seq/RNA-seq/methylation coverage tracks (e.g. produced by deeptools bamCoverage) into pandas/numpy for downstream analysis or ML feature extraction. Complements deeptools (which generates BigWig files) and chip-seq/atac-seq workflows.
Distributed Python compute with Ray — @ray.remote tasks/actors for cluster-scale parallelism, Ray Data for large-batch preprocessing, Ray Train for distributed model training (DDP/FSDP/DeepSpeed), Ray Tune for scalable hyperparameter search, and Ray Serve for model serving. Use when scaling a Python workload (docking screens, million-cell atlas preprocessing, hyperparameter sweeps, multi-GPU training) from a laptop to a multi-node cluster with minimal code changes. Ray Tune can use optuna as a search algorithm; Ray Train wraps pytorch-lightning-style training loops.