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.

All parameters

Every parameter, grouped as in nextflow_schema.json. Each shows its type and default; the parameters most runs change are explained by topic in Parameters.

A switch shown as default false is unset in the schema: nf-core pipelines leave a switch that is off as null, which the pipeline reads as false. The params templates in assets/ show it as null.

The run checks combinations when it starts; a Requires, Conflicts or Ignored unless line under a parameter states its rule.

Input/output options

Define where the pipeline should find input data and save output data.

pixel_size

number · default none

µm per pixel of the image (OME PhysicalSizeX). Required by InstanSeg and Nimbus.

input

string · default none

Path to a comma-separated samplesheet. Its shape depends on use_preprocessing: one row per acquisition cycle when true, one row per sample when false.

Two shapes are accepted and the correct one is validated at runtime, so no fixed schema is declared here.

use_preprocessing = true (default): one row per cycle, with columns sample, cycle_number, image_tiles and marker_sheet, and optionally dfp and ffp. Validated against assets/schema_input_cycle.json.

use_preprocessing = false: one row per stitched image, with column data_path and optionally sample (default: the file name). Validated against assets/schema_input.json. Use this for pre-stitched images and for dearrayed TMA cores re-entering the pipeline.

outdir

string · default none

The output directory where the results will be saved. Use an absolute path.

email

string · default none

Email address for completion summary.

Set this parameter to your e-mail address to get a summary e-mail with details of the run sent to you when the workflow exits. If set in your user config file (~/.nextflow/config) then you don’t need to specify this on the command line for every run.

Preprocessing

Illumination correction, stitching and registration, optional background subtraction and optional TMA dearray. These run before the image enters the SpatialData half, and are skipped entirely when use_preprocessing is false.

use_preprocessing

boolean · default true

Run the preprocessing half: illumination correction, stitching and registration, and the optional steps below. When false, each samplesheet row is an already stitched OME-TIFF, such as a dearrayed core re-entering the pipeline.

Requires: instanseg_channels when use_instanseg is true and this is false. Conflicts: preprocessing_only, use_projection and use_tma_dearray when this is false.

preprocessing_only

boolean · default false

Stop after preprocessing: keep the stitched images under preprocessing/ and skip segmentation, quantification and the QC report. Ashlar’s own QC is still written when use_qc is true. Requires use_preprocessing; no segmentation method is needed.

Requires: use_preprocessing.

skip_reference_dna_check

boolean · default false

Run even when Ashlar’s alignment channel or Coreograph’s dearray channel is not a dna channel in the marker sheet. A warning is logged instead of stopping.

Ignored unless: use_preprocessing is true.

ashlar_args

string · default --maximum-shift 30

Extra command-line arguments passed through to Ashlar.

Ashlar runs from the josenimo/ashlar image, which adds rotation correction between cycles; -c -1 aligns each cycle on its own last channel. Do not pass --qc-output or --report: the pipeline adds them when use_qc is true.

Requires: -c (a within-cycle channel index, default 0, -1 for the last) to be a dna channel in every cycle of the marker sheet, unless skip_reference_dna_check is true.

use_backsub

boolean · default false

Subtract background channels after stitching. Requires exposure and background columns in the marker sheet.

Conflicts: cellpose_channels or instanseg_channels naming a channel marked remove in the marker sheet.

backsub_args

string · default none

Extra command-line arguments passed through to backsub.

Ignored unless: use_backsub is true.

use_tma_dearray

boolean · default false

Split a tissue microarray into individual cores with UNetCoreograph. Each core then runs the downstream half as an independent sample, and the results are merged per slide at the end. Requires use_preprocessing.

Requires: use_preprocessing, and tma_expected_cores and tma_core_diameter_mm unless coreograph_args is set.

tma_expected_cores

integer · default none

Total number of cores expected on the slide. Required with use_tma_dearray unless coreograph_args is set.

