name: "from_h5mu_to_spatialdata"
namespace: "convert"
scope: "public"
description: |
  Reads in an H5MU file and saves it as a SpatialData Zarr store. The selected
  modality in the MuData is stored as the main table in the SpatialData object.
  If a matching existing SpatialData is provided, it will be used to fill the
  remaining SpatialData slots.
    
authors:
  - __merge__: /src/authors/dorien_roosen.yaml
    roles: [ maintainer ]
  - __merge__: /src/authors/luke_zappia.yaml
    roles: [ author ]
arguments:
  - name: "--input"
    alternatives: ["-i"]
    type: file
    description: Input H5MU file.
    example: input.h5mu
    direction: input
    required: true
  - name: "--input_spatialdata"
    type: file
    description: An optional existing SpatialData Zarr store to fill remaining slots from.
    example: existing.zarr
    direction: input
    required: false
  - name: "--modality"
    type: string
    default: rna
    description: The modality in the MuData to be used as the main table in the SpatialData object.
  - name: "--output"
    alternatives: ["-o"]
    type: file
    description: The path to the output SpatialData Zarr store.
    example: "output.zarr"
    direction: output
    required: true

resources:
  - type: python_script
    path: script.py
  - path: /src/utils/setup_logger.py
test_resources:
  - type: python_script
    path: test.py
  - path: /resources_test/xenium/xenium_tiny.h5mu
  - path: /resources_test/xenium/xenium_tiny.zarr
engines:
  - type: docker
    image: python:3.12-slim
    setup:
      - type: apt
        packages: 
          - procps
      - type: python
        __merge__: [/src/base/requirements/anndata_mudata.yaml, /src/base/requirements/spatialdata.yaml]
    __merge__: [ /src/base/requirements/python_test_setup.yaml, .]
runners:
  - type: executable
  - type: nextflow
    directives:
      label: [lowmem, singlecpu]
