{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "harmony_knn",
  "description": "Cell type annotation workflow by performing harmony integration of reference and query dataset followed by KNN label transfer.",
  "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": "array",
          "items": {
            "type": "string"
          },
          "description": "In which `.obs` slots to store the predicted cell labels.\nIf provided, must have the same length as `--reference_obs_targets`.\nIf empty, will default to the `reference_obs_targets` combined with the `\"_pred\"` suffix.\n",
          "help_text": "Type: `string`, multiple: `True`. "
        },
        "output_obs_probability": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "In which `.obs` slots to store the probability of the predictions.\nIf provided, must have the same length as `--reference_obs_targets`.\nIf empty, will default to the `reference_obs_targets` combined with the `\"_probability\"` suffix.\n",
          "help_text": "Type: `string`, multiple: `True`. "
        },
        "output_obsm_integrated": {
          "type": "string",
          "description": "In which .obsm slot to store the integrated embedding.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"X_integrated_harmony\"`. ",
          "default": "X_integrated_harmony"
        },
        "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"
          ]
        }
      }
    },
    "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"
        },
        "input_layer": {
          "type": "string",
          "description": "The layer of the input dataset to process 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_var_gene_names": {
          "type": "string",
          "description": "The .var field in the input (query) dataset containing gene names; if not provided, the .var index will be used.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "input_reference_gene_overlap": {
          "type": "integer",
          "description": "The minimum number of genes present in both the reference and query datasets.\n",
          "help_text": "Type: `integer`, multiple: `False`, default: `100`. ",
          "default": 100
        },
        "overwrite_existing_key": {
          "type": "boolean",
          "description": "If provided, will overwrite existing fields in the input dataset when data are copied during the reference alignment process.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "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_layer": {
          "type": "string",
          "description": "The layer of the reference dataset to process if .X is not to be used",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "reference_obs_target": {
          "type": "string",
          "description": "The `.obs` key of the target cell type labels to transfer.",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"cell_type\"`. "
        },
        "reference_var_gene_names": {
          "type": "string",
          "description": "The .var field in the reference dataset containing gene names; if not provided, the .var index will be used.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "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\"`. "
        }
      }
    },
    "hvg subset arguments": {
      "title": "HVG subset arguments",
      "type": "object",
      "description": "No description",
      "properties": {
        "n_hvg": {
          "type": "integer",
          "description": "Number of highly variable genes to subset for.\n",
          "help_text": "Type: `integer`, multiple: `False`, default: `2000`. ",
          "default": 2000
        }
      }
    },
    "pca options": {
      "title": "PCA options",
      "type": "object",
      "description": "No description",
      "properties": {
        "pca_num_components": {
          "type": "integer",
          "description": "Number of principal components to compute",
          "help_text": "Type: `integer`, multiple: `False`, example: `25`. "
        }
      }
    },
    "harmony integration options": {
      "title": "Harmony integration options",
      "type": "object",
      "description": "No description",
      "properties": {
        "harmony_theta": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "Diversity clustering penalty parameter",
          "help_text": "Type: `double`, multiple: `True`, default: `[2.0]`. ",
          "default": [
            2.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/hvg subset arguments"
    },
    {
      "$ref": "#/$defs/pca options"
    },
    {
      "$ref": "#/$defs/harmony integration options"
    },
    {
      "$ref": "#/$defs/leiden clustering options"
    },
    {
      "$ref": "#/$defs/neighbor classifier arguments"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
