name: "scvi"
namespace: "integrate"
version: "v4.0.4"
authors:
- name: "Malte D. Luecken"
  roles:
  - "author"
  info:
    role: "Core Team Member"
    links:
      email: "malte.luecken@helmholtz-muenchen.de"
      github: "LuckyMD"
      orcid: "0000-0001-7464-7921"
      linkedin: "malte-l%C3%BCcken-b8b21049"
      twitter: "MDLuecken"
    organizations:
    - name: "Helmholtz Munich"
      href: "https://www.helmholtz-munich.de"
      role: "Group Leader"
    - name: "Open Problems"
      href: "https://openproblems.bio"
      role: "Core Member"
- name: "Dries Schaumont"
  roles:
  - "maintainer"
  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"
- name: "Matthias Beyens"
  roles:
  - "contributor"
  info:
    role: "Contributor"
    links:
      github: "MatthiasBeyens"
      orcid: "0000-0003-3304-0706"
      email: "matthias.beyens@gmail.com"
      linkedin: "mbeyens"
    organizations:
    - name: "Janssen Pharmaceuticals"
      href: "https://www.janssen.com"
      role: "Principal Scientist"
argument_groups:
- name: "Inputs"
  arguments:
  - type: "file"
    name: "--input"
    alternatives:
    - "-i"
    description: "Input h5mu file"
    info: null
    must_exist: true
    create_parent: true
    required: true
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--modality"
    description: "Which modality from the input MuData file to process.\n"
    info: null
    default:
    - "rna"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--input_layer"
    description: "Input layer to use. If None, X is used"
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--obs_batch"
    description: "Column name discriminating between your batches."
    info: null
    default:
    - "sample_id"
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--var_gene_names"
    description: ".var column containing gene names. By default, use the index."
    info: null
    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: "string"
    name: "--obs_labels"
    description: "Key in adata.obs for label information. Categories will automatically\
      \ be \nconverted into integer categories and saved to adata.obs['_scvi_labels'].\n\
      If None, assigns the same label to all the data.\n"
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--obs_size_factor"
    description: "Key in adata.obs for size factor information. Instead of using library\
      \ size as a size factor,\nthe provided size factor column will be used as offset\
      \ in the mean of the likelihood.\nAssumed to be on linear scale.\n"
    info: null
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--obs_categorical_covariate"
    description: "Keys in adata.obs that correspond to categorical data. These covariates\
      \ can be added in\naddition to the batch covariate and are also treated as nuisance\
      \ factors\n(i.e., the model tries to minimize their effects on the latent space).\n\
      Thus, these should not be used for biologically-relevant factors that you do\
      \ _not_ want to correct for.\n"
    info: null
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "string"
    name: "--obs_continuous_covariate"
    description: "Keys in adata.obs that correspond to continuous data. These covariates\
      \ can be added in\naddition to the batch covariate and are also treated as nuisance\
      \ factors\n(i.e., the model tries to minimize their effects on the latent space).\
      \ Thus, these should not be\nused for biologically-relevant factors that you\
      \ do _not_ want to correct for.\n"
    info: null
    required: false
    direction: "input"
    multiple: true
    multiple_sep: ";"
  - type: "boolean"
    name: "--sanitize_ensembl_ids"
    description: "Whether to sanitize ensembl ids by removing version numbers."
    info: null
    default:
    - true
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Outputs"
  arguments:
  - type: "file"
    name: "--output"
    alternatives:
    - "-o"
    description: "Output h5mu file."
    info: null
    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
    must_exist: true
    create_parent: true
    required: false
    direction: "output"
    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: "--output_compression"
    description: "Compression format to use for the output AnnData and/or Mudata objects.\n\
      By default no compression is applied.\n"
    info: null
    example:
    - "gzip"
    required: false
    choices:
    - "gzip"
    - "lzf"
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "SCVI options"
  arguments:
  - type: "integer"
    name: "--n_hidden_nodes"
    description: "Number of nodes per hidden layer."
    info: null
    default:
    - 128
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--n_dimensions_latent_space"
    description: "Dimensionality of the latent space."
    info: null
    default:
    - 30
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--n_hidden_layers"
    description: "Number of hidden layers used for encoder and decoder neural-networks."
    info: null
    default:
    - 2
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "double"
    name: "--dropout_rate"
    description: "Dropout rate for the neural networks."
    info: null
    default:
    - 0.1
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--dispersion"
    description: "Set the behavior for the dispersion for negative binomial distributions:\n\
      - gene: dispersion parameter of negative binomial is constant per gene across\
      \ cells\n- gene-batch: dispersion can differ between different batches\n- gene-label:\
      \ dispersion can differ between different labels\n- gene-cell:  dispersion can\
      \ differ for every gene in every cell\n"
    info: null
    default:
    - "gene"
    required: false
    choices:
    - "gene"
    - "gene-batch"
    - "gene-label"
    - "gene-cell"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--gene_likelihood"
    description: "Model used to generate the expression data from a count-based likelihood\
      \ distribution.\n- nb: Negative binomial distribution\n- zinb: Zero-inflated\
      \ negative binomial distribution\n- poisson: Poisson distribution\n"
    info: null
    default:
    - "nb"
    required: false
    choices:
    - "nb"
    - "zinb"
    - "poisson"
    direction: "input"
    multiple: false
    multiple_sep: ";"
