File size: 5,810 Bytes
4c0a8e4 f05c8dc 4c0a8e4 f05c8dc 4c0a8e4 f05c8dc 4c0a8e4 f05c8dc 4c0a8e4 d401c72 4c0a8e4 f05c8dc 4c0a8e4 433c159 4c0a8e4 2bef6c4 d401c72 4c0a8e4 d401c72 4c0a8e4 d401c72 4c0a8e4 d401c72 4c0a8e4 2bef6c4 4c0a8e4 f05c8dc 4c0a8e4 d401c72 4c0a8e4 392f58c 4c0a8e4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | ---
license: other
license_name: cc-by-4.0-and-cc-by-nc-4.0
license_link: LICENSE.md
tags:
- biology
- genomics
- regulatory-genomics
- mpra
- single-cell
language:
- en
pretty_name: scMPRA stratified negative binomial fits
---
# scMPRA stratified negative binomial fits
Fitted parameters for every stratified negative binomial (NB) and
zero-inflated negative binomial (ZINB) model reported in *Modeling,
calibration, and power analysis of single-cell massively parallel reporter
assays*. There are fifteen fits over three published scMPRA datasets: three canonical
(one per dataset, the model the paper's analyses use) and twelve
counterfactuals kept so the model-selection comparisons can be reproduced.
The parameter tables are plain parquet and need nothing but
pandas. The orthos are the complete fitted objects, loadable with
`scMPRAforge`. Bounds objects derived from these fits are included with `scMPRAforge`.
## Files
| file | rows | description |
|---|---|---|
| `fitted_means.parquet` | 45,296 | fitted mean and dispersion, one row per level |
| `zero_inflation.parquet` | 6,016 | fitted zero inflation, ZINB fits only |
| `fits.csv` | 15 | one row per fit: dataset, model family, zero handling, canonical flag |
| `export_fits.py` | | the script that produced all three |
| `orthos/<fit>.tar.gz` | 15 | the complete fitted objects, one archive per fit |
### Schema
`fitted_means.parquet`
- `fit` — fit name, joins to `fits.csv`
- `stratified_by` — `cell_type` or `cre`
- `stratum` — the level of the stratifying axis this model was fit on
- `level_axis` / `level` — what the mean is indexed by, and which one
- `mu` — fitted mean
- `theta` — NB dispersion for this stratum
`zero_inflation.parquet` is the same minus `theta`, with `zi` in place of `mu`,
and `level_axis` always `rep_id`.
## Datasets
| `dataset` | study | assay |
|---|---|---|
| `shendure` | Lalanne et al. 2024, *Nat Methods* 21:983, [10.1038/s41592-024-02260-3](https://doi.org/10.1038/s41592-024-02260-3) | scQers, developmental CREs in mouse embryoid bodies |
| `cohen` | Zhao et al. 2023, *Nat Genet* 55:346, [10.1038/s41588-022-01278-7](https://doi.org/10.1038/s41588-022-01278-7) | scMPRA, promoter variants in live mouse retinas |
| `seelig` | Yin et al. 2025, *Cell Systems* 16:101302, [10.1016/j.cels.2025.101302](https://doi.org/10.1016/j.cels.2025.101302) | scMPRA of designed enhancers in HepG2/K562 |
The lab names are kept as identifiers so these join to the analysis code. Make sure you cite the papers above in downstream analysis.
## Loading
```python
import pandas as pd
fits = pd.read_csv("fits.csv")
means = pd.read_parquet("fitted_means.parquet")
canonical = set(fits.loc[fits.canonical, "fit"])
mu = means[means.fit.isin(canonical) & (means.stratified_by == "cell_type")]
```
### Orthos
Each ortho holds its training data in `training_data.scmpra/`: the count table
post filtering and negative-control pooling.
`ortho.load` reads it from there, so an ortho loads and computes from any
working directory.
The embedded UMI-wise tables use schema version 2, recorded in `members.json`,
with signal-first count names: `mpra_umis`, `mpra_reads`, `transfection_umis`,
`transfection_reads`, and `dna_reads` where available. Counts are non-negative
integers; null optional counts mean unknown. `cre_id_original` retains the
original identity of pooled negative controls. The paper's supplementary note
defines the complete read-wise, UMI-wise, and coarse-reporter schemas.
Coarse transfection-reporter detections, when present, are stored separately
as `_coarse_reporter` in `members.pkl`, with one presence-only row per
`(rep_id, cell_bc, cre_id)`. They are loaded with the training data and are not
paired with individual MPRA UMIs. Zero-handling settings determine how these
detections contribute to a fit; the main count table alone does not encode them.
Each fit is one archive, so download only the ones you need:
```python
import tarfile
from huggingface_hub import hf_hub_download
from distributed import Client, LocalCluster
from scMPRAforge.core import ortho
name = "seelig_cm_moib_nb_phantom"
archive = hf_hub_download("saarantras1/scMPRAforge_models", f"orthos/{name}.tar.gz",
repo_type="dataset")
tarfile.open(archive).extractall("orthos", filter="data")
client = Client(LocalCluster())
o = ortho.load(client, "orthos", name)
```
These archives require the schema-version-2 reader. A compatible package
revision is [6e67ed8](https://github.com/Reilly-Lab-Yale/scMPRAforge/commit/6e67ed8c49609de57b64bd0b2b556f17b4b12467):
```bash
pip install "scMPRAforge @ git+https://github.com/Reilly-Lab-Yale/scMPRAforge.git@6e67ed8c49609de57b64bd0b2b556f17b4b12467"
```
## Licence and source data
| files | licence | reason |
|---|---|---|
| `orthos/seelig_*.tar.gz` | [CC-BY-NC-4.0](https://creativecommons.org/licenses/by-nc/4.0/) | contains Yin et al.'s count table, published under CC-BY-NC-4.0 |
| everything else | [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) | our fits, and the `shendure` and `cohen` count tables, whose sources are CC-BY-4.0 |
The count tables are processed from the depositing studies' public data:
| dataset | deposit | source terms |
|---|---|---|
| `shendure` | GEO [GSE217686](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE217686) | paper is CC-BY-4.0 |
| `cohen` | GEO [GSE188639](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE188639), Zenodo [14907846](https://doi.org/10.5281/zenodo.14907846) | Zenodo deposit is CC-BY-4.0 |
| `seelig` | GEO [GSE269037](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE269037) (scMPRA), [GSE269036](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE269036) (bulk) | paper is CC-BY-NC-4.0 |
## Citation
TODO on acceptance.
|