name: "scanorama_leiden"
namespace: "workflows/integration"
scope: "public"
description: "Run scanorama integration followed by neighbour calculations, leiden clustering and run umap on the result."
authors:
  - __merge__: /src/authors/mauro_saporita.yaml
    roles: [ author ]
  - __merge__: /src/authors/povilas_gibas.yaml
    roles: [ author ]
info:
  test_dependencies:
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: Neighbour calculation
    arguments:
      - name: "--uns_neighbors"
        type: string
        default: scanorama_integration_neighbors
        description: In which .uns slot to store various neighbor output objects.
      - name: "--obsp_neighbor_distances"
        type: string
        default: "scanorama_integration_distances"
        description: "In which .obsp slot to store the distance matrix between the resulting neighbors."
      - name: "--obsp_neighbor_connectivities"
        type: string
        default: "scanorama_integration_connectivities"
        description: "In which .obsp slot to store the connectivities matrix between the resulting neighbors."
  - name: "Scanorama integration options"
    arguments:
      - name: "--obs_batch"
        type: string
        description: Column name discriminating between your batches.
        default: "sample_id"
        required: false
      - name: "--obsm_input"
        type: string
        description: .obsm slot that points to embedding to run scanorama on. 
        default: "X_pca"
      - name: "--obsm_output"
        type: string
        description: The name of the field in adata.obsm where the integrated embeddings will be stored after running this function. Defaults to X_scanorama.
        default: "X_scanorama"   
      - name: "--knn"
        type: integer
        description: "Number of nearest neighbors to use for matching."
        default: 20
      - name: "--batch_size"
        type: integer
        description: "The batch size used in the alignment vector computation. Useful when integrating very large (>100k samples) datasets. Set to large value that runs within available memory."
        default: 5000
      - name: "--sigma"
        type: double
        description: "Correction smoothing parameter on Gaussian kernel."
        default: 15
      - name: "--approx"
        type: boolean
        description: "Use approximate nearest neighbors with Python annoy; greatly speeds up matching runtime."
        default: True
      - name: "--alpha"
        type: double
        description: "Alignment score minimum cutoff"
        default: 0.1
  - name: "Clustering options"
    arguments:
      - name: "--obs_cluster"
        type: string
        description: |
          Prefix for the .obs keys under which to add the cluster labels. Newly created columns in .obs will 
          be created from the specified value for '--obs_cluster' suffixed with an underscore and one of the
          resolutions specified in '--leiden_resolution'.
        default: "scanorama_integration_leiden"
      - name: "--leiden_resolution"
        type: double
        description: Control the coarseness of the clustering. Higher values lead to more clusters.
        multiple: true
        default: [1]
  - name: "Umap options"
    arguments:
      - name: "--obsm_umap"
        type: string
        default: "X_leiden_scanorama_umap"
        required: false
        description: "In which .obsm slot to store the resulting UMAP embedding."
dependencies:
  - name: integrate/scanorama
  - 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
  - type: nextflow_script
    path: test.nf
    entrypoint: test_wf2
  - path: /resources_test/pbmc_1k_protein_v3
runners:
  - type: nextflow
