name: "scvi_leiden"
namespace: "workflows/integration"
version: "3.0.0"
authors:
- name: "Dries Schaumont"
  roles:
  - "author"
  info:
    role: "Core Team Member"
    links:
      email: "dries@data-intuitive.com"
      github: "DriesSchaumont"
      orcid: "0000-0002-4389-0440"
      linkedin: "dries-schaumont"
    organizations:
    - name: "Data Intuitive"
      href: "https://www.data-intuitive.com"
      role: "Data Scientist"
argument_groups:
- name: "Inputs"
  arguments:
  - type: "string"
    name: "--id"
    description: "ID of the sample."
    info: null
    example:
    - "foo"
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--input"
    description: "Path to the sample."
    info: null
    example:
    - "dataset.h5mu"
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--layer"
    description: "use specified layer for expression values instead of the .X object\
      \ from the modality."
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--modality"
    description: "Which modality to process."
    info: null
    default:
    - "rna"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Outputs"
  arguments:
  - type: "file"
    name: "--output"
    description: "Destination path to the output."
    info: null
    example:
    - "output.h5mu"
    must_exist: true
    create_parent: true
    required: true
    direction: "output"
    multiple: false
    multiple_sep: ";"
  - type: "file"
    name: "--output_model"
    description: "Folder where the state of the trained model will be saved to."
    info: null
    example:
    - "output_dir"
    must_exist: true
    create_parent: true
    required: true
    direction: "output"
    multiple: false
    multiple_sep: ";"
- name: "Neighbour calculation"
  arguments:
  - type: "string"
    name: "--uns_neighbors"
    description: "In which .uns slot to store various neighbor output objects."
    info: null
    default:
    - "scvi_integration_neighbors"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--obsp_neighbor_distances"
    description: "In which .obsp slot to store the distance matrix between the resulting\
      \ neighbors."
    info: null
    default:
    - "scvi_integration_distances"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--obsp_neighbor_connectivities"
    description: "In which .obsp slot to store the connectivities matrix between the\
      \ resulting neighbors."
    info: null
    default:
    - "scvi_integration_connectivities"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Scvi integration options"
  arguments:
  - type: "string"
    name: "--obs_batch"
    description: "Column name discriminating between your batches."
    info: null
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--obsm_output"
    description: "In which .obsm slot to store the resulting integrated embedding."
    info: null
    default:
    - "X_scvi_integrated"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--var_input"
    description: ".var column containing highly variable genes. By default, do not\
      \ subset genes."
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean"
    name: "--early_stopping"
    description: "Whether to perform early stopping with respect to the validation\
      \ set."
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--early_stopping_monitor"
    description: "Metric logged during validation set epoch."
    info: null
    default:
    - "elbo_validation"
    required: false
    choices:
    - "elbo_validation"
    - "reconstruction_loss_validation"
    - "kl_local_validation"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--early_stopping_patience"
    description: "Number of validation epochs with no improvement after which training\
      \ will be stopped."
    info: null
    default:
    - 45
    required: false
    min: 1
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "double"
    name: "--early_stopping_min_delta"
    description: "Minimum change in the monitored quantity to qualify as an improvement,\
      \ i.e. an absolute change of less than min_delta, will count as no improvement."
    info: null
    default:
    - 0.0
    required: false
    min: 0.0
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--max_epochs"
    description: "Number of passes through the dataset, defaults to (20000 / number\
      \ of cells) * 400 or 400; whichever is smallest."
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean"
    name: "--reduce_lr_on_plateau"
    description: "Whether to monitor validation loss and reduce learning rate when\
      \ validation set `lr_scheduler_metric` plateaus."
    info: null
    default:
    - true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "double"
    name: "--lr_factor"
    description: "Factor to reduce learning rate."
    info: null
    default:
    - 0.6
    required: false
    min: 0.0
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "double"
    name: "--lr_patience"
    description: "Number of epochs with no improvement after which learning rate will\
      \ be reduced."
    info: null
    default:
    - 30.0
    required: false
    min: 0.0
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Clustering options"
  arguments:
  - type: "string"
    name: "--obs_cluster"
    description: "Prefix for the .obs keys under which to add the cluster labels.\
      \ Newly created columns in .obs will \nbe created from the specified value for\
      \ '--obs_cluster' suffixed with an underscore and one of the resolutions\nresolutions\
      \ specified in '--leiden_resolution'.\n"
    info: null
    default:
    - "scvi_integration_leiden"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "double"
    name: "--leiden_resolution"
    description: "Control the coarseness of the clustering. Higher values lead to\
      \ more clusters."
    info: null
    default:
    - 1.0
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
- name: "Umap options"
  arguments:
  - type: "string"
    name: "--obsm_umap"
    description: "In which .obsm slot to store the resulting UMAP embedding."
    info: null
    default:
    - "X_scvi_umap"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
resources:
- type: "nextflow_script"
  path: "main.nf"
  is_executable: true
  entrypoint: "run_wf"
- type: "file"
  path: "utils"
- type: "file"
  path: "nextflow_labels.config"
  dest: "nextflow_labels.config"
description: "Run scvi integration followed by neighbour calculations, leiden clustering\
  \ and run umap on the result."
test_resources:
- type: "nextflow_script"
  path: "test.nf"
  is_executable: true
  entrypoint: "test_wf"
- type: "file"
  path: "pbmc_1k_protein_v3"
info: null
status: "enabled"
scope:
  image: "public"
  target: "public"
