Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.95 KB

File metadata and controls

25 lines (20 loc) · 1.95 KB

Xenflow

Xenium spatial transcriptomics analysis pipeline built with Nextflow and Singularity/Apptainer. The pipeline uses cv2 to automatically identify tissue contours and bounding boxes, making it especially suited for tissue microarrays and multi-sample slides.

Quick start

  1. Build a container sopa.sif using the definition file from this repository.
  2. Export two environment variables:
  • CONTAINERDIR → path to the container image.
  • PROJECTDIR → path to the project directory (mounted inside the container at runtime).
  1. Adjust resource settings in resources.config for each pipeline step.
  2. Create a run-specific config (e.g., run01.config) in the config directory, based on run.template.
  3. Create an environment with Nextflow installed using make env_create.
  4. Run the pipeline using make nf_run.

Key steps

The workflow processes raw Xenium output through to the identification of gene programs with cNMF.

Nextflow DAG

  • CONVERT_XENIUM converts raw data to spatialdata-formatted zarr archive for downstream processing.
  • RESEGMENT_NUCLEI applies cellpose or stardist to resegment nuclei.
  • RESEGMENT_CELLS applies Baysor or Proseg to refine segmentation based on transcript distributions.
  • DETECT_TISSUE identifies tissue contours and bounding boxes, splitting multi-sample slides into independent samples (especially useful for tissue microarrays).
  • SPLIT_SAMPLES creates one AnnData h5ad archive per sample based on the tissue contours.
  • IDENTIFY_PROGRAMS runs cNMF on each sample. Note: The pipeline does not automatically select the optimal number of programs, this step is left to the user.