merge-cli 3.7__tar.gz → 3.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. merge_cli-3.10.0/MANIFEST.in +9 -0
  2. merge_cli-3.10.0/PKG-INFO +238 -0
  3. merge_cli-3.10.0/README.md +205 -0
  4. merge_cli-3.10.0/TUTORIAL.md +674 -0
  5. merge_cli-3.10.0/merge_cli/__init__.py +7 -0
  6. merge_cli-3.10.0/merge_cli/__main__.py +15 -0
  7. merge_cli-3.10.0/merge_cli/api.py +212 -0
  8. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli/cli.py +570 -151
  9. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli/config.py +12 -1
  10. merge_cli-3.10.0/merge_cli/data/models/MERGE_coding.pkl +0 -0
  11. merge_cli-3.10.0/merge_cli/data/models/MERGE_noncoding.pkl +0 -0
  12. merge_cli-3.10.0/merge_cli/data/models/MERGE_nonsnv.pkl +0 -0
  13. merge_cli-3.10.0/merge_cli/data/models/MERGE_splicing.pkl +0 -0
  14. merge_cli-3.10.0/merge_cli/data/models/MODEL_CARD.md +40 -0
  15. merge_cli-3.10.0/merge_cli/data/models/ensemble_predict.py +596 -0
  16. merge_cli-3.10.0/merge_cli/data/skills/merge-variant-pathogenicity/SKILL.md +111 -0
  17. merge_cli-3.10.0/merge_cli/local_engine.py +3233 -0
  18. merge_cli-3.10.0/merge_cli/mcp_install.py +460 -0
  19. merge_cli-3.10.0/merge_cli/mcp_server.py +607 -0
  20. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli/output.py +93 -10
  21. merge_cli-3.10.0/merge_cli/skill_install.py +89 -0
  22. merge_cli-3.10.0/merge_cli.egg-info/PKG-INFO +238 -0
  23. merge_cli-3.10.0/merge_cli.egg-info/SOURCES.txt +38 -0
  24. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli.egg-info/entry_points.txt +1 -0
  25. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli.egg-info/requires.txt +11 -2
  26. merge_cli-3.10.0/pyproject.toml +86 -0
  27. merge_cli-3.10.0/tests/test_answer_variant.py +210 -0
  28. merge_cli-3.10.0/tests/test_ep_module_isolation.py +108 -0
  29. merge_cli-3.10.0/tests/test_evo2_polling.py +148 -0
  30. merge_cli-3.10.0/tests/test_mcp_install.py +379 -0
  31. merge_cli-3.10.0/tests/test_semicolon_features.py +96 -0
  32. merge_cli-3.10.0/tests/test_sklearn_compat.py +109 -0
  33. merge_cli-3.10.0/tests/test_smoke_v38.py +262 -0
  34. merge_cli-3.10.0/tests/test_time_budget.py +136 -0
  35. merge_cli-3.7/MANIFEST.in +0 -1
  36. merge_cli-3.7/PKG-INFO +0 -88
  37. merge_cli-3.7/README.md +0 -61
  38. merge_cli-3.7/merge_cli/__init__.py +0 -1
  39. merge_cli-3.7/merge_cli/api.py +0 -153
  40. merge_cli-3.7/merge_cli/cli_env_patch.py +0 -132
  41. merge_cli-3.7/merge_cli/data/models/BestModel_coding.pkl +0 -0
  42. merge_cli-3.7/merge_cli/data/models/BestModel_noncoding.pkl +0 -0
  43. merge_cli-3.7/merge_cli/data/models/BestModel_splice.pkl +0 -0
  44. merge_cli-3.7/merge_cli/data/models/ensemble_predict.py +0 -752
  45. merge_cli-3.7/merge_cli/ensemble_predict.py +0 -752
  46. merge_cli-3.7/merge_cli/local_engine.py +0 -1810
  47. merge_cli-3.7/merge_cli.egg-info/PKG-INFO +0 -88
  48. merge_cli-3.7/merge_cli.egg-info/SOURCES.txt +0 -24
  49. merge_cli-3.7/pyproject.toml +0 -46
  50. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli/data/__init__.py +0 -0
  51. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli/data/models/.gitkeep +0 -0
  52. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli/data/models/__init__.py +0 -0
  53. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli.egg-info/dependency_links.txt +0 -0
  54. {merge_cli-3.7 → merge_cli-3.10.0}/merge_cli.egg-info/top_level.txt +0 -0
  55. {merge_cli-3.7 → merge_cli-3.10.0}/setup.cfg +0 -0
