Simulates a compact demonstration experiment: one 96-unit plate format, six treatment levels, four exposure levels, two plates and two pre-treatment intervals. It is small enough that every example in the package can build a fresh copy in well under a second, and structured enough that the batch, quality-control and effect-size functions all have something to work on.
Value
A cr_experiment whose cells table holds one row per cell
(cell_id, well, x, y, area, circularity, DAPI,
marker_1, marker_2, marker_3) and whose design table holds
one row per unit, as described in cr_example_design().
Details
Use cr_example_screen() instead when a multi-compound screen with
per-batch controls, merged analysis units and a specificity arm is
needed.
Generating model
Values are drawn independently per cell from log-normal distributions, so that the marker channels are right-skewed the way measured intensities are:
- unit intercept
Each unit draws \(u \sim N(0, 0.15^2)\), added to the log mean of every channel in that unit. This is what makes the unit, and not the cell, the honest replicate.
- target signal
marker_1is \(\mathrm{LogNormal}(\log 500 + u + e \log 2,\ 0.5^2)\), where \(e\) is the treatment effect in log2 units:0untreated,1.0and3.0for the low and high exposure level ofCompoundA,3.3for the positive control,0.4forCompoundBand0.7forCompoundC.- further channels
marker_2moves against the target signal at \(-0.4e\),marker_3weakly with it at \(0.3e\).- nuclear stain
DAPIis \(\mathrm{LogNormal}(\log 500 + u,\ 0.3^2)\) and carries no treatment effect.- morphology
Nuclear
areais \(\mathrm{LogNormal}(\log 400,\ 0.25^2)\) andcircularityis \(\mathrm{Beta}(5, 2)\).- plate position
Units on the outer rows and columns get a fixed
+0.07log bump on every channel, an edge effect for the plate map to show.- debris
Five per cent of the cells of each unit are shrunk to a twentieth of their area and a tenth of their nuclear signal, so that the quality-control filters have something to remove.
- artefacts
Two named units are multiplied up on
marker_1and down onarea, a saturated pair for the outlier screens.
The random number generator state of the caller is restored on exit, so calling this function does not disturb a seeded analysis.
Examples
exp <- cr_example_experiment(seed = 1, n_cells_per_well = 20)
exp
#> ── cr_experiment ───────────────────────────────────────────────────────────────
#> • Cells: 1961 across 96 wells
#> • Channels: "DAPI", "marker_1", "marker_2", and "marker_3"
#> • Design: 6 treatment groups
#> • QC steps applied: 0
#> ℹ Metadata fields: project and sop
head(exp$design, 3)
#> # A tibble: 3 × 9
#> well treatment dose dose_unit group replicate plate interval timepoint
#> <chr> <chr> <dbl> <chr> <chr> <int> <chr> <chr> <dbl>
#> 1 A01 Untreated 0 uM control 1 Plate_1 15min 24
#> 2 B01 Untreated 0 uM control 1 Plate_1 15min 24
#> 3 C01 Untreated 0 uM control 1 Plate_2 15min 24