dependencies:
- name: "integrate/scvi"
  repository:
    type: "local"
- name: "workflows/multiomics/neighbors_leiden_umap"
  repository:
    type: "local"
license: "MIT"
links:
  repository: "https://github.com/openpipelines-bio/openpipeline"
  docker_registry: "ghcr.io"
runners:
- type: "nextflow"
  id: "nextflow"
  directives:
    tag: "$id"
  auto:
    simplifyInput: true
    simplifyOutput: false
    transcript: false
    publish: false
  config:
    labels:
      mem1gb: "memory = 1000000000.B"
      mem2gb: "memory = 2000000000.B"
      mem5gb: "memory = 5000000000.B"
      mem10gb: "memory = 10000000000.B"
      mem20gb: "memory = 20000000000.B"
      mem50gb: "memory = 50000000000.B"
      mem100gb: "memory = 100000000000.B"
      mem200gb: "memory = 200000000000.B"
      mem500gb: "memory = 500000000000.B"
      mem1tb: "memory = 1000000000000.B"
      mem2tb: "memory = 2000000000000.B"
      mem5tb: "memory = 5000000000000.B"
      mem10tb: "memory = 10000000000000.B"
      mem20tb: "memory = 20000000000000.B"
      mem50tb: "memory = 50000000000000.B"
      mem100tb: "memory = 100000000000000.B"
      mem200tb: "memory = 200000000000000.B"
      mem500tb: "memory = 500000000000000.B"
      mem1gib: "memory = 1073741824.B"
      mem2gib: "memory = 2147483648.B"
      mem4gib: "memory = 4294967296.B"
      mem8gib: "memory = 8589934592.B"
      mem16gib: "memory = 17179869184.B"
      mem32gib: "memory = 34359738368.B"
      mem64gib: "memory = 68719476736.B"
      mem128gib: "memory = 137438953472.B"
      mem256gib: "memory = 274877906944.B"
      mem512gib: "memory = 549755813888.B"
      mem1tib: "memory = 1099511627776.B"
      mem2tib: "memory = 2199023255552.B"
      mem4tib: "memory = 4398046511104.B"
      mem8tib: "memory = 8796093022208.B"
      mem16tib: "memory = 17592186044416.B"
      mem32tib: "memory = 35184372088832.B"
      mem64tib: "memory = 70368744177664.B"
      mem128tib: "memory = 140737488355328.B"
      mem256tib: "memory = 281474976710656.B"
      mem512tib: "memory = 562949953421312.B"
      cpu1: "cpus = 1"
      cpu2: "cpus = 2"
      cpu5: "cpus = 5"
      cpu10: "cpus = 10"
      cpu20: "cpus = 20"
      cpu50: "cpus = 50"
      cpu100: "cpus = 100"
      cpu200: "cpus = 200"
      cpu500: "cpus = 500"
      cpu1000: "cpus = 1000"
    script:
    - "includeConfig(\"nextflow_labels.config\")"
  debug: false
  container: "docker"
build_info:
  config: "src/workflows/integration/scvi_leiden/config.vsh.yaml"
  runner: "nextflow"
  engine: "native"
  output: "target/nextflow/workflows/integration/scvi_leiden"
  executable: "target/nextflow/workflows/integration/scvi_leiden/main.nf"
  viash_version: "0.9.4"
  git_commit: "706b5ce24d313dcf947b7d9fe929630f1ad204e7"
  git_remote: "https://github.com/openpipelines-bio/openpipeline"
  git_tag: "2.1.0-2-g706b5ce24d3"
  dependencies:
  - "target/nextflow/integrate/scvi"
  - "target/nextflow/workflows/multiomics/neighbors_leiden_umap"
package_config:
  name: "openpipeline"
  summary: "Best-practice workflows for single-cell multi-omics analyses.\n"
  description: "OpenPipelines are extensible single cell analysis pipelines for reproducible\
    \ and large-scale single cell processing using [Viash](https://viash.io) and [Nextflow](https://www.nextflow.io/).\n\
    \nIn terms of workflows, the following has been made available, but keep in mind\
    \ that\nindividual tools and functionality can be executed as standalone components\
    \ as well.\n\n  * Demultiplexing: conversion of raw sequencing data to FASTQ objects.\n\
    \  * Ingestion: Read mapping and generating a count matrix.\n  * Single sample\
    \ processing: cell filtering and doublet detection.\n  * Multisample processing:\
    \ Count transformation, normalization, QC metric calulations.\n  * Integration:\
    \ Clustering, integration and batch correction using single and multimodal methods.\n\
    \  * Downstream analysis workflows\n"
  info:
    test_resources:
    - type: "s3"
      path: "s3://openpipelines-data"
      dest: "resources_test"
    nextflow_labels_ci:
    - path: "src/workflows/utils/labels_ci.config"
      description: "Adds the correct memory and CPU labels when running on the Viash\
        \ Hub CI."
  viash_version: "0.9.4"
  source: "src"
  target: "target"
  config_mods:
  - ".resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n\
    .runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\
    )'"
  - ".version := \"3.0.0\""
  keywords:
  - "single-cell"
  - "multimodal"
  license: "MIT"
  organization: "openpipelines-bio"
  links:
    repository: "https://github.com/openpipelines-bio/openpipeline"
    docker_registry: "ghcr.io"
    homepage: "https://openpipelines.bio"
    documentation: "https://openpipelines.bio/fundamentals"
    issue_tracker: "https://github.com/openpipelines-bio/openpipeline/issues"
