name: "dimensionality_reduction"
namespace: "workflows/multiomics"
scope: "public"
description: "Run calculations that output information required for most integration methods: PCA, nearest neighbour and UMAP."
authors:
  - __merge__: /src/authors/dries_schaumont.yaml
    roles: [ author ]
info:
  test_dependencies:
    - name: dimensionality_reduction_test
      namespace: test_workflows/multiomics
argument_groups:
  - name: "Inputs"
    arguments:
      - name: "--id"
        required: true
        type: string
        description: ID of the sample.
        example: foo
      - name: "--input"
        required: true
        type: file
        description: Path to the sample.
        example: dataset.h5mu
      - name: "--layer"
        default: "log_normalized"
        type: string
        description: use specified layer for expression values instead of the .X object from the modality.
        required: false
      - name: "--modality"
        description: Which modality to process.
        type: string
        default: "rna"
        required: false
  - name: "Outputs"
    arguments:
      - name: "--output"
        type: file
        required: true
        direction: output
        description: Destination path to the output.
        example: output.h5mu
  - name: PCA options
    arguments:
      - name: "--obsm_pca"
        type: string
        default: "X_pca"
        description: "In which .obsm slot to store the resulting PCA embedding."
      - name: "--var_pca_feature_selection"
        type: string
        required: false
        description: Column name in .var matrix that will be used to select which genes to run the PCA on.
      - name: "--pca_loadings_varm_output"
        type: string
        description: |
          Name of the .varm key where the PCA loadings are stored.
      - name: "--pca_variance_uns_output"
        type: string
        description: |
          Name of the .uns key where the variance and variance ratio will be stored as a map.
          The map will contain two keys: variance and variance_ratio respectively.
      - name: "--pca_overwrite"
        type: boolean_true
        description: "Allow overwriting slots for PCA output."
  - name: Neighbour calculation
    arguments:
      - name: "--uns_neighbors"
        type: string
        default: neighbors
        description: In which .uns slot to store various neighbor output objects.
      - name: "--obsp_neighbor_distances"
        type: string
        default: "distances"
        description: "In which .obsp slot to store the distance matrix between the resulting neighbors."
      - name: "--obsp_neighbor_connectivities"
        type: string
        default: "connectivities"
        description: "In which .obsp slot to store the connectivities matrix between the resulting neighbors."
  - name: Umap options
    arguments:
      - name: "--obsm_umap"
        type: string
        default: "X_umap"
        required: false
        description: "In which .obsm slot to store the resulting UMAP embedding."
dependencies:
  - name: dimred/pca
  - name: workflows/multiomics/neighbors_leiden_umap
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
runners:
  - type: nextflow
