{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "calculate_qc_metrics",
  "description": "Add basic quality control metrics to an .h5mu file.\n\nThe metrics are comparable to what scanpy.pp.calculate_qc_metrics output,\nalthough they have slightly different names:\n\nVar metrics (name in this component -> name in scanpy):\n  - pct_dropout -> pct_dropout_by_{expr_type}\n  - num_nonzero_obs -> n_cells_by_{expr_type}\n  - obs_mean -> mean_{expr_type}\n  - total_counts -> total_{expr_type}\n\n  Obs metrics:\n    - num_nonzero_vars -> n_genes_by_{expr_type}\n    - pct_{var_qc_metrics} -> pct_{expr_type}_{qc_var}\n    - total_counts_{var_qc_metrics} -> total_{expr_type}_{qc_var}\n    - pct_of_counts_in_top_{top_n_vars}_vars -> pct_{expr_type}_in_top_{n}_{var_type}\n    - total_counts -> total_{expr_type}\n    \n",
  "type": "object",
  "$defs": {
    "Dataset input": {
      "title": "Dataset input",
      "type": "object",
      "description": "Dataset input using nf-tower \"dataset\" or \"data explorer\". Allows for the input of multiple         parameter sets to initialise a Nextflow channel.",
      "properties": {
        "param_list": {
          "description": "Dataset input can either be a list of maps, a csv file, a json file, a yaml file, or simply a yaml                 blob. The names of the input fields (e.g. csv columns, json keys) need to be an exact match with the workflow input parameters.",
          "type": "string",
          "default": "",
          "format": "file-path",
          "mimetype": "text/csv"
        }
      }
    },
    "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`, example: `\"input.h5mu\"`. "
        },
        "modality": {
          "type": "string",
          "description": "Which modality from the input MuData file to process",
          "help_text": "Type: `string`, multiple: `False`, default: `\"rna\"`. ",
          "default": "rna"
        },
        "layer": {
          "type": "string",
          "description": "Layer from modality to use as input data",
          "help_text": "Type: `string`, multiple: `False`, example: `\"raw_counts\"`. "
        }
      }
    },
    "outputs": {
      "title": "Outputs",
      "type": "object",
      "description": "No description",
      "properties": {
        "output": {
          "type": "string",
          "format": "path",
          "description": "Output h5mu file.",
          "help_text": "Type: `file`, multiple: `False`, default: `\"$id.$key.output.h5mu\"`, direction: `output`, example: `\"output.h5mu\"`. ",
          "default": "$id.$key.output.h5mu"
        },
        "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"
          ]
        }
      }
    },
    "metrics added to .obs": {
      "title": "Metrics added to .obs",
      "type": "object",
      "description": "No description",
      "properties": {
        "var_qc_metrics": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Keys to select a boolean (containing only True or False) column from .var.\nFor each cell, calculate the proportion of total values for genes which are labeled 'True', \ncompared to the total sum of the values for all genes.\n",
          "help_text": "Type: `string`, multiple: `True`, example: `[\"ercc,highly_variable,mitochondrial\"]`. "
        },
        "var_qc_metrics_fill_na_value": {
          "type": "boolean",
          "description": "Fill any 'NA' values found in the columns specified with --var_qc_metrics to 'True' or 'False'.\nas False.\n",
          "help_text": "Type: `boolean`, multiple: `False`. "
        },
        "top_n_vars": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Number of top vars to be used to calculate cumulative proportions.\nIf not specified, proportions are not calculated",
          "help_text": "Type: `integer`, multiple: `True`. "
        },
        "output_obs_num_nonzero_vars": {
          "type": "string",
          "description": "Name of column in .obs describing, for each observation, the number of stored values\n(including explicit zeroes)",
          "help_text": "Type: `string`, multiple: `False`, default: `\"num_nonzero_vars\"`. ",
          "default": "num_nonzero_vars"
        },
        "output_obs_total_counts_vars": {
          "type": "string",
          "description": "Name of the column for .obs describing, for each observation (row),\nthe sum of the stored values in the columns.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"total_counts\"`. ",
          "default": "total_counts"
        }
      }
    },
    "metrics added to .var": {
      "title": "Metrics added to .var",
      "type": "object",
      "description": "No description",
      "properties": {
        "output_var_num_nonzero_obs": {
          "type": "string",
          "description": "Name of column describing, for each feature, the number of stored values\n(including explicit zeroes)",
          "help_text": "Type: `string`, multiple: `False`, default: `\"num_nonzero_obs\"`. ",
          "default": "num_nonzero_obs"
        },
        "output_var_total_counts_obs": {
          "type": "string",
          "description": "Name of the column in .var describing, for each feature (column),\nthe sum of the stored values in the rows.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"total_counts\"`. ",
          "default": "total_counts"
        },
        "output_var_obs_mean": {
          "type": "string",
          "description": "Name of the column in .obs providing the mean of the values in each row.\n",
          "help_text": "Type: `string`, multiple: `False`, default: `\"obs_mean\"`. ",
          "default": "obs_mean"
        },
        "output_var_pct_dropout": {
          "type": "string",
          "description": "Name of the column in .obs providing for each feature the percentage of\nobservations the feature does not appear on (i.e",
          "help_text": "Type: `string`, multiple: `False`, default: `\"pct_dropout\"`. ",
          "default": "pct_dropout"
        }
      }
    },
    "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/metrics added to .obs"
    },
    {
      "$ref": "#/$defs/metrics added to .var"
    },
    {
      "$ref": "#/$defs/nextflow input-output arguments"
    }
  ]
}
