einarolafsson commited on
Commit
4e45cdc
·
verified ·
1 Parent(s): 080dadc

Add the OPS end-to-end subset of Funk et al. 2022 plate A well A1 (core and full tiers), CC-BY-4.0

Browse files
README.md ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ pretty_name: "spaCR example: OPS end-to-end subset (Funk et al. 2022, plate A, well A1)"
4
+ tags:
5
+ - microscopy
6
+ - optical-pooled-screen
7
+ - spacr
8
+ size_categories:
9
+ - n<1K
10
+ ---
11
+
12
+ # spaCR example: OPS end-to-end subset, Funk et al. 2022 plate A, well A1
13
+
14
+ A small raw subset of one optical pooled screen (OPS) well that runs every OPS step in spaCR: stitch, align,
15
+ genotype (decode) and phenotype. It is the test data for spaCR's end-to-end OPS test and the default example
16
+ for OPS live mode.
17
+
18
+ **This is the core tier** (about 190 MB, for CI). Every file has the published name, shape, dtype,
19
+ axes and ImageJ metadata. Pixels inside a region of interest (ROI) are byte-identical to the archive; every
20
+ other pixel is 0. The ROI of each file is listed in `roi_manifest.json`. Phenotype site 1280 is an all-zero
21
+ placeholder: it keeps the 1,281-field round-well layout and tests the field-without-nuclei path.
22
+
23
+ ## Source and citation
24
+ - **Source:** BioImage Archive **S-BIAD394**, "The phenotypic landscape of essential human genes", released
25
+ 2022-03-31. Files: <https://ftp.ebi.ac.uk/biostudies/fire/S-BIAD/394/S-BIAD394/Files/>
26
+ (`screenA/20200202_6W-LaC024A`). The SHA-256 of every original file is in `roi_manifest.json`
27
+ (`source_sha256`).
28
+ - **Citation:** Funk L, Su KC, Ly J, Feldman D, Singh A, Moodie B, Blainey PC, Cheeseman IM. The phenotypic
29
+ landscape of essential human genes. *Cell* 185(24):4634–4653.e22 (2022). doi:10.1016/j.cell.2022.10.017,
30
+ PMID 36347254.
31
+ - **Library:** `library/pool10_design.csv`, the pool10 design from the authors' code repository
32
+ (OpticalPooledScreens, MIT licence, Copyright (c) 2017 David Feldman, Avtar Singh, Rebecca Carlson,
33
+ Paul Blainey). `library/pool10_prefixes.csv` is derived from it: one column `prefix` =
34
+ `sgRNA[:prefix_length]` for every design row, in file order (20,445 prefixes of 11 bases). spaCR reads
35
+ this file (`ops_library`).
36
+ - **Licence:** this subset is redistributed under **CC-BY-4.0**; please cite Funk et al. 2022. The source
37
+ record S-BIAD394 carries no licence attribute; the BioImage Archive releases direct submissions under CC0
38
+ or CC-BY-4.0, and both allow redistribution.
39
+
40
+ ## What is included
41
+ | Part | Files |
42
+ |---|---|
43
+ | Sequencing (SBS, 10X, 1,480 × 1,480 px, uint16) | tiles (sites) **321, 322, 331, 332**, all 11 cycles: `c1` 5-plane stack `DAPI-CY3-A594-CY5-CY7` (axes CYX), `c2`–`c11` one file per base channel `CY3`, `A594`, `CY5`, `CY7` (axes YX). 44 files. |
44
+ | Phenotype (20X, 2,960 × 2,960 px, 4 focal planes, uint16) | fields **1255, 1264, 1280**: `DAPI-GFP` (axes ZCYX, 4 × 2), `A594` and `AF750` (axes ZYX). 9 files. |
45
+ | `library/` | `pool10_design.csv` (original), `pool10_prefixes.csv` (what spaCR reads). |
46
+ | `settings/` | `ops_testdata_settings.csv` (`ops_align_model` = tile_affine) and `ops_testdata_settings_similarity.csv`, written by spaCR's settings writer, with `.json` twins. Paths are relative: run spaCR with this folder as the working directory. |
47
+ | `reference/inputs/` | `ops_ph_placement_seed.json` (phenotype placement seed, schema below) and `flatfield/` (the plate's stored spaCR flat-field maps: `flat_info.json`, `fields.json`, one `flat_20200202_6W-LaC024A_<channel>.npy` per channel). |
48
+ | `reference/` | spaCR reference outputs (see `reference/PROVENANCE.json`). |
49
+ | `roi_manifest.json` | per file: source SHA-256 and size, ROI(s) in file coordinates (core tier), the canvas ROI and the production placements. |
50
+ | `SHA256SUMS` | SHA-256 of every file in this tier. |
51
+
52
+ **Why these sites.** spaCR takes a well's layout from its highest site number, so the subset holds SBS site
53
+ 332 (333-tile round well) and phenotype site 1280 (1,281-field well). The stitch keeps only the largest
54
+ connected group of tiles, so the subset is one 2 × 2 block at the well's right rim (with all 4 overlaps).
55
+ Field 1264 sits on the block's 4-tile junction and field 1255 is its left neighbour in another tile group.
56
+ No included file is on the plate's broken-input lists (phenotype fields 598, 757, 860, 864, 867, 871, 909,
57
+ 988, 1133, 1136; SBS c11 CY5 Site-56).
58
+
59
+ **Folder layout** mirrors the plate as spaCR's OPS reader indexes it:
60
+ ```
61
+ ops_testdata_funk2022_A1/
62
+ 20200202_6W-LaC024A/
63
+ sequencing/images/input/c1 … c11/10X_c{N}_A1_<channel>_Site-<site>.tif
64
+ phenotype/images/input/DAPI-GFP-A594-AF750/20X_DAPI-GFP-A594-AF750_A1_<channel>_Site-<site>.tif
65
+ library/ settings/ reference/ roi_manifest.json README.md SHA256SUMS
66
+ ```
67
+
68
+ ## What was cut (core tier)
69
+ - **SBS ROI**, in the production canvas of well A1 (cycle-1 stitch): y 14,750–15,750, x 24,800–25,800. It holds
70
+ the 4-tile junction, both overlap strips across it and the SBS area under the two phenotype ROIs. In each
71
+ file it is the canvas ROI minus that tile's production placement, rounded outward and padded on every side
72
+ by |cycle shift| + max |channel shift| of that cycle + 4 px (shifts from the production decode), so the
73
+ registered cycles still cover it.
74
+ - **Cycle-1 DAPI** also keeps each tile's whole overlap with the other three tiles (+ 8 px). Without it a
75
+ zeroed edge crossing an overlap strip pulled the stitch by 1 px; with it the core and full stitches agree
76
+ exactly.
77
+ - **Phenotype ROIs**, 1,200 × 1,200 field px, all focal planes and channels: field 1255 rows 952–2152,
78
+ columns 1760–2960 (touches the right border); field 1264 rows 952–2152, columns 0–1200 (touches the left
79
+ border). Both lie inside the SBS ROI. Field 1280 is all zero.
80
+ - **Storage:** lossless deflate (zlib) with the horizontal predictor. tifffile decodes it with the standard
81
+ library; imagecodecs is not needed. Every written file was read back and compared with the source: inside the
82
+ ROI bit-identical, outside 0 (core); everything bit-identical (full).
83
+
84
+ ## What this subset can and cannot test
85
+ - Core tier: the reader and layout, the stitch (4 overlaps and a junction) and, after item 940, alignment on
86
+ 2 tile groups and phenotype measurement per cell. Full tier: all of these plus decode (all rules, decoy
87
+ counting) and determinism.
88
+ - **It cannot estimate a false-discovery rate (FDR).** spaCR's FDR is decoy calls / real calls × 1.268 / 4
89
+ (81,780 decoys). The core tier expects about 1 decoy call (Poisson 0–3) and the full tier about 6; even 6
90
+ decoys leave the FDR uncertain by more than a factor of 2. FDR calibration stays with full-well runs.
91
+ - Flat-field fitting needs many fields; the stored plate maps are used instead.
92
+
93
+ ## Phenotype placement seed (`reference/inputs/ops_ph_placement_seed.json`)
94
+ A partial well cannot supply the whole-well anchor fields spaCR's phenotype phase aligns, so the phenotype
95
+ placement of well A1 (production spaCR run) is stored as a file. spaCR item 940 adds the setting that reads it.
96
+ Schema `spacr.ops_ph_placement_seed`, `schema_version` 1 (JSON object):
97
+
98
+ | Key | Type | Meaning |
99
+ |---|---|---|
100
+ | `schema`, `schema_version` | str, int | `"spacr.ops_ph_placement_seed"`, `1`. |
101
+ | `plate`, `well` | str | `"20200202_6W-LaC024A"`, `"A1"`. |
102
+ | `phenotype_fields` | int | fields of the phenotype acquisition (1281); the layout is `spacr.ops_layout.round_well_layout(phenotype_fields)`. |
103
+ | `sbs_tiles` | int | tiles of the sequencing acquisition (333). |
104
+ | `frame.kind` | str | `"sbs_tile_anchored"`: every (y, x) is in the stitched cycle-1 sequencing well frame of the production run (`ops_geometry` y/x). |
105
+ | `frame.reference_tiles` | {site: {y, x}} | production placements (top-left, px) of SBS tiles 321, 322, 331, 332 in that frame. |
106
+ | `frame.tile_shape` | [h, w] | SBS tile size, [1480, 1480]. |
107
+ | `raster.origin`, `raster.column_step`, `raster.row_step` | [dy, dx] floats | `centre(site) = origin + column × column_step + row × row_step`, `(column, row) = layout.position(site)`; the same raster `spacr.ops_phenotype.phenotype_centres` fits from anchors. |
108
+ | `transform.scale` | float | well px per field px (0.24994). |
109
+ | `transform.rotation_deg` | float | field rotation in the well frame (−0.002). |
110
+ | `transform.field_shape` | [h, w] | phenotype field size, [2960, 2960]. |
111
+ | `fields[]` | list | for each included field: `site`, `grid_column`, `grid_row`, `centre_y`, `centre_x`, `sbs_site`, `offset_y`, `offset_x` (derived; for checking). `offset = centre − scale × R(rotation) @ (h/2, w/2)` (`spacr.ops_merge.field_transform`). |
112
+ | `provenance` | object | source database and table, the anchor fields with their raster residuals, and the largest difference between the raster and any stored production centre (≤ 1e-6 px). |
113
+
114
+ **Using it on another stitch of these tiles** (for example this subset's own stitch, whose origin differs):
115
+ `offset = mean over the reference tiles present of (new placement − stored placement)`; add `offset` to
116
+ `raster.origin` and to every centre; the steps, scale and rotation stay. On this subset all 4 tiles are present.
117
+
118
+ ## Status of the reference outputs (2026-11-13, spaCR nightly 6afe2e8f8c)
119
+ - **Run and reproducible:** stitch (core and full agree exactly; full is within 0.15 px of production), SBS
120
+ objects (Cellpose-SAM, CPU), decode (rule (a) + S2; reruns are identical).
121
+ - **Full tier vs production (gate (c), PASS):** the rule is at least 99 % same guide where both called, for
122
+ nuclei more than 100 px from the subset edge: 99.01 % on 13,705 called nuclei. Agreement where either side
123
+ called (always reported beside it): 94.1 % overall, 95.8 % beyond 100 px. Over all nuclei, 98.9 % same guide
124
+ where both called, and 735 nuclei called on one side only (`reference/provenance_call_differences.parquet`).
125
+ The full tier's cycle and channel shifts equal production's exactly.
126
+ - **Scope of the core tier (maintainer decision, 2026-11-13):** the core tier is for the reader and layout,
127
+ stitch and (after item 940) phenotype tests only. **Decode tests use the full tier.** The core tier's decode
128
+ outputs are kept for the record but are **not a test reference**: spaCR's whole-field cycle registration
129
+ locks onto the zeroed ROI edges, so its cycle shifts are wrong.
130
+ - **Not yet run:** phenotype placement, segmentation, measurement and merge (similarity and tile_affine).
131
+ The phenotype phase refuses without whole-well anchors; spaCR item 940 will place the fields from
132
+ `reference/inputs/ops_ph_placement_seed.json`.
133
+ - Details and gates: `reference/PROVENANCE.json`.
134
+
135
+ ## How to regenerate
136
+ 1. Data: `build_ops_testdata.py <out_root>` reads the 53 source files from an S-BIAD394 mirror (the
137
+ NAS copy is byte-identical to the archive) and writes both tiers; `write_placement_seed.py` writes the seed.
138
+ 2. Reference: with this folder as the working directory, run spaCR on `settings/ops_testdata_settings.csv`
139
+ (`spacr.ops_engine.run_ops(settings, wells=["A1"], phases=...)`); see `reference/PROVENANCE.json`
140
+ for the commit, the phases run, the environment lock and the CPU.
141
+
142
+ ## Repository layout: two tiers
143
+
144
+ - `ops_testdata_funk2022_A1_core.tar` (about 194 MB): the core tier, the smallest subset that runs the OPS end-to-end test.
145
+ - `ops_testdata_funk2022_A1_full.tar` (about 1.25 GB): the full tier, with the complete set of inputs for plate A well A1.
146
+ - `SHA256SUMS_tars.txt`: sha256 of both tar files (`sha256sum -c SHA256SUMS_tars.txt`).
147
+
148
+ Each tar unpacks to a top folder `ops_testdata_funk2022_A1/` that holds `README.md`, `roi_manifest.json`, `SHA256SUMS` (check with `sha256sum -c SHA256SUMS` inside the folder), `settings/`, `reference/` and `library/`.
SHA256SUMS_tars.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ e16758546e242ff6c6462e12c4e412d6fb0980d7b419024fbed63f4fe54adca0 ops_testdata_funk2022_A1_core.tar
2
+ 6e4d9a6cbcdbf3ef96025c097093631306a2763eb799b36bee1c5577f5eabb20 ops_testdata_funk2022_A1_full.tar
ops_testdata_funk2022_A1_core.tar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e16758546e242ff6c6462e12c4e412d6fb0980d7b419024fbed63f4fe54adca0
3
+ size 193884160
ops_testdata_funk2022_A1_full.tar ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e4d9a6cbcdbf3ef96025c097093631306a2763eb799b36bee1c5577f5eabb20
3
+ size 1245040640