What you will do¶
Run a tissue microarray (TMA): the stitched slide is cut into its cores, each core is segmented and checked on its own, and the cores are merged back into one store per slide.
The data is MCMICRO’s exemplar-002: a small TMA with four cores, three cycles of four channels. Cycle 1 records only autofluorescence, the tissue’s own glow, so this run also subtracts it from the markers. Tutorial 3 explains background subtraction in detail. This is the same run the pipeline is tested with before every release.
Get the data¶
Three OME-TIFF files, 953 MB in total, from MCMICRO’s public storage:
mkdir -p /path/to/exemplars/exemplar-002 && cd /path/to/exemplars/exemplar-002
for c in 01 02 03; do
curl -fLO "https://mcmicro.s3.amazonaws.com/exemplars/002/exemplar-002/raw/exemplar-002-cycle-$c.ome.tiff"
doneThe samplesheet¶
One row per cycle. The sample is the whole slide; the cores are found by the pipeline.
| sample | cycle_number | image_tiles | marker_sheet |
|---|---|---|---|
| exemplar-002 | 1 | /path/to/exemplars/exemplar-002/exemplar-002-cycle-01.ome.tiff | /path/to/exemplars/markers_exemplar002.csv |
| exemplar-002 | 2 | /path/to/exemplars/exemplar-002/exemplar-002-cycle-02.ome.tiff | /path/to/exemplars/markers_exemplar002.csv |
| exemplar-002 | 3 | /path/to/exemplars/exemplar-002/exemplar-002-cycle-03.ome.tiff | /path/to/exemplars/markers_exemplar002.csv |
Copy as CSV: samplesheet.csv
sample,cycle_number,image_tiles,marker_sheet
exemplar-002,1,/path/to/exemplars/exemplar-002/exemplar-002-cycle-01.ome.tiff,/path/to/exemplars/markers_exemplar002.csv
exemplar-002,2,/path/to/exemplars/exemplar-002/exemplar-002-cycle-02.ome.tiff,/path/to/exemplars/markers_exemplar002.csv
exemplar-002,3,/path/to/exemplars/exemplar-002/exemplar-002-cycle-03.ome.tiff,/path/to/exemplars/markers_exemplar002.csvColumns: The samplesheet.
The marker sheet¶
Save as markers_exemplar002.csv;
download it from GitHub.
| channel_number | cycle_number | marker_name | channel_role | channel_compartment | filter | excitation_wavelength | emission_wavelength | exposure | background | remove |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 1 | DNA_1 | dna | nuclear | DAPI | 390 | 431 | 0.03 | ||
| 2 | 1 | AF488 | autofluorescence | FITC | 475 | 525 | 0.2 | TRUE | ||
| 3 | 1 | AF555 | autofluorescence | Sytox | 542 | 590 | 0.2 | TRUE | ||
| 4 | 1 | AF647 | autofluorescence | Cy5 | 632 | 690 | 0.2 | TRUE | ||
| 5 | 2 | DNA_2 | dna | nuclear | DAPI | 390 | 431 | 0.03 | ||
| 6 | 2 | A488_background | marker | cytoplasm | FITC | 475 | 525 | 0.2 | AF488 | |
| 7 | 2 | A555_background | marker | cytoplasm | Sytox | 542 | 590 | 0.2 | AF555 | |
| 8 | 2 | A647_background | marker | cytoplasm | Cy5 | 632 | 690 | 0.2 | AF647 | |
| 9 | 3 | DNA_3 | dna | nuclear | DAPI | 390 | 431 | 0.015 | ||
| 10 | 3 | FDX1 | marker | cytoplasm | FITC | 475 | 525 | 0.2 | AF488 | |
| 11 | 3 | CD357 | marker | membrane | Sytox | 542 | 590 | 0.5 | AF555 | |
| 12 | 3 | CD1D | marker | membrane | Cy5 | 632 | 690 | 0.5 | AF647 |
The cores are found on the first
dnachannel,DNA_1.backgroundnames the autofluorescence channel to subtract from each marker, andexposurescales it to the marker’s exposure time.removedrops the three autofluorescence channels after subtraction: 12 channels become 9.
Columns: The marker sheet.
The parameters¶
Save as params.yml:
input: /path/to/exemplars/samplesheet.csv
outdir: /path/to/results/exemplar-002
use_tma_dearray: true
tma_expected_cores: 4
tma_core_diameter_mm: 1.5
use_backsub: true
use_instanseg: true
pixel_size: 0.65
segment_nuclei: true
patch_width_pixel: 2000use_tma_dearraycuts the slide into cores with Coreograph.tma_expected_coresis a count, not rows × columns; withtma_core_diameter_mmit lets the pipeline pick how much to shrink the image before looking for cores. See TMA dearray.use_backsubsubtracts the autofluorescence with backsub, on each core separately.InstanSeg segments cells and, with
segment_nuclei, nuclei too; the two are then linked. See Methods and targets.Cores are about 2900 pixels across, so
patch_width_pixel: 2000gives 2 × 2 patches per core.
Run¶
nextflow run CosciaLab/histo -r v3.2.0 \
-profile singularity,size_small,slurm \
-params-file params.ymlOn the MDC cluster add mdc. Set up your session first:
Running on the cluster.
What runs: BaSiCPy per cycle and Ashlar once for the slide; then Coreograph tries five shrink factors and keeps the one that best matches four cores of 1.5 mm. Everything after that runs once per core: backsub, the SpatialData store, tiled segmentation, linking, quantification and the QC report. Finally the four cores are merged into one store, with one report for the slide.
What you get¶
/path/to/results/exemplar-002/
├── preprocessing/
│ ├── illumination/ exemplar-002_cycle1-dfp.ome.tif, -ffp.ome.tif; per cycle
│ ├── registration/ exemplar-002.ome.tif, exemplar-002_ashlar_qc/
│ ├── dearray/ exemplar-002_core001.ome.tif … core004
│ │ │ exemplar-002_tma_map.tif, _coremask.tif, _centroids.txt
│ │ ├── masks/ exemplar-002_core001_mask.tif, … one per core
│ │ └── sweep/ exemplar-002_sweep.tsv, _sweep_overlays.png, _selection.json, …
│ └── background_subtraction/ exemplar-002_core001_backsub.ome.tif and .csv, … one per core
├── exemplar-002_merged.zarr/ all four cores in one store
├── exemplar-002_merge_manifest.json
├── qc/
│ ├── exemplar-002_instanseg_slide_report.html
│ ├── exemplar-002_core001_instanseg_qc_report.html, … one per core
│ ├── exemplar-002_core001_instanseg_qc.json, … one per core
│ └── exemplar-002_core001_instanseg_qc_images/, … one per core
└── pipeline_info/In the merged store every element is prefixed by its core, for example
exemplar-002_core001__instanseg_table. Per-core stores are not kept. Every file is described in
Outputs.
What to check¶
preprocessing/dearray/sweep/exemplar-002_sweep_overlays.png: the cores found at each shrink factor. Four round cores, none split or merged. The log warns when even the best factor is off.qc/exemplar-002_instanseg_slide_report.html: it names any core that failed a check, and holds the stitching QC for the slide. See The QC report.A failing core’s own report next.
In a core’s report, “Channels” lists nine names: no
AF488,AF555orAF647.exemplar-002_merged.zarrwith the outlines over the image; see Viewers.
A core missing, or two merged into one: see Common failures.