Add AxoMEME v1 weights, config, and model card
Browse files- README.md +138 -0
- config.json +11 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: axomeme
|
| 4 |
+
tags:
|
| 5 |
+
- biology
|
| 6 |
+
- bioinformatics
|
| 7 |
+
- phylogenetics
|
| 8 |
+
- molecular-evolution
|
| 9 |
+
- positive-selection
|
| 10 |
+
- dn-ds
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# AxoMEME
|
| 14 |
+
|
| 15 |
+
**Ultra-fast neural inference of episodic positive selection in molecular sequences.**
|
| 16 |
+
|
| 17 |
+
AxoMEME detects site-level episodic diversifying positive selection (dN/dS > 1) across
|
| 18 |
+
arbitrary codon alignments and phylogenetic trees. It replaces numerical Maximum Likelihood
|
| 19 |
+
Estimation with an axial geometric transformer using Continuous 4D Tree Rotary Position
|
| 20 |
+
Embeddings (Tree-RoPE), reaching a 100x-1,000x speedup over HyPhy MEME and PAML CodeML while
|
| 21 |
+
matching or exceeding their empirical statistical power at a strictly controlled false
|
| 22 |
+
positive rate.
|
| 23 |
+
|
| 24 |
+
- **Repository:** https://github.com/veg/axomeme
|
| 25 |
+
- **Architecture notes:** [ARCHITECTURE.md](https://github.com/veg/axomeme/blob/main/ARCHITECTURE.md)
|
| 26 |
+
- **Developed by:** Sergei L. Kosakovsky Pond and collaborators
|
| 27 |
+
- **License:** MIT
|
| 28 |
+
|
| 29 |
+
## Model details
|
| 30 |
+
|
| 31 |
+
| | |
|
| 32 |
+
| :--- | :--- |
|
| 33 |
+
| Parameters | 1,909,404 |
|
| 34 |
+
| Embedding dimension | 384 |
|
| 35 |
+
| Layers | 6 |
|
| 36 |
+
| Attention heads | 12 |
|
| 37 |
+
| Ordinal thresholds (CORAL head) | 16 |
|
| 38 |
+
| Precision | float32 |
|
| 39 |
+
| Checkpoint format | safetensors |
|
| 40 |
+
|
| 41 |
+
The model consumes a codon alignment plus a phylogeny and emits, per codon site, a likelihood
|
| 42 |
+
ratio test statistic for episodic diversifying selection. Asymptotic p-values follow the
|
| 43 |
+
standard MEME null mixture, `0.5 * delta(0) + 0.5 * chi^2(1)`.
|
| 44 |
+
|
| 45 |
+
## Usage
|
| 46 |
+
|
| 47 |
+
Install the package, which pulls these weights automatically on first use:
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
pip install git+https://github.com/veg/axomeme.git
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
### Command line
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
axomeme predict \
|
| 57 |
+
--alignment my_genes.fasta \
|
| 58 |
+
--tree my_genes.nwk \
|
| 59 |
+
--output results.json \
|
| 60 |
+
--csv results.csv
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
If `--tree` is omitted, AxoMEME extracts an embedded tree from a NEXUS or FASTA alignment.
|
| 64 |
+
|
| 65 |
+
### Python
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
from axomeme import PhyloAxialTransformer, load_alignment_and_tree
|
| 69 |
+
|
| 70 |
+
model = PhyloAxialTransformer.from_pretrained("datamonkey/axomeme").eval()
|
| 71 |
+
codons, aas, dists, mds, invariable, taxa, num_sites = load_alignment_and_tree(
|
| 72 |
+
"my_genes.fasta", "my_genes.nwk"
|
| 73 |
+
)
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
See the repository README for a complete inference loop, including site batching and p-value
|
| 77 |
+
computation.
|
| 78 |
+
|
| 79 |
+
## Inputs and outputs
|
| 80 |
+
|
| 81 |
+
**Inputs.** An in-frame codon alignment (FASTA or NEXUS) and a phylogenetic tree (Newick or
|
| 82 |
+
NEXUS) with branch lengths. Trees lacking branch lengths are estimated via HyPhy under HKY85
|
| 83 |
+
when HyPhy is on the PATH; otherwise strictly positive lower bounds of 1e-4 are enforced,
|
| 84 |
+
which degrades accuracy.
|
| 85 |
+
|
| 86 |
+
**Outputs.** Per codon site: an LRT statistic, an asymptotic p-value, and an invariable-site
|
| 87 |
+
flag. Sites that are invariable across the alignment are assigned an LRT of 0.
|
| 88 |
+
|
| 89 |
+
## Evaluation
|
| 90 |
+
|
| 91 |
+
Taking HyPhy MEME (p <= 0.10, asymptotic LRT >= 4.605) as ground truth across 84 empirical
|
| 92 |
+
datasets from 9 independent literature studies (43,302 codons, up to 476 taxa):
|
| 93 |
+
|
| 94 |
+
| Literature study & system | Datasets | Codons | ROC-AUC | PR-AUC | PPV | FPR | Spearman rho | HyPhy MLE | AxoMEME CPU | Speedup |
|
| 95 |
+
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 96 |
+
| Abdul et al. (2018), SMC5/6 complex | 9 | 7,073 | 0.990 | 0.752 | 100.0% | 0.00% | 0.874 | 561.0 s | 3.84 s | 171.3x |
|
| 97 |
+
| Nisson et al. (2025), CCDC137 (HIV Vpr) | 1 | 290 | 0.940 | 0.650 | 75.0% | 0.35% | 0.833 | 80.0 s | 0.21 s | 380.9x |
|
| 98 |
+
| Le Corf et al. (2026), GBP5 GTPase | 2 | 1,223 | 0.958 | 0.584 | 68.2% | 0.49% | 0.782 | 1,174.0 s | 1.68 s | 693.3x |
|
| 99 |
+
| D'Oliviera et al. (2025), TRMT1 cleavage | 2 | 1,613 | 0.945 | 0.512 | 62.5% | 0.31% | 0.671 | 723.0 s | 1.30 s | 543.9x |
|
| 100 |
+
| Lytras et al. (2023), bat OAS1 factor | 1 | 351 | 0.904 | 0.628 | 87.5% | 0.35% | 0.675 | 352.0 s | 0.22 s | 1,566.3x |
|
| 101 |
+
| Wisotsky et al. (2020), benchmark suite | 12 | 4,290 | 0.965 | 0.618 | 68.8% | 0.58% | 0.615 | 8,603.0 s | 55.49 s | 608.8x |
|
| 102 |
+
| Hilbert & Elde (2023), Siglec / C-lectins | 57 | 28,462 | 0.892 | 0.224 | 44.8% | 0.17% | 0.376 | 14,203.0 s | 16.12 s | 859.1x |
|
| 103 |
+
| **Global aggregate** | **84** | **43,302** | **0.914** | **0.286** | **50.6%** | **0.191%** | **0.489** | **25,696.0 s** | **78.87 s** | **325.8x** |
|
| 104 |
+
|
| 105 |
+
Validation metrics recorded in the training checkpoint: Spearman rho 0.5974, MSE
|
| 106 |
+
3.6411, at epoch 16.
|
| 107 |
+
|
| 108 |
+
## Limitations and intended use
|
| 109 |
+
|
| 110 |
+
AxoMEME is a research tool for comparative molecular evolution, intended as a fast screen for
|
| 111 |
+
sites under episodic diversifying selection.
|
| 112 |
+
|
| 113 |
+
- It is trained to approximate HyPhy MEME, so it inherits that method's assumptions and is
|
| 114 |
+
evaluated against it rather than against ground-truth selection. It is an approximation of
|
| 115 |
+
MEME, not an independent test of it.
|
| 116 |
+
- Precision falls on large, diverse gene families. On the Hilbert & Elde Siglec/C-lectin set
|
| 117 |
+
the positive predictive value is 44.8%, so roughly half of flagged sites are not MEME
|
| 118 |
+
positives. Treat hits as candidates for confirmatory analysis, not conclusions.
|
| 119 |
+
- Aggregate PR-AUC of 0.286 reflects strong class imbalance; positive sites are rare.
|
| 120 |
+
- Accuracy depends on branch lengths being present and meaningful. Topology-only trees are
|
| 121 |
+
handled but degrade results.
|
| 122 |
+
- Alignments must be in frame. Frameshifted or misaligned input produces silently wrong
|
| 123 |
+
output.
|
| 124 |
+
- The model has not been evaluated on non-coding sequence, recombinant alignments, or
|
| 125 |
+
alignments with pervasive sequencing error.
|
| 126 |
+
|
| 127 |
+
## Citation
|
| 128 |
+
|
| 129 |
+
A publication is in preparation. Until it appears, cite the repository:
|
| 130 |
+
|
| 131 |
+
```bibtex
|
| 132 |
+
@software{axomeme,
|
| 133 |
+
title = {AxoMEME: Ultra-Fast Neural Inference of Episodic Positive Selection in Molecular Sequences},
|
| 134 |
+
author = {Kosakovsky Pond, Sergei L. and collaborators},
|
| 135 |
+
url = {https://github.com/veg/axomeme},
|
| 136 |
+
year = {2026}
|
| 137 |
+
}
|
| 138 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dropout": 0.1,
|
| 3 |
+
"embed_dim": 384,
|
| 4 |
+
"max_k": 32,
|
| 5 |
+
"max_species": 256,
|
| 6 |
+
"num_heads": 12,
|
| 7 |
+
"num_layers": 6,
|
| 8 |
+
"num_thresholds": 16,
|
| 9 |
+
"num_tokens": 66,
|
| 10 |
+
"window_size": 1
|
| 11 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db59db0d13aeca06fddbec3c56280a69915bd6c4fd77a19220c4e82365a5e5bc
|
| 3 |
+
size 7655016
|