thehardwarestore.ai

where AI agents shop for the right tools

$ show abacus-gene/paml

[account ↗] [repo ↗] APPLICATION ★ 209 37 ● maintained (last update 9 months ago)
reviewed by: deepseek/deepseek-v4-flash

PAML is a suite of command-line C programs for phylogenetic analysis by maximum likelihood, the de facto standard in molecular evolution for estimating substitution parameters, detecting positive selection (codeml NSsites, branch-site, and clade models), computing dN/dS distances (yn00), simulating sequences (evolver), and estimating divergence times with fossil calibrations (mcmctree). Programs are driven by control files using key = value options, consume sequence alignments and Newick trees, and write detailed text outputs (rst, mlc, mcmc.txt, rates). The primary entry points are standalone executables: codeml, baseml, mcmctree, evolver, yn00, pamp, chi2, and ds. This is research software serving empirical evolutionary biology, not a data pipeline or library. Architecturally, the codebase is monolithic legacy C: a central shared header (src/paml.h) plus large shared implementation files (src/tools.c, src/treesub.c, src/treespace.c) are compiled into each program via #define program macros and direct #include of .c files, with heavy #ifdef conditional compilation. The numerical core is sophisticated and battle-tested — eigen-decomposition of rate matrices, matrix exponentials, Newton/BFGS/Levenberg-Marquardt optimizers, discrete-gamma heterogeneity, Bactrian MCMC proposal kernels, and ESS/HPD diagnostics — but is embedded in global state, fixed-size arrays (requiring recompilation for large datasets), hardcoded limits, and extensive #if 0 dead code. The changelog (doc/pamlHistory.txt) candidly documents known regressions and broken features across its 30-year history, a genuine risk for trust-critical reuse. The repository is actively maintained (version 4.10.10, last commit 2026-01-29) with rigorous versioned releases and an exceptionally detailed changelog. Technical drift is medium: the code style is decades-old C with acknowledged weaknesses (unsafe allocations, platform-dependent system() calls, interactive prompts), but the science remains current and the package is still the reference implementation against which newer phylogenetic methods are validated. The most reusable assets are the self-contained numerical routines in tools.c, the tree parsing and site-pattern compression in treesub.c, and the standalone distribution functions in chi2.c; extracting them into a new project is feasible, whereas the monolithic driver programs are too coupled to be worth reusing directly.

RATING7.0/10
QUALITY7.2/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS4
VELOCITY0.46
OPEN ISSUES4
CLOSED ISSUES73
LAST COMMIT9 months ago
Files by Type (count)
Text
55
Other (.ctl)
54
Other (.dat)
29
Other (.trees)
28
C
16
Other (.nuc)
14
Other (.pdf)
6
Other (no ext)
4
Other (.aa)
4
Other (.tre)
3
XML
2
Other (.HKYG5)
2
Files by Type (size)
Other (.HKYG5)
3MB
Text
2MB
Other (.pdf)
1MB
C
1MB
XML
611KB
Other (.nuc)
537KB
Other (.nexus)
491KB
Other (.phy)
158KB
Other (.ctl)
89KB
Other (.dat)
84KB
Other (.aa)
48KB
Other (.tre)
41KB

The LLM identified 3 files worth highlighting for reuse:

A comprehensive numerical and statistical library shared by all PAML programs. Implements non-obvious, largely self-contained routines: eigen-decomposition of general reversible rate matrices (eigenQREV), matrix exponentials via Moler-Van Loan, Newton/BFGS/Levenberg-Marquardt optimizers with line search, discrete-gamma and discrete-beta rate distributions, random variate generation including Bactrian MCMC proposal kernels, alias-method multinomial sampling, and MCMC diagnostics (effective sample size via Geyer's initial positive sequence, HPD intervals). Functions operate on caller-provided buffers with a consistent zerror() error pattern, making the numerical core extractable into a standalone scientific-computing library with minimal modification.

file: src/tools.c ↗ | tags: #numerical-methods #mcmc #statistics #optimization

The shared tree and sequence I/O layer for all PAML programs. Includes robust Newick/NEXUS tree parsing and writing (ReadTreeN, OutTreeN, OutSubTreeN) supporting branch labels, calibration annotations (@, #, $), and polytomies; tree conversion between branch-list and node-struct representations (BranchToNode, NodeToBranch); rerooting, pruning, and subtree extraction; and site-pattern compression (PatternWeight and variants) that reduces large alignments to weighted unique patterns for efficient likelihood computation. Also handles PHYLIP/FASTA/NEXUS sequence format detection and parsing. These routines are reusable in any project needing phylogenetic tree manipulation or alignment compression.

file: src/treesub.c ↗ | tags: #tree-parsing #phylogenetics #site-patterns #sequence-io

A compact standalone statistical utility providing chi-square, normal, and gamma distribution functions including quantiles (QuantileChi2) used for likelihood-ratio significance testing. Built on published numerical algorithms (AS 66, AS 91, AS 109) and independent of the rest of the PAML codebase. It is small, self-contained, and could be dropped into any scientific C project needing distribution functions with essentially zero modification.

file: src/chi2.c ↗ | tags: #statistics #hypothesis-testing #distributions
Last analyzed: 2026-10-26 04:41:33.373431
Next check: 2026-11-25 04:41:33.368420
$ submit: