Nextflow pipeline for exporting large annotation regions from a QuPath project using headless QuPath and a Groovy script.
- Runs QuPath in CLI mode against a
.qpprojproject. - Executes
export_large_annotation_region.groovyto export selected annotation ROIs. - Collects exported OME-TIFF outputs from
ExportedAnnotations/.
--projectPath to QuPath project (.qpproj).--qupath_binPath to QuPath executable (default:/stornext/System/data/software/rhel/9/base/tools/QuPath/0.6.0/bin/QuPath).
Optional:
--scriptGroovy script path (default:bin/export_large_annotation_region.groovy). Relative paths are resolved from the pipeline directory.--target_annotation_namesComma-separated annotation names (default:annotation_1). Use an empty string ("") to export all annotations.--downsampleExport downsample factor (default:1.0).--compression_typeOME-TIFF compression type for QuPath writer (default:LZW).--output_subdirQuPath project-side output subdirectory name (default:ExportedAnnotations).--tile_sizeOME writer tile width/height in pixels (default:512).--num_cpusThreads used by QuPath writer parallelization (default:48).--big_tiffEnable BigTIFF output for large files (default:true).--build_pyramidEnable pyramidal OME-TIFF output (default:true).--outdirOutput directory for published results (default:results).--publish_dir_modeNextflowpublishDirmode (default:copy).
Run on HPC with Slurm resources matching the default medium profile (48 CPUs, 450 GB RAM):
nextflow run main.nf \
--project /vast/projects/project_name/Qupath_project/project.qpproj \
--qupath_bin /stornext/System/data/software/rhel/9/base/tools/QuPath/0.6.0/bin/QuPath \
--script bin/export_large_annotation_region.groovy \
--target_annotation_names annotation_1,annotation_2 \
--downsample 1.0 \
--compression_type LZW \
--output_subdir ExportedAnnotations \
--tile_size 512 \
--num_cpus 48 \
--big_tiff true \
--build_pyramid true \
--outdir /path/to/outputThe pipeline defaults to the standard profile, configured with medium resources.
| Profile | Executor | Queue | CPUs (process_heavy) |
Memory (process_heavy) |
Time (process_heavy) |
|---|---|---|---|---|---|
standard (default) |
slurm | regular | 48 | 450 GB | 24h |
small |
slurm | regular | 16 | 128 GB | 24h |
medium |
slurm | regular | 48 | 450 GB | 24h |
large |
slurm | regular | 64 | 1200 GB | 24h |
Use -profile small, -profile medium, or -profile large to override the default resource profile.
ExportedAnnotations/containing exported.ome.tifregion files.qupath_large_annotation_export.logwith full QuPath run logs.
- Groovy export settings are now pipeline parameters, so you can change them via CLI without editing the script.
- If your environment does not provide
module load java/17, use a QuPath build that bundles Java or enable thecondaprofile innextflow.config.