bio-phylo-bayesian-inference
БесплатноЗапускает вложенные скриптыНе проверенRun Bayesian phylogenetic analysis with MrBayes, BEAST2, RevBayes, and PhyloBayes including MCMC convergence diagnostics and model comparison. Use when…
от gabrielmoreira★ 23 звезды на GitHubОб этом скилле
Version Compatibility
Reference examples tested with: MrBayes 3.2.7+, BEAST2 2.7+, Tracer 1.7+, RevBayes 1.2+, PhyloBayes MPI 1.9+, RWTY (R package)
Before using code patterns, verify installed versions match. If versions differ:
- CLI:
mb --version,beast -version,rb --version,pb --version - Python:
pip show biopythonthenhelp(module.function)to check signatures - R:
packageVersion('rwty')then?function_nameto verify parameters
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Bayesian Phylogenetic Inference
"Run a Bayesian phylogenetic analysis" -> Infer posterior distribution of trees and parameters via MCMC sampling, producing posterior probability support and enabling formal model comparison.
- CLI:
mb(MrBayes),beast(BEAST2),rb(RevBayes),pb/bpcomp(PhyloBayes) - Python: BioPython
Bio.Phylofor parsing output trees;arviz/pandasfor trace diagnostics
When to Use Bayesian vs ML
| Factor | ML (IQ-TREE/RAxML-NG) | MrBayes | BEAST2 | RevBayes | PhyloBayes |
|---|---|---|---|---|---|
| Primary use | Topology, hypothesis testing | Posterior probabilities on topology | Divergence times, demographics, tip-dating | Non-standard models, full graphical model control | Deep phylogenies with compositional heterogeneity |
| Speed | Fast | Moderate | Slow | Moderate | Very slow |
| Ease of use | Easy | Easy | Moderate (BEAUti GUI) | Steep learning curve | Moderate |
| Model flexibility | Good | Good | Extensive (packages) | Maximum (scripted) | CAT/CAT-GTR |
| Default choice | Yes, for topology | When posterior probabilities needed | When time calibration needed (see divergence-dating) | When no existing model fits | When LBA from model misspecification suspected |
| Multi-run | Automatic | 2 runs x 4 chains default | Must run independently | Manual | Must run independently |
Default recommendation: Start with ML (modern-tree-inference). Move to Bayesian when posterior probabilities, divergence times, or site-heterogeneous models are specifically needed.
MrBayes
Basic Analysis
Goal: Obtain a Bayesian phylogeny with posterior probability support values.
Approach: Load a Nexus alignment into MrBayes, set the substitution model and priors, run two independent MCMC analyses with Metropolis-coupled chains (MC3), then summarize parameters and trees after discarding burn-in.
execute alignment.nex
lset nst=6 rates=invgamma
prset brlenspr=unconstrained:exp(10.0)
mcmc ngen=1000000 samplefreq=100 nchains=4 nruns=2
sump
sumt
Key settings:
nst=6 rates=invgamma: GTR+I+G model. Usenst=2for HKY,nst=1for JC/F81nchains=4 nruns=2: Two independent runs each with 4 Metropolis-coupled chains (1 cold + 3 heated). This is the default and should not be reducedsamplefreq=100: Sample every 100 generations. Adjust so total samples = ngen/samplefreq is at least 10,000sump: Summarizes parameter traces, reports ESS and PSRFsumt: Summarizes trees, builds majority-rule consensus with posterior probabilities
MC3 (Metropolis-Coupled MCMC)
MrBayes runs Metropolis coupling by default: one cold chain explores the posterior while heated chains explore broader landscape and swap states with the cold chain. This improves mixing for multimodal posteriors. The acceptance rate for swaps between adjacent chains should be 20-70%; adjust temp=0.2 (default) if swaps are too rare or too frequent.
Mixed Models and Partitions
charset gene1 = 1-300
charset gene2 = 301-600
partition by_gene = 2: gene1, gene2
set partition = by_gene
lset applyto=(1) nst=6 rates=invgamma
lset applyto=(2) nst=2 rates=gamma
unlink statefreq=(all) revmat=(all) shape=(all) pinvar=(all)
prset applyto=(all) ratepr=variable
Reversible-Jump Model Selection
MrBayes can average over all 203 time-reversible substitution models during MCMC:
lset nst=mixed rates=invgamma
This integrates over model uncertainty rather than fixing a single model. Preferred when model choice is uncertain.
BEAST2
Workflow
- Prepare alignment in BEAUti (generates XML configuration)
- Set substitution model, clock model, and tree prior in BEAUti
- Run BEAST2 from command line
- Check convergence in Tracer
- Summarize trees with TreeAnnotator
- Visualize in FigTree or equivalent
beast -threads 4 -seed 12345 analysis.xml
treeannotator -burnin 10 -heights median analysis.trees consensus.tree
bModelTest for Bayesian Model Averaging
The bModelTest package averages over all 203 time-reversible nucleotide substitution models during MCMC, eliminating the need for separate model selection:
- Install via BEAUti Package Manager
- In BEAUti: Site Model tab -> select "bModelTest"
- The analysis samples across models weighted by their posterior probability
This is analogous to
Установить bio-phylo-bayesian-inference в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bio-phylo-bayesian-inference?
Run Bayesian phylogenetic analysis with MrBayes, BEAST2, RevBayes, and PhyloBayes including MCMC convergence diagnostics and model comparison. Use when needing posterior probability support, Bayesian model averaging, site-heterogeneous models for deep phylogenies, or formal model comparison via stepping-stone sampling.
Как установить скилл bio-phylo-bayesian-inference?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bio-phylo-bayesian-inference запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic