name: add_id
namespace: "metadata"
scope: "public"
description: |
  Add id of .obs. Also allows to make .obs_names (the .obs index) unique 
  by prefixing the values with an unique id per .h5mu file.
authors:
  - __merge__: /src/authors/dries_schaumont.yaml
    roles: [ maintainer ]
arguments:
  - name: "--input"
    alternatives: ["-i"]
    type: file
    description: Path to the input .h5mu.
    required: true
    example: input.h5mu
  - name: "--input_id"
    type: string
    description: "The input id."
    required: true
  - name: "--obs_output"
    type: string
    required: false
    description: "Name of the .obs column where to store the id."
    default: "sample_id"
  - name: "--output"
    description: |
      Name of output MuData file.
    alternatives: ["-o"]
    type: file
    direction: output
    example: "output.h5mu"
  - name: "--make_observation_keys_unique"
    type: boolean_true
    description: Join the id to the .obs index (.obs_names).
__merge__: [., /src/base/h5_compression_argument.yaml]

resources:
  - type: python_script
    path: script.py
  - path: /src/utils/setup_logger.py
test_resources:
  - type: python_script
    path: test.py
  - path: /resources_test/concat_test_data/e18_mouse_brain_fresh_5k_filtered_feature_bc_matrix_subset_unique_obs.h5mu

engines:
- type: docker
  image: python:3.11-slim
  setup:
    - type: apt
      packages: 
        - procps
    - type: python
      __merge__: /src/base/requirements/anndata_mudata.yaml
  __merge__: [ /src/base/requirements/python_test_setup.yaml, .]

runners:  
- type: executable
- type: nextflow
  directives:
    label: [ singlecpu, lowmem ]