name: harmony
namespace: "integrate"
scope: "public"
status: disabled
description: "Performs Harmony integration based as described in https://github.com/immunogenomics/harmony."
authors:
  - __merge__: /src/authors/dries_de_maeyer.yaml
    roles: [ author ]
  - __merge__: /src/authors/robrecht_cannoodt.yaml
    roles: [ maintainer, author ]
arguments:
  - name: "--input"
    alternatives: ["-i"]
    type: file
    description: Input h5mu file
    direction: input
    required: true
  - name: "--output"
    alternatives: ["-o"]
    type: file
    description: Output h5mu file.
    direction: output
    required: true
  - name: "--modality"
    type: string
    default: "rna"
    required: false
  - name: "--obsm_input"
    type: string
    default: "X_pca"
    required: false
    description: "Which .obsm slot to use as a starting PCA embedding."
  - name: "--obsm_output"
    type: string
    default: "X_pca_integrated"
    required: false
    description: "In which .obsm slot to store the resulting integrated embedding."
  - name: "--theta"
    description: "Diversity clustering penalty parameter. Can be set as a single value for all batch observations or as multiple values, one for each observation in the batches defined by --obs_covariates. theta=0 does not encourage any diversity. Larger values of theta result in more diverse clusters."
    type: double
    default: 2
    multiple: true
  - name: "--obs_covariates"
    type: string
    description: "The .obs field(s) that define the covariate(s) to regress out."
    example: ["batch", "sample"]
    multiple: true
__merge__: [., /src/base/h5_compression_argument.yaml]
resources:
  - type: r_script
    path: script.R

test_resources:
  - type: python_script
    path: ../harmonypy/test.py
  - path: /resources_test/pbmc_1k_protein_v3/pbmc_1k_protein_v3_mms.h5mu

engines:
- type: docker
  image: ghcr.io/data-intuitive/randpy:r4.0_py3.10
  setup:
    - type: python
      __merge__: /src/base/requirements/anndata_mudata.yaml
    - type: r
      cran: 
        - harmony
        - anndata
        - reticulate

runners:
- type: executable
- type: nextflow
  directives:
    label: [highmem, highcpu, highdisk]