- name: "Variational auto-encoder model options"
  arguments:
  - type: "string"
    name: "--use_layer_normalization"
    description: "Neural networks for which to enable layer normalization. \n"
    info: null
    default:
    - "both"
    required: false
    choices:
    - "encoder"
    - "decoder"
    - "none"
    - "both"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "string"
    name: "--use_batch_normalization"
    description: "Neural networks for which to enable batch normalization. \n"
    info: null
    default:
    - "none"
    required: false
    choices:
    - "encoder"
    - "decoder"
    - "none"
    - "both"
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "boolean_false"
    name: "--encode_covariates"
    description: "Whether to concatenate covariates to expression in encoder"
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--deeply_inject_covariates"
    description: "Whether to concatenate covariates into output of hidden layers in\
      \ encoder/decoder. \nThis option only applies when n_layers > 1. The covariates\
      \ are concatenated to\nthe input of subsequent hidden layers.\n"
    info: null
    direction: "input"
  - type: "boolean_true"
    name: "--use_observed_lib_size"
    description: "Use observed library size for RNA as scaling factor in mean of conditional\
      \ distribution.\n"
    info: null
    direction: "input"
- name: "Early stopping arguments"
  arguments:
  - 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: ";"
- name: "Learning parameters"
  arguments:
  - 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: "Data validition"
  arguments:
  - type: "integer"
    name: "--n_obs_min_count"
    description: "Minimum number of cells threshold ensuring that every obs_batch\
      \ category has sufficient observations (cells) for model training."
    info: null
    default:
    - 0
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
  - type: "integer"
    name: "--n_var_min_count"
    description: "Minimum number of genes threshold ensuring that every var_input\
      \ filter has sufficient observations (genes) for model training."
    info: null
    default:
    - 0
    required: false
    direction: "input"
    multiple: false
    multiple_sep: ";"
resources:
- type: "python_script"
  path: "script.py"
  is_executable: true
- type: "file"
  path: "subset_vars.py"
- type: "file"
  path: "compress_h5mu.py"
- type: "file"
  path: "set_var_index.py"
- type: "file"
  path: "nextflow_labels.config"
  dest: "nextflow_labels.config"
description: "Performs scvi integration as done in the human lung cell atlas https://github.com/LungCellAtlas/HLCA"
test_resources:
- type: "python_script"
  path: "test.py"
  is_executable: true
- type: "file"
  path: "pbmc_1k_protein_v3_mms.h5mu"
- type: "file"
  path: "TS_Blood_filtered.h5mu"
info: null
status: "enabled"
scope:
  image: "public"
  target: "public"
license: "MIT"
links:
  repository: "https://github.com/openpipelines-bio/openpipeline"
  docker_registry: "ghcr.io"
runners:
- type: "executable"
  id: "executable"
  docker_setup_strategy: "ifneedbepullelsecachedbuild"
- type: "nextflow"
  id: "nextflow"
  directives:
    label:
    - "midcpu"
    - "midmem"
    - "gpu"
    - "highdisk"
    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"
engines:
- type: "docker"
  id: "docker"
  image: "pytorch/pytorch:2.9.1-cuda12.8-cudnn9-runtime"
  target_registry: "images.viash-hub.com"
  target_tag: "v4.0.4"
  namespace_separator: "/"
  setup:
  - type: "python"
    user: false
    packages:
    - "anndata~=0.12.7"
    - "awkward"
    - "mudata~=0.3.2"
    - "scanpy~=1.11.4"
    script:
    - "exec(\"try:\\n  import zarr; from importlib.metadata import version\\nexcept\
      \ ModuleNotFoundError:\\n  exit(0)\\nelse:  assert int(version(\\\"zarr\\\"\
      ).partition(\\\".\\\")[0]) > 2\")"
    upgrade: true
  - type: "python"
    user: false
    packages:
    - "scvi-tools[cuda]~=1.4.1"
    upgrade: true
  test_setup:
  - type: "python"
    user: false
    packages:
    - "viashpy==0.8.0"
    upgrade: true
  entrypoint: []
  cmd: null
- type: "native"
  id: "native"
build_info:
  config: "src/integrate/scvi/config.vsh.yaml"
  runner: "nextflow"
  engine: "docker|native"
  output: "target/nextflow/integrate/scvi"
  executable: "target/nextflow/integrate/scvi/main.nf"
  viash_version: "0.9.4"
  git_commit: "fb7dc76676aa63d06ae1421bbdd6312ad4f67312"
  git_remote: "https://github.com/openpipelines-bio/openpipeline"
package_config:
  name: "openpipeline"
  version: "v4.0.4"
  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\"\
    )'"
  - ".engines += { type: \"native\" }"
  - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'"
  - ".engines[.type == 'docker'].target_tag := 'v4.0.4'"
  keywords:
  - "single-cell"
  - "multimodal"
  license: "MIT"
  organization: "vsh"
  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"