Count the cores you expect to find, not rows times columns: arrays have empty or lost positions. The pipeline tries several Coreograph downsample factors and keeps the one whose cores best match this count and tma_core_diameter_mm. Every slide in the run is scored against the same values, so run arrays of different layouts separately.

Requires: tma_core_diameter_mm. Ignored unless: use_tma_dearray is true and coreograph_args is unset.

tma_core_diameter_mm

number · default none

Expected core diameter in mm. Required with use_tma_dearray unless coreograph_args is set.

Used with tma_expected_cores to choose Coreograph’s downsample factor. The pixel size is read from the image’s OME-XML.

Requires: tma_expected_cores. Ignored unless: use_tma_dearray is true and coreograph_args is unset.

coreograph_args

string · default none

Command-line arguments for UNetCoreograph. Setting this skips the downsample sweep.

Leave unset to let the pipeline choose --downsampleFactor from tma_expected_cores and tma_core_diameter_mm (it then runs on the marker sheet’s first dna channel with --buffer 2 --sensitivity 0.3). Set it, for example to ‘--downsampleFactor 4 --channel 0 --buffer 2’, to run Coreograph exactly as given.

Requires: a --channel index (default 0) that is a dna channel in the marker sheet, unless skip_reference_dna_check is true. Ignored unless: use_tma_dearray is true.

Generic options

Less common options for the pipeline, typically set in a config file.

help

boolean | string · default none

Display the help message.

help_full

boolean · default false

Display the full detailed help message.

show_hidden

boolean · default false

Display hidden parameters in the help message (only works when --help or --help_full are provided).

Patches

Tiling of the image before segmentation

patch_width_pixel

number · default 2000

Width and height of each segmentation patch, in pixels. Choose it so the image yields roughly 16 to 200 patches: patch_width = sqrt(width * height / target_patches).

This parameter sets how segmentation parallelises, and it is not automatic. Tiled segmentation is the reason this pipeline scales, but only if the tiling suits the image.

Too large and you get one patch and no parallelism at all: a 3138 x 2511 image at patch_width_pixel = 5000 produces a single task. Too small and you get thousands of tasks, each paying container startup and scheduler overhead; a 115000 x 115000 image at 2000 produces 3364 of them.

Task count is usually the constraint, so aim for a few times your cluster’s concurrency and no more. Memory can be too: InstanSeg on a 5000 pixel patch of 6 channels needed more than 12 GB.

Rough guide, patches = ceil(width/p) * ceil(height/p): 3k x 3k -> 1000 gives 9, 2000 gives 4, 5000 gives 1 25k x 25k -> 2000 gives 169, 5000 gives 25, 8000 gives 16 50k x 50k -> 5000 gives 100, 8000 gives 49, 10000 gives 25 115k x 115k -> 8000 gives 225, 10000 gives 144, 15000 gives 64

Get the dimensions of a stitched image with: python -c “import tifffile; print(tifffile.TiffFile(‘stitched.ome.tif’).series[0].shape)”

patch_overlap_pixel

number · default 100

Overlap between neighbouring patches, in pixels. About twice a cell diameter.

use_gpu

boolean · default false

One GPU per Cellpose and InstanSeg patch task. Cluster only; InstanSeg then takes at most 10 channels.

Conflicts: use_instanseg on more than 10 channels.

Tissue segmentation

Parameters related to the tissue segmentation

use_tissue_segmentation

boolean · default false

Whether to run tissue segmentation

level

number · default none

Level of the image pyramid to use for tissue segmentation

mode

string · default none · one of staining, saturation

Mode for the tissue segmentation: ‘staining’ or ‘saturation’ (for H&E images).

tissue_segmentation_kwargs

string · default none

Additional tissue segmentation parameters as a python dict string

Cell filtering

Filtering objects at segmentation. Cells are never dropped at aggregation.

min_area_pixels2

number · default none

Objects smaller than this, in pixels², are dropped at segmentation, per patch. Unset: sopa uses 0.

Aggregation

