Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Tutorial 2: Tissue microarray

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"
done

The samplesheet

One row per cycle. The sample is the whole slide; the cores are found by the pipeline.

samplecycle_numberimage_tilesmarker_sheet
exemplar-0021/path/to/exemplars/exemplar-002/exemplar-002-cycle-01.ome.tiff/path/to/exemplars/markers_exemplar002.csv
exemplar-0022/path/to/exemplars/exemplar-002/exemplar-002-cycle-02.ome.tiff/path/to/exemplars/markers_exemplar002.csv
exemplar-0023/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.csv

Columns: The samplesheet.

The marker sheet

Save as markers_exemplar002.csv; download it from GitHub.

channel_numbercycle_numbermarker_namechannel_rolechannel_compartmentfilterexcitation_wavelengthemission_wavelengthexposurebackgroundremove
11DNA_1dnanuclearDAPI3904310.03
21AF488autofluorescenceFITC4755250.2TRUE
31AF555autofluorescenceSytox5425900.2TRUE
41AF647autofluorescenceCy56326900.2TRUE
52DNA_2dnanuclearDAPI3904310.03
62A488_backgroundmarkercytoplasmFITC4755250.2AF488
72A555_backgroundmarkercytoplasmSytox5425900.2AF555
82A647_backgroundmarkercytoplasmCy56326900.2AF647
93DNA_3dnanuclearDAPI3904310.015
103FDX1markercytoplasmFITC4755250.2AF488
113CD357markermembraneSytox5425900.5AF555
123CD1DmarkermembraneCy56326900.5AF647

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: 2000

Run

nextflow run CosciaLab/histo -r v3.2.0 \
    -profile singularity,size_small,slurm \
    -params-file params.yml

On 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

  1. 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.

  2. 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.

  3. A failing core’s own report next.

  4. In a core’s report, “Channels” lists nine names: no AF488, AF555 or AF647.

  5. exemplar-002_merged.zarr with the outlines over the image; see Viewers.

A core missing, or two merged into one: see Common failures.