name: "split_h5mu"
namespace: "workflows/multiomics"
scope: "private"
description: "Split the samples of a single modality from a .h5mu (multimodal) sample into seperate .h5mu files based on the values of an .obs column of this modality. "
authors:
  - __merge__: /src/authors/dries_schaumont.yaml
    roles: [ author, maintainer ]
info:
  test_dependencies:
    - name: split_h5mu_test
      namespace: test_workflows/multiomics
argument_groups:
- name: Input & specifications
  arguments:
  - name: "--input"
    type: file
    description: Path to a single .h5mu file.
    required: true
  - name: "--modality"
    description: |
      Which modality from the input MuData file to process.
    type: string
    default: "rna"
    required: false
  - name: "--obs_feature"
    type: string
    required: true
    description: The .obs column to split the mudata on.
    example: "celltype"
  - name: "--drop_obs_nan"
    type: boolean_true
    description: Whether to drop all .obs columns that contain only nan values after splitting.
  - name: "--ensure_unique_filenames"
    type: boolean_true
    description: Append number suffixes to ensure unique filenames after sanitizing obs feature values.

- name: Outputs
  arguments:
  - name: "--output"
    type: file
    required: true
    direction: output
    example: "/path/to/output"
    description: Output directory containing multiple h5mu files.
  - name: "--output_compression"
    type: string
    description: The compression format to be used on the output h5mu object.
    choices: ["gzip", "lzf"]
    required: false
    example: "gzip"
  - name: "--output_files"
    type: file
    required: true
    direction: output
    example: sample_files.csv
    description: A csv containing the base filename and obs feature by which it was split.
dependencies:
  - name: dataflow/split_h5mu
    alias: split_h5mu_component
resources:
  - type: nextflow_script
    path: main.nf
    entrypoint: run_wf
  - type: file
    path: /src/workflows/utils/
test_resources:
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf
  - path: /resources_test/concat_test_data/concatenated_brain_filtered_feature_bc_matrix_subset.h5mu
runners:
  - type: nextflow