@@ -0,0 +1,9 @@
1
+ recursive-include merge_cli/data/models *.pkl *.py *.md .gitkeep
2
+ # The skill is what makes the MCP tools findable in clients that defer tool
3
+ # loading, so it has to ship with the package rather than live only in the repo.
4
+ recursive-include merge_cli/data/skills *.md
5
+ # README is included automatically as the long_description; TUTORIAL is not, and
6
+ # README links to it — a source distribution without it has a dead link.
7
+ include TUTORIAL.md
8
+ include MODEL_CARD.md
9
+ recursive-include tests *.py
@@ -0,0 +1,238 @@
1
+ Metadata-Version: 2.4
2
+ Name: merge-cli
3
+ Version: 3.10.0
4
+ Summary: MERGE variant pathogenicity prediction CLI: 4 variant types, 14 model features, local/remote modes, MCP server
5
+ Author: MERGE Team
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://merge.fanglab.cn
8
+ Keywords: bioinformatics,variant,pathogenicity,genomics,cli
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Environment :: Console
14
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
15
+ Requires-Python: >=3.11
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: click>=8.1
18
+ Requires-Dist: rich>=13.0
19
+ Requires-Dist: requests>=2.31
20
+ Requires-Dist: numpy>=1.26
21
+ Requires-Dist: pandas>=2.1
22
+ Requires-Dist: scikit-learn>=1.8
23
+ Requires-Dist: joblib>=1.3
24
+ Requires-Dist: matplotlib>=3.8
25
+ Requires-Dist: shap>=0.44
26
+ Requires-Dist: catboost>=1.2
27
+ Provides-Extra: mcp
28
+ Requires-Dist: mcp<2,>=1.2; extra == "mcp"
29
+ Provides-Extra: local
30
+ Requires-Dist: pysam>=0.22; extra == "local"
31
+ Provides-Extra: all
32
+ Requires-Dist: merge-cli[local,mcp]; extra == "all"
33
+
34
+ # merge-cli 3.8
35
+
36
+ MERGE variant pathogenicity prediction CLI — the professional-user counterpart to
37
+ [merge.fanglab.cn](https://merge.fanglab.cn), with the same models and the same
38
+ ensemble, runnable entirely on your own machine.
39
+
40
+ **New here? Read [TUTORIAL.md](TUTORIAL.md)** — install, both modes, per-model
41
+ setup, scripting and troubleshooting.
42
+
43
+ ## Highlights
44
+
45
+ - **Four variant types**: coding, splice, noncoding and **non-SNV** (indel / MNV / delins).
46
+ - **13 models**: AlphaGenome, HyenaDNA, NT, AlphaMissense, ESM-1b, GPN-MSA,
47
+ Evo2-7B, Evo2-7B-base, Enformer, GENERATOR, GENERATOR-v2, NT-v2, Carbon-3B.
48
+ (Evo2-1B-base is also supported locally where the GPU allows it.)
49
+ - **Remote and local modes.** Local mode deploys each model into its own conda
50
+ environment and serves it over HTTP — no Docker, no gateway required.
51
+ - Local precomputed VCF cache lookup for hg38/hg19 coding and splicing SNVs.
52
+ - Bundled MERGE ensemble models (the same four deployment bundles the website runs).
53
+
54
+ ## Quick Start
55
+
56
+ ```bash
57
+ pip install merge-cli
58
+ merge --help
59
+ merge predict --chrom chr1 --pos 69428 --ref T --alt G --genome hg38
60
+ ```
61
+
62
+ Optional extras: `merge-cli[mcp]` to ask for predictions in chat (see below),
63
+ `merge-cli[local]` for local mode (adds pysam, which has no Windows wheels —
64
+ which is why it is not in the base install), or `merge-cli[all]` for both.
65
+
66
+ ## Ask in chat (MCP)
67
+
68
+ ```bash
69
+ pip install "merge-cli[mcp]"
70
+ merge mcp install # detects Claude Desktop / Claude Code / Codex, writes the config
71
+ merge skill install # so the agent reaches for these tools on its own
72
+ merge mcp status
73
+ ```
74
+
75
+ On Windows, `merge` is usually *"not recognized"* right after installing: pip
76
+ puts `merge.exe` in `...\Python\Scripts\` and warns that the directory is not on
77
+ PATH. Use `python -m merge_cli` instead of `merge` — the registration it writes
78
+ is correct either way, because MCP clients launch the server by absolute path.
79
+
80
+ Then restart your client and ask *"Is chr1:1040819 G>GC pathogenic?"*. The MCP
81
+ server runs in remote mode only — no GPU needed. Details in
82
+ [TUTORIAL.md §11](TUTORIAL.md).
83
+
84
+ ## Variant types and ensemble models
85
+
86
+ The task is chosen automatically: a variant whose REF or ALT is not a single base
87
+ is scored as non-SNV; otherwise ANNOVAR decides coding / splice / noncoding.
88
+ Override with `--ensemble-type coding|splice|noncoding|nonsnv`.
89
+
90
+ | Task | Bundle | Algorithm | Features |
91
+ |---|---|---|---|
92
+ | coding | `MERGE_coding.pkl` | LR_L1 | 6 |
93
+ | splice | `MERGE_splicing.pkl` | CatBoost | 10 |
94
+ | noncoding | `MERGE_noncoding.pkl` | LR_L2 | 10 |
95
+ | non-SNV | `MERGE_nonsnv.pkl` | CatBoost | 10 |
96
+
97
+ Each bundle embeds its own preprocessing (median imputation → z-scoring →
98
+ classifier), so raw model scores are fed straight in and any model you did not
99
+ run is median-imputed. See `merge_cli/data/models/MODEL_CARD.md` for the exact
100
+ feature panels.
101
+
102
+ ## Models
103
+
104
+ All models run by default — each one feeds at least one ensemble panel, and a
105
+ model you skip has its feature median-imputed instead. Skip any with `--no-<model>`:
106
+
107
+ ```bash
108
+ merge predict --chrom chr1 --pos 69428 --ref T --alt G --no-carbon --no-nt-v2
109
+ ```
110
+
111
+ Available switches: `--no-alphagenome --no-hyenadna --no-nt --no-alphamissense
112
+ --no-esm1b --no-gpn-msa --no-evo2 --no-enformer --no-generator
113
+ --no-generator-v2 --no-nt-v2 --no-carbon`.
114
+
115
+ In local mode every model needs its service running; the CLI reports which
116
+ features were computed and which were imputed on every prediction.
117
+
118
+ ### Evo2 variants
119
+
120
+ `--evo2-model` picks the weights for the primary Evo2 score (remote and local):
121
+
122
+ ```bash
123
+ merge predict --chrom chr1 --pos 69428 --ref T --alt G --evo2-model evo2_7b_base
124
+ ```
125
+
126
+ All three Evo2 variants are scored by default in local mode —
127
+ `evo2_7b_score`, `evo2_7b_base_score` and `evo2_1b_base_score` are separate
128
+ ensemble features. They share one GPU-resident service and are scored one at a
129
+ time, costing a few seconds each. Narrow the set to trade coverage for speed:
130
+
131
+ ```bash
132
+ merge local predict --chrom chr1 --pos 69428 --ref T --alt G \
133
+ --evo2-models evo2_7b # primary variant only, faster
134
+ ```
135
+
136
+ `evo2_1b_base` needs a GPU with FP8 (compute capability ≥ 8.9: RTX 4000/5000 Ada,
137
+ L40S, H100). Elsewhere — including in remote mode — its feature is left missing and
138
+ median-imputed by the ensemble, which is what the website does too.
139
+
140
+ ## Local mode
141
+
142
+ ```bash
143
+ merge doctor # check GPU and services
144
+ merge local setup # configure paths
145
+ merge local env setup --model evo2 # deploy one model
146
+ merge local env setup --model carbon # ... or another
147
+ merge local env setup --model all # everything (large!)
148
+ merge local env start --model evo2
149
+ merge local env status
150
+ merge local predict --chrom chr17 --pos 43092919 --ref A --alt G
151
+ ```
152
+
153
+ Setting a reference FASTA is strongly recommended — the local services use it to
154
+ cut the exact sequence windows the models were scored with during training:
155
+
156
+ ```bash
157
+ merge local setup # answer the "Reference genome FASTA path" prompt
158
+ # or
159
+ merge local predict ... --genome-ref /path/to/hg38.fa
160
+ ```
161
+
162
+ Without it the services fall back to fetching sequence context from the MERGE
163
+ server, which requires network access.
164
+
165
+ ### Service ports
166
+
167
+ | Model | Env | Port |
168
+ |---|---|---|
169
+ | AlphaGenome | `alphagenome` | 5000 |
170
+ | HyenaDNA | `hyenadna` | 5001 |
171
+ | NT | `nt` | 5002 |
172
+ | Evo2 (all variants) | `evo2` | 5003 |
173
+ | Enformer | `enformer` | 5004 |
174
+ | Carbon | `carbon` | 5005 |
175
+ | GENERATOR | `generator` | 5006 |
176
+ | GENERATOR-v2 | `generator_v2` | 5007 |
177
+ | NT-v2 | `nt_v2` | 5008 |
178
+
179
+ Each service exposes `GET /health` and `POST /predict` (`{chrom, pos, ref, alt,
180
+ genome_version}`); the DNA-LM services also expose `POST /batch_predict`.
181
+
182
+ Each model gets its own conda env, service and port by default, and there is no
183
+ gateway to stand up — so you can deploy only the models you actually need.
184
+
185
+ Environments may also be **shared**: any environment with the right dependencies
186
+ (torch + `transformers<5` + pyfaidx) can serve several of these models, which
187
+ saves tens of GB. Start the service with that environment's interpreter, e.g.
188
+ `~/miniconda3/envs/NT/bin/python ~/.merge-local-servers/generator_server.py`.
189
+ `merge local env status` shows which environment is really behind each port.
190
+
191
+ ## Precomputed VCF Cache
192
+
193
+ ```bash
194
+ merge precomputed configure --data-dir /path/to/precomputed
195
+ merge precomputed status
196
+ merge precomputed download --genome all --variant-type all
197
+ ```
198
+
199
+ Expected files: `coding_merged.vcf.gz`, `splicing_merged.vcf.gz`, their hg19
200
+ counterparts, and `.tbi` indices. The cache only covers SNVs and the older
201
+ feature set, so it is bypassed for non-SNVs and whenever an opt-in DNA-LM is
202
+ requested.
203
+
204
+ ## Scoring conventions
205
+
206
+ The local services reproduce the exact quantities the ensemble was trained on.
207
+ Changing any of them silently invalidates the MERGE score:
208
+
209
+ | Model | Score | Window | VRAM |
210
+ |---|---|---|---|
211
+ | Evo2-7B / -7B-base | mean_PLL(REF) − mean_PLL(ALT) | 8192 bp | ~20 GB |
212
+ | Evo2-1B-base | mean_PLL(REF) − mean_PLL(ALT) | 8192 bp | ~8 GB, needs FP8 |
213
+ | Carbon-3B | logP_sum(REF) − logP_sum(ALT) | 24576 bp | **~20 GB** |
214
+ | GENERATOR / -v2 | NLL(ALT) − NLL(REF) | 600 bp, max_length 128 | ~6 GB |
215
+ | NT-v2 | ‖emb(ALT) − emb(REF)‖₂ | 600 bp, max_length 128 | ~3 GB |
216
+ | NT | ‖emb(ALT) − emb(REF)‖₂ | 8192 bp | ~3 GB |
217
+ | HyenaDNA | log p(ALT) − log p(REF), next token | 1000 bp upstream | ~2 GB |
218
+
219
+ These windows are not tunable, on purpose. The MERGE bundles were fitted on
220
+ features computed exactly this way, so a shorter window does not merely cost
221
+ accuracy — it puts the feature on a different scale than the model expects, and
222
+ the resulting MERGE score is wrong without anything looking wrong. If a model
223
+ does not fit on your GPU, leave it off: the ensemble median-imputes what is
224
+ missing, which is the honest fallback.
225
+
226
+ Carbon in particular needs roughly 20 GB of VRAM at the 24576 bp training window.
227
+
228
+ The `transformers` version is pinned to 4.x in the generated environments:
229
+ NT-v2's remote code does not load under transformers 5.x. `alphagenome` is
230
+ pinned to 0.5.1 to match the MERGE server, so both modes return the same
231
+ AlphaGenome features.
232
+
233
+ AlphaGenome is the one model whose features are **not** reproducible over time:
234
+ it runs on Google's servers and is updated there, so today's values differ from
235
+ those in the training tables. Every other model reproduces bit-for-bit.
236
+
237
+ If local services are unavailable, the errors are reported under
238
+ `prediction.errors` and the CLI continues with the models it could reach.
@@ -0,0 +1,205 @@
1
+ # merge-cli 3.8
2
+
3
+ MERGE variant pathogenicity prediction CLI — the professional-user counterpart to
4
+ [merge.fanglab.cn](https://merge.fanglab.cn), with the same models and the same
5
+ ensemble, runnable entirely on your own machine.
6
+
7
+ **New here? Read [TUTORIAL.md](TUTORIAL.md)** — install, both modes, per-model
8
+ setup, scripting and troubleshooting.
9
+
10
+ ## Highlights
11
+
12
+ - **Four variant types**: coding, splice, noncoding and **non-SNV** (indel / MNV / delins).
13
+ - **13 models**: AlphaGenome, HyenaDNA, NT, AlphaMissense, ESM-1b, GPN-MSA,
14
+ Evo2-7B, Evo2-7B-base, Enformer, GENERATOR, GENERATOR-v2, NT-v2, Carbon-3B.
15
+ (Evo2-1B-base is also supported locally where the GPU allows it.)
16
+ - **Remote and local modes.** Local mode deploys each model into its own conda
17
+ environment and serves it over HTTP — no Docker, no gateway required.
18
+ - Local precomputed VCF cache lookup for hg38/hg19 coding and splicing SNVs.
19
+ - Bundled MERGE ensemble models (the same four deployment bundles the website runs).
20
+
21
+ ## Quick Start
22
+
23
+ ```bash
24
+ pip install merge-cli
25
+ merge --help
26
+ merge predict --chrom chr1 --pos 69428 --ref T --alt G --genome hg38
27
+ ```
28
+
29
+ Optional extras: `merge-cli[mcp]` to ask for predictions in chat (see below),
30
+ `merge-cli[local]` for local mode (adds pysam, which has no Windows wheels —
31
+ which is why it is not in the base install), or `merge-cli[all]` for both.
32
+
33
+ ## Ask in chat (MCP)
34
+
35
+ ```bash
36
+ pip install "merge-cli[mcp]"
37
+ merge mcp install # detects Claude Desktop / Claude Code / Codex, writes the config
38
+ merge skill install # so the agent reaches for these tools on its own
39
+ merge mcp status
40
+ ```
41
+
42
+ On Windows, `merge` is usually *"not recognized"* right after installing: pip
43
+ puts `merge.exe` in `...\Python\Scripts\` and warns that the directory is not on
44
+ PATH. Use `python -m merge_cli` instead of `merge` — the registration it writes
45
+ is correct either way, because MCP clients launch the server by absolute path.
46
+
47
+ Then restart your client and ask *"Is chr1:1040819 G>GC pathogenic?"*. The MCP
48
+ server runs in remote mode only — no GPU needed. Details in
49
+ [TUTORIAL.md §11](TUTORIAL.md).
50
+
51
+ ## Variant types and ensemble models
52
+
53
+ The task is chosen automatically: a variant whose REF or ALT is not a single base
54
+ is scored as non-SNV; otherwise ANNOVAR decides coding / splice / noncoding.
55
+ Override with `--ensemble-type coding|splice|noncoding|nonsnv`.
56
+
57
+ | Task | Bundle | Algorithm | Features |
58
+ |---|---|---|---|
59
+ | coding | `MERGE_coding.pkl` | LR_L1 | 6 |
60
+ | splice | `MERGE_splicing.pkl` | CatBoost | 10 |
61
+ | noncoding | `MERGE_noncoding.pkl` | LR_L2 | 10 |
62
+ | non-SNV | `MERGE_nonsnv.pkl` | CatBoost | 10 |
63
+
64
+ Each bundle embeds its own preprocessing (median imputation → z-scoring →
65
+ classifier), so raw model scores are fed straight in and any model you did not
66
+ run is median-imputed. See `merge_cli/data/models/MODEL_CARD.md` for the exact
67
+ feature panels.
68
+
69
+ ## Models
70
+
71
+ All models run by default — each one feeds at least one ensemble panel, and a
72
+ model you skip has its feature median-imputed instead. Skip any with `--no-<model>`:
73
+
74
+ ```bash
75
+ merge predict --chrom chr1 --pos 69428 --ref T --alt G --no-carbon --no-nt-v2
76
+ ```
77
+
78
+ Available switches: `--no-alphagenome --no-hyenadna --no-nt --no-alphamissense
79
+ --no-esm1b --no-gpn-msa --no-evo2 --no-enformer --no-generator
80
+ --no-generator-v2 --no-nt-v2 --no-carbon`.
81
+
82
+ In local mode every model needs its service running; the CLI reports which
83
+ features were computed and which were imputed on every prediction.
84
+
85
+ ### Evo2 variants
86
+
87
+ `--evo2-model` picks the weights for the primary Evo2 score (remote and local):
88
+
89
+ ```bash
90
+ merge predict --chrom chr1 --pos 69428 --ref T --alt G --evo2-model evo2_7b_base
91
+ ```
92
+
93
+ All three Evo2 variants are scored by default in local mode —
94
+ `evo2_7b_score`, `evo2_7b_base_score` and `evo2_1b_base_score` are separate
95
+ ensemble features. They share one GPU-resident service and are scored one at a
96
+ time, costing a few seconds each. Narrow the set to trade coverage for speed:
97
+
98
+ ```bash
99
+ merge local predict --chrom chr1 --pos 69428 --ref T --alt G \
100
+ --evo2-models evo2_7b # primary variant only, faster
101
+ ```
102
+
103
+ `evo2_1b_base` needs a GPU with FP8 (compute capability ≥ 8.9: RTX 4000/5000 Ada,
104
+ L40S, H100). Elsewhere — including in remote mode — its feature is left missing and
105
+ median-imputed by the ensemble, which is what the website does too.
106
+
107
+ ## Local mode
108
+
109
+ ```bash
110
+ merge doctor # check GPU and services
111
+ merge local setup # configure paths
112
+ merge local env setup --model evo2 # deploy one model
113
+ merge local env setup --model carbon # ... or another
114
+ merge local env setup --model all # everything (large!)
115
+ merge local env start --model evo2
116
+ merge local env status
117
+ merge local predict --chrom chr17 --pos 43092919 --ref A --alt G
118
+ ```
119
+
120
+ Setting a reference FASTA is strongly recommended — the local services use it to
121
+ cut the exact sequence windows the models were scored with during training:
122
+
123
+ ```bash
124
+ merge local setup # answer the "Reference genome FASTA path" prompt
125
+ # or
126
+ merge local predict ... --genome-ref /path/to/hg38.fa
127
+ ```
128
+
129
+ Without it the services fall back to fetching sequence context from the MERGE
130
+ server, which requires network access.
131
+
132
+ ### Service ports
133
+
134
+ | Model | Env | Port |
135
+ |---|---|---|
136
+ | AlphaGenome | `alphagenome` | 5000 |
137
+ | HyenaDNA | `hyenadna` | 5001 |
138
+ | NT | `nt` | 5002 |
139
+ | Evo2 (all variants) | `evo2` | 5003 |
140
+ | Enformer | `enformer` | 5004 |
141
+ | Carbon | `carbon` | 5005 |
142
+ | GENERATOR | `generator` | 5006 |
143
+ | GENERATOR-v2 | `generator_v2` | 5007 |
144
+ | NT-v2 | `nt_v2` | 5008 |
145
+
146
+ Each service exposes `GET /health` and `POST /predict` (`{chrom, pos, ref, alt,
147
+ genome_version}`); the DNA-LM services also expose `POST /batch_predict`.
148
+
149
+ Each model gets its own conda env, service and port by default, and there is no
150
+ gateway to stand up — so you can deploy only the models you actually need.
151
+
152
+ Environments may also be **shared**: any environment with the right dependencies
153
+ (torch + `transformers<5` + pyfaidx) can serve several of these models, which
154
+ saves tens of GB. Start the service with that environment's interpreter, e.g.
155
+ `~/miniconda3/envs/NT/bin/python ~/.merge-local-servers/generator_server.py`.
156
+ `merge local env status` shows which environment is really behind each port.
157
+
158
+ ## Precomputed VCF Cache
159
+
160
+ ```bash
161
+ merge precomputed configure --data-dir /path/to/precomputed
162
+ merge precomputed status
163
+ merge precomputed download --genome all --variant-type all
164
+ ```
165
+
166
+ Expected files: `coding_merged.vcf.gz`, `splicing_merged.vcf.gz`, their hg19
167
+ counterparts, and `.tbi` indices. The cache only covers SNVs and the older
168
+ feature set, so it is bypassed for non-SNVs and whenever an opt-in DNA-LM is
169
+ requested.
170
+
171
+ ## Scoring conventions
172
+
173
+ The local services reproduce the exact quantities the ensemble was trained on.
174
+ Changing any of them silently invalidates the MERGE score:
175
+
176
+ | Model | Score | Window | VRAM |
177
+ |---|---|---|---|
178
+ | Evo2-7B / -7B-base | mean_PLL(REF) − mean_PLL(ALT) | 8192 bp | ~20 GB |
179
+ | Evo2-1B-base | mean_PLL(REF) − mean_PLL(ALT) | 8192 bp | ~8 GB, needs FP8 |
180
+ | Carbon-3B | logP_sum(REF) − logP_sum(ALT) | 24576 bp | **~20 GB** |
181
+ | GENERATOR / -v2 | NLL(ALT) − NLL(REF) | 600 bp, max_length 128 | ~6 GB |
182
+ | NT-v2 | ‖emb(ALT) − emb(REF)‖₂ | 600 bp, max_length 128 | ~3 GB |
183
+ | NT | ‖emb(ALT) − emb(REF)‖₂ | 8192 bp | ~3 GB |
184
+ | HyenaDNA | log p(ALT) − log p(REF), next token | 1000 bp upstream | ~2 GB |
185
+
186
+ These windows are not tunable, on purpose. The MERGE bundles were fitted on
187
+ features computed exactly this way, so a shorter window does not merely cost
188
+ accuracy — it puts the feature on a different scale than the model expects, and
189
+ the resulting MERGE score is wrong without anything looking wrong. If a model
190
+ does not fit on your GPU, leave it off: the ensemble median-imputes what is
191
+ missing, which is the honest fallback.
192
+
193
+ Carbon in particular needs roughly 20 GB of VRAM at the 24576 bp training window.
194
+
195
+ The `transformers` version is pinned to 4.x in the generated environments:
196
+ NT-v2's remote code does not load under transformers 5.x. `alphagenome` is
197
+ pinned to 0.5.1 to match the MERGE server, so both modes return the same
198
+ AlphaGenome features.
199
+
200
+ AlphaGenome is the one model whose features are **not** reproducible over time:
201
+ it runs on Google's servers and is updated there, so today's values differ from
202
+ those in the training tables. Every other model reproduces bit-for-bit.
203
+
204
+ If local services are unavailable, the errors are reported under
205
+ `prediction.errors` and the CLI continues with the models it could reach.