{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "scanvi_scarches",
  "description": "Cell type annotation workflow using ScanVI with scArches for reference mapping.",
  "type": "object",
  "$defs": {
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "The query data in .h5mu format with predicted labels predicted from the classifier trained on the reference.",
          "help_text": "Type: `file`, multiple: `False`, required, default: `\"$id.$key.output.h5mu\"`, direction: `output`, example: `\"output.h5mu\"`. ",
          "default": "$id.$key.output.h5mu"
        },
        "output_obs_predictions": {
          "type": "string",
          "description": "In which .obs slot to store the predicted labels.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"scanvi_pred\"`. ",
          "default": "scanvi_pred"
        },
        "output_obs_probability": {
          "type": "string",
          "description": "In which",
          "help_text": "Type: `string`, multiple: `False`, default: `\"scanvi_probabilities\"`. ",
          "default": "scanvi_probabilities"
        },
        "output_obsm_integrated": {
          "type": "string",
          "description": "In which .obsm slot to store the integrated embedding.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"X_integrated_scanvi\"`. ",
          "default": "X_integrated_scanvi"
        },
        "output_compression": {
          "type": "string",
          "description": "The compression format to be used on the output h5mu object.\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"gzip\"`, choices: ``gzip`, `lzf``. ",
          "enum": [
            "gzip",
            "lzf"
          ]
        },
        "output_model": {
          "type": "string",
          "format": "path",
          "description": "Path to the resulting scANVI model that was updated with query data.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.output_model\"`, direction: `output`. ",
          "default": "$id.$key.output_model"
        }
      }
    },
    "query input": {
      "title": "Query Input",
      "type": "object",
      "description": "No description",
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of the sample.",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"foo\"`. "
        },
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Input dataset consisting of the (unlabeled) query observations",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"input.h5mu\"`. "
        },
        "modality": {
          "type": "string",
          "description": "Which modality to process",
          "help_text": "Type: `string`, multiple: `False`, default: `\"rna\"`. ",
          "default": "rna"
        },
        "layer": {
          "type": "string",
          "description": "Which layer to use for integration if .X is not to be used",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "input_obs_batch_label": {
          "type": "string",
          "description": "The .obs field in the input (query) dataset containing the batch labels.",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"sample\"`. "
        },
        "input_obs_size_factor": {
          "type": "string",
          "description": "Key in adata.obs for size factor information",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "input_obs_categorical_covariate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys in adata.obs that correspond to categorical data",
          "help_text": "Type: `string`, multiple: `True`. "
        },
        "input_obs_continuous_covariate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys in adata.obs that correspond to continuous data",
          "help_text": "Type: `string`, multiple: `True`. "
        },
        "input_var_gene_names": {
          "type": "string",
          "description": ".var column containing gene names",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "sanitize_ensembl_ids": {
          "type": "boolean",
          "description": "Whether to sanitize ensembl ids by removing version numbers.",
          "help_text": "Type: `boolean`, multiple: `False`, default: `true`. ",
          "default": true
        }
      }
    },
    "reference input": {
      "title": "Reference input",
      "type": "object",
      "description": "No description",
      "properties": {
        "reference": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "Reference dataset consisting of the labeled observations to train the KNN classifier on",
          "help_text": "Type: `file`, multiple: `False`, required, direction: `input`, example: `\"reference.h5mu\"`. "
        },
        "reference_obs_target": {
          "type": "string",
          "description": "The `.obs` key containing the target labels.",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"cell_type\"`. "
        },
        "reference_obs_batch_label": {
          "type": "string",
          "description": "The .obs field in the reference dataset containing the batch labels.",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"sample\"`. "
        },
        "reference_obs_size_factor": {
          "type": "string",
          "description": "Key in adata.obs for size factor information",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "reference_obs_categorical_covariate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys in adata.obs that correspond to categorical data",
          "help_text": "Type: `string`, multiple: `True`. "
        },
        "reference_obs_continuous_covariate": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys in adata.obs that correspond to continuous data",
          "help_text": "Type: `string`, multiple: `True`. "
        },
        "unlabeled_category": {
          "type": "string",
          "description": "Value in the --reference_obs_batch_label field that indicates unlabeled observations\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"Unknown\"`. ",
          "default": "Unknown"
        },
        "reference_var_hvg": {
          "type": "string",
          "description": ".var column containing highly variable genes",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "reference_var_gene_names": {
          "type": "string",
          "description": ".var column containing gene names",
          "help_text": "Type: `string`, multiple: `False`. "
        }
      }
    },
    "scvi, scanvi and scarches training options": {
      "title": "scVI, scANVI and scArches training options",
      "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
        },
        "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
        }
      }
    },
    "leiden clustering options": {
      "title": "Leiden clustering options",
      "type": "object",
      "description": "No description",
      "properties": {
        "leiden_resolution": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "Control the coarseness of the clustering",
          "help_text": "Type: `double`, multiple: `True`, default: `[1.0]`. ",
          "default": [
            1.0
          ]
        }
      }
    },
    "neighbor classifier arguments": {
      "title": "Neighbor classifier arguments",
      "type": "object",
      "description": "No description",
      "properties": {
        "knn_weights": {
          "type": "string",
          "description": "Weight function used in prediction",
          "help_text": "Type: `string`, multiple: `False`, default: `\"uniform\"`, choices: ``uniform`, `distance``. ",
          "enum": [
            "uniform",
            "distance"
          ],
          "default": "uniform"
        },
        "knn_n_neighbors": {
          "type": "integer",
          "description": "The number of neighbors to use in k-neighbor graph structure used for fast approximate nearest neighbor search with PyNNDescent",
          "help_text": "Type: `integer`, multiple: `False`, default: `15`. ",
          "default": 15
        }
      }
    },
    "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/outputs"
    },
    {
      "$ref": "#/$defs/query input"
    },
    {
      "$ref": "#/$defs/reference input"
    },
    {
      "$ref": "#/$defs/scvi, scanvi and scarches training options"
    },
    {
      "$ref": "#/$defs/leiden clustering options"
    },
    {
      "$ref": "#/$defs/neighbor classifier arguments"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
