| --- |
| license: cc-by-4.0 |
| tags: |
| - genomics |
| - chromatin-accessibility |
| - chorus |
| - background-distributions |
| --- |
| |
| # Chorus background CDFs for Cherimoya / CATv1 |
|
|
| Per-track background distributions that let [chorus](https://github.com/pinellolab/chorus) |
| turn a raw Cherimoya prediction into an **effect percentile** and an |
| **activity percentile**, rather than an uncalibrated fold-change. |
|
|
| This is a staging copy so that |
| [pinellolab/chorus#107](https://github.com/pinellolab/chorus/pull/107) is |
| testable before merge. Chorus reads backgrounds from |
| `lucapinello/chorus-backgrounds` (hardcoded in |
| `chorus/analysis/normalization.py`), where the other seven oracles' files |
| live; the intent is for this file to be mirrored or moved there. |
|
|
| | file | tracks | size | |
| |---|---|---| |
| | `cherimoya_pertrack.npz` | 1,518 | 154 MiB | |
|
|
| ## What's in it |
|
|
| Three sorted 10,000-point empirical CDFs per track, keyed by `ASSAY:ENCSR` |
| (e.g. `DNASE:ENCSR000EOT` — the ENCODE experiment accession, because |
| `(assay, biosample)` is ambiguous for 1,188 of the 1,518 CATv1 experiments): |
|
|
| | CDF | built from | supports | |
| |---|---|---| |
| | `effect` | 18,672 SNPs — 9,609 random + 9,063 DHS-proximal; `\|log2 FC\|` of alt vs ref over a 501 bp window centred on the variant | effect percentile | |
| | `summary` | 34,004 baseline positions — random + ENCODE cCREs + protein-coding TSS + Meuleman DHS summits; 501 bp window sum of the reference prediction | activity percentile | |
| | `perbin` | 32 sampled bins at each of those baselines | per-bin activity axis for the browser | |
|
|
| `signed_flags` is False throughout: DNase/ATAC accessibility is unsigned, so |
| what matters is effect magnitude. |
|
|
| ## Provenance |
|
|
| Every array is accompanied by a `build_config` JSON blob recording the |
| sampling configuration, fold, device and `cherimoya` version, so a CDF file |
| can always be traced back to how it was made. |
|
|
| - **Built by** `scripts/build_backgrounds_cherimoya.py` in the PR above |
| - **Models** [`programmable-genomics/CATv1`](https://huggingface.co/programmable-genomics/CATv1), fold 0 |
| - **Genome** GRCh38 |
| - **Sampling** the shared, seeded variant and region sets in |
| `chorus/utils/annotations.py`, reproducing the sample counts of the |
| published `chrombpnet_pertrack.npz` exactly (`effect_counts=18672`, |
| `summary_counts=34004`) — that match is the check that the sets really are |
| shared, so Cherimoya's percentiles are comparable to the other oracles' |
| - **Compute** 1,518 tracks in 11.1 min across 8× H200 |
|
|
| ## Notes |
|
|
| Fold 0 only, matching chorus' ChromBPNet oracle and the fold its CDFs were |
| built at. CATv1 uses the same chromosome partition as the ENCODE ChromBPNet |
| annotations, so fold-0-to-fold-0 comparisons are exact. |
|
|
| The `summary` and `perbin` CDFs contain a small number of slightly negative |
| values (195 of 15.18M, at most 5 of 10,000 points in any track, minimum |
| −0.38 counts), always at the extreme low tail. Cherimoya's count head |
| predicts `log(count + 1)`, so a near-zero-activity window can yield a |
| slightly negative count under `expm1`. These are left unclamped so that the |
| builder and `oracle.predict()` compute values identically — that agreement |
| is what makes a percentile meaningful. The `effect` CDF has no negatives. |
|
|
| ## Citation |
|
|
| Cherimoya / CATv1: https://github.com/jmschrei/cherimoya |
| Chorus: https://github.com/pinellolab/chorus |
|
|