selkit
Pure-Python reimplementation of PAML's selection-analysis workflows (codeml, yn00).
v1 ships codeml site models (M0, M1a, M2a, M7, M8, M8a) with auto-LRTs, per-site NEB posteriors, model-level parallelism, multi-start optimization with a convergence gate, strict input validation, and reproducible run.yaml artifacts.
Install
pip install -e ".[dev]"
Requires Python 3.11+.
Typical CLI workflow
selkit codeml site-models \
--alignment gene.fa \
--tree species.nwk \
--output results/gene1 \
--threads 4
This fits M0, M1a, M2a, M7, M8, and M8a, computes M1a-vs-M2a, M7-vs-M8, and M8a-vs-M8 LRTs, and emits per-site NEB posteriors for M2a and M8.
Outputs in results/gene1/:
results.json— canonical structured output (all fits, LRTs, BEB sites, warnings).fits.tsv,lrts.tsv,beb_M2a.tsv,beb_M8.tsv— tabular views.run.yaml— exact config; reproduce withselkit rerun results/gene1/run.yaml.
Validation
selkit validate --alignment gene.fa --tree species.nwk
Runs every pre-flight check short of model fitting (length multiples of 3, stop codons, taxon match, foreground-label consistency).
Library
from selkit import codeml_site_models
result = codeml_site_models(
alignment="gene.fa", tree="species.nwk", output_dir="out/",
models=("M0", "M1a", "M2a"),
)
print(result.fits["M2a"].lnL)
for s in result.beb["M2a"]:
if s.p_positive > 0.95:
print(f"site {s.site}: P(omega > 1) = {s.p_positive:.3f}")
Not yet in v1
- Branch models (one-ratio, two-ratios, free-ratios)
- Branch-site models (Model A, Model A null)
- yn00 pairwise dN/dS
These land in subsequent plans built on the same engine.
Design
See docs/superpowers/specs/2026-04-18-selkit-design.md.
Metadata
Release files for selkit 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| selkit-0.1.0.tar.gz | 25.1 kB | Without provenance | Details for selkit-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| selkit-0.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for selkit-0.1.0-py2.py3-none-any.whl |
Total release size: 56.0 kB
Release files / selkit-0.1.0.tar.gz
| Download URL | selkit-0.1.0.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac0855f5fe1985d43b34956641d83788a2e8d3c7ec4f25215e0c4d77cdcb5a9c
|
|
BLAKE2b-256 checksum How to use checksums |
9bdf35dd0d66b43a33bfd9eefe2a26041ae6478df45c7e1aca9ede30077e2994
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.10
|
Release files / selkit-0.1.0-py2.py3-none-any.whl
| Download URL | selkit-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 30.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
147b1c4ccaa63d60d0fe2903e734a327adb7751e1307ae27f435041b7eeda186
|
|
BLAKE2b-256 checksum How to use checksums |
5ce3c8ed0d22793bbf9f9ed76941e19be6fa4dd6d923ec5c73aaeede977c16de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.10
|
Security for selkit 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.