name: delimit_counts
namespace: "filter"
scope: "private"
description: |
  Turns an .obs column containing count values into a boolean column based on thresholds.
authors:
  - __merge__: /src/authors/dorien_roosen.yaml
    roles: [ author, maintainer]

argument_groups:
  - name: Inputs
    arguments:
      - name: "--input"
        type: file
        description: Input h5mu file
        direction: input
        required: true
        example: input.h5mu
      - name: "--modality"
        description: |
          Which modality from the input MuData file to process.
        type: string
        default: "rna"
        required: false
      - name: "--obs_count_column"
        type: string
        required: true
        example: "n_counts"
        description:  |
          Name of column from .obs dataframe selecting
          a column that contains integer or float values.

  - name: Outputs
    arguments:
      - name: "--output"
        type: file
        description: Output h5mu file.
        direction: output
        example: output.h5mu
      - name: "--obs_name_filter"
        type: string
        required: true
        description: In which .obs slot to store a boolean array corresponding to which observations should be removed.
    __merge__: [., /src/base/h5_compression_argument.yaml]

  - name: Arguments
    arguments:
      - name: "--min_count"
        type: integer
        min: 0
        description: Min count for an observation to be retained (True in output).
      - name: "--max_count"
        type: integer
        min: 0
        description: Max count for an observation to be retained (True in output).
      - name: "--do_subset"
        type: boolean_true
        description: Whether to subset before storing the output.

resources:
  - type: python_script
    path: script.py
  - path: /src/utils/setup_logger.py
  - path: /src/utils/compress_h5mu.py
test_resources:
  - type: python_script
    path: test.py
  - path: /resources_test/annotation_test_data/TS_Blood_filtered_pseudobulk.h5mu

engines:
- type: docker
  image: python:3.13-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]