{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "scvi",
  "description": "Performs scvi integration as done in the human lung cell atlas https://github.com/LungCellAtlas/HLCA",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input h5mu file",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`. "
        },
        "modality": {
          "type": "string",
          "description": "Which modality from the input MuData file to process.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"rna\"`. ",
          "default": "rna"
        },
        "input_layer": {
          "type": "string",
          "description": "Input layer to use",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "obs_batch": {
          "type": "string",
          "description": "Column name discriminating between your batches.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"sample_id\"`. ",
          "default": "sample_id"
        },
        "var_gene_names": {
          "type": "string",
          "description": ".var column containing gene names",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "var_input": {
          "type": "string",
          "description": ".var column containing highly variable genes",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "obs_labels": {
          "type": "string",
          "description": "Key in adata.obs for label information",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "obs_size_factor": {
          "type": "string",
          "description": "Key in adata.obs for size factor information",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "obs_categorical_covariate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys in adata.obs that correspond to categorical data",
          "help_text": "Type: `string`, multiple: `True`. "
        },
        "obs_continuous_covariate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys in adata.obs that correspond to continuous data",
          "help_text": "Type: `string`, multiple: `True`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output h5mu file.",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output\"`, direction: `output`. ",
          "default": "$id.$key.output"
        },
        "output_model": {
          "type": "string",
          "format": "path",
          "description": "Folder where the state of the trained model will be saved to.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.output_model\"`, direction: `output`. ",
          "default": "$id.$key.output_model"
        },
        "obsm_output": {
          "type": "string",
          "description": "In which .obsm slot to store the resulting integrated embedding.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"X_scvi_integrated\"`. ",
          "default": "X_scvi_integrated"
        },
        "output_compression": {
          "type": "string",
          "description": "Compression format to use for the output AnnData and/or Mudata objects.\nBy default no compression is applied.\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"gzip\"`, choices: ``gzip`, `lzf``. ",
          "enum": [
            "gzip",
            "lzf"
          ]
        }
      }
    },
    "scvi options": {
      "title": "SCVI options",
      "type": "object",
      "description": "No description",
      "properties": {
        "n_hidden_nodes": {
          "type": "integer",
          "description": "Number of nodes per hidden layer.",
          "help_text": "Type: `integer`, multiple: `False`, default: `128`. ",
          "default": 128
        },
        "n_dimensions_latent_space": {
          "type": "integer",
          "description": "Dimensionality of the latent space.",
          "help_text": "Type: `integer`, multiple: `False`, default: `30`. ",
          "default": 30
        },
        "n_hidden_layers": {
          "type": "integer",
          "description": "Number of hidden layers used for encoder and decoder neural-networks.",
          "help_text": "Type: `integer`, multiple: `False`, default: `2`. ",
          "default": 2
        },
        "dropout_rate": {
          "type": "number",
          "description": "Dropout rate for the neural networks.",
          "help_text": "Type: `double`, multiple: `False`, default: `0.1`. ",
          "default": 0.1
        },
        "dispersion": {
          "type": "string",
          "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",
          "help_text": "Type: `string`, multiple: `False`, default: `\"gene\"`, choices: ``gene`, `gene-batch`, `gene-label`, `gene-cell``. ",
          "enum": [
            "gene",
            "gene-batch",
            "gene-label",
            "gene-cell"
          ],
          "default": "gene"
        },
        "gene_likelihood": {
          "type": "string",
          "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",
          "help_text": "Type: `string`, multiple: `False`, default: `\"nb\"`, choices: ``nb`, `zinb`, `poisson``. ",
          "enum": [
            "nb",
            "zinb",
            "poisson"
          ],
          "default": "nb"
        }
      }
    },
    "variational auto-encoder model options": {
      "title": "Variational auto-encoder model options",
      "type": "object",
      "description": "No description",
      "properties": {
        "use_layer_normalization": {
          "type": "string",
          "description": "Neural networks for which to enable layer normalization",
          "help_text": "Type: `string`, multiple: `False`, default: `\"both\"`, choices: ``encoder`, `decoder`, `none`, `both``. ",
          "enum": [
            "encoder",
            "decoder",
            "none",
            "both"
          ],
          "default": "both"
        },
        "use_batch_normalization": {
          "type": "string",
          "description": "Neural networks for which to enable batch normalization",
          "help_text": "Type: `string`, multiple: `False`, default: `\"none\"`, choices: ``encoder`, `decoder`, `none`, `both``. ",
          "enum": [
            "encoder",
            "decoder",
            "none",
            "both"
          ],
          "default": "none"
        },
        "encode_covariates": {
          "type": "boolean",
          "description": "Whether to concatenate covariates to expression in encoder",
          "help_text": "Type: `boolean_false`, multiple: `False`, default: `true`. ",
          "default": true
        },
        "deeply_inject_covariates": {
          "type": "boolean",
          "description": "Whether to concatenate covariates into output of hidden layers in encoder/decoder",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "use_observed_lib_size": {
          "type": "boolean",
          "description": "Use observed library size for RNA as scaling factor in mean of conditional distribution.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "early stopping arguments": {
      "title": "Early stopping arguments",
      "type": "object",
      "description": "No description",
      "properties": {
        "early_stopping": {
          "type": "boolean",
          "description": "Whether to perform early stopping with respect to the validation set.",
          "help_text": "Type: `boolean`, multiple: `False`. "
        },
        "early_stopping_monitor": {
          "type": "string",
          "description": "Metric logged during validation set epoch.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"elbo_validation\"`, choices: ``elbo_validation`, `reconstruction_loss_validation`, `kl_local_validation``. ",
          "enum": [
            "elbo_validation",
            "reconstruction_loss_validation",
            "kl_local_validation"
          ],
          "default": "elbo_validation"
        },
        "early_stopping_patience": {
          "type": "integer",
          "description": "Number of validation epochs with no improvement after which training will be stopped.",
          "help_text": "Type: `integer`, multiple: `False`, default: `45`. ",
          "default": 45
        },
        "early_stopping_min_delta": {
          "type": "number",
          "description": "Minimum change in the monitored quantity to qualify as an improvement, i.e",
          "help_text": "Type: `double`, multiple: `False`, default: `0.0`. ",
          "default": 0.0
        }
      }
    },
    "learning parameters": {
      "title": "Learning parameters",
      "type": "object",
      "description": "No description",
      "properties": {
        "max_epochs": {
          "type": "integer",
          "description": "Number of passes through the dataset, defaults to (20000 / number of cells) * 400 or 400; whichever is smallest.",
          "help_text": "Type: `integer`, multiple: `False`. "
        },
        "reduce_lr_on_plateau": {
          "type": "boolean",
          "description": "Whether to monitor validation loss and reduce learning rate when validation set `lr_scheduler_metric` plateaus.",
          "help_text": "Type: `boolean`, multiple: `False`, default: `true`. ",
          "default": true
        },
        "lr_factor": {
          "type": "number",
          "description": "Factor to reduce learning rate.",
          "help_text": "Type: `double`, multiple: `False`, default: `0.6`. ",
          "default": 0.6
        },
        "lr_patience": {
          "type": "number",
          "description": "Number of epochs with no improvement after which learning rate will be reduced.",
          "help_text": "Type: `double`, multiple: `False`, default: `30.0`. ",
          "default": 30.0
        }
      }
    },
    "data validition": {
      "title": "Data validition",
      "type": "object",
      "description": "No description",
      "properties": {
        "n_obs_min_count": {
          "type": "integer",
          "description": "Minimum number of cells threshold ensuring that every obs_batch category has sufficient observations (cells) for model training.",
          "help_text": "Type: `integer`, multiple: `False`, default: `0`. ",
          "default": 0
        },
        "n_var_min_count": {
          "type": "integer",
          "description": "Minimum number of genes threshold ensuring that every var_input filter has sufficient observations (genes) for model training.",
          "help_text": "Type: `integer`, multiple: `False`, default: `0`. ",
          "default": 0
        }
      }
    },
    "nextflow input-output arguments": {
      "title": "Nextflow input-output arguments",
      "type": "object",
      "description": "Input/output parameters for Nextflow itself. Please note that both publishDir and publish_dir are supported but at least one has to be configured.",
      "properties": {
        "publish_dir": {
          "type": "string",
          "description": "Path to an output directory.",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"output/\"`. "
        }
      }
    }
  },
  "allOf": [
    {
      "$ref": "#/$defs/inputs"
    },
    {
      "$ref": "#/$defs/outputs"
    },
    {
      "$ref": "#/$defs/scvi options"
    },
    {
      "$ref": "#/$defs/variational auto-encoder model options"
    },
    {
      "$ref": "#/$defs/early stopping arguments"
    },
    {
      "$ref": "#/$defs/learning parameters"
    },
    {
      "$ref": "#/$defs/data validition"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
