{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "align_query_reference",
  "description": "Alignment of a query and reference dataset by:\n* Alignment of layers\n* Harmonization of .obs field names for batch and cell type labels\n* Harmonization of .var field name for gene names\n* Sanitation of gene names\n* Cross-checking of genes\n* Assignment of an id to the query and reference datasets\n",
  "type": "object",
  "$defs": {
    "inputs": {
      "title": "Inputs",
      "type": "object",
      "description": "Input dataset (query) arguments",
      "properties": {
        "input": {
          "type": "string",
          "format": "path",
          "exists": true,
          "description": "The input (query) data to be labeled",
          "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 in the input (query) data containing raw counts if .X is not to be used.",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "input_layer_lognormalized": {
          "type": "string",
          "description": "The layer in the input (query) data containing log normalized counts if .X is not to be used.",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "input_var_gene_names": {
          "type": "string",
          "description": "The name of the .var column in the input (query) data containing gene names; when no gene_name_layer is provided, the var index will be used.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "input_obs_batch": {
          "type": "string",
          "description": "The name of the .obs column in the input (query) data containing batch information.\n",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"sample_id\"`. "
        },
        "input_obs_label": {
          "type": "string",
          "description": "The name of the .obs column in the input (query) data containing cell type labels",
          "help_text": "Type: `string`, multiple: `False`, example: `\"cell_type\"`. "
        },
        "input_id": {
          "type": "string",
          "description": "Meta id value to be assigned to the --output_obs_id .obs field of the aligned input (query) data.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"query\"`. ",
          "default": "query"
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "Output arguments.",
      "properties": {
        "output_query": {
          "type": "string",
          "format": "path",
          "description": "Aligned query data.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.output_query.h5mu\"`, direction: `output`, example: `\"output_query.h5mu\"`. ",
          "default": "$id.$key.output_query.h5mu"
        },
        "output_reference": {
          "type": "string",
          "format": "path",
          "description": "Aligned reference data.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.output_reference.h5mu\"`, direction: `output`, example: `\"output_reference.h5mu\"`. ",
          "default": "$id.$key.output_reference.h5mu"
        },
        "output_layer": {
          "type": "string",
          "description": "Name of the aligned layer containing raw counts in the output query and reference datasets.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_counts\"`. ",
          "default": "_counts"
        },
        "output_layer_lognormalized": {
          "type": "string",
          "description": "Name of the aligned layer containing log normalized counts in the output query and reference datasets.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_log_normalized\"`. ",
          "default": "_log_normalized"
        },
        "output_var_gene_names": {
          "type": "string",
          "description": "Name of the .var column in the output query and reference datasets containing the gene names.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_gene_names\"`. ",
          "default": "_gene_names"
        },
        "output_obs_batch": {
          "type": "string",
          "description": "Name of the .obs column in the output query and reference datasets containing the batch information.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_sample_id\"`. ",
          "default": "_sample_id"
        },
        "output_obs_label": {
          "type": "string",
          "description": "Name of the .obs column in the output query and reference datasets containing the cell type labels.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_cell_type\"`. ",
          "default": "_cell_type"
        },
        "output_obs_id": {
          "type": "string",
          "description": "Name of the .obs column in the output query and reference datasets containing the dataset id.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_dataset\"`. ",
          "default": "_dataset"
        },
        "output_var_index": {
          "type": "string",
          "description": "Name of the .var column to which the .var index of the --input and --reference datasets is stored",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_ori_var_index\"`. ",
          "default": "_ori_var_index"
        },
        "output_var_common_genes": {
          "type": "string",
          "description": "Name of the .var column in the output query and reference datasets containing the boolean array indicating the common variables.",
          "help_text": "Type: `string`, multiple: `False`, default: `\"_common_vars\"`. ",
          "default": "_common_vars"
        },
        "output_compression": {
          "type": "string",
          "description": "Compression format to use for the output AnnData and/or Mudata H5 files.\nBy default no compression is applied.\n",
          "help_text": "Type: `string`, multiple: `False`, example: `\"gzip\"`, choices: ``gzip`, `lzf``. ",
          "enum": [
            "gzip",
            "lzf"
          ]
        }
      }
    },
    "arguments": {
      "title": "Arguments",
      "type": "object",
      "description": "Arguments related to the alignment of the input and reference datasets.",
      "properties": {
        "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
        },
        "align_layers_raw_counts": {
          "type": "boolean",
          "description": "Whether to align the query and reference layers containing raw counts.",
          "help_text": "Type: `boolean`, multiple: `False`, default: `true`. ",
          "default": true
        },
        "align_layers_lognormalized_counts": {
          "type": "boolean",
          "description": "Whether to align the query and reference layers containing log normalized counts.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "unkown_celltype_label": {
          "type": "string",
          "description": "The label to assign to cells with an unknown cell type.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"Unknown\"`. ",
          "default": "Unknown"
        },
        "overwrite_existing_key": {
          "type": "boolean",
          "description": "If set to true and the layer, obs or var key already exists in the query/reference file, the key will be overwritten.",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        },
        "preserve_var_index": {
          "type": "boolean",
          "description": "If set to true, the .var index of the --input and --reference datasets will be preserved.\nIf set to false (default behavior), the original .var index will be stored in the --output_var_index .var column and the .var index will be replaced with the sanitized & aligned gene names.\n",
          "help_text": "Type: `boolean_true`, multiple: `False`, default: `false`. ",
          "default": false
        }
      }
    },
    "reference": {
      "title": "Reference",
      "type": "object",
      "description": "Arguments related to the reference dataset.",
      "properties": {
        "reference": {
          "type": "string",
          "format": "path",
          "description": "The reference data to train the CellTypist classifiers on",
          "help_text": "Type: `file`, multiple: `False`, direction: `input`, example: `\"reference.h5mu\"`. "
        },
        "reference_layer": {
          "type": "string",
          "description": "The layer in the reference data containing raw counts if .X is not to be used",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "reference_layer_lognormalized": {
          "type": "string",
          "description": "The layer in the reference data containing log normalized counts if .X is not to be used",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "reference_var_gene_names": {
          "type": "string",
          "description": "The name of the .var column in the reference data containing gene names; when no gene_name_layer is provided, the var index will be used.\n",
          "help_text": "Type: `string`, multiple: `False`. "
        },
        "reference_obs_batch": {
          "type": "string",
          "description": "The name of the .obs column in the reference data containing batch information.\n",
          "help_text": "Type: `string`, multiple: `False`, required, example: `\"sample_id\"`. "
        },
        "reference_obs_label": {
          "type": "string",
          "description": "The name of the .obs column in the reference data containing cell type labels",
          "help_text": "Type: `string`, multiple: `False`, example: `\"cell_type\"`. "
        },
        "reference_id": {
          "type": "string",
          "description": "Meta id value to be assigned to the --output_obs_id .obs field of the aligned reference data.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"reference\"`. ",
          "default": "reference"
        }
      }
    },
    "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/arguments"
    },
    {
      "$ref": "#/$defs/reference"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