Per-cell marker statistics and morphology

expand_radius_ratio

number · default none

Expand cell polygons by expand_radius_ratio * mean_radius when measuring channel intensities, for X only; the nucleus and cytoplasm layers, area and centroids use the unexpanded shapes. Helps capture membrane stainings at the cell boundary.

quantification_statistics

string · default mean,median,std

Per-marker statistics, comma-separated, no spaces: mean, median, std, min, max, q25, q75, q90. mean is required.

Requires: mean in the list, each statistic once.

Image preprocessing

Image preprocessing applied before segmentation (Cellpose, InstanSeg). Unset: none for either method.

gaussian_sigma

number · default none

Parameter for scipy gaussian_filter (applied before running the segmentation method). Unset: 0, no smoothing.

clip_limit

number · default none

Parameter for skimage.exposure.equalize_adapthist (applied before running the segmentation method). Unset: 0, no CLAHE.

clahe_kernel_size

number · default none

Parameter for skimage.exposure.equalize_adapthist (applied before running the segmentation method)

Channel projection

Segment a nuclear and a cell channel projected from many markers, for 2-channel Cellpose

use_projection

boolean · default false

Project the marker sheet’s channels into a nuclear and a cell (membrane and cytoplasm) channel and segment those with Cellpose. Requires use_cellpose and use_preprocessing; leave cellpose_channels unset.

Requires: use_cellpose and use_preprocessing. Conflicts: cellpose_channels, and keep_projection when this is false.

keep_projection

boolean · default false

Keep the projected nuclear and cell image in the published store as <image>_projected. Requires use_projection.

Requires: use_projection.

projection_method

string · default max · one of max, mean

How the rescaled markers of a channel are combined. max keeps markers that stain only one cell type at full brightness; mean averages out noise but dims them.

projection_low_percentile

number · default 1

Per-marker percentile mapped to 0 before combining. Zero-valued padding is ignored.

projection_high_percentile

number · default 99.9

Per-marker percentile mapped to 1 before combining.

projection_sigma

number · default 0

Gaussian smoothing in pixels applied to each marker before combining; 0 for none.

Segmentation targets

What each enabled method segments: whole cells, nuclei, or both.

segment_cells

boolean · default true

Segment whole cells with each enabled method: shapes {method}_cells. Set false for nuclei only.

Requires: segment_cells or segment_nuclei, unless preprocessing_only is true.

segment_nuclei

boolean · default false

Segment nuclei with each enabled method: shapes {method}_nuclei. With segment_cells, nuclei are linked to cells and the cytoplasm is derived.

Requires: segment_cells or segment_nuclei, unless preprocessing_only is true.

Cellpose

Parameters related to the cellpose segmentation method

use_cellpose

boolean · default false

Segment with Cellpose. May be combined with use_instanseg.

Requires: cellpose_channels unless use_projection is true, and use_cellpose or use_instanseg unless preprocessing_only is true.

cellpose_channels

string | integer · default none

Channel(s) to segment with Cellpose. Use marker names from the marker sheet, e.g. “DNA_1”. If multiple, separate by space, comma or pipe characters. The last is the nuclear channel, which segment_nuclei uses.

Conflicts: use_projection, and channels marked remove in the marker sheet with use_backsub.

flow_threshold

number · default none

Cellpose flow_threshold parameter. Unset: 0.6, from the segmentation benchmark.

cellprob_threshold

number · default none

Cellpose cellprob_threshold parameter. Unset: -1, from the segmentation benchmark.

pretrained_model

string · default cpsam_v2

Cellpose weights: a name baked into the image (cpsam_v2, cpsam) or a path

cellpose_kwargs

string · default none

Additional cellpose parameters as a python dict string

InstanSeg

Parameters related to the InstanSeg segmentation method

use_instanseg

boolean · default false

Segment with InstanSeg. May be combined with use_cellpose.

