yhsure commited on
Commit
a0d954e
·
verified ·
1 Parent(s): 186b845

Add COMPASS transfer cohort and standalone preparation script

Browse files
LICENSE-CODE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The Authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
LICENSE.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Sources and licenses
2
+
3
+ Third-party data retain their original terms. The code license does not replace the data licenses.
4
+
5
+ | Material | Source and terms |
6
+ | --- | --- |
7
+ | COMPASS sequences and measurements in `compass-transfer/compass.tsv.gz` | Koplik et al., [COMPASS](https://doi.org/10.1101/2025.10.12.681955), [GEO GSE307247](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE307247). CC BY-NC 4.0; [license](https://creativecommons.org/licenses/by-nc/4.0/). |
8
+ | OpenSplice source selection | Quarantani et al., [OpenSplice experimental master table, version 5](https://doi.org/10.6084/m9.figshare.32337414.v5). CC BY 4.0; [license](https://creativecommons.org/licenses/by/4.0/). |
9
+ | BEND 2.0 preparation code, documentation and exclusion metadata | The Authors, 2026. [MIT license](LICENSE-CODE). |
10
+
11
+ Changes to the source data comprise the BEND 2.0 cohort selection, matching reference and alternate constructs, averaging available cell-line effects, and constructing the paired-repeat reference. The preparation script documents these changes. Please retain source attribution and applicable licenses when redistributing derived data.
README.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: BEND 2.0 extras
3
+ language:
4
+ - en
5
+ license: other
6
+ license_name: mixed-source-licenses
7
+ license_link: LICENSE.md
8
+ tags:
9
+ - biology
10
+ - genomics
11
+ - splicing
12
+ - benchmark
13
+ - arxiv:2611.03806
14
+ size_categories:
15
+ - 100K<n<1M
16
+ configs:
17
+ - config_name: compass-transfer
18
+ sep: "\t"
19
+ data_files:
20
+ - split: test
21
+ path: compass-transfer/compass.tsv.gz
22
+ default: true
23
+ ---
24
+
25
+ # BEND 2.0 extras
26
+
27
+ Additional data and preparation scripts for the [BEND 2.0 paper](https://arxiv.org/abs/2611.03806).
28
+
29
+ [Code](https://github.com/MachineLearningLifeScience/BEND2) · [Leaderboard](https://machinelearninglifescience.github.io/BEND2/) · [Main benchmark data](https://huggingface.co/datasets/yhsure/BEND2)
30
+
31
+ **[OpenSplice → COMPASS transfer](compass-transfer/README.md)** — the Fig. 2B evaluation cohort, OpenSplice source-row list, exclusions and a standalone preparation script. Includes 4,618 COMPASS variants across 88 genes and the 282,610 OpenSplice substitutions used for fitting.
32
+
33
+ See [source credits and licenses](LICENSE.md). File checksums are in [SHA256SUMS](SHA256SUMS).
SHA256SUMS ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 9f1abe28a25b5f6f95c58a81a647de3fa72ff6388d228c59bddd079255709989 LICENSE-CODE
2
+ 664009adaa97f76ae2380e9a17ec19d5b8de3a312241fc145811aad90646101b LICENSE.md
3
+ 63e4aa7347b274ed23ec1b545ff119d91e90a4d291773af7bf4737d8dba71d11 README.md
4
+ 39b84a8afd148d3242aaef7ba3ac9fa7c5a92983d3557f14e91d51122ec0d2d8 compass-transfer/README.md
5
+ 027f35fec031e194da26b36f2dfa429817c8916ef5394be2af6ebc156acb012f compass-transfer/compass.tsv.gz
6
+ 94ead6d28f3431471e94de863730e8083e00f8b71cbc942afb42421f9415e501 compass-transfer/exclusions.json
7
+ d09a3b736803e6569696c5a77de338829b0189245eee0c3dcb0b280f95edeb37 compass-transfer/opensplice-source.tsv.gz
8
+ ab9a7d93cd4cdce29f733b489d93f55f292825a2c570a31cc337446ce617eb4a compass-transfer/prepare.py
9
+ d412c34408124d9680009f7e40684bfdd78535df45cec5ba8644fd88bca845da compass-transfer/sequence-overlaps.csv
10
+ 20fafe717d7efd88b6b75e5c9859a5194bb7e91f620a038344649408b828963d compass-transfer/sources.json
11
+ 686af41f9440708e67395568ff4eaef5708641f6e130f0da45e6ed188b02d94d compass-transfer/target-genes.tsv
compass-transfer/README.md ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # OpenSplice → COMPASS transfer
2
+
3
+ Data preparation for BEND 2.0 Fig. 2B and Appendix C. The evaluation contains **4,618 single variants in 88 genes** (97 exon constructs). Fitted readouts use **282,610 OpenSplice substitutions in 443 genes**.
4
+
5
+ ## Files
6
+
7
+ | File | Contents |
8
+ | --- | --- |
9
+ | [compass.tsv.gz](compass.tsv.gz) | The exact evaluation cohort: variant IDs, genes, reference/alternate DNA, pooled effects and two repeat effects. |
10
+ | [target-genes.tsv](target-genes.tsv) | All 88 target genes, with variant and exon counts. |
11
+ | [opensplice-source.tsv.gz](opensplice-source.tsv.gz) | The 282,610 source record IDs and genes, in fitting order. |
12
+ | [exclusions.json](exclusions.json) | The 23 shared genes and 12 excluded COMPASS sequence-overlap events. |
13
+ | [sequence-overlaps.csv](sequence-overlaps.csv) | The frozen sequence-overlap audit behind those event exclusions. |
14
+ | [prepare.py](prepare.py) | Reconstructs the cohorts from the original assay releases and checks them against these files. |
15
+ | [sources.json](sources.json) | Pinned input URLs and checksums. |
16
+
17
+ Read the cohort directly:
18
+
19
+ ```python
20
+ import pandas as pd
21
+
22
+ target = pd.read_csv("compass.tsv.gz", sep="\t")
23
+ source_ids = pd.read_csv("opensplice-source.tsv.gz", sep="\t")
24
+ ```
25
+
26
+ `record_id` is `event_id|mutation`. The mutation position is zero-based within the 161-nt assayed insert. `sequence_ref` and `sequence_alt` are the complete assayed inserts. `target_logit_delta` is the evaluation label; `target_contexts` counts the cell lines contributing to it.
27
+
28
+ ## Rebuild from the original releases
29
+
30
+ Download this folder, then install the small CPU dependencies:
31
+
32
+ ```bash
33
+ python -m pip install numpy pandas pyarrow
34
+ ```
35
+
36
+ Download the [COMPASS processed table](https://ftp.ncbi.nlm.nih.gov/geo/series/GSE307nnn/GSE307247/suppl/GSE307247_Processed_PSIs_All_Cells.csv.gz) and [OpenSplice v5 table](https://ndownloader.figshare.com/files/64886694). OpenSplice is also available as `opensplice.tsv.gz` in the [main BEND 2.0 data release](https://huggingface.co/datasets/yhsure/BEND2). Verify the input hashes against `sources.json`.
37
+
38
+ ```bash
39
+ python prepare.py \
40
+ --compass /path/to/GSE307247_Processed_PSIs_All_Cells.csv.gz \
41
+ --opensplice /path/to/open_splice_experimental_master_unique_sequence_all_predictor_cols.tsv.gz \
42
+ --out rebuilt
43
+ ```
44
+
45
+ This writes `rebuilt/compass.parquet` and `rebuilt/opensplice-source.parquet`. The source table includes sequences and transformed fitting labels, not just the IDs. Omit `--opensplice` to rebuild only the evaluation cohort. Use a new output directory for each run.
46
+
47
+ ## Cohort construction
48
+
49
+ The historical COMPASS preparation starts from complete WT/A/B/AB quartets: a wild-type construct, its two constituent single mutations and their double mutation must have nonmissing pooled measurements in at least one cell line. The transfer cohort takes the distinct single variants appearing in those quartets. Wild types are matched by `event_id`; single variants by event and mutation. Sequence identities and raw mutation labels are checked when joining the measurements.
50
+
51
+ The 12 events in the frozen sequence-overlap audit are removed first. The remaining COMPASS genes are intersected with the OpenSplice substitution genes, and all 23 shared genes are removed from both source and target. OpenSplice fitting retains `mut_type == "sub"`; deletions from the broader Fig. 2A task are excluded. The source IDs preserve the original OpenSplice row indexing.
52
+
53
+ ## Measurements and readouts
54
+
55
+ COMPASS labels use the release's `*_delta_logit_pooled` columns. Replicates are already pooled by the release; we average these effects across the available HeLa, K562, MCF7, HMC3 and HEK measurements. All five cell lines are not required. This is not an average of the two repeat columns supplied here.
56
+
57
+ For the experimental reference, `rep1_logit_delta` and `rep2_logit_delta` are computed separately as alternate minus matched wild-type logit, then averaged across the same available cell lines. A cell line contributes only when both alternate and wild-type measurements exist in both repeats; `replicate_contexts` records that count.
58
+
59
+ OpenSplice fitting labels are `logit(clip(PSI_alt / 100, .01, .99)) - logit(clip(PSI_ref / 100, .01, .99))`. Each embedding-based transfer readout is a separate ridge regression (α = 10, fitted intercept, no feature standardization) on alternate-minus-reference embeddings, fitted once on all 282,610 eligible source rows. The same frozen representation and projection are used for source and target. The transfer fit does **not** average the five Fig. 2A cross-validation heads or ensemble independently fitted checkpoints. Released native-output methods are evaluated separately. COMPASS labels are not used for fitting, calibration or model selection.
60
+
61
+ The reported metric is the mean of within-gene Spearman correlations. Genes with constant outcomes have undefined correlations; 86 of the 88 target genes have varying outcomes. This release supplies the published cohort and its preparation, without model prediction arrays.
62
+
63
+ Please cite [BEND 2.0](https://arxiv.org/abs/2611.03806), [OpenSplice](https://doi.org/10.6084/m9.figshare.32337414.v5) and [COMPASS](https://doi.org/10.1101/2025.10.12.681955). See [licenses](../LICENSE.md).
compass-transfer/compass.tsv.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:027f35fec031e194da26b36f2dfa429817c8916ef5394be2af6ebc156acb012f
3
+ size 207036
compass-transfer/exclusions.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "shared_genes_removed": [
3
+ "AP4M1",
4
+ "APC",
5
+ "ASL",
6
+ "BIN1",
7
+ "BRCA1",
8
+ "CACNA1C",
9
+ "CFTR",
10
+ "COL11A2",
11
+ "COLQ",
12
+ "ELN",
13
+ "GNAS",
14
+ "HMBS",
15
+ "L1CAM",
16
+ "MEF2C",
17
+ "MYH11",
18
+ "NEK1",
19
+ "NF1",
20
+ "NRXN1",
21
+ "PDE6B",
22
+ "SLC26A4",
23
+ "TNNT2",
24
+ "TSC2",
25
+ "TSEN2"
26
+ ],
27
+ "excluded_overlap_events": [
28
+ "chr11:119088168-119088328:+",
29
+ "chr11:119092023-119092183:+",
30
+ "chr11:31801851-31802011:-",
31
+ "chr19:38570553-38570713:+",
32
+ "chr1:45332898-45333058:-",
33
+ "chr20:63431320-63431480:-",
34
+ "chr2:232527305-232527465:+",
35
+ "chr2:71549251-71549411:+",
36
+ "chr3:128806309-128806469:+",
37
+ "chr3:38557211-38557371:-",
38
+ "chr4:113348168-113348328:+",
39
+ "chrX:31177912-31178072:-"
40
+ ]
41
+ }
compass-transfer/opensplice-source.tsv.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d09a3b736803e6569696c5a77de338829b0189245eee0c3dcb0b280f95edeb37
3
+ size 4434521
compass-transfer/prepare.py ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Rebuild the BEND 2.0 Fig. 2B cohorts from the released assay tables."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import argparse
6
+ import hashlib
7
+ import json
8
+ from pathlib import Path
9
+
10
+ import numpy as np
11
+ import pandas as pd
12
+
13
+ HERE = Path(__file__).resolve().parent
14
+ CELLS = ("HeLa", "K562", "MCF7", "HMC3", "HEK")
15
+
16
+
17
+ def require(condition, message):
18
+ if not condition:
19
+ raise ValueError(message)
20
+
21
+
22
+ def dna(value):
23
+ value = str(value).upper().replace("U", "T")
24
+ require(not (set(value) - set("ACGTN")), "Invalid DNA sequence")
25
+ return value
26
+
27
+
28
+ def prepare_compass(path, exclusions):
29
+ raw = pd.read_csv(path, low_memory=False)
30
+ raw = pd.concat([raw, raw.snp.map(lambda x: "".join(str(x).split())).rename("snp_norm")], axis=1)
31
+ wt = raw.loc[raw.seq_type.eq("none")].copy()
32
+ singles = raw.loc[raw.seq_type.eq("single")].copy()
33
+ require(not wt.event_id.duplicated().any(), "Duplicate wild-type event")
34
+ require(not singles[["event_id", "snp_norm"]].duplicated().any(), "Duplicate single variant")
35
+ wt = wt.set_index("event_id")
36
+ single_index = singles.set_index(["event_id", "snp_norm"])
37
+
38
+ # The historical canonical table contains complete WT/A/B/AB quartets.
39
+ # Recover its single-variant union, rather than taking every raw single.
40
+ identities = []
41
+ for double in raw.loc[raw.seq_type.eq("double")].itertuples(index=False):
42
+ mutations = double.snp_norm.split(";")
43
+ require(len(mutations) == 2, "Expected two mutations in a double")
44
+ event = double.event_id
45
+ keys = [(event, m) for m in mutations]
46
+ if event not in wt.index or any(k not in single_index.index for k in keys):
47
+ continue
48
+ reference = wt.loc[event]
49
+ a, b = (single_index.loc[k] for k in keys)
50
+ covered = any(all(pd.notna(v) for v in (
51
+ reference[f"{c}_pooled_logit"], a[f"{c}_pooled_logit"],
52
+ b[f"{c}_pooled_logit"], getattr(double, f"{c}_pooled_logit"),
53
+ )) for c in CELLS)
54
+ if not covered or event in exclusions["excluded_overlap_events"]:
55
+ continue
56
+ require(int(mutations[1].split(":")[0]) > int(mutations[0].split(":")[0]),
57
+ "Double components must be ordered by position")
58
+ require(len(dna(double.full_seq)) == 161, "Expected a 161-nt double construct")
59
+ for mutation, alternate in zip(mutations, (a, b)):
60
+ identities.append((str(event), str(double.gene_exon).split(" exon ", 1)[0],
61
+ dna(reference.full_seq), dna(alternate.full_seq), mutation))
62
+ target = pd.DataFrame(identities, columns=[
63
+ "event_id", "gene_id", "sequence_ref", "sequence_alt", "mutation",
64
+ ]).drop_duplicates()
65
+ require(not target[["event_id", "mutation"]].duplicated().any(),
66
+ "Inconsistent gene or sequence for a single variant")
67
+ require(target.sequence_ref.str.len().eq(161).all() and target.sequence_alt.str.len().eq(161).all(),
68
+ "Expected 161-nt reference and alternate constructs")
69
+
70
+ values = singles.loc[singles.event_id.isin(target.event_id)].copy()
71
+ pooled = [f"{c}_delta_logit_pooled" for c in CELLS]
72
+ values["target_logit_delta"] = values[pooled].mean(axis=1, skipna=True)
73
+ values["target_contexts"] = values[pooled].notna().sum(axis=1)
74
+ values["intron1_length"] = values.intron1.str.len()
75
+ values["exon_length"] = values.exon.str.len()
76
+ values = values.rename(columns={"full_seq": "sequence_alt", "snp": "raw_mutation"})
77
+ target = target.merge(values[[
78
+ "event_id", "sequence_alt", "raw_mutation", "intron1_length", "exon_length",
79
+ "target_logit_delta", "target_contexts",
80
+ ]], on=["event_id", "sequence_alt"], how="left", validate="one_to_one")
81
+ require(target.target_logit_delta.notna().all(), "Missing target measurement")
82
+ require(target.mutation.eq(target.raw_mutation).all(), "Raw mutation label mismatch")
83
+ target = target.drop(columns="raw_mutation").sort_values(["event_id", "mutation"])
84
+ target["record_id"] = target.event_id + "|" + target.mutation
85
+ all_target_genes = set(target.gene_id)
86
+ target = target.loc[~target.gene_id.isin(exclusions["shared_genes_removed"])].copy()
87
+ for row in target.itertuples(index=False):
88
+ position, change = row.mutation.split(":")
89
+ reference_base, alternate_base = change.split(">")
90
+ position = int(position)
91
+ require(row.sequence_ref[position] == reference_base and
92
+ row.sequence_alt == row.sequence_ref[:position] + alternate_base + row.sequence_ref[position + 1:],
93
+ f"Mutation does not match reference/alternate DNA: {row.record_id}")
94
+
95
+ # Repeat effects are for the experimental reference, not the pooled label.
96
+ replicate_rows = []
97
+ for row in target.itertuples(index=False):
98
+ alternate = single_index.loc[(row.event_id, row.mutation)]
99
+ reference = wt.loc[row.event_id]
100
+ deltas = [[], []]
101
+ for cell in CELLS:
102
+ measurements = [(alternate[f"{cell}_rep{r}_logit"], reference[f"{cell}_rep{r}_logit"])
103
+ for r in (1, 2)]
104
+ if all(np.isfinite(a) and np.isfinite(w) for a, w in measurements):
105
+ for k, (a, w) in enumerate(measurements):
106
+ deltas[k].append(float(a - w))
107
+ replicate_rows.append((
108
+ float(np.mean(deltas[0])) if deltas[0] else np.nan,
109
+ float(np.mean(deltas[1])) if deltas[1] else np.nan, len(deltas[0]),
110
+ ))
111
+ target[["rep1_logit_delta", "rep2_logit_delta", "replicate_contexts"]] = replicate_rows
112
+ target["replicate_contexts"] = target.replicate_contexts.astype(int)
113
+ target = target.reset_index(drop=True)
114
+ require((len(target), target.gene_id.nunique(), target.event_id.nunique()) == (4618, 88, 97),
115
+ "COMPASS cohort differs from the published 4,618 variants / 88 genes / 97 exons")
116
+ require(target.record_id.is_unique, "Duplicate target ID")
117
+ return target, all_target_genes
118
+
119
+
120
+ def prepare_opensplice(path, exclusions, target_genes):
121
+ # A historical canonical Parquet may also be used to avoid rereading the raw TSV.
122
+ if path.suffix == ".parquet":
123
+ source = pd.read_parquet(path)
124
+ else:
125
+ aliases = {
126
+ "sequence_alt": ("nt_seq", "mut_seq", "sequence", "seq"),
127
+ "sequence_ref": ("wt_seq", "reference_sequence", "ref_seq"),
128
+ "unit_id": ("ensembl_exon_id", "exon_id", "exon"),
129
+ "gene_id": ("gene", "gene_name", "gene_id"),
130
+ "delta_y": ("delta_psi", "dpsi", "deltaPSI"),
131
+ "y_alt": ("psi", "PSI"), "y_ref": ("wt_psi", "psi_wt", "WT_PSI"),
132
+ }
133
+ columns = set(pd.read_csv(path, sep="\t", nrows=0).columns)
134
+ resolved = {key: next((c for c in choices if c in columns), None)
135
+ for key, choices in aliases.items()}
136
+ require(all(resolved[k] for k in aliases if k not in {"sequence_ref", "gene_id"}),
137
+ "Unrecognized OpenSplice columns")
138
+ extras = columns & {"variant_id", "start", "end", "wt", "mut_type"}
139
+ source = pd.read_csv(path, sep="\t", low_memory=False,
140
+ usecols=sorted(extras | {c for c in resolved.values() if c}))
141
+ source = source.dropna(subset=[resolved["sequence_alt"], resolved["unit_id"]]).copy()
142
+ source["sequence_alt"] = source[resolved["sequence_alt"]].map(dna)
143
+ if resolved["sequence_ref"]:
144
+ source["sequence_ref"] = source[resolved["sequence_ref"]].map(dna)
145
+ else:
146
+ source["sequence_ref"] = [
147
+ seq[:int(start)-1] + dna(wt) + seq[int(end) if kind == "sub" else int(start)-1:]
148
+ for seq, start, end, wt, kind in zip(source.sequence_alt, source.start,
149
+ source.end, source.wt, source.mut_type)
150
+ ]
151
+ source["unit_id"] = source[resolved["unit_id"]].astype(str)
152
+ source["gene_id"] = source[resolved["gene_id"]].astype(str) if resolved["gene_id"] else source.unit_id
153
+ source["record_id"] = [hashlib.sha256(f"opensplice|{unit}|{index}".encode()).hexdigest()[:24]
154
+ for index, unit in zip(source.index, source.unit_id)]
155
+ for name in ("y_ref", "y_alt", "delta_y"):
156
+ source[name] = pd.to_numeric(source[resolved[name]], errors="coerce")
157
+ source["intervention_type"] = source.mut_type.astype(str)
158
+ source = source.dropna(subset=["delta_y"])
159
+ source = source.loc[source.intervention_type.eq("sub")].copy()
160
+ require((len(source), source.gene_id.nunique()) == (306343, 466), "Unexpected pre-exclusion source cohort")
161
+ shared = sorted(set(source.gene_id) & target_genes)
162
+ require(shared == exclusions["shared_genes_removed"], "Shared-gene exclusion differs")
163
+ source = source.loc[~source.gene_id.isin(shared)].reset_index(drop=True)
164
+ reference = np.clip(source.y_ref.to_numpy(float) / 100, .01, .99)
165
+ alternate = np.clip(source.y_alt.to_numpy(float) / 100, .01, .99)
166
+ source["target_logit_delta"] = np.log(alternate / (1 - alternate)) - np.log(reference / (1 - reference))
167
+ require((len(source), source.gene_id.nunique()) == (282610, 443), "Unexpected strict source cohort")
168
+ require(source.sequence_ref.str.len().eq(source.sequence_alt.str.len()).all(), "Source contains a length-changing edit")
169
+ require(source.record_id.is_unique, "Duplicate source ID")
170
+ columns = ["record_id", "gene_id", "unit_id", "sequence_ref", "sequence_alt", "target_logit_delta"]
171
+ if "variant_id" in source:
172
+ columns.insert(1, "variant_id")
173
+ return source[columns]
174
+
175
+
176
+ def main():
177
+ parser = argparse.ArgumentParser(description=__doc__)
178
+ parser.add_argument("--compass", type=Path, required=True, help="GSE307247 processed CSV.gz")
179
+ parser.add_argument("--opensplice", type=Path, help="OpenSplice v5 TSV.gz or historical canonical Parquet")
180
+ parser.add_argument("--out", type=Path, required=True, help="New output directory")
181
+ args = parser.parse_args()
182
+ exclusions = json.loads((HERE / "exclusions.json").read_text())
183
+ target, target_genes = prepare_compass(args.compass, exclusions)
184
+ # Compare to the published data before writing anything.
185
+ expected = pd.read_csv(HERE / "compass.tsv.gz", sep="\t")
186
+ pd.testing.assert_frame_equal(target[expected.columns], expected, check_dtype=False,
187
+ check_exact=False, rtol=1e-12, atol=1e-12)
188
+ source = prepare_opensplice(args.opensplice, exclusions, target_genes) if args.opensplice else None
189
+ if source is not None:
190
+ manifest = pd.read_csv(HERE / "opensplice-source.tsv.gz", sep="\t")
191
+ pd.testing.assert_frame_equal(source[["record_id", "gene_id"]], manifest, check_dtype=False)
192
+ args.out.mkdir(parents=True, exist_ok=False)
193
+ target.to_parquet(args.out / "compass.parquet", index=False)
194
+ if source is not None:
195
+ source.to_parquet(args.out / "opensplice-source.parquet", index=False)
196
+ print(f"Verified COMPASS: {len(target):,} variants, {target.gene_id.nunique()} genes")
197
+ if source is not None:
198
+ print(f"Verified OpenSplice: {len(source):,} substitutions, {source.gene_id.nunique()} genes")
199
+
200
+
201
+ if __name__ == "__main__":
202
+ main()
compass-transfer/sequence-overlaps.csv ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dataset_a,dataset_b,sequence_id_a,sequence_id_b,role_a,role_b,gene_id_a,gene_id_b,length_a,length_b,shared_seeds,edit_distance,identity,orientation,overlap_class,target_start,target_end,query_is_a
2
+ compass,opensplice,chr2:232527305-232527465:+,ENSE00003555045,reference_exon,reference_exon,CHRND,CHRND,161,140,125,5,0.9642857142857143,forward,near_complete_shorter,26,160,False
3
+ compass,opensplice,chr3:38557211-38557371:-,ENSE00004014126,reference_exon,reference_exon,SCN5A,SCN5A,161,149,134,5,0.9664429530201343,forward,near_complete_shorter,17,160,False
4
+ compass,opensplice,chr11:119092023-119092183:+,ENSE00003528094,reference_exon,reference_exon,HMBS,HMBS,161,134,119,5,0.9626865671641791,forward,near_complete_shorter,32,160,False
5
+ compass,opensplice,chrX:31177912-31178072:-,ENSE00001158912,reference_exon,reference_exon,DMD,DMD,161,134,119,5,0.9626865671641791,forward,near_complete_shorter,32,160,False
6
+ compass,opensplice,chr2:71549251-71549411:+,ENSE00001072853,reference_exon,reference_exon,DYSF,DYSF,161,137,122,5,0.9635036496350365,forward,near_complete_shorter,29,160,False
7
+ compass,opensplice,chr20:63431320-63431480:-,ENSE00003997833,reference_exon,reference_exon,KCNQ2,KCNQ2,161,125,110,5,0.96,forward,near_complete_shorter,41,160,False
8
+ compass,opensplice,chr1:45332898-45333058:-,ENSE00003522055,reference_exon,reference_exon,MUTYH,MUTYH,161,137,122,5,0.9635036496350365,forward,near_complete_shorter,29,160,False
9
+ compass,opensplice,chr19:38570553-38570713:+,ENSE00000826243,reference_exon,reference_exon,RYR1,RYR1,161,182,151,0,1.0,forward,exact_containment,16,176,True
10
+ compass,opensplice,chr11:119088168-119088328:+,ENSE00003527962,reference_exon,reference_exon,HMBS,HMBS,161,149,134,5,0.9664429530201343,forward,near_complete_shorter,17,160,False
11
+ compass,opensplice,chr11:31801851-31802011:-,ENSE00003499781,reference_exon,reference_exon,PAX6,PAX6,161,137,122,5,0.9635036496350365,forward,near_complete_shorter,29,160,False
12
+ compass,opensplice,chr4:113348168-113348328:+,ENSE00001644280,reference_exon,reference_exon,ANK2,ANK2,161,128,113,5,0.9609375,forward,near_complete_shorter,38,160,False
13
+ compass,routing,chr3:128806309-128806469:+,chr3:128805722-128806302,reference_exon,enhancer_window,RAB7A,,161,1000,151,0,1.0,forward,exact_containment,796,956,True
compass-transfer/sources.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "sources": [
3
+ {
4
+ "dataset": "compass",
5
+ "url": "https://ftp.ncbi.nlm.nih.gov/geo/series/GSE307nnn/GSE307247/suppl/GSE307247_Processed_PSIs_All_Cells.csv.gz",
6
+ "doi": "10.1101/2025.10.12.681955",
7
+ "bytes": 36222316,
8
+ "sha256": "c5ec382ce6a54097fe15eda70a5738f891dbe831fab5242cf5ff3671f3c2cd07",
9
+ "md5": "fa6a4973260cb9534a72b096dd470f10"
10
+ },
11
+ {
12
+ "dataset": "opensplice",
13
+ "url": "https://ndownloader.figshare.com/files/64886694",
14
+ "doi": "10.6084/m9.figshare.32337414.v5",
15
+ "bytes": 425453242,
16
+ "sha256": "1ec5aa239793bf6e84d5d771990d04486f03017b8d8cfb67d323076575d05bf4",
17
+ "md5": "374443aa36bc1070dfd36318d8e77c59"
18
+ }
19
+ ]
20
+ }
compass-transfer/target-genes.tsv ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ gene_id variants exons
2
+ ABCB7 65 2
3
+ ACAD9 29 1
4
+ ACADVL 39 1
5
+ ADA 50 1
6
+ ADAM15 78 1
7
+ AFF2 61 1
8
+ AKAP9 18 1
9
+ ALDH6A1 59 1
10
+ ALDOA 60 1
11
+ AMPD1 22 1
12
+ ANK1 73 1
13
+ ANK3 38 1
14
+ AP4S1 56 1
15
+ APPL1 40 1
16
+ ART4 46 1
17
+ ASAH1 22 1
18
+ ASS1 53 1
19
+ AUH 51 1
20
+ BCKDHA 49 1
21
+ BEST1 52 1
22
+ BLOC1S6 48 1
23
+ CACNA2D4 61 1
24
+ CASK 38 1
25
+ CLN3 68 1
26
+ CRYM 23 1
27
+ DEPDC5 116 2
28
+ DIAPH1 17 1
29
+ DNM1L 126 3
30
+ DRD2 51 1
31
+ ECEL1 53 1
32
+ EPB41L1 110 2
33
+ ERCC2 40 1
34
+ EYA1 19 1
35
+ FANCA 39 1
36
+ FGF8 77 1
37
+ GALC 45 1
38
+ GCDH 49 1
39
+ GDAP1 47 1
40
+ GFM2 12 1
41
+ GH1 44 1
42
+ GNS 46 1
43
+ GPI 56 1
44
+ GUSB 53 1
45
+ HARS2 67 1
46
+ IL2RA 31 1
47
+ IMPDH1 107 2
48
+ IVD 59 1
49
+ LARS1 48 1
50
+ LMNA 61 1
51
+ MAPT 61 1
52
+ MEFV 60 1
53
+ MFAP5 53 1
54
+ MLC1 122 2
55
+ MYBPC1 75 1
56
+ NDUFAF5 59 1
57
+ NEXN 26 1
58
+ NLRC3 35 1
59
+ NPC2 46 1
60
+ OCA2 56 1
61
+ PAFAH1B1 15 1
62
+ PAX5 79 1
63
+ PCCA 45 1
64
+ PCCB 44 2
65
+ PIGH 63 1
66
+ PPT1 63 1
67
+ SERPINB7 47 1
68
+ SHOX2 75 1
69
+ SLC13A5 29 1
70
+ SLC26A5 63 1
71
+ SNCA 50 1
72
+ SOS1 49 1
73
+ SPINT2 50 1
74
+ STRC 15 1
75
+ STXBP2 65 1
76
+ SUMF1 102 2
77
+ SYNGAP1 60 1
78
+ TAC3 57 1
79
+ TIMM44 52 1
80
+ TNFRSF1A 50 1
81
+ TTC8 36 1
82
+ TTN 26 1
83
+ TTN-AS1 54 1
84
+ UROS 51 1
85
+ USB1 54 1
86
+ USP28 47 1
87
+ VPS33B 56 1
88
+ WDR35 49 1
89
+ WT1 7 1