name: scvelo
namespace: "velocity"
scope: "public"
authors:
  - __merge__: /src/authors/dries_schaumont.yaml
    roles: [ maintainer ]
argument_groups:
  - name: Inputs
    arguments:
      - name: "--input"
        description: "Input MuData file"
        type: file
        direction: input
        required: true
      - name: "--counts_layer"
        type: string
        description: "Name of the counts layer, if not specified, X is used."
        required: false
      - name: "--modality"
        description: Input modality
        required: true
        type: string
      - name: "--layer_spliced"
        description: |
          Name of the layer to store the spliced abundances in. Will be used as key in the .layer attribute of the
          output MuData object.
        type: string
        required: false
        default: "spliced"
      - name: "--layer_unspliced"
        description: |
          Name of the layer to store the unspliced abundances in.
          Will be used as key in the .layer attribute of the output MuData object.
        type: string
        required: false
        default: "unspliced"
      - name: "--layer_ambiguous"
        description: |
          Name of the layer to store the abundances in for which no fate was determined.
          Will be used as key in the .layer attribute of the output MuData object.
        type: string
        required: false
        default: "ambiguous"
  - name: Outputs
    arguments:
      - name: "--output"
        required: true
        type: file
        direction: output
        description: "Output directory. If it does not exist, will be created."
      - name: "--output_h5mu"
        required: true
        type: file
        direction: output
        description: "Output mudata file."
    __merge__: [., /src/base/h5_compression_argument.yaml]

  - name: "Filtering and normalization"
    description: Arguments for filtering, normalization an log transform (see scvelo.pp.filter_and_normalize function)
    arguments:
      - name: --min_counts
        description: Minimum number of counts required for a gene to pass filtering (spliced).
        type: integer
      - name: --min_counts_u
        description: Minimum number of counts required for a gene to pass filtering (unspliced).
        type: integer
      - name: --min_cells
        description: Minimum number of cells expressed required to pass filtering (spliced).
        type: integer
      - name: --min_cells_u
        description: Minimum number of cells expressed required to pass filtering (unspliced).
        type: integer
      - name: "--min_shared_counts"
        description: "Minimum number of counts (both unspliced and spliced) required for a gene."
        type: integer
      - name: "--min_shared_cells"
        description: "Minimum number of cells required to be expressed (both unspliced and spliced)."
        type: integer
      - name: "--n_top_genes"
        description: "Number of genes to keep."
        type: integer
      - name: "--log_transform"
        type: boolean
        default: true
        description: "Do not log transform counts."
  - name: Fitting parameters
    description: Arguments for fitting the data
    arguments:
      - name: --n_principal_components
        description: Number of principal components to use for calculating moments.
        type: integer
      - name: --n_neighbors
        description: |
          Number of neighbors to use. First/second-order moments are computed for each
          cell across its nearest neighbors, where the neighbor graph is obtained from
          euclidean distances in PCA space.
        type: integer
        default: 30
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/rna_velocity/velocyto_processed/velocyto.h5mu
engines:
  - type: docker
    image: python:3.12-slim
    setup:
      - type: apt
        packages:
          - procps
          - git
      - type: python
        __merge__: [/src/base/requirements/anndata_mudata.yaml, /src/base/requirements/scanpy.yaml, .]
        packages:
          - scvelo~=0.3.3
          - scipy~=1.14.1
    __merge__: [ /src/base/requirements/python_test_setup.yaml, .]
runners:
  - type: executable
  - type: nextflow
    directives:
      label: [ highmem, highcpu ]