Requires: pixel_size, instanseg_channels when use_preprocessing is false, and use_cellpose or use_instanseg unless preprocessing_only is true. Conflicts: use_gpu on more than 10 channels.

instanseg_model_type

string · default none

Name of the pretrained InstanSeg model, or path to a local model. sopa defaults to fluorescence_nuclei_and_cells

instanseg_channels

string | integer · default none

Channel(s) to segment with InstanSeg. Unset takes them from each sample’s marker sheet: dna and marker channels for cells, dna only for nuclei; autofluorescence, blank and removed channels are left out. Required without a marker sheet (use_preprocessing = false). Use marker names, separated by space, comma or pipe characters.

Conflicts: more than 10 channels with use_gpu, and channels marked remove in the marker sheet with use_backsub.

instanseg_kwargs

string · default none

Additional InstanSeg parameters as a python dict string

Learned features

Parameters related to learned-features models, which score each segmented cell

use_nimbus

boolean · default false

Score per-cell marker positivity with Nimbus.

Requires: pixel_size, segment_cells, and nimbus_channels when use_preprocessing is false.

nimbus_channels

string | integer · default none

Channel(s) to score with Nimbus. Unset takes the marker channels from each sample’s marker sheet. Required without a marker sheet (use_preprocessing = false). Use marker names, separated by space, comma or pipe characters.

Ignored unless: use_nimbus.

use_virtues

boolean · default false

Embed each segmented cell with VirTues, a multiplex protein-marker foundation model.

Requires: use_gpu, use_preprocessing, use_tissue_segmentation, segment_cells, pixel_size, and a uniprot_id on at least one marker-sheet row.

QC report

Parameters related to the quality-control metrics and report

use_qc

boolean · default true

Whether to compute QC metrics, write Ashlar’s stitching and registration QC, and render the QC report

Writes a machine-readable JSON of metrics next to a self-contained HTML report, per sample and method, into <outdir>/qc, plus {sample}_comparison.json and .html when both methods segment cells. The JSON is the contract an unattended run should read; the HTML is for a person. With use_preprocessing, Ashlar also writes its stitching and registration QC to <outdir>/preprocessing/registration/{sample}_ashlar_qc/, which the report reads.

use_qc_images

boolean · default true

Whether to include the segmentation crops and the cell clustering in the QC report

These cost minutes where the metrics cost seconds: the crops rasterise segmentation polygons and the clustering builds a nearest-neighbour graph over every cell. Set false for a metrics-only report. Tuning for this step goes through ext.args for QC_IMAGES in conf/modules.config.

Advanced and nf-core parameters

Rarely changed; most are set by profiles or institutional configs.

ParameterTypeDefaultDescription
custom_config_versionstringmasterGit commit id for Institutional configs.
custom_config_basestringhttps://raw.githubusercontent.com/nf-core/configs/masterBase directory for Institutional configs.
config_profile_namestringnoneInstitutional config name.
config_profile_descriptionstringnoneInstitutional config description.
config_profile_contactstringnoneInstitutional config contact information.
config_profile_urlstringnoneInstitutional config URL link.
versionbooleanfalseDisplay version and exit.
publish_dir_modestringcopyMethod used to save pipeline results to output directory.
email_on_failstringnoneEmail address for completion summary, only when pipeline fails.
plaintext_emailbooleanfalseSend plain-text email instead of HTML.
monochrome_logsbooleanfalseDo not use coloured log outputs.
validate_paramsbooleantrueBoolean whether to validate parameters against the schema at runtime
pipelines_testdata_base_pathstringhttps://raw.githubusercontent.com/nf-core/test-datasets/Base URL or local path to location of pipeline test dataset files
trace_report_suffixstringnoneSuffix to add to the trace report filename. Default is the date and time in the format yyyy-MM-dd_HH-mm-ss.
instanseg_pixel_sizenumbernoneDeprecated: use pixel_size
virtues_statsstringnoneA {slide}_virtues_stats.json from an earlier run, applied to every slide instead of computing per-slide statistics.